Skip to content

Commit

Permalink
Add select all and deselect all buttons to the contant and media root…
Browse files Browse the repository at this point in the history
… node menu (#1)
  • Loading branch information
OwainJ authored Jun 18, 2024
1 parent ae595c2 commit 79b4272
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@
label-off="Include only published nodes"
label-position="right">
</umb-toggle>
<umb-button class="select-all"
action="vm.selectAllContent();"
label-key="migratorSource_selectAllContent"
type="button"
button-style="info">
</umb-button>
<umb-button action="vm.deselectAllContent();"
label-key="migratorSource_deselectAllContent"
type="button"
button-style="info">
</umb-button>
</div>
<div class="root-node-previews">
<div class="root-node-previews__node" ng-repeat="item in vm.rootNodes" ng-click="vm.toggleNode(item.Id)" ng-class="(vm.settings.selectedRootNodes.includes(item.Id) === true) ? '-include' : '-exclude'">
Expand All @@ -77,6 +88,17 @@
label-off="Include physical media files"
label-position="right">
</umb-toggle>
<umb-button class="select-all"
action="vm.selectAllMedia();"
label-key="migratorSource_selectAllMedia"
type="button"
button-style="info">
</umb-button>
<umb-button action="vm.deselectAllMedia();"
label-key="migratorSource_deselectAllMedia"
type="button"
button-style="info">
</umb-button>
</div>

<div class="root-node-previews">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,30 @@
});
}

vm.selectAllMedia = () => {
if (vm.rootMediaNodes == null) { return; }
vm.settings.selectedRootMediaNodes = [];
vm.rootMediaNodes.forEach(item => {
vm.settings.selectedRootMediaNodes.push(item.Id);
});
}

vm.selectAllContent = () => {
if (vm.rootNodes == null) { return; }
vm.settings.selectedRootNodes = [];
vm.rootNodes.forEach(item => {
vm.settings.selectedRootNodes.push(item.Id);
});
}

vm.deselectAllMedia = () => {
vm.settings.selectedRootMediaNodes = [];
}

vm.deselectAllContent = () => {
vm.settings.selectedRootNodes = [];
}

//// Private Functions ////
function initialise() {
vm.rootNodes = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,13 @@

.migrator-dashboard .settings-container {
display: flex;
gap: 20px;
gap: 10px;
margin-bottom: 10px;
}

.migrator-dashboard .settings-container .select-all {
margin-left: auto;
}

.migrator-dashboard .settings-container__setting {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,9 @@
<key alias="downloadSnapshot">Download</key>
<key alias="deleteSnapshot">Delete</key>
<key alias="deleteAllSnapshots">Delete all</key>
<key alias="selectAllContent">Select All</key>
<key alias="selectAllMedia">Select All</key>
<key alias="deselectAllMedia">Deselect All</key>
<key alias="deselectAllContent">Deselect All</key>
</area>
</language>

0 comments on commit 79b4272

Please sign in to comment.