Skip to content

Commit

Permalink
fix(intranet-header): update avatar url, used to load a users profile…
Browse files Browse the repository at this point in the history
… picture form the intranet backend (#4117)

! The required input value has recently changed !
Due to the technical conversion of the intranet backend from Sitecore to
Sharepoint, the value required for the property to display a user image
has changed. Previously the user ID was required, now this property
expects the user-specific e-mail address.
  • Loading branch information
oliverschuerch authored Dec 2, 2024
1 parent cb44384 commit c9bc8c0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .changeset/brave-beds-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@swisspost/design-system-intranet-header': patch
'@swisspost/design-system-documentation': patch
'@swisspost/design-system-demo': patch
---

Updated the avatar url, used to load a users profile picture form the intranet backend.

! The required input value has recently changed !
Due to the technical conversion of the intranet backend from Sitecore to Sharepoint, the value required for the property to display a user image has changed. Previously the user ID was required, now this property expects the user-specific e-mail address.
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,23 @@ <h3 class="bold mt-5" id="intranet-layout-options">Options</h3>
<code>''</code>
</td>
<td>
The user ID of the currently logged on user.
The email address of the currently logged on user.
<br />
Used to show the users profile image.
<br />
The default value of
<code>'user'</code>
is used to show the fallback-image.

<div class="mt-3 alert alert-warning">
<div class="alert-heading">The required input value has recently changed</div>
<p>
Due to the technical conversion of the intranet backend from Sitecore to Sharepoint,
the value required for the property to display a user image has changed. Previously
the user ID was required, now this property expects the user-specific e-mail
address.
</p>
</div>
</td>
</tr>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ const meta: MetaComponent = {
currentUserId: {
name: 'currentUserId',
description:
"The ID of the currently logged-in user, used to display the user's profile picture." +
'<p class="alert alert-info alert-sm">By default, a fallback image is displayed.</p>',
"The email address of the currently logged on user, used to display the user's profile picture." +
'<p class="alert alert-info alert-sm">By default, a fallback image is displayed.</p>' +
'<div class="mt-3 alert alert-warning alert-sm">' +
'<div class="alert-heading">The required input value has recently changed</div>' +
'<p>Due to the technical conversion of the intranet backend from Sitecore to Sharepoint, the value required for the property to display a user image has changed. Previously the user ID was required, now this property expects the user-specific e-mail address.</p>' +
'</div>',
control: 'text',
table: {
defaultValue: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ export class SwissPostIntranetHeaderComponent implements OnInit, OnChanges, Afte
private createSafeAvatarUrl(): SafeUrl {
return this.currentUserId === ''
? userImage
: `https://web.post.ch/UserProfileImage/${encodeURIComponent(this.currentUserId)}.png`;
: `https://postchag.sharepoint.com/_layouts/15/userphoto.aspx?size=S&username=${encodeURIComponent(
this.currentUserId,
)}`;
}

private updateMoreElementText() {
Expand Down
6 changes: 3 additions & 3 deletions pnpm-lock.yaml

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

0 comments on commit c9bc8c0

Please sign in to comment.