feat(web): Add stacking option to deduplication utilities ()

* feat(web): Add stacking option to deduplication utilities

* Update web/src/lib/components/utilities-page/duplicates/duplicates-compare-control.svelte

Co-authored-by: Alex <alex.tran1502@gmail.com>

* Fix prettier

* Draft for server side modifications. Endpoint for stacks (PUT,DELETE)

* Fix error

* Disable stakc button if less or more than one asset selected

* Remove unnecesarry log

* Revert to first commit

* Further Revert

* Actually Revert to Origin

* Only one stack button

* Update +page.svelte

* Fix optional arguments

* Fix Prettier

* Fix Linting

* Add stack information to asset view

* clean up

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
i-am-a-teapot 2024-08-06 19:06:30 +02:00 committed by GitHub
parent 9f4fad2a0f
commit 65f5118bdd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 82 additions and 30 deletions
web/src/lib/utils

View file

@ -324,7 +324,7 @@ export const getSelectedAssets = (assets: Set<AssetResponseDto>, user: UserRespo
return ids;
};
export const stackAssets = async (assets: AssetResponseDto[]) => {
export const stackAssets = async (assets: AssetResponseDto[], showNotification = true) => {
if (assets.length < 2) {
return false;
}
@ -362,16 +362,18 @@ export const stackAssets = async (assets: AssetResponseDto[]) => {
parent.stack = parent.stack.concat(children, grandChildren);
parent.stackCount = parent.stack.length + 1;
notificationController.show({
message: $t('stacked_assets_count', { values: { count: parent.stackCount } }),
type: NotificationType.Info,
button: {
text: $t('view_stack'),
onClick() {
return assetViewingStore.setAssetId(parent.id);
if (showNotification) {
notificationController.show({
message: $t('stacked_assets_count', { values: { count: parent.stackCount } }),
type: NotificationType.Info,
button: {
text: $t('view_stack'),
onClick() {
return assetViewingStore.setAssetId(parent.id);
},
},
},
});
});
}
return ids;
};