From bd72a684cb96e4d9cc7c9af01934758a1512e663 Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Fri, 8 Mar 2024 13:28:05 -0300
Subject: [PATCH 01/16] feat: componentized cooperators view for 2 types of
tests
---
.../organisms/ModeratedCoopsView.vue | 536 +++++++++++++++++
.../organisms/UnmoderatedCoopsView.vue | 549 ++++++++++++++++++
src/views/admin/CooperatorsView.vue | 547 +----------------
3 files changed, 1100 insertions(+), 532 deletions(-)
create mode 100644 src/components/organisms/ModeratedCoopsView.vue
create mode 100644 src/components/organisms/UnmoderatedCoopsView.vue
diff --git a/src/components/organisms/ModeratedCoopsView.vue b/src/components/organisms/ModeratedCoopsView.vue
new file mode 100644
index 000000000..3c2fd6775
--- /dev/null
+++ b/src/components/organisms/ModeratedCoopsView.vue
@@ -0,0 +1,536 @@
+
+
+
+
+
+ Loading Cooperators
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mdi-email
+
+
+
+ Send invitations
+
+
+
+
+
+ {{ typeof coop == 'object' ? coop.email : coop }}
+
+
+
+
+
+ There are no users registered with that email, press enter
+ to select anyways.
+
+
+
+
+
+
+
+
+
+
+ mdi-account-circle
+
+ {{ item.email }}
+
+
+
+
+
+ {{ item.accessLevel }}
+
+
+
+
+
+ mdi-checkbox-marked-circle-outline
+
+
+ mdi-close-circle-outline
+
+
+
+
+
+
+ mdi-checkbox-blank-circle-outline
+
+
+ mdi-checkbox-marked-circle-outline
+
+
+ mdi-close-circle-outline
+
+
+
+
+
+
+
+
+ mdi-dots-vertical
+
+
+
+
+
+ Send a message
+
+
+ Re-invite
+
+
+
+ Remove cooperator
+
+
+
+ Cancel invitation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mdi-email
+
+ Send a Message
+
+
+
+
+
+
+
+
+
+
+ Cancel
+
+
+ Send
+
+
+
+
+
+
+
+
+ mdi-email
+
+ Invite Evaluator To Test
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/organisms/UnmoderatedCoopsView.vue b/src/components/organisms/UnmoderatedCoopsView.vue
new file mode 100644
index 000000000..8accd7dc8
--- /dev/null
+++ b/src/components/organisms/UnmoderatedCoopsView.vue
@@ -0,0 +1,549 @@
+
+
+
+
+
+ Loading Cooperators
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mdi-email
+
+
+
+ Send invitations
+
+
+
+
+
+ {{ typeof coop == 'object' ? coop.email : coop }}
+
+
+
+
+
+ There are no users registered with that email, press enter
+ to select anyways.
+
+
+
+
+
+
+
+
+
+
+
+
+ mdi-account-circle
+
+ {{ item.email }}
+
+
+
+
+
+
+
+
+
+
+
+ mdi-checkbox-marked-circle-outline
+
+
+ mdi-close-circle-outline
+
+
+
+
+
+
+ mdi-checkbox-blank-circle-outline
+
+
+ mdi-checkbox-marked-circle-outline
+
+
+ mdi-close-circle-outline
+
+
+
+
+
+
+
+
+ mdi-dots-vertical
+
+
+
+
+
+ Send a message
+
+
+ Re-invite
+
+
+
+ Remove cooperator
+
+
+
+ Cancel invitation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mdi-email
+
+ Send a Message
+
+
+
+
+
+
+
+
+
+
+ Cancel
+
+
+ Send
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/admin/CooperatorsView.vue b/src/views/admin/CooperatorsView.vue
index e591fada0..62a229a41 100644
--- a/src/views/admin/CooperatorsView.vue
+++ b/src/views/admin/CooperatorsView.vue
@@ -1,549 +1,32 @@
-
-
-
- Loading Cooperators
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mdi-email
-
-
-
- Send invitations
-
-
-
-
-
- {{ typeof coop == 'object' ? coop.email : coop }}
-
-
-
-
-
- There are no users registered with that email, press enter
- to select anyways.
-
-
-
-
-
-
-
-
-
-
-
-
- mdi-account-circle
-
- {{ item.email }}
-
-
-
-
-
-
-
-
-
-
-
- mdi-checkbox-marked-circle-outline
-
-
- mdi-close-circle-outline
-
-
-
-
-
-
- mdi-checkbox-blank-circle-outline
-
-
- mdi-checkbox-marked-circle-outline
-
-
- mdi-close-circle-outline
-
-
-
-
-
-
-
-
- mdi-dots-vertical
-
-
-
-
-
- Send a message
-
-
- Re-invite
-
-
-
- Remove cooperator
-
-
-
- Cancel invitation
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- mdi-email
-
- Send a Message
-
-
-
-
-
-
-
-
-
-
- Cancel
-
-
- Send
-
-
-
-
+
+
+
+
+
-
-
From 85d96046bc93a98df1e98f369a79228da5963b96 Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Fri, 8 Mar 2024 16:36:26 -0300
Subject: [PATCH 02/16] feat(ModContributors): progress made with the front-end
---
.../organisms/ModeratedCoopsView.vue | 88 ++++++++++++-------
1 file changed, 54 insertions(+), 34 deletions(-)
diff --git a/src/components/organisms/ModeratedCoopsView.vue b/src/components/organisms/ModeratedCoopsView.vue
index 3c2fd6775..9fdfb56e0 100644
--- a/src/components/organisms/ModeratedCoopsView.vue
+++ b/src/components/organisms/ModeratedCoopsView.vue
@@ -43,15 +43,6 @@
-
- {{ typeof coop == 'object' ? coop.email : coop }}
-
-
+
-
-
- mdi-email
-
+
Invite Evaluator To Test
+
-
-
+
+ Email
+
+
+
+ Scheduled at
+
+
+
+
+
+ Invite message
+
+
@@ -533,4 +544,13 @@ export default {
margin-bottom: 0px;
padding-bottom: 0px;
}
+.modalInternTitles {
+ max-width: 270px;
+ font-family: 'Poppins', Helvetica;
+ color: #626e76;
+ font-size: 18px;
+ font-style: normal;
+ font-weight: 500;
+ line-height: normal;
+}
From b3f8eae1ff823725e54d3109d1571cbdef5c565a Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Wed, 27 Mar 2024 16:21:26 -0300
Subject: [PATCH 03/16] fix(coops) now can't invite users without account
---
src/components/organisms/UnmoderatedCoopsView.vue | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/components/organisms/UnmoderatedCoopsView.vue b/src/components/organisms/UnmoderatedCoopsView.vue
index 8accd7dc8..1d65d6f48 100644
--- a/src/components/organisms/UnmoderatedCoopsView.vue
+++ b/src/components/organisms/UnmoderatedCoopsView.vue
@@ -263,7 +263,6 @@ import { cooperatorsHeaders } from '@/utils/headers'
import { roleOptionsItems } from '@/utils/items'
import Notification from '@/models/Notification'
const UIDGenerator = require('uid-generator')
-import Vue from 'vue'
export default {
components: {
ShowInfo,
@@ -455,7 +454,14 @@ export default {
//if is object then no need to validate
if (this.email.length) {
if (!this.email.includes('@') || !this.email.includes('.')) {
- Vue.$toast.error(this.email + ' is not a valid email')
+ this.$toast.error(this.email + ' is not a valid email')
+ }
+ if (!this.users.find((user) => user.email === this.email)) {
+ // Verifica se o e-mail inserido manualmente existe na lista de usuários
+ this.$toast.error(
+ this.email + ' is not a valid email or does not exist',
+ )
+ return // Se não existir, interrompe a execução
} else if (!this.selectedCoops.includes(this.email)) {
this.selectedCoops.push(this.email)
}
From 241bd1e418343599da4dcd02d2fcc3b84128e693 Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Wed, 3 Apr 2024 17:55:54 -0300
Subject: [PATCH 04/16] feat: add date picker to cooperators invite
---
.../organisms/ModeratedCoopsView.vue | 80 +++++++++++--------
1 file changed, 47 insertions(+), 33 deletions(-)
diff --git a/src/components/organisms/ModeratedCoopsView.vue b/src/components/organisms/ModeratedCoopsView.vue
index 9fdfb56e0..5a488537c 100644
--- a/src/components/organisms/ModeratedCoopsView.vue
+++ b/src/components/organisms/ModeratedCoopsView.vue
@@ -228,47 +228,58 @@
-
- Email
-
-
-
- Scheduled at
-
-
+
+
+ Email
+
-
- Invite message
-
-
+ Scheduled at
+
+
+
+
+
+ Invite message
+
+
+
+
+
+
+
@@ -297,6 +308,9 @@ export default {
},
props: { id: { type: String, default: '' } },
data: () => ({
+ date: new Date(Date.now() - new Date().getTimezoneOffset() * 60000)
+ .toISOString()
+ .substr(0, 10),
object: null,
headers: [
{ text: 'Email', value: 'email' },
From c2994071d37040a0aca37813038b9959904abdb8 Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Thu, 4 Apr 2024 17:48:23 -0300
Subject: [PATCH 05/16] style: import poppins font in the project
---
public/index.html | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/public/index.html b/public/index.html
index e7b06ed3f..cd7c29206 100644
--- a/public/index.html
+++ b/public/index.html
@@ -10,6 +10,10 @@
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"
/>
+
Date: Thu, 4 Apr 2024 17:48:49 -0300
Subject: [PATCH 06/16] style: figma design successfully implemented
---
public/Schedule.svg | 1 +
.../organisms/ModeratedCoopsView.vue | 171 ++++++++++++------
2 files changed, 119 insertions(+), 53 deletions(-)
create mode 100644 public/Schedule.svg
diff --git a/public/Schedule.svg b/public/Schedule.svg
new file mode 100644
index 000000000..99f09f527
--- /dev/null
+++ b/public/Schedule.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/components/organisms/ModeratedCoopsView.vue b/src/components/organisms/ModeratedCoopsView.vue
index 5a488537c..140e04b45 100644
--- a/src/components/organisms/ModeratedCoopsView.vue
+++ b/src/components/organisms/ModeratedCoopsView.vue
@@ -30,6 +30,7 @@
right
color="#F9A826"
v-bind="attrs"
+ :disabled="!comboboxModel.email"
@click="openInvitationModal()"
v-on="on"
>
@@ -46,12 +47,15 @@
There are no users registered with that email, press enter
@@ -221,7 +224,7 @@
-
+
Invite Evaluator To Test
@@ -229,55 +232,125 @@
-
+
Email
Scheduled at
-
-
-
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
Invite message
-
+
+
+
+
-
-
+
+ Invite with test link will be send at to evaluator email
+ at scheduled time
+
+ Send
+
-
@@ -311,6 +384,8 @@ export default {
date: new Date(Date.now() - new Date().getTimezoneOffset() * 60000)
.toISOString()
.substr(0, 10),
+ showTimePicker: false,
+ hour: null,
object: null,
headers: [
{ text: 'Email', value: 'email' },
@@ -460,22 +535,6 @@ export default {
openInvitationModal() {
this.inviteModal = true
},
- validateEmail() {
- this.email = this.comboboxModel.pop()
- this.comboboxKey++
- if (typeof this.email !== 'object' && this.email !== undefined) {
- //if is object then no need to validate
- if (this.email.length) {
- if (!this.email.includes('@') || !this.email.includes('.')) {
- Vue.$toast.error(this.email + ' is not a valid email')
- } else if (!this.selectedCoops.includes(this.email)) {
- this.selectedCoops.push(this.email)
- }
- }
- } else if (!this.selectedCoops.includes(this.email)) {
- this.selectedCoops.push(this.email)
- }
- },
async removeCoop(coop) {
const ok = confirm(
`Are you sure you want to remove ${coop.email} from your cooperators?`,
@@ -567,4 +626,10 @@ export default {
font-weight: 500;
line-height: normal;
}
+.v-application .v-autocomplete__content.menuable__content__active {
+ border-radius: 20px !important;
+}
+.v-dialog {
+ border-radius: 20px !important;
+}
From bdd061b1b9399abd33ed27cfdb7687664712cb94 Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Fri, 5 Apr 2024 17:49:51 -0300
Subject: [PATCH 07/16] feat: improvements on moderatedCoops, saving in UTC
timestamp
---
.../organisms/ModeratedCoopsView.vue | 88 +++++++++++--------
1 file changed, 52 insertions(+), 36 deletions(-)
diff --git a/src/components/organisms/ModeratedCoopsView.vue b/src/components/organisms/ModeratedCoopsView.vue
index 140e04b45..8be005c09 100644
--- a/src/components/organisms/ModeratedCoopsView.vue
+++ b/src/components/organisms/ModeratedCoopsView.vue
@@ -12,7 +12,7 @@
/>
-
+
@@ -87,17 +87,19 @@
>
-
-
- mdi-account-circle
-
+
{{ item.email }}
- {{ item.accessLevel }}
+ {{ formatDate(item.testDate) }}
+
+
+
+
+ {{ formatTime(item.testDate) }}
@@ -317,7 +319,7 @@
Send
r.value === item.accessLevel,
- ).text
- if (item.accessLevel !== event.value) {
- const ok = confirm(
- `Are you sure you want to change ${item.email}'s role from "${currentAccessLevelText}" to "${event.text}"`,
- )
- if (ok) {
- // UPDATE TEST WITH NEW COLLABORATOR ROLE
- this.test.cooperators[index] = newCoop
- await this.$store.dispatch('updateTest', this.test)
- // UPDATE COOPERATOR ARRAY 'MYANSWERS' TO HAVE NEW ACCESSROLE
- await this.$store.dispatch('updateUserAnswer', {
- testDocId: this.test.id,
- cooperatorId: newCoop.userDocId,
- data: { accessLevel: newCoop.accessLevel },
- })
- } else {
- this.dataTableKey++ //forces data table re-render without changing user role
- }
- }
+ async saveInvitation() {
+ const cooperator = this.comboboxModel
+ const dateTimeString = this.date + 'T' + this.hour + ':00'
+ const dateTime = new Date(dateTimeString)
+ const timestamp = dateTime.toISOString()
+ console.log(timestamp)
+ this.cooperatorsEdit.push({
+ userDocId: cooperator.id || null,
+ email: cooperator.email,
+ invited: true,
+ accepted: false,
+ accessLevel: 1,
+ testDate: timestamp,
+ inviteMessage: this.inviteMessage,
+ updateDate: this.test.updateDate,
+ testAuthorEmail: this.test.testAdmin.email,
+ })
+
+ this.submit()
},
+
async submit() {
this.test.cooperators = [...this.cooperatorsEdit]
await this.$store.dispatch('updateTest', this.test)
@@ -481,7 +478,11 @@ export default {
this.notifyCooperator(guest)
}
})
- this.selectedCoops = []
+ this.inviteModal = false
+ this.hour = null
+ this.date = null
+ this.inviteMessage = ''
+ this.comboboxModel = []
this.$refs.combobox.blur()
},
notifyCooperator(guest) {
@@ -529,6 +530,21 @@ export default {
})
}
},
+ formatDate(timestamp) {
+ const date = new Date(timestamp)
+ const day = date.getDate()
+ const month = date.getMonth() + 1
+ const year = date.getFullYear()
+
+ return `${day}/${month}/${year}`
+ },
+ formatTime(timestamp) {
+ const date = new Date(timestamp)
+ const hours = date.getHours()
+ const minutes = date.getMinutes()
+
+ return `${hours}:${minutes < 10 ? '0' + minutes : minutes}`
+ },
reinvite(guest) {
this.notifyCooperator(guest)
},
From 728e581b22bf82ce747b164c51572cc028c41dde Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Mon, 8 Apr 2024 15:58:08 -0300
Subject: [PATCH 08/16] feat(style): global fonts imported and added to global
stylesheet
---
src/App.vue | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/src/App.vue b/src/App.vue
index d62c9b4f6..cba8b9552 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -32,6 +32,33 @@ export default {
\ No newline at end of file
+
diff --git a/src/views/public/ModeratedTestView.vue b/src/views/public/ModeratedTestView.vue
index a4278a846..d3a74f7c3 100644
--- a/src/views/public/ModeratedTestView.vue
+++ b/src/views/public/ModeratedTestView.vue
@@ -233,7 +233,9 @@
- Waiting the evaluator connection ...
+ Waiting the evaluator connection ...
@@ -396,7 +398,7 @@
Evaluator concluded the test!
-
+
Here you can finilize the test, or you can keep talking with
your evaluator until you finish!
@@ -465,7 +467,7 @@
class="ma-0 pa-0"
@click="
changeStatus(taskIndex, 'consent', 'done'),
- (consentCompleted = true)
+ (consentCompleted = true)
"
>
@@ -495,7 +497,9 @@
cols="4"
class="mt-2 mb-8 mr-8"
>
- Waiting the moderator...
+ Waiting the moderator...
@@ -582,7 +586,7 @@
>
Final Message!
-
+
Congratulations you finished this test, here you can until talk
with your moderator or leave the test
@@ -795,7 +799,7 @@
draggable="false"
src="../../../public/finalMessage.svg"
alt="Final test svg"
- >
+ />
@@ -1393,7 +1397,6 @@ export default {
}
.cardsTitle {
color: #455a64;
- font-family: 'Poppins', Helvetica;
font-size: 18px;
font-style: normal;
font-weight: 600;
@@ -1401,7 +1404,6 @@ export default {
}
.cardsSubtitle {
color: #455a64;
- font-family: 'Poppins', Helvetica;
font-size: 15px;
font-style: normal;
font-weight: 400;
@@ -1447,7 +1449,6 @@ body {
transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.titleView {
- font-family: 'Poppins', Helvetica;
font-style: normal;
font-weight: 300;
font-size: 60px;
@@ -1457,7 +1458,6 @@ body {
color: #ffffff;
}
.description {
- font-family: Roboto;
font-style: normal;
font-weight: 200;
font-size: 18.1818px;
@@ -1472,7 +1472,6 @@ body {
overflow: hidden;
}
.subtitleView {
- font-family: Roboto;
font-style: normal;
font-weight: 200;
font-size: 18.1818px;
@@ -1537,7 +1536,6 @@ body {
/* background: #515069; */
}
.card-title {
- font-family: Roboto;
font-style: normal;
font-weight: 300;
font-size: 48px;
diff --git a/src/views/public/SignInView.vue b/src/views/public/SignInView.vue
index 06c34cfbb..755ee78b0 100644
--- a/src/views/public/SignInView.vue
+++ b/src/views/public/SignInView.vue
@@ -48,7 +48,8 @@
{{ $t('SIGNIN.dont-have-account') }}
+ >{{ $t('SIGNIN.dont-have-account') }}
@@ -112,7 +113,6 @@ export default {
align-content: center;
}
.card-title {
- font-family: Roboto;
font-style: normal;
font-weight: 300;
font-size: 48px;
diff --git a/src/views/public/SignUpView.vue b/src/views/public/SignUpView.vue
index b8e6fa417..f4a208fa4 100644
--- a/src/views/public/SignUpView.vue
+++ b/src/views/public/SignUpView.vue
@@ -12,7 +12,11 @@
-
+
- {{ $t('SIGNIN.alreadyHaveAnAccount') }}
+ {{ $t('SIGNIN.alreadyHaveAnAccount') }}
@@ -83,7 +91,6 @@ export default {
Snackbar,
},
data: () => ({
-
email: '',
password: '',
@@ -104,7 +111,8 @@ export default {
computed: {
comparePassword() {
return () =>
- (this.confirmpassword == this.password && this.confirmpassword !== '') ||
+ (this.confirmpassword == this.password &&
+ this.confirmpassword !== '') ||
i18n.t('errors.differentPasswords')
},
user() {
@@ -117,7 +125,7 @@ export default {
methods: {
async onSignUp() {
- if (this.valid){
+ if (this.valid) {
await this.$store.dispatch('signup', {
email: this.email,
password: this.password,
@@ -139,7 +147,6 @@ export default {
align-content: center;
}
.card-title {
- font-family: Roboto;
font-style: normal;
font-weight: 300;
font-size: 48px;
@@ -157,4 +164,4 @@ export default {
) !important;
height: 0.5px;
}
-
\ No newline at end of file
+
diff --git a/src/views/public/TestView.vue b/src/views/public/TestView.vue
index 48e060dfa..ae1d724d2 100644
--- a/src/views/public/TestView.vue
+++ b/src/views/public/TestView.vue
@@ -713,7 +713,6 @@ body {
transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.titleView {
- font-family: Roboto;
font-style: normal;
font-weight: 300;
font-size: 60px;
@@ -723,7 +722,6 @@ body {
color: #ffffff;
}
.description {
- font-family: Roboto;
font-style: normal;
font-weight: 200;
font-size: 18.1818px;
@@ -743,7 +741,6 @@ body {
align-items: center;
}
.subtitleView {
- font-family: Roboto;
font-style: normal;
font-weight: 200;
font-size: 18.1818px;
@@ -811,7 +808,6 @@ body {
/* background: #515069; */
}
.card-title {
- font-family: Roboto;
font-style: normal;
font-weight: 300;
font-size: 48px;
diff --git a/src/views/public/UserTestView.vue b/src/views/public/UserTestView.vue
index 81b05bb85..38e18db74 100644
--- a/src/views/public/UserTestView.vue
+++ b/src/views/public/UserTestView.vue
@@ -455,10 +455,7 @@
-
+
{{ test.testTitle }} -
{{ $t('UserTestView.titles.preTest') }}
@@ -489,10 +486,7 @@
-
+
{{ test.testTitle }} -
{{ $t('UserTestView.titles.preTest') }}
@@ -569,19 +563,13 @@
-
+
{{ test.testStructure.userTasks[taskIndex].taskName }}
-
+
{{
test.testStructure.userTasks[taskIndex].taskDescription
}}
@@ -745,10 +733,7 @@
-
+
{{ test.testTitle }} -
{{ $t('UserTestView.titles.postTest') }}
@@ -1243,7 +1228,6 @@ export default {
transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.titleView {
- font-family: Roboto;
font-style: normal;
font-weight: 300;
font-size: 60px;
@@ -1253,7 +1237,6 @@ export default {
color: #ffffff;
}
.description {
- font-family: Roboto;
font-style: normal;
font-weight: 200;
font-size: 18.1818px;
@@ -1268,7 +1251,6 @@ export default {
overflow: hidden;
}
.subtitleView {
- font-family: Roboto;
font-style: normal;
font-weight: 200;
font-size: 18.1818px;
@@ -1337,7 +1319,7 @@ export default {
}
.cardsTitle {
color: #455a64;
- font-family: 'Poppins', Helvetica;
+
font-size: 18px;
font-style: normal;
font-weight: 600;
@@ -1345,7 +1327,7 @@ export default {
}
.cardsSubtitle {
color: #455a64;
- font-family: 'Poppins', Helvetica;
+
font-size: 15px;
font-style: normal;
font-weight: 400;
From 6d937a53b431b53e34d7692a79a0e496a8661fc3 Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Mon, 8 Apr 2024 17:51:21 -0300
Subject: [PATCH 10/16] feat(ModCoops): now inviting testId/CoopsId
---
src/components/organisms/ModeratedCoopsView.vue | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/src/components/organisms/ModeratedCoopsView.vue b/src/components/organisms/ModeratedCoopsView.vue
index 08ce6344f..d059d0b18 100644
--- a/src/components/organisms/ModeratedCoopsView.vue
+++ b/src/components/organisms/ModeratedCoopsView.vue
@@ -485,18 +485,13 @@ export default {
notifyCooperator(guest) {
// Notify user on the platform in case it is already registered
if (guest.userDocId) {
- let path = ''
- if (guest.accessLevel.value >= 2) {
- path = 'testview'
- } else {
- path = 'managerview'
- }
+ let path = 'testview'
this.$store.dispatch('addNotification', {
userId: guest.userDocId,
notification: new Notification({
- title: 'Cooperation Invite!',
- description: `You have been invited to test ${this.test.testTitle}!`,
- redirectsTo: `${path}/${this.test.id}/${guest.token}`,
+ title: `You have been invited to test ${this.test.testTitle}!`,
+ description: this.inviteMessage,
+ redirectsTo: `${path}/${this.test.id}/${this.comboboxModel.id}`,
author: `${this.test.testAdmin.email}`,
read: false,
testId: this.test.id,
From c0763be5d4c45f3e4bc95c6e9f7e7bce2f0d8fce Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Tue, 9 Apr 2024 16:07:56 -0300
Subject: [PATCH 11/16] feat(ModCoops): session added to moderated test
---
.../organisms/ModeratedCoopsView.vue | 23 +++-
src/views/public/ModeratedTestView.vue | 114 ++++++++++--------
src/views/public/TestView.vue | 3 +-
3 files changed, 86 insertions(+), 54 deletions(-)
diff --git a/src/components/organisms/ModeratedCoopsView.vue b/src/components/organisms/ModeratedCoopsView.vue
index d059d0b18..53b8a8268 100644
--- a/src/components/organisms/ModeratedCoopsView.vue
+++ b/src/components/organisms/ModeratedCoopsView.vue
@@ -74,7 +74,6 @@
+
+
+
+
+ mdi-file-document-arrow-right
+
+ Go to session
+
+
+
@@ -394,6 +411,7 @@ export default {
{ text: 'Starts at', value: 'testHour' },
{ text: 'Invited', value: 'invited', justify: 'center' },
{ text: 'Accepted', value: 'accepted', justify: 'center' },
+ { text: 'Session', value: 'session', justify: 'center' },
{ text: 'More', value: 'more', sortable: false },
],
roleOptions: roleOptionsItems,
@@ -482,6 +500,9 @@ export default {
this.comboboxModel = []
this.$refs.combobox.blur()
},
+ goToSession(coopId) {
+ this.$router.push(`/testview/${this.test.id}/${coopId}`)
+ },
notifyCooperator(guest) {
// Notify user on the platform in case it is already registered
if (guest.userDocId) {
diff --git a/src/views/public/ModeratedTestView.vue b/src/views/public/ModeratedTestView.vue
index d3a74f7c3..c48f0ed8c 100644
--- a/src/views/public/ModeratedTestView.vue
+++ b/src/views/public/ModeratedTestView.vue
@@ -1,55 +1,5 @@
-
-
-
- Saving Answer
-
-
-
-
-
-
-
-
-
-
-
-
-
- mdi-account
-
-
-
-
-
- Continue as {{ user.email }}
-
-
-
-
- Not {{ user.email }}?
- Change account
-
-
-
-
-
- Confirm you are ready
+ Confirm you are ready {{ token }}
@@ -831,6 +781,55 @@
+
+
+
+ Saving Answer
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mdi-account
+
+
+
+
+
+ Continue as {{ user.email }}
+
+
+
+
+ Not {{ user.email }}?
+ Change account
+
+
+
+
@@ -884,7 +883,11 @@ export default {
mediaRecorderModerator: null,
isLoading: false,
consentCompleted: false,
+ sessionCooperator: null,
}),
+ props: {
+ token: { type: String, default: '' },
+ },
computed: {
test() {
return this.$store.getters.test
@@ -950,6 +953,15 @@ export default {
},
},
async created() {
+ if (this.token != null) {
+ this.sessionCooperator = this.test.cooperators.find(
+ (user) => user.userDocId === this.token,
+ )
+ console.log(this.sessionCooperator)
+ } else {
+ this.$toast.info('Use a session your session link to the test')
+ this.$router.push('/managerview/' + this.test.id)
+ }
await this.verifyAdmin()
await this.mappingSteps()
this.consentCompleted = this.currentUserTestAnswer.consentCompleted
diff --git a/src/views/public/TestView.vue b/src/views/public/TestView.vue
index ae1d724d2..972894e94 100644
--- a/src/views/public/TestView.vue
+++ b/src/views/public/TestView.vue
@@ -418,7 +418,7 @@
-
+
@@ -435,7 +435,6 @@ import HeuristicQuestionAnswer from '@/models/HeuristicQuestionAnswer'
import Heuristic from '@/models/Heuristic'
import UserTestView from './UserTestView.vue'
import ModeratedTestView from './ModeratedTestView.vue'
-import Vue from 'vue'
export default {
components: {
ShowInfo,
From 6d55079d875d75b587f451c2e67c3a51cd65c066 Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Wed, 10 Apr 2024 18:46:17 -0300
Subject: [PATCH 12/16] feat: verify if token of session is on date
---
src/views/public/ModeratedTestView.vue | 28 +++++++++++++++++++-------
src/views/public/TestView.vue | 2 +-
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/src/views/public/ModeratedTestView.vue b/src/views/public/ModeratedTestView.vue
index c48f0ed8c..a99651e3f 100644
--- a/src/views/public/ModeratedTestView.vue
+++ b/src/views/public/ModeratedTestView.vue
@@ -14,7 +14,13 @@
{{ test.testDescription }}
-
+
Start Test
@@ -161,7 +167,7 @@
- Confirm you are ready {{ token }}
+ Confirm you are ready
@@ -884,9 +890,10 @@ export default {
isLoading: false,
consentCompleted: false,
sessionCooperator: null,
+ testDate: null,
}),
props: {
- token: { type: String, default: '' },
+ token: { type: String, default: null },
},
computed: {
test() {
@@ -914,11 +921,13 @@ export default {
remoteStream() {
return this.$store.getters.remoteStream
},
+ isTestAvailable() {
+ console.log(new Date(this.testDate))
+ console.log(new Date() > new Date(this.testDate))
+ return new Date() > new Date(this.testDate)
+ },
},
watch: {
- test: async function() {
- this.mappingSteps()
- },
taskIndex() {
this.$refs.rightView.scrollTop = 0
},
@@ -957,7 +966,12 @@ export default {
this.sessionCooperator = this.test.cooperators.find(
(user) => user.userDocId === this.token,
)
- console.log(this.sessionCooperator)
+ if (this.sessionCooperator.testDate) {
+ this.testDate = this.sessionCooperator.testDate
+ } else {
+ this.$toast.warning(`Your session don't have a scheduled date`)
+ this.$router.push('/managerview/' + this.test.id)
+ }
} else {
this.$toast.info('Use a session your session link to the test')
this.$router.push('/managerview/' + this.test.id)
diff --git a/src/views/public/TestView.vue b/src/views/public/TestView.vue
index 972894e94..a5d70dafd 100644
--- a/src/views/public/TestView.vue
+++ b/src/views/public/TestView.vue
@@ -449,7 +449,7 @@ export default {
},
props: {
id: { type: String, default: '' },
- token: { type: String, default: '' },
+ token: { type: String, default: null },
},
data: () => ({
logined: null,
From d66b09cb3d9621496fc7aeb7a162798ef0cca0b2 Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Thu, 11 Apr 2024 15:32:55 -0300
Subject: [PATCH 13/16] fix(style): scroll on tabs
---
src/components/organisms/EditModeratedUserTest.vue | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/components/organisms/EditModeratedUserTest.vue b/src/components/organisms/EditModeratedUserTest.vue
index 0d8eae165..a642ae1c5 100644
--- a/src/components/organisms/EditModeratedUserTest.vue
+++ b/src/components/organisms/EditModeratedUserTest.vue
@@ -34,7 +34,7 @@
-
+
Welcome message
-
+
Participant camera
@@ -81,7 +81,7 @@
-
+
-
+
Final message
Date: Thu, 11 Apr 2024 15:34:52 -0300
Subject: [PATCH 14/16] fix:lint
---
.../organisms/ModeratedCoopsView.vue | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/components/organisms/ModeratedCoopsView.vue b/src/components/organisms/ModeratedCoopsView.vue
index 53b8a8268..cc90a9e37 100644
--- a/src/components/organisms/ModeratedCoopsView.vue
+++ b/src/components/organisms/ModeratedCoopsView.vue
@@ -325,6 +325,7 @@
/>
{
if (!guest.accepted) {
this.notifyCooperator(guest)
From ab56084e9bc316999d8fbbbd88f2dbbd788c72ef Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Thu, 11 Apr 2024 15:35:30 -0300
Subject: [PATCH 15/16] fix(style): fix scroll on edit
---
src/views/admin/EditTestView.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/views/admin/EditTestView.vue b/src/views/admin/EditTestView.vue
index 10a4cc83c..fb53a0571 100644
--- a/src/views/admin/EditTestView.vue
+++ b/src/views/admin/EditTestView.vue
@@ -86,7 +86,7 @@
/>
-->
-
+
\ No newline at end of file
+
From 80084f5e3c93cf89fc23c3dbbb26b422517bfc94 Mon Sep 17 00:00:00 2001
From: jvJUCA
Date: Thu, 11 Apr 2024 15:42:50 -0300
Subject: [PATCH 16/16] feat: sessions with time verification and router guard
---
src/views/public/ModeratedTestView.vue | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/views/public/ModeratedTestView.vue b/src/views/public/ModeratedTestView.vue
index a99651e3f..d27a3fcd7 100644
--- a/src/views/public/ModeratedTestView.vue
+++ b/src/views/public/ModeratedTestView.vue
@@ -13,7 +13,16 @@
{{ test.testDescription }}
-
+
+ The test is available at
+ {{ new Date(this.testDate).toLocaleString() }}
user.userDocId === this.token,
)
+ if (!this.user.userDocId !== this.token && !this.isAdmin) {
+ this.$toast.error(`You don't have access to this session.`)
+ this.$router.push('/testslist/')
+ }
if (this.sessionCooperator.testDate) {
this.testDate = this.sessionCooperator.testDate
} else {
@@ -976,7 +990,7 @@ export default {
this.$toast.info('Use a session your session link to the test')
this.$router.push('/managerview/' + this.test.id)
}
- await this.verifyAdmin()
+
await this.mappingSteps()
this.consentCompleted = this.currentUserTestAnswer.consentCompleted
const ref = doc(db, 'tests/', this.roomTestId)