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(intranet-header): update avatar url, used to load a users profile picture form the intranet backend #4218

Merged
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
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
Loading