From 25351330e9f6bd99e034763711a62071baea8b62 Mon Sep 17 00:00:00 2001 From: "robinwilliam.hundt" <robinwilliam.hundt@stud.uni-goettingen.de> Date: Sun, 3 Mar 2019 16:35:09 +0100 Subject: [PATCH] tutors get reason for rejected pw / Task Type name clipped --- frontend/src/components/PasswordChangeDialog.vue | 9 +++++++-- frontend/src/components/RegisterDialog.vue | 12 +++++++++--- frontend/src/components/SubmissionTypesOverview.vue | 4 ++-- .../components/subscriptions/SubscriptionForList.vue | 10 ++++++++-- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/PasswordChangeDialog.vue b/frontend/src/components/PasswordChangeDialog.vue index 8712b593..5a14e10e 100644 --- a/frontend/src/components/PasswordChangeDialog.vue +++ b/frontend/src/components/PasswordChangeDialog.vue @@ -77,10 +77,15 @@ export default { }) this.$emit('hide') }).catch(() => { + let reasons = '' + if (error.response) { + reasons = error.response.data.password.map(reason => `- ${reason}`).join('<br/>') + } this.$notify({ title: 'Error!', - text: 'Unable to change password', - type: 'error' + text: `Unable to change password<br/>${reasons}`, + type: 'error', + duration: -1 }) }) } diff --git a/frontend/src/components/RegisterDialog.vue b/frontend/src/components/RegisterDialog.vue index 5687f055..b5c1f760 100644 --- a/frontend/src/components/RegisterDialog.vue +++ b/frontend/src/components/RegisterDialog.vue @@ -58,11 +58,17 @@ export default { this.loading = true registerTutor(this.credentials).then(() => { this.$emit('registered', this.credentials) - }).catch(() => { + }).catch(error => { + let reasons = '' + if (error.response) { + reasons = error.response.data.password.map(reason => `- ${reason}`).join('<br/>') + } + console.log(reasons) this.$notify({ title: 'Unable to register', - text: "Couldn't register a tutor account.", - type: 'error' + text: `Couldn't register a tutor account.<br/>${reasons}`, + type: 'error', + duration: -1 }) }).finally(() => { this.loading = false }) } diff --git a/frontend/src/components/SubmissionTypesOverview.vue b/frontend/src/components/SubmissionTypesOverview.vue index 3082ed56..88efc529 100644 --- a/frontend/src/components/SubmissionTypesOverview.vue +++ b/frontend/src/components/SubmissionTypesOverview.vue @@ -1,6 +1,6 @@ <template> <v-card> - <v-card-title class="title">Assignment types</v-card-title> + <v-card-title class="title">Task types</v-card-title> <v-layout row wrap> <v-flex xs3> <v-list> @@ -16,7 +16,7 @@ </v-flex> <v-flex xs9> <v-layout v-if="!selectedSubmissionType" justify-center> - <strong>Select an assignment type on the left to see the description and solution.</strong> + <strong>Select a task type on the left to see the description and solution.</strong> </v-layout> <submission-type class="mr-2 mb-2" v-else v-bind="selectedSubmissionType"/> </v-flex> diff --git a/frontend/src/components/subscriptions/SubscriptionForList.vue b/frontend/src/components/subscriptions/SubscriptionForList.vue index c19b60bf..d88fa9cf 100644 --- a/frontend/src/components/subscriptions/SubscriptionForList.vue +++ b/frontend/src/components/subscriptions/SubscriptionForList.vue @@ -8,11 +8,11 @@ <!-- dynamically set css class depending on active --> <v-list-tile-content :class="{'inactive-subscription': !active}" - class="ml-3"> + class="mr-3 subscription"> {{name}} </v-list-tile-content> <v-list-tile-action-text> - available: {{available}} + left: {{available}} </v-list-tile-action-text> </v-list-tile> </v-layout> @@ -55,4 +55,10 @@ export default class SubscriptionForList extends Vue { cursor: default; color: #B5B5B5; } + + .subscription { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } </style> -- GitLab