Skip to content

Commit

Permalink
Merge pull request #98 from City-of-Helsinki/release/1.0.0
Browse files Browse the repository at this point in the history
Release/1.0.0
  • Loading branch information
klempine authored Jun 10, 2020
2 parents 4e3a568 + 2ec2317 commit b74a771
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build-review:
variables:
DOCKER_IMAGE_NAME: "$CI_PROJECT_NAME-review"
DOCKER_BUILD_ARG_REACT_APP_ENVIRONMENT: 'review'
DOCKER_BUILD_ARG_REACT_APP_OIDC_AUTHORITY: "https://tunnistamo.test.kuva.hel.ninja/"
DOCKER_BUILD_ARG_REACT_APP_OIDC_AUTHORITY: "https://api.hel.fi/sso-test/"
DOCKER_BUILD_ARG_REACT_APP_PROFILE_GRAPHQL: "https://profiili-api.test.kuva.hel.ninja/graphql/"
only:
refs:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "open-city-profile-ui",
"version": "1.0.0-rc.3",
"version": "1.0.0",
"license": "MIT",
"private": true,
"dependencies": {
Expand Down
18 changes: 18 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { MAIN_CONTENT_ID } from './common/constants';
import AccessibilityShortcuts from './common/accessibilityShortcuts/AccessibilityShortcuts';
import AppMeta from './AppMeta';
import authenticate from './auth/authenticate';
import logout from './auth/logout';
import authConstants from './auth/constants/authConstants';

countries.registerLocale(fi);
countries.registerLocale(en);
Expand Down Expand Up @@ -60,6 +62,22 @@ function App(props: Props) {
authenticate();
}

window.addEventListener('storage', event => {
if (
event.key === authConstants.OIDC_KEY &&
event.oldValue &&
!event.newValue
) {
logout();
}
if (
event.key === authConstants.OIDC_KEY &&
!event.oldValue &&
event.newValue
)
authenticate();
});

return (
<ReduxProvider store={store}>
<OidcProvider store={store} userManager={userManager}>
Expand Down
3 changes: 3 additions & 0 deletions src/auth/constants/authConstants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
OIDC_KEY: `oidc.user:${process.env.REACT_APP_OIDC_AUTHORITY}:${process.env.REACT_APP_OIDC_CLIENT_ID}`,
};
2 changes: 2 additions & 0 deletions src/auth/logout.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import * as Sentry from '@sentry/browser';

import authConstants from './constants/authConstants';
import userManager from './userManager';
import store from '../redux/store';
import { apiError } from './redux';

export default function(): void {
window.localStorage.removeItem(authConstants.OIDC_KEY);
userManager.signoutRedirect().catch(error => {
Sentry.captureException(error);
store.dispatch(apiError(error.toString()));
Expand Down
6 changes: 4 additions & 2 deletions src/common/footerLinks/FooterLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ function FooterLinks(props: Props) {
return (
<span className={props.className}>
{' '}
<a href="/#">{t('footer.privacy')}</a> |{' '}
<Link to="/accessibility">{t('footer.accessibility')}</Link>
<a href={t('profileForm.termsFileDescriptionLink')}>
{t('footer.privacy')}
</a>{' '}
| <Link to="/accessibility">{t('footer.accessibility')}</Link>
</span>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
"postalCode": "Postal code",
"submit": "Save",
"terms": "I have read <0>file description</0> and city's <1>data protection principles</1>",
"termsDataProtectionLink": "https://www.hel.fi/static/liitteet/kanslia/rekisteriselosteet/Keha/Kanslia-EU-Sahkoisten-asiointipalveluiden-rekisteri.pdf",
"termsFileDescriptionLink": "https://www.hel.fi/helsinki/en/administration/information/data-protection"
"termsDataProtectionLink": "https://www.hel.fi/helsinki/en/administration/information/data-protection",
"termsFileDescriptionLink": "https://www.hel.fi/static/liitteet/kanslia/rekisteriselosteet/Keha/Kanslia-EU-Sahkoisten-asiointipalveluiden-rekisteri.pdf"
},
"profileInformation": {
"address": "Address",
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
"postalCode": "Postinumero",
"submit": "Tallenna",
"terms": "Olen tutustunut palvelun <0>rekisteriselosteeseen</0> ja kaupungin <1>tietosuojakäytäntöön</1> ",
"termsDataProtectionLink": "https://www.hel.fi/static/liitteet/kanslia/rekisteriselosteet/Keha/Kanslia-EU-Sahkoisten-asiointipalveluiden-rekisteri.pdf",
"termsFileDescriptionLink": "https://www.hel.fi/helsinki/fi/kaupunki-ja-hallinto/tietoa-helsingista/tietosuoja/"
"termsDataProtectionLink": "https://www.hel.fi/helsinki/fi/kaupunki-ja-hallinto/tietoa-helsingista/tietosuoja/",
"termsFileDescriptionLink": "https://www.hel.fi/static/liitteet/kanslia/rekisteriselosteet/Keha/Kanslia-EU-Sahkoisten-asiointipalveluiden-rekisteri.pdf"
},
"profileInformation": {
"address": "Osoite",
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@
"postalCode": "Postnummer",
"submit": "Spara",
"terms": "Jag har läst filen <0>beskrivningen</0> och stads <1>sekretesspolicy</1>",
"termsDataProtectionLink": "https://www.hel.fi/static/liitteet/kanslia/rekisteriselosteet/Keha/Kanslia-EU-Sahkoisten-asiointipalveluiden-rekisteri.pdf",
"termsFileDescriptionLink": "https://www.hel.fi/helsinki/sv/stad-och-forvaltning/information/dataskydd"
"termsDataProtectionLink": "https://www.hel.fi/helsinki/sv/stad-och-forvaltning/information/dataskydd",
"termsFileDescriptionLink": "https://www.hel.fi/static/liitteet/kanslia/rekisteriselosteet/Keha/Kanslia-EU-Sahkoisten-asiointipalveluiden-rekisteri.pdf"
},
"profileInformation": {
"address": "Adress",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ function CreateProfileForm(props: Props) {
components={[
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a
href={t('profileForm.termsDataProtectionLink')}
href={t('profileForm.termsFileDescriptionLink')}
target="_blank"
rel="noopener noreferrer"
/>,
// eslint-disable-next-line jsx-a11y/anchor-has-content
<a
href={t('profileForm.termsFileDescriptionLink')}
href={t('profileForm.termsDataProtectionLink')}
target="_blank"
rel="noopener noreferrer"
/>,
Expand Down
5 changes: 3 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10936,8 +10936,9 @@ websocket-driver@>=0.5.1:
websocket-extensions ">=0.1.1"

websocket-extensions@>=0.1.1:
version "0.1.3"
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.3.tgz#5d2ff22977003ec687a4b87073dfbbac146ccf29"
version "0.1.4"
resolved "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42"
integrity sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==

whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3, whatwg-encoding@^1.0.5:
version "1.0.5"
Expand Down

0 comments on commit b74a771

Please sign in to comment.