feat(web,server): user storage label (#2418)

* feat: user storage label

* chore: open api

* fix: checks

* fix: api update validation and tests

* feat: default admin storage label

* fix: linting

* fix: user create/update dto

* fix: delete library with custom label
This commit is contained in:
Jason Rasmussen
2023-05-21 23:18:10 -04:00
committed by GitHub
parent 0ccb73cf2b
commit 74353193f8
43 changed files with 452 additions and 137 deletions

View File

@@ -43,7 +43,7 @@ export const authStub = {
isAllowUpload: true,
}),
user1: Object.freeze<AuthUserDto>({
id: 'immich_id',
id: 'user-id',
email: 'immich@test.com',
isAdmin: false,
isPublicUser: false,
@@ -81,6 +81,7 @@ export const userEntityStub = {
password: 'admin_password',
firstName: 'admin_first_name',
lastName: 'admin_last_name',
storageLabel: 'admin',
oauthId: '',
shouldChangePassword: false,
profileImagePath: '',
@@ -94,6 +95,21 @@ export const userEntityStub = {
password: 'immich_password',
firstName: 'immich_first_name',
lastName: 'immich_last_name',
storageLabel: null,
oauthId: '',
shouldChangePassword: false,
profileImagePath: '',
createdAt: '2021-01-01',
updatedAt: '2021-01-01',
tags: [],
assets: [],
}),
storageLabel: Object.freeze<UserEntity>({
...authStub.user1,
password: 'immich_password',
firstName: 'immich_first_name',
lastName: 'immich_last_name',
storageLabel: 'label-1',
oauthId: '',
shouldChangePassword: false,
profileImagePath: '',
@@ -536,7 +552,7 @@ export const loginResponseStub = {
user1oauth: {
response: {
accessToken: 'cmFuZG9tLWJ5dGVz',
userId: 'immich_id',
userId: 'user-id',
userEmail: 'immich@test.com',
firstName: 'immich_first_name',
lastName: 'immich_last_name',
@@ -552,7 +568,7 @@ export const loginResponseStub = {
user1password: {
response: {
accessToken: 'cmFuZG9tLWJ5dGVz',
userId: 'immich_id',
userId: 'user-id',
userEmail: 'immich@test.com',
firstName: 'immich_first_name',
lastName: 'immich_last_name',
@@ -568,7 +584,7 @@ export const loginResponseStub = {
user1insecure: {
response: {
accessToken: 'cmFuZG9tLWJ5dGVz',
userId: 'immich_id',
userId: 'user-id',
userEmail: 'immich@test.com',
firstName: 'immich_first_name',
lastName: 'immich_last_name',