Skip to content

Commit 7acec9f

Browse files
Merge pull request #1104 from ral-facilities/release/v1.1.0
Release v1.1.0
2 parents 34de69a + abe99dc commit 7acec9f

34 files changed

+730
-327
lines changed

.github/workflows/release-build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Release Build
22
on:
33
push:
4-
branches: main
4+
branches:
5+
- main
6+
- develop
57
tags: '*'
68

79
jobs:
@@ -47,6 +49,9 @@ jobs:
4749
if [ "${{ github.ref }}" = "refs/heads/main" ]
4850
then
4951
echo TAG_NAME=snapshot >> $GITHUB_ENV
52+
elif [ "${{ github.ref }}" = "refs/heads/develop" ]
53+
then
54+
echo TAG_NAME=snapshot-develop >> $GITHUB_ENV
5055
else
5156
echo TAG_NAME=`basename ${{ github.ref }}` >> $GITHUB_ENV
5257
fi
@@ -62,7 +67,7 @@ jobs:
6267
tag_name: ${{ env.TAG_NAME }}
6368
env:
6469
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65-
if: ${{ github.ref == 'refs/heads/main' }}
70+
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }}
6671

6772
- name: Create/update release
6873
uses: johnwbyrd/[email protected]
@@ -71,5 +76,5 @@ jobs:
7176
files: ./scigateway-${{ env.TAG_NAME }}.tar.gz
7277
release: Release ${{ env.TAG_NAME }}
7378
tag: ${{ env.TAG_NAME }}
74-
prerelease: ${{ github.ref == 'refs/heads/main' }}
79+
prerelease: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }}
7580
draft: false

CHANGELOG-BASE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## [v1.0.0](https://github.com/ral-facilities/scigateway/tree/v1.0.0) (2022-03-31)
4+
5+
Initial release for ISIS

CHANGELOG.md

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

3-
## [v1.0.0](https://github.com/ral-facilities/scigateway/tree/v1.0.0) (2022-03-31)
3+
## [v1.1.0](https://github.com/ral-facilities/scigateway/tree/v1.1.0) (2022-06-21)
44

5-
Initial release for ISIS
5+
[Full Changelog](https://github.com/ral-facilities/scigateway/compare/v1.0.0...v1.1.0)
6+
7+
**Implemented enhancements:**
8+
9+
- \#1086 - enable custom logos to be larger than 24px [\#1090](https://github.com/ral-facilities/scigateway/pull/1090) ([louise-davies](https://github.com/louise-davies))
10+
- Customisable primary colour [\#1087](https://github.com/ral-facilities/scigateway/pull/1087) ([louise-davies](https://github.com/louise-davies))
11+
- Adding arrow on left of headers in help page \#1075 [\#1076](https://github.com/ral-facilities/scigateway/pull/1076) ([sam-glendenning](https://github.com/sam-glendenning))
12+
- \#1061 - have menu open by default no matter if you're logged in or not [\#1065](https://github.com/ral-facilities/scigateway/pull/1065) ([louise-davies](https://github.com/louise-davies))
13+
- Homepage accessible regardless of login status \#1049 [\#1050](https://github.com/ral-facilities/scigateway/pull/1050) ([sam-glendenning](https://github.com/sam-glendenning))
14+
15+
**Fixed bugs:**
16+
17+
- \#1081 - add autoLogin setting to control whether we attempt autoLogin [\#1084](https://github.com/ral-facilities/scigateway/pull/1084) ([louise-davies](https://github.com/louise-davies))
18+
- Fix token refresh error [\#1072](https://github.com/ral-facilities/scigateway/pull/1072) ([louise-davies](https://github.com/louise-davies))
19+
- Preventing app bar from opening nav drawer on failed login attempt \#999 [\#1044](https://github.com/ral-facilities/scigateway/pull/1044) ([sam-glendenning](https://github.com/sam-glendenning))
20+
21+
**Security fixes:**
22+
23+
- Bump async from 2.6.3 to 2.6.4 [\#1078](https://github.com/ral-facilities/scigateway/pull/1078) ([dependabot[bot]](https://github.com/apps/dependabot))
24+
25+
**Merged pull requests:**
26+
27+
- Merge main into develop [\#1096](https://github.com/ral-facilities/scigateway/pull/1096) ([louise-davies](https://github.com/louise-davies))
28+
- Update cookie policy [\#1089](https://github.com/ral-facilities/scigateway/pull/1089) ([louise-davies](https://github.com/louise-davies))
29+
- Bump ejs from 3.1.6 to 3.1.7 [\#1055](https://github.com/ral-facilities/scigateway/pull/1055) ([dependabot[bot]](https://github.com/apps/dependabot))
30+
- Bump minimist from 1.2.5 to 1.2.6 [\#1015](https://github.com/ral-facilities/scigateway/pull/1015) ([dependabot[bot]](https://github.com/apps/dependabot))
31+
- Bump node-forge from 1.2.1 to 1.3.0 [\#1004](https://github.com/ral-facilities/scigateway/pull/1004) ([dependabot[bot]](https://github.com/apps/dependabot))
32+
- Bump i18next-http-backend from 1.3.1 to 1.4.0 [\#988](https://github.com/ral-facilities/scigateway/pull/988) ([dependabot[bot]](https://github.com/apps/dependabot))
33+
34+
35+
36+
## [v1.0.0](https://github.com/ral-facilities/scigateway/tree/v1.0.0) (2022-03-31)
37+
38+
Initial release for ISIS
39+
40+
41+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*

cypress/integration/login.spec.ts

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ describe('Login', () => {
9292
it('should login given correct credentials', () => {
9393
cy.visit('/login');
9494
cy.contains('Sign in').should('be.visible');
95-
cy.get('button[aria-label="Open navigation menu"]').should('not.exist');
9695

9796
cy.contains('Username*').parent().find('input').type('username');
9897
cy.contains('Password*').parent().find('input').type('password');
@@ -109,13 +108,11 @@ describe('Login', () => {
109108
(window) =>
110109
expect(window.localStorage.getItem('scigateway:token')).not.be.null
111110
);
112-
cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
113111
});
114112

115113
it('should login given username with leading or trailing whitespace', () => {
116114
cy.visit('/login');
117115
cy.contains('Sign in').should('be.visible');
118-
cy.get('button[aria-label="Open navigation menu"]').should('not.exist');
119116

120117
cy.contains('Username*').parent().find('input').type(' username ');
121118
cy.contains('Password*').parent().find('input').type('password');
@@ -132,13 +129,11 @@ describe('Login', () => {
132129
(window) =>
133130
expect(window.localStorage.getItem('scigateway:token')).not.be.null
134131
);
135-
cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
136132
});
137133

138134
it('should remain logged in following page refresh or redirect', () => {
139135
cy.visit('/login');
140136
cy.contains('Sign in').should('be.visible');
141-
cy.get('button[aria-label="Open navigation menu"]').should('not.exist');
142137

143138
cy.contains('Username*').parent().find('input').type(' username');
144139
cy.contains('Password*').parent().find('input').type('password');
@@ -157,7 +152,6 @@ describe('Login', () => {
157152
expect(window.localStorage.getItem('scigateway:token')).not.be.null;
158153
storedToken = window.localStorage.getItem('scigateway:token');
159154
});
160-
cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
161155

162156
cy.reload();
163157
cy.window().then((window) => {
@@ -166,7 +160,6 @@ describe('Login', () => {
166160
window.localStorage.getItem('scigateway:token')
167161
);
168162
});
169-
cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
170163
cy.contains('Sign in').should('not.exist');
171164

172165
cy.visit('/help');
@@ -176,7 +169,6 @@ describe('Login', () => {
176169
window.localStorage.getItem('scigateway:token')
177170
);
178171
});
179-
cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
180172
cy.contains('Sign in').should('not.exist');
181173
});
182174

@@ -287,7 +279,7 @@ describe('Login', () => {
287279
});
288280
});
289281

290-
describe('autoLogin', () => {
282+
describe('autoLogin on', () => {
291283
// Define responses for login attempts
292284
let verifyResponse: { statusCode: Number; body: string };
293285
let loginResponse: { statusCode: Number; body: string };
@@ -311,6 +303,7 @@ describe('Login', () => {
311303
'ui-strings': 'res/default.json',
312304
'auth-provider': 'icat',
313305
authUrl: 'http://localhost:8000',
306+
autoLogin: true,
314307
'help-tour-steps': [],
315308
});
316309
cy.intercept('/authenticators', [
@@ -331,33 +324,34 @@ describe('Login', () => {
331324
});
332325
});
333326

334-
it('should show the sidebar and yet still show the Sign in button', () => {
327+
it('should allow access to plugins and yet still show the Sign in button', () => {
335328
verifyResponse = verifySuccess;
336329
loginResponse = loginSuccess;
337-
cy.visit('/');
330+
cy.visit('/plugin1');
338331

339-
cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
332+
cy.get('#demo_plugin').contains('Demo Plugin').should('be.visible');
340333
cy.contains('Sign in').should('be.visible');
341334

342335
// test that token verification also works with autologin
343336
cy.reload();
344-
cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
337+
cy.get('#demo_plugin').contains('Demo Plugin').should('be.visible');
345338
cy.contains('Sign in').should('be.visible');
346339

347340
// test that autologin works after token validation + refresh fail
348341
verifyResponse = failure;
349342
cy.intercept('POST', '/refresh', { statusCode: 403 });
350343
cy.reload();
351-
cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
344+
cy.get('#demo_plugin').contains('Demo Plugin').should('be.visible');
352345
cy.contains('Sign in').should('be.visible');
353346
});
354347

355-
it('should not display as logged in if autologin requests fail', () => {
348+
it('should not be logged in if autologin requests fail', () => {
356349
loginResponse = failure;
357350
verifyResponse = verifySuccess;
358351

359-
cy.contains('Sign in').should('be.visible');
360-
cy.get('button[aria-label="Open navigation menu"]').should('not.exist');
352+
cy.visit('/plugin1');
353+
cy.get('#demo_plugin').should('not.exist');
354+
cy.contains('h1', 'Sign in').should('be.visible');
361355

362356
// test that autologin fails after token validation + refresh fail
363357
verifyResponse = failure;
@@ -366,8 +360,8 @@ describe('Login', () => {
366360
$window.localStorage.setItem('scigateway:token', 'invalidtoken')
367361
);
368362
cy.reload();
369-
cy.contains('Sign in').should('be.visible');
370-
cy.get('button[aria-label="Open navigation menu"]').should('not.exist');
363+
cy.get('#demo_plugin').should('not.exist');
364+
cy.contains('h1', 'Sign in').should('be.visible');
371365
});
372366

373367
it('should be able to directly view a plugin route without signing in', () => {
@@ -388,7 +382,6 @@ describe('Login', () => {
388382

389383
cy.get('[alt="SciGateway"]').click();
390384

391-
cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
392385
cy.contains('Sign in').should('be.visible');
393386
});
394387

@@ -407,7 +400,6 @@ describe('Login', () => {
407400
.contains('button', 'Sign in')
408401
.click();
409402

410-
cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
411403
cy.contains('Sign in').should('not.exist');
412404
cy.get('[aria-label="Open user menu"]').should('be.visible');
413405
});
@@ -434,4 +426,31 @@ describe('Login', () => {
434426
cy.contains('div', 'Demo Plugin').should('be.visible');
435427
});
436428
});
429+
430+
describe('autoLogin off', () => {
431+
beforeEach(() => {
432+
cy.intercept('/settings.json', {
433+
plugins: [
434+
{
435+
name: 'demo_plugin',
436+
src: '/plugins/e2e-plugin/main.js',
437+
enable: true,
438+
location: 'main',
439+
},
440+
],
441+
'ui-strings': 'res/default.json',
442+
'auth-provider': 'icat',
443+
authUrl: 'http://localhost:8000',
444+
autoLogin: false,
445+
'help-tour-steps': [],
446+
});
447+
});
448+
449+
it('should not attempt to auto login in if autoLogin setting is set to false', () => {
450+
cy.visit('/plugin1');
451+
cy.get('#demo_plugin').should('not.exist');
452+
cy.contains('h1', 'Sign in').should('be.visible');
453+
cy.contains('Unable to create anonymous session').should('not.exist');
454+
});
455+
});
437456
});

cypress/integration/scigateway_frontend_spec.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,36 @@ describe('Scigateway', () => {
3030

3131
cy.contains('404').should('be.visible');
3232
});
33+
34+
it('page refresh should open the navigation drawer', () => {
35+
cy.visit('/');
36+
cy.clearLocalStorage();
37+
cy.login('username', 'password');
38+
cy.reload();
39+
cy.get('button[aria-label="Close navigation menu"]').should('exist');
40+
});
41+
42+
it('should keep drawer in same state when redirecting', () => {
43+
cy.visit('/login');
44+
cy.contains('Sign in').should('be.visible');
45+
46+
cy.contains('Username*').parent().find('input').type('username');
47+
cy.contains('Password*').parent().find('input').type('password');
48+
49+
cy.contains('Username*')
50+
.parent()
51+
.parent()
52+
.contains('button', 'Sign in')
53+
.click();
54+
55+
cy.url().should('eq', 'http://127.0.0.1:3000/');
56+
57+
cy.get('button[aria-label="Close navigation menu"]').should('exist');
58+
cy.get('button[aria-label="Help page"]').click();
59+
cy.get('button[aria-label="Close navigation menu"]').should('exist');
60+
cy.get('button[aria-label="Close navigation menu"]').click();
61+
cy.get('button[aria-label="Open navigation menu"]').should('exist');
62+
cy.get('button[aria-label="Home page"]').click();
63+
cy.get('button[aria-label="Open navigation menu"]').should('exist');
64+
});
3365
});

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "scigateway",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"private": true,
55
"dependencies": {
66
"@material-ui/core": "^4.11.3",
@@ -13,7 +13,7 @@
1313
"express": "^4.17.1",
1414
"i18next": "^21.6.11",
1515
"i18next-browser-languagedetector": "^6.0.0",
16-
"i18next-http-backend": "^1.1.1",
16+
"i18next-http-backend": "^1.4.0",
1717
"js-cookie": "^3.0.1",
1818
"jsonwebtoken": "^8.5.1",
1919
"loglevel": "^1.8.0",

0 commit comments

Comments
 (0)