feat (server, web): Implement Archive (#2225)

* feat (server, web): add archive

* chore: generate api

* feat (web): add empty placeholder for archive page

* chore: remove title on favorites page

Duplicates sidebar selection. Two pages (Archive and Favorites)
are consistent now

* refactor (web): create EmptyPlaceholder component for empty pages

* fixed menu close button not close:

* fix (web): remove not necessary store call

* test (web): simplify asset tests code

* test (web): simplify asset tests code

* chore (server): remove isArchived while uploading

* chore (server): remove isArchived from typesense schema

* chore: generate api

* fix (web): delete asset from archive page

* chore: change archive asset count endpoint

old endpoint: /asset/archived-count-by-user-id
new endpoint: /asset/stat/archive

* chore: generate api

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Sergey Kondrikov
2023-04-12 18:37:52 +03:00
committed by GitHub
parent eb9481b668
commit d314805caf
39 changed files with 861 additions and 97 deletions

View File

@@ -19,6 +19,7 @@ export class AssetResponseDto {
fileModifiedAt!: string;
updatedAt!: string;
isFavorite!: boolean;
isArchived!: boolean;
mimeType!: string | null;
duration!: string;
webpPath!: string | null;
@@ -43,6 +44,7 @@ export function mapAsset(entity: AssetEntity): AssetResponseDto {
fileModifiedAt: entity.fileModifiedAt,
updatedAt: entity.updatedAt,
isFavorite: entity.isFavorite,
isArchived: entity.isArchived,
mimeType: entity.mimeType,
webpPath: entity.webpPath,
encodedVideoPath: entity.encodedVideoPath,
@@ -68,6 +70,7 @@ export function mapAssetWithoutExif(entity: AssetEntity): AssetResponseDto {
fileModifiedAt: entity.fileModifiedAt,
updatedAt: entity.updatedAt,
isFavorite: entity.isFavorite,
isArchived: entity.isArchived,
mimeType: entity.mimeType,
webpPath: entity.webpPath,
encodedVideoPath: entity.encodedVideoPath,

View File

@@ -28,6 +28,11 @@ export class SearchDto {
@Transform(toBoolean)
isFavorite?: boolean;
@IsBoolean()
@IsOptional()
@Transform(toBoolean)
isArchived?: boolean;
@IsString()
@IsNotEmpty()
@IsOptional()

View File

@@ -15,6 +15,7 @@ export interface SearchFilter {
userId: string;
type?: AssetType;
isFavorite?: boolean;
isArchived?: boolean;
city?: string;
state?: string;
country?: string;