Skip to content

Commit 0c7acb9

Browse files
linter
1 parent e666b07 commit 0c7acb9

File tree

4 files changed

+94
-96
lines changed

4 files changed

+94
-96
lines changed

src/components/ListCategoryNew.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
@trailing-button-click="newCategoryName = ''" />
1010

1111
<NcButton type="tertiary"
12-
:aria-label="t('grocerylist', 'Add category {category}', { category: newCategoryName })"
13-
@click="addCategory">
12+
:aria-label="t('grocerylist', 'Add category {category}', { category: newCategoryName })"
13+
@click="addCategory">
1414
<template #icon>
1515
<IconPlus :size="20" />
1616
</template>

src/components/NavigationGroceryListItem.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
{{ t('grocerylist', 'Delete list') }}
1717
</NcActionButton>
1818
</template>
19-
<template #counter v-if="groceryList.uncheckedCount > 0">
20-
<NcCounterBubble>
21-
{{ groceryList.uncheckedCount }}
22-
</NcCounterBubble>
23-
</template>
19+
<template v-if="groceryList.uncheckedCount > 0" #counter>
20+
<NcCounterBubble>
21+
{{ groceryList.uncheckedCount }}
22+
</NcCounterBubble>
23+
</template>
2424
</NcAppNavigationItem>
2525
</template>
2626
<script>
2727
import { showError, showInfo, showSuccess } from '@nextcloud/dialogs'
2828
import {
2929
NcActionButton,
3030
NcAppNavigationItem,
31-
NcCounterBubble,
31+
NcCounterBubble,
3232
} from '@nextcloud/vue'
3333
import axios from '@nextcloud/axios'
3434
import { generateUrl } from '@nextcloud/router'
@@ -38,7 +38,7 @@ export default {
3838
components: {
3939
NcActionButton,
4040
NcAppNavigationItem,
41-
NcCounterBubble
41+
NcCounterBubble,
4242
},
4343
props: {
4444
groceryList: {
@@ -63,14 +63,14 @@ export default {
6363
},
6464
title() {
6565
return this.groceryList.title
66-
},
67-
titleWithCount() {
68-
if (this.groceryList.uncheckedCount > 0) {
69-
return this.groceryList.title + ' (' + this.groceryList.uncheckedCount + ')'
70-
} else {
71-
return this.groceryList.title
72-
}
73-
},
66+
},
67+
titleWithCount() {
68+
if (this.groceryList.uncheckedCount > 0) {
69+
return this.groceryList.title + ' (' + this.groceryList.uncheckedCount + ')'
70+
} else {
71+
return this.groceryList.title
72+
}
73+
},
7474
},
7575
methods: {
7676
async onRename(newTitle) {

src/views/GroceryList.vue

Lines changed: 71 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,47 @@
11
<template>
22
<div class="page-wrapper">
3-
<div>
4-
<NcButton aria-label="Show add/edit modal"
5-
@click="showAddModal">
6-
<template #icon>
7-
<Plus :size="20"/>
8-
</template>
9-
<template>Add</template>
10-
</NcButton>
11-
</div>
3+
<div>
4+
<NcButton aria-label="Show add/edit modal"
5+
@click="showAddModal">
6+
<template #icon>
7+
<Plus :size="20" />
8+
</template>
9+
<template>Add</template>
10+
</NcButton>
11+
</div>
1212
<h1>{{ groceryList?.title ?? t('grocerylist', 'Grocery list') }}</h1>
1313
<div>
1414
<NcCheckboxRadioSwitch :checked="!!groceryList?.showOnlyUnchecked" type="switch" @update:checked="toggleVisibility">
1515
{{ t('grocerylist', 'Show only unchecked') }}
1616
</NcCheckboxRadioSwitch>
17-
<NcModal
18-
v-if="modal"
19-
ref="modalRef"
20-
:name="t('grocerylist', 'Add item')"
17+
<NcModal v-if="modal"
18+
ref="modalRef"
19+
:name="t('grocerylist', 'Add item')"
2120
@close="closeModal">
2221
<form class="modal__content"
2322
@submit.prevent="onSaveItem()">
2423
<p class="quantityRow">
2524
<NcTextField :value.sync="newItemQuantity"
2625
label="Quantity…"
27-
@keyup.up="increaseQuantity()"
28-
@keyup.down="decreaseQuantity()"
29-
/>
30-
<NcButton aria-label="Increase quantity"
31-
style="display:inline-block;"
32-
type="tertiary"
33-
@click="increaseQuantity()">
34-
<template #icon>
35-
<Plus :size="20"/>
36-
</template>
37-
</NcButton>
38-
<NcButton aria-label="Decrease quantity"
39-
style="display:inline-block;"
40-
type="tertiary"
41-
@click="decreaseQuantity()">
42-
<template #icon>
43-
<Minus :size="20"/>
44-
</template>
45-
</NcButton>
46-
</p>
26+
@keyup.up="increaseQuantity()"
27+
@keyup.down="decreaseQuantity()" />
28+
<NcButton aria-label="Increase quantity"
29+
style="display:inline-block;"
30+
type="tertiary"
31+
@click="increaseQuantity()">
32+
<template #icon>
33+
<Plus :size="20" />
34+
</template>
35+
</NcButton>
36+
<NcButton aria-label="Decrease quantity"
37+
style="display:inline-block;"
38+
type="tertiary"
39+
@click="decreaseQuantity()">
40+
<template #icon>
41+
<Minus :size="20" />
42+
</template>
43+
</NcButton>
44+
</p>
4745
<p>
4846
<NcTextField :value.sync="newItemName"
4947
label="Item…"
@@ -141,17 +139,17 @@ import { ref } from 'vue'
141139
export default {
142140
name: 'GroceryList',
143141
144-
components: {
145-
NcCheckboxRadioSwitch,
146-
NcSelect,
147-
NcButton,
148-
AlarmSnooze,
149-
NcTextField,
150-
Plus,
151-
Minus,
152-
Delete,
153-
NcModal,
154-
},
142+
components: {
143+
NcCheckboxRadioSwitch,
144+
NcSelect,
145+
NcButton,
146+
AlarmSnooze,
147+
NcTextField,
148+
Plus,
149+
Minus,
150+
Delete,
151+
NcModal,
152+
},
155153
156154
props: {
157155
listId: {
@@ -381,37 +379,37 @@ export default {
381379
this.newItemCategory = this.allCategories.find(i => i.id === item.category)
382380
this.modal = true
383381
},
384-
increaseQuantity() {
385-
if (this.newItemQuantity === '') {
386-
this.newItemQuantity = 0
387-
}
382+
increaseQuantity() {
383+
if (this.newItemQuantity === '') {
384+
this.newItemQuantity = 0
385+
}
388386
389-
if (this.newItemQuantity >= 1000) {
390-
this.newItemQuantity = this.newItemQuantity + 1000
391-
} else if (this.newItemQuantity >= 100) {
392-
this.newItemQuantity = this.newItemQuantity + 100
393-
} else if (this.newItemQuantity >= 10) {
394-
this.newItemQuantity = this.newItemQuantity + 10
395-
} else {
396-
this.newItemQuantity = this.newItemQuantity + 1
397-
}
398-
},
399-
decreaseQuantity() {
400-
if (this.newItemQuantity > 1000) {
401-
this.newItemQuantity = this.newItemQuantity - 1000
402-
} else if (this.newItemQuantity > 100) {
403-
this.newItemQuantity = this.newItemQuantity - 100
404-
} else if (this.newItemQuantity > 10) {
405-
this.newItemQuantity = this.newItemQuantity - 10
406-
} else if (this.newItemQuantity > 1) {
407-
this.newItemQuantity = this.newItemQuantity - 1
408-
} else {
409-
this.newItemQuantity = ''
410-
}
411-
},
387+
if (this.newItemQuantity >= 1000) {
388+
this.newItemQuantity = this.newItemQuantity + 1000
389+
} else if (this.newItemQuantity >= 100) {
390+
this.newItemQuantity = this.newItemQuantity + 100
391+
} else if (this.newItemQuantity >= 10) {
392+
this.newItemQuantity = this.newItemQuantity + 10
393+
} else {
394+
this.newItemQuantity = this.newItemQuantity + 1
395+
}
396+
},
397+
decreaseQuantity() {
398+
if (this.newItemQuantity > 1000) {
399+
this.newItemQuantity = this.newItemQuantity - 1000
400+
} else if (this.newItemQuantity > 100) {
401+
this.newItemQuantity = this.newItemQuantity - 100
402+
} else if (this.newItemQuantity > 10) {
403+
this.newItemQuantity = this.newItemQuantity - 10
404+
} else if (this.newItemQuantity > 1) {
405+
this.newItemQuantity = this.newItemQuantity - 1
406+
} else {
407+
this.newItemQuantity = ''
408+
}
409+
},
412410
async onSaveItem() {
413-
if (this.newItemName === "") {
414-
showInfo("Cannot add empty item!")
411+
if (this.newItemName === '') {
412+
showInfo('Cannot add empty item!')
415413
return
416414
}
417415

src/views/ListSettings.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
<ListCategoryNew :list-id="listId" />
2020

21-
<!-- <h2>{{ t('grocerylist', 'Shares') }}</h2>-->
22-
<!-- <span v-for="sharee in sharees" :key="sharee.userId">-->
23-
<!-- <ul>-->
24-
<!-- <li>{{ sharee.userId }}</li>-->
25-
<!-- </ul>-->
26-
<!-- </span>-->
21+
<!-- <h2>{{ t('grocerylist', 'Shares') }}</h2>-->
22+
<!-- <span v-for="sharee in sharees" :key="sharee.userId">-->
23+
<!-- <ul>-->
24+
<!-- <li>{{ sharee.userId }}</li>-->
25+
<!-- </ul>-->
26+
<!-- </span>-->
2727
</div>
2828
</template>
2929

0 commit comments

Comments
 (0)