Skip to content

Commit

Permalink
Merge pull request #1104 from ral-facilities/release/v1.1.0
Browse files Browse the repository at this point in the history
Release v1.1.0
  • Loading branch information
louise-davies committed Jun 23, 2022
2 parents 34de69a + abe99dc commit 7acec9f
Show file tree
Hide file tree
Showing 34 changed files with 730 additions and 327 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Release Build
on:
push:
branches: main
branches:
- main
- develop
tags: '*'

jobs:
Expand Down Expand Up @@ -47,6 +49,9 @@ jobs:
if [ "${{ github.ref }}" = "refs/heads/main" ]
then
echo TAG_NAME=snapshot >> $GITHUB_ENV
elif [ "${{ github.ref }}" = "refs/heads/develop" ]
then
echo TAG_NAME=snapshot-develop >> $GITHUB_ENV
else
echo TAG_NAME=`basename ${{ github.ref }}` >> $GITHUB_ENV
fi
Expand All @@ -62,7 +67,7 @@ jobs:
tag_name: ${{ env.TAG_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ github.ref == 'refs/heads/main' }}
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }}

- name: Create/update release
uses: johnwbyrd/update-release@v1.0.0
Expand All @@ -71,5 +76,5 @@ jobs:
files: ./scigateway-${{ env.TAG_NAME }}.tar.gz
release: Release ${{ env.TAG_NAME }}
tag: ${{ env.TAG_NAME }}
prerelease: ${{ github.ref == 'refs/heads/main' }}
prerelease: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' }}
draft: false
5 changes: 5 additions & 0 deletions CHANGELOG-BASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## [v1.0.0](https://github.com/ral-facilities/scigateway/tree/v1.0.0) (2022-03-31)

Initial release for ISIS
40 changes: 38 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

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

Initial release for ISIS
[Full Changelog](https://github.com/ral-facilities/scigateway/compare/v1.0.0...v1.1.0)

**Implemented enhancements:**

- \#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))
- Customisable primary colour [\#1087](https://github.com/ral-facilities/scigateway/pull/1087) ([louise-davies](https://github.com/louise-davies))
- 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))
- \#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))
- Homepage accessible regardless of login status \#1049 [\#1050](https://github.com/ral-facilities/scigateway/pull/1050) ([sam-glendenning](https://github.com/sam-glendenning))

**Fixed bugs:**

- \#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))
- Fix token refresh error [\#1072](https://github.com/ral-facilities/scigateway/pull/1072) ([louise-davies](https://github.com/louise-davies))
- 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))

**Security fixes:**

- 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))

**Merged pull requests:**

- Merge main into develop [\#1096](https://github.com/ral-facilities/scigateway/pull/1096) ([louise-davies](https://github.com/louise-davies))
- Update cookie policy [\#1089](https://github.com/ral-facilities/scigateway/pull/1089) ([louise-davies](https://github.com/louise-davies))
- 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))
- 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))
- 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))
- 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))



## [v1.0.0](https://github.com/ral-facilities/scigateway/tree/v1.0.0) (2022-03-31)

Initial release for ISIS


\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
61 changes: 40 additions & 21 deletions cypress/integration/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ describe('Login', () => {
it('should login given correct credentials', () => {
cy.visit('/login');
cy.contains('Sign in').should('be.visible');
cy.get('button[aria-label="Open navigation menu"]').should('not.exist');

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

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

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

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

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

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

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

Expand Down Expand Up @@ -287,7 +279,7 @@ describe('Login', () => {
});
});

describe('autoLogin', () => {
describe('autoLogin on', () => {
// Define responses for login attempts
let verifyResponse: { statusCode: Number; body: string };
let loginResponse: { statusCode: Number; body: string };
Expand All @@ -311,6 +303,7 @@ describe('Login', () => {
'ui-strings': 'res/default.json',
'auth-provider': 'icat',
authUrl: 'http://localhost:8000',
autoLogin: true,
'help-tour-steps': [],
});
cy.intercept('/authenticators', [
Expand All @@ -331,33 +324,34 @@ describe('Login', () => {
});
});

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

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

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

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

it('should not display as logged in if autologin requests fail', () => {
it('should not be logged in if autologin requests fail', () => {
loginResponse = failure;
verifyResponse = verifySuccess;

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

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

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

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

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

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

cy.get('button[aria-label="Close navigation menu"]').should('be.visible');
cy.contains('Sign in').should('not.exist');
cy.get('[aria-label="Open user menu"]').should('be.visible');
});
Expand All @@ -434,4 +426,31 @@ describe('Login', () => {
cy.contains('div', 'Demo Plugin').should('be.visible');
});
});

describe('autoLogin off', () => {
beforeEach(() => {
cy.intercept('/settings.json', {
plugins: [
{
name: 'demo_plugin',
src: '/plugins/e2e-plugin/main.js',
enable: true,
location: 'main',
},
],
'ui-strings': 'res/default.json',
'auth-provider': 'icat',
authUrl: 'http://localhost:8000',
autoLogin: false,
'help-tour-steps': [],
});
});

it('should not attempt to auto login in if autoLogin setting is set to false', () => {
cy.visit('/plugin1');
cy.get('#demo_plugin').should('not.exist');
cy.contains('h1', 'Sign in').should('be.visible');
cy.contains('Unable to create anonymous session').should('not.exist');
});
});
});
32 changes: 32 additions & 0 deletions cypress/integration/scigateway_frontend_spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,36 @@ describe('Scigateway', () => {

cy.contains('404').should('be.visible');
});

it('page refresh should open the navigation drawer', () => {
cy.visit('/');
cy.clearLocalStorage();
cy.login('username', 'password');
cy.reload();
cy.get('button[aria-label="Close navigation menu"]').should('exist');
});

it('should keep drawer in same state when redirecting', () => {
cy.visit('/login');
cy.contains('Sign in').should('be.visible');

cy.contains('Username*').parent().find('input').type('username');
cy.contains('Password*').parent().find('input').type('password');

cy.contains('Username*')
.parent()
.parent()
.contains('button', 'Sign in')
.click();

cy.url().should('eq', 'http://127.0.0.1:3000/');

cy.get('button[aria-label="Close navigation menu"]').should('exist');
cy.get('button[aria-label="Help page"]').click();
cy.get('button[aria-label="Close navigation menu"]').should('exist');
cy.get('button[aria-label="Close navigation menu"]').click();
cy.get('button[aria-label="Open navigation menu"]').should('exist');
cy.get('button[aria-label="Home page"]').click();
cy.get('button[aria-label="Open navigation menu"]').should('exist');
});
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scigateway",
"version": "1.0.0",
"version": "1.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.3",
Expand All @@ -13,7 +13,7 @@
"express": "^4.17.1",
"i18next": "^21.6.11",
"i18next-browser-languagedetector": "^6.0.0",
"i18next-http-backend": "^1.1.1",
"i18next-http-backend": "^1.4.0",
"js-cookie": "^3.0.1",
"jsonwebtoken": "^8.5.1",
"loglevel": "^1.8.0",
Expand Down
Loading

0 comments on commit 7acec9f

Please sign in to comment.