Skip to content

Commit cbfa974

Browse files
Merge pull request #1422 from ral-facilities/release/v3.0.0
Release/v3.0.0
2 parents 49cfe44 + 6064175 commit cbfa974

File tree

56 files changed

+1520
-974
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1520
-974
lines changed

.github/workflows/ci-build.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,32 @@ jobs:
3838
run: yarn e2e
3939

4040
docker:
41-
# This job triggers only if all the other jobs succeed. It builds the Docker image and if successful,
42-
# it pushes it to Harbor.
41+
# This job triggers only if all the other jobs succeed. It builds the Docker image to ensure it builds correctly.
4342
needs: [test]
4443
name: Docker
4544
runs-on: ubuntu-20.04
4645
steps:
4746
- name: Checkout repo
48-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
47+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4948

5049
- name: Login to Harbor
51-
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2.2.0
50+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
5251
with:
5352
registry: ${{ secrets.HARBOR_URL }}
5453
username: ${{ secrets.HARBOR_USERNAME }}
5554
password: ${{ secrets.HARBOR_TOKEN }}
5655

57-
- name: Extract metadata (tags, labels) for Docker
56+
- name: Extract metadata (tags, labels, annotations) for Docker
5857
id: meta
59-
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175 # v4.6.0
58+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
6059
with:
6160
images: ${{ secrets.HARBOR_URL }}/scigateway
6261

63-
- name: Build and push Docker image to Harbor
64-
uses: docker/build-push-action@0a97817b6ade9f46837855d676c4cca3a2471fc9 # v4.2.1
62+
- name: Build Docker image
63+
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
6564
with:
6665
context: .
67-
push: true
66+
push: false
6867
tags: ${{ steps.meta.outputs.tags }}
6968
labels: ${{ steps.meta.outputs.labels }}
69+
annotations: ${{ steps.meta.outputs.annotations }}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Docker Release Build
2+
on:
3+
push:
4+
tags: '*'
5+
6+
jobs:
7+
docker:
8+
# This job builds the Docker image and if successful, it pushes it to Harbor.
9+
name: Docker
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
15+
- name: Login to Harbor
16+
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
17+
with:
18+
registry: ${{ secrets.HARBOR_URL }}
19+
username: ${{ secrets.HARBOR_USERNAME }}
20+
password: ${{ secrets.HARBOR_TOKEN }}
21+
22+
- name: Extract metadata (tags, labels) for Docker
23+
id: meta
24+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
25+
with:
26+
images: ${{ secrets.HARBOR_URL }}/scigateway
27+
tags: |
28+
type=semver,pattern={{version}}
29+
type=semver,pattern={{major}}.{{minor}}
30+
type=ref,event=tag,pattern={{ref}}
31+
32+
- name: Build and push Docker image to Harbor
33+
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
34+
with:
35+
context: .
36+
file: ./Dockerfile
37+
push: true
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}
40+
annotations: ${{ steps.meta.outputs.annotations }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ npm-debug.log*
3131
yarn-debug.log*
3232
yarn-error.log*
3333

34-
public/settings.json
34+
**/public/*settings*.json
35+
!**/public/*settings.example.json
3536
public/*.js

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
# Changelog
22

3+
## [v3.0.0](https://github.com/ral-facilities/scigateway/tree/v3.0.0) (2024-11-27)
4+
5+
## What's Changed
6+
7+
### Features
8+
9+
* add darkBlue colour to theming by @joshuadkitenge in https://github.com/ral-facilities/scigateway/pull/1375
10+
* Increase toast functionailty #355 by @joshuadkitenge in https://github.com/ral-facilities/scigateway/pull/1376
11+
* Print improvement for IMS by @joelvdavies in https://github.com/ral-facilities/scigateway/pull/1385
12+
* Change accessibility page variable to be more general #356 by @joshuadkitenge in https://github.com/ral-facilities/scigateway/pull/1377
13+
* Fix error colour inconsistency for IMS by @joelvdavies in https://github.com/ral-facilities/scigateway/pull/1393
14+
* Ims maintenance endpoints by @MatteoGuarnaccia5 in https://github.com/ral-facilities/scigateway/pull/1398
15+
* Add docker image push when tags pushed #1390 by @joelvdavies in https://github.com/ral-facilities/scigateway/pull/1420
16+
* Generate custom admin tabs from plugin routes #1418 by @joshuadkitenge in https://github.com/ral-facilities/scigateway/pull/1419
17+
* React 18 #1205 by @louise-davies in https://github.com/ral-facilities/scigateway/pull/1275
18+
19+
### Dependencies
20+
21+
* Bump webpack from 5.76.1 to 5.94.0 by @dependabot in https://github.com/ral-facilities/scigateway/pull/1408
22+
* Update dependency axios to v1.7.4 [SECURITY] by @renovate in https://github.com/ral-facilities/scigateway/pull/1407
23+
* Update Node.js to v20.17.0 by @renovate in https://github.com/ral-facilities/scigateway/pull/1411
24+
* Update httpd:2.4.59-alpine3.20 Docker image to http:2.4.62-alpine3.20 by @renovate in https://github.com/ral-facilities/scigateway/pull/1410
25+
* Update dependency express to v4.20.0 [SECURITY] by @renovate in https://github.com/ral-facilities/scigateway/pull/1414
26+
* Bump rollup from 2.79.1 to 2.79.2 by @dependabot in https://github.com/ral-facilities/scigateway/pull/1416
27+
* Bump http-proxy-middleware from 2.0.6 to 2.0.7 by @dependabot in https://github.com/ral-facilities/scigateway/pull/1417
28+
* Bump cross-spawn from 7.0.3 to 7.0.6 by @dependabot in https://github.com/ral-facilities/scigateway/pull/1421
29+
30+
## New Contributors
31+
32+
* @MatteoGuarnaccia5 made their first contribution in https://github.com/ral-facilities/scigateway/pull/1398
33+
34+
**Full Changelog**: https://github.com/ral-facilities/scigateway/compare/v2.0.0...v3.0.0
35+
336
## [v2.0.0](https://github.com/ral-facilities/scigateway/tree/v2.0.0) (2024-07-24)
437

538
## What's Changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Dockerfile to build and serve scigateway
22

33
# Build stage
4-
FROM node:20.14.0-alpine3.20@sha256:928b24aaadbd47c1a7722c563b471195ce54788bf8230ce807e1dd500aec0549 as builder
4+
FROM node:20.17.0-alpine3.20@sha256:2d07db07a2df6830718ae2a47db6fedce6745f5bcd174c398f2acdda90a11c03 as builder
55

66
WORKDIR /scigateway-build
77

@@ -24,7 +24,7 @@ COPY docker/settings.json public/settings.json
2424
RUN yarn build
2525

2626
# Run stage
27-
FROM httpd:2.4.59-alpine3.20@sha256:554f25b8496f360a58febaaa5df9effb8e037cc1b70b27d40b7353a85e8edbf0
27+
FROM httpd:2.4.62-alpine3.20@sha256:66c49302c02430619abb84240a438bcfc083015661009fcaaeaac931450f62cd
2828

2929
WORKDIR /usr/local/apache2/htdocs
3030

cypress/e2e/login.cy.ts

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,24 @@ describe('Login', () => {
185185
cy.url().should('eq', 'http://127.0.0.1:3000/login');
186186
});
187187

188+
it('should redirect to login page when navigating to a plugin then back to the plugin after login', () => {
189+
cy.visit('/plugin1');
190+
191+
cy.contains('Sign in').should('be.visible');
192+
193+
cy.contains('Username*').parent().find('input').type(' username ');
194+
cy.contains('Password*').parent().find('input').type('password');
195+
196+
cy.contains('Username*')
197+
.parent()
198+
.parent()
199+
.contains('button', 'Sign in')
200+
.click();
201+
202+
cy.url().should('eq', 'http://127.0.0.1:3000/plugin1');
203+
cy.get('#demo_plugin').contains('Demo Plugin').should('be.visible');
204+
});
205+
188206
it('should not be logged in if invalid or unsigned token in localStorage', () => {
189207
// if token cannot be deciphered
190208
cy.contains('Sign in').should('be.visible');
@@ -320,17 +338,19 @@ describe('Login', () => {
320338
]);
321339
cy.intercept('POST', '/login', (req) => {
322340
req.reply(loginResponse);
323-
});
341+
}).as('login');
324342
cy.intercept('POST', '/verify', (req) => {
325343
req.reply(verifyResponse);
326-
});
344+
}).as('verify');
327345
});
328346

329347
it('should allow access to plugins and yet still show the Sign in button', () => {
330348
verifyResponse = verifySuccess;
331349
loginResponse = loginSuccess;
332350
cy.visit('/plugin1');
333351

352+
cy.wait('@login');
353+
334354
cy.get('#demo_plugin').contains('Demo Plugin').should('be.visible');
335355
cy.contains('Sign in').should('be.visible');
336356

@@ -340,9 +360,13 @@ describe('Login', () => {
340360
cy.contains('Sign in').should('be.visible');
341361

342362
// test that autologin works after token validation + refresh fail
343-
verifyResponse = failure;
363+
cy.window().then(() => {
364+
// use cy.window command just so that this line is async and executed at the right time
365+
verifyResponse = failure;
366+
});
344367
cy.intercept('POST', '/refresh', { statusCode: 403 });
345368
cy.reload();
369+
cy.wait('@login');
346370
cy.get('#demo_plugin').contains('Demo Plugin').should('be.visible');
347371
cy.contains('Sign in').should('be.visible');
348372
});
@@ -356,7 +380,10 @@ describe('Login', () => {
356380
cy.contains('h1', 'Sign in').should('be.visible');
357381

358382
// test that autologin fails after token validation + refresh fail
359-
verifyResponse = failure;
383+
cy.window().then(() => {
384+
// use cy.window command just so that this line is async and executed at the right time
385+
verifyResponse = failure;
386+
});
360387
cy.intercept('POST', '/refresh', { statusCode: 403 });
361388
cy.window().then(($window) =>
362389
$window.localStorage.setItem('scigateway:token', 'invalidtoken')
@@ -374,6 +401,37 @@ describe('Login', () => {
374401
cy.get('#demo_plugin').contains('Demo Plugin').should('be.visible');
375402
});
376403

404+
it('can remove toasts with esc keydown when a plugin error occurs', () => {
405+
cy.intercept('/settings.json', {
406+
plugins: [
407+
{
408+
name: 'demo_plugin',
409+
src: '/plugins/main.js',
410+
enable: true,
411+
location: 'main',
412+
},
413+
],
414+
'ui-strings': 'res/default.json',
415+
'auth-provider': 'icat',
416+
authUrl: 'http://localhost:8000',
417+
autoLogin: true,
418+
'help-tour-steps': [],
419+
});
420+
verifyResponse = verifySuccess;
421+
loginResponse = loginSuccess;
422+
cy.visit('/plugin1');
423+
424+
cy.contains(
425+
'Failed to load plugin demo_plugin from /plugins/main.js.'
426+
).should('exist');
427+
428+
cy.get('body').type('{esc}');
429+
430+
cy.contains(
431+
'Failed to load plugin demo_plugin from /plugins/main.js.'
432+
).should('not.exist');
433+
});
434+
377435
it('should be able to switch authenticators and still be "auto logged in"', () => {
378436
verifyResponse = verifySuccess;
379437
loginResponse = loginSuccess;
@@ -421,6 +479,8 @@ describe('Login', () => {
421479
cy.contains('Sign out').click();
422480

423481
cy.contains('Sign in').should('be.visible');
482+
cy.wait('@login');
483+
424484
cy.contains('a', 'Demo Plugin').should('be.visible');
425485
cy.contains('a', 'Demo Plugin').click();
426486

cypress/support/commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626

2727
Cypress.Commands.add('login', (username, password) => {
2828
return cy.readFile('server/e2e-settings.json').then((settings) => {
29-
cy.request('POST', `${settings.authUrl}/api/jwt/authenticate`, {
29+
cy.request('POST', `${settings.authUrl}/login`, {
3030
username: username,
3131
password: password,
3232
}).then((response) => {
33-
window.localStorage.setItem('scigateway:token', response.body.token);
33+
window.localStorage.setItem('scigateway:token', response.body);
3434
});
3535
});
3636
});

micro-frontend-tools/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
dev-plugin-settings.json
1+
/*settings*.json
2+
!/*settings.example.json

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "scigateway",
3-
"version": "2.0.0",
3+
"version": "3.0.0",
44
"private": true,
55
"resolutions": {
6-
"@types/react": "17.0.38",
7-
"@types/react-dom": "17.0.11",
6+
"@types/react": "18.0.33",
7+
"@types/react-dom": "18.0.11",
88
"@typescript-eslint/eslint-plugin": "7.0.2",
99
"@typescript-eslint/parser": "7.0.2"
1010
},
@@ -13,22 +13,22 @@
1313
"@emotion/styled": "11.11.0",
1414
"@mui/icons-material": "5.15.10",
1515
"@mui/material": "5.15.10",
16-
"@types/history": "4.7.3",
16+
"@types/history": "4.7.11",
1717
"@types/jest": "29.5.2",
1818
"@types/js-cookie": "3.0.1",
19-
"@types/react-dom": "17.0.11",
20-
"@types/react-redux-toastr": "7.6.0",
21-
"@types/react-router-dom": "5.3.1",
19+
"@types/react-dom": "18.0.11",
20+
"@types/react-redux-toastr": "7.6.2",
21+
"@types/react-router-dom": "5.3.3",
2222
"@types/redux-logger": "3.0.8",
23-
"axios": "1.6.2",
24-
"connected-react-router": "6.9.1",
23+
"axios": "1.7.4",
24+
"connected-react-router": "6.9.3",
2525
"cookie-parser": "1.4.5",
2626
"custom-event-polyfill": "1.0.7",
2727
"cypress-failed-log": "2.10.0",
2828
"eslint-config-prettier": "9.1.0",
2929
"eslint-plugin-cypress": "2.15.1",
3030
"eslint-plugin-prettier": "5.1.3",
31-
"express": "4.19.2",
31+
"express": "4.20.0",
3232
"husky": "9.0.6",
3333
"i18next": "23.8.2",
3434
"i18next-browser-languagedetector": "7.2.0",
@@ -39,19 +39,19 @@
3939
"prettier": "3.2.5",
4040
"prop-types": "15.8.1",
4141
"query-string": "7.1.1",
42-
"react": "17.0.2",
42+
"react": "18.2.0",
4343
"react-app-polyfill": "3.0.0",
44-
"react-dom": "17.0.2",
44+
"react-dom": "18.2.0",
4545
"react-i18next": "14.0.1",
4646
"react-joyride": "2.7.2",
4747
"react-redux": "8.1.2",
4848
"react-redux-toastr": "7.6.8",
4949
"react-router-dom": "5.3.0",
5050
"react-scripts": "5.0.0",
51-
"redux": "4.2.0",
51+
"redux": "4.2.1",
5252
"redux-logger": "3.0.6",
5353
"redux-thunk": "3.1.0",
54-
"single-spa": "5.9.1",
54+
"single-spa": "5.9.4",
5555
"typeface-roboto": "1.1.13",
5656
"typescript": "5.3.3"
5757
},
@@ -105,13 +105,13 @@
105105
"devDependencies": {
106106
"@babel/eslint-parser": "7.23.3",
107107
"@testing-library/jest-dom": "6.4.1",
108-
"@testing-library/react": "12.1.5",
108+
"@testing-library/react": "14.0.0",
109109
"@testing-library/user-event": "14.5.2",
110110
"@types/jsonwebtoken": "9.0.1",
111-
"@types/node": "20.14.0",
112-
"@types/react": "17.0.38",
111+
"@types/node": "20.16.5",
112+
"@types/react": "18.0.33",
113113
"@types/react-redux": "7.1.20",
114-
"@types/react-router": "5.1.12",
114+
"@types/react-router": "5.1.20",
115115
"@types/redux-mock-store": "1.0.2",
116116
"@typescript-eslint/eslint-plugin": "7.0.2",
117117
"@typescript-eslint/parser": "7.0.2",

0 commit comments

Comments
 (0)