Skip to content

Commit

Permalink
fix: update the profile picture in the navigation-bar (#12723)
Browse files Browse the repository at this point in the history
* fix: update the profile picture in the navigation-bar

* chore: clean up

---------

Co-authored-by: Jason Rasmussen <[email protected]>
  • Loading branch information
martabal and jrasm91 authored Sep 17, 2024
1 parent b0aafce commit c468da5
Show file tree
Hide file tree
Showing 23 changed files with 147 additions and 36 deletions.
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 @@ -8779,6 +8779,10 @@
},
"CreateProfileImageResponseDto": {
"properties": {
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
},
Expand All @@ -8787,6 +8791,7 @@
}
},
"required": [
"profileChangedAt",
"profileImagePath",
"userId"
],
Expand Down Expand Up @@ -10015,6 +10020,10 @@
"name": {
"type": "string"
},
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
}
Expand All @@ -10024,6 +10033,7 @@
"email",
"id",
"name",
"profileChangedAt",
"profileImagePath"
],
"type": "object"
Expand Down Expand Up @@ -12454,6 +12464,10 @@
"oauthId": {
"type": "string"
},
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
},
Expand Down Expand Up @@ -12492,6 +12506,7 @@
"license",
"name",
"oauthId",
"profileChangedAt",
"profileImagePath",
"quotaSizeInBytes",
"quotaUsageInBytes",
Expand Down Expand Up @@ -12653,6 +12668,10 @@
"name": {
"type": "string"
},
"profileChangedAt": {
"format": "date-time",
"type": "string"
},
"profileImagePath": {
"type": "string"
}
Expand All @@ -12662,6 +12681,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 @@ -669,6 +671,7 @@ export type PartnerResponseDto = {
id: string;
inTimeline?: boolean;
name: string;
profileChangedAt: string;
profileImagePath: string;
};
export type UpdatePartnerDto = {
Expand Down Expand Up @@ -1252,6 +1255,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

0 comments on commit c468da5

Please sign in to comment.