Skip to content

Commit 0e68be4

Browse files
committed
Prettiers
1 parent 8d0345a commit 0e68be4

File tree

5 files changed

+44
-27
lines changed

5 files changed

+44
-27
lines changed

src/webviews/apps/settings/partials/autolinks.html

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
<section id="autolinks" class="section--settings section--collapsible">
22
<div class="section__header">
33
<h2>Autolinks</h2>
4-
<p class="section__header-hint">Use autolinks to identify external references, like Jira issues or Zendesk tickets, in your commit messages and convert them to clickable links.</p>
4+
<p class="section__header-hint">
5+
Use autolinks to identify external references, like Jira issues or Zendesk tickets, in your commit messages
6+
and convert them to clickable links.
7+
</p>
58
</div>
69

710
<div class="section__collapsible">
811
<div class="section__group">
912
<div class="section__preview mb-0">
10-
<img class="image__preview image__preview--fit" src="#{webroot}/media/hovers-autolink.webp" loading="lazy" width="329" height="112">
13+
<img
14+
class="image__preview image__preview--fit"
15+
src="#{webroot}/media/hovers-autolink.webp"
16+
loading="lazy"
17+
width="329"
18+
height="112"
19+
/>
1120
</div>
1221
</div>
1322
<div class="section__group">
1423
<div class="section__content">
1524
<div class="setting-list" data-component="autolinks"></div>
1625
<p class="mb-0">
17-
<button class="button button--compact button--flat m-0" type="button" data-action="show" data-action-target="autolink">Add autolink</button>
26+
<button
27+
class="button button--compact button--flat m-0"
28+
type="button"
29+
data-action="show"
30+
data-action-target="autolink"
31+
>
32+
Add autolink
33+
</button>
1834
</p>
1935
</div>
2036
</div>

src/webviews/apps/settings/settings.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,7 @@ <h2>Jump to</h2>
274274
</li>
275275

276276
<li class="mt-1">
277-
<a
278-
class="sidebar__jump-link"
279-
data-action="jump"
280-
href="#autolinks"
281-
title="Jump to Autolinks"
277+
<a class="sidebar__jump-link" data-action="jump" href="#autolinks" title="Jump to Autolinks"
282278
>Autolinks</a
283279
>
284280
</li>

src/webviews/apps/settings/settings.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,13 +730,13 @@ section {
730730
// background-color: var(--color-button-secondary-background);
731731

732732
&:hover {
733-
border-color:var(--color-background--lighten-30);
733+
border-color: var(--color-background--lighten-30);
734734
}
735735
}
736736

737737
&__control:checked + .toggle-button__label {
738738
background-color: var(--color-background--lighten-30);
739-
border-color:var(--color-background--lighten-30);
739+
border-color: var(--color-background--lighten-30);
740740
}
741741

742742
&__control:focus + .toggle-button__label {

src/webviews/apps/settings/settings.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export class SettingsApp extends AppWithConfig<State> {
250250
`;
251251

252252
const autolinkTemplate = (index: number, autolink?: AutolinkReference, isNew = false, renderHelp = true) => `
253-
<div class="setting${ isNew ? ' hidden" data-region="autolink' : ''}">
253+
<div class="setting${isNew ? ' hidden" data-region="autolink' : ''}">
254254
<div class="setting__group">
255255
<div class="setting__input setting__input--short setting__input--with-actions">
256256
<label for="autolinks.${index}.prefix">Prefix</label>
@@ -260,7 +260,7 @@ export class SettingsApp extends AppWithConfig<State> {
260260
placeholder="TICKET-"
261261
data-setting
262262
data-setting-type="arrayObject"
263-
${ autolink?.prefix ? `value="${encodeURIComponent(autolink.prefix)}"` : ''}
263+
${autolink?.prefix ? `value="${encodeURIComponent(autolink.prefix)}"` : ''}
264264
>
265265
<div class="setting__input-actions">
266266
<div class="toggle-button">
@@ -271,7 +271,7 @@ export class SettingsApp extends AppWithConfig<State> {
271271
class="toggle-button__control"
272272
data-setting
273273
data-setting-type="arrayObject"
274-
${ autolink?.ignoreCase ? 'checked' : ''}
274+
${autolink?.ignoreCase ? 'checked' : ''}
275275
>
276276
<label class="toggle-button__label" for="autolinks.${index}.ignoreCase" title="Case-sensitive" aria-label="Case-sensitive">Aa</label>
277277
</div>
@@ -283,7 +283,7 @@ export class SettingsApp extends AppWithConfig<State> {
283283
class="toggle-button__control"
284284
data-setting
285285
data-setting-type="arrayObject"
286-
${ autolink?.alphanumeric ? 'checked' : ''}
286+
${autolink?.alphanumeric ? 'checked' : ''}
287287
>
288288
<label class="toggle-button__label" for="autolinks.${index}.alphanumeric" title="Alphanumeric" aria-label="Alphanumeric">a1</label>
289289
</div>
@@ -298,9 +298,11 @@ export class SettingsApp extends AppWithConfig<State> {
298298
placeholder="https://example.com/TICKET?q=&lt;num&gt;"
299299
data-setting
300300
data-setting-type="arrayObject"
301-
${ autolink?.url ? `value="${encodeURIComponent(autolink.url)}"` : ''}
301+
${autolink?.url ? `value="${encodeURIComponent(autolink.url)}"` : ''}
302302
>
303-
${ isNew ? `
303+
${
304+
isNew
305+
? `
304306
<button
305307
class="button button--compact button--flat-subtle"
306308
type="button"
@@ -310,7 +312,8 @@ export class SettingsApp extends AppWithConfig<State> {
310312
title="Delete"
311313
aria-label="Delete"
312314
><i class="codicon codicon-close"></i></button>
313-
` : `
315+
`
316+
: `
314317
<button
315318
id="autolinks.${index}.delete"
316319
name="autolinks.${index}.delete"
@@ -321,10 +324,11 @@ export class SettingsApp extends AppWithConfig<State> {
321324
title="Delete"
322325
aria-label="Delete"
323326
><i class="codicon codicon-close"></i></button>
324-
`}
327+
`
328+
}
325329
</div>
326330
</div>
327-
${ renderHelp && isNew ? helpTemplate() : ''}
331+
${renderHelp && isNew ? helpTemplate() : ''}
328332
</div>
329333
`;
330334

@@ -337,7 +341,7 @@ export class SettingsApp extends AppWithConfig<State> {
337341
fragment.push(autolinkTemplate(this.state.config.autolinks?.length ?? 0, undefined, true, !autolinks));
338342

339343
if (autolinks) {
340-
fragment.push( helpTemplate());
344+
fragment.push(helpTemplate());
341345
}
342346

343347
$root.innerHTML = fragment.join('');

src/webviews/apps/shared/appWithConfigBase.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ export abstract class AppWithConfig<State extends AppStateWithConfig> extends Ap
5757
'input',
5858
(e, target: HTMLInputElement) => this.onInputChanged(target),
5959
),
60-
DOM.on(
61-
'button[data-setting-clear]',
62-
'click',
63-
(e, target: HTMLButtonElement) => this.onButtonClicked(target),
60+
DOM.on('button[data-setting-clear]', 'click', (e, target: HTMLButtonElement) =>
61+
this.onButtonClicked(target),
6462
),
6563
DOM.on('select[data-setting]', 'change', (e, target: HTMLSelectElement) => this.onInputSelected(target)),
6664
DOM.on('.token[data-token]', 'mousedown', (e, target: HTMLElement) => this.onTokenMouseDown(target, e)),
@@ -138,19 +136,22 @@ export abstract class AppWithConfig<State extends AppStateWithConfig> extends Ap
138136
setting[index] = settingItem;
139137
}
140138

141-
set(setting[index], objectProps.join('.'), element.type === 'number' && value != null ? Number(value) : value);
139+
set(
140+
setting[index],
141+
objectProps.join('.'),
142+
element.type === 'number' && value != null ? Number(value) : value,
143+
);
142144

143145
this._changes[settingName] = setting;
144146
} else {
145147
this._changes[element.name] = element.type === 'number' && value != null ? Number(value) : value;
146148
}
147149

148-
149150
// this.setAdditionalSettings(element.checked ? element.dataset.addSettingsOn : element.dataset.addSettingsOff);
150151
this.applyChanges();
151152
}
152153

153-
protected onButtonClicked(element:HTMLButtonElement) {
154+
protected onButtonClicked(element: HTMLButtonElement) {
154155
if (element.dataset.settingType === 'arrayObject') {
155156
const props = element.name.split('.');
156157
const settingName = props[0];

0 commit comments

Comments
 (0)