Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public function newForm(?int $fromId = null): DataResponse {
unset($formData['id']);
unset($formData['created']);
unset($formData['lastUpdated']);
unset($formData['state']);
$formData['hash'] = $this->formsService->generateFormHash();
// TRANSLATORS Appendix to the form Title of a duplicated/copied form.
$formData['title'] .= ' - ' . $this->l10n->t('Copy');
Expand Down
5 changes: 4 additions & 1 deletion src/Forms.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@
</template>

<!-- Archived forms modal -->
<ArchivedFormsModal :open.sync="showArchivedForms" :forms="archivedForms" />
<ArchivedFormsModal
:open.sync="showArchivedForms"
:forms="archivedForms"
@clone="onCloneForm" />
</NcContent>
</template>

Expand Down
3 changes: 2 additions & 1 deletion src/components/AppNavigationForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{{ t('forms', 'Results') }}
</NcActionRouter>
<NcActionButton
v-if="canEdit && !isArchived"
v-if="canEdit"
:close-after-click="true"
@click="onCloneForm">
<template #icon>
Expand Down Expand Up @@ -278,6 +278,7 @@ export default {
onShareForm() {
this.$emit('open-sharing', this.form.hash)
},

onCloneForm() {
this.$emit('clone', this.form.id)
},
Expand Down
6 changes: 6 additions & 0 deletions src/components/ArchivedFormsModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
:form="form"
:read-only="false"
force-display-actions
@clone="onCloneForm(form.id)"
@delete="onDelete(form)"
@mobile-close-navigation="$emit('update:open', false)" />
</ul>
Expand Down Expand Up @@ -69,6 +70,11 @@ export default defineComponent({
methods: {
t,

onCloneForm(formId) {
this.$emit('clone', formId)
this.$emit('update:open', false)
},

onDelete(form) {
this.shownForms = this.shownForms.filter(({ id }) => id !== form.id)
},
Expand Down
Loading