diff --git a/src/Forms.vue b/src/Forms.vue index 66411b4a1..01d3f3efa 100644 --- a/src/Forms.vue +++ b/src/Forms.vue @@ -140,12 +140,11 @@ :form.sync="selectedForm" :sidebar-opened.sync="sidebarOpened" @open-sharing="openSharing" /> - + :active.sync="sidebarActive" /> @@ -177,8 +176,9 @@ import IconPlus from 'vue-material-design-icons/Plus.vue' import ArchivedFormsModal from './components/ArchivedFormsModal.vue' import AppNavigationForm from './components/AppNavigationForm.vue' import FormsIcon from './components/Icons/FormsIcon.vue' -import PermissionTypes from './mixins/PermissionTypes.js' import OcsResponse2Data from './utils/OcsResponse2Data.js' +import PermissionTypes from './mixins/PermissionTypes.js' +import Sidebar from './views/Sidebar.vue' import logger from './utils/Logger.js' import { FormState } from './models/FormStates.ts' @@ -199,6 +199,7 @@ export default { NcContent, NcEmptyContent, NcLoadingIcon, + Sidebar, }, mixins: [PermissionTypes], diff --git a/src/components/Results/ResultsSummary.vue b/src/components/Results/ResultsSummary.vue index 10fcbde9f..baefba14b 100644 --- a/src/components/Results/ResultsSummary.vue +++ b/src/components/Results/ResultsSummary.vue @@ -49,7 +49,7 @@ @@ -130,7 +130,7 @@ export default { }) // Go through submissions to check which options have how many responses - this.submissions.forEach((submission) => { + this.submissions?.forEach((submission) => { const answers = submission.answers.filter( (answer) => answer.questionId === this.question.id, ) @@ -168,7 +168,7 @@ export default { questionOptionsStats.forEach((questionOptionsStat) => { // Fill percentage values questionOptionsStat.percentage = Math.round( - (100 * questionOptionsStat.count) / this.submissions.length, + (100 * questionOptionsStat.count) / this.submissions?.length, ) // Mark all best results. First one is best for sure due to sorting questionOptionsStat.best = @@ -186,7 +186,7 @@ export default { let noResponseCount = 0 // Go through submissions to check which options have how many responses - this.submissions.forEach((submission) => { + this.submissions?.forEach((submission) => { const answers = submission.answers.filter( (answer) => answer.questionId === this.question.id, ) @@ -216,7 +216,7 @@ export default { // Calculate no response percentage const noResponsePercentage = Math.round( - (100 * noResponseCount) / this.submissions.length, + (100 * noResponseCount) / this.submissions?.length, ) answersModels.unshift({ id: 0, diff --git a/src/components/TopBar.vue b/src/components/TopBar.vue index 4055d1f13..0ffb7589f 100644 --- a/src/components/TopBar.vue +++ b/src/components/TopBar.vue @@ -44,18 +44,6 @@ {{ t('forms', 'Share') }} - - - @@ -221,8 +209,4 @@ export default { margin-inline-end: 0; } } - -.icon--flipped { - transform: scaleX(-1); -} diff --git a/src/mixins/ViewsMixin.js b/src/mixins/ViewsMixin.js index 7b416a621..d956bcc2b 100644 --- a/src/mixins/ViewsMixin.js +++ b/src/mixins/ViewsMixin.js @@ -116,10 +116,6 @@ export default { this.$emit('open-sharing', this.form.hash) }, - onSidebarChange(newState) { - this.$emit('update:sidebarOpened', newState) - }, - /** * Focus title after form load */ diff --git a/src/router.js b/src/router.js index 03a955117..0775c5918 100644 --- a/src/router.js +++ b/src/router.js @@ -28,7 +28,6 @@ import { generateUrl } from '@nextcloud/router' import Create from './views/Create.vue' import Results from './views/Results.vue' -import Sidebar from './views/Sidebar.vue' import Submit from './views/Submit.vue' Vue.use(Router) @@ -56,7 +55,6 @@ export default new Router({ path: '/:hash/edit', components: { default: Create, - sidebar: Sidebar, }, name: 'edit', props: { default: true }, @@ -65,7 +63,6 @@ export default new Router({ path: '/:hash/results', components: { default: Results, - sidebar: Sidebar, }, name: 'results', props: { default: true }, @@ -74,7 +71,6 @@ export default new Router({ path: '/:hash/submit', components: { default: Submit, - sidebar: Sidebar, }, name: 'submit', props: { default: true }, diff --git a/src/views/Results.vue b/src/views/Results.vue index 4ca6e47e7..4cd99f359 100644 --- a/src/views/Results.vue +++ b/src/views/Results.vue @@ -105,7 +105,7 @@

{{ t('forms', '{amount} responses', { - amount: form.submissions.length, + amount: form.submissions?.length ?? 0, }) }}

@@ -125,6 +125,14 @@ @blur="isDownloadActionOpened = false" @close="isDownloadActionOpened = false">