Skip to content

Commit 422bafd

Browse files
committed
Updates messaging for Cloud patches security
1 parent 5ca0474 commit 422bafd

File tree

4 files changed

+42
-30
lines changed

4 files changed

+42
-30
lines changed

src/plus/utils.ts

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,35 @@ export async function ensureAccount(title: string, container: Container): Promis
112112
export async function confirmDraftStorage(container: Container): Promise<boolean> {
113113
if (container.storage.get('confirm:draft:storage', false)) return true;
114114

115-
const accept: MessageItem = { title: 'Yes' };
116-
const decline: MessageItem = { title: 'No', isCloseAffordance: true };
117-
const moreInfo: MessageItem = { title: 'More Info' };
118-
const result = await window.showInformationMessage(
119-
`Cloud Patches are securely stored by GitKraken.\n\nDo you want to continue?`,
120-
{ modal: true },
121-
accept,
122-
decline,
123-
moreInfo,
124-
);
125-
126-
if (result === accept) {
127-
void container.storage.store('confirm:draft:storage', true);
128-
return true;
129-
}
115+
while (true) {
116+
const accept: MessageItem = { title: 'Continue' };
117+
const decline: MessageItem = { title: 'Cancel', isCloseAffordance: true };
118+
const moreInfo: MessageItem = { title: 'Learn More' };
119+
const security: MessageItem = { title: 'Security' };
120+
const result = await window.showInformationMessage(
121+
`Cloud Patches are securely stored by GitKraken and can be accessed by anyone with the link and a GitKraken account.`,
122+
{ modal: true },
123+
accept,
124+
moreInfo,
125+
security,
126+
decline,
127+
);
130128

131-
if (result === moreInfo) {
132-
void env.openExternal(Uri.parse('https://help.gitkraken.com/gitlens/security'));
133-
}
129+
if (result === accept) {
130+
void container.storage.store('confirm:draft:storage', true);
131+
return true;
132+
}
134133

135-
return false;
134+
if (result === security) {
135+
void env.openExternal(Uri.parse('https://help.gitkraken.com/gitlens/security'));
136+
continue;
137+
}
138+
139+
if (result === moreInfo) {
140+
void env.openExternal(Uri.parse('https://www.gitkraken.com/solutions/cloud-patches'));
141+
continue;
142+
}
143+
144+
return false;
145+
}
136146
}

src/plus/webviews/patchDetails/patchDetailsWebview.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,13 +339,6 @@ export class PatchDetailsWebviewProvider
339339
return;
340340
}
341341

342-
if (
343-
!(await ensureAccount('Cloud Patches require a GitKraken account.', this.container)) ||
344-
!(await confirmDraftStorage(this.container))
345-
) {
346-
return;
347-
}
348-
349342
const changeset = this._context.draft.changesets?.[0];
350343
if (changeset == null) return;
351344

@@ -413,7 +406,12 @@ export class PatchDetailsWebviewProvider
413406
}
414407

415408
private async createDraft({ title, changesets, description }: CreatePatchParams): Promise<void> {
416-
if (!(await ensureAccount('Cloud patches require a GitKraken account.', this.container))) return;
409+
if (
410+
!(await ensureAccount('Cloud Patches require a GitKraken account.', this.container)) ||
411+
!(await confirmDraftStorage(this.container))
412+
) {
413+
return;
414+
}
417415

418416
const createChanges: CreateDraftChange[] = [];
419417

src/webviews/apps/plus/patchDetails/components/gl-patch-create.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,12 @@ export class GlPatchCreate extends GlTreeBase<GlPatchCreateEvents> {
132132
<gl-button full @click=${this.onCreateAll}>Create Cloud Patch</gl-button>
133133
</span>
134134
</p>
135-
<!-- <p class="h-deemphasize"><code-icon icon="account"></code-icon> Requires a GitKraken account <a href="#">sign-in</a></p>
136-
<p class="h-deemphasize"><code-icon icon="info"></code-icon> <a href="#">Learn more about cloud patches</a></p> -->
135+
<!-- <p class="h-deemphasize"><code-icon icon="account"></code-icon> Requires a GitKraken account <a href="#">sign-in</a></p> -->
136+
<p class="h-deemphasize"><code-icon icon="info"></code-icon> <a href="https://www.gitkraken.com/solutions/cloud-patches" title="Learn more about Cloud Patches"
137+
aria-label="Learn more about GitKraken security">Cloud Patches</a> are <a href="https://help.gitkraken.com/gitlens/security/"
138+
title="Learn more about Cloud Patches"
139+
aria-label="Learn more about GitKraken security">securely stored</a> by GitKraken.
140+
</p>
137141
</div>
138142
`;
139143
}

src/webviews/apps/plus/patchDetails/patchDetails.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ textarea.message-input__control {
130130
}
131131
&-deemphasize {
132132
margin: 0.8rem 0 0.4rem;
133-
opacity: 0.8;
133+
opacity: 0.7;
134134
}
135135
&-no-border {
136136
--vscode-sideBarSectionHeader-border: transparent;

0 commit comments

Comments
 (0)