Skip to content

Commit 06af232

Browse files
committed
run lint:fix
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent 4bd1a38 commit 06af232

32 files changed

Lines changed: 386 additions & 390 deletions

src/Forms.vue

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-->
55

66
<template>
7-
<NcContent app-name="forms">
7+
<NcContent appName="forms">
88
<NcAppNavigation
99
v-if="canCreateForms || hasForms"
1010
:aria-label="t('forms', 'Forms navigation')">
@@ -20,17 +20,17 @@
2020
<!-- Form-Owner-->
2121
<template v-if="ownedForms.length > 0">
2222
<NcAppNavigationCaption
23-
is-heading
23+
isHeading
2424
class="forms-navigation__list-heading"
25-
heading-id="forms-navigation-your-forms"
25+
headingId="forms-navigation-your-forms"
2626
:name="t('forms', 'Your forms')" />
2727
<ul aria-labelledby="forms-navigation-your-forms">
2828
<AppNavigationForm
2929
v-for="form in ownedForms"
3030
:key="form.id"
3131
:form="form"
32-
@open-sharing="openSharing"
33-
@mobile-close-navigation="mobileCloseNavigation"
32+
@openSharing="openSharing"
33+
@mobileCloseNavigation="mobileCloseNavigation"
3434
@clone="onCloneForm"
3535
@delete="onDeleteForm" />
3636
</ul>
@@ -39,18 +39,18 @@
3939
<!-- Shared Forms-->
4040
<template v-if="sharedForms.length > 0">
4141
<NcAppNavigationCaption
42-
is-heading
42+
isHeading
4343
class="forms-navigation__list-heading"
44-
heading-id="forms-navigation-shared-forms"
44+
headingId="forms-navigation-shared-forms"
4545
:name="t('forms', 'Shared with you')" />
4646
<ul aria-labelledby="forms-navigation-shared-forms">
4747
<AppNavigationForm
4848
v-for="form in sharedForms"
4949
:key="form.id"
5050
:form="form"
51-
read-only
52-
@open-sharing="openSharing"
53-
@mobile-close-navigation="mobileCloseNavigation" />
51+
readOnly
52+
@openSharing="openSharing"
53+
@mobileCloseNavigation="mobileCloseNavigation" />
5454
</ul>
5555
</template>
5656

@@ -119,16 +119,16 @@
119119
<template v-else>
120120
<router-view
121121
:form="selectedForm"
122-
:sidebar-opened="sidebarOpened"
122+
:sidebarOpened="sidebarOpened"
123123
@update:form="updateSelectedForm"
124-
@update:sidebar-opened="sidebarOpened = $event"
125-
@open-sharing="openSharing" />
124+
@update:sidebarOpened="sidebarOpened = $event"
125+
@openSharing="openSharing" />
126126
<Sidebar
127127
v-if="!selectedForm.partial && canEdit"
128128
:form="selectedForm"
129-
:sidebar-opened="sidebarOpened"
129+
:sidebarOpened="sidebarOpened"
130130
:active="sidebarActive"
131-
@update:sidebar-opened="sidebarOpened = $event"
131+
@update:sidebarOpened="sidebarOpened = $event"
132132
@update:active="sidebarActive = $event" />
133133
</template>
134134

@@ -207,6 +207,35 @@ export default {
207207
208208
const PERMISSION_TYPES = PermissionTypes.data().PERMISSION_TYPES
209209
210+
const routeHash = computed(() => route.params.hash)
211+
212+
const routeAllowed = computed(() => {
213+
if (loading.value && loadState(appName, 'formId') === 'invalid') {
214+
return false
215+
}
216+
217+
if (!routeHash.value) {
218+
return false
219+
}
220+
221+
const form = [...forms.value, ...allSharedForms.value].find(
222+
(form) => form.hash === routeHash.value,
223+
)
224+
225+
if (form === undefined) {
226+
fetchPartialForm(routeHash.value)
227+
return false
228+
}
229+
230+
if (route.name === 'results') {
231+
return (
232+
form.permissions.includes(route.name) || form.submissionCount > 0
233+
)
234+
}
235+
236+
return form?.permissions.includes(route.name)
237+
})
238+
210239
const selectedForm = computed(() => {
211240
if (routeAllowed.value) {
212241
return (
@@ -263,36 +292,6 @@ export default {
263292
)
264293
})
265294
266-
const routeHash = computed(() => route.params.hash)
267-
268-
const routeAllowed = computed(() => {
269-
if (loading.value && loadState(appName, 'formId') === 'invalid') {
270-
return false
271-
}
272-
273-
if (!routeHash.value) {
274-
return false
275-
}
276-
277-
const form = [...forms.value, ...allSharedForms.value].find(
278-
(form) => form.hash === routeHash.value,
279-
)
280-
281-
if (form === undefined) {
282-
fetchPartialForm(routeHash.value)
283-
return false
284-
}
285-
286-
if (route.name === 'results') {
287-
return (
288-
form.permissions.includes(route.name)
289-
|| form.submissionCount > 0
290-
)
291-
}
292-
293-
return form?.permissions.includes(route.name)
294-
})
295-
296295
const mobileCloseNavigation = () => {
297296
if (isMobile.value) {
298297
emit('toggle-navigation', { open: false })
@@ -341,7 +340,12 @@ export default {
341340
loading.value = false
342341
}
343342
344-
const fetchPartialForm = async (hash) => {
343+
/**
344+
* Fetch a partial form by its hash after initial load completes.
345+
*
346+
* @param {string} hash The hash of the form to fetch.
347+
*/
348+
async function fetchPartialForm(hash) {
345349
await new Promise((resolve) => {
346350
const wait = () => {
347351
if (loading.value) {

src/FormsEmptyContent.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-->
55

66
<template>
7-
<NcContent app-name="forms">
7+
<NcContent appName="forms">
88
<NcAppContent class="forms-emptycontent">
99
<NcEmptyContent
1010
:name="currentModel.title"

src/FormsSettings.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
v-model="appConfig.restrictCreation"
1212
class="forms-settings__creation__switch"
1313
type="switch"
14-
@update:model-value="onRestrictCreationChange">
14+
@update:modelValue="onRestrictCreationChange">
1515
{{ t('forms', 'Restrict form creation to selected groups') }}
1616
</NcCheckboxRadioSwitch>
1717
<NcSelect
@@ -29,21 +29,21 @@
2929
ref="switchAllowPublicLink"
3030
v-model="appConfig.allowPublicLink"
3131
type="switch"
32-
@update:model-value="onAllowPublicLinkChange">
32+
@update:modelValue="onAllowPublicLinkChange">
3333
{{ t('forms', 'Allow sharing by link') }}
3434
</NcCheckboxRadioSwitch>
3535
<NcCheckboxRadioSwitch
3636
ref="switchAllowPermitAll"
3737
v-model="appConfig.allowPermitAll"
3838
type="switch"
39-
@update:model-value="onAllowPermitAllChange">
39+
@update:modelValue="onAllowPermitAllChange">
4040
{{ t('forms', 'Allow sharing to all logged in accounts') }}
4141
</NcCheckboxRadioSwitch>
4242
<NcCheckboxRadioSwitch
4343
ref="switchAllowShowToAll"
4444
v-model="appConfig.allowShowToAll"
4545
type="switch"
46-
@update:model-value="onAllowShowToAllChange">
46+
@update:modelValue="onAllowShowToAllChange">
4747
{{
4848
t(
4949
'forms',

src/FormsSubmit.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
-->
55

66
<template>
7-
<NcContent app-name="forms" :class="{ 'app-forms-embedded': isEmbedded }">
7+
<NcContent appName="forms" :class="{ 'app-forms-embedded': isEmbedded }">
88
<Submit
99
:form="form"
10-
public-view
11-
:share-hash="shareHash"
12-
:is-logged-in="isLoggedIn"
13-
:sidebar-opened="false" />
10+
publicView
11+
:shareHash="shareHash"
12+
:isLoggedIn="isLoggedIn"
13+
:sidebarOpened="false" />
1414
</NcContent>
1515
</template>
1616

src/components/AppNavigationForm.vue

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
<NcListItem
88
:active="isActive"
99
:actions-aria-label="t('forms', 'Form actions')"
10-
:counter-number="form.submissionCount"
10+
:counterNumber="form.submissionCount"
1111
compact
12-
:force-display-actions="forceDisplayActions"
12+
:forceDisplayActions="forceDisplayActions"
1313
:name="formTitle"
1414
:to="{
1515
name: routerTarget,
@@ -29,7 +29,7 @@
2929
#actions>
3030
<NcActionRouter
3131
v-if="!isArchived && canEdit"
32-
close-after-click
32+
closeAfterClick
3333
:disabled="isFormLocked"
3434
:to="{ name: 'edit', params: { hash: form.hash } }"
3535
@click="mobileCloseNavigation">
@@ -40,7 +40,7 @@
4040
</NcActionRouter>
4141
<NcActionButton
4242
v-if="!isArchived && !readOnly"
43-
close-after-click
43+
closeAfterClick
4444
@click="onShareForm">
4545
<template #icon>
4646
<IconShareVariant :size="20" />
@@ -49,15 +49,15 @@
4949
</NcActionButton>
5050
<NcActionRouter
5151
v-if="canSeeResults"
52-
close-after-click
52+
closeAfterClick
5353
:to="{ name: 'results', params: { hash: form.hash } }"
5454
@click="mobileCloseNavigation">
5555
<template #icon>
5656
<IconPoll :size="20" />
5757
</template>
5858
{{ t('forms', 'Results') }}
5959
</NcActionRouter>
60-
<NcActionButton v-if="canEdit" close-after-click @click="onCloneForm">
60+
<NcActionButton v-if="canEdit" closeAfterClick @click="onCloneForm">
6161
<template #icon>
6262
<IconContentCopy :size="20" />
6363
</template>
@@ -66,7 +66,7 @@
6666
<NcActionSeparator v-if="canEdit && !readOnly" />
6767
<NcActionButton
6868
v-if="canEdit && !readOnly"
69-
close-after-click
69+
closeAfterClick
7070
:disabled="isFormLocked"
7171
@click="onToggleArchive">
7272
<template #icon>
@@ -81,7 +81,7 @@
8181
</NcActionButton>
8282
<NcActionButton
8383
v-if="canEdit && !readOnly"
84-
close-after-click
84+
closeAfterClick
8585
:disabled="isFormLocked"
8686
@click="showDeleteDialog = true">
8787
<template #icon>
@@ -169,13 +169,7 @@ export default {
169169
},
170170
},
171171
172-
emits: [
173-
'mobile-close-navigation',
174-
'open-sharing',
175-
'clone',
176-
'update-form-state',
177-
'delete',
178-
],
172+
emits: ['mobileCloseNavigation', 'openSharing', 'clone', 'delete'],
179173
180174
data() {
181175
return {
@@ -299,11 +293,11 @@ export default {
299293
* Closes the App-Navigation on mobile-devices
300294
*/
301295
mobileCloseNavigation() {
302-
this.$emit('mobile-close-navigation')
296+
this.$emit('mobileCloseNavigation')
303297
},
304298
305299
onShareForm() {
306-
this.$emit('open-sharing', this.form.hash)
300+
this.$emit('openSharing', this.form.hash)
307301
},
308302
309303
onCloneForm() {

src/components/ArchivedFormsModal.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<template>
77
<NcDialog
8-
content-classes="archived-forms"
8+
contentClasses="archived-forms"
99
:name="t('forms', 'Archived forms')"
1010
:open="open"
1111
size="normal"
@@ -15,10 +15,10 @@
1515
v-for="(form, key) in shownForms"
1616
:key="key"
1717
:form="form"
18-
force-display-actions
18+
forceDisplayActions
1919
@clone="onCloneForm(form.id)"
2020
@delete="onDelete(form)"
21-
@mobile-close-navigation="$emit('update:open', false)" />
21+
@mobileCloseNavigation="$emit('update:open', false)" />
2222
</ul>
2323
</NcDialog>
2424
</template>

src/components/OptionInputDialog.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<template>
77
<NcDialog
8-
content-classes="options-modal"
8+
contentClasses="options-modal"
99
:name="t('forms', 'Add multiple options')"
1010
:open="open"
1111
:buttons="buttons"
@@ -18,10 +18,10 @@
1818
resize="vertical"
1919
rows="10" />
2020
<NcSelect
21-
:input-label="t('forms', 'Options')"
21+
:inputLabel="t('forms', 'Options')"
2222
multiple
2323
disabled
24-
:model-value="multipleOptions" />
24+
:modelValue="multipleOptions" />
2525
</NcDialog>
2626
</template>
2727

@@ -50,7 +50,7 @@ export default defineComponent({
5050
},
5151
},
5252
53-
emits: ['update:open', 'multiple-answers'],
53+
emits: ['update:open', 'multipleAnswers'],
5454
5555
data() {
5656
return {
@@ -93,7 +93,7 @@ export default defineComponent({
9393
this.$emit('update:open', false)
9494
if (this.multipleOptions.length > 1) {
9595
// extract all options entries to parent
96-
this.$emit('multiple-answers', this.multipleOptions)
96+
this.$emit('multipleAnswers', this.multipleOptions)
9797
this.enteredOptions = ''
9898
return
9999
}

0 commit comments

Comments
 (0)