Skip to content

Commit 133099d

Browse files
Merge branch 'dev' into feat/1366
2 parents 14ba8cf + a2eabb2 commit 133099d

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

.github/workflows/.pr-close.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,18 @@ jobs:
9797
package: ${{ fromJson(needs.vars.outputs.packages) }}
9898
timeout-minutes: 1
9999
steps:
100+
- name: Check if target image tag exists
101+
run: |
102+
IMAGE="ghcr.io/${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}:${{ inputs.target }}"
103+
if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then
104+
echo "IMAGE_EXISTS=true" >> $GITHUB_ENV
105+
else
106+
echo "IMAGE_EXISTS=false" >> $GITHUB_ENV
107+
echo "Skipping retag; not found: $IMAGE"
108+
fi
109+
100110
- uses: shrink/actions-docker-registry-tag@v4
111+
if: env.IMAGE_EXISTS == 'true'
101112
with:
102113
registry: ghcr.io
103114
repository: ${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}
@@ -118,16 +129,17 @@ jobs:
118129
echo "ERROR: Tagging success!"
119130
echo "RETRY=false" >> $GITHUB_ENV
120131
fi
132+
if: env.IMAGE_EXISTS == 'true'
121133
122134
- uses: shrink/actions-docker-registry-tag@v4
123-
if: env.RETRY == 'true'
135+
if: env.IMAGE_EXISTS == 'true' && env.RETRY == 'true'
124136
with:
125137
registry: ghcr.io
126138
repository: ${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}
127139
target: ${{ inputs.target }}
128140
tags: ${{ inputs.tag_promote }}
129141

130-
- if: env.RETRY == 'true'
142+
- if: env.IMAGE_EXISTS == 'true' && env.RETRY == 'true'
131143
run: |
132144
# Verify tagging after retry
133145
INSPECT="docker manifest inspect ghcr.io/${{ inputs.organization }}/${{ inputs.repository }}/${{ matrix.package }}"
@@ -138,6 +150,7 @@ jobs:
138150
exit 1
139151
fi
140152
153+
141154
# Clean up OpenShift when PR closed, no conditions
142155
cleanup:
143156
name: OpenShift

cats-frontend/src/app/components/account/UserAccount.tsx

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,12 @@ const UserAccount = (props: any) => {
1717
auth.signinRedirect({ extraQueryParams: { kc_idp_hint: 'idir' } });
1818
}
1919

20-
const userObj = {
21-
firstname: auth.user?.profile.given_name,
22-
lastName: auth.user?.profile.family_name,
23-
};
24-
25-
const [user, setUser] = useState(userObj);
2620
const [dropdownArrow, setDropdownArrow] = useState(false);
2721
const toggleButton = (event: any) => {
2822
event.stopPropagation();
2923
setDropdownArrow(!dropdownArrow);
3024
};
3125

32-
useEffect(() => {
33-
setUser({
34-
firstname: auth.user?.profile.given_name,
35-
lastName: auth.user?.profile.family_name,
36-
});
37-
}, []);
38-
3926
const signOut = () => {
4027
auth.removeUser();
4128
auth.signoutRedirect({
@@ -44,6 +31,10 @@ const UserAccount = (props: any) => {
4431
auth.clearStaleState();
4532
};
4633

34+
// Access user data directly from auth.user
35+
const firstName = auth.user?.profile?.given_name;
36+
const lastName = auth.user?.profile?.family_name;
37+
4738
if (props.mobileView) {
4839
return (
4940
<>
@@ -64,10 +55,10 @@ const UserAccount = (props: any) => {
6455
onClick={toggleButton}
6556
>
6657
{/* Profile image */}
67-
<Avatar firstName={user.firstname} lastName={user.lastName} />
58+
<Avatar firstName={firstName} lastName={lastName} />
6859
{/* User name */}
6960
<div id="user-name" className="p-3">
70-
{user.firstname}
61+
{firstName}
7162
</div>
7263
<div
7364
id="account-dropdown"
@@ -121,7 +112,7 @@ const UserAccount = (props: any) => {
121112
className="d-flex align-items-center "
122113
onClick={() => setDropdownArrow(!dropdownArrow)}
123114
>
124-
<Avatar firstName={user.firstname} lastName={user.lastName} />
115+
<Avatar firstName={firstName} lastName={lastName} />
125116
<div
126117
id="account-dropdown"
127118
className="ps-2"
@@ -148,9 +139,9 @@ const UserAccount = (props: any) => {
148139
<div className="account-custom-label">Logged in as:</div>
149140
<div className="d-flex align-items-center account-username py-3 ">
150141
{/* Profile image */}
151-
<Avatar firstName={user.firstname} lastName={user.lastName} />
142+
<Avatar firstName={firstName} lastName={lastName} />
152143
{/* User name */}
153-
<span className="px-2">{user.firstname}</span>
144+
<span className="px-2">{firstName}</span>
154145
</div>
155146
</Dropdown.Item>
156147
<div className="pt-3">

cats-frontend/src/app/features/people/person/PersonConfig.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ const personForm: { [key: string]: IFormField } = {
3737
customEditLabelCss: 'custom-people-edit-lbl',
3838
customInputTextCss: 'custom-people-txt',
3939
customEditInputTextCss: 'custom-people-edit-txt',
40+
validation: {
41+
required: true,
42+
customMessage: 'First name is required',
43+
},
4044
},
4145
middleName: {
4246
type: FormFieldType.Text,
@@ -59,6 +63,10 @@ const personForm: { [key: string]: IFormField } = {
5963
customEditLabelCss: 'custom-people-edit-lbl',
6064
customInputTextCss: 'custom-people-txt',
6165
customEditInputTextCss: 'custom-people-edit-txt',
66+
validation: {
67+
required: true,
68+
customMessage: 'Last name is required',
69+
},
6270
},
6371
phone: {
6472
type: FormFieldType.Text,

0 commit comments

Comments
 (0)