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 and leagrdv committed Dec 12, 2024
1 parent 21d0783 commit f15c533
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 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 @@ -336,7 +336,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

0 comments on commit f15c533

Please sign in to comment.