mirror of
https://github.com/immich-app/immich.git
synced 2026-03-26 20:00:44 +03:00
fix(mobile/web): album cover buttons consistency (#27213)
* fix(mobile/web): album cover buttons consistency * test: adjust test
This commit is contained in:
@@ -143,8 +143,7 @@ enum ActionButtonType {
|
|||||||
!context.isInLockedView && //
|
!context.isInLockedView && //
|
||||||
context.currentAlbum != null,
|
context.currentAlbum != null,
|
||||||
ActionButtonType.setAlbumCover =>
|
ActionButtonType.setAlbumCover =>
|
||||||
context.isOwner && //
|
!context.isInLockedView && //
|
||||||
!context.isInLockedView && //
|
|
||||||
context.currentAlbum != null && //
|
context.currentAlbum != null && //
|
||||||
context.selectedCount == 1,
|
context.selectedCount == 1,
|
||||||
ActionButtonType.unstack =>
|
ActionButtonType.unstack =>
|
||||||
|
|||||||
@@ -727,7 +727,7 @@ void main() {
|
|||||||
expect(ActionButtonType.setAlbumCover.shouldShow(context), isTrue);
|
expect(ActionButtonType.setAlbumCover.shouldShow(context), isTrue);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should not show when not owner', () {
|
test('should show when not owner', () {
|
||||||
final album = createRemoteAlbum();
|
final album = createRemoteAlbum();
|
||||||
final context = ActionButtonContext(
|
final context = ActionButtonContext(
|
||||||
asset: mergedAsset,
|
asset: mergedAsset,
|
||||||
@@ -742,7 +742,7 @@ void main() {
|
|||||||
selectedCount: 1,
|
selectedCount: 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(ActionButtonType.setAlbumCover.shouldShow(context), isFalse);
|
expect(ActionButtonType.setAlbumCover.shouldShow(context), isTrue);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should not show when in locked view', () {
|
test('should not show when in locked view', () {
|
||||||
|
|||||||
@@ -476,13 +476,6 @@
|
|||||||
<ChangeDate menuItem />
|
<ChangeDate menuItem />
|
||||||
<ChangeDescription menuItem />
|
<ChangeDescription menuItem />
|
||||||
<ChangeLocation menuItem />
|
<ChangeLocation menuItem />
|
||||||
{#if assetInteraction.selectedAssets.length === 1}
|
|
||||||
<MenuOption
|
|
||||||
text={$t('set_as_album_cover')}
|
|
||||||
icon={mdiImageOutline}
|
|
||||||
onClick={() => updateThumbnailUsingCurrentSelection()}
|
|
||||||
/>
|
|
||||||
{/if}
|
|
||||||
<ArchiveAction
|
<ArchiveAction
|
||||||
menuItem
|
menuItem
|
||||||
unarchive={assetInteraction.isAllArchived}
|
unarchive={assetInteraction.isAllArchived}
|
||||||
@@ -490,6 +483,13 @@
|
|||||||
/>
|
/>
|
||||||
<SetVisibilityAction menuItem onVisibilitySet={handleSetVisibility} />
|
<SetVisibilityAction menuItem onVisibilitySet={handleSetVisibility} />
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if assetInteraction.selectedAssets.length === 1}
|
||||||
|
<MenuOption
|
||||||
|
text={$t('set_as_album_cover')}
|
||||||
|
icon={mdiImageOutline}
|
||||||
|
onClick={() => updateThumbnailUsingCurrentSelection()}
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
|
|
||||||
{#if $preferences.tags.enabled && assetInteraction.isAllUserOwned}
|
{#if $preferences.tags.enabled && assetInteraction.isAllUserOwned}
|
||||||
<TagAction menuItem />
|
<TagAction menuItem />
|
||||||
|
|||||||
Reference in New Issue
Block a user