From bb0474c4c01ddc68842459d04472714ce45a5a24 Mon Sep 17 00:00:00 2001 From: JulioManoel Date: Tue, 9 Jul 2024 03:27:48 -0300 Subject: [PATCH 1/3] fix: Organization Create Test --- src/components/atoms/ButtonBack.vue | 21 + src/components/atoms/CardTypeTest.vue | 168 +++++ src/components/atoms/CardTypeTestImage.vue | 154 +++++ .../dialogs/CreateTestNameDialog.vue | 251 ++++++++ .../dialogs/CreateTestUserDialog.vue | 125 ++++ src/views/admin/CreateBlankView.vue | 574 ++---------------- src/views/admin/DashboardView.vue | 54 +- src/views/admin/ManagerView.vue | 2 +- 8 files changed, 791 insertions(+), 558 deletions(-) create mode 100644 src/components/atoms/ButtonBack.vue create mode 100644 src/components/atoms/CardTypeTest.vue create mode 100644 src/components/atoms/CardTypeTestImage.vue create mode 100644 src/components/dialogs/CreateTestNameDialog.vue create mode 100644 src/components/dialogs/CreateTestUserDialog.vue diff --git a/src/components/atoms/ButtonBack.vue b/src/components/atoms/ButtonBack.vue new file mode 100644 index 00000000..61c22710 --- /dev/null +++ b/src/components/atoms/ButtonBack.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/src/components/atoms/CardTypeTest.vue b/src/components/atoms/CardTypeTest.vue new file mode 100644 index 00000000..5469ea81 --- /dev/null +++ b/src/components/atoms/CardTypeTest.vue @@ -0,0 +1,168 @@ + + + + + \ No newline at end of file diff --git a/src/components/atoms/CardTypeTestImage.vue b/src/components/atoms/CardTypeTestImage.vue new file mode 100644 index 00000000..17a1e641 --- /dev/null +++ b/src/components/atoms/CardTypeTestImage.vue @@ -0,0 +1,154 @@ + + + + + \ No newline at end of file diff --git a/src/components/dialogs/CreateTestNameDialog.vue b/src/components/dialogs/CreateTestNameDialog.vue new file mode 100644 index 00000000..3333da3b --- /dev/null +++ b/src/components/dialogs/CreateTestNameDialog.vue @@ -0,0 +1,251 @@ + + + + + \ No newline at end of file diff --git a/src/components/dialogs/CreateTestUserDialog.vue b/src/components/dialogs/CreateTestUserDialog.vue new file mode 100644 index 00000000..19aac21f --- /dev/null +++ b/src/components/dialogs/CreateTestUserDialog.vue @@ -0,0 +1,125 @@ + + + + + \ No newline at end of file diff --git a/src/views/admin/CreateBlankView.vue b/src/views/admin/CreateBlankView.vue index a6a4b822..a44d8527 100644 --- a/src/views/admin/CreateBlankView.vue +++ b/src/views/admin/CreateBlankView.vue @@ -2,396 +2,65 @@
- What kind of test are you looking to start? +

+ What kind of test are you looking to start? +

+ - - + - - - - - -
- Usability Heuristic -
- Test -
-
- - - - Usability Percentage - - - - Final Report PDF - - - - Invite specialists to evaluate your application - -
+
- + - - - - - -
- Usability User -
- Test -
-
- - - - Webcam, audio & screen record - - - - Enhanced answer analysis - - - - Moderated or non moderated tests - -
+
-
- - - - - mdi-arrow-u-left-bottom - - - - Test Creation -
- Add a name to your test! -
- - - - -
- Test Name -
- - Test Description - - - - - - mdi-arrow-right - - - -
-
-
- - Test Creation image - -
-
-
- - - - - - - mdi-arrow-u-left-bottom - - - - - What type of test are you looking to start? - - - - - - - - -
- SelfTest -
- UNMODERATED -
-
- Test Creation image - - - Answer on free time - - - - Enhanced answer analysis - - - - Task Customization - -
-
- - - -
- LiveTest -
- MODERATED -
-
- Test Creation image - - - Webcam, audio & screen record - - - - Enhanced answer analysis - - - - Moderated live test - -
-
- -
-
-
-
+
diff --git a/src/views/admin/ManagerView.vue b/src/views/admin/ManagerView.vue index fd46249c..50ab4b50 100644 --- a/src/views/admin/ManagerView.vue +++ b/src/views/admin/ManagerView.vue @@ -37,7 +37,7 @@ - + @@ -46,7 +46,7 @@
-

@@ -55,7 +55,9 @@

{{ test.testTitle }}

+ > + {{ test.testTitle }} +

({ - selected: true, flagUser: false, flagToken: false, flagNewUser: false, logined: false, - - selectedTest: null, - item: 0, }), computed: { @@ -228,10 +226,6 @@ export default { return this.$store.getters.test }, - isSettings() { - return this.$route.path.includes('/settings') - }, - topCards() { return [ { @@ -326,6 +320,40 @@ export default { // Check if the test is public return this.test.isPublic ? 1 : 2 }, + + navigator() { + if (!this.test) return [] + + const items = [ + { title: 'Manager', icon: 'mdi-home', path: `/managerview/${this.test.id}` }, + ] + + if (this.test.template) { + items.push({ title: 'Template', icon: 'mdi-file-compare', path: `/templateview/${this.test.template.id}` }) + } + + if (this.accessLevel == 0) { + items.push( + { title: 'Test', icon: 'mdi-file-document-edit', path: `/edittest/${this.test.id}` }, + { title: 'Preview', icon: 'mdi-file-eye', path: `/testview/${this.test.id}` }, + { title: 'Reports', icon: 'mdi-book-multiple', path: `/reportview/${this.test.id}` }, + { title: 'Answers', icon: 'mdi-order-bool-ascending-variant', path: `/answerview/${this.test.id}` }, + { title: 'Final Report', icon: 'mdi-file-document', path: `/finalreportview/${this.test.id}` }, + { title: 'Cooperators', icon: 'mdi-account-group', path: `/cooperators/${this.test.id}` }, + { title: 'Settings', icon: 'mdi-cog', path: `/settingsview/${this.test.id}` }, + ) + } + + if (this.accessLevel == 1) { + items.push( + { title: 'Answer Test', icon: 'mdi-file-document', path: `/testview/${this.test.id}` }, + { title: 'Reports', icon: 'mdi-book-multiple', path: `/reportview/${this.test.id}` }, + { title: 'Answers', icon: 'mdi-order-bool-ascending-variant', path: `/answerview/${this.test.id}` }, + ) + } + + return items + }, }, watch: { @@ -351,11 +379,9 @@ export default { methods: { go(item) { - if (item.id === undefined) this.$router.push(item).catch(() => {}) - else { - if (item.id === 2) window.open(item.path) - else this.$router.push(item.path).catch(() => {}) - } + if (item.id === undefined) return this.$router.push(item).catch(() => {}) + if (item.id === 2) return window.open(item.path) + return this.$router.push(item.path).catch(() => {}) }, setFlag(flag, value) {