Skip to content

Commit 755ef07

Browse files
committed
Fix prettier
(#4481, #4473)
1 parent f640c13 commit 755ef07

File tree

5 files changed

+65
-35
lines changed

5 files changed

+65
-35
lines changed

src/commands/resets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class ResetCommand extends GlCommandBase {
103103
{
104104
label: 'Promo Opt-Ins...',
105105
detail: 'Clears any locally stored promo opt-ins',
106-
item: 'promoOptIns'
106+
item: 'promoOptIns',
107107
},
108108
);
109109
}

src/plus/gk/subscriptionService.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,16 +1682,17 @@ export class SubscriptionService implements Disposable {
16821682
try {
16831683
if (hasAccount) {
16841684
try {
1685-
const token = await this.container.accountAuthentication.getExchangeToken(
1686-
AiAllAccessOptInPathPrefix,
1687-
);
1685+
const token =
1686+
await this.container.accountAuthentication.getExchangeToken(AiAllAccessOptInPathPrefix);
16881687
query.set('token', token);
16891688
} catch (ex) {
16901689
Logger.error(ex, scope);
16911690
}
16921691
} else {
16931692
const callbackUri = await env.asExternalUri(
1694-
Uri.parse(`${env.uriScheme}://${this.container.context.extension.id}/${AiAllAccessOptInPathPrefix}`),
1693+
Uri.parse(
1694+
`${env.uriScheme}://${this.container.context.extension.id}/${AiAllAccessOptInPathPrefix}`,
1695+
),
16951696
);
16961697
query.set('redirect_uri', callbackUri.toString(true));
16971698
}
@@ -1700,7 +1701,7 @@ export class SubscriptionService implements Disposable {
17001701
this.container.telemetry.sendEvent('aiAllAccess/opened', undefined, source);
17011702
}
17021703

1703-
if(!(await openUrl(this.container.urls.getGkDevUrl('all-access', query)))) {
1704+
if (!(await openUrl(this.container.urls.getGkDevUrl('all-access', query)))) {
17041705
return false;
17051706
}
17061707
} catch (ex) {
@@ -1710,14 +1711,20 @@ export class SubscriptionService implements Disposable {
17101711

17111712
const completionPromises = [
17121713
new Promise<string>(resolve => setTimeout(() => resolve('cancel'), 5 * 60 * 1000)),
1713-
new Promise<string>(resolve => once(this.container.uri.onDidReceiveAiAllAccessOptInUri)(() => resolve(hasAccount ? 'update' : 'login'))),
1714+
new Promise<string>(resolve =>
1715+
once(this.container.uri.onDidReceiveAiAllAccessOptInUri)(() =>
1716+
resolve(hasAccount ? 'update' : 'login'),
1717+
),
1718+
),
17141719
];
17151720

17161721
const action = await Promise.race(completionPromises);
17171722

17181723
if (action === 'update' && hasAccount) {
17191724
void this.checkUpdatedSubscription(source);
1720-
void this.container.storage.store(`gk:promo:${this._session?.account.id ?? '00000000'}:ai:allAccess:dismissed`, true).catch();
1725+
void this.container.storage
1726+
.store(`gk:promo:${this._session?.account.id ?? '00000000'}:ai:allAccess:dismissed`, true)
1727+
.catch();
17211728
void this.container.views.home.refresh();
17221729
}
17231730

@@ -1743,7 +1750,9 @@ export class SubscriptionService implements Disposable {
17431750
await this.loginWithCode({ code: code }, { source: 'subscription' });
17441751
const newSession = await this.getAuthenticationSession();
17451752
if (newSession?.account?.id != null) {
1746-
await this.container.storage.store(`gk:promo:${newSession.account.id}:ai:allAccess:dismissed`, true).catch();
1753+
await this.container.storage
1754+
.store(`gk:promo:${newSession.account.id}:ai:allAccess:dismissed`, true)
1755+
.catch();
17471756
void this.container.views.home.refresh();
17481757
}
17491758
}

src/webviews/apps/home/components/ai-all-access-banner.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,25 @@ export class GlAiAllAccessBanner extends LitElement {
4141

4242
private get shouldShow(): boolean {
4343
// Don't show if dismissed or closed
44-
return !(this._state.aiAllAccessBannerCollapsed);
44+
return !this._state.aiAllAccessBannerCollapsed;
4545
}
4646

4747
private get bodyLabel(): string {
48-
return this.hasAdvancedOrHigher ? 'Opt in now to get unlimited GitKraken AI until July 11th!' : 'Opt in now to try all Advanced GitLens features with unlimited GitKraken AI for FREE until July 11th!';
49-
48+
return this.hasAdvancedOrHigher
49+
? 'Opt in now to get unlimited GitKraken AI until July 11th!'
50+
: 'Opt in now to try all Advanced GitLens features with unlimited GitKraken AI for FREE until July 11th!';
5051
}
5152

5253
private get primaryButtonLabel(): string {
5354
return 'Opt In Now';
5455
}
5556

5657
private get hasAdvancedOrHigher(): boolean {
57-
return this._state.subscription.plan && compareSubscriptionPlans(this._state.subscription.plan.actual.id, 'advanced') >= 0 || compareSubscriptionPlans(this._state.subscription.plan.effective.id, 'advanced') >= 0;
58+
return (
59+
(this._state.subscription.plan &&
60+
compareSubscriptionPlans(this._state.subscription.plan.actual.id, 'advanced') >= 0) ||
61+
compareSubscriptionPlans(this._state.subscription.plan.effective.id, 'advanced') >= 0
62+
);
5863
}
5964

6065
override render(): unknown {
@@ -68,10 +73,7 @@ export class GlAiAllAccessBanner extends LitElement {
6873
banner-title="All Access Week - now until July 11th!"
6974
body="${this.bodyLabel}"
7075
primary-button="${this.primaryButtonLabel}"
71-
primary-button-href="${createCommandLink(
72-
'gitlens.plus.aiAllAccess.optIn',
73-
{ source: 'home' },
74-
)}"
76+
primary-button-href="${createCommandLink('gitlens.plus.aiAllAccess.optIn', { source: 'home' })}"
7577
secondary-button="Dismiss"
7678
@gl-banner-secondary-click=${this.onSecondaryClick}
7779
></gl-banner>

src/webviews/apps/shared/components/banner/banner.css.ts

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,42 @@ export const bannerStyles = css`
5151
var(--gl-banner-primary-emphasis-background) 0%,
5252
var(--gl-banner-secondary-emphasis-background) 100%
5353
);
54-
border: 1px solid color-mix(in lab, var(--gl-banner-primary-emphasis-background) 50%, var(--gl-banner-secondary-emphasis-background) 50%);
54+
border: 1px solid
55+
color-mix(
56+
in lab,
57+
var(--gl-banner-primary-emphasis-background) 50%,
58+
var(--gl-banner-secondary-emphasis-background) 50%
59+
);
5560
}
5661
5762
/* Gradient transparent display mode - same gradient but with transparency */
5863
.banner--gradient-transparent {
5964
background: linear-gradient(
6065
to right,
61-
color-mix(in lab, var(--gl-banner-primary-emphasis-background) calc(100% * (1 - var(--gl-banner-transparency))), transparent) 0%,
62-
color-mix(in lab, var(--gl-banner-secondary-emphasis-background) calc(100% * (1 - var(--gl-banner-transparency))), transparent) 100%
63-
);
64-
border: 1px solid color-mix(
65-
in lab,
66-
color-mix(in lab, var(--gl-banner-primary-emphasis-background) 50%, var(--gl-banner-secondary-emphasis-background) 50%) calc(100% * (1 - var(--gl-banner-transparency))),
67-
transparent
66+
color-mix(
67+
in lab,
68+
var(--gl-banner-primary-emphasis-background) calc(100% * (1 - var(--gl-banner-transparency))),
69+
transparent
70+
)
71+
0%,
72+
color-mix(
73+
in lab,
74+
var(--gl-banner-secondary-emphasis-background) calc(100% * (1 - var(--gl-banner-transparency))),
75+
transparent
76+
)
77+
100%
6878
);
79+
border: 1px solid
80+
color-mix(
81+
in lab,
82+
color-mix(
83+
in lab,
84+
var(--gl-banner-primary-emphasis-background) 50%,
85+
var(--gl-banner-secondary-emphasis-background) 50%
86+
)
87+
calc(100% * (1 - var(--gl-banner-transparency))),
88+
transparent
89+
);
6990
}
7091
7192
.banner__content {
@@ -131,7 +152,11 @@ export const bannerStyles = css`
131152
:host-context(.vscode-light),
132153
:host-context(.vscode-high-contrast-light) {
133154
--gl-banner-primary-emphasis-background: color-mix(in lab, var(--vscode-button-background) 40%, #fff 60%);
134-
--gl-banner-secondary-emphasis-background: color-mix(in lab, var(--vscode-button-secondaryBackground) 40%, #fff 60%);
155+
--gl-banner-secondary-emphasis-background: color-mix(
156+
in lab,
157+
var(--vscode-button-secondaryBackground) 40%,
158+
#fff 60%
159+
);
135160
}
136161
137162
/* Override text color for high contrast light theme specifically */

src/webviews/apps/shared/components/banner/banner.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,13 @@ export class GlBanner extends LitElement {
5353
}
5454

5555
override render(): unknown {
56-
return html`
57-
<div part="base" class=${classMap(this.classNames)}>
58-
${this.renderContent()}
59-
</div>
60-
`;
56+
return html` <div part="base" class=${classMap(this.classNames)}>${this.renderContent()}</div> `;
6157
}
6258

6359
private renderContent() {
6460
return html`
6561
<div class="banner__content">
66-
${this.bannerTitle ? this.renderTitle() : ''}
67-
${this.body ? this.renderBody() : ''}
62+
${this.bannerTitle ? this.renderTitle() : ''} ${this.body ? this.renderBody() : ''}
6863
${this.renderButtons()}
6964
</div>
7065
`;
@@ -86,8 +81,7 @@ export class GlBanner extends LitElement {
8681

8782
return html`
8883
<div class="banner__buttons">
89-
${hasPrimary ? this.renderPrimaryButton() : ''}
90-
${hasSecondary ? this.renderSecondaryButton() : ''}
84+
${hasPrimary ? this.renderPrimaryButton() : ''} ${hasSecondary ? this.renderSecondaryButton() : ''}
9185
</div>
9286
`;
9387
}

0 commit comments

Comments
 (0)