diff --git a/src/Forms.vue b/src/Forms.vue
index ef7b109ad..ec98b713d 100644
--- a/src/Forms.vue
+++ b/src/Forms.vue
@@ -122,12 +122,11 @@
:form.sync="selectedForm"
:sidebar-opened.sync="sidebarOpened"
@open-sharing="openSharing" />
-
+ :active.sync="sidebarActive" />
@@ -162,8 +161,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'
@@ -184,6 +184,7 @@ export default {
NcContent,
NcEmptyContent,
NcLoadingIcon,
+ Sidebar,
},
mixins: [PermissionTypes],
diff --git a/src/components/Results/ResultsSummary.vue b/src/components/Results/ResultsSummary.vue
index ea2f5c042..9bddbd357 100644
--- a/src/components/Results/ResultsSummary.vue
+++ b/src/components/Results/ResultsSummary.vue
@@ -32,7 +32,7 @@
@@ -113,7 +113,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,
)
@@ -151,7 +151,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 =
@@ -169,7 +169,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,
)
@@ -199,7 +199,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 4bc97f907..ad8630fa4 100644
--- a/src/components/TopBar.vue
+++ b/src/components/TopBar.vue
@@ -27,18 +27,6 @@
{{ t('forms', 'Share') }}
-
-
-
-
-
@@ -204,8 +192,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 d2b1dcd0c..018dec407 100644
--- a/src/mixins/ViewsMixin.js
+++ b/src/mixins/ViewsMixin.js
@@ -99,10 +99,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 d5cf76f8c..2eee43dc5 100644
--- a/src/router.js
+++ b/src/router.js
@@ -9,7 +9,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)
@@ -37,7 +36,6 @@ export default new Router({
path: '/:hash/edit',
components: {
default: Create,
- sidebar: Sidebar,
},
name: 'edit',
props: { default: true },
@@ -46,7 +44,6 @@ export default new Router({
path: '/:hash/results',
components: {
default: Results,
- sidebar: Sidebar,
},
name: 'results',
props: { default: true },
@@ -55,7 +52,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 9054e5d26..d3d354a41 100644
--- a/src/views/Results.vue
+++ b/src/views/Results.vue
@@ -43,7 +43,7 @@
{{
t('forms', '{amount} responses', {
- amount: form.submissions.length,
+ amount: form.submissions?.length ?? 0,
})
}}
@@ -64,6 +64,14 @@
@blur="isDownloadActionOpened = false"
@close="isDownloadActionOpened = false">
+
+
+
+
+ {{ t('forms', 'Create spreadsheet') }}
+
{{ t('forms', 'Unlink spreadsheet') }}
-
+
-
-
-
-
- {{ t('forms', 'Create spreadsheet') }}
-
{
try {
- const response = await axios.patch(
+ await axios.patch(
generateOcsUrl('apps/forms/api/v3/forms/{id}', {
id: this.form.id,
}),
@@ -513,15 +525,12 @@ export default {
},
},
)
- const responseData = OcsResponse2Data(response)
-
- this.form.fileFormat = responseData.fileFormat
- this.form.fileId = responseData.fileId
- this.form.filePath = responseData.filePath
+ await this.fetchFullForm(this.form.id)
+ await this.loadFormResults()
showSuccess(
t('forms', 'File {file} successfully linked', {
- file: responseData.fileName,
+ file: this.form.filePath.split('/').pop(),
}),
)
emit('forms:last-updated:set', this.form.id)
@@ -586,20 +595,6 @@ export default {
}
},
- async fetchLinkedFileInfo() {
- const response = await axios.get(
- generateOcsUrl('apps/forms/api/v3/forms/{id}', {
- id: this.form.id,
- }),
- )
- const form = OcsResponse2Data(response)
- this.$set(this.form, 'fileFormat', form.fileFormat)
- this.$set(this.form, 'fileId', form.fileId)
- this.$set(this.form, 'filePath', form.filePath)
- this.showLinkedFileNotAvailableDialog =
- this.canEditForm && form.fileId && !form.filePath
- },
-
async onReExport() {
if (!this.form.fileId) {
// Theoretically this will never fire