From 9b0126d0da28591a55ce8b304f1e1ca62d160b93 Mon Sep 17 00:00:00 2001 From: Keith Daulton Date: Thu, 9 Nov 2023 22:17:11 -0500 Subject: [PATCH] Implements cloud patch icons --- package.json | 2 +- .../commitDetails/components/gl-commit-details.ts | 2 ++ .../commitDetails/components/gl-details-base.ts | 27 ++++++++++++++-------- .../commitDetails/components/gl-wip-details.ts | 4 +++- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 7efaac3..32d923b 100644 --- a/package.json +++ b/package.json @@ -15391,7 +15391,7 @@ "name": "Patch", "when": "!gitlens:untrusted && config.gitlens.cloudPatches.enabled && gitlens:views:patchDetails:mode", "contextualTitle": "GL", - "icon": "$(gitlens-commit-view)", + "icon": "$(gitlens-cloud-patch)", "initialSize": 24 }, { diff --git a/src/webviews/apps/commitDetails/components/gl-commit-details.ts b/src/webviews/apps/commitDetails/components/gl-commit-details.ts index 525fb31..c3fcb00 100644 --- a/src/webviews/apps/commitDetails/components/gl-commit-details.ts +++ b/src/webviews/apps/commitDetails/components/gl-commit-details.ts @@ -19,6 +19,8 @@ interface ExplainState { @customElement('gl-commit-details') export class GlCommitDetails extends GlDetailsBase { + override readonly tab = 'commit'; + @property({ type: Object }) state?: Serialized; diff --git a/src/webviews/apps/commitDetails/components/gl-details-base.ts b/src/webviews/apps/commitDetails/components/gl-details-base.ts index aa47868..2cee5ca 100644 --- a/src/webviews/apps/commitDetails/components/gl-details-base.ts +++ b/src/webviews/apps/commitDetails/components/gl-details-base.ts @@ -12,6 +12,8 @@ type File = Files[0]; type Mode = 'commit' | 'stash' | 'wip'; export class GlDetailsBase extends LitElement { + readonly tab: 'wip' | 'commit' = 'commit'; + @property({ type: Array }) files?: Files; @@ -30,16 +32,21 @@ export class GlDetailsBase extends LitElement { return html` ${label} - + ${when( + this.tab === 'wip', + () => + html` `, + )} `; } diff --git a/src/webviews/apps/commitDetails/components/gl-wip-details.ts b/src/webviews/apps/commitDetails/components/gl-wip-details.ts index f884363..d2d3bba 100644 --- a/src/webviews/apps/commitDetails/components/gl-wip-details.ts +++ b/src/webviews/apps/commitDetails/components/gl-wip-details.ts @@ -7,6 +7,8 @@ import { GlDetailsBase } from './gl-details-base'; @customElement('gl-wip-details') export class GlWipDetails extends GlDetailsBase { + override readonly tab = 'wip'; + @property({ type: Object }) wip?: Wip; @@ -46,7 +48,7 @@ export class GlWipDetails extends GlDetailsBase { aria-label="Share as Cloud Patch" title="Share as Cloud Patch" > - + Share