Skip to content
Snippets Groups Projects
Commit 25351330 authored by robinwilliam.hundt's avatar robinwilliam.hundt
Browse files

tutors get reason for rejected pw / Task Type name clipped

parent 94f0c460
No related branches found
No related tags found
1 merge request!151Resolve "Tutor Registration - match password against pwned database"
Pipeline #325512 passed
...@@ -77,10 +77,15 @@ export default { ...@@ -77,10 +77,15 @@ export default {
}) })
this.$emit('hide') this.$emit('hide')
}).catch(() => { }).catch(() => {
let reasons = ''
if (error.response) {
reasons = error.response.data.password.map(reason => `- ${reason}`).join('<br/>')
}
this.$notify({ this.$notify({
title: 'Error!', title: 'Error!',
text: 'Unable to change password', text: `Unable to change password<br/>${reasons}`,
type: 'error' type: 'error',
duration: -1
}) })
}) })
} }
......
...@@ -58,11 +58,17 @@ export default { ...@@ -58,11 +58,17 @@ export default {
this.loading = true this.loading = true
registerTutor(this.credentials).then(() => { registerTutor(this.credentials).then(() => {
this.$emit('registered', this.credentials) 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({ this.$notify({
title: 'Unable to register', title: 'Unable to register',
text: "Couldn't register a tutor account.", text: `Couldn't register a tutor account.<br/>${reasons}`,
type: 'error' type: 'error',
duration: -1
}) })
}).finally(() => { this.loading = false }) }).finally(() => { this.loading = false })
} }
......
<template> <template>
<v-card> <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-layout row wrap>
<v-flex xs3> <v-flex xs3>
<v-list> <v-list>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</v-flex> </v-flex>
<v-flex xs9> <v-flex xs9>
<v-layout v-if="!selectedSubmissionType" justify-center> <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> </v-layout>
<submission-type class="mr-2 mb-2" v-else v-bind="selectedSubmissionType"/> <submission-type class="mr-2 mb-2" v-else v-bind="selectedSubmissionType"/>
</v-flex> </v-flex>
......
...@@ -8,11 +8,11 @@ ...@@ -8,11 +8,11 @@
<!-- dynamically set css class depending on active --> <!-- dynamically set css class depending on active -->
<v-list-tile-content <v-list-tile-content
:class="{'inactive-subscription': !active}" :class="{'inactive-subscription': !active}"
class="ml-3"> class="mr-3 subscription">
{{name}} {{name}}
</v-list-tile-content> </v-list-tile-content>
<v-list-tile-action-text> <v-list-tile-action-text>
available: {{available}} left: {{available}}
</v-list-tile-action-text> </v-list-tile-action-text>
</v-list-tile> </v-list-tile>
</v-layout> </v-layout>
...@@ -55,4 +55,10 @@ export default class SubscriptionForList extends Vue { ...@@ -55,4 +55,10 @@ export default class SubscriptionForList extends Vue {
cursor: default; cursor: default;
color: #B5B5B5; color: #B5B5B5;
} }
.subscription {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style> </style>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment