-
Notifications
You must be signed in to change notification settings - Fork 44
/
ShowSubmissionDialog.vue
73 lines (66 loc) · 2.21 KB
/
ShowSubmissionDialog.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<template>
<v-dialog
:value="dialog"
@input="$emit('dialog', false)"
@keydown.esc="$emit('dialog', false)"
max-width="75%"
>
<v-card>
<v-card-title>
<span class="headline">{{ submission.question.title }}</span>
</v-card-title>
<v-card-text class="text-left">
<show-question :question="submission.question" />
<div v-if="submission.argument !== null && submission.name === $store.getters.getUser.name">
<h3 style="display: inline">Argument: </h3>
<p style="display: inline">{{ submission.argument }}</p>
</div>
</v-card-text>
<v-card-title>
<span class="headline">{{ 'Reviews' }}</span>
</v-card-title>
<div class="text-left">
<show-reviews
class="history"
:key="reviewsComponentKey"
:submission="submission"
/>
</div>
<v-card-actions>
<v-spacer />
<v-btn dark color="primary" data-cy="close" @click="$emit('dialog')"
>close</v-btn
>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script lang="ts">
import { Component, Vue, Prop, Model, Watch } from 'vue-property-decorator';
import ShowReviews from '@/views/student/submissions/ShowReviews.vue'
import ShowQuestion from '@/views/student/submissions/ShowQuestion.vue';
import Submission from '@/models/management/Submission';
@Component({
components: {
'show-question': ShowQuestion,
'show-reviews': ShowReviews
}
})
export default class ShowSubmissionDialog extends Vue {
@Model('dialog', Boolean) dialog!: boolean;
@Prop({ type: Submission, required: true }) readonly submission!: Submission;
reviewsComponentKey: number = 0;
@Watch('dialog')
forceRerender() {
if (this.dialog) {
this.reviewsComponentKey += 1;
}
}
}
</script>
<style lang="scss" scoped>
.history {
max-height: 235px;
overflow-y: auto;
}
</style>