Skip to content

Commit

Permalink
Options conditional rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVelezLl committed Feb 27, 2024
1 parent ad5ce70 commit 9c80359
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
label: this.$tr('editLearningActivitiesButton'),
icon: 'activities',
onClick: this.quickEditModalFactory(QuickEditModals.LEARNING_ACTIVITIES),
condition: this.canEdit,
condition: this.canEdit && this.isResourceSelected,
disabled: this.isTopicSelected,
dataTest: 'change-learning-activities-btn',
},
Expand All @@ -417,15 +417,15 @@
label: this.$tr('editSourceButton'),
icon: 'attribution',
onClick: this.quickEditModalFactory(QuickEditModals.SOURCE),
condition: this.canEdit,
condition: this.canEdit && this.isResourceSelected,
disabled: this.isTopicSelected,
dataTest: 'change-learning-activities-btn',
},
{
label: this.$tr('editAudienceButton'),
icon: 'audience',
onClick: this.quickEditModalFactory(QuickEditModals.AUDIENCE),
condition: this.canEdit,
condition: this.canEdit && this.isResourceSelected,
disabled: this.isTopicSelected,
dataTest: 'change-audience-btn',
},
Expand Down Expand Up @@ -463,6 +463,9 @@
isTopicSelected() {
return this.selectedNodes.some(node => node.kind === ContentKindsNames.TOPIC);
},
isResourceSelected() {
return this.selectedNodes.some(node => node.kind !== ContentKindsNames.TOPIC);
},
ancestors() {
return this.getContentNodeAncestors(this.topicId, true).map(ancestor => {
return {
Expand Down
4 changes: 2 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9116,9 +9116,9 @@ kolibri-constants@^0.2.0:
resolved "https://registry.yarnpkg.com/kolibri-constants/-/kolibri-constants-0.2.0.tgz#47c9d773894e23251ba5ac4db420822e45603142"
integrity sha512-WYDMGDzB9gNxRbpX1O2cGe1HrJvLvSZGwMuAv6dqrxJgPf7iO+Hi40/1CXjHM7nk5CRt+hn5bqnMzCBmj1omPA==

"kolibri-design-system@https://github.com/AlexVelezLl/kolibri-design-system#086b5c3f1f109234d1ad4b521651fbc88f04c54c":
"kolibri-design-system@https://github.com/AlexVelezLl/kolibri-design-system#7971ea4b49b7f1c817d80aaa01286e630801d3c2":
version "3.0.1"
resolved "https://github.com/AlexVelezLl/kolibri-design-system#086b5c3f1f109234d1ad4b521651fbc88f04c54c"
resolved "https://github.com/AlexVelezLl/kolibri-design-system#7971ea4b49b7f1c817d80aaa01286e630801d3c2"
dependencies:
"@vue/composition-api" "^1.7.2"
aphrodite "https://github.com/learningequality/aphrodite/"
Expand Down

0 comments on commit 9c80359

Please sign in to comment.