Commit ab645f58 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Safari ITP cookie touch. New support email.

parent 99efeb32
Pipeline #79991 passed with stages
in 45 minutes and 52 seconds
...@@ -14,9 +14,14 @@ module.exports = { ...@@ -14,9 +14,14 @@ module.exports = {
"fetch": false, "fetch": false,
"browser": true "browser": true
}, },
"plugins": [
"react", "react-hooks"
],
"rules": { "rules": {
"space-before-function-paren": ["error", "never"], "space-before-function-paren": ["error", "never"],
"camelcase": [0] "camelcase": [0],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}, },
"settings": { "settings": {
"react": { "react": {
......
...@@ -4,16 +4,13 @@ ...@@ -4,16 +4,13 @@
"commit": "e98694e", "commit": "e98694e",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1",
"@material-ui/core": "^4.0.0", "@material-ui/core": "^4.0.0",
"@material-ui/icons": "^4.0.0", "@material-ui/icons": "^4.0.0",
"@material-ui/lab": "^4.0.0-alpha.49", "@material-ui/lab": "^4.0.0-alpha.49",
"@navjobs/upload": "^3.1.3", "@navjobs/upload": "^3.1.3",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"autosuggest-highlight": "^3.1.1", "autosuggest-highlight": "^3.1.1",
"base-64": "^0.1.0", "base-64": "^0.1.0",
"chroma-js": "^2.0.3", "chroma-js": "^2.0.3",
...@@ -32,16 +29,19 @@ ...@@ -32,16 +29,19 @@
"pace-js": "^1.0.2", "pace-js": "^1.0.2",
"piwik-react-router": "^0.12.1", "piwik-react-router": "^0.12.1",
"qs": "^6.8.0", "qs": "^6.8.0",
"react": "^16.13.1",
"react-app-polyfill": "^1.0.1", "react-app-polyfill": "^1.0.1",
"react-autosuggest": "^9.4.3", "react-autosuggest": "^9.4.3",
"react-cookie": "^3.0.8", "react-cookie": "^3.0.8",
"react-copy-to-clipboard": "^5.0.1", "react-copy-to-clipboard": "^5.0.1",
"react-dom": "^16.13.1",
"react-dropzone": "^5.0.1", "react-dropzone": "^5.0.1",
"react-highlight": "^0.12.0", "react-highlight": "^0.12.0",
"react-infinite-scroller": "^1.2.4", "react-infinite-scroller": "^1.2.4",
"react-json-view": "^1.19.1", "react-json-view": "^1.19.1",
"react-keycloak": "^6.1.0", "react-keycloak": "^6.1.0",
"react-router-dom": "^5.1.2", "react-router-dom": "^5.1.2",
"react-scripts": "3.4.1",
"react-swipeable-views": "^0.13.0", "react-swipeable-views": "^0.13.0",
"recompose": "^0.28.2", "recompose": "^0.28.2",
"swagger-client": "^3.8.22", "swagger-client": "^3.8.22",
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
"eslint-plugin-import": "^2.14.0", "eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^8.0.1", "eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^3.7.0", "eslint-plugin-promise": "^3.7.0",
"eslint-plugin-react": "^7.11.1", "eslint-plugin-react": "^7.20.5",
"eslint-plugin-standard": "^3.1.0", "eslint-plugin-standard": "^3.1.0",
"react-docgen": "^5.3.0", "react-docgen": "^5.3.0",
"serve": "^10.0.0" "serve": "^10.0.0"
......
...@@ -228,7 +228,7 @@ export default function About() { ...@@ -228,7 +228,7 @@ export default function About() {
<Markdown>{` <Markdown>{`
### Getting Help ### Getting Help
If you encounter any difficulties, please write to If you encounter any difficulties, please write to
[webmaster@nomad-coe.eu](mailto:webmaster@nomad-coe.eu). If you think [support@nomad-lab.eu](mailto:support@nomad-lab.eu). If you think
that this web-page is not working as expected, or if you want to start a discussion that this web-page is not working as expected, or if you want to start a discussion
about possible features, feel free to open an issue on our [issue tracking about possible features, feel free to open an issue on our [issue tracking
system](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR/issues). system](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR/issues).
......
import React, { useEffect, useState, useContext, useCallback, useRef } from 'react' import React, { useEffect, useState, useContext, useCallback, useRef, useMemo } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import { compose } from 'recompose' import { compose } from 'recompose'
import classNames from 'classnames' import classNames from 'classnames'
...@@ -154,7 +154,10 @@ function Consent() { ...@@ -154,7 +154,10 @@ function Consent() {
const [cookies, setCookie] = useCookies() const [cookies, setCookie] = useCookies()
const [accepted, setAccepted] = useState(cookies['terms-accepted']) const [accepted, setAccepted] = useState(cookies['terms-accepted'])
const [optOut, setOptOut] = useState(cookies['tracking-enabled'] === 'false') const [optOut, setOptOut] = useState(cookies['tracking-enabled'] === 'false')
const forever = new Date(2147483647 * 1000) const cookieOptions = useMemo(() => ({
expires: new Date(2147483647 * 1000),
path: '/' + guiBase.split('/').slice(1).join('/')
}), [])
useEffect(() => { useEffect(() => {
if (!optOut) { if (!optOut) {
...@@ -164,15 +167,23 @@ function Consent() { ...@@ -164,15 +167,23 @@ function Consent() {
} }
}) })
// Write again to push forwards Safari's hard-coded 7 days ITP window
useEffect(() => {
setCookie('terms-accepted', cookies['terms-accepted'], cookieOptions)
setCookie('tracking-enabled', cookies['tracking-enabled'], cookieOptions)
},
// eslint-disable-next-line react-hooks/exhaustive-deps
[])
const handleClosed = accepted => { const handleClosed = accepted => {
if (accepted) { if (accepted) {
setCookie('terms-accepted', true, {expires: forever}) setCookie('terms-accepted', true, cookieOptions)
setCookie('tracking-enabled', !optOut, {expires: forever}) setCookie('tracking-enabled', !optOut, cookieOptions)
setAccepted(true) setAccepted(true)
} }
} }
const handleOpen = () => { const handleOpen = () => {
setCookie('terms-accepted', false) setCookie('terms-accepted', false, cookieOptions)
setAccepted(false) setAccepted(false)
} }
......
...@@ -15,7 +15,7 @@ export const keycloakClientId = window.nomadEnv.keycloakClientId ...@@ -15,7 +15,7 @@ export const keycloakClientId = window.nomadEnv.keycloakClientId
export const debug = window.nomadEnv.debug || false export const debug = window.nomadEnv.debug || false
export const matomoEnabled = window.nomadEnv.matomoEnabled export const matomoEnabled = window.nomadEnv.matomoEnabled
export const encyclopediaEnabled = window.nomadEnv.encyclopediaEnabled export const encyclopediaEnabled = window.nomadEnv.encyclopediaEnabled
export const email = 'webmaster@nomad-coe.eu' export const email = 'support@nomad-lab.eu'
export const maxLogsToShow = 50 export const maxLogsToShow = 50
export const consent = ` export const consent = `
......
...@@ -2251,6 +2251,15 @@ array.prototype.flat@^1.2.1: ...@@ -2251,6 +2251,15 @@ array.prototype.flat@^1.2.1:
define-properties "^1.1.3" define-properties "^1.1.3"
es-abstract "^1.17.0-next.1" es-abstract "^1.17.0-next.1"
   
array.prototype.flatmap@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.2.3.tgz#1c13f84a178566042dd63de4414440db9222e443"
integrity sha512-OOEk+lkePcg+ODXIpvuU9PAryCikCJyo7GlDG1upleEpQRx6mzL9puEBkozQ5iAx20KV0l3DbyQwqciJtqe5Pg==
dependencies:
define-properties "^1.1.3"
es-abstract "^1.17.0-next.1"
function-bind "^1.1.1"
arrify@^1.0.1: arrify@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
...@@ -4808,7 +4817,7 @@ eslint-plugin-react-hooks@^1.6.1: ...@@ -4808,7 +4817,7 @@ eslint-plugin-react-hooks@^1.6.1:
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04" resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-1.7.0.tgz#6210b6d5a37205f0b92858f895a4e827020a7d04"
integrity sha512-iXTCFcOmlWvw4+TOE8CLWj6yX1GwzT0Y6cUfHHZqWnSk144VmVIRcVGtUAzrLES7C798lmvnt02C7rxaOX1HNA== integrity sha512-iXTCFcOmlWvw4+TOE8CLWj6yX1GwzT0Y6cUfHHZqWnSk144VmVIRcVGtUAzrLES7C798lmvnt02C7rxaOX1HNA==
   
eslint-plugin-react@7.19.0, eslint-plugin-react@^7.11.1: eslint-plugin-react@7.19.0:
version "7.19.0" version "7.19.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.19.0.tgz#6d08f9673628aa69c5559d33489e855d83551666" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.19.0.tgz#6d08f9673628aa69c5559d33489e855d83551666"
integrity sha512-SPT8j72CGuAP+JFbT0sJHOB80TX/pu44gQ4vXH/cq+hQTiY2PuZ6IHkqXJV6x1b28GDdo1lbInjKUrrdUf0LOQ== integrity sha512-SPT8j72CGuAP+JFbT0sJHOB80TX/pu44gQ4vXH/cq+hQTiY2PuZ6IHkqXJV6x1b28GDdo1lbInjKUrrdUf0LOQ==
...@@ -4826,6 +4835,23 @@ eslint-plugin-react@7.19.0, eslint-plugin-react@^7.11.1: ...@@ -4826,6 +4835,23 @@ eslint-plugin-react@7.19.0, eslint-plugin-react@^7.11.1:
string.prototype.matchall "^4.0.2" string.prototype.matchall "^4.0.2"
xregexp "^4.3.0" xregexp "^4.3.0"
   
eslint-plugin-react@^7.20.5:
version "7.20.5"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.20.5.tgz#29480f3071f64a04b2c3d99d9b460ce0f76fb857"
integrity sha512-ajbJfHuFnpVNJjhyrfq+pH1C0gLc2y94OiCbAXT5O0J0YCKaFEHDV8+3+mDOr+w8WguRX+vSs1bM2BDG0VLvCw==
dependencies:
array-includes "^3.1.1"
array.prototype.flatmap "^1.2.3"
doctrine "^2.1.0"
has "^1.0.3"
jsx-ast-utils "^2.4.1"
object.entries "^1.1.2"
object.fromentries "^2.0.2"
object.values "^1.1.1"
prop-types "^15.7.2"
resolve "^1.17.0"
string.prototype.matchall "^4.0.2"
eslint-plugin-standard@^3.1.0: eslint-plugin-standard@^3.1.0:
version "3.1.0" version "3.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz#2a9e21259ba4c47c02d53b2d0c9135d4b1022d47" resolved "https://registry.yarnpkg.com/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz#2a9e21259ba4c47c02d53b2d0c9135d4b1022d47"
...@@ -7352,6 +7378,14 @@ jsx-ast-utils@^2.2.1, jsx-ast-utils@^2.2.3: ...@@ -7352,6 +7378,14 @@ jsx-ast-utils@^2.2.1, jsx-ast-utils@^2.2.3:
array-includes "^3.0.3" array-includes "^3.0.3"
object.assign "^4.1.0" object.assign "^4.1.0"
   
jsx-ast-utils@^2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.4.1.tgz#1114a4c1209481db06c690c2b4f488cc665f657e"
integrity sha512-z1xSldJ6imESSzOjd3NNkieVJKRlKYSOtMG8SFyCj2FIrvSaSuli/WjpBkEzCBoR9bYYYFgqJw61Xhu7Lcgk+w==
dependencies:
array-includes "^3.1.1"
object.assign "^4.1.0"
keycloak-js@^6.0.0: keycloak-js@^6.0.0:
version "6.0.1" version "6.0.1"
resolved "https://registry.yarnpkg.com/keycloak-js/-/keycloak-js-6.0.1.tgz#329a5e77210dfc4a7d4acf96f95dd0132455bea3" resolved "https://registry.yarnpkg.com/keycloak-js/-/keycloak-js-6.0.1.tgz#329a5e77210dfc4a7d4acf96f95dd0132455bea3"
...@@ -8274,6 +8308,15 @@ object.entries@^1.1.0, object.entries@^1.1.1: ...@@ -8274,6 +8308,15 @@ object.entries@^1.1.0, object.entries@^1.1.1:
function-bind "^1.1.1" function-bind "^1.1.1"
has "^1.0.3" has "^1.0.3"
   
object.entries@^1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.2.tgz#bc73f00acb6b6bb16c203434b10f9a7e797d3add"
integrity sha512-BQdB9qKmb/HyNdMNWVr7O3+z5MUIx3aiegEIJqjMBbBf0YT9RRxTJSim4mzFqtyr7PDAHigq0N9dO0m0tRakQA==
dependencies:
define-properties "^1.1.3"
es-abstract "^1.17.5"
has "^1.0.3"
object.fromentries@^2.0.2: object.fromentries@^2.0.2:
version "2.0.2" version "2.0.2"
resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.2.tgz#4a09c9b9bb3843dd0f89acdb517a794d4f355ac9" resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.2.tgz#4a09c9b9bb3843dd0f89acdb517a794d4f355ac9"
...@@ -10474,7 +10517,7 @@ resolve@1.15.0: ...@@ -10474,7 +10517,7 @@ resolve@1.15.0:
dependencies: dependencies:
path-parse "^1.0.6" path-parse "^1.0.6"
   
resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.3.2, resolve@^1.8.1: resolve@^1.10.0, resolve@^1.12.0, resolve@^1.13.1, resolve@^1.15.1, resolve@^1.17.0, resolve@^1.3.2, resolve@^1.8.1:
version "1.17.0" version "1.17.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==
......
...@@ -210,8 +210,8 @@ mail = NomadConfig( ...@@ -210,8 +210,8 @@ mail = NomadConfig(
port=8995, port=8995,
user='', user='',
password='', password='',
from_address='webmaster@nomad-coe.eu', from_address='support@nomad-lab.eu',
cc_address='webmaster@nomad-coe.eu' cc_address='support@nomad-lab.eu'
) )
normalize = NomadConfig( normalize = NomadConfig(
......
...@@ -1192,8 +1192,8 @@ ...@@ -1192,8 +1192,8 @@
"auth": "", "auth": "",
"port": "25", "port": "25",
"host": "mailrelay.mpcdf.mpg.de", "host": "mailrelay.mpcdf.mpg.de",
"replyTo": "webmaster@nomad-coe.eu", "replyTo": "support@nomad-lab.eu",
"from": "webmaster@nomad-coe.eu", "from": "support@nomad-lab.eu",
"fromDisplayName": "The nomad team", "fromDisplayName": "The nomad team",
"ssl": "" "ssl": ""
}, },
......
...@@ -1249,8 +1249,8 @@ ...@@ -1249,8 +1249,8 @@
"auth": "", "auth": "",
"port": "25", "port": "25",
"host": "mailrelay.mpcdf.mpg.de", "host": "mailrelay.mpcdf.mpg.de",
"replyTo": "webmaster@nomad-coe.eu", "replyTo": "support@nomad-lab.eu",
"from": "webmaster@nomad-coe.eu", "from": "support@nomad-lab.eu",
"fromDisplayName": "The nomad team", "fromDisplayName": "The nomad team",
"ssl": "" "ssl": ""
}, },
......
...@@ -41,7 +41,7 @@ All docker container are configured via docker-compose an the respective `docker ...@@ -41,7 +41,7 @@ All docker container are configured via docker-compose an the respective `docker
Further, we will need to mount some configuration files to configure the NOMAD services within Further, we will need to mount some configuration files to configure the NOMAD services within
their respective containers. their respective containers.
Please [write us](mailto:webmaster@nomad-coe.eu) to register your NOMAD account as an OASIS Please [write us](mailto:support@nomad-lab.eu) to register your NOMAD account as an OASIS
admin and to register your hostname. Please replace the indicated configuration items with admin and to register your hostname. Please replace the indicated configuration items with
the right information. the right information.
......
...@@ -144,7 +144,7 @@ mail: ...@@ -144,7 +144,7 @@ mail:
enabled: "false" enabled: "false"
host: 'localhost' host: 'localhost'
port: 25 port: 25
from: 'webmaster@nomad-coe.eu' from: 'support@nomad-lab.eu'
client: client:
username: admin username: admin
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment