mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
fix: prevent trashing of trashed assets (#10028)
* fix: prevent trashing of trashed assets Motivation ---------- This will improve user experience by hiding a pointless action. You can not trash a trashed asset again. It won't get any trashier than it already is. How to test ----------- 1. Visit route `/trash` 2. Click on an asset 3. Press "Delete" on your keyboard 4. Nothing happens 5. Try to find the trash button in the top right 6. You can't find it * refactor: follow @michelheusschen's review See: https://github.com/immich-app/immich/pull/10028#pullrequestreview-2105296755 * refactor: follow @michelheusschen's 2nd review See: https://github.com/immich-app/immich/pull/10028#discussion_r1632057833
This commit is contained in:
parent
e1e7de4d4c
commit
d8d64ecc45
6 changed files with 129 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { faker } from '@faker-js/faker';
|
||||
import { UserAvatarColor, type UserResponseDto } from '@immich/sdk';
|
||||
import { UserAvatarColor, UserStatus, type UserAdminResponseDto, type UserResponseDto } from '@immich/sdk';
|
||||
import { Sync } from 'factory.ts';
|
||||
|
||||
export const userFactory = Sync.makeFactory<UserResponseDto>({
|
||||
|
|
@ -9,3 +9,21 @@ export const userFactory = Sync.makeFactory<UserResponseDto>({
|
|||
profileImagePath: '',
|
||||
avatarColor: UserAvatarColor.Primary,
|
||||
});
|
||||
|
||||
export const userAdminFactory = Sync.makeFactory<UserAdminResponseDto>({
|
||||
id: Sync.each(() => faker.string.uuid()),
|
||||
email: Sync.each(() => faker.internet.email()),
|
||||
name: Sync.each(() => faker.person.fullName()),
|
||||
profileImagePath: '',
|
||||
avatarColor: UserAvatarColor.Primary,
|
||||
isAdmin: true,
|
||||
createdAt: Sync.each(() => faker.date.recent().toISOString()),
|
||||
updatedAt: Sync.each(() => faker.date.recent().toISOString()),
|
||||
deletedAt: null,
|
||||
oauthId: '',
|
||||
quotaUsageInBytes: 0,
|
||||
quotaSizeInBytes: 1000,
|
||||
shouldChangePassword: false,
|
||||
status: UserStatus.Active,
|
||||
storageLabel: null,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue