Gitlab Community Edition Instance

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

Removed exam Instance from store/Added header slot for nav-drawer

parent 56513be0
Branches
Tags
1 merge request!25WIP: Resolve "A new student overview page with Vue.js"
......@@ -16,7 +16,7 @@
</v-btn>
</v-list-tile-action>
<v-list-tile-content class="title">
{{ examInstance }}
<slot name="header"></slot>
</v-list-tile-content>
<v-list-tile-action>
<v-btn icon @click.native.stop="mini = !mini">
......
<template>
<base-layout>
<template slot="header">
{{ module_reference }}
</template>
<v-list dense slot="navigation">
<v-list-tile exact v-for="(item, i) in generalNavItems" :key="i" :to="item.route">
<v-list-tile-action>
......@@ -28,6 +31,7 @@
</template>
<script>
import { mapState } from 'vuex'
import BaseLayout from '../base/BaseLayout'
export default {
components: {BaseLayout},
......@@ -49,8 +53,12 @@
}
},
computed: {
...mapState({
module_reference: state => state.studentPage.exam.module_reference,
submissions: state => state.studentPage.submissions
}),
submissionNavItems: function () {
return this.$store.state.studentPage.submissions.map((sub, index) => {
return this.submissions.map((sub, index) => {
return {
name: sub.type_name,
route: `/student/submission/${sub.type_id}`
......
......@@ -19,7 +19,6 @@ const store = new Vuex.Store({
username: '',
userRole: '',
error: '',
examInstance: ''
},
getters: {
gradySpeak: state => {
......@@ -43,10 +42,6 @@ const store = new Vuex.Store({
},
'SET_USER_ROLE': function (state, userRole) {
state.userRole = userRole
},
'SET_EXAM_INSTANCE': function (state, examInstance) {
state.examInstance = examInstance
}
},
actions: {
async getJWTToken (context, credentials) {
......@@ -69,9 +64,6 @@ const store = new Vuex.Store({
getUserRole (context) {
ax.get('api/user-role/').then(response => context.commit('SET_USER_ROLE', response.data.role))
},
getExamModule (context) {
ax.get('api/exam-module/').then(response => context.commit('SET_EXAM_INSTANCE', response.data.exam))
},
logout (store) {
store.commit('LOGOUT')
store.commit('SET_JWT_TOKEN', '')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment