From 07098338861568e44f58f5d9871c0505135d2987 Mon Sep 17 00:00:00 2001 From: 4t4nner <28292794+4t4nner@users.noreply.github.com> Date: Fri, 7 Oct 2022 16:59:43 +0700 Subject: [PATCH 1/2] todo --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 22344c37..b801e4cd 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,17 @@ # Git History, Search and More (including _git log_) +// todo: +// server/apiController.ts:190 +/* +case 'goto': + await await this.commandManager.executeCommand('git.openFileInViewer', committedFile.uri); + break; +*/ +// src/components/LogView/Commit/FileEntry/index.tsx:88 +/* + this.props.onAction(this.props.committedFile, 'goto')}>{this.props.committedFile.relativePath} +*/ + * View and search git log along with the graph and details. * View a previous copy of the file. * View and search the history From baceb16144929646344a95812fc1b3f85acb4ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9A=D0=BE=D0=B6=D0=B5?= =?UTF-8?q?=D0=B2=D0=BD=D0=B8=D0=BA=D0=BE=D0=B2?= Date: Sun, 9 Oct 2022 21:12:05 +0700 Subject: [PATCH 2/2] add clickable link to file in FileEntry --- README.md | 12 ------------ .../components/LogView/Commit/FileEntry/index.tsx | 10 +++++++++- src/server/apiController.ts | 6 ++++++ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index b801e4cd..22344c37 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,5 @@ # Git History, Search and More (including _git log_) -// todo: -// server/apiController.ts:190 -/* -case 'goto': - await await this.commandManager.executeCommand('git.openFileInViewer', committedFile.uri); - break; -*/ -// src/components/LogView/Commit/FileEntry/index.tsx:88 -/* - this.props.onAction(this.props.committedFile, 'goto')}>{this.props.committedFile.relativePath} -*/ - * View and search git log along with the graph and details. * View a previous copy of the file. * View and search the history diff --git a/browser/src/components/LogView/Commit/FileEntry/index.tsx b/browser/src/components/LogView/Commit/FileEntry/index.tsx index aefee245..91043a67 100644 --- a/browser/src/components/LogView/Commit/FileEntry/index.tsx +++ b/browser/src/components/LogView/Commit/FileEntry/index.tsx @@ -85,7 +85,15 @@ export class FileEntry extends React.Component { {oldFile} {constFileMovementSymbol} - {this.props.committedFile.relativePath} + this.props.onAction(this.props.committedFile, 'goto')} + > + {this.props.committedFile.relativePath} +
diff --git a/src/server/apiController.ts b/src/server/apiController.ts index d3f06ed4..c853d13e 100644 --- a/src/server/apiController.ts +++ b/src/server/apiController.ts @@ -205,6 +205,12 @@ export class ApiController { case 'history': await this.commandManager.executeCommand('git.viewFileHistory', Uri.file(committedFile.uri.path)); break; + case 'goto': + await await this.commandManager.executeCommand( + 'git.openFileInViewer', + Uri.file(committedFile.uri.path), + ); + break; } return committedFile;