Skip to content

Commit 3b481c1

Browse files
Vamshi-MicrosoftCopilot
andcommitted
Refactor UserProfile and useAuth to standardize logout terminology
Co-authored-by: Copilot <copilot@github.com>
1 parent 2b63fe0 commit 3b481c1

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
@@ -150,9 +150,9 @@ jobs:
150150
E2E_PILL="<span style=\"${PILL_BASE} background:#d4edda; color:#155724;\">&#x23ED;&#xFE0F; SKIPPED</span>"
151151
152152
BODY_HTML=$(cat <<HTML
153-
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#1a1a2e; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
153+
<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="640" 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-radius:8px; overflow:hidden;">
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>
@@ -226,9 +226,9 @@ jobs:
226226
E2E_PILL="<span style=\"${PILL_BASE} background:#d4edda; color:#155724;\">&#x23ED;&#xFE0F; SKIPPED</span>"
227227
228228
BODY_HTML=$(cat <<HTML
229-
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#1a1a2e; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
229+
<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="640" 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-radius:8px; overflow:hidden;">
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>
@@ -320,9 +320,9 @@ jobs:
320320
fi
321321
322322
BODY_HTML=$(cat <<HTML
323-
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#1a1a2e; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
323+
<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="640" 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-radius:8px; overflow:hidden;">
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>
@@ -404,9 +404,9 @@ jobs:
404404
E2E_PILL="<span style=\"${PILL_BASE} background:#f8d7da; color:#721c24;\">&#x274C; FAILED</span>"
405405
406406
BODY_HTML=$(cat <<HTML
407-
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#1a1a2e; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
407+
<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="640" 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-radius:8px; overflow:hidden;">
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>
@@ -493,9 +493,9 @@ jobs:
493493
fi
494494
495495
BODY_HTML=$(cat <<HTML
496-
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#1a1a2e; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
496+
<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="640" 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-radius:8px; overflow:hidden;">
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>
@@ -579,9 +579,9 @@ jobs:
579579
fi
580580
581581
BODY_HTML=$(cat <<HTML
582-
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" style="background-color:#1a1a2e; padding:40px 20px; font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;">
582+
<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="640" 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-radius:8px; overflow:hidden;">
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>

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 Sign out option.
22+
* the signed-in user's name and email along with a Logout 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, signOut } = useAuth();
48+
const { isAuthenticated, accounts, logout } = 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 handleSignOut = (e: React.MouseEvent) => {
59+
const handleLogout = (e: React.MouseEvent) => {
6060
e.stopPropagation();
61-
signOut();
61+
logout();
6262
};
6363

6464
return (
@@ -124,8 +124,8 @@ const UserProfile: React.FC = () => {
124124
</div>
125125
</MenuItem>
126126
<MenuDivider />
127-
<MenuItem icon={<SignOut20Regular />} onClick={handleSignOut}>
128-
Sign out
127+
<MenuItem icon={<SignOut20Regular />} onClick={handleLogout}>
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 signOut = async () => {
79+
const logout = async () => {
8080
if (!msalInstance) {
81-
console.error("MSAL Instance is not available for sign out.");
81+
console.error("MSAL Instance is not available for logout.");
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 sign out.");
92+
console.warn("No active account found for logout.");
9393
}
9494
} catch (error) {
95-
console.error("Sign out failed:", error);
95+
console.error("Logout failed:", error);
9696
}
9797
};
9898

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

0 commit comments

Comments
 (0)