Skip to content

Commit 0baf1e2

Browse files
Refactor UserProfile and useAuth to standardize sign out terminology
1 parent 3b481c1 commit 0baf1e2

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

.github/workflows/job-send-notification.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ jobs:
152152
BODY_HTML=$(cat <<HTML
153153
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#ffffff; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
154154
<tr><td align="center">
155-
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border-radius:8px; overflow:hidden;">
155+
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.08);">
156156
<tr><td style="background-color:#ef4444; padding:24px 40px;">
157157
<table width="100%" cellpadding="0" cellspacing="0"><tr>
158158
<td><h1 style="margin:0; color:#ffffff; font-size:20px; font-weight:700;">Pipeline Failed &mdash; Insufficient Quota</h1>
@@ -163,7 +163,7 @@ jobs:
163163
</tr></table>
164164
</td></tr>
165165
<tr><td style="padding:32px 40px;">
166-
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br><br>The <strong>${ACCELERATOR_NAME}</strong> deployment has <span style="color:#dc2626; font-weight:700;">failed due to insufficient quota</span>.</p>
166+
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br>The <strong>${ACCELERATOR_NAME}</strong> deployment has <span style="color:#dc2626; font-weight:700;">failed due to insufficient quota</span>.</p>
167167
<div style="background:#f8f9fb; border-radius:8px; padding:20px; margin-bottom:24px;">
168168
<h3 style="margin:0 0 16px; color:#1a1a2e; font-size:14px; text-transform:uppercase; letter-spacing:0.5px;">Status Summary</h3>
169169
<table width="100%" cellpadding="0" cellspacing="0" style="font-size:14px;">
@@ -228,7 +228,7 @@ jobs:
228228
BODY_HTML=$(cat <<HTML
229229
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#ffffff; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
230230
<tr><td align="center">
231-
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border-radius:8px; overflow:hidden;">
231+
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.08);">
232232
<tr><td style="background-color:#ef4444; padding:24px 40px;">
233233
<table width="100%" cellpadding="0" cellspacing="0"><tr>
234234
<td><h1 style="margin:0; color:#ffffff; font-size:20px; font-weight:700;">Pipeline Failed</h1>
@@ -239,7 +239,7 @@ jobs:
239239
</tr></table>
240240
</td></tr>
241241
<tr><td style="padding:32px 40px;">
242-
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br><br>The <strong>${ACCELERATOR_NAME}</strong> deployment has <span style="color:#dc2626; font-weight:700;">failed</span>. Please investigate at your earliest convenience.</p>
242+
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br>The <strong>${ACCELERATOR_NAME}</strong> deployment has <span style="color:#dc2626; font-weight:700;">failed</span>. Please investigate at your earliest convenience.</p>
243243
<div style="background:#f8f9fb; border-radius:8px; padding:20px; margin-bottom:24px;">
244244
<h3 style="margin:0 0 16px; color:#1a1a2e; font-size:14px; text-transform:uppercase; letter-spacing:0.5px;">Status Summary</h3>
245245
<table width="100%" cellpadding="0" cellspacing="0" style="font-size:14px;">
@@ -322,7 +322,7 @@ jobs:
322322
BODY_HTML=$(cat <<HTML
323323
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#ffffff; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
324324
<tr><td align="center">
325-
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border-radius:8px; overflow:hidden;">
325+
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.08);">
326326
<tr><td style="background-color:#10b981; padding:24px 40px;">
327327
<table width="100%" cellpadding="0" cellspacing="0"><tr>
328328
<td><h1 style="margin:0; color:#ffffff; font-size:20px; font-weight:700;">Pipeline Succeeded</h1>
@@ -333,7 +333,7 @@ jobs:
333333
</tr></table>
334334
</td></tr>
335335
<tr><td style="padding:32px 40px;">
336-
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br><br>${INTRO}</p>
336+
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br>${INTRO}</p>
337337
<div style="background:#f8f9fb; border-radius:8px; padding:20px; margin-bottom:24px;">
338338
<h3 style="margin:0 0 16px; color:#1a1a2e; font-size:14px; text-transform:uppercase; letter-spacing:0.5px;">Status Summary</h3>
339339
<table width="100%" cellpadding="0" cellspacing="0" style="font-size:14px;">
@@ -406,7 +406,7 @@ jobs:
406406
BODY_HTML=$(cat <<HTML
407407
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#ffffff; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
408408
<tr><td align="center">
409-
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border-radius:8px; overflow:hidden;">
409+
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.08);">
410410
<tr><td style="background-color:#ef4444; padding:24px 40px;">
411411
<table width="100%" cellpadding="0" cellspacing="0"><tr>
412412
<td><h1 style="margin:0; color:#ffffff; font-size:20px; font-weight:700;">E2E Tests Failed</h1>
@@ -417,7 +417,7 @@ jobs:
417417
</tr></table>
418418
</td></tr>
419419
<tr><td style="padding:32px 40px;">
420-
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br><br>The <strong>${ACCELERATOR_NAME}</strong> test automation has <span style="color:#dc2626; font-weight:700;">failed</span>. Please investigate at your earliest convenience.</p>
420+
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br>The <strong>${ACCELERATOR_NAME}</strong> test automation has <span style="color:#dc2626; font-weight:700;">failed</span>. Please investigate at your earliest convenience.</p>
421421
<div style="background:#f8f9fb; border-radius:8px; padding:20px; margin-bottom:24px;">
422422
<h3 style="margin:0 0 16px; color:#1a1a2e; font-size:14px; text-transform:uppercase; letter-spacing:0.5px;">Status Summary</h3>
423423
<table width="100%" cellpadding="0" cellspacing="0" style="font-size:14px;">
@@ -495,7 +495,7 @@ jobs:
495495
BODY_HTML=$(cat <<HTML
496496
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#ffffff; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
497497
<tr><td align="center">
498-
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border-radius:8px; overflow:hidden;">
498+
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.08);">
499499
<tr><td style="background-color:#10b981; padding:24px 40px;">
500500
<table width="100%" cellpadding="0" cellspacing="0"><tr>
501501
<td><h1 style="margin:0; color:#ffffff; font-size:20px; font-weight:700;">Pipeline Succeeded</h1>
@@ -506,7 +506,7 @@ jobs:
506506
</tr></table>
507507
</td></tr>
508508
<tr><td style="padding:32px 40px;">
509-
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br><br>The <strong>${ACCELERATOR_NAME}</strong> pipeline executed against the specified Target URL and test automation has completed successfully.</p>
509+
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br>The <strong>${ACCELERATOR_NAME}</strong> pipeline executed against the specified Target URL and test automation has completed successfully.</p>
510510
<div style="background:#f8f9fb; border-radius:8px; padding:20px; margin-bottom:24px;">
511511
<h3 style="margin:0 0 16px; color:#1a1a2e; font-size:14px; text-transform:uppercase; letter-spacing:0.5px;">Status Summary</h3>
512512
<table width="100%" cellpadding="0" cellspacing="0" style="font-size:14px;">
@@ -581,7 +581,7 @@ jobs:
581581
BODY_HTML=$(cat <<HTML
582582
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#ffffff; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
583583
<tr><td align="center">
584-
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border-radius:8px; overflow:hidden;">
584+
<table role="presentation" width="800" cellpadding="0" cellspacing="0" style="background-color:#ffffff; border:1px solid #e5e7eb; border-radius:8px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,0.08);">
585585
<tr><td style="background-color:#ef4444; padding:24px 40px;">
586586
<table width="100%" cellpadding="0" cellspacing="0"><tr>
587587
<td><h1 style="margin:0; color:#ffffff; font-size:20px; font-weight:700;">E2E Tests Failed</h1>
@@ -592,7 +592,7 @@ jobs:
592592
</tr></table>
593593
</td></tr>
594594
<tr><td style="padding:32px 40px;">
595-
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br><br>The <strong>${ACCELERATOR_NAME}</strong> pipeline executed against the specified Target URL and test automation has <span style="color:#dc2626; font-weight:700;">failed</span>.</p>
595+
<p style="color:#374151; font-size:14px; line-height:1.7; margin:0 0 28px;">Dear Team,<br>The <strong>${ACCELERATOR_NAME}</strong> pipeline executed against the specified Target URL and test automation has <span style="color:#dc2626; font-weight:700;">failed</span>.</p>
596596
<div style="background:#f8f9fb; border-radius:8px; padding:20px; margin-bottom:24px;">
597597
<h3 style="margin:0 0 16px; color:#1a1a2e; font-size:14px; text-transform:uppercase; letter-spacing:0.5px;">Status Summary</h3>
598598
<table width="100%" cellpadding="0" cellspacing="0" style="font-size:14px;">

src/frontend/src/components/Header/UserProfile.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import useAuth from "../../msal-auth/useAuth";
1919
/**
2020
* @component UserProfile
2121
* @description Renders an avatar in the header. Clicking opens a menu showing
22-
* the signed-in user's name and email along with a Logout option.
22+
* the signed-in user's name and email along with a Sign out option.
2323
* Designed to be rendered only when MSAL authentication is enabled.
2424
*/
2525
const getInitials = (name?: string, username?: string): string => {
@@ -45,7 +45,7 @@ const getInitials = (name?: string, username?: string): string => {
4545
};
4646

4747
const UserProfile: React.FC = () => {
48-
const { isAuthenticated, accounts, logout } = useAuth();
48+
const { isAuthenticated, accounts, signOut } = useAuth();
4949

5050
if (!isAuthenticated || !accounts || accounts.length === 0) {
5151
return null;
@@ -56,9 +56,9 @@ const UserProfile: React.FC = () => {
5656
const email = account?.username || "";
5757
const initials = getInitials(account?.name, account?.username);
5858

59-
const handleLogout = (e: React.MouseEvent) => {
59+
const handleSignOut = (e: React.MouseEvent) => {
6060
e.stopPropagation();
61-
logout();
61+
signOut();
6262
};
6363

6464
return (
@@ -124,8 +124,8 @@ const UserProfile: React.FC = () => {
124124
</div>
125125
</MenuItem>
126126
<MenuDivider />
127-
<MenuItem icon={<SignOut20Regular />} onClick={handleLogout}>
128-
Sign Out
127+
<MenuItem icon={<SignOut20Regular />} onClick={handleSignOut}>
128+
Sign out
129129
</MenuItem>
130130
</MenuList>
131131
</MenuPopover>

src/frontend/src/msal-auth/useAuth.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ const useAuth = () => {
7676
}
7777
};
7878

79-
const logout = async () => {
79+
const signOut = async () => {
8080
if (!msalInstance) {
81-
console.error("MSAL Instance is not available for logout.");
81+
console.error("MSAL Instance is not available for sign out.");
8282
return;
8383
}
8484

@@ -89,10 +89,10 @@ const useAuth = () => {
8989
});
9090
localStorage.removeItem('token');
9191
} else {
92-
console.warn("No active account found for logout.");
92+
console.warn("No active account found for sign out.");
9393
}
9494
} catch (error) {
95-
console.error("Logout failed:", error);
95+
console.error("Sign out failed:", error);
9696
}
9797
};
9898

@@ -130,7 +130,7 @@ const useAuth = () => {
130130
return {
131131
isAuthenticated,
132132
login,
133-
logout,
133+
signOut,
134134
user,
135135
accounts,
136136
inProgress,

0 commit comments

Comments
 (0)