Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update the profile picture in the navigation-bar #12723

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions e2e/src/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const signupResponseDto = {
quotaSizeInBytes: null,
status: 'active',
license: null,
profileChangedAt: expect.any(String),
},
};

Expand Down
10 changes: 9 additions & 1 deletion mobile/openapi/lib/model/create_profile_image_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion mobile/openapi/lib/model/partner_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion mobile/openapi/lib/model/user_admin_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion mobile/openapi/lib/model/user_response_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions open-api/immich-openapi-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -8746,6 +8746,10 @@
},
"CreateProfileImageResponseDto": {
"properties": {
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
},
Expand All @@ -8754,6 +8758,7 @@
}
},
"required": [
"profileChangedAt",
"profileImagePath",
"userId"
],
Expand Down Expand Up @@ -9963,6 +9968,10 @@
"name": {
"type": "string"
},
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
}
Expand All @@ -9972,6 +9981,7 @@
"email",
"id",
"name",
"profileChangedAt",
"profileImagePath"
],
"type": "object"
Expand Down Expand Up @@ -12402,6 +12412,10 @@
"oauthId": {
"type": "string"
},
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
},
Expand Down Expand Up @@ -12440,6 +12454,7 @@
"license",
"name",
"oauthId",
"profileChangedAt",
"profileImagePath",
"quotaSizeInBytes",
"quotaUsageInBytes",
Expand Down Expand Up @@ -12601,6 +12616,10 @@
"name": {
"type": "string"
},
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
}
Expand All @@ -12610,6 +12629,7 @@
"email",
"id",
"name",
"profileChangedAt",
"profileImagePath"
],
"type": "object"
Expand Down
4 changes: 4 additions & 0 deletions open-api/typescript-sdk/src/fetch-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type UserResponseDto = {
email: string;
id: string;
name: string;
profileChangedAt: string;
profileImagePath: string;
};
export type ActivityResponseDto = {
Expand Down Expand Up @@ -53,6 +54,7 @@ export type UserAdminResponseDto = {
license: (UserLicense) | null;
name: string;
oauthId: string;
profileChangedAt: string;
profileImagePath: string;
quotaSizeInBytes: number | null;
quotaUsageInBytes: number | null;
Expand Down Expand Up @@ -666,6 +668,7 @@ export type PartnerResponseDto = {
id: string;
inTimeline?: boolean;
name: string;
profileChangedAt: string;
profileImagePath: string;
};
export type UpdatePartnerDto = {
Expand Down Expand Up @@ -1249,6 +1252,7 @@ export type CreateProfileImageDto = {
file: Blob;
};
export type CreateProfileImageResponseDto = {
profileChangedAt: string;
profileImagePath: string;
userId: string;
};
Expand Down
8 changes: 1 addition & 7 deletions server/src/dtos/user-profile.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ export class CreateProfileImageDto {

export class CreateProfileImageResponseDto {
userId!: string;
profileChangedAt!: Date;
profileImagePath!: string;
}

export function mapCreateProfileImageResponse(userId: string, profileImagePath: string): CreateProfileImageResponseDto {
return {
userId,
profileImagePath,
};
}
2 changes: 2 additions & 0 deletions server/src/dtos/user.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class UserResponseDto {
profileImagePath!: string;
@ApiProperty({ enumName: 'UserAvatarColor', enum: UserAvatarColor })
avatarColor!: UserAvatarColor;
profileChangedAt!: Date;
}

export class UserLicense {
Expand All @@ -47,6 +48,7 @@ export const mapUser = (entity: UserEntity): UserResponseDto => {
name: entity.name,
profileImagePath: entity.profileImagePath,
avatarColor: getPreferences(entity).avatar.color,
profileChangedAt: entity.profileChangedAt,
};
};

Expand Down
3 changes: 3 additions & 0 deletions server/src/entities/user.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,7 @@ export class UserEntity {

@OneToMany(() => UserMetadataEntity, (metadata) => metadata.user)
metadata!: UserMetadataEntity[];

@Column({ type: 'timestamptz', default: () => 'CURRENT_TIMESTAMP' })
profileChangedAt!: Date;
}
Loading
Loading