Skip to content

Commit

Permalink
User's describe() now exposes the link for the avatar in links.avatar…
Browse files Browse the repository at this point in the history
…Image.href instead of meta.avatarUrl. This is a breaking change.
  • Loading branch information
rizen committed Jan 14, 2025
1 parent 0cf157a commit ade6ccf
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
</InputGroup>
<SplitButton v-if="currentUser.props?.id" :model="userMenu" text>
<NuxtLink to="/user/settings" class="flex items-center">
<Avatar :image="currentUser.meta?.avatarUrl" alt="user avatar" shape="circle" />
<Avatar :image="currentUser.links?.avatarImage?.href" alt="user avatar" shape="circle" />
<span class="ml-2">
{{ currentUser.meta?.displayName }}
</span>
Expand Down
2 changes: 1 addition & 1 deletion app/pages/user/admin/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

<div class="mb-4">
<span class="font-medium text-900 mb-2">Profile Picture</span><br>
<Avatar :image="user.meta?.avatarUrl" alt="user avatar" class="h-10rem w-10rem" shape="circle" />
<Avatar :image="user.links?.avatarImage?.href" alt="user avatar" class="h-10rem w-10rem" shape="circle" />
</div>
</FieldsetItem>

Expand Down
2 changes: 1 addition & 1 deletion app/pages/user/settings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</div>
</div>
<div class="col text-center mb-3">
<Image :src="currentUser.meta?.avatarUrl" alt="user avatar" class="inline-block"/>
<Image :src="currentUser.links?.avatarImage?.href" alt="user avatar" class="inline-block"/>
</div>
</div>

Expand Down
1 change: 1 addition & 0 deletions ving/docs/change-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ outline: deep
* Added VingRecord.describeLinks() to generate links for the UI rather than having to manually code them in a describe() override. They are automatically generated for all VingRecords via the CLI, and then pages that are generated also use the exposed links. #179
* NOTE: You'll need to add a describeLinks() override to classes generated before now.
* NOTE: S3File's describe() now exposes the links for the file and thumbnail in links.file.href and links.thumbnail.href respectively instead of meta.fileUrl and meta.thumbnailUrl. This is a breaking change.
* NOTE: User's describe() now exposes the link for the avatar in links.avatarImage.href instead of meta.avatarUrl. This is a breaking change.

### 2025-01-12
* Removed pulumi from the project.
Expand Down
1 change: 0 additions & 1 deletion ving/record/records/User.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export class UserRecord extends RoleMixin(VingRecord) {
const out = await super.describe(params);
if (params?.include?.meta && out.meta) {
out.meta.displayName = this.displayName();
out.meta.avatarUrl = await this.avatarUrl();
}
return out;
}
Expand Down

0 comments on commit ade6ccf

Please sign in to comment.