Skip to content

Commit cdd61b3

Browse files
Chartman123nfebe
authored andcommitted
run lint:fix
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent 70713e9 commit cdd61b3

32 files changed

Lines changed: 385 additions & 389 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,19 +39,19 @@
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"
51+
readOnly
52+
@openSharing="openSharing"
5353
@clone="onCloneForm"
54-
@mobile-close-navigation="mobileCloseNavigation" />
54+
@mobileCloseNavigation="mobileCloseNavigation" />
5555
</ul>
5656
</template>
5757

@@ -120,16 +120,16 @@
120120
<template v-else>
121121
<router-view
122122
:form="selectedForm"
123-
:sidebar-opened="sidebarOpened"
123+
:sidebarOpened="sidebarOpened"
124124
@update:form="updateSelectedForm"
125-
@update:sidebar-opened="sidebarOpened = $event"
126-
@open-sharing="openSharing" />
125+
@update:sidebarOpened="sidebarOpened = $event"
126+
@openSharing="openSharing" />
127127
<Sidebar
128128
v-if="!selectedForm.partial && canEdit"
129129
:form="selectedForm"
130-
:sidebar-opened="sidebarOpened"
130+
:sidebarOpened="sidebarOpened"
131131
:active="sidebarActive"
132-
@update:sidebar-opened="sidebarOpened = $event"
132+
@update:sidebarOpened="sidebarOpened = $event"
133133
@update:active="sidebarActive = $event" />
134134
</template>
135135

@@ -208,6 +208,35 @@ export default {
208208
209209
const PERMISSION_TYPES = PermissionTypes.data().PERMISSION_TYPES
210210
211+
const routeHash = computed(() => route.params.hash)
212+
213+
const routeAllowed = computed(() => {
214+
if (loading.value && loadState(appName, 'formId') === 'invalid') {
215+
return false
216+
}
217+
218+
if (!routeHash.value) {
219+
return false
220+
}
221+
222+
const form = [...forms.value, ...allSharedForms.value].find(
223+
(form) => form.hash === routeHash.value,
224+
)
225+
226+
if (form === undefined) {
227+
fetchPartialForm(routeHash.value)
228+
return false
229+
}
230+
231+
if (route.name === 'results') {
232+
return (
233+
form.permissions.includes(route.name) || form.submissionCount > 0
234+
)
235+
}
236+
237+
return form?.permissions.includes(route.name)
238+
})
239+
211240
const selectedForm = computed(() => {
212241
if (routeAllowed.value) {
213242
return (
@@ -264,36 +293,6 @@ export default {
264293
)
265294
})
266295
267-
const routeHash = computed(() => route.params.hash)
268-
269-
const routeAllowed = computed(() => {
270-
if (loading.value && loadState(appName, 'formId') === 'invalid') {
271-
return false
272-
}
273-
274-
if (!routeHash.value) {
275-
return false
276-
}
277-
278-
const form = [...forms.value, ...allSharedForms.value].find(
279-
(form) => form.hash === routeHash.value,
280-
)
281-
282-
if (form === undefined) {
283-
fetchPartialForm(routeHash.value)
284-
return false
285-
}
286-
287-
if (route.name === 'results') {
288-
return (
289-
form.permissions.includes(route.name)
290-
|| form.submissionCount > 0
291-
)
292-
}
293-
294-
return form?.permissions.includes(route.name)
295-
})
296-
297296
const mobileCloseNavigation = () => {
298297
if (isMobile.value) {
299298
emit('toggle-navigation', { open: false })
@@ -342,7 +341,12 @@ export default {
342341
loading.value = false
343342
}
344343
345-
const fetchPartialForm = async (hash) => {
344+
/**
345+
* Fetch a partial form by its hash after initial load completes.
346+
*
347+
* @param {string} hash The hash of the form to fetch.
348+
*/
349+
async function fetchPartialForm(hash) {
346350
await new Promise((resolve) => {
347351
const wait = () => {
348352
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="onConfirmDelete">
8787
<template #icon>
@@ -157,13 +157,7 @@ export default {
157157
},
158158
},
159159
160-
emits: [
161-
'mobile-close-navigation',
162-
'open-sharing',
163-
'clone',
164-
'update-form-state',
165-
'delete',
166-
],
160+
emits: ['mobileCloseNavigation', 'openSharing', 'clone', 'delete'],
167161
168162
data() {
169163
return {
@@ -276,11 +270,11 @@ export default {
276270
* Closes the App-Navigation on mobile-devices
277271
*/
278272
mobileCloseNavigation() {
279-
this.$emit('mobile-close-navigation')
273+
this.$emit('mobileCloseNavigation')
280274
},
281275
282276
onShareForm() {
283-
this.$emit('open-sharing', this.form.hash)
277+
this.$emit('openSharing', this.form.hash)
284278
},
285279
286280
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)