Skip to content

Commit 5efb9ed

Browse files
committed
chore: fixed indention issues
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 523670d commit 5efb9ed

File tree

7 files changed

+84
-50
lines changed

7 files changed

+84
-50
lines changed

src/components/NcActionInput/NcActionInput.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ export default {
311311
type: String,
312312
default: 'text',
313313
validator(type) {
314-
return ['date',
314+
return [
315+
'date',
315316
'datetime-local',
316317
'month',
317318
'multiselect',
@@ -324,7 +325,8 @@ export default {
324325
'url',
325326
'week',
326327
'color',
327-
'email'].indexOf(type) > -1
328+
'email',
329+
].includes(type)
328330
},
329331
},
330332

src/components/NcActions/NcActions.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,9 +1888,7 @@ export default {
18881888
},
18891889
],
18901890
},
1891-
[
1892-
renderActionsPopover(menuActions),
1893-
],
1891+
[renderActionsPopover(menuActions)],
18941892
)
18951893
: null,
18961894
],

src/components/NcBreadcrumb/NcBreadcrumb.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,15 @@ export default {
189189
* The attributes to pass to `router-link` or `a`
190190
*/
191191
linkAttributes() {
192-
// If it's a router-link, we pass `to` and `exact`, if its an <a/> element, we pass `href`, otherwise we have a button
193-
return this.to
194-
? { to: this.to, ...this.$attrs }
195-
: (this.href
196-
? { href: this.href, ...this.$attrs }
197-
: this.$attrs
198-
)
192+
// If it's a router-link, we pass `to` and `exact`
193+
if (this.to) {
194+
return { to: this.to, ...this.$attrs }
195+
} else if (this.href) {
196+
// if its an <a/> element, we pass `href`
197+
return { href: this.href, ...this.$attrs }
198+
}
199+
// otherwise we have a button
200+
return this.$attrs
199201
},
200202
},
201203

src/components/NcButton/NcButton.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,9 @@ export type ButtonSize = 'small'
450450
| 'normal'
451451
| 'large'
452452
453-
export type ButtonType
454-
= | 'submit'
455-
| 'reset'
456-
| 'button'
453+
export type ButtonType = 'submit'
454+
| 'reset'
455+
| 'button'
457456
458457
export type ButtonVariant = 'primary'
459458
| 'secondary'

src/components/NcDialog/NcDialog.vue

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -409,25 +409,29 @@ const dialogTagName = computed(() => props.isForm && !hasNavigation.value ? 'for
409409
* Listener to assign to the dialog element
410410
* This only sets the `@submit` listener if the dialog element is a form
411411
*/
412-
const dialogListeners = computed(() => dialogTagName.value === 'form'
413-
? {
412+
const dialogListeners = computed(() => {
413+
if (dialogTagName.value !== 'form') {
414+
return {}
415+
}
416+
417+
return {
414418
/**
415419
* @param event - Form submit event
416420
*/
417-
submit(event: SubmitEvent) {
418-
event.preventDefault()
419-
emit('submit', event)
420-
},
421-
422-
/**
423-
* @param event - Form submit event
424-
*/
425-
reset(event: Event) {
426-
event.preventDefault()
427-
emit('reset', event)
428-
},
429-
}
430-
: {})
421+
submit(event: SubmitEvent) {
422+
event.preventDefault()
423+
emit('submit', event)
424+
},
425+
426+
/**
427+
* @param event - Form submit event
428+
*/
429+
reset(event: Event) {
430+
event.preventDefault()
431+
emit('reset', event)
432+
},
433+
}
434+
})
431435
432436
/**
433437
* If the underlying modal is shown

src/utils/colors.ts

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,56 @@ function mixPalette(steps: number, color1: Color, color2: Color): Color[] {
7474
* Like GenColor(4) but with labels
7575
*/
7676
export const defaultPalette = [
77-
new Color(182, 70, 157, t('Purple')),
78-
new Color(191, 103, 139, t('Rosy brown'), // TRANSLATORS: A color name for RGB(191, 103, 139)
77+
/* eslint-disable @stylistic/function-call-argument-newline -- Allow to put translators comments */
78+
new Color(
79+
182, 70, 157,
80+
t('Purple'),
7981
),
80-
new Color(201, 136, 121, t('Feldspar'), // TRANSLATORS: A color name for RGB(201, 136, 121)
82+
new Color(
83+
191, 103, 139,
84+
t('Rosy brown'), // TRANSLATORS: A color name for RGB(191, 103, 139)
8185
),
82-
new Color(211, 169, 103, t('Whiskey'), // TRANSLATORS: A color name for RGB(211, 169, 103)
86+
new Color(
87+
201, 136, 121,
88+
t('Feldspar'), // TRANSLATORS: A color name for RGB(201, 136, 121)
8389
),
84-
new Color(221, 203, 85, t('Gold')),
85-
new Color(165, 184, 114, t('Olivine'), // TRANSLATORS: A color name for RGB(165, 184, 114)
90+
new Color(
91+
211, 169, 103,
92+
t('Whiskey'), // TRANSLATORS: A color name for RGB(211, 169, 103)
8693
),
87-
new Color(110, 166, 143, t('Acapulco'), // TRANSLATORS: A color name for RGB(110, 166, 143)
94+
new Color(
95+
221, 203, 85,
96+
t('Gold'),
8897
),
89-
new Color(55, 148, 172, t('Boston Blue'), // TRANSLATORS: A color name for RGB(55, 148, 172)
98+
new Color(
99+
165, 184, 114,
100+
t('Olivine'), // TRANSLATORS: A color name for RGB(165, 184, 114)
90101
),
91-
new Color(0, 130, 201, t('Nextcloud blue')),
92-
new Color(45, 115, 190, t('Mariner'), // TRANSLATORS: A color name for RGB(45, 115, 190)
102+
new Color(
103+
110, 166, 143,
104+
t('Acapulco'), // TRANSLATORS: A color name for RGB(110, 166, 143)
93105
),
94-
new Color(91, 100, 179, t('Blue Violet'), // TRANSLATORS: A color name for RGB(91, 100, 179)
106+
new Color(
107+
55, 148, 172,
108+
t('Boston Blue'), // TRANSLATORS: A color name for RGB(55, 148, 172)
95109
),
96-
new Color(136, 85, 168, t('Deluge'), // TRANSLATORS: A color name for RGB(136, 85, 168)
110+
new Color(
111+
0, 130, 201,
112+
t('Nextcloud blue'),
97113
),
114+
new Color(
115+
45, 115, 190,
116+
t('Mariner'), // TRANSLATORS: A color name for RGB(45, 115, 190)
117+
),
118+
new Color(
119+
91, 100, 179,
120+
t('Blue Violet'), // TRANSLATORS: A color name for RGB(91, 100, 179)
121+
),
122+
new Color(
123+
136, 85, 168,
124+
t('Deluge'), // TRANSLATORS: A color name for RGB(136, 85, 168)
125+
),
126+
/* eslint-enable @stylistic/function-call-argument-newline */
98127
]
99128

100129
/**

tests/unit/utils/colors.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ describe('utils: colors', () => {
3838
})
3939

4040
it.each([
41-
42-
[0, 0, 0, '#000000'],
43-
[255, 0, 0, '#ff0000'],
44-
[0, 255, 0, '#00ff00'],
45-
[1, 2, 0, '#010200'],
41+
/* eslint-disable @stylistic/no-multi-spaces, @stylistic/array-bracket-spacing */
42+
[ 0, 0, 0, '#000000'],
43+
[255, 0, 0, '#ff0000'],
44+
[ 0, 255, 0, '#00ff00'],
45+
[ 1, 2, 0, '#010200'],
4646
[512, 999, 256, '#ffffff'],
47-
/* eslint-enabled no-multi-spaces,array-bracket-spacing */
47+
/* eslint-enabled @stylistic/no-multi-spaces, @stylistic/array-bracket-spacing */
4848
])('correctly generated color string', (r: number, g: number, b: number, expected: string) => {
4949
expect(new Color(r, g, b).color).toBe(expected)
5050
})

0 commit comments

Comments
 (0)