Skip to content

Commit

Permalink
Move diff flag to container list 🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
MiroDojkic committed Jan 13, 2021
1 parent 2a27eb1 commit 6479c85
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 7 additions & 4 deletions client/components/editor/ActivityContent/ContainerList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
:elements="processedElements"
:tes="elements"
:position="index"
:is-disabled="isDisabled"
:is-disabled="showPublishDiff"
v-bind="$attrs" />
<div v-if="addBtnEnabled">
<v-btn @click="addContainer" color="blue-grey darken-3" text class="mt-4">
Expand Down Expand Up @@ -64,17 +64,20 @@ export default {
label: { type: String, required: true },
required: { type: Boolean, default: true },
multiple: { type: Boolean, default: false },
displayHeading: { type: Boolean, default: false },
isDisabled: { type: Boolean, default: false }
displayHeading: { type: Boolean, default: false }
},
computed: {
...mapState('repository/contentElements', { elements: 'items' }),
...mapState('editor', ['showPublishDiff']),
containerName() {
const id = getContainerTemplateId(this);
return getContainerName(this.$ccRegistry.get(id) ? id : 'DEFAULT');
},
name: vm => vm.label.toLowerCase(),
addBtnEnabled: vm => !vm.isDisabled && !(!vm.multiple && vm.containerGroup.length),
addBtnEnabled() {
const isMultipleOrEmpty = this.multiple || !this.containerGroup.length;
return !this.showPublishDiff && isMultipleOrEmpty;
},
nextPosition() {
const last = get(maxBy(this.containerGroup, 'position'), 'position', 0);
return last + 1;
Expand Down
3 changes: 1 addition & 2 deletions client/components/editor/ActivityContent/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
:container-group="containerGroup"
:processed-elements="processedElements"
:processed-activities="processedActivities"
:parent-id="activityId"
:is-disabled="showPublishDiff" />
:parent-id="activityId" />
</publish-diff-provider>
</div>
</div>
Expand Down

0 comments on commit 6479c85

Please sign in to comment.