Skip to content

Commit 8d621b2

Browse files
Merge branch 'fix/REGISTRY-2731' of https://github.com/HDRUK/safepeopleregistry-web into fix/REGISTRY-2731
2 parents ed491ce + 3cceea9 commit 8d621b2

6 files changed

Lines changed: 110 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## [1.38.0](https://github.com/HDRUK/safepeopleregistry-web/compare/v1.37.0...v1.38.0) (2026-07-31)
2+
3+
### ✨ Features
4+
5+
* **REGISTRY-1006:** Organisations - add parent organisation (subsidiaries) (#839) ([5023bda](https://github.com/HDRUK/safepeopleregistry-web/commit/5023bda86be0efa7d5b606e02ef22e93cc241b93))
6+
* **REGISTRY-2622:** User | Change UK Stats Authority tick box to instead be its own table (#838) ([fa0d2ae](https://github.com/HDRUK/safepeopleregistry-web/commit/fa0d2ae7abe8a8bb85abb1b4e3d2ecc969ec5b5f))
7+
8+
### 🐛 Bug Fixes
9+
10+
* **REGISTRY-0000:** Fix 'Add organisation manual check' modal header (#837) ([f463f2e](https://github.com/HDRUK/safepeopleregistry-web/commit/f463f2ed47d18de13e0082da82e940d2c7954e2c))
11+
* **REGISTRY-000:** Update copyright notices' year to 2026 (#841) ([868c7b0](https://github.com/HDRUK/safepeopleregistry-web/commit/868c7b010de0c96ae55d1ea44d434179b7d33711))
12+
* **REGISTRY-2854:** Update banner text on pre-prod to say July 23, not June 30 (#840) ([44f4a93](https://github.com/HDRUK/safepeopleregistry-web/commit/44f4a93bf7c7e0089640cc8d8af74e25ed6e389e))
13+
114
## [1.37.0](https://github.com/HDRUK/safepeopleregistry-web/compare/v1.36.1...v1.37.0) (2026-07-10)
215

316
### ✨ Features

chart/soursd-web/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ version: 1.0.0
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "1.37.0"
24+
appVersion: "1.38.0"

cypress/e2e/user-journeys/admin/emails.cy.ts

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,30 @@ import { dataCy, getModalByHeader, logout } from "cypress/support/utils/common";
77

88
const dataInviteUser = mockedInvitedUser();
99

10+
const refreshUntilFirstRowMatches = (
11+
predicate: (firstRowText: string) => boolean,
12+
maxAttempts = 5,
13+
attempts = 0
14+
) => {
15+
cy.get(dataCy("emails-list"))
16+
.find("tbody tr")
17+
.should("have.length.greaterThan", 0)
18+
.first()
19+
.then($row => {
20+
if (predicate($row.text())) {
21+
return;
22+
}
23+
24+
if (attempts >= maxAttempts) {
25+
throw new Error("Timed out waiting for first row to match condition");
26+
}
27+
28+
cy.contains("button", "Update").click();
29+
cy.wait(1000);
30+
refreshUntilFirstRowMatches(predicate, maxAttempts, attempts + 1);
31+
});
32+
};
33+
1034
describe("Resend invite", () => {
1135
before(() => {
1236
loginAdmin();
@@ -29,9 +53,7 @@ describe("Resend invite", () => {
2953
});
3054

3155
it("Shows a list of emails", () => {
32-
cy.wait(20000);
33-
cy.contains("button", "Update").click();
34-
56+
refreshUntilFirstRowMatches(text => text.includes(dataInviteUser.email));
3557
cy.get(dataCy("emails-list"))
3658
.find("tbody tr")
3759
.first()

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "safepeopleregistry-web",
3-
"version": "1.37.0",
3+
"version": "1.38.0",
44
"private": true,
55
"scripts": {
66
"maildev": "maildev",

src/organisms/NavBar/NavBar.test.tsx

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useStore } from "@/data/store";
1+
import { StoreState, useStore } from "@/data/store";
22
import { mockedJwt } from "@/mocks/data/auth";
33
import { mockedUser } from "@/mocks/data/user";
44
import theme from "@/theme";
@@ -15,6 +15,9 @@ import {
1515
waitFor,
1616
} from "../../utils/testUtils";
1717
import NavBar from "./NavBar";
18+
import { mockedOrganisation } from "@/mocks/data/organisation";
19+
import { mockedCustodian } from "@/mocks/data/custodian";
20+
import { AccountType } from "@/types/accounts";
1821

1922
jest.mock("js-cookie", () => ({
2023
get: jest.fn(),
@@ -117,7 +120,11 @@ describe("NavBar Component", () => {
117120
selector({
118121
getUser: () => mockedUser(),
119122
setUser: jest.fn(),
120-
})
123+
config: {
124+
organisation: mockedOrganisation,
125+
custodian: mockedCustodian,
126+
},
127+
} as unknown as StoreState)
121128
);
122129

123130
render(<NavBar loggedIn />);
@@ -127,6 +134,40 @@ describe("NavBar Component", () => {
127134
expect(handleLogout).toHaveBeenCalled();
128135
});
129136

137+
it("displays 'Organisation' chip when the user belongs to an organisation", () => {
138+
mockUseStore.mockImplementation(selector =>
139+
selector({
140+
getUser: () => mockedUser(),
141+
setUser: jest.fn(),
142+
config: {
143+
organisation: mockedOrganisation,
144+
custodian: undefined,
145+
},
146+
} as unknown as StoreState)
147+
);
148+
149+
render(<NavBar loggedIn />);
150+
151+
expect(screen.getByText(AccountType.ORGANISATION)).toBeInTheDocument();
152+
});
153+
154+
it("displays 'Custodian' chip when the user belongs to an custodian", () => {
155+
mockUseStore.mockImplementation(selector =>
156+
selector({
157+
getUser: () => mockedUser(),
158+
setUser: jest.fn(),
159+
config: {
160+
organisation: undefined,
161+
custodian: mockedCustodian,
162+
},
163+
} as unknown as StoreState)
164+
);
165+
166+
render(<NavBar loggedIn />);
167+
168+
expect(screen.getByText(AccountType.CUSTODIAN)).toBeInTheDocument();
169+
});
170+
130171
it("displays 'My Account' and 'Sign Out' if the user is authenticated", () => {
131172
mockGetMe.mockResolvedValueOnce({
132173
status: 200,
@@ -137,7 +178,11 @@ describe("NavBar Component", () => {
137178
selector({
138179
getUser: () => mockedUser(),
139180
setUser: jest.fn(),
140-
})
181+
config: {
182+
organisation: undefined,
183+
custodian: undefined,
184+
},
185+
} as unknown as StoreState)
141186
);
142187

143188
(get as jest.Mock).mockReturnValue(mockedJwt);

src/organisms/NavBar/NavBar.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import MenuIcon from "@mui/icons-material/Menu";
99
import {
1010
Box,
1111
Button,
12+
Chip,
1213
IconButton,
1314
MenuItem,
1415
MenuList,
@@ -27,6 +28,7 @@ import { handleLogin, handleLogout } from "../../utils/keycloak";
2728
import NotificationsMenu from "../NotificationsMenu";
2829
import SupportMenu from "../SupportMenu/SupportMenu";
2930
import { StyledContainer, StyledHeader } from "./NavBar.styles";
31+
import { AccountType } from "@/types/accounts";
3032

3133
const NAMESPACE_TRANSLATIONS_NAVBAR = "NavBar";
3234

@@ -105,6 +107,8 @@ export default function NavBar({ loggedIn }: NavBarProps) {
105107
store.getUser(),
106108
store.setUser,
107109
]);
110+
const storedOrganisation = useStore(state => state.config.organisation);
111+
const storedCustodian = useStore(state => state.config.custodian);
108112

109113
const theme = useTheme();
110114
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
@@ -214,6 +218,24 @@ export default function NavBar({ loggedIn }: NavBarProps) {
214218
sx={{ mr: 4 }}
215219
/>
216220
</Link>
221+
{loggedIn && (
222+
<Chip
223+
label={
224+
storedOrganisation
225+
? AccountType.ORGANISATION
226+
: storedCustodian
227+
? AccountType.CUSTODIAN
228+
: AccountType.USER
229+
}
230+
sx={{
231+
textTransform: "uppercase",
232+
backgroundColor: theme.palette[`neutral-500`].main,
233+
color: theme.palette.white,
234+
}}
235+
size="medium"
236+
/>
237+
)}
238+
217239
{renderButtons(left_buttons)}
218240
</Box>
219241
<Box sx={{ display: "flex", alignItems: "center", gap: 2 }}>

0 commit comments

Comments
 (0)