refactor: user entity (#16655)
* refactor: user entity * fix: add users to album & user profile url * chore: rebase fixes * generate files * fix(mobile): timeline not reset on login * fix: test stub * refactor: rename user model (#16813) * refactor: rename user model * simplify import --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com> * chore: generate files * fix: use getAllAccessible instead of getAll --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Vendored
+3
-2
@@ -1,4 +1,5 @@
|
||||
import 'package:immich_mobile/entities/album.entity.dart';
|
||||
import 'package:immich_mobile/infrastructure/entities/user.entity.dart';
|
||||
|
||||
import 'asset.stub.dart';
|
||||
import 'user.stub.dart';
|
||||
@@ -26,7 +27,7 @@ final class AlbumStub {
|
||||
shared: true,
|
||||
activityEnabled: false,
|
||||
endDate: DateTime(2020),
|
||||
)..sharedUsers.addAll([UserStub.admin]);
|
||||
)..sharedUsers.addAll([User.fromDto(UserStub.admin)]);
|
||||
|
||||
static final oneAsset = Album(
|
||||
name: "album-with-single-asset",
|
||||
@@ -53,7 +54,7 @@ final class AlbumStub {
|
||||
)
|
||||
..assets.addAll([AssetStub.image1, AssetStub.image2])
|
||||
..activityEnabled = true
|
||||
..owner.value = UserStub.admin;
|
||||
..owner.value = User.fromDto(UserStub.admin);
|
||||
|
||||
static final create2020end2020Album = Album(
|
||||
name: "create2020update2020Album",
|
||||
|
||||
Vendored
+16
-16
@@ -1,35 +1,35 @@
|
||||
import 'package:immich_mobile/entities/user.entity.dart';
|
||||
import 'package:immich_mobile/domain/models/user.model.dart';
|
||||
|
||||
abstract final class UserStub {
|
||||
const UserStub._();
|
||||
|
||||
static final admin = User(
|
||||
id: "admin",
|
||||
updatedAt: DateTime(2021),
|
||||
static final admin = UserDto(
|
||||
uid: "admin",
|
||||
email: "admin@test.com",
|
||||
name: "admin",
|
||||
isAdmin: true,
|
||||
profileImagePath: '',
|
||||
avatarColor: AvatarColorEnum.green,
|
||||
updatedAt: DateTime(2021),
|
||||
profileImagePath: null,
|
||||
avatarColor: AvatarColor.green,
|
||||
);
|
||||
|
||||
static final user1 = User(
|
||||
id: "user1",
|
||||
updatedAt: DateTime(2022),
|
||||
static final user1 = UserDto(
|
||||
uid: "user1",
|
||||
email: "user1@test.com",
|
||||
name: "user1",
|
||||
isAdmin: false,
|
||||
profileImagePath: '',
|
||||
avatarColor: AvatarColorEnum.red,
|
||||
updatedAt: DateTime(2022),
|
||||
profileImagePath: null,
|
||||
avatarColor: AvatarColor.red,
|
||||
);
|
||||
|
||||
static final user2 = User(
|
||||
id: "user2",
|
||||
updatedAt: DateTime(2023),
|
||||
static final user2 = UserDto(
|
||||
uid: "user2",
|
||||
email: "user2@test.com",
|
||||
name: "user2",
|
||||
isAdmin: false,
|
||||
profileImagePath: '',
|
||||
avatarColor: AvatarColorEnum.primary,
|
||||
updatedAt: DateTime(2023),
|
||||
profileImagePath: null,
|
||||
avatarColor: AvatarColor.primary,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user