Disable bookmarking when editing a module

This commit is contained in:
Ramon Wenger 2021-01-26 17:29:12 +01:00
parent 297896e380
commit 5eadff662d
5 changed files with 14 additions and 8 deletions

View File

@ -33,7 +33,7 @@
import AddContentButton from '@/components/AddContentButton';
import BookmarkActions from '@/components/notes/BookmarkActions';
import {mapGetters} from 'vuex';
import {mapState} from 'vuex';
import {isHidden} from '@/helpers/content-block';
import {meQuery} from '@/graphql/queries';
@ -56,7 +56,7 @@
},
computed: {
...mapGetters(['editModule']),
...mapState(['editModule']),
filteredContentBlocks() {
if (!(this.chapter && this.chapter.contentBlocks)) {
return [];

View File

@ -62,7 +62,7 @@
import {meQuery} from '@/graphql/queries';
import {mapGetters} from 'vuex';
import {mapState} from 'vuex';
import {isHidden} from '@/helpers/content-block';
@ -93,7 +93,7 @@
},
computed: {
...mapGetters(['editModule']),
...mapState(['editModule']),
canEditModule() {
return !this.contentBlock.indent && this.editModule;
},

View File

@ -19,7 +19,7 @@
</template>
<script>
import {mapGetters} from 'vuex';
import {mapState} from 'vuex';
import TextBlock from '@/components/content-blocks/TextBlock';
import InstrumentWidget from '@/components/content-blocks/InstrumentWidget';
@ -70,7 +70,7 @@ export default {
},
computed: {
...mapGetters(['editModule']),
...mapState(['editModule']),
bookmarked() {
return this.bookmarks && !!this.bookmarks.find(bookmark => bookmark.uuid === this.component.id);
},

View File

@ -1,5 +1,7 @@
<template>
<div class="bookmark-actions">
<div
class="bookmark-actions"
v-if="!editModule">
<a
:class="{'bookmark-actions__action--bookmarked': bookmarked}"
class="bookmark-actions__action bookmark-actions__bookmark"
@ -27,12 +29,17 @@
import AddNoteIcon from '@/components/icons/AddNoteIcon';
import NoteIcon from '@/components/icons/NoteIcon';
import {mapState} from 'vuex';
export default {
props: ['bookmarked', 'note'],
components: {
BookmarkIcon,
AddNoteIcon,
NoteIcon
},
computed: {
...mapState(['editModule'])
}
};
</script>

View File

@ -46,7 +46,6 @@ export default new Vuex.Store({
scrollToAssignmentReady: state => state.scrollToAssignmentReady,
scrollingToAssignment: state => state.scrollingToAssignment,
currentProjectEntry: state => state.currentProjectEntry,
editModule: state => state.editModule,
currentObjectiveGroup: state => state.currentObjectiveGroup,
currentContent: state => state.currentContent,
currentNoteBlock: state => state.currentNoteBlock,