From 5adf186e554580d80899d6c096dfd3efa6ffe2bc Mon Sep 17 00:00:00 2001 From: sarahse Date: Tue, 12 May 2020 09:34:55 +0200 Subject: [PATCH 001/100] Np 890 bugfix show uploaded file (#642) * set hasUploadSuccessEventListener to false when unmounting files tab * ignore check if uppy has upload successevent listener * add translations --- src/components/UppyDashboard.tsx | 4 ++++ src/pages/publication/PublicationForm.tsx | 9 ++++++--- .../publication/files_and_license_tab/FileUploader.tsx | 6 +++--- .../publication/new_publication/LoadPublication.tsx | 2 +- src/translations/en/publication.json | 2 ++ src/translations/nb/publication.json | 2 ++ 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/components/UppyDashboard.tsx b/src/components/UppyDashboard.tsx index 0f4d5d8400..725e8bd72a 100644 --- a/src/components/UppyDashboard.tsx +++ b/src/components/UppyDashboard.tsx @@ -45,6 +45,10 @@ const UppyDashboard: React.FC = ({ uppy, shouldAllowMultipleF 0: t('files_and_license.upload_one_file'), 1: t('files_and_license.upload_x_files'), }, + uploadXNewFiles: { + 0: t('files_and_license.upload_one_more_file'), + 1: t('files_and_license.upload_x_more_files'), + }, }, }} /> diff --git a/src/pages/publication/PublicationForm.tsx b/src/pages/publication/PublicationForm.tsx index 9182b5bef0..d02dbe3b54 100644 --- a/src/pages/publication/PublicationForm.tsx +++ b/src/pages/publication/PublicationForm.tsx @@ -62,9 +62,12 @@ const PublicationForm: FC = ({ const dispatch = useDispatch(); const history = useHistory(); - useEffect(() => { - return () => uppy && uppy.reset(); - }, [uppy]); + useEffect( + () => () => { + uppy && uppy.reset(); + }, + [uppy] + ); useEffect(() => { const getPublicationById = async (id: string) => { diff --git a/src/pages/publication/files_and_license_tab/FileUploader.tsx b/src/pages/publication/files_and_license_tab/FileUploader.tsx index 307944a329..f5a1064e78 100644 --- a/src/pages/publication/files_and_license_tab/FileUploader.tsx +++ b/src/pages/publication/files_and_license_tab/FileUploader.tsx @@ -1,15 +1,15 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, FC } from 'react'; import { File, emptyFile, Uppy } from '../../../types/file.types'; import UppyDashboard from '../../../components/UppyDashboard'; import { UppyFile } from '@uppy/core'; interface FileUploaderProps { addFile: (file: File) => void; - uppy: Uppy; shouldAllowMultipleFiles: boolean; + uppy: Uppy; } -const FileUploader: React.FC = ({ addFile, uppy, shouldAllowMultipleFiles }) => { +const FileUploader: FC = ({ addFile, shouldAllowMultipleFiles, uppy }) => { useEffect(() => { if (uppy && !uppy.hasUploadSuccessEventListener) { uppy.on('upload-success', (file: UppyFile, response: any) => { diff --git a/src/pages/publication/new_publication/LoadPublication.tsx b/src/pages/publication/new_publication/LoadPublication.tsx index a7e9b20430..fc5d40d6f6 100644 --- a/src/pages/publication/new_publication/LoadPublication.tsx +++ b/src/pages/publication/new_publication/LoadPublication.tsx @@ -35,7 +35,7 @@ const LoadPublication: FC = ({ expanded, onChange, openFor const dispatch = useDispatch(); useEffect(() => { - if (uppy && !uppy.hasUploadSuccessEventListener) { + if (uppy) { const addFile = (newFile: File) => { setUploadedFiles([newFile, ...uploadedFiles]); }; diff --git a/src/translations/en/publication.json b/src/translations/en/publication.json index 394a4d73c8..c442c3d981 100644 --- a/src/translations/en/publication.json +++ b/src/translations/en/publication.json @@ -72,7 +72,9 @@ "title": "File name", "upload_files": "Upload Files", "upload_one_file": "Upload %{smart_count} file", + "upload_one_more_file": "Upload %{smart_count} more file", "upload_x_files": "Upload %{smart_count} files", + "upload_x_more_files": "Upload %{smart_count} files", "uploaded_size": "Uploaded {{size}} kB" }, "heading": { diff --git a/src/translations/nb/publication.json b/src/translations/nb/publication.json index 0d884f2dd6..24d99288d2 100644 --- a/src/translations/nb/publication.json +++ b/src/translations/nb/publication.json @@ -72,7 +72,9 @@ "title": "Filnavn", "upload_files": "Last opp filer", "upload_one_file": "Last opp %{smart_count} fil", + "upload_one_more_file": "Last opp %{smart_count} fil til", "upload_x_files": "Last opp %{smart_count} filer", + "upload_x_more_files": "Last opp %{smart_count} filer til", "uploaded_size": "Lastet opp {{size}} kB" }, "heading": { From 13dd28c33e29e1f6a50d874fdd2abd0c1bccbc99 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 12 May 2020 10:43:41 +0200 Subject: [PATCH 002/100] Bump @cypress/webpack-preprocessor from 5.1.2 to 5.2.0 (#645) Bumps [@cypress/webpack-preprocessor](https://github.com/cypress-io/cypress-webpack-preprocessor) from 5.1.2 to 5.2.0. - [Release notes](https://github.com/cypress-io/cypress-webpack-preprocessor/releases) - [Commits](https://github.com/cypress-io/cypress-webpack-preprocessor/compare/v5.1.2...v5.2.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0144af9fa4..195871001a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3408,9 +3408,9 @@ } }, "@cypress/webpack-preprocessor": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@cypress/webpack-preprocessor/-/webpack-preprocessor-5.1.2.tgz", - "integrity": "sha512-Id8OQ9sRlSHhh8xXYI10jN54Mr5MHCbkD3+mu0BTMGrVFGNcWfcMc5+aOhDPlgHJ7rHp1mmaEJtpx853Fpg7lg==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@cypress/webpack-preprocessor/-/webpack-preprocessor-5.2.0.tgz", + "integrity": "sha512-uvo0FfKL+rIXrBGS6qPIaJRD8euK+t6YoZvrTuLPnStprzlgeGfSCnCDUEMJZqFk9LwBd1NtOop+J7qNuv74ng==", "dev": true, "requires": { "bluebird": "3.7.1", diff --git a/package.json b/package.json index bc69b27c22..377ac99450 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "devDependencies": { "@cypress/code-coverage": "^3.4.1", "@cypress/instrument-cra": "^1.1.1", - "@cypress/webpack-preprocessor": "^5.1.2", + "@cypress/webpack-preprocessor": "^5.2.0", "@istanbuljs/nyc-config-typescript": "^1.0.1", "@types/jest": "^25.2.1", "@types/node": "^13.13.5", From 4216c8f33e21efaf806f6abebc782d343acd8c55 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 12 May 2020 10:45:00 +0200 Subject: [PATCH 003/100] Bump date-fns from 2.12.0 to 2.13.0 (#644) Bumps [date-fns](https://github.com/date-fns/date-fns) from 2.12.0 to 2.13.0. - [Release notes](https://github.com/date-fns/date-fns/releases) - [Changelog](https://github.com/date-fns/date-fns/blob/master/CHANGELOG.md) - [Commits](https://github.com/date-fns/date-fns/compare/v2.12.0...v2.13.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 195871001a..a659e9875f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8810,9 +8810,9 @@ } }, "date-fns": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.12.0.tgz", - "integrity": "sha512-qJgn99xxKnFgB1qL4jpxU7Q2t0LOn1p8KMIveef3UZD7kqjT3tpFNNdXJelEHhE+rUgffriXriw/sOSU+cS1Hw==" + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.13.0.tgz", + "integrity": "sha512-xm0c61mevGF7f0XpCGtDTGpzEFC/1fpLXHbmFpxZZQJuvByIK2ozm6cSYuU+nxFYOPh2EuCfzUwlTEFwKG+h5w==" }, "debug": { "version": "3.1.0", diff --git a/package.json b/package.json index 377ac99450..05b7644180 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@uppy/react": "^1.6.3", "aws-amplify": "^3.0.8", "axios": "^0.19.2", - "date-fns": "^2.12.0", + "date-fns": "^2.13.0", "deepmerge": "^4.2.2", "formik": "^2.1.4", "formik-material-ui": "1.0.0", From e806aa1a3c17958d23e1ea69eff9b44384d024d8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 12 May 2020 10:46:57 +0200 Subject: [PATCH 004/100] Bump @material-ui/lab from 4.0.0-alpha.48 to 4.0.0-alpha.53 (#646) Bumps [@material-ui/lab](https://github.com/mui-org/material-ui/tree/HEAD/packages/material-ui-lab) from 4.0.0-alpha.48 to 4.0.0-alpha.53. - [Release notes](https://github.com/mui-org/material-ui/releases) - [Changelog](https://github.com/mui-org/material-ui/blob/master/CHANGELOG.md) - [Commits](https://github.com/mui-org/material-ui/commits/HEAD/packages/material-ui-lab) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a659e9875f..be29c49a83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4136,9 +4136,9 @@ } }, "@material-ui/lab": { - "version": "4.0.0-alpha.48", - "resolved": "https://registry.npmjs.org/@material-ui/lab/-/lab-4.0.0-alpha.48.tgz", - "integrity": "sha512-iGuTGUvIR3LLkd4LPJRl1Sa92TKmoRa3B3p0I+IllAx+uK1h/aXr++6CnYmTS+gubWRQ8yWQVLRADVrPuLnvCA==", + "version": "4.0.0-alpha.53", + "resolved": "https://registry.npmjs.org/@material-ui/lab/-/lab-4.0.0-alpha.53.tgz", + "integrity": "sha512-D2lNbMj6ZcTCbI9yPnlhGW6D/STI2RRTdXFXCKrfWGAFWV27xevNlLNwBuk++mQ5TH9mcJAMI24ej15ztOZXCQ==", "requires": { "@babel/runtime": "^7.4.4", "@material-ui/utils": "^4.9.6", diff --git a/package.json b/package.json index 05b7644180..97afb81660 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "@date-io/date-fns": "^1.3.13", "@material-ui/core": "^4.9.13", "@material-ui/icons": "^4.9.1", - "@material-ui/lab": "^4.0.0-alpha.48", + "@material-ui/lab": "^4.0.0-alpha.53", "@material-ui/pickers": "^3.2.10", "@material-ui/styles": "^4.9.13", "@testing-library/react": "^10.0.4", From ba6b33351c6fdcbcf37b85ae903aa0be1748e8e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Tue, 12 May 2020 11:41:06 +0200 Subject: [PATCH 005/100] Update uppy (#647) * Bump @uppy/core from 1.10.2 to 1.10.4 Bumps [@uppy/core](https://github.com/transloadit/uppy) from 1.10.2 to 1.10.4. - [Release notes](https://github.com/transloadit/uppy/releases) - [Changelog](https://github.com/transloadit/uppy/blob/master/CHANGELOG.md) - [Commits](https://github.com/transloadit/uppy/compare/@uppy/core@1.10.2...@uppy/core@1.10.4) Signed-off-by: dependabot-preview[bot] * Bump @uppy/aws-s3-multipart from 1.6.2 to 1.6.4 Bumps [@uppy/aws-s3-multipart](https://github.com/transloadit/uppy) from 1.6.2 to 1.6.4. - [Release notes](https://github.com/transloadit/uppy/releases) - [Changelog](https://github.com/transloadit/uppy/blob/master/CHANGELOG.md) - [Commits](https://github.com/transloadit/uppy/compare/@uppy/aws-s3-multipart@1.6.2...@uppy/aws-s3-multipart@1.6.4) Signed-off-by: dependabot-preview[bot] * Bump @uppy/dashboard from 1.8.3 to 1.8.5 Bumps [@uppy/dashboard](https://github.com/transloadit/uppy) from 1.8.3 to 1.8.5. - [Release notes](https://github.com/transloadit/uppy/releases) - [Changelog](https://github.com/transloadit/uppy/blob/master/CHANGELOG.md) - [Commits](https://github.com/transloadit/uppy/compare/@uppy/dashboard@1.8.3...@uppy/dashboard@1.8.5) Signed-off-by: dependabot-preview[bot] * Bump @uppy/react from 1.6.3 to 1.6.5 Bumps [@uppy/react](https://github.com/transloadit/uppy) from 1.6.3 to 1.6.5. - [Release notes](https://github.com/transloadit/uppy/releases) - [Changelog](https://github.com/transloadit/uppy/blob/master/CHANGELOG.md) - [Commits](https://github.com/transloadit/uppy/compare/@uppy/react@1.6.3...@uppy/react@1.6.5) Signed-off-by: dependabot-preview[bot] * Fix tests according to updated uppy Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- cypress/integration/publication.spec.js | 1 - cypress/integration/publication_files.spec.js | 1 - .../publication_validation.spec.js | 1 - package-lock.json | 288 +++++++++++++----- package.json | 8 +- 5 files changed, 224 insertions(+), 75 deletions(-) diff --git a/cypress/integration/publication.spec.js b/cypress/integration/publication.spec.js index 902ac7eb94..db8a660504 100644 --- a/cypress/integration/publication.spec.js +++ b/cypress/integration/publication.spec.js @@ -41,7 +41,6 @@ describe('Publication', () => { }); cy.get('input[type=file]').uploadFile('img.jpg'); - cy.get('.uppy-StatusBar-actionBtn--upload').click({ force: true }); cy.get('[data-testid=uploaded-file-card]').should('be.visible'); cy.get('[data-testid=publication-file-start-button]').click({ force: true }); diff --git a/cypress/integration/publication_files.spec.js b/cypress/integration/publication_files.spec.js index 834ea29b80..cf9d00fe05 100644 --- a/cypress/integration/publication_files.spec.js +++ b/cypress/integration/publication_files.spec.js @@ -23,7 +23,6 @@ describe('Publication: File upload', () => { }); cy.get('input[type=file]').uploadFile('img.jpg'); - cy.get('.uppy-StatusBar-actionBtn--upload').click({ force: true }); cy.get('[data-testid=uploaded-file-card]').should('be.visible'); }); }); diff --git a/cypress/integration/publication_validation.spec.js b/cypress/integration/publication_validation.spec.js index b0bbbb64dc..cf53ddf098 100644 --- a/cypress/integration/publication_validation.spec.js +++ b/cypress/integration/publication_validation.spec.js @@ -120,7 +120,6 @@ describe('User opens publication form and can see validation errors', () => { headers: { ETag: 'etag' }, }); cy.get('input[type=file]').uploadFile('img.jpg'); - cy.get('.uppy-StatusBar-actionBtn--upload').click({ force: true }); cy.get('[data-testid=uploaded-file-card]').should('be.visible'); cy.contains(ErrorMessage.MISSING_FILE).should('not.be.visible'); cy.contains(ErrorMessage.REQUIRED).should('not.be.visible'); diff --git a/package-lock.json b/package-lock.json index be29c49a83..88f67d1b14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4916,29 +4916,39 @@ } }, "@uppy/aws-s3-multipart": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@uppy/aws-s3-multipart/-/aws-s3-multipart-1.6.2.tgz", - "integrity": "sha512-ntZkdntVlYUEwqxwNxn5/a7RNTkLeBsr/8WMY43kyZTHqVmUUSJ+1PBilZ7uJXiyBPPMxI5HW988GHkB97jHZg==", + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@uppy/aws-s3-multipart/-/aws-s3-multipart-1.6.4.tgz", + "integrity": "sha512-OwvM/cx+mXPW13Id3wC3kGBVap1CqpJp2NEp2iw6P2ItELDxGerpDTa4Rq8N6q/j4JWuR+4CM0kRXPju/cJ1vg==", "requires": { - "@uppy/companion-client": "^1.4.2", - "@uppy/utils": "^2.4.2" + "@uppy/companion-client": "^1.4.4", + "@uppy/utils": "^2.4.4" + }, + "dependencies": { + "@uppy/utils": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", + "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", + "requires": { + "lodash.throttle": "^4.1.1" + } + } } }, "@uppy/companion-client": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/@uppy/companion-client/-/companion-client-1.4.2.tgz", - "integrity": "sha512-UBYvz0RZ7oBFHItpBSSXEok+gQRMKN4jz1kaDQt8UQbN/SFtdOghpeSH3LqHcqRZvZ6zq3JnCIHiM6sm3RCg7Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/@uppy/companion-client/-/companion-client-1.4.4.tgz", + "integrity": "sha512-4M1mAIYLDDhNEO1Lphuf5+wZv9HxTbEhNEoQ9KaWLeKjfRmTMMoWMVqgtEjzwp8C5A3XU134+H4beSQTbxQneg==", "requires": { "namespace-emitter": "^2.0.1" } }, "@uppy/core": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/@uppy/core/-/core-1.10.2.tgz", - "integrity": "sha512-0mC6f6icnwQTqpX5VQgt1mnD2629FgAMB2uwTg7PS9BkqwoNulgUhUkqg4aRB6Kmjvc5Cw0LWp0Z8Bkh56E5cA==", + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@uppy/core/-/core-1.10.4.tgz", + "integrity": "sha512-mORSXL4JyXHGo98u6u0sMzv3wtdI5jjHsqyThQAXx3LvctWE0EBrxE7vJqrXue2z/m9lovsZVhuzP2L7Qkuebg==", "requires": { "@uppy/store-default": "^1.2.1", - "@uppy/utils": "^2.4.2", + "@uppy/utils": "^2.4.4", "cuid": "^2.1.1", "lodash.throttle": "^4.1.1", "mime-match": "^1.0.2", @@ -4947,15 +4957,15 @@ } }, "@uppy/dashboard": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@uppy/dashboard/-/dashboard-1.8.3.tgz", - "integrity": "sha512-hrEBn4eg1L6yWOUo8gEgFVWUB7Xw8UpjO/atYuZ0YNBSCG2AMXfumzGeYmUkyMlreTzBcQ6esj0YMSPoVUu4UA==", - "requires": { - "@uppy/informer": "^1.5.3", - "@uppy/provider-views": "^1.6.3", - "@uppy/status-bar": "^1.6.3", - "@uppy/thumbnail-generator": "^1.5.10", - "@uppy/utils": "^2.4.2", + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@uppy/dashboard/-/dashboard-1.8.5.tgz", + "integrity": "sha512-oBf7bkhtsDei1NyxuT9XcFIu/0lvWO6SXD9DGLcAYj87BwJTknZoJPud8bNsgkIunlykODhJ0RLZlG0Q6kcDIA==", + "requires": { + "@uppy/informer": "^1.5.5", + "@uppy/provider-views": "^1.6.5", + "@uppy/status-bar": "^1.6.5", + "@uppy/thumbnail-generator": "^1.5.12", + "@uppy/utils": "^2.4.4", "classnames": "^2.2.6", "cuid": "^2.1.1", "is-shallow-equal": "^1.0.1", @@ -4965,67 +4975,193 @@ "preact": "8.2.9", "preact-css-transition-group": "^1.3.0", "resize-observer-polyfill": "^1.5.0" + }, + "dependencies": { + "@uppy/status-bar": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/@uppy/status-bar/-/status-bar-1.6.5.tgz", + "integrity": "sha512-pfPjcKVOVJ/G6fuHm2ITMQwWev41AVlzWrWIyyBq9LTwzkLpJBKDu6g+AWHcDug4ji2UmIUBqEuRMyeCDVaymg==", + "requires": { + "@uppy/utils": "^2.4.4", + "classnames": "^2.2.6", + "lodash.throttle": "^4.1.1", + "preact": "8.2.9" + } + }, + "@uppy/utils": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", + "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", + "requires": { + "lodash.throttle": "^4.1.1" + } + } } }, "@uppy/drag-drop": { - "version": "1.4.10", - "resolved": "https://registry.npmjs.org/@uppy/drag-drop/-/drag-drop-1.4.10.tgz", - "integrity": "sha512-/RHYZcA/EQIwjBPtal5liETXs7uiScGugyBiHUfZg4UmsIaHkuEPWzrTq3Ceky8QY2vKBgWrjeR7/Arm0O86eg==", + "version": "1.4.12", + "resolved": "https://registry.npmjs.org/@uppy/drag-drop/-/drag-drop-1.4.12.tgz", + "integrity": "sha512-BNRElIdGvPjuRd68KE5J2io5RzdU4WncNzD5x5rvGNlelNl7lF78ONYnG0vycm6LLoe8b7GdXvpVJOms4zqjNQ==", "requires": { - "@uppy/utils": "^2.4.2", + "@uppy/utils": "^2.4.4", "preact": "8.2.9" + }, + "dependencies": { + "@uppy/utils": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", + "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", + "requires": { + "lodash.throttle": "^4.1.1" + } + } } }, "@uppy/informer": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/@uppy/informer/-/informer-1.5.3.tgz", - "integrity": "sha512-RRoxGxwx837kuUGgy7DS2wksfXLLI9bm99T3QIu4nqc/lB04dGnmmfSP/19KbuKF4Aosk6bd9giOK937Tofe6g==", + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@uppy/informer/-/informer-1.5.5.tgz", + "integrity": "sha512-eGtE/AM2fOkBQrCDV7vR4BKgZmcip48Zqm0rBgNxVnDh8a2DFpt7UbMdC4/cCob2gdCdDT4+TaVA6GHXpcKFMA==", "requires": { - "@uppy/utils": "^2.4.2", + "@uppy/utils": "^2.4.4", "preact": "8.2.9" + }, + "dependencies": { + "@uppy/utils": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", + "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", + "requires": { + "lodash.throttle": "^4.1.1" + } + } } }, "@uppy/progress-bar": { - "version": "1.3.11", - "resolved": "https://registry.npmjs.org/@uppy/progress-bar/-/progress-bar-1.3.11.tgz", - "integrity": "sha512-SO9yrH1bIfWTgCrx8JsUhA6XJuwQTIegJH9bftOy33+6C1yYK5mjUZ/u1wvY+Xn3KUVF7VjOetzQXz2G1+zvhw==", + "version": "1.3.13", + "resolved": "https://registry.npmjs.org/@uppy/progress-bar/-/progress-bar-1.3.13.tgz", + "integrity": "sha512-2jV7QAIAHOhrXhLVofTzUuC1iW3is4fvCs0To4STb1Vg9i70ijecYA5vpG1yNXGPavGDlhyt783MamGFRIbxaQ==", "requires": { - "@uppy/utils": "^2.4.2", + "@uppy/utils": "^2.4.4", "preact": "8.2.9" + }, + "dependencies": { + "@uppy/utils": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", + "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", + "requires": { + "lodash.throttle": "^4.1.1" + } + } } }, "@uppy/provider-views": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@uppy/provider-views/-/provider-views-1.6.3.tgz", - "integrity": "sha512-MOcR3BUAPYR5TbIAwAi/8qpKsBBlt+z13oT+pdS2DlkBLo5VUw8ogiZOky8ppjvUhw0rv+4yBV+JZQFbBPm1GA==", + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/@uppy/provider-views/-/provider-views-1.6.5.tgz", + "integrity": "sha512-dEhqVzPkXEW+qduIkGtfusDNbIwC2T7p2R6N2cJ/5pNeC8nZ/PLLy+6nTHLIndASdZXY4WG/dYCFAZVRfdG3YQ==", "requires": { - "@uppy/utils": "^2.4.2", + "@uppy/utils": "^2.4.4", "classnames": "^2.2.6", "preact": "8.2.9" + }, + "dependencies": { + "@uppy/utils": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", + "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", + "requires": { + "lodash.throttle": "^4.1.1" + } + } } }, "@uppy/react": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@uppy/react/-/react-1.6.3.tgz", - "integrity": "sha512-mY8jAlVXFMhFprDFRo3LGDCc9GQwBXIHvDj4KW6LaiNhkU3qWpIAtxZ8j3P6PSYoXUAIllBdFxvGaXWcCJ/G+g==", - "requires": { - "@uppy/dashboard": "^1.8.3", - "@uppy/drag-drop": "^1.4.10", - "@uppy/progress-bar": "^1.3.11", - "@uppy/status-bar": "^1.6.3", - "@uppy/utils": "^2.4.2", + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/@uppy/react/-/react-1.6.5.tgz", + "integrity": "sha512-k+HBuFMgRjim5MvNSZByUMPeEDJNHHmstCEmc7bokOTVgycwIhWjaQfFJgP8eH6NsTnAYDLDqmXcYeVckN1EzA==", + "requires": { + "@uppy/dashboard": "^1.8.5", + "@uppy/drag-drop": "^1.4.12", + "@uppy/progress-bar": "^1.3.13", + "@uppy/status-bar": "^1.6.5", + "@uppy/utils": "^2.4.4", "prop-types": "^15.6.1" - } - }, - "@uppy/status-bar": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@uppy/status-bar/-/status-bar-1.6.3.tgz", - "integrity": "sha512-K1ioDCsMUK8HrnlR469bgFtIE6Gws1RwXeKczL8y8QwLNFJb+aT6uNPio3QVTFcCApvEGlcBj7Am8qyby7ZxxA==", - "requires": { - "@uppy/utils": "^2.4.2", - "classnames": "^2.2.6", - "lodash.throttle": "^4.1.1", - "preact": "8.2.9" + }, + "dependencies": { + "@uppy/dashboard": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@uppy/dashboard/-/dashboard-1.8.5.tgz", + "integrity": "sha512-oBf7bkhtsDei1NyxuT9XcFIu/0lvWO6SXD9DGLcAYj87BwJTknZoJPud8bNsgkIunlykODhJ0RLZlG0Q6kcDIA==", + "requires": { + "@uppy/informer": "^1.5.5", + "@uppy/provider-views": "^1.6.5", + "@uppy/status-bar": "^1.6.5", + "@uppy/thumbnail-generator": "^1.5.12", + "@uppy/utils": "^2.4.4", + "classnames": "^2.2.6", + "cuid": "^2.1.1", + "is-shallow-equal": "^1.0.1", + "lodash.debounce": "^4.0.8", + "lodash.throttle": "^4.1.1", + "memoize-one": "^5.0.4", + "preact": "8.2.9", + "preact-css-transition-group": "^1.3.0", + "resize-observer-polyfill": "^1.5.0" + } + }, + "@uppy/informer": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@uppy/informer/-/informer-1.5.5.tgz", + "integrity": "sha512-eGtE/AM2fOkBQrCDV7vR4BKgZmcip48Zqm0rBgNxVnDh8a2DFpt7UbMdC4/cCob2gdCdDT4+TaVA6GHXpcKFMA==", + "requires": { + "@uppy/utils": "^2.4.4", + "preact": "8.2.9" + } + }, + "@uppy/provider-views": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/@uppy/provider-views/-/provider-views-1.6.5.tgz", + "integrity": "sha512-dEhqVzPkXEW+qduIkGtfusDNbIwC2T7p2R6N2cJ/5pNeC8nZ/PLLy+6nTHLIndASdZXY4WG/dYCFAZVRfdG3YQ==", + "requires": { + "@uppy/utils": "^2.4.4", + "classnames": "^2.2.6", + "preact": "8.2.9" + } + }, + "@uppy/status-bar": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/@uppy/status-bar/-/status-bar-1.6.5.tgz", + "integrity": "sha512-pfPjcKVOVJ/G6fuHm2ITMQwWev41AVlzWrWIyyBq9LTwzkLpJBKDu6g+AWHcDug4ji2UmIUBqEuRMyeCDVaymg==", + "requires": { + "@uppy/utils": "^2.4.4", + "classnames": "^2.2.6", + "lodash.throttle": "^4.1.1", + "preact": "8.2.9" + } + }, + "@uppy/thumbnail-generator": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@uppy/thumbnail-generator/-/thumbnail-generator-1.5.12.tgz", + "integrity": "sha512-8D8nxTw/Pl7HRLNdLriBOVS0j+eIIVw74rAIHiQKE39nevraXzKdHyOmhRnQOKfLgYzunzu35iKX6r4yR0U/pA==", + "requires": { + "@uppy/utils": "^2.4.4", + "exifr": "^5.0.1", + "math-log2": "^1.0.1" + } + }, + "@uppy/utils": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", + "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", + "requires": { + "lodash.throttle": "^4.1.1" + } + }, + "exifr": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/exifr/-/exifr-5.0.1.tgz", + "integrity": "sha512-6Vq+IVvq7oyRSTpEDMDalzupJZs7rauXL0gZeS2yU1BSA+1fAzJCJrfRHXjMMggtUyb/hJ9m9MlLf8AtvEsrUw==" + } } }, "@uppy/store-default": { @@ -5034,18 +5170,29 @@ "integrity": "sha512-B7iKa9CMLTPgSu1lHQX+Z82NgxoBrzWfZg9WbZnvoJRHnoiwu8A3EFXPLq0OEslvJndBD4xPgUms0BPt4WbnWw==" }, "@uppy/thumbnail-generator": { - "version": "1.5.10", - "resolved": "https://registry.npmjs.org/@uppy/thumbnail-generator/-/thumbnail-generator-1.5.10.tgz", - "integrity": "sha512-kPegx7yJC37fnCUMXHvMWQpz9WhWoK8yK4Mf6T8NewnMrrgMR1cnZfdeYI+BXVvglrdhKpaADyIp/BdSVxLg3A==", + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@uppy/thumbnail-generator/-/thumbnail-generator-1.5.12.tgz", + "integrity": "sha512-8D8nxTw/Pl7HRLNdLriBOVS0j+eIIVw74rAIHiQKE39nevraXzKdHyOmhRnQOKfLgYzunzu35iKX6r4yR0U/pA==", "requires": { - "@uppy/utils": "^2.4.2", - "exifr": "^4.3.4" + "@uppy/utils": "^2.4.4", + "exifr": "^5.0.1", + "math-log2": "^1.0.1" + }, + "dependencies": { + "@uppy/utils": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", + "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", + "requires": { + "lodash.throttle": "^4.1.1" + } + } } }, "@uppy/utils": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.2.tgz", - "integrity": "sha512-iKe2NR/xRZ2t6TJZHseNlL4DpoXDLilv2nFf3LvAVgrZy/YP7kn/QHyQ5ikW1EdgOzm1IrbvRR29bztwYeWneg==", + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", + "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", "requires": { "lodash.throttle": "^4.1.1" } @@ -10132,9 +10279,9 @@ } }, "exifr": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/exifr/-/exifr-4.3.5.tgz", - "integrity": "sha512-ir36aoochREnTekiEOqY0yuUjmj4oPWMDE3NTKJoz9Yuz/m5V9nWu1p4UStOOuhJI4Wz+p0nRpuqZNKeAIkhQw==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/exifr/-/exifr-5.0.1.tgz", + "integrity": "sha512-6Vq+IVvq7oyRSTpEDMDalzupJZs7rauXL0gZeS2yU1BSA+1fAzJCJrfRHXjMMggtUyb/hJ9m9MlLf8AtvEsrUw==" }, "exit": { "version": "0.1.2", @@ -15813,6 +15960,11 @@ "classnames": "^2.2.6" } }, + "math-log2": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/math-log2/-/math-log2-1.0.1.tgz", + "integrity": "sha1-+4lBvl9evol55xjmJzsXjlhpRWU=" + }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", diff --git a/package.json b/package.json index 97afb81660..da1afe8041 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,10 @@ "@testing-library/react": "^10.0.4", "@types/react-router": "^5.1.7", "@types/react-truncate": "^2.3.3", - "@uppy/aws-s3-multipart": "^1.6.2", - "@uppy/core": "^1.10.2", - "@uppy/dashboard": "^1.8.3", - "@uppy/react": "^1.6.3", + "@uppy/aws-s3-multipart": "^1.6.4", + "@uppy/core": "^1.10.4", + "@uppy/dashboard": "^1.8.5", + "@uppy/react": "^1.6.5", "aws-amplify": "^3.0.8", "axios": "^0.19.2", "date-fns": "^2.13.0", From 4e5de5556de8d00bf0950030bf62a9d474439425 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Tue, 12 May 2020 13:10:16 +0200 Subject: [PATCH 006/100] Np 883 validate tabs (#640) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove old TODO comment * NP-883 Test missing email field * NP-883 Initial work on tab validation * NP-883 Set file fields to touched * NP-883 Rename and move touched variables * NP-883 Validate tabs on unmount * NP-883 Set more fields to touched * NP-883 Write test for more journal fields * NP-883 Test tabs continuously * NP-883 Fix typos * NP-883 Reuse logic of setting touched fields * NP-833 Ensure date input is entered correctly * NP-883 Ensure page interval is valid * Np-883 Update page number tests * NP-883 Remove aria-labels Co-authored-by: Møkkelgjerd Kjetil --- .../publication_validation.spec.js | 64 ++++++++++++--- src/pages/publication/ContributorsPanel.tsx | 17 ++-- src/pages/publication/DescriptionPanel.tsx | 25 +++--- .../publication/FilesAndLicensePanel.tsx | 26 +++---- src/pages/publication/PublicationForm.tsx | 42 ++-------- .../publication/PublicationFormContent.tsx | 78 +++++++++++++++++++ .../PublicationFormValidationSchema.ts | 20 +++-- src/pages/publication/ReferencesPanel.tsx | 8 +- src/pages/publication/SubmissionPanel.tsx | 38 +++++---- .../references_tab/JournalArticleForm.tsx | 57 ++++++++++++-- src/translations/en/formikValues.json | 5 ++ src/translations/en/publication.json | 3 + src/translations/nb/formikValues.json | 5 ++ src/translations/nb/publication.json | 3 + src/types/publicationFieldNames.ts | 10 +-- src/utils/formik-helpers.ts | 73 ++++++++++++++++- 16 files changed, 346 insertions(+), 128 deletions(-) create mode 100644 src/pages/publication/PublicationFormContent.tsx diff --git a/cypress/integration/publication_validation.spec.js b/cypress/integration/publication_validation.spec.js index cf53ddf098..b4e57262fc 100644 --- a/cypress/integration/publication_validation.spec.js +++ b/cypress/integration/publication_validation.spec.js @@ -49,6 +49,8 @@ describe('User opens publication form and can see validation errors', () => { .parent() .within(() => cy.get("input[type='text']").clear().click({ force: true }).type('01.01.2000')); cy.get('[data-testid=date-published-field]').contains('Invalid Date Format').should('not.be.visible'); + + cy.get('[data-testid=nav-tabpanel-description]').should('not.have.class', 'error-tab'); }); it('The User should be able to see validation errors on reference tab', () => { @@ -79,6 +81,27 @@ describe('User opens publication form and can see validation errors', () => { cy.contains('testament').click({ force: true }); cy.contains(ErrorMessage.REQUIRED).should('not.be.visible'); + cy.get('[data-testid=volume-field]').click({ force: true }).type('-1'); + cy.get('[data-testid=issue-field]').click({ force: true }).type('-1'); + cy.get('[data-testid=pages-from-field]').click({ force: true }).type('-1'); + cy.get('[data-testid=pages-to-field]').click({ force: true }).type('-2'); + cy.get('[data-testid=article-number-field]').click({ force: true }).type('-1'); + cy.get('[data-testid=volume-field]').contains(ErrorMessage.MUST_BE_POSITIVE); + cy.get('[data-testid=issue-field]').contains(ErrorMessage.MUST_BE_POSITIVE); + cy.get('[data-testid=pages-from-field]').contains(ErrorMessage.MUST_BE_POSITIVE); + cy.get('[data-testid=pages-to-field]').contains(ErrorMessage.INVALID_PAGE_INTERVAL); + cy.get('[data-testid=article-number-field]').contains(ErrorMessage.MUST_BE_POSITIVE); + cy.get('[data-testid=volume-field]').click({ force: true }).type('{backspace}{backspace}1'); + cy.get('[data-testid=issue-field]').click({ force: true }).type('{backspace}{backspace}1'); + cy.get('[data-testid=pages-from-field]').click({ force: true }).type('{backspace}{backspace}2'); + cy.get('[data-testid=pages-to-field]').click({ force: true }).type('{backspace}{backspace}1'); + cy.get('[data-testid=pages-from-field]').contains(ErrorMessage.INVALID_PAGE_INTERVAL); + cy.get('[data-testid=pages-to-field]').contains(ErrorMessage.INVALID_PAGE_INTERVAL); + cy.get('[data-testid=pages-to-field]').click({ force: true }).type('0'); + cy.get('[data-testid=article-number-field]').click({ force: true }).type('{backspace}{backspace}1'); + + cy.get('[data-testid=nav-tabpanel-references]').should('not.have.class', 'error-tab'); + // TODO: Book type, Report type, etc }); @@ -106,6 +129,21 @@ describe('User opens publication form and can see validation errors', () => { cy.get('[data-testid=author-email-input]').click({ force: true }).type('@email.com'); cy.contains(ErrorMessage.INVALID_FORMAT).should('not.be.visible'); cy.contains(ErrorMessage.REQUIRED).should('not.be.visible'); + + // Add author and set corresponding without setting email + cy.get('[data-testid=add-contributor]').click({ force: true }); + cy.get('[data-testid=search-input]').click({ force: true }).type('test'); + cy.get('[data-testid=search-button]').click({ force: true }); + cy.get('[data-testid=author-radio-button]').eq(1).click({ force: true }); + cy.get('[data-testid=connect-author-button]').click({ force: true }); + cy.get('[data-testid=author-corresponding-checkbox]').eq(1).click({ force: true }); + cy.get('[data-testid=nav-tabpanel-submission]').click({ force: true }); + cy.get('[data-testid=nav-tabpanel-contributors]').click({ force: true }); + cy.contains(ErrorMessage.REQUIRED).should('be.visible'); + cy.get('[data-testid=nav-tabpanel-contributors]').should('have.class', 'error-tab'); + cy.get('[data-testid=author-email-input]').eq(1).click({ force: true }).type('test@email.com'); + cy.contains(ErrorMessage.REQUIRED).should('not.be.visible'); + cy.get('[data-testid=nav-tabpanel-contributors]').should('not.have.class', 'error-tab'); }); it('The User should be able to see validation errors on files tab', () => { @@ -124,28 +162,30 @@ describe('User opens publication form and can see validation errors', () => { cy.contains(ErrorMessage.MISSING_FILE).should('not.be.visible'); cy.contains(ErrorMessage.REQUIRED).should('not.be.visible'); + // Lincense field + cy.get('[data-testid=nav-tabpanel-contributors]').click({ force: true }); + cy.get('[data-testid=nav-tabpanel-files-and-license]').click({ force: true }); + cy.contains(ErrorMessage.REQUIRED).should('be.visible'); + cy.get('[data-testid=uploaded-file-select-license]') + .parent() + .within(() => cy.get('.MuiSelect-root').click({ force: true })); + cy.get('[data-testid=license-item]').eq(0).click({ force: true }); + cy.contains(ErrorMessage.REQUIRED).should('not.be.visible'); + // Embargo field cy.get('[data-testid=uploaded-file-embargo-date]') .parent() .within(() => { - cy.get("input[type='text']").click({ force: true }).type('01.01.').blur(); + cy.get("input[type='text']").click({ force: true }).type('0101', { force: true }).blur(); cy.contains(ErrorMessage.INVALID_FORMAT).should('be.visible'); - cy.get("input[type='text']").click({ force: true }).type('2000'); + cy.get("input[type='text']").click({ force: true }).type('2000', { force: true }); cy.contains(ErrorMessage.INVALID_FORMAT).should('not.be.visible'); cy.contains(ErrorMessage.MUST_BE_FUTURE).should('be.visible'); - cy.get("input[type='text']").clear().click({ force: true }).type('01.01.3000'); + cy.get("input[type='text']").clear().click({ force: true }).type('01013000', { force: true }); cy.contains(ErrorMessage.MUST_BE_FUTURE).should('not.be.visible'); }); - // Lincense field - cy.get('[data-testid=nav-tabpanel-contributors]').click({ force: true }); - cy.get('[data-testid=nav-tabpanel-files-and-license]').click({ force: true }); - cy.contains(ErrorMessage.REQUIRED).should('be.visible'); - cy.get('[data-testid=uploaded-file-select-license]') - .parent() - .within(() => cy.get('.MuiSelect-root').click({ force: true })); - cy.get('[data-testid=license-item]').eq(0).click({ force: true }); - cy.contains(ErrorMessage.REQUIRED).should('not.be.visible'); + cy.get('[data-testid=nav-tabpanel-files-and-license]').should('not.have.class', 'error-tab'); }); it('The user navigates to submission tab and see no errors', () => { diff --git a/src/pages/publication/ContributorsPanel.tsx b/src/pages/publication/ContributorsPanel.tsx index 9d6b0b70c3..902b964d37 100644 --- a/src/pages/publication/ContributorsPanel.tsx +++ b/src/pages/publication/ContributorsPanel.tsx @@ -7,12 +7,12 @@ import Card from '../../components/Card'; import SortableTable from './contributors_tab/components/SortableTable'; import { FormikPublication } from '../../types/publication.types'; import { ContributorFieldNames } from '../../types/publicationFieldNames'; -import { getAllContributorFields } from '../../utils/formik-helpers'; +import { touchedContributorTabFields } from '../../utils/formik-helpers'; +import { PanelProps } from './PublicationFormContent'; -const ContributorsPanel: FC = () => { +const ContributorsPanel: FC = ({ setTouchedFields }) => { const { t } = useTranslation('publication'); const { - setFieldTouched, values: { entityDescription: { contributors }, }, @@ -23,14 +23,11 @@ const ContributorsPanel: FC = () => { contributorsRef.current = contributors; }, [contributors]); - // Set all fields to touched on unmount useEffect( - () => () => { - // Use contributorsRef to avoid trigging this useEffect on every values update - const fieldNames = getAllContributorFields(contributorsRef.current); - fieldNames.forEach((fieldName) => setFieldTouched(fieldName)); - }, - [setFieldTouched] + // Set all fields to touched on unmount + // Use refs to avoid trigging this useEffect on every values update + () => () => setTouchedFields(touchedContributorTabFields(contributorsRef.current)), + [setTouchedFields] ); return ( diff --git a/src/pages/publication/DescriptionPanel.tsx b/src/pages/publication/DescriptionPanel.tsx index ffa534a69c..8489075ed1 100644 --- a/src/pages/publication/DescriptionPanel.tsx +++ b/src/pages/publication/DescriptionPanel.tsx @@ -1,23 +1,25 @@ import { Field, FieldArray, FormikProps, useFormikContext, FieldProps, FieldArrayRenderProps, getIn } from 'formik'; import { TextField } from 'formik-material-ui'; -import React, { FC, useCallback, useEffect } from 'react'; +import React, { FC, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; - import DateFnsUtils from '@date-io/date-fns'; import { MenuItem } from '@material-ui/core'; import { MuiPickersUtilsProvider } from '@material-ui/pickers'; +import ChipInput from 'material-ui-chip-input'; + import { FormikPublication } from '../../types/publication.types'; import DisciplineSearch from './description_tab/DisciplineSearch'; import ProjectSearch from './description_tab/ProjectSearch'; import ProjectRow from './description_tab/ProjectRow'; import DatePickerField from './description_tab/DatePickerField'; -import ChipInput from 'material-ui-chip-input'; import { publicationLanguages } from '../../types/language.types'; import Heading from '../../components/Heading'; import Card from '../../components/Card'; import { DescriptionFieldNames } from '../../types/publicationFieldNames'; import { emptyProject } from '../../types/project.types'; +import { touchedDescriptionTabFields } from '../../utils/formik-helpers'; +import { PanelProps } from './PublicationFormContent'; const MultipleFieldWrapper = styled.div` display: flex; @@ -37,21 +39,14 @@ const StyledFieldHeader = styled.header` font-size: 1.5rem; `; -const DescriptionPanel: FC = () => { +const DescriptionPanel: FC = ({ setTouchedFields }) => { const { t } = useTranslation('publication'); - const { setFieldTouched, setFieldValue, values }: FormikProps = useFormikContext(); - - // Validation messages won't show on fields that are not touched - const setAllFieldsTouched = useCallback(() => { - Object.values(DescriptionFieldNames).forEach((fieldName) => setFieldTouched(fieldName)); - }, [setFieldTouched]); + const { setFieldValue, values }: FormikProps = useFormikContext(); useEffect( - () => () => { - // Set all fields as touched if user navigates away from this panel (on unmount) - setAllFieldsTouched(); - }, - [setAllFieldsTouched] + // Set all fields as touched if user navigates away from this panel (on unmount) + () => () => setTouchedFields(touchedDescriptionTabFields), + [setTouchedFields] ); return ( diff --git a/src/pages/publication/FilesAndLicensePanel.tsx b/src/pages/publication/FilesAndLicensePanel.tsx index b5175cdc8b..483952f3e6 100644 --- a/src/pages/publication/FilesAndLicensePanel.tsx +++ b/src/pages/publication/FilesAndLicensePanel.tsx @@ -1,9 +1,10 @@ import React, { useState, useEffect, useRef, FC } from 'react'; import { useTranslation } from 'react-i18next'; -import FileUploader from './files_and_license_tab/FileUploader'; -import FileCard from './files_and_license_tab/FileCard'; import styled from 'styled-components'; import { FieldArray, FormikProps, useFormikContext, ErrorMessage, FieldArrayRenderProps } from 'formik'; +import { FormHelperText } from '@material-ui/core'; +import FileUploader from './files_and_license_tab/FileUploader'; +import FileCard from './files_and_license_tab/FileCard'; import { FormikPublication, Publisher } from '../../types/publication.types'; import Modal from '../../components/Modal'; import { licenses, Uppy } from '../../types/file.types'; @@ -12,9 +13,9 @@ import Heading from '../../components/Heading'; import PublicationChannelInfoCard from './files_and_license_tab/PublicationChannelInfoCard'; import NormalText from '../../components/NormalText'; import Label from '../../components/Label'; -import { FormHelperText } from '@material-ui/core'; -import { getAllFileFields } from '../../utils/formik-helpers'; import { FileFieldNames } from '../../types/publicationFieldNames'; +import { touchedFilesTabFields } from '../../utils/formik-helpers'; +import { PanelProps } from './PublicationFormContent'; const shouldAllowMultipleFiles = true; @@ -31,13 +32,13 @@ const StyledLicenseDescription = styled.article` margin-bottom: 1rem; `; -interface FilesAndLicensePanelProps { +interface FilesAndLicensePanelProps extends PanelProps { uppy: Uppy; } -const FilesAndLicensePanel: FC = ({ uppy }) => { +const FilesAndLicensePanel: FC = ({ uppy, setTouchedFields }) => { const { t } = useTranslation('publication'); - const { values, setFieldTouched }: FormikProps = useFormikContext(); + const { values }: FormikProps = useFormikContext(); const [isLicenseModalOpen, setIsLicenseModalOpen] = useState(false); const { fileSet: { files }, @@ -51,14 +52,11 @@ const FilesAndLicensePanel: FC = ({ uppy }) => { filesRef.current = files; }, [files]); - // Set all fields to touched on unmount useEffect( - () => () => { - // Use filesRef to avoid trigging this useEffect on every values update - const fieldNames = getAllFileFields(filesRef.current); - fieldNames.forEach((fieldName) => setFieldTouched(fieldName)); - }, - [setFieldTouched] + // Set all fields to touched on unmount + // Use filesRef to avoid trigging this useEffect on every values update + () => () => setTouchedFields(touchedFilesTabFields(filesRef.current)), + [setTouchedFields] ); const toggleLicenseModal = () => { diff --git a/src/pages/publication/PublicationForm.tsx b/src/pages/publication/PublicationForm.tsx index d02dbe3b54..ec2a8d6604 100644 --- a/src/pages/publication/PublicationForm.tsx +++ b/src/pages/publication/PublicationForm.tsx @@ -4,12 +4,7 @@ import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; import { emptyPublication, FormikPublication, PublicationStatus } from '../../types/publication.types'; import { createUppy } from '../../utils/uppy-config'; -import ContributorsPanel from './ContributorsPanel'; -import DescriptionPanel from './DescriptionPanel'; -import FilesAndLicensePanel from './FilesAndLicensePanel'; import { PublicationFormTabs } from './PublicationFormTabs'; -import ReferencesPanel from './ReferencesPanel'; -import SubmissionPanel from './SubmissionPanel'; import { emptyFile, Uppy, emptyFileSet } from '../../types/file.types'; import { getPublication, updatePublication } from '../../api/publicationApi'; import { useDispatch } from 'react-redux'; @@ -21,6 +16,7 @@ import { Button, CircularProgress } from '@material-ui/core'; import RouteLeavingGuard from '../../components/RouteLeavingGuard'; import { useHistory } from 'react-router'; import ButtonWithProgress from '../../components/ButtonWithProgress'; +import { PublicationFormContent } from './PublicationFormContent'; const shouldAllowMultipleFiles = false; @@ -28,11 +24,6 @@ const StyledPublication = styled.div` width: 100%; `; -const StyledPanel = styled.div` - margin-top: 2rem; - margin-bottom: 1rem; -`; - const StyledButtonGroupContainer = styled.div` margin-bottom: 1rem; `; @@ -160,31 +151,12 @@ const PublicationForm: FC = ({ />
- {tabNumber === 0 && ( - - - - )} - {tabNumber === 1 && ( - - - - )} - {tabNumber === 2 && ( - - - - )} - {tabNumber === 3 && ( - - - - )} - {tabNumber === 4 && ( - - - - )} + {tabNumber !== 4 && ( diff --git a/src/pages/publication/PublicationFormContent.tsx b/src/pages/publication/PublicationFormContent.tsx new file mode 100644 index 0000000000..80a9c7cb74 --- /dev/null +++ b/src/pages/publication/PublicationFormContent.tsx @@ -0,0 +1,78 @@ +import { FormikProps, useFormikContext, FormikTouched } from 'formik'; +import React, { FC, useCallback, useRef, useEffect } from 'react'; +import styled from 'styled-components'; + +import { FormikPublication } from '../../types/publication.types'; +import DescriptionPanel from './DescriptionPanel'; +import ReferencesPanel from './ReferencesPanel'; +import ContributorsPanel from './ContributorsPanel'; +import FilesAndLicensePanel from './FilesAndLicensePanel'; +import SubmissionPanel from './SubmissionPanel'; +import { Uppy } from '../../types/file.types'; +import { mergeTouchedFields } from '../../utils/formik-helpers'; + +const StyledPanel = styled.div` + margin-top: 2rem; + margin-bottom: 1rem; +`; + +export interface PanelProps { + setTouchedFields: (fieldsToTouch: FormikTouched) => void; +} + +interface PublicationFormContentProps { + isSaving: boolean; + savePublication: (values: FormikPublication) => void; + tabNumber: number; + uppy: Uppy; +} + +export const PublicationFormContent: FC = ({ + isSaving, + savePublication, + tabNumber, + uppy, +}) => { + const { touched, setTouched }: FormikProps = useFormikContext(); + + const touchedRef = useRef(touched); + useEffect(() => { + touchedRef.current = touched; + }, [touched]); + + const setTouchedFields = useCallback( + (fieldsToTouch: FormikTouched) => + setTouched(mergeTouchedFields([touchedRef.current, fieldsToTouch])), + [setTouched] + ); + + return ( + <> + {tabNumber === 0 && ( + + + + )} + {tabNumber === 1 && ( + + + + )} + {tabNumber === 2 && ( + + + + )} + {tabNumber === 3 && ( + + + + )} + {tabNumber === 4 && ( + + + + )} + + ); +}; diff --git a/src/pages/publication/PublicationFormValidationSchema.ts b/src/pages/publication/PublicationFormValidationSchema.ts index 1d54be903a..872800849c 100644 --- a/src/pages/publication/PublicationFormValidationSchema.ts +++ b/src/pages/publication/PublicationFormValidationSchema.ts @@ -13,8 +13,11 @@ export const ErrorMessage = { REQUIRED: i18n.t('publication:feedback.required_field'), MISSING_CONTRIBUTOR: i18n.t('publication:feedback.minimum_one_contributor'), MISSING_FILE: i18n.t('publication:feedback.minimum_one_file'), + INVALID_PAGE_INTERVAL: i18n.t('publication:feedback.invalid_page_interval'), INVALID_FORMAT: i18n.t('publication:feedback.invalid_format'), MUST_BE_FUTURE: i18n.t('publication:feedback.date_must_be_in_future'), + MUST_BE_POSITIVE: i18n.t('publication:feedback.must_be_positive'), + MUST_BE_MIN_1: i18n.t('publication:feedback.must_be_min_1'), }; const contributorValidationSchema = { @@ -51,19 +54,22 @@ const fileValidationSchema = { const journalValidationSchema = { type: Yup.string().oneOf(Object.values(JournalArticleType)).required(ErrorMessage.REQUIRED), peerReviewed: Yup.boolean().required(ErrorMessage.REQUIRED), - articleNumber: Yup.string(), - volume: Yup.string(), - issue: Yup.string(), + articleNumber: Yup.number().typeError(ErrorMessage.INVALID_FORMAT).min(0, ErrorMessage.MUST_BE_POSITIVE), + volume: Yup.number().typeError(ErrorMessage.INVALID_FORMAT).min(0, ErrorMessage.MUST_BE_POSITIVE), + issue: Yup.number().typeError(ErrorMessage.INVALID_FORMAT).min(0, ErrorMessage.MUST_BE_POSITIVE), pages: Yup.object().shape({ - begin: Yup.string(), - end: Yup.string(), + begin: Yup.number() + .typeError(ErrorMessage.INVALID_FORMAT) + .min(0, ErrorMessage.MUST_BE_POSITIVE) + .max(Yup.ref('end'), ErrorMessage.INVALID_PAGE_INTERVAL), + end: Yup.number().typeError(ErrorMessage.INVALID_FORMAT).min(Yup.ref('begin'), ErrorMessage.INVALID_PAGE_INTERVAL), }), }; const bookValidationSchema = { type: Yup.string().oneOf(Object.values(BookType)).required(ErrorMessage.REQUIRED), isbn: Yup.string(), - numberOfPages: Yup.string(), + numberOfPages: Yup.number().typeError(ErrorMessage.INVALID_FORMAT).min(1, ErrorMessage.MUST_BE_MIN_1), textBook: Yup.boolean(), peerReviewed: Yup.boolean().required(ErrorMessage.REQUIRED), }; @@ -71,7 +77,7 @@ const bookValidationSchema = { const reportValidationSchema = { type: Yup.string().oneOf(Object.values(ReportType)).required(ErrorMessage.REQUIRED), isbn: Yup.string(), - numberOfPages: Yup.string(), + numberOfPages: Yup.number().typeError(ErrorMessage.INVALID_FORMAT).min(1, ErrorMessage.MUST_BE_MIN_1), }; const degreeValidationSchema = { diff --git a/src/pages/publication/ReferencesPanel.tsx b/src/pages/publication/ReferencesPanel.tsx index f4da931721..ce1e26aa83 100644 --- a/src/pages/publication/ReferencesPanel.tsx +++ b/src/pages/publication/ReferencesPanel.tsx @@ -12,6 +12,8 @@ import ReportForm from './references_tab/ReportForm'; import Card from '../../components/Card'; import Heading from '../../components/Heading'; import SelectTypeField from './references_tab/components/SelectTypeField'; +import { touchedReferenceTabFields } from '../../utils/formik-helpers'; +import { PanelProps } from './PublicationFormContent'; const StyledCard = styled(Card)` margin-top: 1rem; @@ -21,15 +23,15 @@ const StyledSelectContainer = styled.div` width: 50%; `; -const ReferencesPanel: FC = () => { +const ReferencesPanel: FC = ({ setTouchedFields }) => { const { t } = useTranslation('publication'); const { values, setFieldTouched, setFieldValue }: FormikProps = useFormikContext(); const publicationContextType = values.entityDescription.reference.publicationContext.type; useEffect( // Set all fields as touched if user navigates away from this panel (on unmount) - () => () => Object.values(ReferenceFieldNames).forEach((fieldName) => setFieldTouched(fieldName)), - [setFieldTouched] + () => () => setTouchedFields(touchedReferenceTabFields), + [setTouchedFields] ); return ( diff --git a/src/pages/publication/SubmissionPanel.tsx b/src/pages/publication/SubmissionPanel.tsx index 01ee051367..e7eda1b4e8 100644 --- a/src/pages/publication/SubmissionPanel.tsx +++ b/src/pages/publication/SubmissionPanel.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef, FC } from 'react'; +import React, { useEffect, FC } from 'react'; import { useTranslation } from 'react-i18next'; import { FormikProps, useFormikContext, Field, FieldProps } from 'formik'; import { FormikPublication } from '../../types/publication.types'; @@ -12,7 +12,7 @@ import SubmissionJournalPublication from './submission_tab/submission_journal'; import SubmissionDescription from './submission_tab/submission_description'; import SubmissionFilesAndLicenses from './submission_tab/submission_files_licenses'; import SubmissionContributors from './submission_tab/submission_contributors'; -import { PublicationType, requiredFieldNames } from '../../types/publicationFieldNames'; +import { PublicationType } from '../../types/publicationFieldNames'; import Heading from '../../components/Heading'; import SubHeading from '../../components/SubHeading'; import Card from '../../components/Card'; @@ -25,6 +25,14 @@ import { useDispatch } from 'react-redux'; import { setNotification } from '../../redux/actions/notificationActions'; import { NotificationVariant } from '../../types/notification.types'; import ButtonWithProgress from '../../components/ButtonWithProgress'; +import { + touchedFilesTabFields, + touchedContributorTabFields, + touchedDescriptionTabFields, + touchedReferenceTabFields, + mergeTouchedFields, +} from '../../utils/formik-helpers'; +import { PanelProps } from './PublicationFormContent'; const StyledButtonGroupContainer = styled.div` margin-bottom: 1rem; @@ -40,27 +48,31 @@ enum PublishSettingFieldName { SHOULD_CREATE_DOI = 'shouldCreateDoi', } -interface SubmissionPanelProps { +interface SubmissionPanelProps extends PanelProps { isSaving: boolean; savePublication: (values: FormikPublication) => void; } -const SubmissionPanel: FC = ({ isSaving, savePublication }) => { +const SubmissionPanel: FC = ({ isSaving, savePublication, setTouchedFields }) => { const { t } = useTranslation('publication'); - const { setFieldTouched, setFieldValue, values, isValid }: FormikProps = useFormikContext(); + const { setFieldValue, values, isValid }: FormikProps = useFormikContext(); const history = useHistory(); const dispatch = useDispatch(); - const { reference } = values.entityDescription; + const { + entityDescription: { contributors, reference }, + fileSet: { files }, + } = values; const publicationContextType = reference.publicationContext.type; - const valuesRef = useRef(values); useEffect(() => { - valuesRef.current = values; - }, [values]); - - useEffect(() => { - requiredFieldNames.forEach((fieldName) => setFieldTouched(fieldName)); - }, [setFieldTouched]); + const touchedForm = mergeTouchedFields([ + touchedDescriptionTabFields, + touchedReferenceTabFields, + touchedContributorTabFields(contributors), + touchedFilesTabFields(files), + ]); + setTouchedFields(touchedForm); + }, [setTouchedFields, contributors, files]); const onClickPublish = async () => { await savePublication(values); diff --git a/src/pages/publication/references_tab/JournalArticleForm.tsx b/src/pages/publication/references_tab/JournalArticleForm.tsx index 4a53d83c43..af652b498d 100644 --- a/src/pages/publication/references_tab/JournalArticleForm.tsx +++ b/src/pages/publication/references_tab/JournalArticleForm.tsx @@ -1,4 +1,4 @@ -import { Field, FormikProps, useFormikContext, FieldProps } from 'formik'; +import { Field, FormikProps, useFormikContext, FieldProps, ErrorMessage } from 'formik'; import React, { FC } from 'react'; import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; @@ -56,26 +56,69 @@ const JournalArticleForm: FC = () => { - {({ field }: FieldProps) => } + {({ field, meta: { error, touched } }: FieldProps) => ( + } + /> + )} - {({ field }: FieldProps) => } + {({ field, meta: { error, touched } }: FieldProps) => ( + } + /> + )} - {({ field }: FieldProps) => } + {({ field, meta: { error, touched } }: FieldProps) => ( + } + /> + )} - {({ field }: FieldProps) => } + {({ field, meta: { error, touched } }: FieldProps) => ( + } + /> + )} {t('references.or')} - {({ field }: FieldProps) => ( - + {({ field, meta: { error, touched } }: FieldProps) => ( + } + /> )} diff --git a/src/translations/en/formikValues.json b/src/translations/en/formikValues.json index dd252340b4..525a5e0672 100644 --- a/src/translations/en/formikValues.json +++ b/src/translations/en/formikValues.json @@ -4,8 +4,13 @@ "entityDescription-mainTitle": "$t(common:title)", "entityDescription-reference-publicationContext-title": "$t(common:publisher)", "entityDescription-reference-publicationContext-type": "Publication type", + "entityDescription-reference-publicationInstance-articleNumber": "$t(publication:references.article_number)", + "entityDescription-reference-publicationInstance-issue": "$t(publication:references.issue)", + "entityDescription-reference-publicationInstance-pages-begin": "$t(publication:references.pages_from)", + "entityDescription-reference-publicationInstance-pages-end": "$t(publication:references.pages_to)", "entityDescription-reference-publicationInstance-peerReviewed": "$t(publication:references.peer_reviewed)", "entityDescription-reference-publicationInstance-type": "Publication subtype", + "entityDescription-reference-publicationInstance-volume": "$t(publication:references.volume)", "fileSet-files": "$t(publication:files_and_license.files)", "fileSet-files-embargoDate": "$t(publication:files_and_license.embargo_date)", "fileSet-files-license": "$t(publication:files_and_license.license)", diff --git a/src/translations/en/publication.json b/src/translations/en/publication.json index c442c3d981..677a9ddd17 100644 --- a/src/translations/en/publication.json +++ b/src/translations/en/publication.json @@ -43,9 +43,12 @@ }, "feedback": { "invalid_format": "Invalid format", + "invalid_page_interval": "Invalid page interval", "invalid_url": "Invalid URL", "minimum_one_contributor": "You need to have at least one author registered for this publication", "minimum_one_file": "You need to have at least one file uploaded for this publication", + "must_be_min_1": "Value must be bigger than 1", + "must_be_positive": "Value must be positive", "date_must_be_in_future": "Date must be in future", "required_field": "Required field" }, diff --git a/src/translations/nb/formikValues.json b/src/translations/nb/formikValues.json index aedd41a33f..f94b8224be 100644 --- a/src/translations/nb/formikValues.json +++ b/src/translations/nb/formikValues.json @@ -4,8 +4,13 @@ "entityDescription-mainTitle": "$t(common:title)", "entityDescription-reference-publicationContext-title": "$t(common:publisher)", "entityDescription-reference-publicationContext-type": "Publikasjonstype", + "entityDescription-reference-publicationInstance-articleNumber": "$t(publication:references.article_number)", + "entityDescription-reference-publicationInstance-issue": "$t(publication:references.issue)", + "entityDescription-reference-publicationInstance-pages-begin": "$t(publication:references.pages_from)", + "entityDescription-reference-publicationInstance-pages-end": "$t(publication:references.pages_to)", "entityDescription-reference-publicationInstance-peerReviewed": "$t(publication:references.peer_reviewed)", "entityDescription-reference-publicationInstance-type": "Publikasjonsundertype", + "entityDescription-reference-publicationInstance-volume": "$t(publication:references.volume)", "fileSet-files": "$t(publication:files_and_license.files)", "fileSet-files-embargoDate": "$t(publication:files_and_license.embargo_date)", "fileSet-files-license": "$t(publication:files_and_license.license)", diff --git a/src/translations/nb/publication.json b/src/translations/nb/publication.json index 24d99288d2..1c6847169d 100644 --- a/src/translations/nb/publication.json +++ b/src/translations/nb/publication.json @@ -43,9 +43,12 @@ }, "feedback": { "invalid_format": "Ugyldig format", + "invalid_page_interval": "Ugyldig sideintervall", "invalid_url": "Ugyldig lenke", "minimum_one_contributor": "Du må ha minst en forfatter på denne publikasjonen", "minimum_one_file": "Du må laste opp minst en fil for denne publikasjonen", + "must_be_min_1": "Verdien må være større enn 0", + "must_be_positive": "Verdien må være positiv", "date_must_be_in_future": "Dato må være i fremtiden", "required_field": "Påkrevd felt" }, diff --git a/src/types/publicationFieldNames.ts b/src/types/publicationFieldNames.ts index e90fb82b0c..a0ae6c0a78 100644 --- a/src/types/publicationFieldNames.ts +++ b/src/types/publicationFieldNames.ts @@ -84,17 +84,9 @@ export enum ContributorFieldNames { // The following fields should be present in "entityDescription.contributors[index]." export enum SpecificContributorFieldNames { - AFFILIATIONS = 'affiliations', // TODO + AFFILIATIONS = 'affiliations', CORRESPONDING = 'correspondingAuthor', EMAIL = 'email', ROLE = 'role', // TODO SEQUENCE = 'sequence', } - -export const requiredFieldNames = [ - DescriptionFieldNames.TITLE, - ReferenceFieldNames.PUBLICATION_CONTEXT_TITLE, - ReferenceFieldNames.PUBLICATION_CONTEXT_TYPE, - ContributorFieldNames.CONTRIBUTORS, - FileFieldNames.FILES, -]; diff --git a/src/utils/formik-helpers.ts b/src/utils/formik-helpers.ts index 4f752ffb53..b0d79f67d2 100644 --- a/src/utils/formik-helpers.ts +++ b/src/utils/formik-helpers.ts @@ -7,6 +7,8 @@ import { } from '../types/publicationFieldNames'; import { Contributor } from '../types/contributor.types'; import { File } from '../types/file.types'; +import { FormikPublication } from '../types/publication.types'; +import deepmerge, { Options } from 'deepmerge'; interface CustomError { fieldName: string; @@ -52,10 +54,10 @@ export const hasTouchedError = ( return fieldNames.some((fieldName) => { const fieldHasError = !!getIn(errors, fieldName); - const fieldIsTouched = getIn(touched, fieldName); + const fieldIsTouched = !!getIn(touched, fieldName); // Touched data can be inconsistent with array of null or undefined elements when adding elements dynamically - // to a FieldArray, so check for value to be true explicitly, otherwise any array will also be true - return fieldHasError && fieldIsTouched === true; + // to a FieldArray, so ensure it is a boolean value + return fieldHasError && fieldIsTouched; }); }; @@ -93,3 +95,68 @@ export const getAllContributorFields = (contributors: Contributor[]) => { } return fieldNames; }; + +export const touchedDescriptionTabFields: FormikTouched = { + entityDescription: { + abstract: true, + date: { + day: true, + month: true, + year: true, + }, + description: true, + language: true, + mainTitle: true, + npiSubjectHeading: true, + tags: true, + }, +}; + +export const touchedReferenceTabFields: FormikTouched = { + entityDescription: { + reference: { + publicationContext: { + type: true, + title: true, + }, + publicationInstance: { + type: true, + articleNumber: true, + issue: true, + pages: { + begin: true, + end: true, + }, + peerReviewed: true, + volume: true, + }, + }, + }, +}; + +export const touchedContributorTabFields = (contributors: Contributor[]): FormikTouched => ({ + entityDescription: { + contributors: contributors.map((contributor) => ({ + affiliations: [], + correspondingAuthor: true, + sequence: true, + email: contributor.correspondingAuthor, + })), + }, +}); + +export const touchedFilesTabFields = (files: File[]): FormikTouched => ({ + fileSet: { + files: files.map((file) => ({ + administrativeAgreement: true, + publisherAuthority: !file.administrativeAgreement, + embargoDate: !file.administrativeAgreement, + license: !file.administrativeAgreement, + })), + }, +}); + +const overwriteArrayMerge = (destinationArray: any[], sourceArray: any[], options?: Options) => sourceArray; +export const mergeTouchedFields = (touchedArray: FormikTouched[]) => { + return deepmerge.all(touchedArray, { arrayMerge: overwriteArrayMerge }); +}; From 44680be1714f390389003e623ef38fa368bf5c85 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 13 May 2020 08:31:02 +0200 Subject: [PATCH 007/100] Bump @types/react-dom from 16.9.7 to 16.9.8 (#654) Bumps [@types/react-dom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react-dom) from 16.9.7 to 16.9.8. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react-dom) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 88f67d1b14..2513caf3d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4665,9 +4665,9 @@ } }, "@types/react-dom": { - "version": "16.9.7", - "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.7.tgz", - "integrity": "sha512-GHTYhM8/OwUCf254WO5xqR/aqD3gC9kSTLpopWGpQLpnw23jk44RvMHsyUSEplvRJZdHxhJGMMLF0kCPYHPhQA==", + "version": "16.9.8", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-16.9.8.tgz", + "integrity": "sha512-ykkPQ+5nFknnlU6lDd947WbQ6TE3NNzbQAkInC2EKY1qeYdTKp7onFusmYZb+ityzx2YviqT6BXSu+LyWWJwcA==", "requires": { "@types/react": "*" } diff --git a/package.json b/package.json index da1afe8041..5d583ec5e0 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "@types/jest": "^25.2.1", "@types/node": "^13.13.5", "@types/react": "^16.9.35", - "@types/react-dom": "^16.9.7", + "@types/react-dom": "^16.9.8", "@types/react-redux": "^7.1.8", "@types/react-router-dom": "^5.1.5", "@types/styled-components": "^5.1.0", From 58226ebca44f7a8b6790a18eb41aebb3a465d06f Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 13 May 2020 09:25:37 +0200 Subject: [PATCH 008/100] Bump @typescript-eslint/parser from 2.30.0 to 2.33.0 (#653) Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.30.0 to 2.33.0. - [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases) - [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md) - [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.33.0/packages/parser) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 31 ++++++++++++++++++------------- package.json | 2 +- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2513caf3d9..a02ed5c830 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4836,38 +4836,38 @@ } }, "@typescript-eslint/parser": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.30.0.tgz", - "integrity": "sha512-9kDOxzp0K85UnpmPJqUzdWaCNorYYgk1yZmf4IKzpeTlSAclnFsrLjfwD9mQExctLoLoGAUXq1co+fbr+3HeFw==", + "version": "2.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-2.33.0.tgz", + "integrity": "sha512-AUtmwUUhJoH6yrtxZMHbRUEMsC2G6z5NSxg9KsROOGqNXasM71I8P2NihtumlWTUCRld70vqIZ6Pm4E5PAziEA==", "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.30.0", - "@typescript-eslint/typescript-estree": "2.30.0", + "@typescript-eslint/experimental-utils": "2.33.0", + "@typescript-eslint/typescript-estree": "2.33.0", "eslint-visitor-keys": "^1.1.0" }, "dependencies": { "@typescript-eslint/experimental-utils": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.30.0.tgz", - "integrity": "sha512-L3/tS9t+hAHksy8xuorhOzhdefN0ERPDWmR9CclsIGOUqGKy6tqc/P+SoXeJRye5gazkuPO0cK9MQRnolykzkA==", + "version": "2.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.33.0.tgz", + "integrity": "sha512-qzPM2AuxtMrRq78LwyZa8Qn6gcY8obkIrBs1ehqmQADwkYzTE1Pb4y2W+U3rE/iFkSWcWHG2LS6MJfj6SmHApg==", "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.30.0", + "@typescript-eslint/typescript-estree": "2.33.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/typescript-estree": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.30.0.tgz", - "integrity": "sha512-nI5WOechrA0qAhnr+DzqwmqHsx7Ulr/+0H7bWCcClDhhWkSyZR5BmTvnBEyONwJCTWHfc5PAQExX24VD26IAVw==", + "version": "2.33.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.33.0.tgz", + "integrity": "sha512-d8rY6/yUxb0+mEwTShCQF2zYQdLlqihukNfG9IUlLYz5y1CH6G/9XYbrxQLq3Z14RNvkCC6oe+OcFlyUpwUbkg==", "requires": { "debug": "^4.1.1", "eslint-visitor-keys": "^1.1.0", "glob": "^7.1.6", "is-glob": "^4.0.1", "lodash": "^4.17.15", - "semver": "^6.3.0", + "semver": "^7.3.2", "tsutils": "^3.17.1" } }, @@ -4883,6 +4883,11 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==" } } }, diff --git a/package.json b/package.json index 5d583ec5e0..818c2635a1 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "@types/react-router-dom": "^5.1.5", "@types/styled-components": "^5.1.0", "@types/yup": "^0.28.1", - "@typescript-eslint/parser": "^2.30.0", + "@typescript-eslint/parser": "^2.33.0", "axios-mock-adapter": "^1.18.1", "cypress": "^4.5.0", "eslint-plugin-prettier": "^3.1.3", From f29b9d7b4257ddbf2b280b199a9a56069d8b3866 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 13 May 2020 10:40:30 +0200 Subject: [PATCH 009/100] Bump @types/node from 13.13.5 to 14.0.1 (#650) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 13.13.5 to 14.0.1. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a02ed5c830..891fded40b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4636,9 +4636,9 @@ "dev": true }, "@types/node": { - "version": "13.13.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.5.tgz", - "integrity": "sha512-3ySmiBYJPqgjiHA7oEaIo2Rzz0HrOZ7yrNO5HWyaE5q0lQ3BppDZ3N53Miz8bw2I7gh1/zir2MGVZBvpb1zq9g==" + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz", + "integrity": "sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA==" }, "@types/parse-json": { "version": "4.0.0", diff --git a/package.json b/package.json index 818c2635a1..29bf54029c 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "@cypress/webpack-preprocessor": "^5.2.0", "@istanbuljs/nyc-config-typescript": "^1.0.1", "@types/jest": "^25.2.1", - "@types/node": "^13.13.5", + "@types/node": "^14.0.1", "@types/react": "^16.9.35", "@types/react-dom": "^16.9.8", "@types/react-redux": "^7.1.8", From 92983c960ad1c5215a9bc591809e900f0a665e74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Wed, 13 May 2020 13:45:10 +0200 Subject: [PATCH 010/100] Np 450 show affiliations in author list (#655) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * NP-450 Show one institution for authors * NP-450 Reuse logic for listing authorities * NP-450 Allow setting maxWidth of modal * NP-450 Reset initial tab number Co-authored-by: Møkkelgjerd Kjetil --- src/components/Modal.tsx | 6 +- .../contributors_tab/AddContributorModal.tsx | 3 +- .../components/AddContributorModalContent.tsx | 38 +++---------- src/pages/user/authority/AuthorityCard.tsx | 49 +++++++++++----- src/pages/user/authority/AuthorityList.tsx | 57 +++++++++++++++++++ .../user/authority/AuthorityOrcidModal.tsx | 5 +- src/pages/user/authority/ConnectAuthority.tsx | 34 +++-------- 7 files changed, 116 insertions(+), 76 deletions(-) create mode 100644 src/pages/user/authority/AuthorityList.tsx diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx index 82cca3de0b..9137a47f47 100644 --- a/src/components/Modal.tsx +++ b/src/components/Modal.tsx @@ -1,7 +1,7 @@ import React, { FC } from 'react'; import styled from 'styled-components'; -import { Avatar, Backdrop, Dialog, Fade, DialogTitle } from '@material-ui/core'; +import { Avatar, Backdrop, Dialog, Fade, DialogTitle, DialogProps } from '@material-ui/core'; import CloseIcon from '@material-ui/icons/Close'; import Heading from './Heading'; @@ -51,7 +51,7 @@ const StyledDialogTitle = styled(DialogTitle)` padding: 0; `; -interface ModalProps { +interface ModalProps extends Partial { ariaDescribedBy?: string; ariaLabelledBy?: string; children: any; @@ -73,6 +73,7 @@ const Modal: FC = ({ headingText, onClose, openModal, + ...props }) => { const handleClose = () => { onClose && onClose(); @@ -80,6 +81,7 @@ const Modal: FC = ({ return ( = ({ : t('contributors.add_author') } onClose={handleCloseModal} - openModal={open}> + openModal={open} + maxWidth="lg"> {createNewAuthor ? ( ) : ( diff --git a/src/pages/publication/contributors_tab/components/AddContributorModalContent.tsx b/src/pages/publication/contributors_tab/components/AddContributorModalContent.tsx index 9110e59320..8ebfea4683 100644 --- a/src/pages/publication/contributors_tab/components/AddContributorModalContent.tsx +++ b/src/pages/publication/contributors_tab/components/AddContributorModalContent.tsx @@ -6,22 +6,13 @@ import styled from 'styled-components'; import { Button, CircularProgress } from '@material-ui/core'; import { getAuthorities } from '../../../../api/authorityApi'; -import Label from '../../../../components/Label'; import SearchBar from '../../../../components/SearchBar'; import { setNotification } from '../../../../redux/actions/notificationActions'; import { Authority } from '../../../../types/authority.types'; -import AuthorityCard from '../../../user/authority/AuthorityCard'; import NormalText from '../../../../components/NormalText'; import { NotificationVariant } from '../../../../types/notification.types'; import SubHeading from '../../../../components/SubHeading'; - -const StyledClickableDiv = styled.div` - cursor: pointer; - align-items: center; - background-color: ${({ theme }) => theme.palette.box.main}; - padding-right: 0.5rem; - margin-bottom: 0.5rem; -`; +import { AuthorityList } from '../../../user/authority/AuthorityList'; const StyledButtonContainer = styled.div` display: flex; @@ -36,10 +27,6 @@ const StyledProgressContainer = styled.div` padding: 2rem; `; -const StyledLabel = styled(Label)` - padding: 0.5rem; -`; - const StyledSubHeading = styled(SubHeading)` margin-bottom: 1rem; `; @@ -108,23 +95,12 @@ const AddContributorModalContent: FC = ({ addAu ) : matchingAuthorities?.length > 0 ? ( <> - - {t('profile:authority.search_summary', { - searchTerm: searchSummary.searchTerm, - results: searchSummary.results, - })} - - {matchingAuthorities?.map((authority) => ( - setSelectedAuthor(authority)}> - - - ))} + - + ); }; diff --git a/src/pages/publication/references_tab/BookForm.tsx b/src/pages/publication/references_tab/BookForm.tsx index 59354c6d49..23261ebed8 100644 --- a/src/pages/publication/references_tab/BookForm.tsx +++ b/src/pages/publication/references_tab/BookForm.tsx @@ -25,7 +25,6 @@ const StyledSection = styled.div` margin-top: 0.7rem; padding-top: 0.7rem; padding-left: 0.7rem; - background-color: ${({ theme }) => theme.palette.background.default}; `; const StyledPeerReview = styled.div` diff --git a/src/pages/publication/references_tab/JournalArticleForm.tsx b/src/pages/publication/references_tab/JournalArticleForm.tsx index af652b498d..3a9b830731 100644 --- a/src/pages/publication/references_tab/JournalArticleForm.tsx +++ b/src/pages/publication/references_tab/JournalArticleForm.tsx @@ -30,7 +30,6 @@ const StyledPeerReview = styled.div` margin-top: 0.7rem; padding-top: 0.7rem; padding-left: 0.7rem; - background-color: ${({ theme }) => theme.palette.background.default}; `; const JournalArticleForm: FC = () => { diff --git a/src/pages/publication/references_tab/components/NviValidation.tsx b/src/pages/publication/references_tab/components/NviValidation.tsx index 1e044d2a93..2b8fe46d2f 100644 --- a/src/pages/publication/references_tab/components/NviValidation.tsx +++ b/src/pages/publication/references_tab/components/NviValidation.tsx @@ -4,15 +4,15 @@ import styled from 'styled-components'; import CancelIcon from '@material-ui/icons/Cancel'; import CheckCircleIcon from '@material-ui/icons/CheckCircle'; +import Card from '../../../../components/Card'; -const StyledNviValidation = styled.div` +const StyledNviValidation = styled(Card)` margin-top: 1rem; display: grid; grid-template-columns: 4rem auto; grid-template-areas: 'icon header' 'icon information'; - background-color: ${({ theme }) => theme.palette.background.default}; padding: 1rem 0; `; diff --git a/src/pages/publication/references_tab/components/PublisherRow.tsx b/src/pages/publication/references_tab/components/PublisherRow.tsx index 3d39ee6bc4..4a00ae4d4d 100644 --- a/src/pages/publication/references_tab/components/PublisherRow.tsx +++ b/src/pages/publication/references_tab/components/PublisherRow.tsx @@ -10,11 +10,11 @@ import { getPublishers } from '../../../../api/publicationChannelApi'; import { PublicationTableNumber } from '../../../../utils/constants'; import { FormikProps, useFormikContext } from 'formik'; import { ReferenceFieldNames } from '../../../../types/publicationFieldNames'; +import Card from '../../../../components/Card'; -const StyledPublisherRow = styled.div` +const StyledPublisherCard = styled(Card)` margin: 1rem 0; padding: 1rem; - background-color: ${({ theme }) => theme.palette.background.default}; display: grid; grid-column-gap: 0.5rem; grid-template-areas: @@ -80,7 +80,7 @@ const PublisherRow: React.FC = ({ dataTestId, publisher, labe }, [level, setFieldValue, title]); return ( - + {label} {t('references.level')} {title} @@ -88,7 +88,7 @@ const PublisherRow: React.FC = ({ dataTestId, publisher, labe {t('common:remove')} - + ); }; From d2f270ec3c3461ae2822d0d4f3f8c4c47b7096ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Wed, 13 May 2020 16:10:00 +0200 Subject: [PATCH 013/100] Np 903 prefill affiliations (#659) * NP-903 Remove unused code * NP-903 Prefill selected contributor with affiliations * NP-903 Display number of affiliations for each contributor --- .../contributors_tab/AddContributorModal.tsx | 2 -- .../components/SortableTable.tsx | 7 ++++++- .../submission_tab/submission_contributors.tsx | 11 +++++++++-- src/translations/en/publication.json | 4 +++- src/translations/nb/publication.json | 4 +++- src/types/contributor.types.ts | 2 +- src/utils/hooks/useFetchMultipleUnits.tsx | 9 ++------- src/utils/hooks/useFetchUnitHierarchy.tsx | 9 ++------- src/utils/isValidUrl.ts | 8 -------- src/utils/unitUrl.ts | 17 +++++++++++++++++ 10 files changed, 43 insertions(+), 30 deletions(-) delete mode 100644 src/utils/isValidUrl.ts create mode 100644 src/utils/unitUrl.ts diff --git a/src/pages/publication/contributors_tab/AddContributorModal.tsx b/src/pages/publication/contributors_tab/AddContributorModal.tsx index 60cfe840fa..26ae8265d6 100644 --- a/src/pages/publication/contributors_tab/AddContributorModal.tsx +++ b/src/pages/publication/contributors_tab/AddContributorModal.tsx @@ -27,11 +27,9 @@ const AddContributorModal: FC = ({ initialSearchTerm, }) => { const { t } = useTranslation('publication'); - const [addedAuthors, setAddedAuthors] = useState([]); const [createNewAuthor, setCreateNewAuthor] = useState(false); const addAuthor = (author: Authority) => { - setAddedAuthors([...addedAuthors, author]); toggleModal(); onAuthorSelected(author); }; diff --git a/src/pages/publication/contributors_tab/components/SortableTable.tsx b/src/pages/publication/contributors_tab/components/SortableTable.tsx index ea0363a9df..8e1ee6e62f 100644 --- a/src/pages/publication/contributors_tab/components/SortableTable.tsx +++ b/src/pages/publication/contributors_tab/components/SortableTable.tsx @@ -20,7 +20,7 @@ import AddIcon from '@material-ui/icons/Add'; import { ContributorFieldNames, SpecificContributorFieldNames } from '../../../../types/publicationFieldNames'; import { Contributor, emptyContributor } from '../../../../types/contributor.types'; -import { FormikPublication } from '../../../../types/publication.types'; +import { FormikPublication, BackendTypeNames } from '../../../../types/publication.types'; import SubHeading from '../../../../components/SubHeading'; import AddContributor from '../AddContributorModal'; import styled from 'styled-components'; @@ -30,6 +30,7 @@ import { useDispatch } from 'react-redux'; import { setNotification } from '../../../../redux/actions/notificationActions'; import { NotificationVariant } from '../../../../types/notification.types'; import { Authority } from '../../../../types/authority.types'; +import { getUnitUri } from '../../../../utils/unitUrl'; const StyledWarningIcon = styled(WarningIcon)` color: ${({ theme }) => theme.palette.warning.main}; @@ -264,6 +265,10 @@ const SortableTable: FC = ({ push, remove, move, replace }) const newContributor: Contributor = { ...emptyContributor, identity, + affiliations: authority.orgunitids.map((unitId) => ({ + type: BackendTypeNames.ORGANIZATION, + id: getUnitUri(unitId), + })), }; push(newContributor); } else { diff --git a/src/pages/publication/submission_tab/submission_contributors.tsx b/src/pages/publication/submission_tab/submission_contributors.tsx index 7047ccd124..0bc34e90ee 100644 --- a/src/pages/publication/submission_tab/submission_contributors.tsx +++ b/src/pages/publication/submission_tab/submission_contributors.tsx @@ -4,6 +4,11 @@ import { useTranslation } from 'react-i18next'; import { FormikProps, useFormikContext } from 'formik'; import { FormikPublication } from '../../../types/publication.types'; import NormalText from '../../../components/NormalText'; +import styled from 'styled-components'; + +const StyledAffiliationCount = styled.span` + margin-left: 0.5rem; +`; const SubmissionContributors: React.FC = () => { const { t } = useTranslation('publication'); @@ -18,8 +23,10 @@ const SubmissionContributors: React.FC = () => { {contributors.map((contributor) => ( {contributor.identity.name} - {contributor.affiliations?.map( - (affiliation) => affiliation?.labels && `(${Object.values(affiliation.labels)[0]})` + {contributor.affiliations?.length > 0 && ( + + ({t('submission.number_of_affiliations', { count: contributor.affiliations.length })}) + )} ))} diff --git a/src/translations/en/publication.json b/src/translations/en/publication.json index 677a9ddd17..095938e2bb 100644 --- a/src/translations/en/publication.json +++ b/src/translations/en/publication.json @@ -143,7 +143,9 @@ "Rejected": "Rejected" }, "submission": { - "ask_for_doi": "Ask for DOI for this registration" + "ask_for_doi": "Ask for DOI for this registration", + "number_of_affiliations": "{{count}} affiliation", + "number_of_affiliations_plural": "{{count}} affiliations" }, "modal_unsaved_changes_description": "You have unsaved changes. Are you sure you want to leave this page?", "modal_unsaved_changes_heading": "Leave without saving?" diff --git a/src/translations/nb/publication.json b/src/translations/nb/publication.json index 1c6847169d..29af811e62 100644 --- a/src/translations/nb/publication.json +++ b/src/translations/nb/publication.json @@ -143,7 +143,9 @@ "Rejected": "Avvist" }, "submission": { - "ask_for_doi": "Be om DOI for denne registreringen (anbefales ikke dersom ressursen allerede har en DOI)" + "ask_for_doi": "Be om DOI for denne registreringen (anbefales ikke dersom ressursen allerede har en DOI)", + "number_of_affiliations": "{{count}} tilknytning", + "number_of_affiliations_plural": "{{count}} tilknytninger" }, "modal_unsaved_changes_description": "Du har gjort endringer som ikke er lagret. Er du sikker på at du vil forlate denne siden?", "modal_unsaved_changes_heading": "Forlate siden uten å ha lagret?" diff --git a/src/types/contributor.types.ts b/src/types/contributor.types.ts index 3bb6bac0ca..2e3e787ede 100644 --- a/src/types/contributor.types.ts +++ b/src/types/contributor.types.ts @@ -23,7 +23,7 @@ export interface Contributor extends BackendType { export interface Institution extends BackendType { id: string; - labels: { + labels?: { [key: string]: string; }; } diff --git a/src/utils/hooks/useFetchMultipleUnits.tsx b/src/utils/hooks/useFetchMultipleUnits.tsx index 1318dabe70..8d402c5e3a 100644 --- a/src/utils/hooks/useFetchMultipleUnits.tsx +++ b/src/utils/hooks/useFetchMultipleUnits.tsx @@ -2,11 +2,10 @@ import { useState, useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { RecursiveInstitutionUnit } from '../../types/institution.types'; -import { CRISTIN_UNITS_BASE_URL, CRISTIN_INSTITUTIONS_BASE_URL } from '../constants'; import { getDepartment } from '../../api/institutionApi'; import { setNotification } from '../../redux/actions/notificationActions'; import { NotificationVariant } from '../../types/notification.types'; -import { isValidUrl } from '../isValidUrl'; +import { getUnitUri } from '../unitUrl'; import Axios from 'axios'; // This hook is used to fetch the top-down hierarchy of units given an array of unitIds @@ -20,11 +19,7 @@ const useFetchMultipleUnits = (unitIds: string[] | undefined): [RecursiveInstitu const fetchDepartment = async (unitId: string) => { // TODO: NP-844 should ensure we have URIs from start (not IDs) - const unitUri = isValidUrl(unitId) - ? unitId - : unitId.includes('.') // Check if root level institution - ? `${CRISTIN_UNITS_BASE_URL}${unitId}` - : `${CRISTIN_INSTITUTIONS_BASE_URL}${unitId}`; + const unitUri = getUnitUri(unitId); const response = await getDepartment(unitUri, cancelSource.token); if (response) { diff --git a/src/utils/hooks/useFetchUnitHierarchy.tsx b/src/utils/hooks/useFetchUnitHierarchy.tsx index bd133c1b5e..e79e32772b 100644 --- a/src/utils/hooks/useFetchUnitHierarchy.tsx +++ b/src/utils/hooks/useFetchUnitHierarchy.tsx @@ -2,11 +2,10 @@ import { useState, useEffect } from 'react'; import { useDispatch } from 'react-redux'; import { RecursiveInstitutionUnit } from '../../types/institution.types'; -import { CRISTIN_UNITS_BASE_URL, CRISTIN_INSTITUTIONS_BASE_URL } from '../constants'; import { getDepartment } from '../../api/institutionApi'; import { setNotification } from '../../redux/actions/notificationActions'; import { NotificationVariant } from '../../types/notification.types'; -import { isValidUrl } from '../isValidUrl'; +import { getUnitUri } from '../unitUrl'; import Axios from 'axios'; // This hook is used to fetch the top-down hierarchy of any given sub-unit @@ -21,11 +20,7 @@ const useFetchUnitHierarchy = (unitId: string): [RecursiveInstitutionUnit | unde const fetchDepartment = async () => { setIsLoading(true); // TODO: NP-844 should ensure we have URIs from start (not IDs) - const unitUri = isValidUrl(unitId) - ? unitId - : unitId.includes('.') // Check if root level institution - ? `${CRISTIN_UNITS_BASE_URL}${unitId}` - : `${CRISTIN_INSTITUTIONS_BASE_URL}${unitId}`; + const unitUri = getUnitUri(unitId); const response = await getDepartment(unitUri, cancelSource.token); if (response) { diff --git a/src/utils/isValidUrl.ts b/src/utils/isValidUrl.ts deleted file mode 100644 index 033a56f1f4..0000000000 --- a/src/utils/isValidUrl.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const isValidUrl = (string: string) => { - try { - new URL(string); - } catch { - return false; - } - return true; -}; diff --git a/src/utils/unitUrl.ts b/src/utils/unitUrl.ts new file mode 100644 index 0000000000..9a65c437ea --- /dev/null +++ b/src/utils/unitUrl.ts @@ -0,0 +1,17 @@ +import { CRISTIN_UNITS_BASE_URL, CRISTIN_INSTITUTIONS_BASE_URL } from './constants'; + +const isValidUrl = (string: string) => { + try { + new URL(string); + } catch { + return false; + } + return true; +}; + +export const getUnitUri = (unitId: string) => + isValidUrl(unitId) + ? unitId + : unitId.includes('.') // Check if root level institution + ? `${CRISTIN_UNITS_BASE_URL}${unitId}` + : `${CRISTIN_INSTITUTIONS_BASE_URL}${unitId}`; From 65079bcf2b878eb397032c4a379d99c5075e9669 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 14 May 2020 08:36:16 +0200 Subject: [PATCH 014/100] Bump @types/yup from 0.28.1 to 0.28.3 (#661) Bumps [@types/yup](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/yup) from 0.28.1 to 0.28.3. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/yup) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 891fded40b..5c9a068cac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4808,9 +4808,9 @@ "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==" }, "@types/yup": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/@types/yup/-/yup-0.28.1.tgz", - "integrity": "sha512-5Xqhu/yZWqtO5ZI83SELkq4vA4LnQzzBPlx0zBH9JgMPTuQk3RoTEotKe8is7ZG2Pk+2DmMhid+2Mn87PgpJgw==", + "version": "0.28.3", + "resolved": "https://registry.npmjs.org/@types/yup/-/yup-0.28.3.tgz", + "integrity": "sha512-0Sir2LxOmupF8HBUvpJoZghLmOqKfZsBk1GYlMwSIccLDDUoN04LHvo0KzDp9qxt1IKf9Fudpj35SrJ8VqetkQ==", "dev": true }, "@typescript-eslint/eslint-plugin": { diff --git a/package.json b/package.json index 29bf54029c..d0853dc4f0 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "@types/react-redux": "^7.1.8", "@types/react-router-dom": "^5.1.5", "@types/styled-components": "^5.1.0", - "@types/yup": "^0.28.1", + "@types/yup": "^0.28.3", "@typescript-eslint/parser": "^2.33.0", "axios-mock-adapter": "^1.18.1", "cypress": "^4.5.0", From 479aa2c3e4e4d68e7c250f0deb8ac7127c9f75f1 Mon Sep 17 00:00:00 2001 From: sarahse Date: Thu, 14 May 2020 08:39:35 +0200 Subject: [PATCH 015/100] Np 899 license info (#658) * add svg files for licenses * set selected license image * delete png images * fix styling of cc images in select in FileCard after using svg * add cssByNc and ccByNd * add cc-by-nc-sa svg * add cc-by-nc-nd and cc0 svgs * fix size of cc0 button * add translations for cc by * add text for cc-by-nd and cc-by-sa * use translations * add rest of translations * fix styling of license modal * set maxWidth of modal to medium and simplify conditional render --- .../publication/FilesAndLicensePanel.tsx | 9 +- .../files_and_license_tab/FileCard.tsx | 22 ++++- .../publication_page/PublicationPage.tsx | 37 +++++++ .../images/licenses/button-cc-by-nc-nd.svg | 93 ++++++++++++++++++ .../images/licenses/button-cc-by-nc-sa.svg | 55 +++++++++++ .../images/licenses/button-cc-by-nc.svg | 67 +++++++++++++ .../images/licenses/button-cc-by-nd.svg | 75 ++++++++++++++ .../images/licenses/button-cc-by-sa.svg | 72 ++++++++++++++ .../images/licenses/button-cc-by.svg | 52 ++++++++++ src/resources/images/licenses/button-cc0.svg | 29 ++++++ src/resources/images/licenses/cc-by-nc-nd.png | Bin 1773 -> 0 bytes src/resources/images/licenses/cc-by-nc-nd.svg | 34 +++++++ src/resources/images/licenses/cc-by-nc-sa.png | Bin 1888 -> 0 bytes src/resources/images/licenses/cc-by-nc-sa.svg | 35 +++++++ src/resources/images/licenses/cc-by-nc.png | Bin 1709 -> 0 bytes src/resources/images/licenses/cc-by-nc.svg | 27 +++++ src/resources/images/licenses/cc-by-nd.png | Bin 1562 -> 0 bytes src/resources/images/licenses/cc-by-nd.svg | 27 +++++ src/resources/images/licenses/cc-by-sa.png | Bin 1697 -> 0 bytes src/resources/images/licenses/cc-by-sa.svg | 27 +++++ src/resources/images/licenses/cc-by.png | Bin 1468 -> 0 bytes src/resources/images/licenses/cc-by.svg | 18 ++++ src/resources/images/licenses/cc.svg | 6 ++ src/resources/images/licenses/cc0.png | Bin 1009 -> 0 bytes src/resources/images/licenses/cc0.svg | 7 ++ src/resources/images/licenses/index.ts | 24 +++-- src/translations/en/licenses.json | 20 ++++ src/translations/i18n.ts | 4 + src/translations/nb/licenses.json | 20 ++++ src/types/file.types.ts | 40 +++++--- 30 files changed, 773 insertions(+), 27 deletions(-) create mode 100644 src/resources/images/licenses/button-cc-by-nc-nd.svg create mode 100644 src/resources/images/licenses/button-cc-by-nc-sa.svg create mode 100644 src/resources/images/licenses/button-cc-by-nc.svg create mode 100644 src/resources/images/licenses/button-cc-by-nd.svg create mode 100644 src/resources/images/licenses/button-cc-by-sa.svg create mode 100644 src/resources/images/licenses/button-cc-by.svg create mode 100644 src/resources/images/licenses/button-cc0.svg delete mode 100644 src/resources/images/licenses/cc-by-nc-nd.png create mode 100644 src/resources/images/licenses/cc-by-nc-nd.svg delete mode 100644 src/resources/images/licenses/cc-by-nc-sa.png create mode 100644 src/resources/images/licenses/cc-by-nc-sa.svg delete mode 100644 src/resources/images/licenses/cc-by-nc.png create mode 100644 src/resources/images/licenses/cc-by-nc.svg delete mode 100644 src/resources/images/licenses/cc-by-nd.png create mode 100644 src/resources/images/licenses/cc-by-nd.svg delete mode 100644 src/resources/images/licenses/cc-by-sa.png create mode 100644 src/resources/images/licenses/cc-by-sa.svg delete mode 100644 src/resources/images/licenses/cc-by.png create mode 100644 src/resources/images/licenses/cc-by.svg create mode 100644 src/resources/images/licenses/cc.svg delete mode 100644 src/resources/images/licenses/cc0.png create mode 100644 src/resources/images/licenses/cc0.svg create mode 100644 src/translations/en/licenses.json create mode 100644 src/translations/nb/licenses.json diff --git a/src/pages/publication/FilesAndLicensePanel.tsx b/src/pages/publication/FilesAndLicensePanel.tsx index 483952f3e6..773cb9f18b 100644 --- a/src/pages/publication/FilesAndLicensePanel.tsx +++ b/src/pages/publication/FilesAndLicensePanel.tsx @@ -30,6 +30,7 @@ const StyledUploadedFiles = styled(Card)` const StyledLicenseDescription = styled.article` margin-bottom: 1rem; + white-space: pre-wrap; `; interface FilesAndLicensePanelProps extends PanelProps { @@ -104,11 +105,15 @@ const FilesAndLicensePanel: FC = ({ uppy, setTouchedF )} - + {licenses.map((license) => ( - {license.identifier} + {license.identifier} {license.description} ))} diff --git a/src/pages/publication/files_and_license_tab/FileCard.tsx b/src/pages/publication/files_and_license_tab/FileCard.tsx index e6fc821c20..37185c5ed9 100644 --- a/src/pages/publication/files_and_license_tab/FileCard.tsx +++ b/src/pages/publication/files_and_license_tab/FileCard.tsx @@ -55,13 +55,26 @@ const StyledSelect = styled(TextField)` } `; +const StyledLicenseImage = styled.img` + width: 40%; +`; + +const StyledLicenseOptionImage = styled.img` + width: 70%; +`; + const StyledLicenseName = styled(Label)` margin-left: 0.5rem; `; +const StyledLicenseOptionName = styled(Label)` + margin-left: -1.5rem; +`; + const StyledVerticalAlign = styled.div` display: flex; align-items: center; + margin-top: -0.25rem; `; const StyledActions = styled.div` @@ -156,7 +169,10 @@ const FileCard: FC = ({ file, removeFile, baseFieldName, toggleLi const selectedLicense = licenses.find((license) => license.identifier === option); return selectedLicense ? ( - {selectedLicense.identifier} + {option} ) : null; @@ -182,10 +198,10 @@ const FileCard: FC = ({ file, removeFile, baseFieldName, toggleLi divider dense> - {license.identifier} + - {license.identifier} + {license.identifier} ))} diff --git a/src/pages/publication/publication_page/PublicationPage.tsx b/src/pages/publication/publication_page/PublicationPage.tsx index e9f2386e7a..8114441d87 100644 --- a/src/pages/publication/publication_page/PublicationPage.tsx +++ b/src/pages/publication/publication_page/PublicationPage.tsx @@ -16,6 +16,9 @@ import { NotificationVariant } from '../../../types/notification.types'; import { useParams } from 'react-router'; import { DOI_PREFIX } from '../../../utils/constants'; import LabelContentRow from '../../../components/LabelContentRow'; +import Label from '../../../components/Label'; +import NormalText from '../../../components/NormalText'; +import { licenses } from '../../../types/file.types'; const StyledContentWrapper = styled.div` display: flex; @@ -39,6 +42,29 @@ const StyledSidebarCard = styled(Card)` padding: 0.5rem; `; +const StyledLicenseCard = styled(Card)` + display: grid; + grid-template-areas: 'image label' 'image description'; + column-gap: 1rem; + align-items: center; + justify-content: left; + margin: 0.5rem 0; + padding: 1rem; +`; + +const StyledImage = styled.img` + grid-area: image; +`; + +const StyledLabel = styled(Label)` + grid-area: label; +`; + +const StyledNormalText = styled(NormalText)` + grid-area: description; + white-space: pre-wrap; +`; + const PublicationPage: FC = () => { const { identifier } = useParams(); const dispatch = useDispatch(); @@ -73,6 +99,10 @@ const PublicationPage: FC = () => { series, } = publication ? publication.entityDescription : emptyPublication.entityDescription; + // Show only the license for the first file for now + const currentLicense = publication?.fileSet?.files[0]?.license ?? null; + const selectedLicense = licenses.find((license) => license.identifier === currentLicense?.identifier); + return ( <> {isLoadingPublication ? ( @@ -127,6 +157,13 @@ const PublicationPage: FC = () => { {publicationContext.title} )} + {selectedLicense && ( + + + {selectedLicense.label} + {selectedLicense.description} + + )} {publication.project && ( {publication.project.name} diff --git a/src/resources/images/licenses/button-cc-by-nc-nd.svg b/src/resources/images/licenses/button-cc-by-nc-nd.svg new file mode 100644 index 0000000000..56df4afbe3 --- /dev/null +++ b/src/resources/images/licenses/button-cc-by-nc-nd.svg @@ -0,0 +1,93 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/resources/images/licenses/button-cc-by-nc-sa.svg b/src/resources/images/licenses/button-cc-by-nc-sa.svg new file mode 100644 index 0000000000..d72f004b1b --- /dev/null +++ b/src/resources/images/licenses/button-cc-by-nc-sa.svg @@ -0,0 +1,55 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/resources/images/licenses/button-cc-by-nc.svg b/src/resources/images/licenses/button-cc-by-nc.svg new file mode 100644 index 0000000000..5139f3c6d8 --- /dev/null +++ b/src/resources/images/licenses/button-cc-by-nc.svg @@ -0,0 +1,67 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/resources/images/licenses/button-cc-by-nd.svg b/src/resources/images/licenses/button-cc-by-nd.svg new file mode 100644 index 0000000000..728831d3a6 --- /dev/null +++ b/src/resources/images/licenses/button-cc-by-nd.svg @@ -0,0 +1,75 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/resources/images/licenses/button-cc-by-sa.svg b/src/resources/images/licenses/button-cc-by-sa.svg new file mode 100644 index 0000000000..cfe3e6ed23 --- /dev/null +++ b/src/resources/images/licenses/button-cc-by-sa.svg @@ -0,0 +1,72 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/resources/images/licenses/button-cc-by.svg b/src/resources/images/licenses/button-cc-by.svg new file mode 100644 index 0000000000..c5b69cbab1 --- /dev/null +++ b/src/resources/images/licenses/button-cc-by.svg @@ -0,0 +1,52 @@ + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/resources/images/licenses/button-cc0.svg b/src/resources/images/licenses/button-cc0.svg new file mode 100644 index 0000000000..935c63cc03 --- /dev/null +++ b/src/resources/images/licenses/button-cc0.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/resources/images/licenses/cc-by-nc-nd.png b/src/resources/images/licenses/cc-by-nc-nd.png deleted file mode 100644 index 55e348a44b70ffdac5484d94a996e99217266954..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1773 zcmV$#j|zB%)q%WMM?H8nIe(0Q$WCBmQbkLAD;t%g>}A6}!-Mv%g>Fl{8F z6idZuE0ds9E=lQpnzDrq<&-StiaE6^S;{II%H-2*493P&F*Y|63o}{%u%F4sJA7-4 zw6Ho)^UGeETY5<^eY332F3!-*!i&1863|EB1|oi1-waVS9-&xrlYy1arx<{RQl5%C z3YA_JX?u5@c3!I$&!tx-)`u}!CClbuE@VU#5hfF|^&oqf=LEoTg(BePFo>F^9yO7h<(?bIT1FYhiw`0uc^HI}9q3^875decHK?_IV z=9nh-e$}f1uerII`uh54XlRHckqE1JMjQI%v6vfA#wcG>L53!SE>uolqm|&Ypo)K{ z|E8vGsW^Xn%j-mK>x1$E+C1(EuD{)R1BZ4V){3Yo)bz zKn5qn@G+`L#V8V2wHRF7(Wz>$lTE}}ZfN*o_$g@r;6r-3j6> z5qqAUnXx73r2mfwV5YrFhEW4IXgKPMqENL3AalBaOvr`{$F(@Lp=vQVAo_yi$v4R8 zsB%LiF9vP5Zrr4wZ{21f^U5{XNF&YU$VHYV*Gh6U0D~X%r95-R_@c1uCoP!7}TMK~$tEn4-xh33KF1^j+Ta;!>4 zfMMKlgn1AlA4vdcg?<^H7aJ> zYu7kIQvn3D7nRcl4Bfq7U38)KJzH|FU%O^lZ5uiGzQ`-^1p!3;B8@oN4qwYB0PlcL zyp`D!01w{3C)^^t09(0NGCjEO4+}R9E*rGkshktLX>Sr>1RUH|vlD1=u5%I~Jo)YS zV}V9Baw>6e#X!R@MZoaEb;C12l_^5sXO|)X@bru6`VN&V8M#V^%#M-cJFFVHB72u? zbO40xvIZ5*-T^$L4QC)*Bk*>V@-Bk_9 zPLe**dc$;OAw$CthTq29<)a@1H-2PpRI!SLJNht2PPkwE>>{HE_}Q*<-uJBr7!?U{ z1OotB*5qogi~w%Fn4@Q7&+L9jU>IcR$Jmi$_S-C(o4ku&=EA{GR>X%VCF#SH5^Iw`Jel`->C)v()qHAnB5JUrglaUn26C+b zVSx4c$zuvdL(->H<%& + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/resources/images/licenses/cc-by-nc-sa.png b/src/resources/images/licenses/cc-by-nc-sa.png deleted file mode 100644 index 8b53554763f972baa17b181b780316f2f1ee5410..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1888 zcmV-m2cP(fP)r$sh56oKc#*Mui$2E2 zGp6PyX<~Mq#=RaIn|@4>ryg;AG&xG66Avqks;9VL3pdl^}(q%S={09b*DB zxin>;D3p7erM2}ndh$%IxXwMzaUaGcl_cMTdw~&(1Q`?9Mv^_=F^yypT%ja8^yEfD zY=O~al&uw{fz+-WU3BX7DXOZj+OZVShQ6+wT|73kmf=Z(MX$tH*qRrX7jz^~&P~wx zj7KGTYMbOsu1nO|*tp{vXhWafmpceJ8o`hSnOqQ)$|l(=-92uqtE;oEI~eP}=jMAM zA+Y9%Msh%ti)r5!P0p$$!;1gxzemnSr-pO#ahzUQJC6wYRs^)vH%27z}d7HQLZ8kHx(!(J-ZRD#@^9$c3uOb2KyW z)uiH|2g6idU9H~N)4?Vcf@Dk>CJxVlMUwm5SL3Z3$wc zU+fC!#fujdi$=NP+76CJFqSWz5;PY}TPC-qrKR8uniWg}?vX7Sn9yWAV_PazE56+6 z(k$iK`nn~-D8h1N4a7Ct-fwNC`+fa7a%*dAsp`!tx_JI)9XZ8t3q%4+S93{8gPW2uORDY&9qF|@d`NwwZmCJ|$WqY*D7R)O=K zcbR|_pL|L`eD^)KVfEd*d5fp}HAh@BSfys0_ojN@hllR}tmj!Wj z1Y?J$JW)8771k?D1EK}!3}y*cCg0fConJPh2rC9Qv=}=+Stj<2V3`aM3u_akz~KoE zwZidwz0};?%S)XAAyuN~)v0!tNIi7I3Q1YP;fMMvu1vcwU3 zi`sSVI@hM7NBMVO?_c(u9AaPO6~qh4%b}Pi+tF)z1>hNoiB}V=8o`~{u4rMAU4pH` zD|sn{5D})q>%*!`#Q}!V`hProR>QIk(_SUP*l>tY&CW(cXk95Ajk~|!*|E_m6(^ZU zvgM=7jZAV*Hpyh@xMVVc+?BeXIubF(lFB#U-q9||m54%6aN znC1`qwagmlho{Hr*UJ@{t`r*$d7EsEXZLcWv7Fy%AayCSY9eh}Nv9hc!I603t#T>( zfpWLXa`L@m36_&RgMSa~eX^&=&Dcox;8`MNDJR~=$wnm|9ccukx;kB2y7J6dXLKZ& zlJtSq7fe@X5_J8>_1E!qdHYAlxt}3HM_k9%E@hobAfzeP3&WQIP=0 zW&kA1mR!z}5y(wvQ`FnvYxg^Xf}0HE7&|y-zs-_KrT$MPVC-yUk`?vP6PjG|p=Xac z^i0|&w-6D=Yr8LHHc7=M&dx-YgW)jifLzGO_8`sb*d8Yrd~A>JBQlASWx*<4S?WZY z{VnHzGRupUO)#Hteb7ptNe_o`h?5oV!;_r!;Yp6$z4I!wxvex_$RH1wsMo)2V#Lr&E~(_hC#q#O{{`?^c7Ye8Qd)d{}o;iRg_(BKGg= a%Kri8a*p|H-$~X00000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/resources/images/licenses/cc-by-nc.png b/src/resources/images/licenses/cc-by-nc.png deleted file mode 100644 index 0c99e7110e72382bcedd7dbb00c97e737cd7e0d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1709 zcmV;e22%NnP)84eJl>Pv^YE&r| zn^xTwB~8?*w4sP3N*f7TL{U-+sMK9~7%(qCuno5H+haq>mIXfm@e5A$o#703hVg4W zMwP>rt~{Q5=ZyW`?|$bo(?&!cZEbCI+1>9%_&EKt7FeZ?&^r0Un-tm(QaBc-?L?Gf zsTl2M5|qj%DV9d1-NVffju8+~-&3Xm0txmgx%6XW#}Re%jgzQ8XT*SaOHKO6OAyV4;+!;=V?u z*G1Yp*rWY7ddG3;b&1C?C#z-o8e9t-(L{u8!nPG;@7kgPG5~H-klW1QCZf#1WH!lc z1!w?u;?V@%{OTsPceJ0|3OI+ciN_N>x3E{>MFFGZ={U1_YiG*@^2+8iEvF>rQEy+bVSjLNkVZyExZ_yPV-Dul3qmvP8vsKmAq!{V=9q~? zUk{nU>+I~L;o)H#8yllYB*GoXIEOKHF0PFyW0WuHAcM(}3tf{pX+5}RmI@md&;C0@ z9UUFIy`dpGJUk?8!#Rv$4(8SaLbL4~0K=g{FChzHt`%H>2Oy7+kEv3dot-rSja3K8 zSTHOc?g7Uaj0R|PYeSa`8y3qC6lP%o)uwo9)4k=MwE|GizGrfhzWwG_!}bk;v3=o` zpt;!ED!Bdq{kAJxu3-^yjml)$geK!2XHucCczubytBWR?fbI#i-W(iM1sF}3R*Pne z{i_25^!LkGCUCpDx~TpAcDjG}XF57Ma%A5GaEzrP#SRUctAbmNwY7i@O@`xRsYt~r z64zPGS{%@|SY$!~7Kc;M;$p5irfPp)?Du~3F@1QYhi-iFCH?sQ4}1>0^~vKWd^|rl z=g7VZU}mqDVQCPDhOMq?8aZtMS>ysXVH+WwusF1>vsjHNRGAQmV{O>ZvT)X|jV6w% zmOqcV_wL-KU+&#!kfjTAtvjb4`zC;)kNHxbLoxaBSj9%0=oUIcIP4J7;_zwMrpkmB zV0dzCv&oiB4cF8PuxdY*Ofs;lZG5+aT&sN(z{t?FeT`#TVXrC;h!&tfSUq$VeCycc zj6N! zco$%Lyu0^la9e{fvCf?2LRs~oM(`p6S zNtmYEhdfODF>Zuu2-(2uhQqY~Bf#}08lsJEBpT2D{Oeqz;lzI35&_4D&<)1`Rh0{OuJv~newo06nk(lDOsw8cWbeyr2s}BeK=~AD{p^y+XQkw zMIW%}r(DMP=IF(%7mdDOV4GxE=QLu!-1l-tCdU99AZz+VPiS)84?U;kp=Y*X zaP9uE^|(O*$}V1|1#Jjmkqh;)JwU7W*d9+V__00Sk0@kZlZ9&KO1BoU+^4G&q4ukv z4Ul)m%OM=%WX*W-q@=ufQsQ&!iziDyFI~TJ-OX2!nj#I=B%!GcRy)9Y`s^u%q9Ntg zsnd>ErwSP!!yGq(y=Vqsm + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/resources/images/licenses/cc-by-nd.png b/src/resources/images/licenses/cc-by-nd.png deleted file mode 100644 index 837376ef4626da11441fb0c1bf898985d2e044cb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1562 zcmV+#2IcvQP)I2{D2fMLYrMp zcLA4};1mJ{BNRfrXk6&7i9NF9hhCOsOS0Y?$&R!2Pw-DT?+TOMaG60@ZkRw)bt0lI;TC2v^3eW)R`m1$% z_~;?sjo!Vs6mSlG>%Xq^*zReUCj}N=X;j#n504KmAScs1l-Sn{kW*VDt@!!sbDE!@ zzjkk&Ltj`hCZXR17_^{*3t-y47F%U39;4aWS%K zV1PW#isQe>>E8T3Q~%=PBCV{fu;5tEV+_Xn1!0ob+RyD-slvgEH~)S|(P-4rx3okT z7Z+r2IEOxr!B{^aOj^GQFdQ2A60`uzwSx=r0OaN6B@Jtvo0}G(G3x*s6NZVyJ>d9q zr7Wcn4-Besuwr>Yu`EoW+7vHsxwqWYD*$f#-QLZweiL9UUpOUjE|#_m?!v-? zOaiV^Eg3q&$+*WARVY@xpCD~_+d>oIJ+Z7$=jS5h-dup&J<=sHi#!*>a^EM-$*-3D>5QB2Z5_J@1=>Agyj&csOSX*HnOqIUzUe4eR87c>2^)LOVIc zzNjn6g9AkS%Q$he7rs_k0Pca9_@sF<5@0oq@(OU!FwJWV9H#vr0rs0{2schD(Fmg7 zH$}klA#}qrKvgNi-WQf4rYcn)=H!MsGA~X}X5MgeJ-(M0C#Qm-7Gp4(&=0+8G844e zGfDl|!Zb;d5n9=oxm%b9kmbC+4-FQrhG`8YOv@JC!?dX?S4yIxrpfkrcASaE@gUJa z=~5C6w}Q`96x^!~=TzBGo<8nWd8z>o7J|>KQr~ku>Oo0J5LDr2; zPjIsDP0zS&dbUD?YX`vTI3xhBlQ(QaLjf#wp>Ep)v{Bpk*ty_sdwd_!ZH|o=MwKha zHGyuw69E|V^*3LUmee?eL!7LeAD;A;4^R4hPW|vCk<#eFcMrz-3DQKU!A<{-0W1Qr zUjO!*@}<1;>C`~*=~TDLeHb%NU~k%jZ;XR)WsE{ZcW!~0+}D-=0vyRE?ERt8R{#J2 M07*qoM6N<$f*5G!)Bpeg diff --git a/src/resources/images/licenses/cc-by-nd.svg b/src/resources/images/licenses/cc-by-nd.svg new file mode 100644 index 0000000000..27fe3b5e48 --- /dev/null +++ b/src/resources/images/licenses/cc-by-nd.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/resources/images/licenses/cc-by-sa.png b/src/resources/images/licenses/cc-by-sa.png deleted file mode 100644 index e76aeffd876ae1ca70e124863b7acfa06831e83d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1697 zcmV;S244AzP)Pwv1JY9U zHEK~?Rfs$&tklX>JyNOm ztV)N+hjjE@6I|Dx)p!hZ6jkASa4&SEvPsqn-DZ%3;Z+@E0NkY@`;6dbQ*41bCCAnZ z&;aVp!x_5s$sM}ZbM4YmKp)0tewyLAmBR{e3M@KP$gnl_2pamIR08^?eY?b~wKlSzX+2$S0_5beYdqE+v=By5K zT&Ii8NQgGJHISQG@!aD%8XOwb^^cB@(!|6B3$8^!=3uT<5IU(}2N*mFTDSnW#FjYr z>6ih$-rimsA0MZwsVPb(lPtJKAI9XlxHpqaQ@N&r3`+)GXq>!5Td}Z_DlDux@N|)S zdU`Z{V`Fr3azf^YK8#@w<~jkP)B1IQ;n2XBpaod28C-w|AkWUus96gH0tTS5>i`)W zhK<7-aD1^;ly-KvHL9?%V(|loWnly5CV6SY+G0(+09ffiJw2s-F2{mvH~MveaeU#F zz_~cuGPolnBbGbcs9_Uuk8H`%2~Nfu7gQlx@zxpzH&+cb0p1gq_5Ap_CBSIH((G`i zmHwwsp3pmQ_ZuV{iL|BP0C1YAA<=gskb;M<3IdpMOE$fBT&dvVV5gv3>)6!wC^woT!IwGEJBPh9@^Si)_iz zaF1Ppg?<1$FfhPi4h{|)_*hu+zb{`p(r*A58Jc>eax5#XSEdF;3*aB@9z+J;JT_ZD zPNE4bhHh{%GQLYR5eaG0gv7(I6JWG(I84LC!~B1&0Df`uqJ4nj+;D_N5+NTwENB() z0?c4AXgMa|FOD>HBjW=VW$PhZEEVHu0z53jwf}-5(BRDAsa0T0Q|-12OSI@t`HZau{V7;C90_(EzGB zO#ABIJ?3avVcP!@V5f^M2G^O}>Z@>+JBoD70ojKO9?KlIAUOuNONPU^oDrim08p_TcVHwx1LvgkLD zp~0f%Fs&ekY0+fkFs-Y~l_JrQ(`0iz>t&*`Ur#hpx)g~OY6x_1~>r~lE9l+~U zxvKz{i#>~fFL+<fKA6*N0Uvn5$ZKL3hG0c$*?l(WY$<%;28yonBKE5}0{P19slL3G%TXH*( zi~w%ATB7+s=iRD8&a;MJ*0k;gE{OJHA@ r1-Ih(jstupE`*5Qx&oqeZ&$to@Ym>elSGv`00000NkvXXu0mjf@eCw0 diff --git a/src/resources/images/licenses/cc-by-sa.svg b/src/resources/images/licenses/cc-by-sa.svg new file mode 100644 index 0000000000..740ce2e962 --- /dev/null +++ b/src/resources/images/licenses/cc-by-sa.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/resources/images/licenses/cc-by.png b/src/resources/images/licenses/cc-by.png deleted file mode 100644 index 44671b21b30cfd36384918279174ea35d21deba5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1468 zcmV;t1w;CYP)1^aqe1kcfX!)LSH~ zpomn8R0&zGqUO+0skbJu#^%Fccnxb~d)M}QA>_(W;3vG*^RC}zc3JQT&KeU&8nND) zogJQi=6OG6Vnh^=#bR_{M_-BXr~6|kzfF6^UCNcRR6Hn9$tcl5wM<6cpd+(N^=6G4 ztp-_blbW_g%}&#;wndh0lG$o-AM~x%4SrTPN<3Dsl;g4Sj!ZU9TYD)=?P#>Qy+Iq9 zPh3BxKhnpo|L#mxfW81Xujgq0ut?>KPDbsJ!D_VX3}D-7QRl=a=W~aSPmk&3i(7H+ ze0I1EeJtDJXYee>C|7kJ6JrNK)^;{MkOA-=1v%yiw_0Wf)~p({6`%ps)idSCTMzkx^LY<-^8B@eijk}Hdj56i=JF;=Q5Pub3q;ji<5sP z>Cx;XZyxjW^R%?I#1+?aAAQg_Qh=e8kcA6yo6N+8XA3^?rlzK7adDAWR#r&Yb*{L^ zJ+!HP@oc4LP|I;a29qHdt|n(`x3J@viW{(a{ofB1kH_8jE-cX5*%<{3?x78R&^HQ@ zJ%C}*pqG#ZFgFM;zypxy=jU`?SzllG0S&eQWPC7uIJ^UfuTaiYc7M;6iVzkL`i}^6 z@uAhCSaaVTWp0rHjO7cX1kJ_LR>7T{n+s*cRRtdb&!|ksn9yXr<3cJF7VoA=+uj^X zCZMar+%Ko6Jpo1$CVy>B_5e0m8tQD&pt&lzy;$21$k1dMK9-8QL3+hyF>7(&)nbu} zK>-$nHV6sOR}5by05f}Slchln8kV|k+caze$RZaQ6Jx`L6BZW_To$Vy#V|4<1}#`1 z7xICF(t#p|FA{*Ek1eOgu9!>;ntRhCdWQ-Z4l6{oxYTvqRGAnSV0a3_5)xJU3Z97! zU_@y4iOs&Ouve7^cni=ie05Y6{9xPK+M4el5f)=?XfYzbOEQtmxZZ@K!*>c`7&k0o z2_n=b1pveRU4W@+T4r$t3Fxr6Yj;v2kWV;1b-W3wEEHok zGc&`+0f6Hg%U{~W(*WSo7A6x2tD8O@F8JKFVF13)$X&(W$c-F)U*r{JLI5#1$uLds zN3YctfOo(rJ~EF+2C(X;^$T$1ZrUURJZPXH+8b%0(XT|n@WFM%H9%D*BG?v{L`+1e ze4UZI&XDzEvfK~0 zp@7k0op7%xlp(5 z0a~wZd+c2Bwmr^Aw9Uw6p;x-{R!D?ezyIMo($X5caPX6D@8F4}96WLOo_g>kmC@+Q zPfx~iROvQJLvMhk0<5=xyrp8fs2rW@Rvevbo7{#z;{bMI8GK(yP>JZlJrG~-bmjlX WBQ!IAXsN6K0000 + + + + + + + + + + + + + + + + diff --git a/src/resources/images/licenses/cc.svg b/src/resources/images/licenses/cc.svg new file mode 100644 index 0000000000..e09832d919 --- /dev/null +++ b/src/resources/images/licenses/cc.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/resources/images/licenses/cc0.png b/src/resources/images/licenses/cc0.png deleted file mode 100644 index ef92abbc6e7d033561765deabaafcb0056802b52..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1009 zcmVE3(q-M;_Z6re_u9xFdw8|OIDpgsau7o5#3dz}g^7L97p|sXH>*M6-_=F|PQ+=9K$cvQ75IE-%^4}8)-m(mL zr?223gqP-4Vhhgs$>F|fzyOwdumW#;u;WQG z3WHz=SxZY~u}B6t=aYL4SQl9IV2+{(D=g2`*aH-4JU}UMYD{u4ecnnzMb?8$Riilp zbGF4`#yqPeTnR+fC?#cpt)t0iD+RwyBq0iz1k5i{G>*0^Q$`EHDpijeK%`C!)+OKB z-sr)prqJ99sU{S#iCl0t1UCGz4CLYrD9JA6uf|t5PIrx32ryKpK;C$ljdYAqS}BV9#D$IocuAA8)8MsoUbt-(22$km|fx7I0|F1)+y;G z=@IS?enN>e(*=P+Vcz6+7FVE7%V;W2%Iy9SS%`ey{=i0kBWgH$G-A_{PWY zjwW5_Rj5RQ + + + + + + \ No newline at end of file diff --git a/src/resources/images/licenses/index.ts b/src/resources/images/licenses/index.ts index aeda944fbd..3f8507ae52 100644 --- a/src/resources/images/licenses/index.ts +++ b/src/resources/images/licenses/index.ts @@ -1,8 +1,18 @@ -export { default as ccByImage } from './cc-by.png'; -export { default as ccBySaImage } from './cc-by-sa.png'; -export { default as ccByNdImage } from './cc-by-nd.png'; -export { default as ccByNcImage } from './cc-by-nc.png'; -export { default as ccByNcSaImage } from './cc-by-nc-sa.png'; -export { default as ccByNcNdImage } from './cc-by-nc-nd.png'; -export { default as cc0Image } from './cc0.png'; +export { default as ccByImage } from './cc-by.svg'; +export { default as ccBySaImage } from './cc-by-sa.svg'; +export { default as ccByNdImage } from './cc-by-nd.svg'; +export { default as ccByNcImage } from './cc-by-nc.svg'; +export { default as ccByNcSaImage } from './cc-by-nc-sa.svg'; +export { default as ccByNcNdImage } from './cc-by-nc-nd.svg'; +export { default as cc0Image } from './cc0.svg'; +export { default as ccImage } from './cc.svg'; export { default as openAccessLogo } from './open-access-logo.svg'; + +// button images - used by license selector +export { default as ccByButton } from './button-cc-by.svg'; +export { default as ccBySaButton } from './button-cc-by-sa.svg'; +export { default as ccByNdButton } from './button-cc-by-nd.svg'; +export { default as ccByNcButton } from './button-cc-by-nc.svg'; +export { default as ccByNcSaButton } from './button-cc-by-nc-sa.svg'; +export { default as ccByNcNdButton } from './button-cc-by-nc-nd.svg'; +export { default as cc0Button } from './button-cc0.svg'; diff --git a/src/translations/en/licenses.json b/src/translations/en/licenses.json new file mode 100644 index 0000000000..0edeeca670 --- /dev/null +++ b/src/translations/en/licenses.json @@ -0,0 +1,20 @@ +{ + "labels": { + "cc0": "CC0 1.0 Universal (CC0 1.0) - Public Domain Dedication", + "cc_by": "Attribution 4.0 International (CC BY 4.0)", + "cc_by_nc": "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", + "cc_by_nc_nd": "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", + "cc_by_nc_sa": "Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)", + "cc_by_nd": "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", + "cc_by_sa": "Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)" + }, + "description": { + "cc0": "The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.", + "cc_by": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material for any purpose, even commercially. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made.", + "cc_by_nc": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nYou may not use the material for commercial purposes.", + "cc_by_nc_nd": "Share — copy and redistribute the material in any medium or format. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nYou may not use the material for commercial purposes. \nIf you remix, transform, or build upon the material, you may not distribute the modified material.", + "cc_by_nc_sa": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nYou may not use the material for commercial purposes. \nIf you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.", + "cc_by_nd": "Share — copy and redistribute the material in any medium or format for any purpose, even commercially. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nIf you remix, transform, or build upon the material, you may not distribute the modified material.", + "cc_by_sa": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material for any purpose, even commercially. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nIf you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original." + } +} diff --git a/src/translations/i18n.ts b/src/translations/i18n.ts index 39de322769..3289f05617 100644 --- a/src/translations/i18n.ts +++ b/src/translations/i18n.ts @@ -11,6 +11,7 @@ import formikValuesEn from './en/formikValues.json'; import infopagesEn from './en/infopages.json'; import institutionEn from './en/institution.json'; import languagesEn from './en/languages.json'; +import licensesEn from './en/licenses.json'; import profileEn from './en/profile.json'; import publicationEn from './en/publication.json'; import publicationTypesEn from './en/publicationTypes.json'; @@ -26,6 +27,7 @@ import formikValuesNb from './nb/formikValues.json'; import infopagesNb from './nb/infopages.json'; import institutionNb from './nb/institution.json'; import languagesNb from './nb/languages.json'; +import licensesNb from './nb/licenses.json'; import profileNb from './nb/profile.json'; import publicationNb from './nb/publication.json'; import publicationTypesNb from './nb/publicationTypes.json'; @@ -50,6 +52,7 @@ i18n.use(LanguageDetector).init({ infopages: infopagesEn, institution: institutionEn, languages: languagesEn, + licenses: licensesEn, profile: profileEn, publication: publicationEn, publicationTypes: publicationTypesEn, @@ -66,6 +69,7 @@ i18n.use(LanguageDetector).init({ infopages: infopagesNb, institution: institutionNb, languages: languagesNb, + licenses: licensesNb, profile: profileNb, publication: publicationNb, publicationTypes: publicationTypesNb, diff --git a/src/translations/nb/licenses.json b/src/translations/nb/licenses.json new file mode 100644 index 0000000000..5e1091294d --- /dev/null +++ b/src/translations/nb/licenses.json @@ -0,0 +1,20 @@ +{ + "labels": { + "cc0": "CC0 1.0 Universal (CC0 1.0) - Fristatus-erklæring", + "cc_by": "Navngivelse 4.0 Internasjonal (CC BY 4.0)", + "cc_by_nc": "Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)", + "cc_by_nc_nd": "Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0)", + "cc_by_nc_sa": "Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)", + "cc_by_nd": "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", + "cc_by_sa": "Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)" + }, + "description": { + "cc0": "Den person som har knyttet et verk til dette aktstykke (deed) har, i den utstrekning loven tillater, erklært dette verket er i det fri ved å si fra seg alle de opphavsrettigheter og nærstående rettigheter som vedkommende hadde til verket.", + "cc_by": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet til et hvilket som helst formål, inkludert kommersielle. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort.", + "cc_by_nc": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDu kan ikke benytte materialet til kommersielle formål.", + "cc_by_nc_nd": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDu kan ikke benytte materialet til kommersielle formål. \nDersom du remixer, bearbeider eller bygger på materialet, kan du ikke distribuere det endrede materialet.", + "cc_by_nc_sa": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDu kan ikke benytte materialet til kommersielle formål. \nDersom du remixer, bearbeider eller bygger på materialet, må du distribuere dine bidrag under samme lisens som originalen.", + "cc_by_nd": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format til et hvilket som helst formål, inkludert kommersielle. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDersom du remixer, bearbeider eller bygger på materialet, kan du ikke distribuere det endrede materialet.", + "cc_by_sa": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet til et hvilket som helst formål, inkludert kommersielle. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDersom du remixer, bearbeider eller bygger på materialet, må du distribuere dine bidrag under samme lisens som originalen." + } +} diff --git a/src/types/file.types.ts b/src/types/file.types.ts index 9e02e6a81b..ee858b92bf 100644 --- a/src/types/file.types.ts +++ b/src/types/file.types.ts @@ -1,6 +1,7 @@ import * as LicenseImages from '../resources/images/licenses'; import { Uppy as UppyType, StrictTypes } from '@uppy/core'; import { BackendType, BackendTypeNames } from './publication.types'; +import i18n from '../translations/i18n'; export enum LicenseNames { CC_BY = 'CC BY', @@ -12,54 +13,63 @@ export enum LicenseNames { CC0 = 'CC0', } -export interface LicenseInfo { +interface LicenseInfo { identifier: LicenseNames; + label: string; description: string; image: any; + buttonImage: any; } export const licenses: LicenseInfo[] = [ { identifier: LicenseNames.CC_BY, + label: i18n.t('licenses:labels.cc_by'), image: LicenseImages.ccByImage, - description: - 'This license lets others distribute, remix, adapt, and build upon your work, even commercially, as long as they credit you for the original creation. This is the most accommodating of licenses offered. Recommended for maximum dissemination and use of licensed materials.', + buttonImage: LicenseImages.ccByButton, + description: i18n.t('licenses:description.cc_by'), }, { identifier: LicenseNames.CC_BY_SA, + label: i18n.t('licenses:labels.cc_by_sa'), image: LicenseImages.ccBySaImage, - description: - 'This license lets others remix, adapt, and build upon your work even for commercial purposes, as long as they credit you and license their new creations under the identical terms. This license is often compared to “copyleft” free and open source software licenses. All new works based on yours will carry the same license, so any derivatives will also allow commercial use. This is the license used by Wikipedia, and is recommended for materials that would benefit from incorporating content from Wikipedia and similarly licensed projects. ', + buttonImage: LicenseImages.ccBySaButton, + description: i18n.t('licenses:description.cc_by_sa'), }, { identifier: LicenseNames.CC_BY_ND, + label: i18n.t('licenses:labels.cc_by_nd'), image: LicenseImages.ccByNdImage, - description: - 'This license lets others reuse the work for any purpose, including commercially; however, it cannot be shared with others in adapted form, and credit must be provided to you.', + buttonImage: LicenseImages.ccByNdButton, + description: i18n.t('licenses:description.cc_by_nd'), }, { identifier: LicenseNames.CC_BY_NC, + label: i18n.t('licenses:labels.cc_by_nc'), image: LicenseImages.ccByNcImage, - description: - 'This license lets others remix, adapt, and build upon your work non-commercially, and although their new works must also acknowledge you and be non-commercial, they don’t have to license their derivative works on the same terms.', + buttonImage: LicenseImages.ccByNcButton, + description: i18n.t('licenses:description.cc_by_nc'), }, { identifier: LicenseNames.CC_BY_NC_SA, + label: i18n.t('licenses:labels.cc_by_nc_sa'), image: LicenseImages.ccByNcSaImage, - description: - 'This license lets others remix, adapt, and build upon your work non-commercially, as long as they credit you and license their new creations under the identical terms.', + buttonImage: LicenseImages.ccByNcSaButton, + description: i18n.t('licenses:description.cc_by_nc_sa'), }, { identifier: LicenseNames.CC_BY_NC_ND, + label: i18n.t('licenses:labels.cc_by_nc_nd'), image: LicenseImages.ccByNcNdImage, - description: - 'This license is the most restrictive of our six main licenses, only allowing others to download your works and share them with others as long as they credit you, but they can’t change them in any way or use them commercially.', + buttonImage: LicenseImages.ccByNcNdButton, + description: i18n.t('licenses:description.cc_by_nc_nd'), }, { identifier: LicenseNames.CC0, + label: i18n.t('licenses:labels.cc0'), image: LicenseImages.cc0Image, - description: - 'CC0 enables scientists, educators, artists and other creators and owners of copyright- or database-protected content to waive those interests in their works and thereby place them as completely as possible in the public domain, so that others may freely build upon, enhance and reuse the works for any purposes without restriction under copyright or database law.', + buttonImage: LicenseImages.cc0Button, + description: i18n.t('licenses:description.cc0'), }, ]; From d5ef9676032502761673614ffb48b01db5005686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Thu, 14 May 2020 10:48:21 +0200 Subject: [PATCH 016/100] NP-903 Fix bug where modal text was incomplete (#664) --- .../contributors_tab/components/AffiliationsCell.tsx | 5 +---- src/translations/en/publication.json | 2 +- src/translations/nb/publication.json | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/pages/publication/contributors_tab/components/AffiliationsCell.tsx b/src/pages/publication/contributors_tab/components/AffiliationsCell.tsx index 0d52487121..454a81cfcc 100644 --- a/src/pages/publication/contributors_tab/components/AffiliationsCell.tsx +++ b/src/pages/publication/contributors_tab/components/AffiliationsCell.tsx @@ -101,10 +101,7 @@ const AffiliationsCell: FC = ({ affiliations, baseFieldNa { setFieldValue( `${baseFieldName}.${SpecificContributorFieldNames.AFFILIATIONS}`, diff --git a/src/translations/en/publication.json b/src/translations/en/publication.json index 095938e2bb..60f1e9c69d 100644 --- a/src/translations/en/publication.json +++ b/src/translations/en/publication.json @@ -11,7 +11,7 @@ "add_other_contributor": "Add more contributors", "author_already_added": "Chosen author is already added", "authors": "Authors", - "confirm_remove_affiliation_text": "Are you sure you want to remove the affiliation to {{affiliationName}} for {{contributorName}}?", + "confirm_remove_affiliation_text": "Are you sure you want to remove this affiliation?", "confirm_remove_affiliation_title": "Remove affiliation?", "confirm_remove_contributor_text": "Are you sure you want to remove {{contributorName}} from list of contributors?", "confirm_remove_contributor_title": "Remove contributor?", diff --git a/src/translations/nb/publication.json b/src/translations/nb/publication.json index 29af811e62..a0a129302b 100644 --- a/src/translations/nb/publication.json +++ b/src/translations/nb/publication.json @@ -11,7 +11,7 @@ "add_other_contributor": "Legg til flere", "author_already_added": "Valgt forfatter er allerede lagt til", "authors": "Forfattere", - "confirm_remove_affiliation_text": "Er du sikker på at du ønsker å fjerne tilknytningen til {{affiliationName}} for {{contributorName}}?", + "confirm_remove_affiliation_text": "Er du sikker på at du ønsker å fjerne denne tilknytningen?", "confirm_remove_affiliation_title": "Fjerne tilknytning?", "confirm_remove_contributor_text": "Er du sikker på at du ønsker å fjerne {{contributorName}} fra listen over bidragsytere?", "confirm_remove_contributor_title": "Fjerne bidragsyter?", From a7f29af3b8128abfe96278f5129e30448fd8761c Mon Sep 17 00:00:00 2001 From: sarahse Date: Thu, 14 May 2020 11:46:24 +0200 Subject: [PATCH 017/100] Np 885 download file from public publication (#663) * start of file download * add icon and translation * download file * add error handling * remove unnecessary props * remove unused import --- src/api/{fileUploadApi.ts => fileApi.ts} | 34 ++++++++--- src/api/mock-interceptor.ts | 8 +-- src/components/ButtonWithProgress.tsx | 15 ++--- .../publication_page/PublicationPageFiles.tsx | 58 +++++++++++++++---- src/translations/en/common.json | 1 + src/translations/en/feedback.json | 1 + src/translations/nb/common.json | 1 + src/translations/nb/feedback.json | 1 + src/utils/uppy-config.ts | 2 +- 9 files changed, 88 insertions(+), 33 deletions(-) rename src/api/{fileUploadApi.ts => fileApi.ts} (63%) diff --git a/src/api/fileUploadApi.ts b/src/api/fileApi.ts similarity index 63% rename from src/api/fileUploadApi.ts rename to src/api/fileApi.ts index 5b5dcef35c..53990af9ca 100644 --- a/src/api/fileUploadApi.ts +++ b/src/api/fileApi.ts @@ -2,15 +2,33 @@ import Axios from 'axios'; import { getIdToken } from './userApi'; import { AwsS3Part } from '@uppy/aws-s3-multipart'; import { UppyFile } from '@uppy/core'; +import i18n from '../translations/i18n'; +import { StatusCode } from '../utils/constants'; -export enum FileUploadApiPaths { +export enum FileApiPaths { + ABORT = '/upload/abort', + COMPLETE = '/upload/complete', CREATE = '/upload/create', + DOWNLOAD = '/download', LIST_PARTS = '/upload/listparts', PREPARE = '/upload/prepare', - ABORT = '/upload/abort', - COMPLETE = '/upload/complete', } +export const downloadFile = async (publicationId: string, fileId: string) => { + const url = `${FileApiPaths.DOWNLOAD}/${publicationId}/files/${fileId}`; + try { + const idToken = await getIdToken(); + const response = await Axios.get(url, { headers: { Authorization: `Bearer ${idToken}` } }); + if (response.status === StatusCode.OK) { + return response.data.presignedDownloadUrl; + } else { + return { error: i18n.t('feedback:error.download_file') }; + } + } catch { + return { error: i18n.t('feedback:error.download_file') }; + } +}; + export const abortMultipartUpload = async (uploadId: string, key: string) => { const payload = { uploadId, @@ -18,7 +36,7 @@ export const abortMultipartUpload = async (uploadId: string, key: string) => { }; const idToken = await getIdToken(); - const response = await Axios.post(FileUploadApiPaths.ABORT, payload, { + const response = await Axios.post(FileApiPaths.ABORT, payload, { headers: { Authorization: `Bearer ${idToken}`, }, @@ -34,7 +52,7 @@ export const completeMultipartUpload = async (uploadId: string, key: string, par }; const idToken = await getIdToken(); - const response = await Axios.post(FileUploadApiPaths.COMPLETE, payload, { + const response = await Axios.post(FileApiPaths.COMPLETE, payload, { headers: { Authorization: `Bearer ${idToken}`, }, @@ -50,7 +68,7 @@ export const createMultipartUpload = async (file: UppyFile) => { }; const idToken = await getIdToken(); - const response = await Axios.post(FileUploadApiPaths.CREATE, payload, { + const response = await Axios.post(FileApiPaths.CREATE, payload, { headers: { Authorization: `Bearer ${idToken}`, }, @@ -65,7 +83,7 @@ export const listParts = async (uploadId: string, key: string) => { }; const idToken = await getIdToken(); - const response = await Axios.post(FileUploadApiPaths.LIST_PARTS, payload, { + const response = await Axios.post(FileApiPaths.LIST_PARTS, payload, { headers: { Authorization: `Bearer ${idToken}`, }, @@ -82,7 +100,7 @@ export const prepareUploadPart = async (uploadId: string, key: string, body: Blo }; const idToken = await getIdToken(); - const response = await Axios.post(FileUploadApiPaths.PREPARE, payload, { + const response = await Axios.post(FileApiPaths.PREPARE, payload, { headers: { Authorization: `Bearer ${idToken}`, }, diff --git a/src/api/mock-interceptor.ts b/src/api/mock-interceptor.ts index c5d435f0e6..b4b0f4ebf7 100644 --- a/src/api/mock-interceptor.ts +++ b/src/api/mock-interceptor.ts @@ -21,7 +21,7 @@ import { InstitutionApiPaths } from './institutionApi'; import { ProjectsApiPaths } from './projectApi'; import { PublicationsApiPaths } from './publicationApi'; import { PublicationChannelApiPaths } from './publicationChannelApi'; -import { FileUploadApiPaths } from './fileUploadApi'; +import { FileApiPaths } from './fileApi'; import { CustomerInstitutionApiPaths } from './customerInstitutionsApi'; import { emptyPublication } from '../types/publication.types'; @@ -85,9 +85,9 @@ export const interceptRequestsOnMock = () => { mock.onGet(new RegExp(`${PublicationsApiPaths.SEARCH}/*`)).reply(200, mockPublications); // File Upload - mock.onPost(new RegExp(FileUploadApiPaths.CREATE)).reply(200, mockCreateUpload); - mock.onPost(new RegExp(FileUploadApiPaths.PREPARE)).reply(200, mockPrepareUpload); - mock.onPost(new RegExp(FileUploadApiPaths.COMPLETE)).reply(200, mockCompleteUpload); + mock.onPost(new RegExp(FileApiPaths.CREATE)).reply(200, mockCreateUpload); + mock.onPost(new RegExp(FileApiPaths.PREPARE)).reply(200, mockPrepareUpload); + mock.onPost(new RegExp(FileApiPaths.COMPLETE)).reply(200, mockCompleteUpload); //MY PUBLICATIONS mock.onGet(new RegExp(`${PublicationsApiPaths.PUBLICATIONS_BY_OWNER}/*`)).reply(200, mockMyPublications); diff --git a/src/components/ButtonWithProgress.tsx b/src/components/ButtonWithProgress.tsx index 3b2ebce601..6315e812e3 100644 --- a/src/components/ButtonWithProgress.tsx +++ b/src/components/ButtonWithProgress.tsx @@ -1,5 +1,5 @@ -import React, { FC, ReactNode } from 'react'; -import { Button, CircularProgress } from '@material-ui/core'; +import React, { FC } from 'react'; +import { Button, CircularProgress, ButtonProps } from '@material-ui/core'; import styled from 'styled-components'; const StyledProgressContainer = styled.div` @@ -8,16 +8,13 @@ const StyledProgressContainer = styled.div` align-items: center; `; -interface ButtonWithProgressProps { - children: ReactNode; +interface ButtonWithProgressProps extends ButtonProps { isLoading: boolean; - onClick?: () => void; - type?: 'submit' | 'reset' | 'button'; } -const ButtonWithProgress: FC = ({ children, isLoading, onClick, type, ...props }) => ( - - + {user.authority && ( + + + + )} {isLoading ? ( diff --git a/src/pages/user/User.tsx b/src/pages/user/User.tsx index a7e69e51ed..922d8d72ef 100644 --- a/src/pages/user/User.tsx +++ b/src/pages/user/User.tsx @@ -81,15 +81,17 @@ const User: React.FC = () => { return ( - - - + {user.authority && ( + + + + )} {t('common:picture')} diff --git a/src/translations/en/breadcrumbs.json b/src/translations/en/breadcrumbs.json index 0a072bad5a..89ece679ab 100644 --- a/src/translations/en/breadcrumbs.json +++ b/src/translations/en/breadcrumbs.json @@ -11,7 +11,7 @@ "order-information": "Order information", "privacy-policy": "Privacy policy", "public": "Public version", - "public-profile": "Public profile", + "profile": "Public profile", "publication": "Publication", "user": "My profile", "worklist": "My worklist" diff --git a/src/translations/nb/breadcrumbs.json b/src/translations/nb/breadcrumbs.json index 70e1f9b9a0..b4b327a5a6 100644 --- a/src/translations/nb/breadcrumbs.json +++ b/src/translations/nb/breadcrumbs.json @@ -11,7 +11,7 @@ "order-information": "Bestillingsinformasjon", "privacy-policy": "Personvernerklæring", "public": "Offentlig versjon", - "public-profile": "Offentlig profil", + "profile": "Offentlig profil", "publication": "Publikasjon", "user": "Min profil", "worklist": "Min arbeidsliste" From 7693cfeec4609106e58d5960a4851d7d40104da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Thu, 14 May 2020 14:01:38 +0200 Subject: [PATCH 019/100] NP-910 Link to public profile from public publication (#666) --- .../publication/publication_page/PublicationPageAuthors.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/publication/publication_page/PublicationPageAuthors.tsx b/src/pages/publication/publication_page/PublicationPageAuthors.tsx index 29b55258f4..45f25d885f 100644 --- a/src/pages/publication/publication_page/PublicationPageAuthors.tsx +++ b/src/pages/publication/publication_page/PublicationPageAuthors.tsx @@ -2,6 +2,7 @@ import React, { FC } from 'react'; import { Contributor } from '../../../types/contributor.types'; import NormalText from '../../../components/NormalText'; import styled from 'styled-components'; +import { Link } from '@material-ui/core'; const StyledAuthor = styled.span` margin-right: 1rem; @@ -14,7 +15,8 @@ interface PublicationPageProps { const PublicationPageAuthors: FC = ({ contributors }) => ( {contributors.map((contributor, index) => { - return {contributor.identity.name}; + const { arpId, name } = contributor.identity; + return {arpId ? {name} : name}; })} ); From dddaeb4faa63afc36d86dd1bfb1cb4b46abdf2db Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 15 May 2020 08:55:17 +0200 Subject: [PATCH 020/100] Bump ts-loader from 7.0.3 to 7.0.4 (#668) Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 7.0.3 to 7.0.4. - [Release notes](https://github.com/TypeStrong/ts-loader/releases) - [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md) - [Commits](https://github.com/TypeStrong/ts-loader/compare/v7.0.3...v7.0.4) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c9a068cac..84b9de1a44 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21951,9 +21951,9 @@ } }, "ts-loader": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-7.0.3.tgz", - "integrity": "sha512-BXAHfPjm3J//20ibuI30M+xgLpdIng68p2H952QqbbmDk7SW72HV42k9Gop7rMxuHvrXWjazWhKuyr9D9kKe3A==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-7.0.4.tgz", + "integrity": "sha512-5du6OQHl+4ZjO4crEyoYUyWSrmmo7bAO+inkaILZ68mvahqrfoa4nn0DRmpQ4ruT4l+cuJCgF0xD7SBIyLeeow==", "requires": { "chalk": "^2.3.0", "enhanced-resolve": "^4.0.0", diff --git a/package.json b/package.json index d0853dc4f0..ef3bfbde05 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "redux-devtools-extension": "^2.13.8", "redux-thunk": "^2.3.0", "styled-components": "^5.1.0", - "ts-loader": "^7.0.3", + "ts-loader": "^7.0.4", "yup": "^0.28.4" }, "scripts": { From 17072d2370c9dda503109c40284743423656bc52 Mon Sep 17 00:00:00 2001 From: sarahse Date: Fri, 15 May 2020 10:28:27 +0200 Subject: [PATCH 021/100] Np 906 publication page styling (#667) * fix styling on public publication page * cleanup --- .../publication_page/PublicationPage.tsx | 65 ++++++++++++++----- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/src/pages/publication/publication_page/PublicationPage.tsx b/src/pages/publication/publication_page/PublicationPage.tsx index 8114441d87..22403237e6 100644 --- a/src/pages/publication/publication_page/PublicationPage.tsx +++ b/src/pages/publication/publication_page/PublicationPage.tsx @@ -2,7 +2,7 @@ import React, { FC, useEffect, useState } from 'react'; import { getPublication } from '../../../api/publicationApi'; import { setNotification } from '../../../redux/actions/notificationActions'; import { useDispatch } from 'react-redux'; -import { CircularProgress, Link } from '@material-ui/core'; +import { CircularProgress, Link, Chip } from '@material-ui/core'; import { Publication, emptyPublication } from '../../../types/publication.types'; import styled from 'styled-components'; import ContentPage from '../../../components/ContentPage'; @@ -24,22 +24,23 @@ const StyledContentWrapper = styled.div` display: flex; padding-top: 1rem; - @media (max-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + @media (max-width: ${({ theme }) => theme.breakpoints.values.md + 'px'}) { flex-direction: column; } `; const StyledSidebar = styled.div` min-width: 15rem; + padding: 1rem 0; `; const StyledMainContent = styled.div` flex: 1; - padding-left: 1rem; + padding: 1rem 2rem; `; const StyledSidebarCard = styled(Card)` - padding: 0.5rem; + padding: 1rem 0.5rem; `; const StyledLicenseCard = styled(Card)` @@ -52,11 +53,11 @@ const StyledLicenseCard = styled(Card)` padding: 1rem; `; -const StyledImage = styled.img` +const StyledLicenseImage = styled.img` grid-area: image; `; -const StyledLabel = styled(Label)` +const StyledLicenseLabel = styled(Label)` grid-area: label; `; @@ -65,6 +66,29 @@ const StyledNormalText = styled(NormalText)` white-space: pre-wrap; `; +const StyledTextContainer = styled.div` + display: inline-block; + margin: 1rem 0; +`; + +const StyledLabel = styled(Label)` + display: inline-block; +`; + +const StyledTextDescription = styled(NormalText)` + display: inline; + margin-left: 1rem; +`; + +const StyledTag = styled.div` + display: inline; + margin-left: 1rem; +`; + +const StyledTagContainer = styled.div` + align-items: center; +`; + const PublicationPage: FC = () => { const { identifier } = useParams(); const dispatch = useDispatch(); @@ -138,19 +162,26 @@ const PublicationPage: FC = () => { )} {abstract && ( - - {abstract} - + + {t('description.abstract')} + {abstract} + )} {description && ( - - {description} - + + {t('description.description')} + {description} + )} {tags && ( - - {tags} - + + {t('description.tags')} + {tags.map((tag) => ( + + + + ))} + )} {publicationContext && ( @@ -159,8 +190,8 @@ const PublicationPage: FC = () => { )} {selectedLicense && ( - - {selectedLicense.label} + + {selectedLicense.label} {selectedLicense.description} )} From 9db0160004e7ca1a50a47be9799a995a710b9d94 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 15 May 2020 10:45:30 +0200 Subject: [PATCH 022/100] Bump yup from 0.28.4 to 0.28.5 (#662) Bumps [yup](https://github.com/jquense/yup) from 0.28.4 to 0.28.5. - [Release notes](https://github.com/jquense/yup/releases) - [Changelog](https://github.com/jquense/yup/blob/master/CHANGELOG.md) - [Commits](https://github.com/jquense/yup/compare/v0.28.4...v0.28.5) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 26 ++++++++++++++++++-------- package.json | 2 +- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 84b9de1a44..022d145dd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21609,9 +21609,9 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" }, "synchronous-promise": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.10.tgz", - "integrity": "sha512-6PC+JRGmNjiG3kJ56ZMNWDPL8hjyghF5cMXIFOKg+NiwwEZZIvxTWd0pinWKyD227odg9ygF8xVhhz7gb8Uq7A==" + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/synchronous-promise/-/synchronous-promise-2.0.12.tgz", + "integrity": "sha512-rIDJiHmIK02tXU+eW1v6a7rNIIiMLm5JUF5Uj2fT6oLSulg7WNDVoqvkYqkFoJzf4v2gmTLppvzegdo9R+7h1Q==" }, "syntax-error": { "version": "1.4.0", @@ -25373,17 +25373,27 @@ "dev": true }, "yup": { - "version": "0.28.4", - "resolved": "https://registry.npmjs.org/yup/-/yup-0.28.4.tgz", - "integrity": "sha512-mcIe+Oz/uEbbp+YgPY3udg22msRP6Ntm7l0LWov9FExRHvZMwwppPSK1ygRXtblu/tYBq3N+tonundeeY+sFJw==", + "version": "0.28.5", + "resolved": "https://registry.npmjs.org/yup/-/yup-0.28.5.tgz", + "integrity": "sha512-7JZcvpUGUxMKoaEtcoMEM8lCWRaueGNH/A3EhL/UWqfbFm3uloiI+x59Yq4nzhbbYWUTwAsCteaZOJ+VbqI1uw==", "requires": { - "@babel/runtime": "^7.8.7", + "@babel/runtime": "^7.9.6", "fn-name": "~3.0.0", "lodash": "^4.17.15", "lodash-es": "^4.17.11", - "property-expr": "^2.0.0", + "property-expr": "^2.0.2", "synchronous-promise": "^2.0.10", "toposort": "^2.0.2" + }, + "dependencies": { + "@babel/runtime": { + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz", + "integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==", + "requires": { + "regenerator-runtime": "^0.13.4" + } + } } }, "zen-observable": { diff --git a/package.json b/package.json index ef3bfbde05..432016109c 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "redux-thunk": "^2.3.0", "styled-components": "^5.1.0", "ts-loader": "^7.0.4", - "yup": "^0.28.4" + "yup": "^0.28.5" }, "scripts": { "start": "react-scripts -r @cypress/instrument-cra start", From 758429b83fd03d89500be6ef0d4d22b18fa4a29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Fri, 15 May 2020 13:42:21 +0200 Subject: [PATCH 023/100] Np 916 tags (#670) * NP-916 Use native MUI components for tags * NP-916 Display existing tags * NP-916 Set type of value --- package-lock.json | 9 ---- package.json | 1 - src/pages/publication/DescriptionPanel.tsx | 48 +++++++++++----------- 3 files changed, 25 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 022d145dd5..69aedb92b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15948,15 +15948,6 @@ "object-visit": "^1.0.0" } }, - "material-ui-chip-input": { - "version": "2.0.0-beta.2", - "resolved": "https://registry.npmjs.org/material-ui-chip-input/-/material-ui-chip-input-2.0.0-beta.2.tgz", - "integrity": "sha512-E+Jxv9FdAvYUsZIPohoqxqdW7LwFYOCunInJGh2WSDJ2IlCUdpCOEVazqgLQH6thaFarKDu44uGYpD1v3RdqDg==", - "requires": { - "clsx": "^1.0.4", - "prop-types": "^15.6.1" - } - }, "material-ui-flat-pagination": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/material-ui-flat-pagination/-/material-ui-flat-pagination-4.1.0.tgz", diff --git a/package.json b/package.json index 432016109c..770eeb2417 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "formik-material-ui": "1.0.0", "i18next": "^19.4.4", "i18next-browser-languagedetector": "^4.1.1", - "material-ui-chip-input": "^2.0.0-beta.2", "material-ui-flat-pagination": "^4.1.0", "react": "^16.13.1", "react-dom": "^16.13.1", diff --git a/src/pages/publication/DescriptionPanel.tsx b/src/pages/publication/DescriptionPanel.tsx index 8489075ed1..825901ce10 100644 --- a/src/pages/publication/DescriptionPanel.tsx +++ b/src/pages/publication/DescriptionPanel.tsx @@ -1,12 +1,12 @@ -import { Field, FieldArray, FormikProps, useFormikContext, FieldProps, FieldArrayRenderProps, getIn } from 'formik'; +import { Field, FormikProps, useFormikContext, FieldProps } from 'formik'; import { TextField } from 'formik-material-ui'; -import React, { FC, useEffect } from 'react'; +import React, { FC, useEffect, ChangeEvent } from 'react'; import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; import DateFnsUtils from '@date-io/date-fns'; -import { MenuItem } from '@material-ui/core'; +import { MenuItem, TextField as MuiTextField } from '@material-ui/core'; import { MuiPickersUtilsProvider } from '@material-ui/pickers'; -import ChipInput from 'material-ui-chip-input'; +import Autocomplete from '@material-ui/lab/Autocomplete'; import { FormikPublication } from '../../types/publication.types'; import DisciplineSearch from './description_tab/DisciplineSearch'; @@ -30,10 +30,6 @@ const StyledFieldWrapper = styled.div` flex: 1 0 40%; `; -const StyledTagsField = styled(StyledFieldWrapper)` - margin-top: 2rem; -`; - const StyledFieldHeader = styled.header` margin: 1rem; font-size: 1.5rem; @@ -41,7 +37,7 @@ const StyledFieldHeader = styled.header` const DescriptionPanel: FC = ({ setTouchedFields }) => { const { t } = useTranslation('publication'); - const { setFieldValue, values }: FormikProps = useFormikContext(); + const { setFieldValue }: FormikProps = useFormikContext(); useEffect( // Set all fields as touched if user navigates away from this panel (on unmount) @@ -104,22 +100,28 @@ const DescriptionPanel: FC = ({ setTouchedFields }) => { )} - - - {({ name, push, remove }: FieldArrayRenderProps) => ( - push(tag)} - onDelete={(_, index) => remove(index)} - aria-label="tags" - label={t('description.tags')} - helperText={t('description.tags_helper')} - variant="outlined" - fullWidth + + + {({ field }: FieldProps) => ( + , value: string[] | string) => setFieldValue(field.name, value)} + renderInput={(params) => ( + + )} /> )} - - + + From 028b85756b792b8759b66e7058bb959ae6f237c4 Mon Sep 17 00:00:00 2001 From: sarahse Date: Mon, 18 May 2020 09:25:28 +0200 Subject: [PATCH 024/100] Np 918 my publications view (#671) * create components PublishedPublications and UnPublishedPublications and set MyPublications as parent node * show unpublished and published publications * add translations * extract TabButton as separate component * fix typo --- src/AppRoutes.tsx | 2 +- src/components/TabButton.tsx | 36 +++++ src/pages/publication/MyPublications.tsx | 76 ----------- .../my_publications/MyPublications.tsx | 123 ++++++++++++++++++ .../{ => my_publications}/PublicationList.tsx | 9 +- src/pages/worklist/WorklistPage.tsx | 28 +--- src/translations/en/workLists.json | 1 + src/translations/nb/workLists.json | 1 + src/types/publication.types.ts | 2 + 9 files changed, 174 insertions(+), 104 deletions(-) create mode 100644 src/components/TabButton.tsx delete mode 100644 src/pages/publication/MyPublications.tsx create mode 100644 src/pages/publication/my_publications/MyPublications.tsx rename src/pages/publication/{ => my_publications}/PublicationList.tsx (91%) diff --git a/src/AppRoutes.tsx b/src/AppRoutes.tsx index 5739388c79..dd201c318e 100644 --- a/src/AppRoutes.tsx +++ b/src/AppRoutes.tsx @@ -10,7 +10,7 @@ import PrivacyPolicy from './pages/infopages/PrivacyPolicy'; const Dashboard = lazy(() => import('./pages/dashboard/Dashboard')); const EditPublication = lazy(() => import('./pages/publication/EditPublication')); -const MyPublications = lazy(() => import('./pages/publication/MyPublications')); +const MyPublications = lazy(() => import('./pages/publication/my_publications/MyPublications')); const Search = lazy(() => import('./pages/search/Search')); const PublicationPage = lazy(() => import('./pages/publication/publication_page/PublicationPage')); const User = lazy(() => import('./pages/user/User')); diff --git a/src/components/TabButton.tsx b/src/components/TabButton.tsx new file mode 100644 index 0000000000..61ebdc5d25 --- /dev/null +++ b/src/components/TabButton.tsx @@ -0,0 +1,36 @@ +import React, { FC } from 'react'; +import styled from 'styled-components'; +import { ButtonProps, Button } from '@material-ui/core'; + +const StyledTabButton = styled(({ isSelected, ...rest }) => - - )} - - {isLoading ? ( - - ) : ( - - )} - - - ); -}; - -export default MyPublications; diff --git a/src/pages/publication/my_publications/MyPublications.tsx b/src/pages/publication/my_publications/MyPublications.tsx new file mode 100644 index 0000000000..2d19e18240 --- /dev/null +++ b/src/pages/publication/my_publications/MyPublications.tsx @@ -0,0 +1,123 @@ +import React, { FC, useState, useEffect } from 'react'; +import { useTranslation } from 'react-i18next'; +import { useSelector, useDispatch } from 'react-redux'; +import { Button, CircularProgress, Card } from '@material-ui/core'; +import styled from 'styled-components'; +import { RootStore } from '../../../redux/reducers/rootReducer'; +import { Link as RouterLink } from 'react-router-dom'; +import { getMyPublications } from '../../../api/publicationApi'; +import { setNotification } from '../../../redux/actions/notificationActions'; +import { NotificationVariant } from '../../../types/notification.types'; +import { PublicationPreview, PublicationStatus } from '../../../types/publication.types'; +import PublicationList from './PublicationList'; +import TabButton from '../../../components/TabButton'; + +const StyledContainer = styled.div` + display: block; + width: 100%; + margin: 0 2rem 2rem 2rem; +`; + +const StyledButtonWrapper = styled.div` + display: flex; + justify-content: flex-end; + padding: 0 1rem; + height: 3rem; +`; + +const StyledTabsContainer = styled.div` + display: flex; + justify-content: center; + padding-top: 2rem; + margin: 0 1.5rem; +`; + +const StyledProgressContainer = styled.div` + display: flex; + justify-content: space-around; + align-items: center; + padding: 2rem; +`; + +const StyledCard = styled(Card)` + margin: 0 1.5rem; +`; + +enum Tab { + Published, + Unpublished, +} + +const MyPublications: FC = () => { + const { t } = useTranslation('workLists'); + const dispatch = useDispatch(); + const user = useSelector((store: RootStore) => store.user); + const [selectedTab, setSelectedTab] = useState(Tab.Unpublished); + const [isLoading, setIsLoading] = useState(true); + const [publications, setPublications] = useState([]); + + useEffect(() => { + const loadData = async () => { + setIsLoading(true); + const publications = await getMyPublications(); + if (publications?.error) { + dispatch(setNotification(publications.error, NotificationVariant.Error)); + } else { + setPublications(publications); + } + setIsLoading(false); + }; + loadData(); + }, [dispatch]); + + const unpublishedPublications = publications + .filter((publication) => publication.status !== PublicationStatus.PUBLISHED) + .sort((a, b) => new Date(b.createdDate).getTime() - new Date(a.createdDate).getTime()); + + const publishedPublications = publications + .filter((publication) => publication.status === PublicationStatus.PUBLISHED) + .sort((a, b) => new Date(b.createdDate).getTime() - new Date(a.createdDate).getTime()); + + return ( + + + {user.authority && ( + + )} + + + setSelectedTab(Tab.Unpublished)} + isSelected={selectedTab === Tab.Unpublished}> + {t('unpublished_publications')} ({unpublishedPublications.length}) + + setSelectedTab(Tab.Published)} + isSelected={selectedTab === Tab.Published}> + {t('published_publications')} ({publishedPublications.length}) + + + {isLoading ? ( + + + + ) : ( + + + + )} + + ); +}; + +export default MyPublications; diff --git a/src/pages/publication/PublicationList.tsx b/src/pages/publication/my_publications/PublicationList.tsx similarity index 91% rename from src/pages/publication/PublicationList.tsx rename to src/pages/publication/my_publications/PublicationList.tsx index 97853183c9..79210ff7f3 100644 --- a/src/pages/publication/PublicationList.tsx +++ b/src/pages/publication/my_publications/PublicationList.tsx @@ -3,13 +3,13 @@ import React, { FC, useState } from 'react'; import styled from 'styled-components'; import { Button, Table, TableBody, TableCell, TableHead, TableRow } from '@material-ui/core'; import { useTranslation } from 'react-i18next'; -import { PublicationPreview } from '../../types/publication.types'; +import { PublicationPreview, PublicationStatus } from '../../../types/publication.types'; import DeleteIcon from '@material-ui/icons/Delete'; import EditIcon from '@material-ui/icons/Edit'; -import Label from '../../components/Label'; -import NormalText from '../../components/NormalText'; +import Label from '../../../components/Label'; +import NormalText from '../../../components/NormalText'; import { Link as RouterLink } from 'react-router-dom'; -import DeletePublicationModal from './DeletePublicationModal'; +import DeletePublicationModal from '../DeletePublicationModal'; const StyledTableRow = styled(TableRow)` background-color: ${(props) => props.theme.palette.box.main}; @@ -96,6 +96,7 @@ const PublicationList: FC = ({ publications }) => { - + + )} - - savePublication(values)}> - {t('common:save')} - - + savePublication(values)}> + {t('common:save')} + ); diff --git a/src/pages/publication/my_publications/MyPublications.tsx b/src/pages/publication/my_publications/MyPublications.tsx index 2d19e18240..36694f2da2 100644 --- a/src/pages/publication/my_publications/MyPublications.tsx +++ b/src/pages/publication/my_publications/MyPublications.tsx @@ -41,6 +41,7 @@ const StyledProgressContainer = styled.div` const StyledCard = styled(Card)` margin: 0 1.5rem; + width: auto; `; enum Tab { diff --git a/src/pages/worklist/WorkListTable.tsx b/src/pages/worklist/WorkListTable.tsx index fa0f7a5d90..1329a2cdaf 100644 --- a/src/pages/worklist/WorkListTable.tsx +++ b/src/pages/worklist/WorkListTable.tsx @@ -13,6 +13,7 @@ import { import { PublicationPreview } from '../../types/publication.types'; import { useTranslation } from 'react-i18next'; import Label from '../../components/Label'; +import { Link as RouterLink } from 'react-router-dom'; import NormalText from '../../components/NormalText'; import { getTranslatedLabelForDisplayedRows } from '../../utils/pagination'; @@ -78,7 +79,12 @@ const WorklistTable: FC = ({ publications }) => { {publication.createdDate} - diff --git a/src/pages/worklist/WorklistPage.tsx b/src/pages/worklist/WorklistPage.tsx index 39bf36b42b..c423c731a3 100644 --- a/src/pages/worklist/WorklistPage.tsx +++ b/src/pages/worklist/WorklistPage.tsx @@ -5,19 +5,25 @@ import PlaylistAddCheckIcon from '@material-ui/icons/PlaylistAddCheck'; import styled from 'styled-components'; import DoiRequests from './DoiRequests'; import PublicationsForApproval from './PublicationsForApproval'; -import Card from '../../components/Card'; import TabButton from '../../components/TabButton'; +import { Card } from '@material-ui/core'; -const StyledTabsContainer = styled.div` +const StyledContainer = styled.div` + display: block; width: 100%; + margin: 0 2rem 2rem 2rem; +`; + +const StyledTabsContainer = styled.div` display: flex; - justify-content: space-around; + justify-content: center; + padding-top: 2rem; + margin: 0 1.5rem; `; const StyledCard = styled(Card)` - margin-top: 2rem; - text-align: center; - min-height: 5rem; + margin: 0 1.5rem; + width: auto; `; const StyledPlaylistAddCheckIcon = styled(PlaylistAddCheckIcon)` @@ -40,7 +46,7 @@ const WorklistPage: FC = () => { const [selectedTab, setSelectedTab] = useState(Tab.Doi); return ( - <> + { {selectedTab === Tab.Approval && } {selectedTab === Tab.Doi && } - + ); }; diff --git a/src/translations/en/common.json b/src/translations/en/common.json index 22d2674c7f..ed3a448735 100644 --- a/src/translations/en/common.json +++ b/src/translations/en/common.json @@ -7,6 +7,7 @@ "contact_person": "Contact", "create": "Create", "create_authority": "Create author ID", + "create_doi": "Create DOI", "description_create_authority": "Personregisteret inneholder personer med opphavsrett til publiserte vitenskapelige arbeid som er tilgjengelig i institusjonens bibliotek, vitenarkiv eller er del av Norsk Vitenskapsindeks. Også omtalte personer kan bli registrert.\n\nOm personen du søker har publisert noe vitenskapelig tidligere, eller har nylig fullført en vitenskapelig grad ved en norsk utdanningsinstitusjon, så er det sannsynlig at personen alt er registrert.\n\nEn kurator vil prøve å finne ut om dette er en ny person eller om det er en ny skrivemåte på en tidligere registrert person.", "date": "Date", "delete": "Delete", @@ -38,6 +39,7 @@ "read": "Read", "read_less": "Read less", "read_more": "Read more", + "reject_doi": "Reject DOI", "remove": "Remove", "rows_per_page": "Rows per page", "save": "Save", diff --git a/src/translations/nb/common.json b/src/translations/nb/common.json index 5e56095cc5..0cd84b2cb9 100644 --- a/src/translations/nb/common.json +++ b/src/translations/nb/common.json @@ -7,6 +7,7 @@ "contact_person": "Kontaktperson", "create": "Opprett", "create_authority": "Opprett forfatteridentitet", + "create_doi": "Opprett DOI", "description_create_authority": "Personregisteret inneholder personer med opphavsrett til publiserte vitenskapelige arbeid som er tilgjengelig i institusjonens bibliotek, vitenarkiv eller er del av Norsk Vitenskapsindeks. Også omtalte personer kan bli registrert.\n\nOm personen du søker har publisert noe vitenskapelig tidligere, eller har nylig fullført en vitenskapelig grad ved en norsk utdanningsinstitusjon, så er det sannsynlig at personen alt er registrert.\n\nEn kurator vil prøve å finne ut om dette er en ny person eller om det er en ny skrivemåte på en tidligere registrert person.", "date": "Dato", "delete": "Slett", @@ -38,6 +39,7 @@ "read": "Les", "read_less": "Les mindre", "read_more": "Les mer", + "reject_doi": "Avvis DOI", "remove": "Fjern", "rows_per_page": "Rader per side", "save": "Lagre", diff --git a/src/types/publication.types.ts b/src/types/publication.types.ts index 997691e140..a5880d37bb 100644 --- a/src/types/publication.types.ts +++ b/src/types/publication.types.ts @@ -30,6 +30,14 @@ export enum PublicationStatus { PUBLISHED = 'Published', } +export enum PublicationTab { + Description = 0, + Reference = 1, + Contributors = 2, + FilesAndLicenses = 3, + Submission = 4, +} + export const levelMap: EnumDictionary = { NO_LEVEL: null, LEVEL_0: 0, diff --git a/src/utils/testfiles/mock_feide_user.ts b/src/utils/testfiles/mock_feide_user.ts index fc4439bb3e..badefb488a 100644 --- a/src/utils/testfiles/mock_feide_user.ts +++ b/src/utils/testfiles/mock_feide_user.ts @@ -5,7 +5,7 @@ export const mockUser: FeideUser = { email: 'testuser@unit.no', 'custom:identifiers': 'tu@unit.no', 'custom:orgName': 'unit', - 'custom:applicationRoles': `${RoleName.PUBLISHER},${RoleName.CURATOR},${RoleName.ADMIN},${RoleName.APP_ADMIN}`, + 'custom:applicationRoles': `${RoleName.PUBLISHER},${RoleName.ADMIN},${RoleName.APP_ADMIN}`, 'custom:application': ApplicationName.NVA, 'custom:orgNumber': 'NO919477822', 'custom:commonName': 'Unit', From 6014b23f14052d39cebac8e6e0f41f02e1fb3adb Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Wed, 20 May 2020 09:07:31 +0200 Subject: [PATCH 035/100] Bump @types/node from 14.0.1 to 14.0.4 (#685) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.0.1 to 14.0.4. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5387956001..2e79f62b51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4573,9 +4573,9 @@ "dev": true }, "@types/node": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.1.tgz", - "integrity": "sha512-FAYBGwC+W6F9+huFIDtn43cpy7+SzG+atzRiTfdp3inUKL2hXnd4rG8hylJLIh4+hqrQy1P17kvJByE/z825hA==" + "version": "14.0.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.4.tgz", + "integrity": "sha512-k3NqigXWRzQZVBDS5D1U70A5E8Qk4Kh+Ha/x4M8Bt9pF0X05eggfnC9+63Usc9Q928hRUIpIhTQaXsZwZBl4Ew==" }, "@types/parse-json": { "version": "4.0.0", diff --git a/package.json b/package.json index d551afa18b..c7a5acf81a 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "@cypress/instrument-cra": "^1.1.1", "@istanbuljs/nyc-config-typescript": "^1.0.1", "@types/jest": "^25.2.1", - "@types/node": "^14.0.1", + "@types/node": "^14.0.4", "@types/react": "^16.9.35", "@types/react-dom": "^16.9.8", "@types/react-redux": "^7.1.9", From 33b783a2fe6d2de36f15a1e7b48dac1f055388dd Mon Sep 17 00:00:00 2001 From: sarahse Date: Wed, 20 May 2020 11:16:56 +0200 Subject: [PATCH 036/100] Np 920 add links to licenses (#690) * rename PublicationPage to PublicPublication and add license links * add link to license heading * cleanup --- src/AppRoutes.tsx | 4 +- .../PublicPublication.tsx} | 14 ++++-- .../PublicPublicationFiles.tsx} | 6 +-- .../PublicationPageAuthors.tsx | 0 src/translations/en/licenses.json | 25 +++++++--- src/translations/nb/licenses.json | 25 +++++++--- src/types/file.types.ts | 50 +++++++++++-------- 7 files changed, 77 insertions(+), 47 deletions(-) rename src/pages/publication/{publication_page/PublicationPage.tsx => public_publication/PublicPublication.tsx} (92%) rename src/pages/publication/{publication_page/PublicationPageFiles.tsx => public_publication/PublicPublicationFiles.tsx} (92%) rename src/pages/publication/{publication_page => public_publication}/PublicationPageAuthors.tsx (100%) diff --git a/src/AppRoutes.tsx b/src/AppRoutes.tsx index aa581ede1a..9abfd6ee4f 100644 --- a/src/AppRoutes.tsx +++ b/src/AppRoutes.tsx @@ -12,7 +12,7 @@ const Dashboard = lazy(() => import('./pages/dashboard/Dashboard')); const EditPublication = lazy(() => import('./pages/publication/EditPublication')); const MyPublications = lazy(() => import('./pages/publication/my_publications/MyPublications')); const Search = lazy(() => import('./pages/search/Search')); -const PublicationPage = lazy(() => import('./pages/publication/publication_page/PublicationPage')); +const PublicPublication = lazy(() => import('./pages/publication/public_publication/PublicPublication')); const User = lazy(() => import('./pages/user/User')); const NotFound = lazy(() => import('./pages/errorpages/NotFound')); const PublicProfile = lazy(() => import('./pages/publication/PublicProfile')); @@ -39,7 +39,7 @@ const AppRoutes: FC = () => { {user.isInstitutionAdmin && } - + {user.isLoggedIn && } diff --git a/src/pages/publication/publication_page/PublicationPage.tsx b/src/pages/publication/public_publication/PublicPublication.tsx similarity index 92% rename from src/pages/publication/publication_page/PublicationPage.tsx rename to src/pages/publication/public_publication/PublicPublication.tsx index 1c41fe5c17..8977a8cdd0 100644 --- a/src/pages/publication/publication_page/PublicationPage.tsx +++ b/src/pages/publication/public_publication/PublicPublication.tsx @@ -6,7 +6,7 @@ import { emptyPublication } from '../../../types/publication.types'; import ContentPage from '../../../components/ContentPage'; import { useTranslation } from 'react-i18next'; import PublicationPageAuthors from './PublicationPageAuthors'; -import PublicationPageFiles from './PublicationPageFiles'; +import PublicPublicationFiles from './PublicPublicationFiles'; import NotFound from '../../errorpages/NotFound'; import Card from '../../../components/Card'; import Heading from '../../../components/Heading'; @@ -87,7 +87,7 @@ const StyledTagContainer = styled.div` align-items: center; `; -const PublicationPage: FC = () => { +const PublicPublication: FC = () => { const { t } = useTranslation('publication'); const { identifier } = useParams(); const [publication, isLoadingPublication] = useFetchPublication(identifier); @@ -124,7 +124,7 @@ const PublicationPage: FC = () => { */} {publication.fileSet && ( - + )} @@ -171,7 +171,11 @@ const PublicationPage: FC = () => { {selectedLicense && ( - {selectedLicense.label} + + + {selectedLicense.label} + + {selectedLicense.description} )} @@ -197,4 +201,4 @@ const PublicationPage: FC = () => { ); }; -export default PublicationPage; +export default PublicPublication; diff --git a/src/pages/publication/publication_page/PublicationPageFiles.tsx b/src/pages/publication/public_publication/PublicPublicationFiles.tsx similarity index 92% rename from src/pages/publication/publication_page/PublicationPageFiles.tsx rename to src/pages/publication/public_publication/PublicPublicationFiles.tsx index 45b1d392f0..e8f698083c 100644 --- a/src/pages/publication/publication_page/PublicationPageFiles.tsx +++ b/src/pages/publication/public_publication/PublicPublicationFiles.tsx @@ -27,11 +27,11 @@ const StyledButtonWithProgress = styled(ButtonWithProgress)` margin: 1rem; `; -interface PublicationPageFilesProps { +interface PublicPublicationFilesProps { files: File[]; } -const PublicationPageFiles: FC = ({ files }) => { +const PublicPublicationFiles: FC = ({ files }) => { const { identifier } = useParams(); const { t } = useTranslation('common'); const dispatch = useDispatch(); @@ -66,4 +66,4 @@ const PublicationPageFiles: FC = ({ files }) => { ); }; -export default PublicationPageFiles; +export default PublicPublicationFiles; diff --git a/src/pages/publication/publication_page/PublicationPageAuthors.tsx b/src/pages/publication/public_publication/PublicationPageAuthors.tsx similarity index 100% rename from src/pages/publication/publication_page/PublicationPageAuthors.tsx rename to src/pages/publication/public_publication/PublicationPageAuthors.tsx diff --git a/src/translations/en/licenses.json b/src/translations/en/licenses.json index 0edeeca670..e179b71ff9 100644 --- a/src/translations/en/licenses.json +++ b/src/translations/en/licenses.json @@ -1,4 +1,13 @@ { + "description": { + "cc0": "The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.", + "cc_by": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material for any purpose, even commercially. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made.", + "cc_by_nc": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nYou may not use the material for commercial purposes.", + "cc_by_nc_nd": "Share — copy and redistribute the material in any medium or format. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nYou may not use the material for commercial purposes. \nIf you remix, transform, or build upon the material, you may not distribute the modified material.", + "cc_by_nc_sa": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nYou may not use the material for commercial purposes. \nIf you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.", + "cc_by_nd": "Share — copy and redistribute the material in any medium or format for any purpose, even commercially. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nIf you remix, transform, or build upon the material, you may not distribute the modified material.", + "cc_by_sa": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material for any purpose, even commercially. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nIf you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original." + }, "labels": { "cc0": "CC0 1.0 Universal (CC0 1.0) - Public Domain Dedication", "cc_by": "Attribution 4.0 International (CC BY 4.0)", @@ -8,13 +17,13 @@ "cc_by_nd": "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "cc_by_sa": "Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)" }, - "description": { - "cc0": "The person who associated a work with this deed has dedicated the work to the public domain by waiving all of his or her rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law.", - "cc_by": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material for any purpose, even commercially. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made.", - "cc_by_nc": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nYou may not use the material for commercial purposes.", - "cc_by_nc_nd": "Share — copy and redistribute the material in any medium or format. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nYou may not use the material for commercial purposes. \nIf you remix, transform, or build upon the material, you may not distribute the modified material.", - "cc_by_nc_sa": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nYou may not use the material for commercial purposes. \nIf you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.", - "cc_by_nd": "Share — copy and redistribute the material in any medium or format for any purpose, even commercially. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nIf you remix, transform, or build upon the material, you may not distribute the modified material.", - "cc_by_sa": "Share — copy and redistribute the material in any medium or format. \nAdapt — remix, transform, and build upon the material for any purpose, even commercially. \n\nYou must give appropriate credit, provide a link to the license, and indicate if changes were made. \nIf you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original." + "links": { + "cc0": "https://creativecommons.org/publicdomain/zero/1.0/", + "cc_by": "https://creativecommons.org/licenses/by/4.0/", + "cc_by_nc": "https://creativecommons.org/licenses/by-nc/4.0/", + "cc_by_nc_nd": "https://creativecommons.org/licenses/by-nc-nd/4.0/", + "cc_by_nc_sa": "https://creativecommons.org/licenses/by-nc-sa/4.0/", + "cc_by_nd": "https://creativecommons.org/licenses/by-nd/4.0/", + "cc_by_sa": "https://creativecommons.org/licenses/by-sa/4.0/" } } diff --git a/src/translations/nb/licenses.json b/src/translations/nb/licenses.json index 5e1091294d..b93d6140d8 100644 --- a/src/translations/nb/licenses.json +++ b/src/translations/nb/licenses.json @@ -1,4 +1,13 @@ { + "description": { + "cc0": "Den person som har knyttet et verk til dette aktstykke (deed) har, i den utstrekning loven tillater, erklært dette verket er i det fri ved å si fra seg alle de opphavsrettigheter og nærstående rettigheter som vedkommende hadde til verket.", + "cc_by": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet til et hvilket som helst formål, inkludert kommersielle. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort.", + "cc_by_nc": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDu kan ikke benytte materialet til kommersielle formål.", + "cc_by_nc_nd": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDu kan ikke benytte materialet til kommersielle formål. \nDersom du remixer, bearbeider eller bygger på materialet, kan du ikke distribuere det endrede materialet.", + "cc_by_nc_sa": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDu kan ikke benytte materialet til kommersielle formål. \nDersom du remixer, bearbeider eller bygger på materialet, må du distribuere dine bidrag under samme lisens som originalen.", + "cc_by_nd": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format til et hvilket som helst formål, inkludert kommersielle. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDersom du remixer, bearbeider eller bygger på materialet, kan du ikke distribuere det endrede materialet.", + "cc_by_sa": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet til et hvilket som helst formål, inkludert kommersielle. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDersom du remixer, bearbeider eller bygger på materialet, må du distribuere dine bidrag under samme lisens som originalen." + }, "labels": { "cc0": "CC0 1.0 Universal (CC0 1.0) - Fristatus-erklæring", "cc_by": "Navngivelse 4.0 Internasjonal (CC BY 4.0)", @@ -8,13 +17,13 @@ "cc_by_nd": "Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)", "cc_by_sa": "Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)" }, - "description": { - "cc0": "Den person som har knyttet et verk til dette aktstykke (deed) har, i den utstrekning loven tillater, erklært dette verket er i det fri ved å si fra seg alle de opphavsrettigheter og nærstående rettigheter som vedkommende hadde til verket.", - "cc_by": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet til et hvilket som helst formål, inkludert kommersielle. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort.", - "cc_by_nc": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDu kan ikke benytte materialet til kommersielle formål.", - "cc_by_nc_nd": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDu kan ikke benytte materialet til kommersielle formål. \nDersom du remixer, bearbeider eller bygger på materialet, kan du ikke distribuere det endrede materialet.", - "cc_by_nc_sa": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDu kan ikke benytte materialet til kommersielle formål. \nDersom du remixer, bearbeider eller bygger på materialet, må du distribuere dine bidrag under samme lisens som originalen.", - "cc_by_nd": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format til et hvilket som helst formål, inkludert kommersielle. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDersom du remixer, bearbeider eller bygger på materialet, kan du ikke distribuere det endrede materialet.", - "cc_by_sa": "Dele — kopiere, distribuere og spre verket i hvilket som helst medium eller format. \nBearbeide — remixe, endre, og bygge videre på materialet til et hvilket som helst formål, inkludert kommersielle. \n\nDu må oppgi korrekt kreditering, oppgi en lenke til lisensen, og indikere om endringer er blitt gjort. \nDersom du remixer, bearbeider eller bygger på materialet, må du distribuere dine bidrag under samme lisens som originalen." + "links": { + "cc0": "https://creativecommons.org/publicdomain/zero/1.0/deed.no", + "cc_by": "https://creativecommons.org/licenses/by/4.0/deed.no", + "cc_by_nc": "https://creativecommons.org/licenses/by-nc/4.0/deed.no", + "cc_by_nc_nd": "https://creativecommons.org/licenses/by-nc-nd/4.0/deed.no", + "cc_by_nc_sa": "https://creativecommons.org/licenses/by-nc-sa/4.0/deed.no", + "cc_by_nd": "https://creativecommons.org/licenses/by-nd/4.0/deed.no", + "cc_by_sa": "https://creativecommons.org/licenses/by-sa/4.0/deed.no" } } diff --git a/src/types/file.types.ts b/src/types/file.types.ts index ee858b92bf..bf32c0caa5 100644 --- a/src/types/file.types.ts +++ b/src/types/file.types.ts @@ -14,34 +14,38 @@ export enum LicenseNames { } interface LicenseInfo { - identifier: LicenseNames; - label: string; + buttonImage: any; description: string; + identifier: LicenseNames; image: any; - buttonImage: any; + label: string; + link: string; } export const licenses: LicenseInfo[] = [ { - identifier: LicenseNames.CC_BY, - label: i18n.t('licenses:labels.cc_by'), - image: LicenseImages.ccByImage, buttonImage: LicenseImages.ccByButton, description: i18n.t('licenses:description.cc_by'), + identifier: LicenseNames.CC_BY, + image: LicenseImages.ccByImage, + label: i18n.t('licenses:labels.cc_by'), + link: i18n.t('licenses:links.cc_by'), }, { - identifier: LicenseNames.CC_BY_SA, - label: i18n.t('licenses:labels.cc_by_sa'), - image: LicenseImages.ccBySaImage, buttonImage: LicenseImages.ccBySaButton, description: i18n.t('licenses:description.cc_by_sa'), + identifier: LicenseNames.CC_BY_SA, + image: LicenseImages.ccBySaImage, + label: i18n.t('licenses:labels.cc_by_sa'), + link: i18n.t('licenses:links.cc_by_sa'), }, { - identifier: LicenseNames.CC_BY_ND, - label: i18n.t('licenses:labels.cc_by_nd'), - image: LicenseImages.ccByNdImage, buttonImage: LicenseImages.ccByNdButton, description: i18n.t('licenses:description.cc_by_nd'), + identifier: LicenseNames.CC_BY_ND, + image: LicenseImages.ccByNdImage, + label: i18n.t('licenses:labels.cc_by_nd'), + link: i18n.t('licenses:links.cc_by_nd'), }, { identifier: LicenseNames.CC_BY_NC, @@ -49,27 +53,31 @@ export const licenses: LicenseInfo[] = [ image: LicenseImages.ccByNcImage, buttonImage: LicenseImages.ccByNcButton, description: i18n.t('licenses:description.cc_by_nc'), + link: i18n.t('licenses:links.cc_by_nc'), }, { - identifier: LicenseNames.CC_BY_NC_SA, - label: i18n.t('licenses:labels.cc_by_nc_sa'), - image: LicenseImages.ccByNcSaImage, buttonImage: LicenseImages.ccByNcSaButton, description: i18n.t('licenses:description.cc_by_nc_sa'), + identifier: LicenseNames.CC_BY_NC_SA, + image: LicenseImages.ccByNcSaImage, + label: i18n.t('licenses:labels.cc_by_nc_sa'), + link: i18n.t('licenses:links.cc_by_nc_sa'), }, { - identifier: LicenseNames.CC_BY_NC_ND, - label: i18n.t('licenses:labels.cc_by_nc_nd'), - image: LicenseImages.ccByNcNdImage, buttonImage: LicenseImages.ccByNcNdButton, description: i18n.t('licenses:description.cc_by_nc_nd'), + identifier: LicenseNames.CC_BY_NC_ND, + image: LicenseImages.ccByNcNdImage, + label: i18n.t('licenses:labels.cc_by_nc_nd'), + link: i18n.t('licenses:links.cc_by_nc_nd'), }, { - identifier: LicenseNames.CC0, - label: i18n.t('licenses:labels.cc0'), - image: LicenseImages.cc0Image, buttonImage: LicenseImages.cc0Button, description: i18n.t('licenses:description.cc0'), + identifier: LicenseNames.CC0, + image: LicenseImages.cc0Image, + label: i18n.t('licenses:labels.cc0'), + link: i18n.t('licenses:links.cc0'), }, ]; From 80d3bb80081cac2e02a049c031a9cf583752894d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Wed, 20 May 2020 11:50:04 +0200 Subject: [PATCH 037/100] Np 969 link corresponding orcid (#691) * NP-969 Add mailto and link to orcid profile * NP-969 Move import --- .../public_publication/PublicPublication.tsx | 4 +-- ...thors.tsx => PublicPublicationAuthors.tsx} | 31 ++++++++++++++----- 2 files changed, 26 insertions(+), 9 deletions(-) rename src/pages/publication/public_publication/{PublicationPageAuthors.tsx => PublicPublicationAuthors.tsx} (62%) diff --git a/src/pages/publication/public_publication/PublicPublication.tsx b/src/pages/publication/public_publication/PublicPublication.tsx index 8977a8cdd0..c920121b11 100644 --- a/src/pages/publication/public_publication/PublicPublication.tsx +++ b/src/pages/publication/public_publication/PublicPublication.tsx @@ -5,7 +5,7 @@ import styled from 'styled-components'; import { emptyPublication } from '../../../types/publication.types'; import ContentPage from '../../../components/ContentPage'; import { useTranslation } from 'react-i18next'; -import PublicationPageAuthors from './PublicationPageAuthors'; +import PublicPublicationAuthors from './PublicPublicationAuthors'; import PublicPublicationFiles from './PublicPublicationFiles'; import NotFound from '../../errorpages/NotFound'; import Card from '../../../components/Card'; @@ -116,7 +116,7 @@ const PublicPublication: FC = () => { {publication ? ( <> {mainTitle} - {contributors && } + {contributors && } {/* diff --git a/src/pages/publication/public_publication/PublicationPageAuthors.tsx b/src/pages/publication/public_publication/PublicPublicationAuthors.tsx similarity index 62% rename from src/pages/publication/public_publication/PublicationPageAuthors.tsx rename to src/pages/publication/public_publication/PublicPublicationAuthors.tsx index d21c11b3b6..cfc2a20b49 100644 --- a/src/pages/publication/public_publication/PublicationPageAuthors.tsx +++ b/src/pages/publication/public_publication/PublicPublicationAuthors.tsx @@ -1,11 +1,14 @@ import React, { FC } from 'react'; import styled from 'styled-components'; -import { Link, CircularProgress } from '@material-ui/core'; +import { Link, CircularProgress, IconButton } from '@material-ui/core'; +import MailOutlineIcon from '@material-ui/icons/MailOutline'; import { Contributor } from '../../../types/contributor.types'; import NormalText from '../../../components/NormalText'; import useFetchUnitHierarchy from '../../../utils/hooks/useFetchUnitHierarchy'; import { getCommaSeparatedUnitString, getDistinctContributorUnits } from '../../../utils/institutions-helpers'; +import OrcidLogo from '../../../resources/images/orcid_logo.svg'; +import { ORCID_BASE_URL } from '../../../utils/constants'; const StyledAuthor = styled.span` margin-right: 1rem; @@ -16,26 +19,40 @@ const StyledAffiliationsContainer = styled.div` padding-left: 1rem; `; -interface PublicationPageProps { +interface PublicPublicationProps { contributors: Contributor[]; } -const PublicationPageAuthors: FC = ({ contributors }) => { +const PublicPublicationAuthors: FC = ({ contributors }) => { const distinctUnits = getDistinctContributorUnits(contributors); return ( <> {contributors.map((contributor, index) => { - const { arpId, name } = contributor.identity; + const { + identity: { arpId, name, orcId }, + email, + } = contributor; const affiliationIndexes = contributor.affiliations?.map( (affiliation) => distinctUnits.indexOf(affiliation.id) + 1 ); - return ( {arpId ? {name} : name} - {affiliationIndexes?.length > 0 && {affiliationIndexes.join(',')}} + + {affiliationIndexes?.length > 0 && affiliationIndexes.join(',')} + {email && ( + + + + )} + {orcId && ( + + orcid + + )} + ); })} @@ -67,4 +84,4 @@ const PublicationPageAffiliation: FC = ({ unitU ) : null; }; -export default PublicationPageAuthors; +export default PublicPublicationAuthors; From 7cf13b326f560b052f5862faa54574c5f4a16200 Mon Sep 17 00:00:00 2001 From: sarahse Date: Wed, 20 May 2020 11:51:31 +0200 Subject: [PATCH 038/100] show npiSubject in public publication (#692) --- .../public_publication/PublicPublication.tsx | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/src/pages/publication/public_publication/PublicPublication.tsx b/src/pages/publication/public_publication/PublicPublication.tsx index c920121b11..50df9905ad 100644 --- a/src/pages/publication/public_publication/PublicPublication.tsx +++ b/src/pages/publication/public_publication/PublicPublication.tsx @@ -17,6 +17,7 @@ import Label from '../../../components/Label'; import NormalText from '../../../components/NormalText'; import { licenses } from '../../../types/file.types'; import useFetchPublication from '../../../utils/hooks/useFetchPublication'; +import { getNpiDiscipline } from '../../../utils/npiDisciplines'; const StyledContentWrapper = styled.div` display: flex; @@ -93,14 +94,15 @@ const PublicPublication: FC = () => { const [publication, isLoadingPublication] = useFetchPublication(identifier); const { - mainTitle, abstract, - description, - tags, - date, contributors, + date, + description, + mainTitle, + npiSubjectHeading, reference: { doi, publicationContext }, series, + tags, } = publication ? publication.entityDescription : emptyPublication.entityDescription; // Show only the license for the first file for now @@ -128,7 +130,7 @@ const PublicPublication: FC = () => { )} - + {date.year} {date.month && `-${date.month}`} {date.day && `-${date.day}`} @@ -137,25 +139,25 @@ const PublicPublication: FC = () => { {doi && ( - + {`${DOI_PREFIX}${doi}`} )} {abstract && ( - {t('description.abstract')} + {`${t('description.abstract')}:`} {abstract} )} {description && ( - {t('description.description')} + {`${t('description.description')}:`} {description} )} {tags && ( - {t('description.tags')} + {`${t('description.tags')}:`} {tags.map((tag) => ( @@ -164,10 +166,15 @@ const PublicPublication: FC = () => { )} {publicationContext && ( - + {publicationContext.title} )} + {npiSubjectHeading && ( + + {getNpiDiscipline(npiSubjectHeading)?.name} + + )} {selectedLicense && ( @@ -180,12 +187,12 @@ const PublicPublication: FC = () => { )} {publication.project && ( - + {publication.project.name} )} {series && ( - + {series.title} )} From 884982a4ec5b94eeddfea17b4b552fa583b6bad9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Wed, 20 May 2020 15:30:07 +0200 Subject: [PATCH 039/100] Np 977 affiliation hierarchy (#693) * NP-969 Add mailto and link to orcid profile * NP-969 Reuse logic for fetching unit * Use one component for displaying affiliation hierarchy * NP-969 Add mailto and link to orcid profile * NP-969 Move import * NP-977 Reuse logic for fetching and displaying affiliation * NP-977 Fix some styling * NP-977 Rename method * NP-977 Fix comment --- .../institution/AffiliationHierarchy.tsx | 47 ++++++++++------ src/pages/publication/PublicProfile.tsx | 23 +++----- .../components/AffiliationsCell.tsx | 17 +----- .../PublicPublicationAuthors.tsx | 39 ++++++------- src/pages/user/authority/AuthorityCard.tsx | 13 +---- .../user/institution/InstitutionCard.tsx | 34 +++++------ src/utils/hooks/useFetchMultipleUnits.tsx | 56 ------------------- src/utils/institutions-helpers.ts | 8 +-- 8 files changed, 77 insertions(+), 160 deletions(-) delete mode 100644 src/utils/hooks/useFetchMultipleUnits.tsx diff --git a/src/components/institution/AffiliationHierarchy.tsx b/src/components/institution/AffiliationHierarchy.tsx index b010a0b965..7aa9dba665 100644 --- a/src/components/institution/AffiliationHierarchy.tsx +++ b/src/components/institution/AffiliationHierarchy.tsx @@ -1,25 +1,40 @@ -import React, { FC } from 'react'; -import { RecursiveInstitutionUnit } from '../../types/institution.types'; +import React, { FC, Fragment } from 'react'; +import { CircularProgress } from '@material-ui/core'; + import Label from '../Label'; import NormalText from '../NormalText'; +import useFetchUnitHierarchy from '../../utils/hooks/useFetchUnitHierarchy'; +import { getUnitHierarchyNames } from '../../utils/institutions-helpers'; interface AffiliationHierarchyProps { - unit: RecursiveInstitutionUnit; - boldTopLevel?: boolean; + unitUri: string; + commaSeparated?: boolean; // Comma separated or line breaks + boldTopLevel?: boolean; // Only relevant if commaSeparated=false } -const AffiliationHierarchy: FC = ({ unit, boldTopLevel = true }) => ( - <> - {boldTopLevel ? : {unit.name}} - {unit?.subunits && } - -); +export const AffiliationHierarchy: FC = ({ + unitUri, + commaSeparated = false, + boldTopLevel = true, +}) => { + const [unit, isLoadingUnit] = useFetchUnitHierarchy(unitUri); + const unitNames = unit ? getUnitHierarchyNames(unit) : []; -const SubUnitRow: FC = ({ unit }) => ( - <> - {unit.name} - {unit.subunits && } - -); + return isLoadingUnit ? ( + + ) : unit ? ( + commaSeparated ? ( + {unitNames.join(', ')} + ) : ( +
+ {unitNames.map((unitName, index) => ( + + {index === 0 && boldTopLevel ? : {unitName}} + + ))} +
+ ) + ) : null; +}; export default AffiliationHierarchy; diff --git a/src/pages/publication/PublicProfile.tsx b/src/pages/publication/PublicProfile.tsx index 11d95a8c79..331081738b 100644 --- a/src/pages/publication/PublicProfile.tsx +++ b/src/pages/publication/PublicProfile.tsx @@ -14,8 +14,7 @@ import { ORCID_BASE_URL } from '../../utils/constants'; import LabelTextLine from './../../components/LabelTextLine'; import Heading from '../../components/Heading'; import { NotificationVariant } from '../../types/notification.types'; -import useFetchMultipleUnits from '../../utils/hooks/useFetchMultipleUnits'; -import { getCommaSeparatedUnitString } from '../../utils/institutions-helpers'; +import { AffiliationHierarchy } from '../../components/institution/AffiliationHierarchy'; const StyledWrapper = styled.div` text-align: center; @@ -33,11 +32,10 @@ const StyledUserInfo = styled.div` const PublicProfile: FC = () => { const dispatch = useDispatch(); + const { t } = useTranslation('profile'); const [isLoading, setIsLoading] = useState(true); const [publications, setPublications] = useState([]); - const { t } = useTranslation('profile'); const user = useSelector((store: RootStore) => store.user); - const [units, isLoadingMultiple] = useFetchMultipleUnits(user.authority?.orgunitids); useEffect(() => { const loadData = async () => { @@ -62,17 +60,12 @@ const PublicProfile: FC = () => { {user.name} - {isLoadingMultiple ? ( - - ) : ( - units && - units.length > 0 && ( - - {units.map((unit) => ( - {getCommaSeparatedUnitString(unit)} - ))} - - ) + {user.authority?.orgunitids && user.authority.orgunitids.length > 0 && ( + + {user.authority.orgunitids.map((unitId) => ( + + ))} + )} {user.authority?.orcids.map((orcid: string) => { const orcidLink = `${ORCID_BASE_URL}/${orcid}`; diff --git a/src/pages/publication/contributors_tab/components/AffiliationsCell.tsx b/src/pages/publication/contributors_tab/components/AffiliationsCell.tsx index a537d993f7..f957cc88d1 100644 --- a/src/pages/publication/contributors_tab/components/AffiliationsCell.tsx +++ b/src/pages/publication/contributors_tab/components/AffiliationsCell.tsx @@ -1,6 +1,6 @@ import React, { FC, useState } from 'react'; import { Institution } from '../../../../types/contributor.types'; -import { Button, CircularProgress } from '@material-ui/core'; +import { Button } from '@material-ui/core'; import SelectInstitution from '../../../../components/institution/SelectInstitution'; import Modal from '../../../../components/Modal'; import { useFormikContext, FormikProps } from 'formik'; @@ -17,7 +17,6 @@ import { getMostSpecificUnit } from '../../../../utils/institutions-helpers'; import { useDispatch } from 'react-redux'; import { setNotification } from '../../../../redux/actions/notificationActions'; import { NotificationVariant } from '../../../../types/notification.types'; -import useFetchUnitHierarchy from '../../../../utils/hooks/useFetchUnitHierarchy'; import AffiliationHierarchy from '../../../../components/institution/AffiliationHierarchy'; import Card from '../../../../components/Card'; @@ -76,7 +75,7 @@ const AffiliationsCell: FC = ({ affiliations, baseFieldNa <> {affiliations?.map((affiliation) => ( - + - - - )} + + + + + + ); }; diff --git a/src/utils/hooks/useFetchMultipleUnits.tsx b/src/utils/hooks/useFetchMultipleUnits.tsx deleted file mode 100644 index 8d402c5e3a..0000000000 --- a/src/utils/hooks/useFetchMultipleUnits.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { useState, useEffect } from 'react'; -import { useDispatch } from 'react-redux'; - -import { RecursiveInstitutionUnit } from '../../types/institution.types'; -import { getDepartment } from '../../api/institutionApi'; -import { setNotification } from '../../redux/actions/notificationActions'; -import { NotificationVariant } from '../../types/notification.types'; -import { getUnitUri } from '../unitUrl'; -import Axios from 'axios'; - -// This hook is used to fetch the top-down hierarchy of units given an array of unitIds -const useFetchMultipleUnits = (unitIds: string[] | undefined): [RecursiveInstitutionUnit[] | undefined, boolean] => { - const dispatch = useDispatch(); - const [isLoading, setIsLoading] = useState(true); - const [units, setUnits] = useState([]); - - useEffect(() => { - const cancelSource = Axios.CancelToken.source(); - - const fetchDepartment = async (unitId: string) => { - // TODO: NP-844 should ensure we have URIs from start (not IDs) - const unitUri = getUnitUri(unitId); - - const response = await getDepartment(unitUri, cancelSource.token); - if (response) { - if (response.error) { - dispatch(setNotification(response.error, NotificationVariant.Error)); - } else { - return response; - } - } - }; - if (unitIds && unitIds.length > 0) { - setIsLoading(true); - unitIds.forEach(async (unitId) => { - const unit = await fetchDepartment(unitId); - if (unit) { - setUnits((u) => { - if (u.length === unitIds.length - 1) { - setIsLoading(false); - } - return [...u, unit]; - }); - } - }); - } else { - setIsLoading(false); - } - - return () => cancelSource.cancel(); - }, [dispatch, unitIds]); - - return [units, isLoading]; -}; - -export default useFetchMultipleUnits; diff --git a/src/utils/institutions-helpers.ts b/src/utils/institutions-helpers.ts index 2baddeb1ff..a68e879817 100644 --- a/src/utils/institutions-helpers.ts +++ b/src/utils/institutions-helpers.ts @@ -33,12 +33,12 @@ export const getDistinctContributorUnits = (contributors: Contributor[]) => [ ), ]; -// Returns top-down comma separated unit names -export const getCommaSeparatedUnitString = (unit: RecursiveInstitutionUnit, unitNames: string[] = []): string => { +// Returns top-down unit names: ["Level1", "Level2", (etc.)] +export const getUnitHierarchyNames = (unit: RecursiveInstitutionUnit, unitNames: string[] = []): string[] => { unitNames.push(unit.name); if (unit.subunits) { - return getCommaSeparatedUnitString(unit.subunits[0], unitNames); + return getUnitHierarchyNames(unit.subunits[0], unitNames); } else { - return unitNames.join(', '); + return unitNames; } }; From f687453b3b4a9dc237cefecd4767875d97284488 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 21 May 2020 09:20:56 +0200 Subject: [PATCH 040/100] Bump i18next-browser-languagedetector from 4.1.1 to 4.2.0 (#698) Bumps [i18next-browser-languagedetector](https://github.com/i18next/i18next-browser-languageDetector) from 4.1.1 to 4.2.0. - [Release notes](https://github.com/i18next/i18next-browser-languageDetector/releases) - [Changelog](https://github.com/i18next/i18next-browser-languageDetector/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next-browser-languageDetector/compare/v4.1.1...v4.2.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e79f62b51..8119ec9599 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11770,9 +11770,9 @@ } }, "i18next-browser-languagedetector": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-4.1.1.tgz", - "integrity": "sha512-akv0zurR/2KU7s1qaWkirY9FEEOT1TNsQaezEg8+1BLLQre7vylqb7tYoUgYqP/0/BEzXJgnoQnj+sh5xYFMhg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-4.2.0.tgz", + "integrity": "sha512-qRSCBWgDUSqVQb3sTxkDC+ImYLhF+wB387Y1RpOcJvyex+V3abi+W83n4Awy+dx719AOBbKTy97FjrUGrAhbyw==", "requires": { "@babel/runtime": "^7.5.5" } diff --git a/package.json b/package.json index c7a5acf81a..bb95dc980e 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "deepmerge": "^4.2.2", "formik": "^2.1.4", "i18next": "^19.4.4", - "i18next-browser-languagedetector": "^4.1.1", + "i18next-browser-languagedetector": "^4.2.0", "react": "^16.13.1", "react-dom": "^16.13.1", "react-i18next": "^11.4.0", From 886d995ef389ffbf3c92742b9c7819bc5f666eb6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 21 May 2020 09:27:40 +0200 Subject: [PATCH 041/100] Bump @types/yup from 0.28.3 to 0.29.0 (#697) Bumps [@types/yup](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/yup) from 0.28.3 to 0.29.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/yup) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8119ec9599..df13f6e5a7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4731,9 +4731,9 @@ "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==" }, "@types/yup": { - "version": "0.28.3", - "resolved": "https://registry.npmjs.org/@types/yup/-/yup-0.28.3.tgz", - "integrity": "sha512-0Sir2LxOmupF8HBUvpJoZghLmOqKfZsBk1GYlMwSIccLDDUoN04LHvo0KzDp9qxt1IKf9Fudpj35SrJ8VqetkQ==", + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/@types/yup/-/yup-0.29.0.tgz", + "integrity": "sha512-E9RTXPD4x44qBOvY6TjUqdkR9FNV9cACWlnAsooUInDqtLZz9M9oYXKn/w1GHNxRvyYyHuG6Bfjbg3QlK+SgXw==", "dev": true }, "@typescript-eslint/eslint-plugin": { diff --git a/package.json b/package.json index bb95dc980e..b76c1ef68d 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "@types/react-router-dom": "^5.1.5", "@types/react-truncate": "^2.3.3", "@types/styled-components": "^5.1.0", - "@types/yup": "^0.28.3", + "@types/yup": "^0.29.0", "axios-mock-adapter": "^1.18.1", "cypress": "^4.5.0", "faker": "^4.1.0", From fdcc5e8151ed547fd41eb29666a35395fc76c4cd Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 21 May 2020 11:18:56 +0200 Subject: [PATCH 042/100] Bump cypress from 4.5.0 to 4.6.0 (#696) Bumps [cypress](https://github.com/cypress-io/cypress) from 4.5.0 to 4.6.0. - [Release notes](https://github.com/cypress-io/cypress/releases) - [Commits](https://github.com/cypress-io/cypress/compare/v4.5.0...v4.6.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 84 +++++------------------------------------------ package.json | 2 +- 2 files changed, 9 insertions(+), 77 deletions(-) diff --git a/package-lock.json b/package-lock.json index df13f6e5a7..2797118fca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4388,34 +4388,6 @@ "@babel/types": "^7.3.0" } }, - "@types/blob-util": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@types/blob-util/-/blob-util-1.3.3.tgz", - "integrity": "sha512-4ahcL/QDnpjWA2Qs16ZMQif7HjGP2cw3AGjHabybjw7Vm1EKu+cfQN1D78BaZbS1WJNa1opSMF5HNMztx7lR0w==", - "dev": true - }, - "@types/bluebird": { - "version": "3.5.29", - "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.29.tgz", - "integrity": "sha512-kmVtnxTuUuhCET669irqQmPAez4KFnFVKvpleVRyfC3g+SHD1hIkFZcWLim9BVcwUBLO59o8VZE4yGCmTif8Yw==", - "dev": true - }, - "@types/chai": { - "version": "4.2.7", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.7.tgz", - "integrity": "sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g==", - "dev": true - }, - "@types/chai-jquery": { - "version": "1.1.40", - "resolved": "https://registry.npmjs.org/@types/chai-jquery/-/chai-jquery-1.1.40.tgz", - "integrity": "sha512-mCNEZ3GKP7T7kftKeIs7QmfZZQM7hslGSpYzKbOlR2a2HCFf9ph4nlMRA9UnuOETeOQYJVhJQK7MwGqNZVyUtQ==", - "dev": true, - "requires": { - "@types/chai": "*", - "@types/jquery": "*" - } - }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", @@ -4541,37 +4513,16 @@ } } }, - "@types/jquery": { - "version": "3.3.31", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.3.31.tgz", - "integrity": "sha512-Lz4BAJihoFw5nRzKvg4nawXPzutkv7wmfQ5121avptaSIXlDNJCUuxZxX/G+9EVidZGuO0UBlk+YjKbwRKJigg==", - "dev": true, - "requires": { - "@types/sizzle": "*" - } - }, "@types/json-schema": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz", "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==" }, - "@types/lodash": { - "version": "4.14.149", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.149.tgz", - "integrity": "sha512-ijGqzZt/b7BfzcK9vTrS6MFljQRPn5BFWOx8oE0GYxribu6uV+aA9zZuXI1zc/etK9E8nrgdoF2+LgUw7+9tJQ==", - "dev": true - }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" }, - "@types/mocha": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", - "dev": true - }, "@types/node": { "version": "14.0.4", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.4.tgz", @@ -4669,22 +4620,12 @@ "@types/react": "*" } }, - "@types/sinon": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-7.5.1.tgz", - "integrity": "sha512-EZQUP3hSZQyTQRfiLqelC9NMWd1kqLcmQE0dMiklxBkgi84T+cHOhnKpgk4NnOWpGX863yE6+IaGnOXUNFqDnQ==", + "@types/sinonjs__fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.1.tgz", + "integrity": "sha512-yYezQwGWty8ziyYLdZjwxyMb0CZR49h8JALHGrxjQHWlqGgc8kLdHEgWrgL0uZ29DMvEVBDnHU2Wg36zKSIUtA==", "dev": true }, - "@types/sinon-chai": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.3.tgz", - "integrity": "sha512-TOUFS6vqS0PVL1I8NGVSNcFaNJtFoyZPXZ5zur+qlhDfOmQECZZM4H4kKgca6O8L+QceX/ymODZASfUfn+y4yQ==", - "dev": true, - "requires": { - "@types/chai": "*", - "@types/sinon": "*" - } - }, "@types/sizzle": { "version": "2.3.2", "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.2.tgz", @@ -8648,24 +8589,15 @@ "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=" }, "cypress": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-4.5.0.tgz", - "integrity": "sha512-2A4g5FW5d2fHzq8HKUGAMVTnW6P8nlWYQALiCoGN4bqBLvgwhYM/oG9oKc2CS6LnvgHFiKivKzpm9sfk3uU3zQ==", + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-4.6.0.tgz", + "integrity": "sha512-vIPXAceRP+Nxvnm/O9ruY9EQaRGmVVybtk9F1sfC9mH3067YbitrdBTynaaLuHFj90p9e0U2ZCV7OkX4x4V/Wg==", "dev": true, "requires": { "@cypress/listr-verbose-renderer": "0.4.1", "@cypress/request": "2.88.5", "@cypress/xvfb": "1.2.4", - "@types/blob-util": "1.3.3", - "@types/bluebird": "3.5.29", - "@types/chai": "4.2.7", - "@types/chai-jquery": "1.1.40", - "@types/jquery": "3.3.31", - "@types/lodash": "4.14.149", - "@types/minimatch": "3.0.3", - "@types/mocha": "5.2.7", - "@types/sinon": "7.5.1", - "@types/sinon-chai": "3.2.3", + "@types/sinonjs__fake-timers": "6.0.1", "@types/sizzle": "2.3.2", "arch": "2.1.1", "bluebird": "3.7.2", diff --git a/package.json b/package.json index b76c1ef68d..8d03a7b7af 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "@types/styled-components": "^5.1.0", "@types/yup": "^0.29.0", "axios-mock-adapter": "^1.18.1", - "cypress": "^4.5.0", + "cypress": "^4.6.0", "faker": "^4.1.0", "husky": "^4.2.5", "nyc": "^15.0.1", From d6d5e38cf72a02c98df9efac09390263afae3aef Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 21 May 2020 13:07:39 +0200 Subject: [PATCH 043/100] Bump typescript from 3.8.3 to 3.9.3 (#689) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump typescript from 3.8.3 to 3.9.3 Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.8.3 to 3.9.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v3.8.3...v3.9.3) Signed-off-by: dependabot-preview[bot] * Ensure correct type Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Kjetil Møkkelgjerd --- package-lock.json | 6 +++--- package.json | 2 +- src/utils/formik-helpers.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2797118fca..87ddea07f7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21820,9 +21820,9 @@ } }, "typescript": { - "version": "3.8.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.8.3.tgz", - "integrity": "sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==", + "version": "3.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.3.tgz", + "integrity": "sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==", "dev": true }, "umd": { diff --git a/package.json b/package.json index 8d03a7b7af..f90488ea63 100644 --- a/package.json +++ b/package.json @@ -96,6 +96,6 @@ "pretty-quick": "^2.0.1", "start-server-and-test": "^1.11.0", "ts-node": "^8.10.1", - "typescript": "^3.8.3" + "typescript": "^3.9.3" } } diff --git a/src/utils/formik-helpers.ts b/src/utils/formik-helpers.ts index b0d79f67d2..9f2d49f733 100644 --- a/src/utils/formik-helpers.ts +++ b/src/utils/formik-helpers.ts @@ -37,7 +37,7 @@ export const flattenFormikErrors = ( } return { fieldName: fieldPath, - errorMessage, + errorMessage: errorMessage as string, }; }) .flat(); From 70bd3fc0d444a879c77e9517967213f1055eaddb Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 May 2020 08:01:00 +0200 Subject: [PATCH 044/100] Bump react-i18next from 11.4.0 to 11.5.0 (#706) Bumps [react-i18next](https://github.com/i18next/react-i18next) from 11.4.0 to 11.5.0. - [Release notes](https://github.com/i18next/react-i18next/releases) - [Changelog](https://github.com/i18next/react-i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/react-i18next/compare/v11.4.0...v11.5.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 87ddea07f7..194ac03d6c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19112,9 +19112,9 @@ "integrity": "sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==" }, "react-i18next": { - "version": "11.4.0", - "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-11.4.0.tgz", - "integrity": "sha512-lyOZSSQkif4H9HnHN3iEKVkryLI+WkdZSEw3VAZzinZLopfYRMHVY5YxCopdkXPLEHs6S5GjKYPh3+j0j336Fg==", + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-11.5.0.tgz", + "integrity": "sha512-V6rUT7MzYBdFCgUrhfr78FHRfnY3CFoR75ET9EP5Py5UPHKyaGiK1MvPx03TesLwsmIaVHlRFU/WLzqCedXevA==", "requires": { "@babel/runtime": "^7.3.1", "html-parse-stringify2": "2.0.1" diff --git a/package.json b/package.json index f90488ea63..7c707d6758 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "i18next-browser-languagedetector": "^4.2.0", "react": "^16.13.1", "react-dom": "^16.13.1", - "react-i18next": "^11.4.0", + "react-i18next": "^11.5.0", "react-redux": "^7.2.0", "react-router-dom": "^5.1.2", "react-scripts": "3.4.1", From e518f5277068502ea10242399da7f9350f085042 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 May 2020 08:01:26 +0200 Subject: [PATCH 045/100] Bump yup from 0.28.5 to 0.29.0 (#702) Bumps [yup](https://github.com/jquense/yup) from 0.28.5 to 0.29.0. - [Release notes](https://github.com/jquense/yup/releases) - [Changelog](https://github.com/jquense/yup/blob/master/CHANGELOG.md) - [Commits](https://github.com/jquense/yup/compare/v0.28.5...v0.29.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 194ac03d6c..b3e83ae202 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25033,9 +25033,9 @@ "dev": true }, "yup": { - "version": "0.28.5", - "resolved": "https://registry.npmjs.org/yup/-/yup-0.28.5.tgz", - "integrity": "sha512-7JZcvpUGUxMKoaEtcoMEM8lCWRaueGNH/A3EhL/UWqfbFm3uloiI+x59Yq4nzhbbYWUTwAsCteaZOJ+VbqI1uw==", + "version": "0.29.0", + "resolved": "https://registry.npmjs.org/yup/-/yup-0.29.0.tgz", + "integrity": "sha512-rXPkxhMIVPsQ6jZXPRcO+nc+AIT+BBo3012pmiEos2RSrPxAq1LyspZyK7l14ahcXuiKQnEHI0H5bptI47v5Tw==", "requires": { "@babel/runtime": "^7.9.6", "fn-name": "~3.0.0", diff --git a/package.json b/package.json index 7c707d6758..c3761d14bd 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "redux-devtools-extension": "^2.13.8", "redux-thunk": "^2.3.0", "styled-components": "^5.1.0", - "yup": "^0.28.5" + "yup": "^0.29.0" }, "scripts": { "start": "react-scripts -r @cypress/instrument-cra start", From dce895d82ab7cee1d03277ed9a13847ce768584a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 May 2020 08:01:54 +0200 Subject: [PATCH 046/100] Bump @types/node from 14.0.4 to 14.0.5 (#703) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.0.4 to 14.0.5. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b3e83ae202..9746b954f0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4524,9 +4524,9 @@ "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" }, "@types/node": { - "version": "14.0.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.4.tgz", - "integrity": "sha512-k3NqigXWRzQZVBDS5D1U70A5E8Qk4Kh+Ha/x4M8Bt9pF0X05eggfnC9+63Usc9Q928hRUIpIhTQaXsZwZBl4Ew==" + "version": "14.0.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.5.tgz", + "integrity": "sha512-90hiq6/VqtQgX8Sp0EzeIsv3r+ellbGj4URKj5j30tLlZvRUpnAe9YbYnjl3pJM93GyXU0tghHhvXHq+5rnCKA==" }, "@types/parse-json": { "version": "4.0.0", diff --git a/package.json b/package.json index c3761d14bd..601977138f 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "@cypress/instrument-cra": "^1.1.1", "@istanbuljs/nyc-config-typescript": "^1.0.1", "@types/jest": "^25.2.1", - "@types/node": "^14.0.4", + "@types/node": "^14.0.5", "@types/react": "^16.9.35", "@types/react-dom": "^16.9.8", "@types/react-redux": "^7.1.9", From 0fbe1c23c0f535b032a86ce564aa437a042aa42a Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 May 2020 08:07:12 +0200 Subject: [PATCH 047/100] Bump @material-ui/lab from 4.0.0-alpha.53 to 4.0.0-alpha.54 (#709) Bumps [@material-ui/lab](https://github.com/mui-org/material-ui/tree/HEAD/packages/material-ui-lab) from 4.0.0-alpha.53 to 4.0.0-alpha.54. - [Release notes](https://github.com/mui-org/material-ui/releases) - [Changelog](https://github.com/mui-org/material-ui/blob/master/CHANGELOG.md) - [Commits](https://github.com/mui-org/material-ui/commits/HEAD/packages/material-ui-lab) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9746b954f0..822978f79d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4104,9 +4104,9 @@ } }, "@material-ui/lab": { - "version": "4.0.0-alpha.53", - "resolved": "https://registry.npmjs.org/@material-ui/lab/-/lab-4.0.0-alpha.53.tgz", - "integrity": "sha512-D2lNbMj6ZcTCbI9yPnlhGW6D/STI2RRTdXFXCKrfWGAFWV27xevNlLNwBuk++mQ5TH9mcJAMI24ej15ztOZXCQ==", + "version": "4.0.0-alpha.54", + "resolved": "https://registry.npmjs.org/@material-ui/lab/-/lab-4.0.0-alpha.54.tgz", + "integrity": "sha512-BK/z+8xGPQoMtG6gWKyagCdYO1/2DzkBchvvXs2bbTVh3sbi/QQLIqWV6UA1KtMVydYVt22NwV3xltgPkaPKLg==", "requires": { "@babel/runtime": "^7.4.4", "@material-ui/utils": "^4.9.6", diff --git a/package.json b/package.json index 601977138f..9e54123f07 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "@date-io/date-fns": "^1.3.13", "@material-ui/core": "^4.9.13", "@material-ui/icons": "^4.9.1", - "@material-ui/lab": "^4.0.0-alpha.53", + "@material-ui/lab": "^4.0.0-alpha.54", "@material-ui/pickers": "^3.2.10", "@material-ui/styles": "^4.9.13", "@uppy/aws-s3-multipart": "^1.6.4", From e025beb3ab5687a9a66db0fb7efd75e1820b10d6 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 May 2020 09:04:32 +0200 Subject: [PATCH 048/100] Bump @material-ui/core from 4.9.13 to 4.10.0 (#704) Bumps [@material-ui/core](https://github.com/mui-org/material-ui/tree/HEAD/packages/material-ui) from 4.9.13 to 4.10.0. - [Release notes](https://github.com/mui-org/material-ui/releases) - [Changelog](https://github.com/mui-org/material-ui/blob/master/CHANGELOG.md) - [Commits](https://github.com/mui-org/material-ui/commits/v4.10.0/packages/material-ui) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 78 ++++++++++++++++++++++++++++++++--------------- package.json | 2 +- 2 files changed, 54 insertions(+), 26 deletions(-) diff --git a/package-lock.json b/package-lock.json index 822978f79d..25f8428555 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4064,15 +4064,14 @@ } }, "@material-ui/core": { - "version": "4.9.13", - "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.9.13.tgz", - "integrity": "sha512-GEXNwUr+laZ0N+F1efmHB64Fyg+uQIRXLqbSejg3ebSXgLYNpIjnMOPRfWdu4rICq0dAIgvvNXGkKDMcf3AMpA==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@material-ui/core/-/core-4.10.0.tgz", + "integrity": "sha512-yVlHe4b8AaoiTHhCOZeszHZ+T2iHU5DncdMGeNcQaaaO+q/Qrq0hxP3iFzTbgjRWnWwftEVQL668GRxcPJVRaQ==", "requires": { "@babel/runtime": "^7.4.4", - "@material-ui/react-transition-group": "^4.3.0", - "@material-ui/styles": "^4.9.13", - "@material-ui/system": "^4.9.13", - "@material-ui/types": "^5.0.1", + "@material-ui/styles": "^4.10.0", + "@material-ui/system": "^4.9.14", + "@material-ui/types": "^5.1.0", "@material-ui/utils": "^4.9.12", "@types/react-transition-group": "^4.2.0", "clsx": "^1.0.4", @@ -4080,9 +4079,37 @@ "popper.js": "^1.16.1-lts", "prop-types": "^15.7.2", "react-is": "^16.8.0", - "react-transition-group": "^4.3.0" + "react-transition-group": "^4.4.0" }, "dependencies": { + "@material-ui/styles": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.10.0.tgz", + "integrity": "sha512-XPwiVTpd3rlnbfrgtEJ1eJJdFCXZkHxy8TrdieaTvwxNYj42VnnCyFzxYeNW9Lhj4V1oD8YtQ6S5Gie7bZDf7Q==", + "requires": { + "@babel/runtime": "^7.4.4", + "@emotion/hash": "^0.8.0", + "@material-ui/types": "^5.1.0", + "@material-ui/utils": "^4.9.6", + "clsx": "^1.0.4", + "csstype": "^2.5.2", + "hoist-non-react-statics": "^3.3.2", + "jss": "^10.0.3", + "jss-plugin-camel-case": "^10.0.3", + "jss-plugin-default-unit": "^10.0.3", + "jss-plugin-global": "^10.0.3", + "jss-plugin-nested": "^10.0.3", + "jss-plugin-props-sort": "^10.0.3", + "jss-plugin-rule-value-function": "^10.0.3", + "jss-plugin-vendor-prefixer": "^10.0.3", + "prop-types": "^15.7.2" + } + }, + "@material-ui/types": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@material-ui/types/-/types-5.1.0.tgz", + "integrity": "sha512-7cqRjrY50b8QzRSYyhSpx4WRw2YuO0KKIGQEVk5J8uoz2BanawykgZGoWEqKm7pVIbzFDN0SpPcVV4IhOFkl8A==" + }, "@material-ui/utils": { "version": "4.9.12", "resolved": "https://registry.npmjs.org/@material-ui/utils/-/utils-4.9.12.tgz", @@ -4092,6 +4119,17 @@ "prop-types": "^15.7.2", "react-is": "^16.8.0" } + }, + "react-transition-group": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-4.4.1.tgz", + "integrity": "sha512-Djqr7OQ2aPUiYurhPalTrVy9ddmFCCzwhqQmtN+J3+3DzLO209Fdr70QrN8Z3DsglWql6iY1lDWAfpFiBtuKGw==", + "requires": { + "@babel/runtime": "^7.5.5", + "dom-helpers": "^5.0.1", + "loose-envify": "^1.4.0", + "prop-types": "^15.6.2" + } } } }, @@ -4128,17 +4166,6 @@ "rifm": "^0.7.0" } }, - "@material-ui/react-transition-group": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@material-ui/react-transition-group/-/react-transition-group-4.3.0.tgz", - "integrity": "sha512-CwQ0aXrlUynUTY6sh3UvKuvye1o92en20VGAs6TORnSxUYeRmkX8YeTUN3lAkGiBX1z222FxLFO36WWh6q73rQ==", - "requires": { - "@babel/runtime": "^7.5.5", - "dom-helpers": "^5.0.1", - "loose-envify": "^1.4.0", - "prop-types": "^15.6.2" - } - }, "@material-ui/styles": { "version": "4.9.13", "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.9.13.tgz", @@ -4163,12 +4190,13 @@ } }, "@material-ui/system": { - "version": "4.9.13", - "resolved": "https://registry.npmjs.org/@material-ui/system/-/system-4.9.13.tgz", - "integrity": "sha512-6AlpvdW6KJJ5bF1Xo2OD13sCN8k+nlL36412/bWnWZOKIfIMo/Lb8c8d1DOIaT/RKWxTEUaWnKZjabVnA3eZjA==", + "version": "4.9.14", + "resolved": "https://registry.npmjs.org/@material-ui/system/-/system-4.9.14.tgz", + "integrity": "sha512-oQbaqfSnNlEkXEziDcJDDIy8pbvwUmZXWNqlmIwDqr/ZdCK8FuV3f4nxikUh7hvClKV2gnQ9djh5CZFTHkZj3w==", "requires": { "@babel/runtime": "^7.4.4", "@material-ui/utils": "^4.9.6", + "csstype": "^2.5.2", "prop-types": "^15.7.2" } }, @@ -4604,9 +4632,9 @@ } }, "@types/react-transition-group": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.2.4.tgz", - "integrity": "sha512-8DMUaDqh0S70TjkqU0DxOu80tFUiiaS9rxkWip/nb7gtvAsbqOXm02UCmR8zdcjWujgeYPiPNTVpVpKzUDotwA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.0.tgz", + "integrity": "sha512-/QfLHGpu+2fQOqQaXh8MG9q03bFENooTb/it4jr5kKaZlDQfWvjqWZg48AwzPVMBHlRuTRAY7hRHCEOXz5kV6w==", "requires": { "@types/react": "*" } diff --git a/package.json b/package.json index 9e54123f07..cdeecc9adb 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@date-io/date-fns": "^1.3.13", - "@material-ui/core": "^4.9.13", + "@material-ui/core": "^4.10.0", "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.54", "@material-ui/pickers": "^3.2.10", From 916fde6a73aef98f5e153a79167d919e6e0b0d46 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 May 2020 09:25:19 +0200 Subject: [PATCH 049/100] Bump @material-ui/styles from 4.9.13 to 4.10.0 (#707) Bumps [@material-ui/styles](https://github.com/mui-org/material-ui/tree/HEAD/packages/material-ui-styles) from 4.9.13 to 4.10.0. - [Release notes](https://github.com/mui-org/material-ui/releases) - [Changelog](https://github.com/mui-org/material-ui/blob/master/CHANGELOG.md) - [Commits](https://github.com/mui-org/material-ui/commits/v4.10.0/packages/material-ui-styles) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 25f8428555..6c5657ca2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4167,13 +4167,13 @@ } }, "@material-ui/styles": { - "version": "4.9.13", - "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.9.13.tgz", - "integrity": "sha512-lWlXJanBdHQ18jW/yphedRokHcvZD1GdGzUF/wQxKDsHwDDfO45ZkAxuSBI202dG+r1Ph483Z3pFykO2obeSRA==", + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.10.0.tgz", + "integrity": "sha512-XPwiVTpd3rlnbfrgtEJ1eJJdFCXZkHxy8TrdieaTvwxNYj42VnnCyFzxYeNW9Lhj4V1oD8YtQ6S5Gie7bZDf7Q==", "requires": { "@babel/runtime": "^7.4.4", "@emotion/hash": "^0.8.0", - "@material-ui/types": "^5.0.1", + "@material-ui/types": "^5.1.0", "@material-ui/utils": "^4.9.6", "clsx": "^1.0.4", "csstype": "^2.5.2", @@ -4201,9 +4201,9 @@ } }, "@material-ui/types": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@material-ui/types/-/types-5.0.1.tgz", - "integrity": "sha512-wURPSY7/3+MAtng3i26g+WKwwNE3HEeqa/trDBR5+zWKmcjO+u9t7Npu/J1r+3dmIa/OeziN9D/18IrBKvKffw==" + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@material-ui/types/-/types-5.1.0.tgz", + "integrity": "sha512-7cqRjrY50b8QzRSYyhSpx4WRw2YuO0KKIGQEVk5J8uoz2BanawykgZGoWEqKm7pVIbzFDN0SpPcVV4IhOFkl8A==" }, "@material-ui/utils": { "version": "4.9.6", diff --git a/package.json b/package.json index cdeecc9adb..dae29668d6 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "@material-ui/icons": "^4.9.1", "@material-ui/lab": "^4.0.0-alpha.54", "@material-ui/pickers": "^3.2.10", - "@material-ui/styles": "^4.9.13", + "@material-ui/styles": "^4.10.0", "@uppy/aws-s3-multipart": "^1.6.4", "@uppy/core": "^1.10.4", "@uppy/dashboard": "^1.8.5", From 4d4674df9b1c310074e99e86b8e2155eec782e1a Mon Sep 17 00:00:00 2001 From: sarahse Date: Mon, 25 May 2020 10:16:15 +0200 Subject: [PATCH 050/100] show more info on public publication (#694) --- src/components/LabelContentRow.tsx | 3 +- .../public_publication/PublicPublication.tsx | 45 +++++++++++-------- src/translations/en/common.json | 3 +- src/translations/en/publication.json | 1 + src/translations/nb/common.json | 3 +- src/translations/nb/publication.json | 1 + 6 files changed, 35 insertions(+), 21 deletions(-) diff --git a/src/components/LabelContentRow.tsx b/src/components/LabelContentRow.tsx index 64ea5b083b..f9ed27d3f7 100644 --- a/src/components/LabelContentRow.tsx +++ b/src/components/LabelContentRow.tsx @@ -7,12 +7,13 @@ const StyledRow = styled.div` display: flex; flex-wrap: wrap; font-size: 0.8rem; + align-items: center; `; const StyledLabel = styled(({ minimal: boolean, ...props }) => )` display: inline-block; font-weight: bold; - ${({ minimal }) => (minimal ? `padding-right: 1rem;` : `min-width: 17rem;`)} + ${({ minimal }) => (minimal ? `width: 10rem;` : `min-width: 17rem;`)} `; const StyledSingleRowContainer = styled(NormalText)` diff --git a/src/pages/publication/public_publication/PublicPublication.tsx b/src/pages/publication/public_publication/PublicPublication.tsx index 50df9905ad..2d86bd7345 100644 --- a/src/pages/publication/public_publication/PublicPublication.tsx +++ b/src/pages/publication/public_publication/PublicPublication.tsx @@ -81,11 +81,7 @@ const StyledTextDescription = styled(NormalText)` const StyledTag = styled.div` display: inline; - margin-left: 1rem; -`; - -const StyledTagContainer = styled.div` - align-items: center; + margin-right: 1rem; `; const PublicPublication: FC = () => { @@ -100,7 +96,7 @@ const PublicPublication: FC = () => { description, mainTitle, npiSubjectHeading, - reference: { doi, publicationContext }, + reference: { doi, publicationContext, publicationInstance }, series, tags, } = publication ? publication.entityDescription : emptyPublication.entityDescription; @@ -129,13 +125,6 @@ const PublicPublication: FC = () => {
)} - - - {date.year} - {date.month && `-${date.month}`} - {date.day && `-${date.day}`} - - {doi && ( @@ -156,18 +145,38 @@ const PublicPublication: FC = () => { )} {tags && ( - - {`${t('description.tags')}:`} + {tags.map((tag) => ( ))} - + )} {publicationContext && ( - - {publicationContext.title} + + {publicationContext.title} + {publicationContext?.onlineIssn && `${t('references.issn')} ${publicationContext.onlineIssn}`} + + )} + {publicationInstance && ( + + {publicationInstance?.volume && `${t('references.volume')} ${publicationInstance.volume}`} + {publicationInstance?.issue && `, ${t('references.issue')} ${publicationInstance.issue}`} + {publicationInstance?.pages?.begin && + publicationInstance?.pages?.end && + `, ${t('references.pages')} ${publicationInstance.pages.begin}-${ + publicationInstance.pages.end + }`} + {publicationInstance?.articleNumber && + `, ${t('references.article_number')} ${publicationInstance.articleNumber}`} + + )} + {date && ( + + {date.year} + {date.month && `-${date.month}`} + {date.day && `-${date.day}`} )} {npiSubjectHeading && ( diff --git a/src/translations/en/common.json b/src/translations/en/common.json index ed3a448735..ebac14557e 100644 --- a/src/translations/en/common.json +++ b/src/translations/en/common.json @@ -8,10 +8,11 @@ "create": "Create", "create_authority": "Create author ID", "create_doi": "Create DOI", - "description_create_authority": "Personregisteret inneholder personer med opphavsrett til publiserte vitenskapelige arbeid som er tilgjengelig i institusjonens bibliotek, vitenarkiv eller er del av Norsk Vitenskapsindeks. Også omtalte personer kan bli registrert.\n\nOm personen du søker har publisert noe vitenskapelig tidligere, eller har nylig fullført en vitenskapelig grad ved en norsk utdanningsinstitusjon, så er det sannsynlig at personen alt er registrert.\n\nEn kurator vil prøve å finne ut om dette er en ny person eller om det er en ny skrivemåte på en tidligere registrert person.", "date": "Date", + "description_create_authority": "Personregisteret inneholder personer med opphavsrett til publiserte vitenskapelige arbeid som er tilgjengelig i institusjonens bibliotek, vitenarkiv eller er del av Norsk Vitenskapsindeks. Også omtalte personer kan bli registrert.\n\nOm personen du søker har publisert noe vitenskapelig tidligere, eller har nylig fullført en vitenskapelig grad ved en norsk utdanningsinstitusjon, så er det sannsynlig at personen alt er registrert.\n\nEn kurator vil prøve å finne ut om dette er en ny person eller om det er en ny skrivemåte på en tidligere registrert person.", "delete": "Delete", "delivered_by": "Delivered by", + "details": "Details", "do_not_show_again": "Do not show this again", "download": "Download", "edit": "Edit", diff --git a/src/translations/en/publication.json b/src/translations/en/publication.json index 60f1e9c69d..c843d4185c 100644 --- a/src/translations/en/publication.json +++ b/src/translations/en/publication.json @@ -120,6 +120,7 @@ "nvi_fail_rated_line2": "(The journal's level may be changed in the Publication Channel Registry, so the publication can ble included in NVI)", "nvi_fail_no_peer_review": "This publication can not be incuded in NVI, since it's not peer reviewed.", "or": "Or", + "pages": "Pages", "pages_from": "Pages from", "pages_to": "to", "peer_review": "Is the publication peer reviewed?", diff --git a/src/translations/nb/common.json b/src/translations/nb/common.json index 0cd84b2cb9..9374faad11 100644 --- a/src/translations/nb/common.json +++ b/src/translations/nb/common.json @@ -8,10 +8,11 @@ "create": "Opprett", "create_authority": "Opprett forfatteridentitet", "create_doi": "Opprett DOI", - "description_create_authority": "Personregisteret inneholder personer med opphavsrett til publiserte vitenskapelige arbeid som er tilgjengelig i institusjonens bibliotek, vitenarkiv eller er del av Norsk Vitenskapsindeks. Også omtalte personer kan bli registrert.\n\nOm personen du søker har publisert noe vitenskapelig tidligere, eller har nylig fullført en vitenskapelig grad ved en norsk utdanningsinstitusjon, så er det sannsynlig at personen alt er registrert.\n\nEn kurator vil prøve å finne ut om dette er en ny person eller om det er en ny skrivemåte på en tidligere registrert person.", "date": "Dato", + "description_create_authority": "Personregisteret inneholder personer med opphavsrett til publiserte vitenskapelige arbeid som er tilgjengelig i institusjonens bibliotek, vitenarkiv eller er del av Norsk Vitenskapsindeks. Også omtalte personer kan bli registrert.\n\nOm personen du søker har publisert noe vitenskapelig tidligere, eller har nylig fullført en vitenskapelig grad ved en norsk utdanningsinstitusjon, så er det sannsynlig at personen alt er registrert.\n\nEn kurator vil prøve å finne ut om dette er en ny person eller om det er en ny skrivemåte på en tidligere registrert person.", "delete": "Slett", "delivered_by": "Levert av", + "details": "Detaljer", "do_not_show_again": "Ikke vis dette igjen", "download": "Last ned", "edit": "Endre", diff --git a/src/translations/nb/publication.json b/src/translations/nb/publication.json index a0a129302b..f91ded5a4f 100644 --- a/src/translations/nb/publication.json +++ b/src/translations/nb/publication.json @@ -120,6 +120,7 @@ "nvi_fail_rated_line2": "(Tidsskriftets nivå i Kanaregisteret kan bli endret, slik at publikasjonen likevel kan inngå i NVI)", "nvi_fail_no_peer_review": "Denne publikasjonen kan ikke inngå i NVI, da den ikke er fagfellevurdert.", "or": "Eller", + "pages": "Sidetall", "pages_from": "Sidetall fra", "pages_to": "til", "peer_review": "Er publikasjonen fagfellevurdert?", From a3b8b764f5934f80291406712278d4b6ac601058 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Mon, 25 May 2020 10:19:35 +0200 Subject: [PATCH 051/100] Ensure increasing reference indexes (#699) --- .../public_publication/PublicPublicationAuthors.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/publication/public_publication/PublicPublicationAuthors.tsx b/src/pages/publication/public_publication/PublicPublicationAuthors.tsx index 0f7a5156c4..c3347c46ad 100644 --- a/src/pages/publication/public_publication/PublicPublicationAuthors.tsx +++ b/src/pages/publication/public_publication/PublicPublicationAuthors.tsx @@ -42,9 +42,10 @@ const PublicPublicationAuthors: FC = ({ contributors }) identity: { arpId, name, orcId }, email, } = contributor; - const affiliationIndexes = contributor.affiliations?.map( - (affiliation) => distinctUnits.indexOf(affiliation.id) + 1 - ); + const affiliationIndexes = contributor.affiliations + ?.map((affiliation) => distinctUnits.indexOf(affiliation.id) + 1) + .sort(); + return ( {arpId ? {name} : name} From bece50dbdeeae92c73d5ee4f8ceab603cd564a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Mon, 25 May 2020 10:28:34 +0200 Subject: [PATCH 052/100] NP-986 clean up app routes (#700) --- src/AppRoutes.tsx | 52 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/src/AppRoutes.tsx b/src/AppRoutes.tsx index 9abfd6ee4f..3bec3f5e9a 100644 --- a/src/AppRoutes.tsx +++ b/src/AppRoutes.tsx @@ -28,29 +28,51 @@ const AppRoutes: FC = () => { }> - {user.isPublisher && } - {user.isPublisher && } - {user.isPublisher && } - {user.isCurator && } - {user.isAppAdmin && } - {user.isAppAdmin && ( - - )} - {user.isInstitutionAdmin && } + + + - + - {user.isLoggedIn && } - {!user.isLoggedIn && } - - - + + {user.isLoggedIn ? ( + <> + + {user.isPublisher && } + {user.isCurator && } + {user.isAppAdmin && } + {user.isInstitutionAdmin && } + + ) : ( + + )} + + {/* NotFound must be last, otherwise it will catch all routes */} ); }; +const PublisherRoutes: FC = () => ( + <> + + + + +); + +const CuratorRoutes: FC = () => ; + +const AppAdminRoutes: FC = () => ( + <> + + + +); + +const InstitutionAdminRoutes: FC = () => ; + export default AppRoutes; From a9ca4509052f6593ea7671bf463f65e754dbd754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Mon, 25 May 2020 10:29:17 +0200 Subject: [PATCH 053/100] NP-971 Avoid error snackbar when requests are cancelled (#701) --- src/api/institutionApi.ts | 6 ++++-- src/api/publicationApi.ts | 8 +++++--- src/utils/hooks/useFetchInstitutions.tsx | 12 +++++++----- src/utils/hooks/useFetchPublication.tsx | 12 +++++++----- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/api/institutionApi.ts b/src/api/institutionApi.ts index 7b091c54a0..7a1cc73669 100644 --- a/src/api/institutionApi.ts +++ b/src/api/institutionApi.ts @@ -22,8 +22,10 @@ export const getInstitutions = async (cancelToken?: CancelToken) => { } else { return { error: i18n.t('feedback:error.get_institutions') }; } - } catch { - return { error: i18n.t('feedback:error.get_institutions') }; + } catch (error) { + if (!Axios.isCancel(error)) { + return { error: i18n.t('feedback:error.get_institutions') }; + } } }; diff --git a/src/api/publicationApi.ts b/src/api/publicationApi.ts index da318af049..748b65bed6 100644 --- a/src/api/publicationApi.ts +++ b/src/api/publicationApi.ts @@ -71,10 +71,12 @@ export const getPublication = async (id: string, cancelToken?: CancelToken) => { if (response.status === StatusCode.OK) { return response.data; } else { - return null; + return { error: i18n.t('feedback:error.get_publication') }; + } + } catch (error) { + if (!Axios.isCancel(error)) { + return { error: i18n.t('feedback:error.get_publication') }; } - } catch { - return { error: i18n.t('feedback:error.get_publication') }; } }; diff --git a/src/utils/hooks/useFetchInstitutions.tsx b/src/utils/hooks/useFetchInstitutions.tsx index d7896dea1c..ac478c9325 100644 --- a/src/utils/hooks/useFetchInstitutions.tsx +++ b/src/utils/hooks/useFetchInstitutions.tsx @@ -20,12 +20,14 @@ const useFetchInstitutions = (): [InstitutionUnitBase[], boolean] => { const fetchInstitutions = async () => { const response = await getInstitutions(cancelSource.token); - if (response?.error) { - dispatch(setNotification(response.error, NotificationVariant.Error)); - } else { - dispatch(setInstitutions(response)); + if (response) { + setIsLoading(false); + if (response.error) { + dispatch(setNotification(response.error, NotificationVariant.Error)); + } else { + dispatch(setInstitutions(response)); + } } - setIsLoading(false); }; // Institutions should not change, so ensure we fetch only once if (!institutions || institutions.length === 0) { diff --git a/src/utils/hooks/useFetchPublication.tsx b/src/utils/hooks/useFetchPublication.tsx index 24289ce683..bf2801a4e8 100644 --- a/src/utils/hooks/useFetchPublication.tsx +++ b/src/utils/hooks/useFetchPublication.tsx @@ -17,12 +17,14 @@ const useFetchPublication = (identifier: string): [Publication | undefined, bool const fetchPublication = async () => { const publication = await getPublication(identifier, cancelSource.token); - if (publication?.error) { - dispatch(setNotification(publication.error, NotificationVariant.Error)); - } else { - setPublication(publication); + if (publication) { + setIsLoading(false); + if (publication.error) { + dispatch(setNotification(publication.error, NotificationVariant.Error)); + } else { + setPublication(publication); + } } - setIsLoading(false); }; fetchPublication(); From a31ff51d079b0f3ebb17ca171041bac9670af6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Mon, 25 May 2020 11:16:54 +0200 Subject: [PATCH 054/100] Np 912 fetch user (#695) * NP-912 Initial work on fetching correct user * NP-912 Cleanup logic * NP-912 Fix public profile tests * NP-912 Handle cancellation of request * NP-912 Remove redundant null check Co-authored-by: sarahse * NP-912 Expand try blocks * NP-912 Remove placeholder for publications Co-authored-by: sarahse --- ...blic_profile.js => public_profile.spec.js} | 2 +- src/api/authorityApi.ts | 49 ++++++-- src/pages/publication/PublicProfile.tsx | 111 ++++++------------ src/utils/hooks/useFetchAuthority.tsx | 37 ++++++ 4 files changed, 113 insertions(+), 86 deletions(-) rename cypress/integration/{public_profile.js => public_profile.spec.js} (92%) create mode 100644 src/utils/hooks/useFetchAuthority.tsx diff --git a/cypress/integration/public_profile.js b/cypress/integration/public_profile.spec.js similarity index 92% rename from cypress/integration/public_profile.js rename to cypress/integration/public_profile.spec.js index 3efb061b62..251a2b74ad 100644 --- a/cypress/integration/public_profile.js +++ b/cypress/integration/public_profile.spec.js @@ -11,6 +11,6 @@ describe('User opens their Public Profile from My Publications Page', () => { // Open Public Profile cy.get('[data-testid=public-profile-button]').click({ force: true }); - cy.contains('testuser@unit.no'); + cy.url().should('include', '/profile/'); }); }); diff --git a/src/api/authorityApi.ts b/src/api/authorityApi.ts index 9223f6d047..5f9d7b3415 100644 --- a/src/api/authorityApi.ts +++ b/src/api/authorityApi.ts @@ -1,4 +1,4 @@ -import Axios from 'axios'; +import Axios, { CancelToken } from 'axios'; import { Dispatch } from 'redux'; import { setNotification } from '../redux/actions/notificationActions'; @@ -17,16 +17,40 @@ export enum AuthorityQualifiers { ORGUNIT_ID = 'orgunitid', } +export const getAuthority = async (arpId: string, cancelToken?: CancelToken) => { + const url = encodeURI(`${AuthorityApiPaths.PERSON}?arpId=${arpId}`); + + try { + // remove when Authorization headers are set for all requests + const idToken = await getIdToken(); + const headers = { + Authorization: `Bearer ${idToken}`, + }; + + const response = await Axios.get(url, { headers, cancelToken }); + + if (response.status === StatusCode.OK) { + return response.data; + } else { + return { error: i18n.t('feedback:error.get_authority') }; + } + } catch (error) { + if (!Axios.isCancel(error)) { + return { error: i18n.t('feedback:error.get_authority') }; + } + } +}; + export const getAuthorities = async (name: string, dispatch: Dispatch) => { const url = encodeURI(`${AuthorityApiPaths.PERSON}?name=${name}`); - // remove when Authorization headers are set for all requests - const idToken = await getIdToken(); - const headers = { - Authorization: `Bearer ${idToken}`, - }; - try { + // remove when Authorization headers are set for all requests + const idToken = await getIdToken(); + const headers = { + Authorization: `Bearer ${idToken}`, + }; + const response = await Axios.get(url, { headers }); if (response.status === StatusCode.OK) { @@ -42,12 +66,13 @@ export const getAuthorities = async (name: string, dispatch: Dispatch) => { export const createAuthority = async (firstName: string, lastName: string, feideId?: string) => { const url = AuthorityApiPaths.PERSON; - // remove when Authorization headers are set for all requests - const idToken = await getIdToken(); - const headers = { - Authorization: `Bearer ${idToken}`, - }; try { + // remove when Authorization headers are set for all requests + const idToken = await getIdToken(); + const headers = { + Authorization: `Bearer ${idToken}`, + }; + const response = await Axios.post(url, { invertedname: `${lastName}, ${firstName}` }, { headers }); if (response.status === StatusCode.OK) { if (feideId) { diff --git a/src/pages/publication/PublicProfile.tsx b/src/pages/publication/PublicProfile.tsx index 331081738b..d7e0c6ff07 100644 --- a/src/pages/publication/PublicProfile.tsx +++ b/src/pages/publication/PublicProfile.tsx @@ -1,26 +1,15 @@ -import React, { FC, useEffect, useState } from 'react'; -import { useDispatch, useSelector } from 'react-redux'; -import { setNotification } from '../../redux/actions/notificationActions'; -import { PublishedPublicationPreview, PublicationStatus } from '../../types/publication.types'; +import React, { FC } from 'react'; +import { useTranslation } from 'react-i18next'; import { CircularProgress } from '@material-ui/core'; import styled from 'styled-components'; -import { getMyPublications } from '../../api/publicationApi'; -import PublishedPublicationList from './PublishedPublicationList'; +import { useParams } from 'react-router-dom'; + import Card from '../../components/Card'; -import { useTranslation } from 'react-i18next'; -import { RootStore } from '../../redux/reducers/rootReducer'; -import NormalText from '../../components/NormalText'; -import { ORCID_BASE_URL } from '../../utils/constants'; import LabelTextLine from './../../components/LabelTextLine'; import Heading from '../../components/Heading'; -import { NotificationVariant } from '../../types/notification.types'; import { AffiliationHierarchy } from '../../components/institution/AffiliationHierarchy'; - -const StyledWrapper = styled.div` - text-align: center; - padding: 0.5rem; - width: 100%; -`; +import useFetchAuthority from '../../utils/hooks/useFetchAuthority'; +import { ORCID_BASE_URL } from '../../utils/constants'; const StyledUserInfo = styled.div` display: flex; @@ -31,66 +20,42 @@ const StyledUserInfo = styled.div` `; const PublicProfile: FC = () => { - const dispatch = useDispatch(); const { t } = useTranslation('profile'); - const [isLoading, setIsLoading] = useState(true); - const [publications, setPublications] = useState([]); - const user = useSelector((store: RootStore) => store.user); - - useEffect(() => { - const loadData = async () => { - setIsLoading(true); - const publications = await getMyPublications(); - if (publications?.error) { - dispatch(setNotification(t('feedback:error.get_publications'), NotificationVariant.Error)); - } else { - setPublications(publications); - } - setIsLoading(false); - }; - loadData(); - }, [dispatch, t]); - - const publishedPublications = publications.filter( - (publication) => publication.status === PublicationStatus.PUBLISHED - ); + const { arpId } = useParams(); + const [authority, isLoadingUser] = useFetchAuthority(arpId); return ( <> - - - {user.name} - {user.authority?.orgunitids && user.authority.orgunitids.length > 0 && ( - - {user.authority.orgunitids.map((unitId) => ( - - ))} - - )} - {user.authority?.orcids.map((orcid: string) => { - const orcidLink = `${ORCID_BASE_URL}/${orcid}`; - return ( - - ); - })} - - {user.email} - - - - - {isLoading ? ( - - ) : ( - - )} - + {isLoadingUser ? ( + + ) : ( + authority && ( + + + {authority.name} + {authority.orgunitids.length > 0 && ( + + {authority.orgunitids.map((unitId) => ( + + ))} + + )} + {authority.orcids.map((orcid: string) => { + const orcidLink = `${ORCID_BASE_URL}/${orcid}`; + return ( + + ); + })} + + + ) + )} ); }; diff --git a/src/utils/hooks/useFetchAuthority.tsx b/src/utils/hooks/useFetchAuthority.tsx new file mode 100644 index 0000000000..a5ca7b135d --- /dev/null +++ b/src/utils/hooks/useFetchAuthority.tsx @@ -0,0 +1,37 @@ +import { useState, useEffect } from 'react'; +import { useDispatch } from 'react-redux'; +import Axios from 'axios'; + +import { setNotification } from '../../redux/actions/notificationActions'; +import { NotificationVariant } from '../../types/notification.types'; +import { getAuthority } from '../../api/authorityApi'; +import { Authority } from '../../types/authority.types'; + +const useFetchAuthority = (arpId: string): [Authority | undefined, boolean] => { + const dispatch = useDispatch(); + const [authority, setAuthority] = useState(); + const [isLoading, setIsLoading] = useState(true); + + useEffect(() => { + const cancelSource = Axios.CancelToken.source(); + + const fetchAuthority = async () => { + const fetchedAuthority = await getAuthority(arpId, cancelSource.token); + if (fetchedAuthority) { + setIsLoading(false); + if (fetchedAuthority.error) { + dispatch(setNotification(fetchedAuthority.error, NotificationVariant.Error)); + } else { + setAuthority(fetchedAuthority); + } + } + }; + fetchAuthority(); + + return () => cancelSource.cancel(); + }, [dispatch, arpId]); + + return [authority, isLoading]; +}; + +export default useFetchAuthority; From 006d90ec106c5d7b1668e4028f84529ef57e85d9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 25 May 2020 11:52:20 +0200 Subject: [PATCH 055/100] Bump react-router-dom from 5.1.2 to 5.2.0 (#651) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump react-router-dom from 5.1.2 to 5.2.0 Bumps [react-router-dom](https://github.com/ReactTraining/react-router) from 5.1.2 to 5.2.0. - [Release notes](https://github.com/ReactTraining/react-router/releases) - [Changelog](https://github.com/ReactTraining/react-router/blob/master/CHANGELOG.md) - [Commits](https://github.com/ReactTraining/react-router/compare/v5.1.2...v5.2.0) Signed-off-by: dependabot-preview[bot] * Replace history with location Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Kjetil Møkkelgjerd --- package-lock.json | 32 +++++++++++++------------------- package.json | 2 +- src/layout/Notifier.tsx | 6 +++--- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6c5657ca2f..272d7fffe1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11183,11 +11183,6 @@ "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=" }, - "gud": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz", - "integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw==" - }, "gzip-size": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz", @@ -15933,13 +15928,12 @@ "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, "mini-create-react-context": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.3.2.tgz", - "integrity": "sha512-2v+OeetEyliMt5VHMXsBhABoJ0/M4RCe7fatd/fBy6SMiKazUSEt3gxxypfnk2SHMkdBYvorHRoQxuGoiwbzAw==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.4.0.tgz", + "integrity": "sha512-b0TytUgFSbgFJGzJqXPKCFCBWigAjpjo+Fl7Vf7ZbKRDptszpppKxXH6DRXEABZ/gcEQczeb0iZ7JvL8e8jjCA==", "requires": { - "@babel/runtime": "^7.4.0", - "gud": "^1.0.0", - "tiny-warning": "^1.0.2" + "@babel/runtime": "^7.5.5", + "tiny-warning": "^1.0.3" } }, "mini-css-extract-plugin": { @@ -19166,15 +19160,15 @@ } }, "react-router": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.1.2.tgz", - "integrity": "sha512-yjEuMFy1ONK246B+rsa0cUam5OeAQ8pyclRDgpxuSCrAlJ1qN9uZ5IgyKC7gQg0w8OM50NXHEegPh/ks9YuR2A==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.2.0.tgz", + "integrity": "sha512-smz1DUuFHRKdcJC0jobGo8cVbhO3x50tCL4icacOlcwDOEQPq4TMqwx3sY1TP+DvtTgz4nm3thuo7A+BK2U0Dw==", "requires": { "@babel/runtime": "^7.1.2", "history": "^4.9.0", "hoist-non-react-statics": "^3.1.0", "loose-envify": "^1.3.1", - "mini-create-react-context": "^0.3.0", + "mini-create-react-context": "^0.4.0", "path-to-regexp": "^1.7.0", "prop-types": "^15.6.2", "react-is": "^16.6.0", @@ -19183,15 +19177,15 @@ } }, "react-router-dom": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.1.2.tgz", - "integrity": "sha512-7BPHAaIwWpZS074UKaw1FjVdZBSVWEk8IuDXdB+OkLb8vd/WRQIpA4ag9WQk61aEfQs47wHyjWUoUGGZxpQXew==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.2.0.tgz", + "integrity": "sha512-gxAmfylo2QUjcwxI63RhQ5G85Qqt4voZpUXSEqCwykV0baaOTQDR1f0PmY8AELqIyVc0NEZUj0Gov5lNGcXgsA==", "requires": { "@babel/runtime": "^7.1.2", "history": "^4.9.0", "loose-envify": "^1.3.1", "prop-types": "^15.6.2", - "react-router": "5.1.2", + "react-router": "5.2.0", "tiny-invariant": "^1.0.2", "tiny-warning": "^1.0.0" } diff --git a/package.json b/package.json index dae29668d6..e0ca5c4684 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "react-dom": "^16.13.1", "react-i18next": "^11.5.0", "react-redux": "^7.2.0", - "react-router-dom": "^5.1.2", + "react-router-dom": "^5.2.0", "react-scripts": "3.4.1", "react-sortable-hoc": "^1.11.0", "react-truncate": "^2.4.0", diff --git a/src/layout/Notifier.tsx b/src/layout/Notifier.tsx index ff91ea280f..140314551c 100644 --- a/src/layout/Notifier.tsx +++ b/src/layout/Notifier.tsx @@ -7,7 +7,7 @@ import { removeNotification } from '../redux/actions/notificationActions'; import { RootStore } from '../redux/reducers/rootReducer'; import { NotificationVariant } from '../types/notification.types'; import { Fade } from '@material-ui/core'; -import { useHistory } from 'react-router-dom'; +import { useLocation } from 'react-router-dom'; const autoHideDuration = { [NotificationVariant.Error]: 6000, @@ -19,7 +19,7 @@ const autoHideDuration = { const Notifier: React.FC = () => { const notification = useSelector((store: RootStore) => store.notification); const dispatch = useDispatch(); - const history = useHistory(); + const location = useLocation(); const notificationRef = useRef(notification); useEffect(() => { @@ -31,7 +31,7 @@ const Notifier: React.FC = () => { if (notificationRef.current) { dispatch(removeNotification()); } - }, [dispatch, history.location.pathname]); + }, [dispatch, location.pathname]); const handleClose = (_?: React.SyntheticEvent, reason?: string) => { if (reason === 'clickaway') { From a05603f0da27c42fbe08f2248a7a8067e0fe5ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kjetil=20M=C3=B8kkelgjerd?= Date: Mon, 25 May 2020 12:22:15 +0200 Subject: [PATCH 056/100] Np 736 packages (#710) * Run npm dedupe * Run npm audit fix --- package-lock.json | 2750 ++++++++------------------------------------- 1 file changed, 445 insertions(+), 2305 deletions(-) diff --git a/package-lock.json b/package-lock.json index 272d7fffe1..44b190ebb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4082,34 +4082,6 @@ "react-transition-group": "^4.4.0" }, "dependencies": { - "@material-ui/styles": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.10.0.tgz", - "integrity": "sha512-XPwiVTpd3rlnbfrgtEJ1eJJdFCXZkHxy8TrdieaTvwxNYj42VnnCyFzxYeNW9Lhj4V1oD8YtQ6S5Gie7bZDf7Q==", - "requires": { - "@babel/runtime": "^7.4.4", - "@emotion/hash": "^0.8.0", - "@material-ui/types": "^5.1.0", - "@material-ui/utils": "^4.9.6", - "clsx": "^1.0.4", - "csstype": "^2.5.2", - "hoist-non-react-statics": "^3.3.2", - "jss": "^10.0.3", - "jss-plugin-camel-case": "^10.0.3", - "jss-plugin-default-unit": "^10.0.3", - "jss-plugin-global": "^10.0.3", - "jss-plugin-nested": "^10.0.3", - "jss-plugin-props-sort": "^10.0.3", - "jss-plugin-rule-value-function": "^10.0.3", - "jss-plugin-vendor-prefixer": "^10.0.3", - "prop-types": "^15.7.2" - } - }, - "@material-ui/types": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@material-ui/types/-/types-5.1.0.tgz", - "integrity": "sha512-7cqRjrY50b8QzRSYyhSpx4WRw2YuO0KKIGQEVk5J8uoz2BanawykgZGoWEqKm7pVIbzFDN0SpPcVV4IhOFkl8A==" - }, "@material-ui/utils": { "version": "4.9.12", "resolved": "https://registry.npmjs.org/@material-ui/utils/-/utils-4.9.12.tgz", @@ -4779,16 +4751,6 @@ "requires": { "@uppy/companion-client": "^1.4.4", "@uppy/utils": "^2.4.4" - }, - "dependencies": { - "@uppy/utils": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", - "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", - "requires": { - "lodash.throttle": "^4.1.1" - } - } } }, "@uppy/companion-client": { @@ -4832,27 +4794,6 @@ "preact": "8.2.9", "preact-css-transition-group": "^1.3.0", "resize-observer-polyfill": "^1.5.0" - }, - "dependencies": { - "@uppy/status-bar": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@uppy/status-bar/-/status-bar-1.6.5.tgz", - "integrity": "sha512-pfPjcKVOVJ/G6fuHm2ITMQwWev41AVlzWrWIyyBq9LTwzkLpJBKDu6g+AWHcDug4ji2UmIUBqEuRMyeCDVaymg==", - "requires": { - "@uppy/utils": "^2.4.4", - "classnames": "^2.2.6", - "lodash.throttle": "^4.1.1", - "preact": "8.2.9" - } - }, - "@uppy/utils": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", - "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", - "requires": { - "lodash.throttle": "^4.1.1" - } - } } }, "@uppy/drag-drop": { @@ -4862,16 +4803,6 @@ "requires": { "@uppy/utils": "^2.4.4", "preact": "8.2.9" - }, - "dependencies": { - "@uppy/utils": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", - "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", - "requires": { - "lodash.throttle": "^4.1.1" - } - } } }, "@uppy/informer": { @@ -4881,16 +4812,6 @@ "requires": { "@uppy/utils": "^2.4.4", "preact": "8.2.9" - }, - "dependencies": { - "@uppy/utils": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", - "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", - "requires": { - "lodash.throttle": "^4.1.1" - } - } } }, "@uppy/progress-bar": { @@ -4900,16 +4821,6 @@ "requires": { "@uppy/utils": "^2.4.4", "preact": "8.2.9" - }, - "dependencies": { - "@uppy/utils": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", - "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", - "requires": { - "lodash.throttle": "^4.1.1" - } - } } }, "@uppy/provider-views": { @@ -4920,16 +4831,6 @@ "@uppy/utils": "^2.4.4", "classnames": "^2.2.6", "preact": "8.2.9" - }, - "dependencies": { - "@uppy/utils": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", - "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", - "requires": { - "lodash.throttle": "^4.1.1" - } - } } }, "@uppy/react": { @@ -4943,82 +4844,17 @@ "@uppy/status-bar": "^1.6.5", "@uppy/utils": "^2.4.4", "prop-types": "^15.6.1" - }, - "dependencies": { - "@uppy/dashboard": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@uppy/dashboard/-/dashboard-1.8.5.tgz", - "integrity": "sha512-oBf7bkhtsDei1NyxuT9XcFIu/0lvWO6SXD9DGLcAYj87BwJTknZoJPud8bNsgkIunlykODhJ0RLZlG0Q6kcDIA==", - "requires": { - "@uppy/informer": "^1.5.5", - "@uppy/provider-views": "^1.6.5", - "@uppy/status-bar": "^1.6.5", - "@uppy/thumbnail-generator": "^1.5.12", - "@uppy/utils": "^2.4.4", - "classnames": "^2.2.6", - "cuid": "^2.1.1", - "is-shallow-equal": "^1.0.1", - "lodash.debounce": "^4.0.8", - "lodash.throttle": "^4.1.1", - "memoize-one": "^5.0.4", - "preact": "8.2.9", - "preact-css-transition-group": "^1.3.0", - "resize-observer-polyfill": "^1.5.0" - } - }, - "@uppy/informer": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@uppy/informer/-/informer-1.5.5.tgz", - "integrity": "sha512-eGtE/AM2fOkBQrCDV7vR4BKgZmcip48Zqm0rBgNxVnDh8a2DFpt7UbMdC4/cCob2gdCdDT4+TaVA6GHXpcKFMA==", - "requires": { - "@uppy/utils": "^2.4.4", - "preact": "8.2.9" - } - }, - "@uppy/provider-views": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@uppy/provider-views/-/provider-views-1.6.5.tgz", - "integrity": "sha512-dEhqVzPkXEW+qduIkGtfusDNbIwC2T7p2R6N2cJ/5pNeC8nZ/PLLy+6nTHLIndASdZXY4WG/dYCFAZVRfdG3YQ==", - "requires": { - "@uppy/utils": "^2.4.4", - "classnames": "^2.2.6", - "preact": "8.2.9" - } - }, - "@uppy/status-bar": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/@uppy/status-bar/-/status-bar-1.6.5.tgz", - "integrity": "sha512-pfPjcKVOVJ/G6fuHm2ITMQwWev41AVlzWrWIyyBq9LTwzkLpJBKDu6g+AWHcDug4ji2UmIUBqEuRMyeCDVaymg==", - "requires": { - "@uppy/utils": "^2.4.4", - "classnames": "^2.2.6", - "lodash.throttle": "^4.1.1", - "preact": "8.2.9" - } - }, - "@uppy/thumbnail-generator": { - "version": "1.5.12", - "resolved": "https://registry.npmjs.org/@uppy/thumbnail-generator/-/thumbnail-generator-1.5.12.tgz", - "integrity": "sha512-8D8nxTw/Pl7HRLNdLriBOVS0j+eIIVw74rAIHiQKE39nevraXzKdHyOmhRnQOKfLgYzunzu35iKX6r4yR0U/pA==", - "requires": { - "@uppy/utils": "^2.4.4", - "exifr": "^5.0.1", - "math-log2": "^1.0.1" - } - }, - "@uppy/utils": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", - "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", - "requires": { - "lodash.throttle": "^4.1.1" - } - }, - "exifr": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/exifr/-/exifr-5.0.1.tgz", - "integrity": "sha512-6Vq+IVvq7oyRSTpEDMDalzupJZs7rauXL0gZeS2yU1BSA+1fAzJCJrfRHXjMMggtUyb/hJ9m9MlLf8AtvEsrUw==" - } + } + }, + "@uppy/status-bar": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/@uppy/status-bar/-/status-bar-1.6.5.tgz", + "integrity": "sha512-pfPjcKVOVJ/G6fuHm2ITMQwWev41AVlzWrWIyyBq9LTwzkLpJBKDu6g+AWHcDug4ji2UmIUBqEuRMyeCDVaymg==", + "requires": { + "@uppy/utils": "^2.4.4", + "classnames": "^2.2.6", + "lodash.throttle": "^4.1.1", + "preact": "8.2.9" } }, "@uppy/store-default": { @@ -5034,16 +4870,6 @@ "@uppy/utils": "^2.4.4", "exifr": "^5.0.1", "math-log2": "^1.0.1" - }, - "dependencies": { - "@uppy/utils": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/@uppy/utils/-/utils-2.4.4.tgz", - "integrity": "sha512-7A0uwK5Rf8XcKqlpNUZ5L5LmkHT5c0/UWjDJGwmzeCxp2lECgzsMC+4vgA6kT4sFzPFbLtUtxHi7ecFwow3NQQ==", - "requires": { - "lodash.throttle": "^4.1.1" - } - } } }, "@uppy/utils": { @@ -5482,6 +5308,15 @@ "sprintf-js": "~1.0.2" } }, + "aria-query": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-3.0.0.tgz", + "integrity": "sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w=", + "requires": { + "ast-types-flow": "0.0.7", + "commander": "^2.11.0" + } + }, "arity-n": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/arity-n/-/arity-n-1.0.4.tgz", @@ -9886,15 +9721,6 @@ "jsx-ast-utils": "^2.2.1" }, "dependencies": { - "aria-query": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-3.0.0.tgz", - "integrity": "sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w=", - "requires": { - "ast-types-flow": "0.0.7", - "commander": "^2.11.0" - } - }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -10041,9 +9867,9 @@ "dev": true }, "eventemitter3": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz", - "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==" + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz", + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==" }, "events": { "version": "3.1.0", @@ -11544,9 +11370,9 @@ "integrity": "sha1-ksnBN0w1CF912zWexWzCV8u5P6Q=" }, "http-proxy": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.0.tgz", - "integrity": "sha512-84I2iJM/n1d4Hdgc6y2+qY5mDaz2PUVjlg9znE9byl+q0uC3DeByqBGReQu5tpLK0TAqTIXScRUV+dg7+bUPpQ==", + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "requires": { "eventemitter3": "^4.0.0", "follow-redirects": "^1.0.0", @@ -22234,2129 +22060,443 @@ } }, "fsevents": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", - "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, "optional": true, "requires": { "bindings": "^1.5.0", - "nan": "^2.12.1", - "node-pre-gyp": "*" + "nan": "^2.12.1" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" }, "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "dev": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, - "optional": true, "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" + "is-extglob": "^2.1.0" } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "optional": true, + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "watchpack": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "requires": { + "chokidar": "^2.0.2", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + }, + "dependencies": { + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "dev": true, - "optional": true - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", - "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true, - "optional": true - }, - "minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", - "dev": true, - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.3.tgz", - "integrity": "sha512-EkY0GeSq87rWp1hoq/sH/wnTWgFVhYlnIkbJ0YJFfRgEFlz2RraCjBpFQ+vrEgEdp0ThfyHADmkChEhcb7PKyw==", - "dev": true, - "optional": true, - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz", - "integrity": "sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==", - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - } - }, - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", - "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", - "dev": true, - "optional": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", - "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "dev": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "dev": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", - "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "dev": true, - "optional": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true, - "optional": true - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "dev": true, - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "dev": true, - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "dev": true, - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "watchpack": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", - "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", - "requires": { - "chokidar": "^2.0.2", - "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0" - }, - "dependencies": { - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "fsevents": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", - "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1", - "node-pre-gyp": "*" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "optional": true - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "optional": true - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "optional": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "optional": true - }, - "fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "optional": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", - "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "optional": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "optional": true - }, - "minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "optional": true, - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - }, - "needle": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.3.tgz", - "integrity": "sha512-EkY0GeSq87rWp1hoq/sH/wnTWgFVhYlnIkbJ0YJFfRgEFlz2RraCjBpFQ+vrEgEdp0ThfyHADmkChEhcb7PKyw==", - "optional": true, - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz", - "integrity": "sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==", - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - } - }, - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", - "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", - "optional": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", - "optional": true - }, - "npm-packlist": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", - "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "optional": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "optional": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "optional": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "optional": true - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "optional": true - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "optional": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "optional": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "optional": true - }, - "tar": { - "version": "4.4.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", - "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "optional": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "optional": true - } - } - }, - "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", - "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "^2.1.0" - } - } - } - }, - "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "wbuf": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", - "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", - "requires": { - "minimalistic-assert": "^1.0.0" - } - }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" - }, - "webpack": { - "version": "4.42.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.42.0.tgz", - "integrity": "sha512-EzJRHvwQyBiYrYqhyjW9AqM90dE4+s1/XtCfn7uWg6cS72zH+2VPFAlsnW0+W0cDi0XRjNKUMoJtpSi50+Ph6w==", - "requires": { - "@webassemblyjs/ast": "1.8.5", - "@webassemblyjs/helper-module-context": "1.8.5", - "@webassemblyjs/wasm-edit": "1.8.5", - "@webassemblyjs/wasm-parser": "1.8.5", - "acorn": "^6.2.1", - "ajv": "^6.10.2", - "ajv-keywords": "^3.4.1", - "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^4.1.0", - "eslint-scope": "^4.0.3", - "json-parse-better-errors": "^1.0.2", - "loader-runner": "^2.4.0", - "loader-utils": "^1.2.3", - "memory-fs": "^0.4.1", - "micromatch": "^3.1.10", - "mkdirp": "^0.5.1", - "neo-async": "^2.6.1", - "node-libs-browser": "^2.2.1", - "schema-utils": "^1.0.0", - "tapable": "^1.1.3", - "terser-webpack-plugin": "^1.4.3", - "watchpack": "^1.6.0", - "webpack-sources": "^1.4.1" - }, - "dependencies": { - "acorn": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", - "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==" - }, - "cacache": { - "version": "12.0.4", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", - "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", - "requires": { - "bluebird": "^3.5.5", - "chownr": "^1.1.1", - "figgy-pudding": "^3.5.1", - "glob": "^7.1.4", - "graceful-fs": "^4.1.15", - "infer-owner": "^1.0.3", - "lru-cache": "^5.1.1", - "mississippi": "^3.0.0", - "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", - "rimraf": "^2.6.3", - "ssri": "^6.0.1", - "unique-filename": "^1.1.1", - "y18n": "^4.0.0" - } - }, - "eslint-scope": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", - "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - } - }, - "schema-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", - "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", - "requires": { - "ajv": "^6.1.0", - "ajv-errors": "^1.0.0", - "ajv-keywords": "^3.1.0" - } - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" - }, - "ssri": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", - "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", - "requires": { - "figgy-pudding": "^3.5.1" - } - }, - "terser-webpack-plugin": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz", - "integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==", - "requires": { - "cacache": "^12.0.2", - "find-cache-dir": "^2.1.0", - "is-wsl": "^1.1.0", - "schema-utils": "^1.0.0", - "serialize-javascript": "^2.1.2", - "source-map": "^0.6.1", - "terser": "^4.1.2", - "webpack-sources": "^1.4.0", - "worker-farm": "^1.7.0" - } - } - } - }, - "webpack-dev-middleware": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.2.tgz", - "integrity": "sha512-1xC42LxbYoqLNAhV6YzTYacicgMZQTqRd27Sim9wn5hJrX3I5nxYy1SxSd4+gjUFsz1dQFj+yEe6zEVmSkeJjw==", - "requires": { - "memory-fs": "^0.4.1", - "mime": "^2.4.4", - "mkdirp": "^0.5.1", - "range-parser": "^1.2.1", - "webpack-log": "^2.0.0" - } - }, - "webpack-dev-server": { - "version": "3.10.3", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.10.3.tgz", - "integrity": "sha512-e4nWev8YzEVNdOMcNzNeCN947sWJNd43E5XvsJzbAL08kGc2frm1tQ32hTJslRS+H65LCb/AaUCYU7fjHCpDeQ==", - "requires": { - "ansi-html": "0.0.7", - "bonjour": "^3.5.0", - "chokidar": "^2.1.8", - "compression": "^1.7.4", - "connect-history-api-fallback": "^1.6.0", - "debug": "^4.1.1", - "del": "^4.1.1", - "express": "^4.17.1", - "html-entities": "^1.2.1", - "http-proxy-middleware": "0.19.1", - "import-local": "^2.0.0", - "internal-ip": "^4.3.0", - "ip": "^1.1.5", - "is-absolute-url": "^3.0.3", - "killable": "^1.0.1", - "loglevel": "^1.6.6", - "opn": "^5.5.0", - "p-retry": "^3.0.1", - "portfinder": "^1.0.25", - "schema-utils": "^1.0.0", - "selfsigned": "^1.10.7", - "semver": "^6.3.0", - "serve-index": "^1.9.1", - "sockjs": "0.3.19", - "sockjs-client": "1.4.0", - "spdy": "^4.0.1", - "strip-ansi": "^3.0.1", - "supports-color": "^6.1.0", - "url": "^0.11.0", - "webpack-dev-middleware": "^3.7.2", - "webpack-log": "^2.0.0", - "ws": "^6.2.1", - "yargs": "12.0.5" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" - }, - "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", - "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "cliui": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", - "requires": { - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0", - "wrap-ansi": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, - "debug": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", - "requires": { - "ms": "^2.1.1" - } - }, - "fsevents": { - "version": "1.2.12", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.12.tgz", - "integrity": "sha512-Ggd/Ktt7E7I8pxZRbGIs7vwqAPscSESMrCSkx2FtWeqmheJgCo2R74fTsZFCifr0VTPwqRpPv17+6b8Zp7th0Q==", - "optional": true, - "requires": { - "bindings": "^1.5.0", - "nan": "^2.12.1", - "node-pre-gyp": "*" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "optional": true - }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "optional": true - }, - "debug": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", - "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "optional": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "optional": true - }, - "fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", - "optional": true, - "requires": { - "minipass": "^2.6.0" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "optional": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", - "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "optional": true - }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "optional": true - }, - "minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", - "optional": true, - "requires": { - "minipass": "^2.9.0" - } - }, - "mkdirp": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.3.tgz", - "integrity": "sha512-P+2gwrFqx8lhew375MQHHeTlY8AuOJSrGf0R5ddkEndUkmwpgUob/vQuBD1V22/Cw1/lJr4x+EjllSezBThzBg==", - "optional": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "optional": true - }, - "needle": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.3.tgz", - "integrity": "sha512-EkY0GeSq87rWp1hoq/sH/wnTWgFVhYlnIkbJ0YJFfRgEFlz2RraCjBpFQ+vrEgEdp0ThfyHADmkChEhcb7PKyw==", - "optional": true, - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.14.0.tgz", - "integrity": "sha512-+CvDC7ZttU/sSt9rFjix/P05iS43qHCOOGzcr3Ry99bXG7VX953+vFyEuph/tfqoYu8dttBkE86JSKBO2OzcxA==", - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4.4.2" - } - }, - "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", - "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", - "optional": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", - "optional": true - }, - "npm-packlist": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", - "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "optional": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "optional": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "optional": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "optional": true - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "optional": true - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "optional": true - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", - "optional": true - }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" + "is-extglob": "^2.1.0" } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "wbuf": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.3.tgz", + "integrity": "sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==", + "requires": { + "minimalistic-assert": "^1.0.0" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" + }, + "webpack": { + "version": "4.42.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.42.0.tgz", + "integrity": "sha512-EzJRHvwQyBiYrYqhyjW9AqM90dE4+s1/XtCfn7uWg6cS72zH+2VPFAlsnW0+W0cDi0XRjNKUMoJtpSi50+Ph6w==", + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/wasm-edit": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "acorn": "^6.2.1", + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^4.1.0", + "eslint-scope": "^4.0.3", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.4.0", + "loader-utils": "^1.2.3", + "memory-fs": "^0.4.1", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.1", + "neo-async": "^2.6.1", + "node-libs-browser": "^2.2.1", + "schema-utils": "^1.0.0", + "tapable": "^1.1.3", + "terser-webpack-plugin": "^1.4.3", + "watchpack": "^1.6.0", + "webpack-sources": "^1.4.1" + }, + "dependencies": { + "acorn": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==" + }, + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.4.tgz", + "integrity": "sha512-a0tMB40oefvuInr4Cwb3GerbL9xTj1D5yg0T5xrjGCGyfvbxseIXX7BAO/u/hIXdafzOI5JC3wDwHyf24buOAQ==", + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "terser-webpack-plugin": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz", + "integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==", + "requires": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^2.1.2", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + } + } + } + }, + "webpack-dev-middleware": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-3.7.2.tgz", + "integrity": "sha512-1xC42LxbYoqLNAhV6YzTYacicgMZQTqRd27Sim9wn5hJrX3I5nxYy1SxSd4+gjUFsz1dQFj+yEe6zEVmSkeJjw==", + "requires": { + "memory-fs": "^0.4.1", + "mime": "^2.4.4", + "mkdirp": "^0.5.1", + "range-parser": "^1.2.1", + "webpack-log": "^2.0.0" + } + }, + "webpack-dev-server": { + "version": "3.10.3", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-3.10.3.tgz", + "integrity": "sha512-e4nWev8YzEVNdOMcNzNeCN947sWJNd43E5XvsJzbAL08kGc2frm1tQ32hTJslRS+H65LCb/AaUCYU7fjHCpDeQ==", + "requires": { + "ansi-html": "0.0.7", + "bonjour": "^3.5.0", + "chokidar": "^2.1.8", + "compression": "^1.7.4", + "connect-history-api-fallback": "^1.6.0", + "debug": "^4.1.1", + "del": "^4.1.1", + "express": "^4.17.1", + "html-entities": "^1.2.1", + "http-proxy-middleware": "0.19.1", + "import-local": "^2.0.0", + "internal-ip": "^4.3.0", + "ip": "^1.1.5", + "is-absolute-url": "^3.0.3", + "killable": "^1.0.1", + "loglevel": "^1.6.6", + "opn": "^5.5.0", + "p-retry": "^3.0.1", + "portfinder": "^1.0.25", + "schema-utils": "^1.0.0", + "selfsigned": "^1.10.7", + "semver": "^6.3.0", + "serve-index": "^1.9.1", + "sockjs": "0.3.19", + "sockjs-client": "1.4.0", + "spdy": "^4.0.1", + "strip-ansi": "^3.0.1", + "supports-color": "^6.1.0", + "url": "^0.11.0", + "webpack-dev-middleware": "^3.7.2", + "webpack-log": "^2.0.0", + "ws": "^6.2.1", + "yargs": "12.0.5" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "optional": true - }, - "tar": { - "version": "4.4.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", - "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - } - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "optional": true, + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "string-width": "^1.0.2 || 2" + "ansi-regex": "^3.0.0" } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", - "optional": true - }, - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "optional": true } } }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", From 3ab55f47e0796c1e0d55a7742fcc1888bf4e0b06 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 26 May 2020 08:06:57 +0200 Subject: [PATCH 057/100] Bump styled-components from 5.1.0 to 5.1.1 (#717) Bumps [styled-components](https://github.com/styled-components/styled-components) from 5.1.0 to 5.1.1. - [Release notes](https://github.com/styled-components/styled-components/releases) - [Changelog](https://github.com/styled-components/styled-components/blob/master/CHANGELOG.md) - [Commits](https://github.com/styled-components/styled-components/compare/v5.1.0...v5.1.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 44b190ebb7..775c3f035c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21061,9 +21061,9 @@ } }, "styled-components": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.1.0.tgz", - "integrity": "sha512-0Qs2wEkFBXHFlysz6CV831VG6HedcrFUwChjnWylNivsx14MtmqQsohi21rMHZxzuTba063dEyoe/SR6VGJI7Q==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-5.1.1.tgz", + "integrity": "sha512-1ps8ZAYu2Husx+Vz8D+MvXwEwvMwFv+hqqUwhNlDN5ybg6A+3xyW1ECrAgywhvXapNfXiz79jJyU0x22z0FFTg==", "requires": { "@babel/helper-module-imports": "^7.0.0", "@babel/traverse": "^7.4.5", diff --git a/package.json b/package.json index e0ca5c4684..b756e6d326 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "redux": "^4.0.5", "redux-devtools-extension": "^2.13.8", "redux-thunk": "^2.3.0", - "styled-components": "^5.1.0", + "styled-components": "^5.1.1", "yup": "^0.29.0" }, "scripts": { From fe688244b7a161336d9c372afe1e38cd7acabee8 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 26 May 2020 08:34:25 +0200 Subject: [PATCH 058/100] Bump i18next from 19.4.4 to 19.4.5 (#713) Bumps [i18next](https://github.com/i18next/i18next) from 19.4.4 to 19.4.5. - [Release notes](https://github.com/i18next/i18next/releases) - [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next/compare/v19.4.4...v19.4.5) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 775c3f035c..9277ea6a63 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11543,9 +11543,9 @@ "integrity": "sha512-EcuixamT82oplpoJ2XU4pDtKGWQ7b00CD9f1ug9IaQ3p1bkHMiKCZ9ut9QDI6qsa6cpUuB+A/I+zLtdNK4n2DQ==" }, "i18next": { - "version": "19.4.4", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-19.4.4.tgz", - "integrity": "sha512-ofaHtdsDdX3A5nYur1HWblB7J4hIcjr2ACdnwTAJgc8hTfPbyzZfGX0hVkKpI3vzDIgO6Uzc4v1ffW2W6gG6zw==", + "version": "19.4.5", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-19.4.5.tgz", + "integrity": "sha512-aLvSsURoupi3x9IndmV6+m3IGhzLzhYv7Gw+//K3ovdliyGcFRV0I1MuddI0Bk/zR7BG1U+kJOjeHFUcUIdEgg==", "requires": { "@babel/runtime": "^7.3.1" } diff --git a/package.json b/package.json index b756e6d326..e4098c5a89 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "date-fns": "^2.14.0", "deepmerge": "^4.2.2", "formik": "^2.1.4", - "i18next": "^19.4.4", + "i18next": "^19.4.5", "i18next-browser-languagedetector": "^4.2.0", "react": "^16.13.1", "react-dom": "^16.13.1", From 061cbc931ea5445b17269182d6f89c772634df3d Mon Sep 17 00:00:00 2001 From: sarahse Date: Tue, 26 May 2020 14:48:55 +0200 Subject: [PATCH 059/100] Np 1000 responsive publication-description and references (#711) * create isMobile constant do not show heading text on tabs if mobile * add scrollable mui tabs show tab heading * fix description tab * fix journalarticleform * fix bookform * fix report form * fix publisherRow * fix nvi validation * fix tests * QA changes * fix scrollable tabs with fullWidth * styledcomponents hides custom classnames that we add to custom components --- src/components/LinkTab.tsx | 7 +- src/pages/publication/DescriptionPanel.tsx | 236 +++++++++--------- src/pages/publication/PublicationFormTabs.tsx | 20 +- src/pages/publication/ReferencesPanel.tsx | 4 + .../description_tab/DatePickerField.tsx | 1 + .../publication/references_tab/BookForm.tsx | 103 ++++---- .../references_tab/JournalArticleForm.tsx | 24 +- .../publication/references_tab/ReportForm.tsx | 96 ++++--- .../components/NviValidation.tsx | 28 +-- .../components/PublisherRow.tsx | 11 +- src/translations/en/publication.json | 3 +- src/translations/nb/publication.json | 3 +- 12 files changed, 297 insertions(+), 239 deletions(-) diff --git a/src/components/LinkTab.tsx b/src/components/LinkTab.tsx index 2e14d1211e..515c14d392 100644 --- a/src/components/LinkTab.tsx +++ b/src/components/LinkTab.tsx @@ -1,7 +1,11 @@ import React, { FC } from 'react'; import { Tab } from '@material-ui/core'; import { useTheme } from '@material-ui/core/styles'; +import styled from 'styled-components'; +const StyledTab = styled(Tab)` + margin: auto; +`; interface LinkTabProps { error?: boolean; href?: string; @@ -14,9 +18,8 @@ const LinkTab: FC = ({ error, ...rest }) => { const styledTab = error ? { color: theme.palette.error.main } : undefined; return ( - ) => { event.preventDefault(); }} diff --git a/src/pages/publication/DescriptionPanel.tsx b/src/pages/publication/DescriptionPanel.tsx index 854e4521c3..41b5389c1a 100644 --- a/src/pages/publication/DescriptionPanel.tsx +++ b/src/pages/publication/DescriptionPanel.tsx @@ -19,19 +19,33 @@ import { DescriptionFieldNames } from '../../types/publicationFieldNames'; import { emptyProject } from '../../types/project.types'; import { touchedDescriptionTabFields } from '../../utils/formik-helpers'; import { PanelProps } from './PublicationFormContent'; +import SubHeading from '../../components/SubHeading'; -const MultipleFieldWrapper = styled.div` - display: flex; +const NpiAndTagsWrapper = styled.div` + display: grid; + grid-template-areas: 'npi tags'; + grid-template-columns: 1fr 1fr; + column-gap: 1rem; + @media (max-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + grid-template-areas: 'npi' 'tags'; + grid-template-columns: 1fr; + } `; -const StyledFieldWrapper = styled.div` - margin: 1rem; - flex: 1 0 40%; +const DateAndLanguageWrapper = styled.div` + display: grid; + grid-template-areas: 'datepicker year-only language'; + grid-template-columns: 1fr 1fr 2fr; + column-gap: 1rem; + @media (max-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + grid-template-areas: 'datepicker' 'year-only' 'language'; + grid-template-columns: 1fr; + } `; -const StyledFieldHeader = styled.header` - margin: 1rem; - font-size: 1.5rem; +const StyledMainCard = styled(Card)` + display: grid; + gap: 1rem; `; const DescriptionPanel: FC = ({ setTouchedFields }) => { @@ -46,131 +60,115 @@ const DescriptionPanel: FC = ({ setTouchedFields }) => { return ( - + {t('heading.description')} - - - {({ field, meta: { touched, error } }: FieldProps) => ( - } + + {({ field, meta: { touched, error } }: FieldProps) => ( + } + /> + )} + + + {({ field }: FieldProps) => ( + + )} + + + {({ field }: FieldProps) => ( + + )} + + + + {({ field: { name, value } }: FieldProps) => ( + // TODO: when we have a service for getting npiDisciplines by id this must be updated (only id is stored in backend for now) + setFieldValue(name, npiDiscipline?.id ?? '')} + dataTestId="search_npi" + value={value} + placeholder={t('description.search_for_npi_discipline')} /> )} - - - - {({ field }: FieldProps) => ( - - )} - - - - + {({ field }: FieldProps) => ( - , value: string[] | string) => setFieldValue(field.name, value)} + renderInput={(params) => ( + + )} /> )} - - - - - {({ field: { name, value } }: FieldProps) => ( - // TODO: when we have a service for getting npiDisciplines by id this must be updated (only id is stored in backend for now) - setFieldValue(name, npiDiscipline?.id ?? '')} - dataTestId="search_npi" - value={value} - placeholder={t('description.search_for_npi_discipline')} - /> - )} - - - - - {({ field }: FieldProps) => ( - , value: string[] | string) => setFieldValue(field.name, value)} - renderInput={(params) => ( - - )} - /> - )} - - - + - - - - + + - - - {({ field }: FieldProps) => ( - - {publicationLanguages.map(({ id, value }) => ( - - {t(`languages:${id}`)} - - ))} - - )} - - - - + + {({ field }: FieldProps) => ( + + {publicationLanguages.map(({ id, value }) => ( + + {t(`languages:${id}`)} + + ))} + + )} + + + - {t('description.project_association')} + {t('description.project_association')} - - - {({ field: { name, value } }: FieldProps) => ( - <> - setFieldValue(name, { ...emptyProject, ...newValue })} - dataTestId="search_project" - placeholder={t('description.search_for_project')} + + {({ field: { name, value } }: FieldProps) => ( + <> + setFieldValue(name, { ...emptyProject, ...newValue })} + dataTestId="search_project" + placeholder={t('description.search_for_project')} + /> + {value && ( + setFieldValue(name, null)} + dataTestId="selected_project" /> - {value && ( - setFieldValue(name, null)} - dataTestId="selected_project" - /> - )} - - )} - - + )} + + )} + ); diff --git a/src/pages/publication/PublicationFormTabs.tsx b/src/pages/publication/PublicationFormTabs.tsx index a0287d81f7..9351320b0d 100644 --- a/src/pages/publication/PublicationFormTabs.tsx +++ b/src/pages/publication/PublicationFormTabs.tsx @@ -8,6 +8,16 @@ import LinkTab from '../../components/LinkTab'; import { FormikPublication } from '../../types/publication.types'; import { ReferenceFieldNames, DescriptionFieldNames } from '../../types/publicationFieldNames'; import { hasTouchedError, getAllFileFields, getAllContributorFields } from '../../utils/formik-helpers'; +import styled from 'styled-components'; + +const StyledTabs = styled(Tabs)` + background-color: ${({ theme }) => theme.overrides.MuiTab.root.background}; + @media (min-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + .MuiTabs-flexContainer { + justify-content: center; + } + } +`; const a11yProps = (tabDescription: string) => { return { @@ -37,7 +47,13 @@ export const PublicationFormTabs: FC = ({ handleTabCha } = values; return ( - + = ({ handleTabCha error={hasTouchedError(errors, touched, getAllFileFields(files))} /> - + ); }; diff --git a/src/pages/publication/ReferencesPanel.tsx b/src/pages/publication/ReferencesPanel.tsx index ce1e26aa83..0324a757bf 100644 --- a/src/pages/publication/ReferencesPanel.tsx +++ b/src/pages/publication/ReferencesPanel.tsx @@ -21,6 +21,10 @@ const StyledCard = styled(Card)` const StyledSelectContainer = styled.div` width: 50%; + @media (max-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + padding: 0 1rem; + width: 100%; + } `; const ReferencesPanel: FC = ({ setTouchedFields }) => { diff --git a/src/pages/publication/description_tab/DatePickerField.tsx b/src/pages/publication/description_tab/DatePickerField.tsx index 990eaa0bfb..b51997c71e 100644 --- a/src/pages/publication/description_tab/DatePickerField.tsx +++ b/src/pages/publication/description_tab/DatePickerField.tsx @@ -54,6 +54,7 @@ const DatePickerField = ({ yearFieldName, monthFieldName, dayFieldName }: DatePi return ( <> theme.breakpoints.values.sm + 'px'}) { + grid-template-areas: 'peer-review' 'text-book'; + grid-template-columns: 1fr; + } `; const StyledPeerReview = styled.div` @@ -35,6 +42,13 @@ const StyledTextBook = styled.div` grid-area: text-book; `; +const StyledTextField = styled(TextField)` + display: inline; + @media (max-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + display: grid; + } +`; + const BookForm: FC = () => { const { t } = useTranslation('publication'); const { setFieldValue, values }: FormikProps = useFormikContext(); @@ -44,7 +58,7 @@ const BookForm: FC = () => { } = values.entityDescription.reference; return ( - <> + @@ -54,12 +68,25 @@ const BookForm: FC = () => { label={t('common:publisher')} placeholder={t('references.search_for_publisher')} /> + + + {({ field }: FieldProps) => ( + + )} + + + + {({ field }: FieldProps) => ( + + )} + + - - {({ field }: FieldProps) => ( - - )} - @@ -85,42 +112,34 @@ const BookForm: FC = () => { - - {({ field }: FieldProps) => ( - - )} - - {t('references.series')} - - - {({ field: { name, value } }: FieldProps) => ( - <> - setFieldValue(name, inputValue ?? emptyPublisher)} - placeholder={t('references.search_for_series')} - /> - {value.title && ( - + {t('references.series')} + + + {({ field: { name, value } }: FieldProps) => ( + <> + setFieldValue(name, emptyPublisher)} + publicationTable={PublicationTableNumber.PUBLICATION_CHANNELS} + setValueFunction={(inputValue) => setFieldValue(name, inputValue ?? emptyPublisher)} + placeholder={t('references.search_for_series')} /> - )} - - )} - + {value.title && ( + setFieldValue(name, emptyPublisher)} + /> + )} + + )} + + - + ); }; diff --git a/src/pages/publication/references_tab/JournalArticleForm.tsx b/src/pages/publication/references_tab/JournalArticleForm.tsx index 3a9b830731..b0b545fed1 100644 --- a/src/pages/publication/references_tab/JournalArticleForm.tsx +++ b/src/pages/publication/references_tab/JournalArticleForm.tsx @@ -13,11 +13,19 @@ import DoiField from './components/DoiField'; import SelectTypeField from './components/SelectTypeField'; import PublisherField from './components/PublisherField'; +const StyledContent = styled.div` + display: grid; + gap: 1rem; +`; + const StyledArticleDetail = styled.div` display: grid; - grid-template-columns: auto auto auto auto auto auto; + grid-template-areas: 'volume issue from to or article'; grid-column-gap: 1rem; align-content: center; + @media (max-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + grid-template-areas: 'volume' 'issue' 'from' 'to' 'or' 'article'; + } `; const StyledLabel = styled.div` @@ -26,12 +34,6 @@ const StyledLabel = styled.div` justify-self: center; `; -const StyledPeerReview = styled.div` - margin-top: 0.7rem; - padding-top: 0.7rem; - padding-left: 0.7rem; -`; - const JournalArticleForm: FC = () => { const { t } = useTranslation('publication'); const { values }: FormikProps = useFormikContext(); @@ -41,7 +43,7 @@ const JournalArticleForm: FC = () => { } = values.entityDescription.reference; return ( - <> + @@ -121,11 +123,9 @@ const JournalArticleForm: FC = () => { )} - - - + - + ); }; diff --git a/src/pages/publication/references_tab/ReportForm.tsx b/src/pages/publication/references_tab/ReportForm.tsx index de3346c931..9c19b8966b 100644 --- a/src/pages/publication/references_tab/ReportForm.tsx +++ b/src/pages/publication/references_tab/ReportForm.tsx @@ -13,16 +13,30 @@ import PublisherRow from './components/PublisherRow'; import DoiField from './components/DoiField'; import SelectTypeField from './components/SelectTypeField'; import PublisherField from './components/PublisherField'; +import SubHeading from '../../../components/SubHeading'; +import Label from '../../../components/Label'; -const StyledLabel = styled.div` - color: ${({ theme }) => theme.palette.text.primary}; - font-size: 1rem; - font-weight: bold; +const StyledContent = styled.div` + display: grid; + gap: 1rem; `; -const StyledHeading = styled.div` - font-size: 1.5rem; - padding-top: 1.5rem; +const StyledSection = styled.div` + display: grid; + gap: 1rem; + grid-template-areas: 'isbn number-of-pages'; + grid-template-columns: 1fr 2fr; + @media (max-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + grid-template-areas: 'isbn' 'number-of-pages'; + grid-template-columns: 1fr; + } +`; + +const StyledTextField = styled(TextField)` + display: inline; + @media (max-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + display: grid; + } `; const ReportForm: FC = () => { @@ -31,7 +45,7 @@ const ReportForm: FC = () => { const { setFieldValue }: FormikProps = useFormikContext(); return ( - <> + @@ -41,49 +55,51 @@ const ReportForm: FC = () => { label={t('common:publisher')} placeholder={t('references.search_for_publisher')} /> + + + {({ field }: FieldProps) => ( + + )} + - - {({ field }: FieldProps) => ( - - )} - -
{({ field }: FieldProps) => ( - )} -
- {t('references.series')} - {t('references.series_info')} - - {({ field: { name, value } }: FieldProps) => ( - <> - setFieldValue(name, inputValue ?? emptyPublisher)} - placeholder={t('references.search_for_series')} - /> - {value.title && ( - +
+ {t('references.series')} + + + {({ field: { name, value } }: FieldProps) => ( + <> + setFieldValue(name, emptyPublisher)} + publicationTable={PublicationTableNumber.PUBLICATION_CHANNELS} + setValueFunction={(inputValue) => setFieldValue(name, inputValue ?? emptyPublisher)} + placeholder={t('references.search_for_series')} /> - )} - - )} - - + {value.title && ( + setFieldValue(name, emptyPublisher)} + /> + )} + + )} + +
+
); }; diff --git a/src/pages/publication/references_tab/components/NviValidation.tsx b/src/pages/publication/references_tab/components/NviValidation.tsx index 2b8fe46d2f..b71b139b02 100644 --- a/src/pages/publication/references_tab/components/NviValidation.tsx +++ b/src/pages/publication/references_tab/components/NviValidation.tsx @@ -5,6 +5,8 @@ import styled from 'styled-components'; import CancelIcon from '@material-ui/icons/Cancel'; import CheckCircleIcon from '@material-ui/icons/CheckCircle'; import Card from '../../../../components/Card'; +import SubHeading from '../../../../components/SubHeading'; +import NormalText from '../../../../components/NormalText'; const StyledNviValidation = styled(Card)` margin-top: 1rem; @@ -13,17 +15,16 @@ const StyledNviValidation = styled(Card)` grid-template-areas: 'icon header' 'icon information'; - padding: 1rem 0; + gap: 1rem; + @media (max-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + grid-template-areas: 'header icon' 'information information'; + grid-template-columns: 4fr 1fr; + } `; -const StyledNviHeader = styled.div` - font-size: 1.5rem; - font-weight: bold; - grid-area: header; -`; - -const StyledNviInformation = styled.div` +const StyledNviInformation = styled(NormalText)` grid-area: information; + white-space: pre-wrap; `; const StyledCheckCircleIcon = styled(CheckCircleIcon)` @@ -51,7 +52,7 @@ const NviValidation: FC = ({ dataTestId, isPeerReviewed, isR return ( - {t('references.nvi_header')} + {t('references.nvi_header')} {isPeerReviewed ? ( isRated ? ( <> @@ -61,18 +62,13 @@ const NviValidation: FC = ({ dataTestId, isPeerReviewed, isR ) : ( <> - -
{t('references.nvi_fail_rated_line1')}
-
{t('references.nvi_fail_rated_line2')}
-
+ {t('references.nvi_fail_not_rated')} ) ) : ( <> - -
{t('references.nvi_fail_no_peer_review')}
-
+ {t('references.nvi_fail_no_peer_review')} )}
diff --git a/src/pages/publication/references_tab/components/PublisherRow.tsx b/src/pages/publication/references_tab/components/PublisherRow.tsx index 4a00ae4d4d..0ae82fbcfa 100644 --- a/src/pages/publication/references_tab/components/PublisherRow.tsx +++ b/src/pages/publication/references_tab/components/PublisherRow.tsx @@ -11,6 +11,7 @@ import { PublicationTableNumber } from '../../../../utils/constants'; import { FormikProps, useFormikContext } from 'formik'; import { ReferenceFieldNames } from '../../../../types/publicationFieldNames'; import Card from '../../../../components/Card'; +import NormalText from '../../../../components/NormalText'; const StyledPublisherCard = styled(Card)` margin: 1rem 0; @@ -21,6 +22,12 @@ const StyledPublisherCard = styled(Card)` 'titleLabel levelLabel button' 'title level button'; grid-template-columns: 7fr 6fr 2fr; + align-items: center; + @media (max-width: ${({ theme }) => theme.breakpoints.values.sm + 'px'}) { + grid-template-areas: 'titleLabel title title' 'levelLabel level level' '. . button'; + grid-template-columns: 1fr 1fr 1fr; + gap: 1rem; + } `; const StyledTitle = styled(Label)` @@ -31,11 +38,11 @@ const StyledLevelLabel = styled(Label)` grid-area: levelLabel; `; -const StyledTitleText = styled.div` +const StyledTitleText = styled(NormalText)` grid-area: title; `; -const StyledLevelText = styled.div` +const StyledLevelText = styled(NormalText)` grid-area: level; `; diff --git a/src/translations/en/publication.json b/src/translations/en/publication.json index c843d4185c..ee3031b84e 100644 --- a/src/translations/en/publication.json +++ b/src/translations/en/publication.json @@ -116,8 +116,7 @@ "number_of_pages": "Total number of pages", "nvi_header": "Norwegian Scientific Index - NVI", "nvi_success": "This publication can be included in NVI", - "nvi_fail_rated_line1": "This publication can not be included in NVI, since selected journal is not at level 1 or 2.", - "nvi_fail_rated_line2": "(The journal's level may be changed in the Publication Channel Registry, so the publication can ble included in NVI)", + "nvi_fail_not_rated": "This publication can not be included in NVI, since selected journal is not at level 1 or 2. \n\n(The journal's level may be changed in the Publication Channel Registry, so the publication can ble included in NVI)", "nvi_fail_no_peer_review": "This publication can not be incuded in NVI, since it's not peer reviewed.", "or": "Or", "pages": "Pages", diff --git a/src/translations/nb/publication.json b/src/translations/nb/publication.json index f91ded5a4f..02a54dbbee 100644 --- a/src/translations/nb/publication.json +++ b/src/translations/nb/publication.json @@ -116,8 +116,7 @@ "number_of_pages": "Totalt antall sider", "nvi_header": "Norsk vitenskapsindeks - NVI", "nvi_success": "Denne publikasjonen kan inngå i NVI", - "nvi_fail_rated_line1": "Denne publikajsonen kan ikke inngå i NVI, da valgt tidsskrift er ikke på nivå 1 eller 2.", - "nvi_fail_rated_line2": "(Tidsskriftets nivå i Kanaregisteret kan bli endret, slik at publikasjonen likevel kan inngå i NVI)", + "nvi_fail_not_rated": "Denne publikajsonen kan ikke inngå i NVI, da valgt tidsskrift er ikke på nivå 1 eller 2. \n\n(Tidsskriftets nivå i Kanalregisteret kan bli endret, slik at publikasjonen likevel kan inngå i NVI)", "nvi_fail_no_peer_review": "Denne publikasjonen kan ikke inngå i NVI, da den ikke er fagfellevurdert.", "or": "Eller", "pages": "Sidetall", From 0a8b9cb58a61a71d64dfb53eb9d4463603792462 Mon Sep 17 00:00:00 2001 From: sarahse Date: Tue, 26 May 2020 15:52:25 +0200 Subject: [PATCH 060/100] Np 1007 responsive publication contributors (#719) * create isMobile constant do not show heading text on tabs if mobile * add scrollable mui tabs show tab heading * fix description tab * fix journalarticleform * fix bookform * fix report form * fix publisherRow * fix nvi validation * fix tests * QA changes * fix scrollable tabs with fullWidth * styledcomponents hides custom classnames that we add to custom components * add scrollable container for contributor table * fix authority card modal * mui has existing TableContainer which is used for scrollable tables --- .../contributors_tab/components/SortableTable.tsx | 7 ++++--- src/pages/user/authority/AuthorityCard.tsx | 6 +++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pages/publication/contributors_tab/components/SortableTable.tsx b/src/pages/publication/contributors_tab/components/SortableTable.tsx index 22a12a9c2c..7177ccaa5e 100644 --- a/src/pages/publication/contributors_tab/components/SortableTable.tsx +++ b/src/pages/publication/contributors_tab/components/SortableTable.tsx @@ -10,6 +10,7 @@ import { TextField, Button, Tooltip, + TableContainer, } from '@material-ui/core'; import { Field, FieldProps, FormikProps, useFormikContext } from 'formik'; import { useTranslation } from 'react-i18next'; @@ -69,6 +70,7 @@ const SortableItem = SortableElement( return ( + #{contributor.sequence} {contributor.identity.name}{' '} {contributor.identity.arpId ? ( @@ -130,7 +132,6 @@ const SortableItem = SortableElement( )} - #{contributor.sequence}