feat(web): shared link filters (#15948)

This commit is contained in:
Jason Rasmussen
2025-02-07 13:05:15 -05:00
committed by GitHub
parent 23014c263b
commit c5360e78c5
22 changed files with 520 additions and 112 deletions

View File

@@ -38,6 +38,14 @@ class PeopleUpdate {
sidebarWeb?: boolean;
}
class SharedLinksUpdate {
@ValidateBoolean({ optional: true })
enabled?: boolean;
@ValidateBoolean({ optional: true })
sidebarWeb?: boolean;
}
class TagsUpdate {
@ValidateBoolean({ optional: true })
enabled?: boolean;
@@ -98,6 +106,11 @@ export class UserPreferencesUpdateDto {
@Type(() => RatingsUpdate)
ratings?: RatingsUpdate;
@Optional()
@ValidateNested()
@Type(() => SharedLinksUpdate)
sharedLinks?: SharedLinksUpdate;
@Optional()
@ValidateNested()
@Type(() => TagsUpdate)
@@ -152,6 +165,11 @@ class TagsResponse {
sidebarWeb: boolean = true;
}
class SharedLinksResponse {
enabled: boolean = true;
sidebarWeb: boolean = false;
}
class EmailNotificationsResponse {
enabled!: boolean;
albumInvite!: boolean;
@@ -175,6 +193,7 @@ export class UserPreferencesResponseDto implements UserPreferences {
memories!: MemoriesResponse;
people!: PeopleResponse;
ratings!: RatingsResponse;
sharedLinks!: SharedLinksResponse;
tags!: TagsResponse;
avatar!: AvatarResponse;
emailNotifications!: EmailNotificationsResponse;

View File

@@ -34,6 +34,10 @@ export interface UserPreferences {
ratings: {
enabled: boolean;
};
sharedLinks: {
enabled: boolean;
sidebarWeb: boolean;
};
tags: {
enabled: boolean;
sidebarWeb: boolean;
@@ -74,6 +78,10 @@ export const getDefaultPreferences = (user: { email: string }): UserPreferences
enabled: true,
sidebarWeb: false,
},
sharedLinks: {
enabled: true,
sidebarWeb: false,
},
ratings: {
enabled: false,
},