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

View File

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

View File

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

View File

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

View File

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