Skip to content

Commit

Permalink
Disable buttons while saving
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVelezLl committed Jan 13, 2025
1 parent 24150e1 commit e952876
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@
type: Array,
required: true,
},
disabled: {
type: Boolean,
default: false,
},
},
computed: {
channelsLink() {
Expand Down Expand Up @@ -151,6 +155,9 @@
}
},
contentCheckboxDisabled(resource) {
if (this.disabled) {
return true;
}
return !this.selectionRules.every(rule => rule(resource) === true);
},
contentIsChecked(resource) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
:style="lessonOrderListButtonBorder"
>
<div class="row-content">
<DragHandle v-if="selectedResources.length > 1">
<DragHandle v-if="selectedResources.length > 1 && !disabled">
<DragSortWidget
:moveUpText="upLabel$"
:moveDownText="downLabel$"
Expand Down Expand Up @@ -63,13 +63,15 @@
icon="emptyTopic"
:ariaLabel="$tr('openParentFolderLabel')"
:tooltip="$tr('openParentFolderLabel')"
:disabled="disabled"
@click="navigateToParent(resource)"
/>

<KIconButton
icon="minus"
:ariaLabel="$tr('removeResourceLabel')"
:tooltip="$tr('removeResourceLabel')"
:disabled="disabled"
@click="removeResource(resource)"
/>
</span>
Expand Down Expand Up @@ -165,6 +167,10 @@
type: Number,
required: true,
},
disabled: {
type: Boolean,
default: false,
},
},
computed: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
canSelectAll
:contentList="contentList"
:hasMore="hasMore"
:disabled="disabled"
:fetchMore="fetchMore"
:loadingMore="loadingMore"
:selectionRules="selectionRules"
Expand Down Expand Up @@ -79,6 +80,10 @@
type: Array,
required: true,
},
disabled: {
type: Boolean,
default: false,
},
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<UpdatedResourceSelection
canSelectAll
:topic="topic"
:disabled="disabled"
:contentList="contentList"
:hasMore="hasMore"
:fetchMore="fetchMore"
Expand Down Expand Up @@ -112,6 +113,10 @@
type: Array,
required: true,
},
disabled: {
type: Boolean,
default: false,
},
},
beforeRouteEnter(to, _, next) {
const { topicId } = to.query;
Expand Down

0 comments on commit e952876

Please sign in to comment.