Add role to user query
This commit is contained in:
parent
d970f75fa4
commit
2adfffd441
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<div class="filter-bar">
|
||||
|
||||
<radiobutton v-if="showEverythingRadioButton" label="Alles" :checked="!currentFilter" v-on:input="updateFilter(false)"></radiobutton>
|
||||
<div class="filter-bar" v-if="isTeacher">
|
||||
<radiobutton label="Alles" :checked="!currentFilter" v-on:input="updateFilter(false)"></radiobutton>
|
||||
<radiobutton
|
||||
v-for="schoolClass in schoolClasses"
|
||||
:key="schoolClass.id"
|
||||
|
|
@ -23,12 +22,6 @@
|
|||
Radiobutton
|
||||
},
|
||||
|
||||
beforeUpdate() {
|
||||
if (!this.showEverythingRadioButton && !this.currentFilter) {
|
||||
this.updateFilter(this.schoolClasses && this.schoolClasses.length > 0 ? this.schoolClasses[0].id : null);
|
||||
}
|
||||
},
|
||||
|
||||
apollo: {
|
||||
me: {
|
||||
query: ME_QUERY
|
||||
|
|
@ -50,9 +43,9 @@
|
|||
schoolClasses() {
|
||||
return this.$getRidOfEdges(this.me.schoolClasses);
|
||||
},
|
||||
showEverythingRadioButton() {
|
||||
return this.me.permissions.includes('user.can_edit_modules');
|
||||
},
|
||||
isTeacher() {
|
||||
return this.me.role === 'teacher';
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ fragment UserParts on UserNode {
|
|||
firstName
|
||||
lastName
|
||||
avatar
|
||||
role
|
||||
schoolClasses {
|
||||
edges {
|
||||
node {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue