Add correct component for solution toggle
This commit is contained in:
parent
273d0dc74c
commit
bcff36b49f
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<checkbox
|
<checkbox
|
||||||
:checked="enabled"
|
:checked="module.solutionsEnabled"
|
||||||
label="Lösungen für Lernende anzeigen"
|
label="Lösungen für Lernende anzeigen"
|
||||||
v-if="canToggleSolutions"
|
v-if="canToggleSolutions"
|
||||||
@input="toggleSolutions"/>
|
@input="toggleSolutions"/>
|
||||||
|
|
@ -11,17 +11,16 @@
|
||||||
import UPDATE_SOLUTION_VISIBILITY_MUTATION from '@/graphql/gql/mutations/updateSolutionVisibility.gql';
|
import UPDATE_SOLUTION_VISIBILITY_MUTATION from '@/graphql/gql/mutations/updateSolutionVisibility.gql';
|
||||||
import MODULE_FRAGMENT from '@/graphql/gql/fragments/moduleParts.gql';
|
import MODULE_FRAGMENT from '@/graphql/gql/fragments/moduleParts.gql';
|
||||||
|
|
||||||
import {meQuery} from '@/graphql/queries';
|
import {meQuery, moduleQuery} from '@/graphql/queries';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
props: ['slug', 'enabled'],
|
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
Checkbox
|
Checkbox
|
||||||
},
|
},
|
||||||
|
|
||||||
apollo: {
|
apollo: {
|
||||||
me: meQuery
|
me: meQuery,
|
||||||
|
module: moduleQuery
|
||||||
},
|
},
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -29,12 +28,16 @@
|
||||||
me: {
|
me: {
|
||||||
permissions: []
|
permissions: []
|
||||||
},
|
},
|
||||||
|
module: {}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
canToggleSolutions() {
|
canToggleSolutions() {
|
||||||
return this.me.permissions.includes('users.can_manage_school_class_content');
|
return this.me.permissions.includes('users.can_manage_school_class_content');
|
||||||
|
},
|
||||||
|
slug() {
|
||||||
|
return this.$route.params.slug;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,8 @@ export function moduleQuery() {
|
||||||
variables: {
|
variables: {
|
||||||
slug: this.$route.params.slug
|
slug: this.$route.params.slug
|
||||||
},
|
},
|
||||||
update(data) {
|
update({module}) {
|
||||||
return this.$getRidOfEdges(data).module || {};
|
return this.$getRidOfEdges(module) || {};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<section class="module-settings__section">
|
<section class="module-settings__section">
|
||||||
<h2 class="module-settings__heading">Lösungen</h2>
|
<h2 class="module-settings__heading">Lösungen</h2>
|
||||||
<p class="module-settings__paragraph">Wollen Sie die Lösungen in diesem Modul für Lernende anzeigen?</p>
|
<p class="module-settings__paragraph">Wollen Sie die Lösungen in diesem Modul für Lernende anzeigen?</p>
|
||||||
<checkbox label="Lösungen anzeigen"/>
|
<toggle-solutions-for-module />
|
||||||
</section>
|
</section>
|
||||||
<section class="module-settings__section">
|
<section class="module-settings__section">
|
||||||
<h2 class="module-settings__heading">Sichtbarkeit</h2>
|
<h2 class="module-settings__heading">Sichtbarkeit</h2>
|
||||||
|
|
@ -24,9 +24,11 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Checkbox from '@/components/ui/Checkbox';
|
import Checkbox from '@/components/ui/Checkbox';
|
||||||
|
import ToggleSolutionsForModule from '@/components/toggle-menu/ToggleSolutionsForModule';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
ToggleSolutionsForModule,
|
||||||
Checkbox
|
Checkbox
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -37,6 +39,5 @@
|
||||||
|
|
||||||
.module-settings {
|
.module-settings {
|
||||||
@include settings-page;
|
@include settings-page;
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue