diff --git a/.gitignore b/.gitignore index 9632f9563..39a931e3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,19 @@ # See https://help.github.com/ignore-files/ for more about ignoring files. +dist # dependencies node_modules # styles *.css +!packages/**/*.css -# testing -/coverage # storybook building files -/built-storybook +built-storybook /website _book -# production -/build # misc .DS_Store @@ -34,4 +32,5 @@ yarn-error.log* cypress/videos cypress/screenshots -coverage \ No newline at end of file +coverage +build \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index f648aebd8..1c86766e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,15 @@ language: node_js node_js: - - 9.10.0 + - 12.8.0 + cache: yarn install: - - npm install + - yarn config set registry https://registry.npmjs.org + - yarn install before_script: - - npm run test:coverage + - yarn test:coverage script: - - CI=false yarn build-insee - - npm run build-storybook -before_deploy: - - git config --global user.email "demey.emmanuel@gmail.com" - - git config --global user.name "Emmanuel DEMEY" - - export GIT_TAG=$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER - - git tag $GIT_TAG -a -m "Generated tag from TravisCI for build $TRAVIS_BUILD_NUMBER" - - git push -q https://${GITHUB_TOKEN}@github.com/$TRAVIS_REPO_SLUG --tags - - tar -zcf ${TRAVIS_BUILD_NUMBER}.tar.gz build + - yarn build-storybook deploy: skip_cleanup: true diff --git a/app/.env b/app/.env new file mode 100644 index 000000000..76af80d8d --- /dev/null +++ b/app/.env @@ -0,0 +1,3 @@ +REACT_APP_API_BASE_HOST = './api' + +REACT_APP_APPLICATIONS = "classifications,concepts,operations" \ No newline at end of file diff --git a/app/.env.development b/app/.env.development new file mode 100644 index 000000000..c9b18c164 --- /dev/null +++ b/app/.env.development @@ -0,0 +1,3 @@ +REACT_APP_API_BASE_HOST = 'http://localhost:8081/api' + +REACT_APP_APPLICATIONS = "classifications,concepts,operations" \ No newline at end of file diff --git a/app/.eslintrc b/app/.eslintrc new file mode 100644 index 000000000..4c749a4b0 --- /dev/null +++ b/app/.eslintrc @@ -0,0 +1,18 @@ +{ + "extends": ["prettier", "react-app"], + "rules": { + "jsx-a11y/href-no-hash": false + }, + "settings": { + "react": { + "version": "16.3.0" + } + }, + "globals": { + "cy": true, + "Cypress": true + }, + "env": { + "mocha": true + } +} diff --git a/app/.storybook/addons.js b/app/.storybook/addons.js new file mode 100644 index 000000000..bc646c943 --- /dev/null +++ b/app/.storybook/addons.js @@ -0,0 +1,3 @@ +import '@storybook/addon-actions/register'; +import '@storybook/addon-links/register'; +import '@storybook/addon-knobs/register'; diff --git a/app/.storybook/config.js b/app/.storybook/config.js new file mode 100644 index 000000000..baa372e8d --- /dev/null +++ b/app/.storybook/config.js @@ -0,0 +1,11 @@ +import { configure } from "@storybook/react"; +import "bootstrap/dist/css/bootstrap.css"; +import "react-bootstrap-table/dist/react-bootstrap-table-all.min.css"; +import "app.scss"; + +const requireAll = requireContext => requireContext.keys().map(requireContext); + +const loadStories = () => + requireAll(require.context("js/components", true, /stories\.jsx?$/)); + +configure(loadStories, module); diff --git a/LICENSE b/app/LICENSE similarity index 100% rename from LICENSE rename to app/LICENSE diff --git a/README.md b/app/README.md similarity index 100% rename from README.md rename to app/README.md diff --git a/cypress.json b/app/cypress.json similarity index 100% rename from cypress.json rename to app/cypress.json diff --git a/cypress/fixtures/families.json b/app/cypress/fixtures/families.json similarity index 100% rename from cypress/fixtures/families.json rename to app/cypress/fixtures/families.json diff --git a/cypress/fixtures/operation-with-sims.json b/app/cypress/fixtures/operation-with-sims.json similarity index 100% rename from cypress/fixtures/operation-with-sims.json rename to app/cypress/fixtures/operation-with-sims.json diff --git a/cypress/fixtures/operation-without-sims.json b/app/cypress/fixtures/operation-without-sims.json similarity index 100% rename from cypress/fixtures/operation-without-sims.json rename to app/cypress/fixtures/operation-without-sims.json diff --git a/cypress/fixtures/series.json b/app/cypress/fixtures/series.json similarity index 100% rename from cypress/fixtures/series.json rename to app/cypress/fixtures/series.json diff --git a/cypress/fixtures/sims.json b/app/cypress/fixtures/sims.json similarity index 100% rename from cypress/fixtures/sims.json rename to app/cypress/fixtures/sims.json diff --git a/cypress/integration/document.spec.js b/app/cypress/integration/document.spec.js similarity index 100% rename from cypress/integration/document.spec.js rename to app/cypress/integration/document.spec.js diff --git a/cypress/integration/family.spec.js b/app/cypress/integration/family.spec.js similarity index 100% rename from cypress/integration/family.spec.js rename to app/cypress/integration/family.spec.js diff --git a/cypress/integration/help.spec.js b/app/cypress/integration/help.spec.js similarity index 100% rename from cypress/integration/help.spec.js rename to app/cypress/integration/help.spec.js diff --git a/cypress/integration/home.spec.js b/app/cypress/integration/home.spec.js similarity index 100% rename from cypress/integration/home.spec.js rename to app/cypress/integration/home.spec.js diff --git a/cypress/integration/indicator.spec.js b/app/cypress/integration/indicator.spec.js similarity index 100% rename from cypress/integration/indicator.spec.js rename to app/cypress/integration/indicator.spec.js diff --git a/cypress/integration/operation.spec.js b/app/cypress/integration/operation.spec.js similarity index 100% rename from cypress/integration/operation.spec.js rename to app/cypress/integration/operation.spec.js diff --git a/cypress/integration/operations_list.spec.js b/app/cypress/integration/operations_list.spec.js similarity index 100% rename from cypress/integration/operations_list.spec.js rename to app/cypress/integration/operations_list.spec.js diff --git a/cypress/integration/po/document.po.js b/app/cypress/integration/po/document.po.js similarity index 100% rename from cypress/integration/po/document.po.js rename to app/cypress/integration/po/document.po.js diff --git a/cypress/integration/po/family.po.js b/app/cypress/integration/po/family.po.js similarity index 100% rename from cypress/integration/po/family.po.js rename to app/cypress/integration/po/family.po.js diff --git a/cypress/integration/po/operation.po.js b/app/cypress/integration/po/operation.po.js similarity index 100% rename from cypress/integration/po/operation.po.js rename to app/cypress/integration/po/operation.po.js diff --git a/cypress/integration/po/series.po.js b/app/cypress/integration/po/series.po.js similarity index 100% rename from cypress/integration/po/series.po.js rename to app/cypress/integration/po/series.po.js diff --git a/cypress/integration/po/sims.po.js b/app/cypress/integration/po/sims.po.js similarity index 100% rename from cypress/integration/po/sims.po.js rename to app/cypress/integration/po/sims.po.js diff --git a/cypress/integration/serie.spec.js b/app/cypress/integration/serie.spec.js similarity index 100% rename from cypress/integration/serie.spec.js rename to app/cypress/integration/serie.spec.js diff --git a/cypress/integration/sims.spec.js b/app/cypress/integration/sims.spec.js similarity index 100% rename from cypress/integration/sims.spec.js rename to app/cypress/integration/sims.spec.js diff --git a/cypress/plugins/index.js b/app/cypress/plugins/index.js similarity index 100% rename from cypress/plugins/index.js rename to app/cypress/plugins/index.js diff --git a/cypress/support/commands.js b/app/cypress/support/commands.js similarity index 100% rename from cypress/support/commands.js rename to app/cypress/support/commands.js diff --git a/cypress/support/index.js b/app/cypress/support/index.js similarity index 100% rename from cypress/support/index.js rename to app/cypress/support/index.js diff --git a/jsconfig.json b/app/jsconfig.json similarity index 100% rename from jsconfig.json rename to app/jsconfig.json diff --git a/app/package.json b/app/package.json new file mode 100755 index 000000000..edfaecb94 --- /dev/null +++ b/app/package.json @@ -0,0 +1,116 @@ +{ + "name": "Bauhaus", + "version": "2.0.0", + "description": "Web application for the management of concepts, classifications and other statistical objects", + "repository": { + "type": "git", + "url": "https://github.com/InseeFr/Bauhaus" + }, + "license": "MIT", + "author": "INSEE (http://www.insee.fr)", + "scripts": { + "build": "cross-env NODE_PATH=src/ REACT_APP_VERSION=$npm_package_version REACT_APP_NAME=$npm_package_name react-scripts build", + "build-insee": "cross-env REACT_APP_APPLICATIONS=classifications,concepts NODE_PATH=src/ REACT_APP_VERSION=$npm_package_version REACT_APP_NAME=$npm_package_name REACT_APP_INSEE=true react-scripts build", + "cypress:open": "cypress open", + "cypress:run": "cypress run", + "e2e": "start-server-and-test start http://localhost:3000 cypress:run", + "eject": "react-scripts eject", + "lint": "eslint src", + "start": "cross-env REACT_APP_VERSION=$npm_package_version REACT_APP_NAME=$npm_package_name react-scripts start", + "start-https": "cross-env HTTPS=true REACT_APP_VERSION=$npm_package_version REACT_APP_NAME=$npm_package_name react-scripts start", + "test": "react-scripts test", + "build-storybook": "cross-env NODE_PATH=src/ build-storybook -o built-storybook/storybook", + "start-storybook": "cross-env NODE_PATH=src/ start-storybook -p 9999", + "test:coverage": "cross-env CI=true react-scripts test --coverage --collectCoverageFrom=src/**/*.js --collectCoverageFrom=!src/**/*.spec.js --collectCoverageFrom=!src/**/*.stories.js --collectCoverageFrom=!src/types/*.js" + }, + "prettier": { + "bracketSpacing": true, + "semi": true, + "singleQuote": true, + "trailingComma": "es5", + "useTabs": true + }, + "dependencies": { + "babel-polyfill": "6.26.0", + "bauhaus-library": "^0.0.0", + "bootstrap": "3.4.1", + "create-react-class": "^15.6.3", + "dompurify": "0.8.7", + "draft-js": "0.10.4", + "draft-js-export-html": "1.4.1", + "draft-js-import-html": "1.2.1", + "draftjs-md-converter": "1.1.1", + "file-saver": "1.3.3", + "jwt-decode": "2.2.0", + "keycloak": "1.2.0", + "lodash.deburr": "4.1.0", + "lodash.difference": "4.5.0", + "moment": "2.23.0", + "moment-range": "3.0.3", + "prop-types": "15.7.2", + "react": "16.8.6", + "react-16-bootstrap-date-picker": "5.1.2", + "react-bootstrap": "0.31.5", + "react-bootstrap-table": "4.3.0", + "react-bootstrap-tabs": "1.0.2", + "react-d3-tree": "1.10.3", + "react-dom": "16.8.6", + "react-draft-wysiwyg": "1.12.0", + "react-dropzone": "^10.1.5", + "react-loading": "2.0.3", + "react-modal": "3.1.8", + "react-redux": "7.1.0", + "react-router-dom": "4.3.1", + "react-router-hash-link": "1.2.0", + "react-scripts": "3.0.1", + "react-select": "1.1.0", + "react-sortable-tree": "2.1.0", + "recompose": "0.30.0", + "redux": "4.0.4", + "redux-logger": "3.0.6", + "redux-thunk": "2.3.0" + }, + "devDependencies": { + "@storybook/addon-actions": "5.1.0-rc.1", + "@storybook/addon-knobs": "5.1.0-rc.1", + "@storybook/addon-links": "5.1.0-rc.1", + "@storybook/addons": "5.1.0-rc.1", + "@storybook/react": "5.1.0-rc.1", + "@babel/core": "7.3.3", + "@types/cypress": "1.1.3", + "@types/jest": "24.0.12", + "axe-core": "3.3.1", + "babel-loader": "8.0.5", + "concurrently": "3.5.1", + "coveralls": "3.0.3", + "cross-env": "5.0.1", + "cypress": "3.4.1", + "cypress-axe": "0.5.1", + "cypress-skip-and-only-ui": "^1.1.0", + "enzyme": "3.10.0", + "enzyme-adapter-react-16": "1.14.0", + "eslint-config-prettier": "6.0.0", + "eslint-config-react-app": "4.0.1", + "eslint-plugin-import": "2.18.2", + "eslint-plugin-jsx-a11y": "6.2.3", + "eslint-plugin-react": "7.14.3", + "jest-localstorage-mock": "2.4.0", + "node-sass": "4.12.0", + "prettier": "1.18.2", + "react-test-renderer": "16.8.6", + "start-server-and-test": "1.9.1", + "term-size": "^1.2.0" + }, + "browserslist": [ + ">0.2%", + "not dead", + "not ie <= 11", + "not op_mini all" + ], + "contributor": [ + { + "name": "Nicolas Laval", + "email": "nicolas.laval@insee.fr" + } + ] +} diff --git a/public/configuration.json b/app/public/configuration.json similarity index 100% rename from public/configuration.json rename to app/public/configuration.json diff --git a/public/favicon.ico b/app/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to app/public/favicon.ico diff --git a/public/index.html b/app/public/index.html similarity index 100% rename from public/index.html rename to app/public/index.html diff --git a/public/keycloak.json b/app/public/keycloak.json similarity index 100% rename from public/keycloak.json rename to app/public/keycloak.json diff --git a/src/app.scss b/app/src/app.scss similarity index 99% rename from src/app.scss rename to app/src/app.scss index 8ff181cb2..f64bb5f6a 100644 --- a/src/app.scss +++ b/app/src/app.scss @@ -1,6 +1,5 @@ @import 'src/styles/mixin.scss'; -// Define concepts colors $color_concepts_1: #044173; $color_concepts_2: #234ca5; $color_concepts_3: #457dbb; diff --git a/src/img/accueil.jpg b/app/src/img/accueil.jpg similarity index 100% rename from src/img/accueil.jpg rename to app/src/img/accueil.jpg diff --git a/src/img/accueil.png b/app/src/img/accueil.png similarity index 100% rename from src/img/accueil.png rename to app/src/img/accueil.png diff --git a/src/img/add.png b/app/src/img/add.png similarity index 100% rename from src/img/add.png rename to app/src/img/add.png diff --git a/src/img/admin.png b/app/src/img/admin.png similarity index 100% rename from src/img/admin.png rename to app/src/img/admin.png diff --git a/src/img/classifications.jpg b/app/src/img/classifications.jpg similarity index 100% rename from src/img/classifications.jpg rename to app/src/img/classifications.jpg diff --git a/src/img/concepts.jpg b/app/src/img/concepts.jpg similarity index 100% rename from src/img/concepts.jpg rename to app/src/img/concepts.jpg diff --git a/src/img/dashboard.png b/app/src/img/dashboard.png similarity index 100% rename from src/img/dashboard.png rename to app/src/img/dashboard.png diff --git a/src/img/del.png b/app/src/img/del.png similarity index 100% rename from src/img/del.png rename to app/src/img/del.png diff --git a/src/img/flags/default.png b/app/src/img/flags/default.png similarity index 100% rename from src/img/flags/default.png rename to app/src/img/flags/default.png diff --git a/src/img/flags/en.png b/app/src/img/flags/en.png similarity index 100% rename from src/img/flags/en.png rename to app/src/img/flags/en.png diff --git a/src/img/flags/fr.png b/app/src/img/flags/fr.png similarity index 100% rename from src/img/flags/fr.png rename to app/src/img/flags/fr.png diff --git a/src/img/operations.jpg b/app/src/img/operations.jpg similarity index 100% rename from src/img/operations.jpg rename to app/src/img/operations.jpg diff --git a/src/img/spinner.svg b/app/src/img/spinner.svg similarity index 100% rename from src/img/spinner.svg rename to app/src/img/spinner.svg diff --git a/src/img/warning.jpg b/app/src/img/warning.jpg similarity index 100% rename from src/img/warning.jpg rename to app/src/img/warning.jpg diff --git a/src/img/work-in-progress.png b/app/src/img/work-in-progress.png similarity index 100% rename from src/img/work-in-progress.png rename to app/src/img/work-in-progress.png diff --git a/src/index.js b/app/src/index.js similarity index 74% rename from src/index.js rename to app/src/index.js index 95bb96040..940a3cb23 100755 --- a/src/index.js +++ b/app/src/index.js @@ -5,9 +5,11 @@ import Root from 'js/components/router'; import Error from 'js/components/shared/error/error'; import configureStore from 'js/store/configure-store'; import Api from 'js/remote-api/api'; -import BackToTop from 'js/components/shared/back-to-top/'; +import { I18NContext, BackToTop } from 'bauhaus-library'; +import { bauhausLibraryDictionary } from 'js/i18n'; import 'app.scss'; +import 'bauhaus-library/dist/index.css'; Api.getInit() .then( @@ -32,10 +34,12 @@ const renderApp = (Component, initState, props) => { ReactDOM.render( -
- - -
+ +
+ + +
+
, document.getElementById('root') ); diff --git a/src/js/actions/app/index.js b/app/src/js/actions/app/index.js similarity index 100% rename from src/js/actions/app/index.js rename to app/src/js/actions/app/index.js diff --git a/src/js/actions/app/index.spec.js b/app/src/js/actions/app/index.spec.js similarity index 100% rename from src/js/actions/app/index.spec.js rename to app/src/js/actions/app/index.spec.js diff --git a/src/js/actions/classifications/classification.js b/app/src/js/actions/classifications/classification.js similarity index 100% rename from src/js/actions/classifications/classification.js rename to app/src/js/actions/classifications/classification.js diff --git a/src/js/actions/classifications/correspondences/association.js b/app/src/js/actions/classifications/correspondences/association.js similarity index 100% rename from src/js/actions/classifications/correspondences/association.js rename to app/src/js/actions/classifications/correspondences/association.js diff --git a/src/js/actions/classifications/correspondences/associations.js b/app/src/js/actions/classifications/correspondences/associations.js similarity index 100% rename from src/js/actions/classifications/correspondences/associations.js rename to app/src/js/actions/classifications/correspondences/associations.js diff --git a/src/js/actions/classifications/correspondences/general.js b/app/src/js/actions/classifications/correspondences/general.js similarity index 100% rename from src/js/actions/classifications/correspondences/general.js rename to app/src/js/actions/classifications/correspondences/general.js diff --git a/src/js/actions/classifications/correspondences/list.js b/app/src/js/actions/classifications/correspondences/list.js similarity index 100% rename from src/js/actions/classifications/correspondences/list.js rename to app/src/js/actions/classifications/correspondences/list.js diff --git a/src/js/actions/classifications/families/family.js b/app/src/js/actions/classifications/families/family.js similarity index 100% rename from src/js/actions/classifications/families/family.js rename to app/src/js/actions/classifications/families/family.js diff --git a/src/js/actions/classifications/families/general.js b/app/src/js/actions/classifications/families/general.js similarity index 100% rename from src/js/actions/classifications/families/general.js rename to app/src/js/actions/classifications/families/general.js diff --git a/src/js/actions/classifications/families/list.js b/app/src/js/actions/classifications/families/list.js similarity index 100% rename from src/js/actions/classifications/families/list.js rename to app/src/js/actions/classifications/families/list.js diff --git a/src/js/actions/classifications/families/members.js b/app/src/js/actions/classifications/families/members.js similarity index 100% rename from src/js/actions/classifications/families/members.js rename to app/src/js/actions/classifications/families/members.js diff --git a/src/js/actions/classifications/general.js b/app/src/js/actions/classifications/general.js similarity index 100% rename from src/js/actions/classifications/general.js rename to app/src/js/actions/classifications/general.js diff --git a/src/js/actions/classifications/item/general.js b/app/src/js/actions/classifications/item/general.js similarity index 100% rename from src/js/actions/classifications/item/general.js rename to app/src/js/actions/classifications/item/general.js diff --git a/src/js/actions/classifications/item/index.js b/app/src/js/actions/classifications/item/index.js similarity index 100% rename from src/js/actions/classifications/item/index.js rename to app/src/js/actions/classifications/item/index.js diff --git a/src/js/actions/classifications/item/narrowers.js b/app/src/js/actions/classifications/item/narrowers.js similarity index 100% rename from src/js/actions/classifications/item/narrowers.js rename to app/src/js/actions/classifications/item/narrowers.js diff --git a/src/js/actions/classifications/item/notes-all.js b/app/src/js/actions/classifications/item/notes-all.js similarity index 100% rename from src/js/actions/classifications/item/notes-all.js rename to app/src/js/actions/classifications/item/notes-all.js diff --git a/src/js/actions/classifications/item/notes-version.js b/app/src/js/actions/classifications/item/notes-version.js similarity index 100% rename from src/js/actions/classifications/item/notes-version.js rename to app/src/js/actions/classifications/item/notes-version.js diff --git a/src/js/actions/classifications/item/notes-version.spec.js b/app/src/js/actions/classifications/item/notes-version.spec.js similarity index 100% rename from src/js/actions/classifications/item/notes-version.spec.js rename to app/src/js/actions/classifications/item/notes-version.spec.js diff --git a/src/js/actions/classifications/items/index.js b/app/src/js/actions/classifications/items/index.js similarity index 100% rename from src/js/actions/classifications/items/index.js rename to app/src/js/actions/classifications/items/index.js diff --git a/src/js/actions/classifications/level/general.js b/app/src/js/actions/classifications/level/general.js similarity index 100% rename from src/js/actions/classifications/level/general.js rename to app/src/js/actions/classifications/level/general.js diff --git a/src/js/actions/classifications/level/index.js b/app/src/js/actions/classifications/level/index.js similarity index 100% rename from src/js/actions/classifications/level/index.js rename to app/src/js/actions/classifications/level/index.js diff --git a/src/js/actions/classifications/level/members.js b/app/src/js/actions/classifications/level/members.js similarity index 100% rename from src/js/actions/classifications/level/members.js rename to app/src/js/actions/classifications/level/members.js diff --git a/src/js/actions/classifications/levels.js b/app/src/js/actions/classifications/levels.js similarity index 100% rename from src/js/actions/classifications/levels.js rename to app/src/js/actions/classifications/levels.js diff --git a/src/js/actions/classifications/list.js b/app/src/js/actions/classifications/list.js similarity index 100% rename from src/js/actions/classifications/list.js rename to app/src/js/actions/classifications/list.js diff --git a/src/js/actions/classifications/series/general.js b/app/src/js/actions/classifications/series/general.js similarity index 100% rename from src/js/actions/classifications/series/general.js rename to app/src/js/actions/classifications/series/general.js diff --git a/src/js/actions/classifications/series/list.js b/app/src/js/actions/classifications/series/list.js similarity index 100% rename from src/js/actions/classifications/series/list.js rename to app/src/js/actions/classifications/series/list.js diff --git a/src/js/actions/classifications/series/members.js b/app/src/js/actions/classifications/series/members.js similarity index 100% rename from src/js/actions/classifications/series/members.js rename to app/src/js/actions/classifications/series/members.js diff --git a/src/js/actions/classifications/series/series.js b/app/src/js/actions/classifications/series/series.js similarity index 100% rename from src/js/actions/classifications/series/series.js rename to app/src/js/actions/classifications/series/series.js diff --git a/src/js/actions/collections/collection.js b/app/src/js/actions/collections/collection.js similarity index 100% rename from src/js/actions/collections/collection.js rename to app/src/js/actions/collections/collection.js diff --git a/src/js/actions/collections/create.js b/app/src/js/actions/collections/create.js similarity index 100% rename from src/js/actions/collections/create.js rename to app/src/js/actions/collections/create.js diff --git a/src/js/actions/collections/export-multi.js b/app/src/js/actions/collections/export-multi.js similarity index 100% rename from src/js/actions/collections/export-multi.js rename to app/src/js/actions/collections/export-multi.js diff --git a/src/js/actions/collections/export-one.js b/app/src/js/actions/collections/export-one.js similarity index 100% rename from src/js/actions/collections/export-one.js rename to app/src/js/actions/collections/export-one.js diff --git a/src/js/actions/collections/general.js b/app/src/js/actions/collections/general.js similarity index 100% rename from src/js/actions/collections/general.js rename to app/src/js/actions/collections/general.js diff --git a/src/js/actions/collections/list.js b/app/src/js/actions/collections/list.js similarity index 100% rename from src/js/actions/collections/list.js rename to app/src/js/actions/collections/list.js diff --git a/src/js/actions/collections/members.js b/app/src/js/actions/collections/members.js similarity index 100% rename from src/js/actions/collections/members.js rename to app/src/js/actions/collections/members.js diff --git a/src/js/actions/collections/send.js b/app/src/js/actions/collections/send.js similarity index 100% rename from src/js/actions/collections/send.js rename to app/src/js/actions/collections/send.js diff --git a/src/js/actions/collections/update.js b/app/src/js/actions/collections/update.js similarity index 100% rename from src/js/actions/collections/update.js rename to app/src/js/actions/collections/update.js diff --git a/src/js/actions/collections/validate-list.js b/app/src/js/actions/collections/validate-list.js similarity index 100% rename from src/js/actions/collections/validate-list.js rename to app/src/js/actions/collections/validate-list.js diff --git a/src/js/actions/collections/validate.js b/app/src/js/actions/collections/validate.js similarity index 100% rename from src/js/actions/collections/validate.js rename to app/src/js/actions/collections/validate.js diff --git a/src/js/actions/concepts/concept-and-all-notes.js b/app/src/js/actions/concepts/concept-and-all-notes.js similarity index 100% rename from src/js/actions/concepts/concept-and-all-notes.js rename to app/src/js/actions/concepts/concept-and-all-notes.js diff --git a/src/js/actions/concepts/concept.js b/app/src/js/actions/concepts/concept.js similarity index 100% rename from src/js/actions/concepts/concept.js rename to app/src/js/actions/concepts/concept.js diff --git a/src/js/actions/concepts/create.js b/app/src/js/actions/concepts/create.js similarity index 100% rename from src/js/actions/concepts/create.js rename to app/src/js/actions/concepts/create.js diff --git a/src/js/actions/concepts/delete.js b/app/src/js/actions/concepts/delete.js similarity index 100% rename from src/js/actions/concepts/delete.js rename to app/src/js/actions/concepts/delete.js diff --git a/src/js/actions/concepts/delete.spec.js b/app/src/js/actions/concepts/delete.spec.js similarity index 100% rename from src/js/actions/concepts/delete.spec.js rename to app/src/js/actions/concepts/delete.spec.js diff --git a/src/js/actions/concepts/export-multi.js b/app/src/js/actions/concepts/export-multi.js similarity index 100% rename from src/js/actions/concepts/export-multi.js rename to app/src/js/actions/concepts/export-multi.js diff --git a/src/js/actions/concepts/export-one.js b/app/src/js/actions/concepts/export-one.js similarity index 100% rename from src/js/actions/concepts/export-one.js rename to app/src/js/actions/concepts/export-one.js diff --git a/src/js/actions/concepts/general.js b/app/src/js/actions/concepts/general.js similarity index 100% rename from src/js/actions/concepts/general.js rename to app/src/js/actions/concepts/general.js diff --git a/src/js/actions/concepts/links.js b/app/src/js/actions/concepts/links.js similarity index 100% rename from src/js/actions/concepts/links.js rename to app/src/js/actions/concepts/links.js diff --git a/src/js/actions/concepts/list.js b/app/src/js/actions/concepts/list.js similarity index 100% rename from src/js/actions/concepts/list.js rename to app/src/js/actions/concepts/list.js diff --git a/src/js/actions/concepts/list.spec.js b/app/src/js/actions/concepts/list.spec.js similarity index 100% rename from src/js/actions/concepts/list.spec.js rename to app/src/js/actions/concepts/list.spec.js diff --git a/src/js/actions/concepts/notes-all.js b/app/src/js/actions/concepts/notes-all.js similarity index 100% rename from src/js/actions/concepts/notes-all.js rename to app/src/js/actions/concepts/notes-all.js diff --git a/src/js/actions/concepts/notes-version.js b/app/src/js/actions/concepts/notes-version.js similarity index 100% rename from src/js/actions/concepts/notes-version.js rename to app/src/js/actions/concepts/notes-version.js diff --git a/src/js/actions/concepts/search-list.js b/app/src/js/actions/concepts/search-list.js similarity index 100% rename from src/js/actions/concepts/search-list.js rename to app/src/js/actions/concepts/search-list.js diff --git a/src/js/actions/concepts/send.js b/app/src/js/actions/concepts/send.js similarity index 100% rename from src/js/actions/concepts/send.js rename to app/src/js/actions/concepts/send.js diff --git a/src/js/actions/concepts/update.js b/app/src/js/actions/concepts/update.js similarity index 100% rename from src/js/actions/concepts/update.js rename to app/src/js/actions/concepts/update.js diff --git a/src/js/actions/concepts/validate-list.js b/app/src/js/actions/concepts/validate-list.js similarity index 100% rename from src/js/actions/concepts/validate-list.js rename to app/src/js/actions/concepts/validate-list.js diff --git a/src/js/actions/concepts/validate.js b/app/src/js/actions/concepts/validate.js similarity index 100% rename from src/js/actions/concepts/validate.js rename to app/src/js/actions/concepts/validate.js diff --git a/src/js/actions/constants/app.js b/app/src/js/actions/constants/app.js similarity index 100% rename from src/js/actions/constants/app.js rename to app/src/js/actions/constants/app.js diff --git a/src/js/actions/constants/classifications.js b/app/src/js/actions/constants/classifications.js similarity index 100% rename from src/js/actions/constants/classifications.js rename to app/src/js/actions/constants/classifications.js diff --git a/src/js/actions/constants/codeList.js b/app/src/js/actions/constants/codeList.js similarity index 100% rename from src/js/actions/constants/codeList.js rename to app/src/js/actions/constants/codeList.js diff --git a/src/js/actions/constants/concepts.js b/app/src/js/actions/constants/concepts.js similarity index 100% rename from src/js/actions/constants/concepts.js rename to app/src/js/actions/constants/concepts.js diff --git a/src/js/actions/constants/index.js b/app/src/js/actions/constants/index.js similarity index 100% rename from src/js/actions/constants/index.js rename to app/src/js/actions/constants/index.js diff --git a/src/js/actions/constants/operations.js b/app/src/js/actions/constants/operations.js similarity index 100% rename from src/js/actions/constants/operations.js rename to app/src/js/actions/constants/operations.js diff --git a/src/js/actions/constants/operations/codeList.js b/app/src/js/actions/constants/operations/codeList.js similarity index 100% rename from src/js/actions/constants/operations/codeList.js rename to app/src/js/actions/constants/operations/codeList.js diff --git a/src/js/actions/constants/operations/documents.js b/app/src/js/actions/constants/operations/documents.js similarity index 100% rename from src/js/actions/constants/operations/documents.js rename to app/src/js/actions/constants/operations/documents.js diff --git a/src/js/actions/constants/operations/families.js b/app/src/js/actions/constants/operations/families.js similarity index 70% rename from src/js/actions/constants/operations/families.js rename to app/src/js/actions/constants/operations/families.js index 21d861cd5..6a915f222 100644 --- a/src/js/actions/constants/operations/families.js +++ b/app/src/js/actions/constants/operations/families.js @@ -10,3 +10,10 @@ export const LOAD_OPERATIONS_FAMILIES_LIST_SUCCESS = 'LOAD_OPERATIONS_FAMILIES_LIST_SUCCESS'; export const LOAD_OPERATIONS_FAMILIES_LIST_FAILURE = 'LOAD_OPERATIONS_FAMILIES_LIST_FAILURE'; + +// For the publication +export const PUBLISH_OPERATIONS_FAMILY = 'PUBLISH_OPERATIONS_FAMILY'; +export const PUBLISH_OPERATIONS_FAMILY_SUCCESS = + 'PUBLISH_OPERATIONS_FAMILY_SUCCESS'; +export const PUBLISH_OPERATIONS_FAMILY_FAILURE = + 'PUBLISH_OPERATIONS_FAMILY_FAILURE'; diff --git a/src/js/actions/constants/operations/indicators.js b/app/src/js/actions/constants/operations/indicators.js similarity index 100% rename from src/js/actions/constants/operations/indicators.js rename to app/src/js/actions/constants/operations/indicators.js diff --git a/src/js/actions/constants/operations/operations.js b/app/src/js/actions/constants/operations/operations.js similarity index 100% rename from src/js/actions/constants/operations/operations.js rename to app/src/js/actions/constants/operations/operations.js diff --git a/src/js/actions/constants/operations/organisations.js b/app/src/js/actions/constants/operations/organisations.js similarity index 100% rename from src/js/actions/constants/operations/organisations.js rename to app/src/js/actions/constants/operations/organisations.js diff --git a/src/js/actions/constants/operations/series.js b/app/src/js/actions/constants/operations/series.js similarity index 100% rename from src/js/actions/constants/operations/series.js rename to app/src/js/actions/constants/operations/series.js diff --git a/src/js/actions/constants/operations/sims.js b/app/src/js/actions/constants/operations/sims.js similarity index 100% rename from src/js/actions/constants/operations/sims.js rename to app/src/js/actions/constants/operations/sims.js diff --git a/src/js/actions/dashboard/collections.js b/app/src/js/actions/dashboard/collections.js similarity index 100% rename from src/js/actions/dashboard/collections.js rename to app/src/js/actions/dashboard/collections.js diff --git a/src/js/actions/dashboard/collections.spec.js b/app/src/js/actions/dashboard/collections.spec.js similarity index 100% rename from src/js/actions/dashboard/collections.spec.js rename to app/src/js/actions/dashboard/collections.spec.js diff --git a/src/js/actions/dissemination-status.js b/app/src/js/actions/dissemination-status.js similarity index 100% rename from src/js/actions/dissemination-status.js rename to app/src/js/actions/dissemination-status.js diff --git a/src/js/actions/index.js b/app/src/js/actions/index.js similarity index 100% rename from src/js/actions/index.js rename to app/src/js/actions/index.js diff --git a/src/js/actions/operations/documents/item.js b/app/src/js/actions/operations/documents/item.js similarity index 100% rename from src/js/actions/operations/documents/item.js rename to app/src/js/actions/operations/documents/item.js diff --git a/src/js/actions/operations/documents/item.spec.js b/app/src/js/actions/operations/documents/item.spec.js similarity index 100% rename from src/js/actions/operations/documents/item.spec.js rename to app/src/js/actions/operations/documents/item.spec.js diff --git a/src/js/actions/operations/documents/list.js b/app/src/js/actions/operations/documents/list.js similarity index 100% rename from src/js/actions/operations/documents/list.js rename to app/src/js/actions/operations/documents/list.js diff --git a/src/js/actions/operations/export-varBook.js b/app/src/js/actions/operations/export-varBook.js similarity index 100% rename from src/js/actions/operations/export-varBook.js rename to app/src/js/actions/operations/export-varBook.js diff --git a/src/js/actions/operations/families/item.js b/app/src/js/actions/operations/families/item.js similarity index 76% rename from src/js/actions/operations/families/item.js rename to app/src/js/actions/operations/families/item.js index b4f0b9d2f..83a3f6557 100644 --- a/src/js/actions/operations/families/item.js +++ b/app/src/js/actions/operations/families/item.js @@ -1,6 +1,13 @@ import api from 'js/remote-api/operations-api'; import * as A from 'js/actions/constants'; -import { getItemFactory } from '../utils'; +import { getPublishFactory, getItemFactory } from '../utils'; + +export const publishFamily = getPublishFactory( + api.publishFamily, + A.PUBLISH_OPERATIONS_FAMILY, + A.PUBLISH_OPERATIONS_FAMILY_SUCCESS, + A.PUBLISH_OPERATIONS_FAMILY_FAILURE +); export const saveFamily = (family, callback) => dispatch => { dispatch({ diff --git a/src/js/actions/operations/families/item.spec.js b/app/src/js/actions/operations/families/item.spec.js similarity index 100% rename from src/js/actions/operations/families/item.spec.js rename to app/src/js/actions/operations/families/item.spec.js diff --git a/src/js/actions/operations/families/list.js b/app/src/js/actions/operations/families/list.js similarity index 100% rename from src/js/actions/operations/families/list.js rename to app/src/js/actions/operations/families/list.js diff --git a/src/js/actions/operations/families/list.spec.js b/app/src/js/actions/operations/families/list.spec.js similarity index 100% rename from src/js/actions/operations/families/list.spec.js rename to app/src/js/actions/operations/families/list.spec.js diff --git a/src/js/actions/operations/indicators/item.js b/app/src/js/actions/operations/indicators/item.js similarity index 100% rename from src/js/actions/operations/indicators/item.js rename to app/src/js/actions/operations/indicators/item.js diff --git a/src/js/actions/operations/indicators/item.spec.js b/app/src/js/actions/operations/indicators/item.spec.js similarity index 100% rename from src/js/actions/operations/indicators/item.spec.js rename to app/src/js/actions/operations/indicators/item.spec.js diff --git a/src/js/actions/operations/indicators/list.js b/app/src/js/actions/operations/indicators/list.js similarity index 100% rename from src/js/actions/operations/indicators/list.js rename to app/src/js/actions/operations/indicators/list.js diff --git a/src/js/actions/operations/indicators/list.spec.js b/app/src/js/actions/operations/indicators/list.spec.js similarity index 100% rename from src/js/actions/operations/indicators/list.spec.js rename to app/src/js/actions/operations/indicators/list.spec.js diff --git a/src/js/actions/operations/metadatastructure/list.js b/app/src/js/actions/operations/metadatastructure/list.js similarity index 100% rename from src/js/actions/operations/metadatastructure/list.js rename to app/src/js/actions/operations/metadatastructure/list.js diff --git a/src/js/actions/operations/metadatastructure/list.spec.js b/app/src/js/actions/operations/metadatastructure/list.spec.js similarity index 100% rename from src/js/actions/operations/metadatastructure/list.spec.js rename to app/src/js/actions/operations/metadatastructure/list.spec.js diff --git a/src/js/actions/operations/operations/item.js b/app/src/js/actions/operations/operations/item.js similarity index 100% rename from src/js/actions/operations/operations/item.js rename to app/src/js/actions/operations/operations/item.js diff --git a/src/js/actions/operations/operations/item.spec.js b/app/src/js/actions/operations/operations/item.spec.js similarity index 100% rename from src/js/actions/operations/operations/item.spec.js rename to app/src/js/actions/operations/operations/item.spec.js diff --git a/src/js/actions/operations/operations/list.js b/app/src/js/actions/operations/operations/list.js similarity index 100% rename from src/js/actions/operations/operations/list.js rename to app/src/js/actions/operations/operations/list.js diff --git a/src/js/actions/operations/operations/list.spec.js b/app/src/js/actions/operations/operations/list.spec.js similarity index 100% rename from src/js/actions/operations/operations/list.spec.js rename to app/src/js/actions/operations/operations/list.spec.js diff --git a/src/js/actions/operations/series/item.js b/app/src/js/actions/operations/series/item.js similarity index 100% rename from src/js/actions/operations/series/item.js rename to app/src/js/actions/operations/series/item.js diff --git a/src/js/actions/operations/series/item.spec.js b/app/src/js/actions/operations/series/item.spec.js similarity index 100% rename from src/js/actions/operations/series/item.spec.js rename to app/src/js/actions/operations/series/item.spec.js diff --git a/src/js/actions/operations/series/list.js b/app/src/js/actions/operations/series/list.js similarity index 100% rename from src/js/actions/operations/series/list.js rename to app/src/js/actions/operations/series/list.js diff --git a/src/js/actions/operations/series/list.spec.js b/app/src/js/actions/operations/series/list.spec.js similarity index 100% rename from src/js/actions/operations/series/list.spec.js rename to app/src/js/actions/operations/series/list.spec.js diff --git a/src/js/actions/operations/sims/item.js b/app/src/js/actions/operations/sims/item.js similarity index 100% rename from src/js/actions/operations/sims/item.js rename to app/src/js/actions/operations/sims/item.js diff --git a/src/js/actions/operations/sims/item.spec.js b/app/src/js/actions/operations/sims/item.spec.js similarity index 100% rename from src/js/actions/operations/sims/item.spec.js rename to app/src/js/actions/operations/sims/item.spec.js diff --git a/src/js/actions/operations/utils/index.js b/app/src/js/actions/operations/utils/index.js similarity index 67% rename from src/js/actions/operations/utils/index.js rename to app/src/js/actions/operations/utils/index.js index 7bb6c1192..1b567a403 100644 --- a/src/js/actions/operations/utils/index.js +++ b/app/src/js/actions/operations/utils/index.js @@ -21,6 +21,31 @@ export default (remoteCall, LOADING, SUCCESS, FAILURE) => dispatch => { ); }; +// TODO Add Unit Test +export const getPublishFactory = (remoteCall, LOADING, SUCCESS, FAILURE) => { + return object => dispatch => { + dispatch({ + type: LOADING, + payload: {}, + }); + + return remoteCall(object).then( + results => { + dispatch({ + type: SUCCESS, + payload: results, + }); + }, + err => { + dispatch({ + type: FAILURE, + payload: { err }, + }); + } + ); + }; +}; + export const getItemFactory = (remoteCall, LOADING, SUCCESS, FAILURE) => id => ( dispatch, getState diff --git a/app/src/js/actions/operations/utils/index.spec.js b/app/src/js/actions/operations/utils/index.spec.js new file mode 100644 index 000000000..26a3eed90 --- /dev/null +++ b/app/src/js/actions/operations/utils/index.spec.js @@ -0,0 +1,83 @@ +import { getItemFactory, getPublishFactory } from './index'; + +const dispatch = jest.fn(); + +describe('getItemFactory', () => { + beforeEach(() => dispatch.mockClear()); + + it('should call dispatch SUCCESS action with the right operation', async () => { + const remoteCall = function() { + return Promise.resolve('result'); + }; + const id = 1; + await getItemFactory(remoteCall, 'LOADING', 'SUCCESS', 'FAILURE')(id)( + dispatch, + () => ({}) + ); + expect(dispatch).toHaveBeenCalledWith({ + type: 'LOADING', + payload: { id }, + }); + expect(dispatch).toHaveBeenLastCalledWith({ + type: 'SUCCESS', + payload: 'result', + }); + }); + it('should call dispatch FAILURE action with the error', async () => { + const remoteCall = function() { + return Promise.reject('error'); + }; + const id = 1; + await getItemFactory(remoteCall, 'LOADING', 'SUCCESS', 'FAILURE')(id)( + dispatch, + () => ({}) + ); + expect(dispatch).toHaveBeenCalledWith({ + type: 'LOADING', + payload: { id }, + }); + expect(dispatch).toHaveBeenLastCalledWith({ + type: 'FAILURE', + payload: { err: 'error' }, + }); + }); +}); + +describe('getPublishFactory', () => { + beforeEach(() => dispatch.mockClear()); + + it('should call dispatch SUCCESS action with the right operation', async () => { + const remoteCall = function() { + return Promise.resolve('result'); + }; + const id = 1; + await getPublishFactory(remoteCall, 'LOADING', 'SUCCESS', 'FAILURE')({ + id, + })(dispatch); + expect(dispatch).toHaveBeenCalledWith({ + type: 'LOADING', + payload: {}, + }); + expect(dispatch).toHaveBeenLastCalledWith({ + type: 'SUCCESS', + payload: 'result', + }); + }); + it('should call dispatch FAILURE action with the error', async () => { + const remoteCall = function() { + return Promise.reject('error'); + }; + const id = 1; + await getPublishFactory(remoteCall, 'LOADING', 'SUCCESS', 'FAILURE')({ + id, + })(dispatch); + expect(dispatch).toHaveBeenCalledWith({ + type: 'LOADING', + payload: {}, + }); + expect(dispatch).toHaveBeenLastCalledWith({ + type: 'FAILURE', + payload: { err: 'error' }, + }); + }); +}); diff --git a/src/js/actions/operations/utils/setup.js b/app/src/js/actions/operations/utils/setup.js similarity index 100% rename from src/js/actions/operations/utils/setup.js rename to app/src/js/actions/operations/utils/setup.js diff --git a/src/js/actions/operations/utils/setup.spec.js b/app/src/js/actions/operations/utils/setup.spec.js similarity index 100% rename from src/js/actions/operations/utils/setup.spec.js rename to app/src/js/actions/operations/utils/setup.spec.js diff --git a/src/js/actions/roles/add.js b/app/src/js/actions/roles/add.js similarity index 100% rename from src/js/actions/roles/add.js rename to app/src/js/actions/roles/add.js diff --git a/src/js/actions/roles/add.spec.js b/app/src/js/actions/roles/add.spec.js similarity index 100% rename from src/js/actions/roles/add.spec.js rename to app/src/js/actions/roles/add.spec.js diff --git a/src/js/actions/roles/agent.js b/app/src/js/actions/roles/agent.js similarity index 100% rename from src/js/actions/roles/agent.js rename to app/src/js/actions/roles/agent.js diff --git a/src/js/actions/roles/agent.spec.js b/app/src/js/actions/roles/agent.spec.js similarity index 100% rename from src/js/actions/roles/agent.spec.js rename to app/src/js/actions/roles/agent.spec.js diff --git a/src/js/actions/roles/delete.js b/app/src/js/actions/roles/delete.js similarity index 100% rename from src/js/actions/roles/delete.js rename to app/src/js/actions/roles/delete.js diff --git a/src/js/actions/roles/delete.spec.js b/app/src/js/actions/roles/delete.spec.js similarity index 100% rename from src/js/actions/roles/delete.spec.js rename to app/src/js/actions/roles/delete.spec.js diff --git a/src/js/actions/roles/role.js b/app/src/js/actions/roles/role.js similarity index 100% rename from src/js/actions/roles/role.js rename to app/src/js/actions/roles/role.js diff --git a/src/js/actions/roles/role.spec.js b/app/src/js/actions/roles/role.spec.js similarity index 100% rename from src/js/actions/roles/role.spec.js rename to app/src/js/actions/roles/role.spec.js diff --git a/src/js/actions/stamp.js b/app/src/js/actions/stamp.js similarity index 100% rename from src/js/actions/stamp.js rename to app/src/js/actions/stamp.js diff --git a/src/js/components/administration/dashboard/concepts/__snapshots__/controls.spec.js.snap b/app/src/js/components/administration/dashboard/concepts/__snapshots__/controls.spec.js.snap similarity index 100% rename from src/js/components/administration/dashboard/concepts/__snapshots__/controls.spec.js.snap rename to app/src/js/components/administration/dashboard/concepts/__snapshots__/controls.spec.js.snap diff --git a/src/js/components/administration/dashboard/concepts/collections/creations-modifications/creations-modifications.spec.js b/app/src/js/components/administration/dashboard/concepts/collections/creations-modifications/creations-modifications.spec.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/collections/creations-modifications/creations-modifications.spec.js rename to app/src/js/components/administration/dashboard/concepts/collections/creations-modifications/creations-modifications.spec.js diff --git a/src/js/components/administration/dashboard/concepts/collections/creations-modifications/data.js b/app/src/js/components/administration/dashboard/concepts/collections/creations-modifications/data.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/collections/creations-modifications/data.js rename to app/src/js/components/administration/dashboard/concepts/collections/creations-modifications/data.js diff --git a/src/js/components/administration/dashboard/concepts/collections/creations-modifications/index.js b/app/src/js/components/administration/dashboard/concepts/collections/creations-modifications/index.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/collections/creations-modifications/index.js rename to app/src/js/components/administration/dashboard/concepts/collections/creations-modifications/index.js diff --git a/src/js/components/administration/dashboard/concepts/collections/summary/index.js b/app/src/js/components/administration/dashboard/concepts/collections/summary/index.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/collections/summary/index.js rename to app/src/js/components/administration/dashboard/concepts/collections/summary/index.js diff --git a/src/js/components/administration/dashboard/concepts/collections/summary/stamps-data.js b/app/src/js/components/administration/dashboard/concepts/collections/summary/stamps-data.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/collections/summary/stamps-data.js rename to app/src/js/components/administration/dashboard/concepts/collections/summary/stamps-data.js diff --git a/src/js/components/administration/dashboard/concepts/collections/summary/summary-data.js b/app/src/js/components/administration/dashboard/concepts/collections/summary/summary-data.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/collections/summary/summary-data.js rename to app/src/js/components/administration/dashboard/concepts/collections/summary/summary-data.js diff --git a/src/js/components/administration/dashboard/concepts/collections/summary/summary.spec.js b/app/src/js/components/administration/dashboard/concepts/collections/summary/summary.spec.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/collections/summary/summary.spec.js rename to app/src/js/components/administration/dashboard/concepts/collections/summary/summary.spec.js diff --git a/src/js/components/administration/dashboard/concepts/concepts/creations-modifications/creations-modifications.spec.js b/app/src/js/components/administration/dashboard/concepts/concepts/creations-modifications/creations-modifications.spec.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/concepts/creations-modifications/creations-modifications.spec.js rename to app/src/js/components/administration/dashboard/concepts/concepts/creations-modifications/creations-modifications.spec.js diff --git a/src/js/components/administration/dashboard/concepts/concepts/creations-modifications/data.js b/app/src/js/components/administration/dashboard/concepts/concepts/creations-modifications/data.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/concepts/creations-modifications/data.js rename to app/src/js/components/administration/dashboard/concepts/concepts/creations-modifications/data.js diff --git a/src/js/components/administration/dashboard/concepts/concepts/creations-modifications/index.js b/app/src/js/components/administration/dashboard/concepts/concepts/creations-modifications/index.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/concepts/creations-modifications/index.js rename to app/src/js/components/administration/dashboard/concepts/concepts/creations-modifications/index.js diff --git a/src/js/components/administration/dashboard/concepts/concepts/summary/index.js b/app/src/js/components/administration/dashboard/concepts/concepts/summary/index.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/concepts/summary/index.js rename to app/src/js/components/administration/dashboard/concepts/concepts/summary/index.js diff --git a/src/js/components/administration/dashboard/concepts/concepts/summary/stamps-data.js b/app/src/js/components/administration/dashboard/concepts/concepts/summary/stamps-data.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/concepts/summary/stamps-data.js rename to app/src/js/components/administration/dashboard/concepts/concepts/summary/stamps-data.js diff --git a/src/js/components/administration/dashboard/concepts/concepts/summary/summary-data.js b/app/src/js/components/administration/dashboard/concepts/concepts/summary/summary-data.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/concepts/summary/summary-data.js rename to app/src/js/components/administration/dashboard/concepts/concepts/summary/summary-data.js diff --git a/src/js/components/administration/dashboard/concepts/concepts/summary/summary.spec.js b/app/src/js/components/administration/dashboard/concepts/concepts/summary/summary.spec.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/concepts/summary/summary.spec.js rename to app/src/js/components/administration/dashboard/concepts/concepts/summary/summary.spec.js diff --git a/src/js/components/administration/dashboard/concepts/controls.js b/app/src/js/components/administration/dashboard/concepts/controls.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/controls.js rename to app/src/js/components/administration/dashboard/concepts/controls.js diff --git a/src/js/components/administration/dashboard/concepts/controls.spec.js b/app/src/js/components/administration/dashboard/concepts/controls.spec.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/controls.spec.js rename to app/src/js/components/administration/dashboard/concepts/controls.spec.js diff --git a/src/js/components/administration/dashboard/concepts/home-container.js b/app/src/js/components/administration/dashboard/concepts/home-container.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/home-container.js rename to app/src/js/components/administration/dashboard/concepts/home-container.js diff --git a/src/js/components/administration/dashboard/concepts/home.js b/app/src/js/components/administration/dashboard/concepts/home.js similarity index 100% rename from src/js/components/administration/dashboard/concepts/home.js rename to app/src/js/components/administration/dashboard/concepts/home.js diff --git a/src/js/components/administration/home-container.js b/app/src/js/components/administration/home-container.js similarity index 100% rename from src/js/components/administration/home-container.js rename to app/src/js/components/administration/home-container.js diff --git a/src/js/components/administration/home.js b/app/src/js/components/administration/home.js similarity index 100% rename from src/js/components/administration/home.js rename to app/src/js/components/administration/home.js diff --git a/src/js/components/administration/home.scss b/app/src/js/components/administration/home.scss similarity index 100% rename from src/js/components/administration/home.scss rename to app/src/js/components/administration/home.scss diff --git a/src/js/components/administration/home.spec.js b/app/src/js/components/administration/home.spec.js similarity index 100% rename from src/js/components/administration/home.spec.js rename to app/src/js/components/administration/home.spec.js diff --git a/src/js/components/administration/roles/home-container.js b/app/src/js/components/administration/roles/home-container.js similarity index 100% rename from src/js/components/administration/roles/home-container.js rename to app/src/js/components/administration/roles/home-container.js diff --git a/src/js/components/administration/roles/update.js b/app/src/js/components/administration/roles/update.js similarity index 100% rename from src/js/components/administration/roles/update.js rename to app/src/js/components/administration/roles/update.js diff --git a/src/js/components/administration/roles/update.spec.js b/app/src/js/components/administration/roles/update.spec.js similarity index 100% rename from src/js/components/administration/roles/update.spec.js rename to app/src/js/components/administration/roles/update.spec.js diff --git a/src/js/components/administration/roles/visualisation.js b/app/src/js/components/administration/roles/visualisation.js similarity index 100% rename from src/js/components/administration/roles/visualisation.js rename to app/src/js/components/administration/roles/visualisation.js diff --git a/src/js/components/administration/roles/visualisation.spec.js b/app/src/js/components/administration/roles/visualisation.spec.js similarity index 100% rename from src/js/components/administration/roles/visualisation.spec.js rename to app/src/js/components/administration/roles/visualisation.spec.js diff --git a/app/src/js/components/app.js b/app/src/js/components/app.js new file mode 100755 index 000000000..3de43441b --- /dev/null +++ b/app/src/js/components/app.js @@ -0,0 +1,32 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; +import D from 'js/i18n'; + +function App() { + document.title = 'Bauhaus'; + + return ( + <> +
+

{D.welcome}

+
+ + + ); +} + +export default App; diff --git a/src/js/components/auth/basic-auth/login-container.js b/app/src/js/components/auth/basic-auth/login-container.js similarity index 100% rename from src/js/components/auth/basic-auth/login-container.js rename to app/src/js/components/auth/basic-auth/login-container.js diff --git a/src/js/components/auth/basic-auth/login.js b/app/src/js/components/auth/basic-auth/login.js similarity index 100% rename from src/js/components/auth/basic-auth/login.js rename to app/src/js/components/auth/basic-auth/login.js diff --git a/src/js/components/auth/hoc.js b/app/src/js/components/auth/hoc.js similarity index 100% rename from src/js/components/auth/hoc.js rename to app/src/js/components/auth/hoc.js diff --git a/src/js/components/auth/hoc.spec.js b/app/src/js/components/auth/hoc.spec.js similarity index 100% rename from src/js/components/auth/hoc.spec.js rename to app/src/js/components/auth/hoc.spec.js diff --git a/src/js/components/auth/no-auth/login.js b/app/src/js/components/auth/no-auth/login.js similarity index 100% rename from src/js/components/auth/no-auth/login.js rename to app/src/js/components/auth/no-auth/login.js diff --git a/src/js/components/auth/open-id-connect-auth/login-container.js b/app/src/js/components/auth/open-id-connect-auth/login-container.js similarity index 100% rename from src/js/components/auth/open-id-connect-auth/login-container.js rename to app/src/js/components/auth/open-id-connect-auth/login-container.js diff --git a/src/js/components/auth/open-id-connect-auth/login-container.spec.js b/app/src/js/components/auth/open-id-connect-auth/login-container.spec.js similarity index 100% rename from src/js/components/auth/open-id-connect-auth/login-container.spec.js rename to app/src/js/components/auth/open-id-connect-auth/login-container.spec.js diff --git a/src/js/components/classifications/correspondences/association/controls.js b/app/src/js/components/classifications/correspondences/association/controls.js similarity index 100% rename from src/js/components/classifications/correspondences/association/controls.js rename to app/src/js/components/classifications/correspondences/association/controls.js diff --git a/src/js/components/classifications/correspondences/association/controls.spec.js b/app/src/js/components/classifications/correspondences/association/controls.spec.js similarity index 100% rename from src/js/components/classifications/correspondences/association/controls.spec.js rename to app/src/js/components/classifications/correspondences/association/controls.spec.js diff --git a/src/js/components/classifications/correspondences/association/general-fields.js b/app/src/js/components/classifications/correspondences/association/general-fields.js similarity index 100% rename from src/js/components/classifications/correspondences/association/general-fields.js rename to app/src/js/components/classifications/correspondences/association/general-fields.js diff --git a/src/js/components/classifications/correspondences/association/home-container.js b/app/src/js/components/classifications/correspondences/association/home-container.js similarity index 100% rename from src/js/components/classifications/correspondences/association/home-container.js rename to app/src/js/components/classifications/correspondences/association/home-container.js diff --git a/src/js/components/classifications/correspondences/association/home.js b/app/src/js/components/classifications/correspondences/association/home.js similarity index 100% rename from src/js/components/classifications/correspondences/association/home.js rename to app/src/js/components/classifications/correspondences/association/home.js diff --git a/src/js/components/classifications/correspondences/association/home.spec.js b/app/src/js/components/classifications/correspondences/association/home.spec.js similarity index 100% rename from src/js/components/classifications/correspondences/association/home.spec.js rename to app/src/js/components/classifications/correspondences/association/home.spec.js diff --git a/src/js/components/classifications/correspondences/home-container.js b/app/src/js/components/classifications/correspondences/home-container.js similarity index 100% rename from src/js/components/classifications/correspondences/home-container.js rename to app/src/js/components/classifications/correspondences/home-container.js diff --git a/src/js/components/classifications/correspondences/home-container.spec.js b/app/src/js/components/classifications/correspondences/home-container.spec.js similarity index 100% rename from src/js/components/classifications/correspondences/home-container.spec.js rename to app/src/js/components/classifications/correspondences/home-container.spec.js diff --git a/src/js/components/classifications/correspondences/home.js b/app/src/js/components/classifications/correspondences/home.js similarity index 100% rename from src/js/components/classifications/correspondences/home.js rename to app/src/js/components/classifications/correspondences/home.js diff --git a/src/js/components/classifications/correspondences/home.spec.js b/app/src/js/components/classifications/correspondences/home.spec.js similarity index 100% rename from src/js/components/classifications/correspondences/home.spec.js rename to app/src/js/components/classifications/correspondences/home.spec.js diff --git a/src/js/components/classifications/correspondences/visualization/controls.js b/app/src/js/components/classifications/correspondences/visualization/controls.js similarity index 100% rename from src/js/components/classifications/correspondences/visualization/controls.js rename to app/src/js/components/classifications/correspondences/visualization/controls.js diff --git a/src/js/components/classifications/correspondences/visualization/controls.spec.js b/app/src/js/components/classifications/correspondences/visualization/controls.spec.js similarity index 100% rename from src/js/components/classifications/correspondences/visualization/controls.spec.js rename to app/src/js/components/classifications/correspondences/visualization/controls.spec.js diff --git a/src/js/components/classifications/correspondences/visualization/general-fields.js b/app/src/js/components/classifications/correspondences/visualization/general-fields.js similarity index 100% rename from src/js/components/classifications/correspondences/visualization/general-fields.js rename to app/src/js/components/classifications/correspondences/visualization/general-fields.js diff --git a/src/js/components/classifications/correspondences/visualization/home-associations.js b/app/src/js/components/classifications/correspondences/visualization/home-associations.js similarity index 100% rename from src/js/components/classifications/correspondences/visualization/home-associations.js rename to app/src/js/components/classifications/correspondences/visualization/home-associations.js diff --git a/src/js/components/classifications/correspondences/visualization/home-associations.spec.js b/app/src/js/components/classifications/correspondences/visualization/home-associations.spec.js similarity index 100% rename from src/js/components/classifications/correspondences/visualization/home-associations.spec.js rename to app/src/js/components/classifications/correspondences/visualization/home-associations.spec.js diff --git a/src/js/components/classifications/correspondences/visualization/home-container.js b/app/src/js/components/classifications/correspondences/visualization/home-container.js similarity index 100% rename from src/js/components/classifications/correspondences/visualization/home-container.js rename to app/src/js/components/classifications/correspondences/visualization/home-container.js diff --git a/src/js/components/classifications/correspondences/visualization/home-general.js b/app/src/js/components/classifications/correspondences/visualization/home-general.js similarity index 100% rename from src/js/components/classifications/correspondences/visualization/home-general.js rename to app/src/js/components/classifications/correspondences/visualization/home-general.js diff --git a/src/js/components/classifications/correspondences/visualization/home-general.spec.js b/app/src/js/components/classifications/correspondences/visualization/home-general.spec.js similarity index 100% rename from src/js/components/classifications/correspondences/visualization/home-general.spec.js rename to app/src/js/components/classifications/correspondences/visualization/home-general.spec.js diff --git a/src/js/components/classifications/families/home-container.js b/app/src/js/components/classifications/families/home-container.js similarity index 100% rename from src/js/components/classifications/families/home-container.js rename to app/src/js/components/classifications/families/home-container.js diff --git a/src/js/components/classifications/families/home-container.spec.js b/app/src/js/components/classifications/families/home-container.spec.js similarity index 100% rename from src/js/components/classifications/families/home-container.spec.js rename to app/src/js/components/classifications/families/home-container.spec.js diff --git a/src/js/components/classifications/families/home.js b/app/src/js/components/classifications/families/home.js similarity index 100% rename from src/js/components/classifications/families/home.js rename to app/src/js/components/classifications/families/home.js diff --git a/src/js/components/classifications/families/home.spec.js b/app/src/js/components/classifications/families/home.spec.js similarity index 100% rename from src/js/components/classifications/families/home.spec.js rename to app/src/js/components/classifications/families/home.spec.js diff --git a/src/js/components/classifications/families/visualization/controls.js b/app/src/js/components/classifications/families/visualization/controls.js similarity index 100% rename from src/js/components/classifications/families/visualization/controls.js rename to app/src/js/components/classifications/families/visualization/controls.js diff --git a/src/js/components/classifications/families/visualization/controls.spec.js b/app/src/js/components/classifications/families/visualization/controls.spec.js similarity index 100% rename from src/js/components/classifications/families/visualization/controls.spec.js rename to app/src/js/components/classifications/families/visualization/controls.spec.js diff --git a/src/js/components/classifications/families/visualization/home-container.js b/app/src/js/components/classifications/families/visualization/home-container.js similarity index 100% rename from src/js/components/classifications/families/visualization/home-container.js rename to app/src/js/components/classifications/families/visualization/home-container.js diff --git a/src/js/components/classifications/families/visualization/home.js b/app/src/js/components/classifications/families/visualization/home.js similarity index 100% rename from src/js/components/classifications/families/visualization/home.js rename to app/src/js/components/classifications/families/visualization/home.js diff --git a/src/js/components/classifications/families/visualization/home.spec.js b/app/src/js/components/classifications/families/visualization/home.spec.js similarity index 100% rename from src/js/components/classifications/families/visualization/home.spec.js rename to app/src/js/components/classifications/families/visualization/home.spec.js diff --git a/src/js/components/classifications/families/visualization/members.js b/app/src/js/components/classifications/families/visualization/members.js similarity index 100% rename from src/js/components/classifications/families/visualization/members.js rename to app/src/js/components/classifications/families/visualization/members.js diff --git a/src/js/components/classifications/families/visualization/members.spec.js b/app/src/js/components/classifications/families/visualization/members.spec.js similarity index 100% rename from src/js/components/classifications/families/visualization/members.spec.js rename to app/src/js/components/classifications/families/visualization/members.spec.js diff --git a/src/js/components/classifications/home-container.js b/app/src/js/components/classifications/home-container.js similarity index 100% rename from src/js/components/classifications/home-container.js rename to app/src/js/components/classifications/home-container.js diff --git a/src/js/components/classifications/home-container.spec.js b/app/src/js/components/classifications/home-container.spec.js similarity index 100% rename from src/js/components/classifications/home-container.spec.js rename to app/src/js/components/classifications/home-container.spec.js diff --git a/src/js/components/classifications/home.js b/app/src/js/components/classifications/home.js similarity index 100% rename from src/js/components/classifications/home.js rename to app/src/js/components/classifications/home.js diff --git a/src/js/components/classifications/home.spec.js b/app/src/js/components/classifications/home.spec.js similarity index 100% rename from src/js/components/classifications/home.spec.js rename to app/src/js/components/classifications/home.spec.js diff --git a/src/js/components/classifications/item/compare/controls.js b/app/src/js/components/classifications/item/compare/controls.js similarity index 100% rename from src/js/components/classifications/item/compare/controls.js rename to app/src/js/components/classifications/item/compare/controls.js diff --git a/src/js/components/classifications/item/compare/controls.spec.js b/app/src/js/components/classifications/item/compare/controls.spec.js similarity index 100% rename from src/js/components/classifications/item/compare/controls.spec.js rename to app/src/js/components/classifications/item/compare/controls.spec.js diff --git a/src/js/components/classifications/item/compare/home-container.js b/app/src/js/components/classifications/item/compare/home-container.js similarity index 100% rename from src/js/components/classifications/item/compare/home-container.js rename to app/src/js/components/classifications/item/compare/home-container.js diff --git a/src/js/components/classifications/item/compare/home.js b/app/src/js/components/classifications/item/compare/home.js similarity index 100% rename from src/js/components/classifications/item/compare/home.js rename to app/src/js/components/classifications/item/compare/home.js diff --git a/src/js/components/classifications/item/compare/home.spec.js b/app/src/js/components/classifications/item/compare/home.spec.js similarity index 100% rename from src/js/components/classifications/item/compare/home.spec.js rename to app/src/js/components/classifications/item/compare/home.spec.js diff --git a/src/js/components/classifications/item/controls.js b/app/src/js/components/classifications/item/controls.js similarity index 100% rename from src/js/components/classifications/item/controls.js rename to app/src/js/components/classifications/item/controls.js diff --git a/src/js/components/classifications/item/controls.spec.js b/app/src/js/components/classifications/item/controls.spec.js similarity index 100% rename from src/js/components/classifications/item/controls.spec.js rename to app/src/js/components/classifications/item/controls.spec.js diff --git a/src/js/components/classifications/item/general.js b/app/src/js/components/classifications/item/general.js similarity index 100% rename from src/js/components/classifications/item/general.js rename to app/src/js/components/classifications/item/general.js diff --git a/src/js/components/classifications/item/general.spec.js b/app/src/js/components/classifications/item/general.spec.js similarity index 100% rename from src/js/components/classifications/item/general.spec.js rename to app/src/js/components/classifications/item/general.spec.js diff --git a/src/js/components/classifications/item/home-container.js b/app/src/js/components/classifications/item/home-container.js similarity index 100% rename from src/js/components/classifications/item/home-container.js rename to app/src/js/components/classifications/item/home-container.js diff --git a/src/js/components/classifications/item/home.js b/app/src/js/components/classifications/item/home.js similarity index 100% rename from src/js/components/classifications/item/home.js rename to app/src/js/components/classifications/item/home.js diff --git a/src/js/components/classifications/item/home.spec.js b/app/src/js/components/classifications/item/home.spec.js similarity index 100% rename from src/js/components/classifications/item/home.spec.js rename to app/src/js/components/classifications/item/home.spec.js diff --git a/src/js/components/classifications/item/narrowers.js b/app/src/js/components/classifications/item/narrowers.js similarity index 100% rename from src/js/components/classifications/item/narrowers.js rename to app/src/js/components/classifications/item/narrowers.js diff --git a/src/js/components/classifications/item/narrowers.spec.js b/app/src/js/components/classifications/item/narrowers.spec.js similarity index 100% rename from src/js/components/classifications/item/narrowers.spec.js rename to app/src/js/components/classifications/item/narrowers.spec.js diff --git a/src/js/components/classifications/item/notes.js b/app/src/js/components/classifications/item/notes.js similarity index 100% rename from src/js/components/classifications/item/notes.js rename to app/src/js/components/classifications/item/notes.js diff --git a/src/js/components/classifications/item/notes.spec.js b/app/src/js/components/classifications/item/notes.spec.js similarity index 100% rename from src/js/components/classifications/item/notes.spec.js rename to app/src/js/components/classifications/item/notes.spec.js diff --git a/src/js/components/classifications/level/controls.js b/app/src/js/components/classifications/level/controls.js similarity index 100% rename from src/js/components/classifications/level/controls.js rename to app/src/js/components/classifications/level/controls.js diff --git a/src/js/components/classifications/level/controls.spec.js b/app/src/js/components/classifications/level/controls.spec.js similarity index 100% rename from src/js/components/classifications/level/controls.spec.js rename to app/src/js/components/classifications/level/controls.spec.js diff --git a/src/js/components/classifications/level/general.js b/app/src/js/components/classifications/level/general.js similarity index 100% rename from src/js/components/classifications/level/general.js rename to app/src/js/components/classifications/level/general.js diff --git a/src/js/components/classifications/level/general.spec.js b/app/src/js/components/classifications/level/general.spec.js similarity index 100% rename from src/js/components/classifications/level/general.spec.js rename to app/src/js/components/classifications/level/general.spec.js diff --git a/src/js/components/classifications/level/home-container.js b/app/src/js/components/classifications/level/home-container.js similarity index 100% rename from src/js/components/classifications/level/home-container.js rename to app/src/js/components/classifications/level/home-container.js diff --git a/src/js/components/classifications/level/home.js b/app/src/js/components/classifications/level/home.js similarity index 100% rename from src/js/components/classifications/level/home.js rename to app/src/js/components/classifications/level/home.js diff --git a/src/js/components/classifications/level/home.spec.js b/app/src/js/components/classifications/level/home.spec.js similarity index 100% rename from src/js/components/classifications/level/home.spec.js rename to app/src/js/components/classifications/level/home.spec.js diff --git a/src/js/components/classifications/level/members.js b/app/src/js/components/classifications/level/members.js similarity index 100% rename from src/js/components/classifications/level/members.js rename to app/src/js/components/classifications/level/members.js diff --git a/src/js/components/classifications/level/members.spec.js b/app/src/js/components/classifications/level/members.spec.js similarity index 100% rename from src/js/components/classifications/level/members.spec.js rename to app/src/js/components/classifications/level/members.spec.js diff --git a/src/js/components/menu/classifications/classifications.scss b/app/src/js/components/classifications/menu/classifications.scss similarity index 100% rename from src/js/components/menu/classifications/classifications.scss rename to app/src/js/components/classifications/menu/classifications.scss diff --git a/src/js/components/menu/classifications/classifications.spec.js b/app/src/js/components/classifications/menu/classifications.spec.js similarity index 83% rename from src/js/components/menu/classifications/classifications.spec.js rename to app/src/js/components/classifications/menu/classifications.spec.js index 2544a4fff..27d8820ad 100644 --- a/src/js/components/menu/classifications/classifications.spec.js +++ b/app/src/js/components/classifications/menu/classifications.spec.js @@ -1,6 +1,6 @@ import React from 'react'; import { shallow } from 'enzyme'; -import MenuClassifications from './'; +import MenuClassifications from '.'; describe('menu-classifications', () => { it('renders without crashing', () => { diff --git a/src/js/components/menu/classifications/index.js b/app/src/js/components/classifications/menu/index.js similarity index 98% rename from src/js/components/menu/classifications/index.js rename to app/src/js/components/classifications/menu/index.js index 2028a660a..468ca07f4 100644 --- a/src/js/components/menu/classifications/index.js +++ b/app/src/js/components/classifications/menu/index.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link, withRouter } from 'react-router-dom'; -import MenuReferentiels from '../referentiels'; +import MenuReferentiels from 'js/components/menu/referentiels'; import D from 'js/i18n'; import './classifications.scss'; diff --git a/app/src/js/components/classifications/routes/index.js b/app/src/js/components/classifications/routes/index.js new file mode 100644 index 000000000..b0af9f08f --- /dev/null +++ b/app/src/js/components/classifications/routes/index.js @@ -0,0 +1,100 @@ +import React from 'react'; +import { Switch, Route } from 'react-router-dom'; + +import ClassificationsFamiliesContainer from 'js/components/classifications/families/home-container'; +import ClassificationsFamilyContainer from 'js/components/classifications/families/visualization/home-container'; +import ClassificationsSeriesContainer from 'js/components/classifications/series/home-container'; +import ClassificationsOneSeriesContainer from 'js/components/classifications/series/visualization/home-container'; +import ClassificationsContainer from 'js/components/classifications/home-container'; +import ClassificationContainer from 'js/components/classifications/visualization/home-container'; +import ClassificationItemsContainer from 'js/components/classifications/visualization/items/home-container'; +import ClassificationTreeContainer from 'js/components/classifications/visualization/tree/home-container'; +import ClassificationLevelContainer from 'js/components/classifications/level/home-container'; +import ClassificationItemContainer from 'js/components/classifications/item/home-container'; +import ClassificationItemCompareContainer from 'js/components/classifications/item/compare/home-container'; +import ClassificationsCorrespondencesContainer from 'js/components/classifications/correspondences/home-container'; +import ClassificationsCorrespondenceContainer from 'js/components/classifications/correspondences/visualization/home-container'; +import ClassificationsCorrespondenceAssociationContainer from 'js/components/classifications/correspondences/association/home-container'; +import D from 'js/i18n'; +import Menu from 'js/components/classifications/menu'; + +export default () => { + document.title = 'Bauhaus - ' + D.classificationsTitle; + return ( + <> + + + + + + + + + + + + + + + + + + + ); +}; diff --git a/src/js/components/classifications/series/home-container.js b/app/src/js/components/classifications/series/home-container.js similarity index 100% rename from src/js/components/classifications/series/home-container.js rename to app/src/js/components/classifications/series/home-container.js diff --git a/src/js/components/classifications/series/home-container.spec.js b/app/src/js/components/classifications/series/home-container.spec.js similarity index 100% rename from src/js/components/classifications/series/home-container.spec.js rename to app/src/js/components/classifications/series/home-container.spec.js diff --git a/src/js/components/classifications/series/home.js b/app/src/js/components/classifications/series/home.js similarity index 100% rename from src/js/components/classifications/series/home.js rename to app/src/js/components/classifications/series/home.js diff --git a/src/js/components/classifications/series/home.spec.js b/app/src/js/components/classifications/series/home.spec.js similarity index 100% rename from src/js/components/classifications/series/home.spec.js rename to app/src/js/components/classifications/series/home.spec.js diff --git a/src/js/components/classifications/series/visualization/controls.js b/app/src/js/components/classifications/series/visualization/controls.js similarity index 100% rename from src/js/components/classifications/series/visualization/controls.js rename to app/src/js/components/classifications/series/visualization/controls.js diff --git a/src/js/components/classifications/series/visualization/controls.spec.js b/app/src/js/components/classifications/series/visualization/controls.spec.js similarity index 100% rename from src/js/components/classifications/series/visualization/controls.spec.js rename to app/src/js/components/classifications/series/visualization/controls.spec.js diff --git a/src/js/components/classifications/series/visualization/general.js b/app/src/js/components/classifications/series/visualization/general.js similarity index 100% rename from src/js/components/classifications/series/visualization/general.js rename to app/src/js/components/classifications/series/visualization/general.js diff --git a/src/js/components/classifications/series/visualization/general.spec.js b/app/src/js/components/classifications/series/visualization/general.spec.js similarity index 100% rename from src/js/components/classifications/series/visualization/general.spec.js rename to app/src/js/components/classifications/series/visualization/general.spec.js diff --git a/src/js/components/classifications/series/visualization/home-container.js b/app/src/js/components/classifications/series/visualization/home-container.js similarity index 100% rename from src/js/components/classifications/series/visualization/home-container.js rename to app/src/js/components/classifications/series/visualization/home-container.js diff --git a/src/js/components/classifications/series/visualization/home.js b/app/src/js/components/classifications/series/visualization/home.js similarity index 100% rename from src/js/components/classifications/series/visualization/home.js rename to app/src/js/components/classifications/series/visualization/home.js diff --git a/src/js/components/classifications/series/visualization/home.spec.js b/app/src/js/components/classifications/series/visualization/home.spec.js similarity index 100% rename from src/js/components/classifications/series/visualization/home.spec.js rename to app/src/js/components/classifications/series/visualization/home.spec.js diff --git a/src/js/components/classifications/series/visualization/members.js b/app/src/js/components/classifications/series/visualization/members.js similarity index 100% rename from src/js/components/classifications/series/visualization/members.js rename to app/src/js/components/classifications/series/visualization/members.js diff --git a/src/js/components/classifications/series/visualization/members.spec.js b/app/src/js/components/classifications/series/visualization/members.spec.js similarity index 100% rename from src/js/components/classifications/series/visualization/members.spec.js rename to app/src/js/components/classifications/series/visualization/members.spec.js diff --git a/src/js/components/classifications/series/visualization/notes.js b/app/src/js/components/classifications/series/visualization/notes.js similarity index 100% rename from src/js/components/classifications/series/visualization/notes.js rename to app/src/js/components/classifications/series/visualization/notes.js diff --git a/src/js/components/classifications/series/visualization/notes.spec.js b/app/src/js/components/classifications/series/visualization/notes.spec.js similarity index 100% rename from src/js/components/classifications/series/visualization/notes.spec.js rename to app/src/js/components/classifications/series/visualization/notes.spec.js diff --git a/src/js/components/classifications/visualization/controls.js b/app/src/js/components/classifications/visualization/controls.js similarity index 100% rename from src/js/components/classifications/visualization/controls.js rename to app/src/js/components/classifications/visualization/controls.js diff --git a/src/js/components/classifications/visualization/controls.spec.js b/app/src/js/components/classifications/visualization/controls.spec.js similarity index 100% rename from src/js/components/classifications/visualization/controls.spec.js rename to app/src/js/components/classifications/visualization/controls.spec.js diff --git a/src/js/components/classifications/visualization/general.js b/app/src/js/components/classifications/visualization/general.js similarity index 100% rename from src/js/components/classifications/visualization/general.js rename to app/src/js/components/classifications/visualization/general.js diff --git a/src/js/components/classifications/visualization/general.spec.js b/app/src/js/components/classifications/visualization/general.spec.js similarity index 100% rename from src/js/components/classifications/visualization/general.spec.js rename to app/src/js/components/classifications/visualization/general.spec.js diff --git a/src/js/components/classifications/visualization/home-container.js b/app/src/js/components/classifications/visualization/home-container.js similarity index 100% rename from src/js/components/classifications/visualization/home-container.js rename to app/src/js/components/classifications/visualization/home-container.js diff --git a/src/js/components/classifications/visualization/home.js b/app/src/js/components/classifications/visualization/home.js similarity index 100% rename from src/js/components/classifications/visualization/home.js rename to app/src/js/components/classifications/visualization/home.js diff --git a/src/js/components/classifications/visualization/home.spec.js b/app/src/js/components/classifications/visualization/home.spec.js similarity index 100% rename from src/js/components/classifications/visualization/home.spec.js rename to app/src/js/components/classifications/visualization/home.spec.js diff --git a/src/js/components/classifications/visualization/items/controls.js b/app/src/js/components/classifications/visualization/items/controls.js similarity index 100% rename from src/js/components/classifications/visualization/items/controls.js rename to app/src/js/components/classifications/visualization/items/controls.js diff --git a/src/js/components/classifications/visualization/items/controls.spec.js b/app/src/js/components/classifications/visualization/items/controls.spec.js similarity index 100% rename from src/js/components/classifications/visualization/items/controls.spec.js rename to app/src/js/components/classifications/visualization/items/controls.spec.js diff --git a/src/js/components/classifications/visualization/items/home-container.js b/app/src/js/components/classifications/visualization/items/home-container.js similarity index 100% rename from src/js/components/classifications/visualization/items/home-container.js rename to app/src/js/components/classifications/visualization/items/home-container.js diff --git a/src/js/components/classifications/visualization/items/home.js b/app/src/js/components/classifications/visualization/items/home.js similarity index 100% rename from src/js/components/classifications/visualization/items/home.js rename to app/src/js/components/classifications/visualization/items/home.js diff --git a/src/js/components/classifications/visualization/items/home.spec.js b/app/src/js/components/classifications/visualization/items/home.spec.js similarity index 100% rename from src/js/components/classifications/visualization/items/home.spec.js rename to app/src/js/components/classifications/visualization/items/home.spec.js diff --git a/src/js/components/classifications/visualization/levels.js b/app/src/js/components/classifications/visualization/levels.js similarity index 100% rename from src/js/components/classifications/visualization/levels.js rename to app/src/js/components/classifications/visualization/levels.js diff --git a/src/js/components/classifications/visualization/levels.spec.js b/app/src/js/components/classifications/visualization/levels.spec.js similarity index 100% rename from src/js/components/classifications/visualization/levels.spec.js rename to app/src/js/components/classifications/visualization/levels.spec.js diff --git a/src/js/components/classifications/visualization/notes.js b/app/src/js/components/classifications/visualization/notes.js similarity index 100% rename from src/js/components/classifications/visualization/notes.js rename to app/src/js/components/classifications/visualization/notes.js diff --git a/src/js/components/classifications/visualization/notes.spec.js b/app/src/js/components/classifications/visualization/notes.spec.js similarity index 100% rename from src/js/components/classifications/visualization/notes.spec.js rename to app/src/js/components/classifications/visualization/notes.spec.js diff --git a/src/js/components/classifications/visualization/tree/controls.js b/app/src/js/components/classifications/visualization/tree/controls.js similarity index 100% rename from src/js/components/classifications/visualization/tree/controls.js rename to app/src/js/components/classifications/visualization/tree/controls.js diff --git a/src/js/components/classifications/visualization/tree/controls.spec.js b/app/src/js/components/classifications/visualization/tree/controls.spec.js similarity index 100% rename from src/js/components/classifications/visualization/tree/controls.spec.js rename to app/src/js/components/classifications/visualization/tree/controls.spec.js diff --git a/src/js/components/classifications/visualization/tree/home-container.js b/app/src/js/components/classifications/visualization/tree/home-container.js similarity index 100% rename from src/js/components/classifications/visualization/tree/home-container.js rename to app/src/js/components/classifications/visualization/tree/home-container.js diff --git a/src/js/components/classifications/visualization/tree/home.js b/app/src/js/components/classifications/visualization/tree/home.js similarity index 100% rename from src/js/components/classifications/visualization/tree/home.js rename to app/src/js/components/classifications/visualization/tree/home.js diff --git a/src/js/components/classifications/visualization/tree/home.spec.js b/app/src/js/components/classifications/visualization/tree/home.spec.js similarity index 100% rename from src/js/components/classifications/visualization/tree/home.spec.js rename to app/src/js/components/classifications/visualization/tree/home.spec.js diff --git a/src/js/components/collections/edition-creation/controls.js b/app/src/js/components/collections/edition-creation/controls.js similarity index 100% rename from src/js/components/collections/edition-creation/controls.js rename to app/src/js/components/collections/edition-creation/controls.js diff --git a/src/js/components/collections/edition-creation/controls.spec.js b/app/src/js/components/collections/edition-creation/controls.spec.js similarity index 100% rename from src/js/components/collections/edition-creation/controls.spec.js rename to app/src/js/components/collections/edition-creation/controls.spec.js diff --git a/src/js/components/collections/edition-creation/creation-container.js b/app/src/js/components/collections/edition-creation/creation-container.js similarity index 100% rename from src/js/components/collections/edition-creation/creation-container.js rename to app/src/js/components/collections/edition-creation/creation-container.js diff --git a/src/js/components/collections/edition-creation/edition-container.js b/app/src/js/components/collections/edition-creation/edition-container.js similarity index 100% rename from src/js/components/collections/edition-creation/edition-container.js rename to app/src/js/components/collections/edition-creation/edition-container.js diff --git a/src/js/components/collections/edition-creation/general.js b/app/src/js/components/collections/edition-creation/general.js similarity index 100% rename from src/js/components/collections/edition-creation/general.js rename to app/src/js/components/collections/edition-creation/general.js diff --git a/src/js/components/collections/edition-creation/general.spec.js b/app/src/js/components/collections/edition-creation/general.spec.js similarity index 100% rename from src/js/components/collections/edition-creation/general.spec.js rename to app/src/js/components/collections/edition-creation/general.spec.js diff --git a/src/js/components/collections/edition-creation/home.js b/app/src/js/components/collections/edition-creation/home.js similarity index 100% rename from src/js/components/collections/edition-creation/home.js rename to app/src/js/components/collections/edition-creation/home.js diff --git a/src/js/components/collections/edition-creation/home.spec.js b/app/src/js/components/collections/edition-creation/home.spec.js similarity index 100% rename from src/js/components/collections/edition-creation/home.spec.js rename to app/src/js/components/collections/edition-creation/home.spec.js diff --git a/src/js/components/collections/edition-creation/members.js b/app/src/js/components/collections/edition-creation/members.js similarity index 100% rename from src/js/components/collections/edition-creation/members.js rename to app/src/js/components/collections/edition-creation/members.js diff --git a/src/js/components/collections/edition-creation/members.spec.js b/app/src/js/components/collections/edition-creation/members.spec.js similarity index 100% rename from src/js/components/collections/edition-creation/members.spec.js rename to app/src/js/components/collections/edition-creation/members.spec.js diff --git a/src/js/components/collections/export/home-container.js b/app/src/js/components/collections/export/home-container.js similarity index 100% rename from src/js/components/collections/export/home-container.js rename to app/src/js/components/collections/export/home-container.js diff --git a/src/js/components/collections/export/home.js b/app/src/js/components/collections/export/home.js similarity index 100% rename from src/js/components/collections/export/home.js rename to app/src/js/components/collections/export/home.js diff --git a/src/js/components/collections/export/home.spec.js b/app/src/js/components/collections/export/home.spec.js similarity index 100% rename from src/js/components/collections/export/home.spec.js rename to app/src/js/components/collections/export/home.spec.js diff --git a/src/js/components/collections/home-container.js b/app/src/js/components/collections/home-container.js similarity index 100% rename from src/js/components/collections/home-container.js rename to app/src/js/components/collections/home-container.js diff --git a/src/js/components/collections/home.js b/app/src/js/components/collections/home.js similarity index 100% rename from src/js/components/collections/home.js rename to app/src/js/components/collections/home.js diff --git a/src/js/components/collections/home.spec.js b/app/src/js/components/collections/home.spec.js similarity index 100% rename from src/js/components/collections/home.spec.js rename to app/src/js/components/collections/home.spec.js diff --git a/src/js/components/collections/send/controls.js b/app/src/js/components/collections/send/controls.js similarity index 100% rename from src/js/components/collections/send/controls.js rename to app/src/js/components/collections/send/controls.js diff --git a/src/js/components/collections/send/controls.spec.js b/app/src/js/components/collections/send/controls.spec.js similarity index 100% rename from src/js/components/collections/send/controls.spec.js rename to app/src/js/components/collections/send/controls.spec.js diff --git a/src/js/components/collections/send/home-container.js b/app/src/js/components/collections/send/home-container.js similarity index 100% rename from src/js/components/collections/send/home-container.js rename to app/src/js/components/collections/send/home-container.js diff --git a/src/js/components/collections/send/home.js b/app/src/js/components/collections/send/home.js similarity index 100% rename from src/js/components/collections/send/home.js rename to app/src/js/components/collections/send/home.js diff --git a/src/js/components/collections/send/home.spec.js b/app/src/js/components/collections/send/home.spec.js similarity index 100% rename from src/js/components/collections/send/home.spec.js rename to app/src/js/components/collections/send/home.spec.js diff --git a/src/js/components/collections/send/status.js b/app/src/js/components/collections/send/status.js similarity index 100% rename from src/js/components/collections/send/status.js rename to app/src/js/components/collections/send/status.js diff --git a/src/js/components/collections/send/status.spec.js b/app/src/js/components/collections/send/status.spec.js similarity index 100% rename from src/js/components/collections/send/status.spec.js rename to app/src/js/components/collections/send/status.spec.js diff --git a/src/js/components/collections/validation/home-container.js b/app/src/js/components/collections/validation/home-container.js similarity index 100% rename from src/js/components/collections/validation/home-container.js rename to app/src/js/components/collections/validation/home-container.js diff --git a/src/js/components/collections/validation/home.js b/app/src/js/components/collections/validation/home.js similarity index 100% rename from src/js/components/collections/validation/home.js rename to app/src/js/components/collections/validation/home.js diff --git a/src/js/components/collections/validation/home.spec.js b/app/src/js/components/collections/validation/home.spec.js similarity index 100% rename from src/js/components/collections/validation/home.spec.js rename to app/src/js/components/collections/validation/home.spec.js diff --git a/src/js/components/collections/visualization/controls.js b/app/src/js/components/collections/visualization/controls.js similarity index 100% rename from src/js/components/collections/visualization/controls.js rename to app/src/js/components/collections/visualization/controls.js diff --git a/src/js/components/collections/visualization/controls.spec.js b/app/src/js/components/collections/visualization/controls.spec.js similarity index 100% rename from src/js/components/collections/visualization/controls.spec.js rename to app/src/js/components/collections/visualization/controls.spec.js diff --git a/src/js/components/collections/visualization/general.js b/app/src/js/components/collections/visualization/general.js similarity index 100% rename from src/js/components/collections/visualization/general.js rename to app/src/js/components/collections/visualization/general.js diff --git a/src/js/components/collections/visualization/general.spec.js b/app/src/js/components/collections/visualization/general.spec.js similarity index 100% rename from src/js/components/collections/visualization/general.spec.js rename to app/src/js/components/collections/visualization/general.spec.js diff --git a/src/js/components/collections/visualization/home-container.js b/app/src/js/components/collections/visualization/home-container.js similarity index 100% rename from src/js/components/collections/visualization/home-container.js rename to app/src/js/components/collections/visualization/home-container.js diff --git a/src/js/components/collections/visualization/home.js b/app/src/js/components/collections/visualization/home.js similarity index 100% rename from src/js/components/collections/visualization/home.js rename to app/src/js/components/collections/visualization/home.js diff --git a/src/js/components/collections/visualization/home.spec.js b/app/src/js/components/collections/visualization/home.spec.js similarity index 100% rename from src/js/components/collections/visualization/home.spec.js rename to app/src/js/components/collections/visualization/home.spec.js diff --git a/src/js/components/collections/visualization/members.js b/app/src/js/components/collections/visualization/members.js similarity index 100% rename from src/js/components/collections/visualization/members.js rename to app/src/js/components/collections/visualization/members.js diff --git a/src/js/components/collections/visualization/members.spec.js b/app/src/js/components/collections/visualization/members.spec.js similarity index 100% rename from src/js/components/collections/visualization/members.spec.js rename to app/src/js/components/collections/visualization/members.spec.js diff --git a/src/js/components/concepts/advanced-search/controls.js b/app/src/js/components/concepts/advanced-search/controls.js similarity index 100% rename from src/js/components/concepts/advanced-search/controls.js rename to app/src/js/components/concepts/advanced-search/controls.js diff --git a/src/js/components/concepts/advanced-search/controls.spec.js b/app/src/js/components/concepts/advanced-search/controls.spec.js similarity index 100% rename from src/js/components/concepts/advanced-search/controls.spec.js rename to app/src/js/components/concepts/advanced-search/controls.spec.js diff --git a/src/js/components/concepts/advanced-search/home-container.js b/app/src/js/components/concepts/advanced-search/home-container.js similarity index 100% rename from src/js/components/concepts/advanced-search/home-container.js rename to app/src/js/components/concepts/advanced-search/home-container.js diff --git a/src/js/components/concepts/advanced-search/home.js b/app/src/js/components/concepts/advanced-search/home.js similarity index 100% rename from src/js/components/concepts/advanced-search/home.js rename to app/src/js/components/concepts/advanced-search/home.js diff --git a/src/js/components/concepts/advanced-search/home.spec.js b/app/src/js/components/concepts/advanced-search/home.spec.js similarity index 100% rename from src/js/components/concepts/advanced-search/home.spec.js rename to app/src/js/components/concepts/advanced-search/home.spec.js diff --git a/src/js/components/concepts/compare/controls.js b/app/src/js/components/concepts/compare/controls.js similarity index 100% rename from src/js/components/concepts/compare/controls.js rename to app/src/js/components/concepts/compare/controls.js diff --git a/src/js/components/concepts/compare/controls.spec.js b/app/src/js/components/concepts/compare/controls.spec.js similarity index 100% rename from src/js/components/concepts/compare/controls.spec.js rename to app/src/js/components/concepts/compare/controls.spec.js diff --git a/src/js/components/concepts/compare/home-container.js b/app/src/js/components/concepts/compare/home-container.js similarity index 100% rename from src/js/components/concepts/compare/home-container.js rename to app/src/js/components/concepts/compare/home-container.js diff --git a/src/js/components/concepts/compare/home.js b/app/src/js/components/concepts/compare/home.js similarity index 100% rename from src/js/components/concepts/compare/home.js rename to app/src/js/components/concepts/compare/home.js diff --git a/src/js/components/concepts/compare/home.spec.js b/app/src/js/components/concepts/compare/home.spec.js similarity index 100% rename from src/js/components/concepts/compare/home.spec.js rename to app/src/js/components/concepts/compare/home.spec.js diff --git a/src/js/components/concepts/edition-creation/controls/controls-layout.js b/app/src/js/components/concepts/edition-creation/controls/controls-layout.js similarity index 100% rename from src/js/components/concepts/edition-creation/controls/controls-layout.js rename to app/src/js/components/concepts/edition-creation/controls/controls-layout.js diff --git a/src/js/components/concepts/edition-creation/controls/controls-layout.spec.js b/app/src/js/components/concepts/edition-creation/controls/controls-layout.spec.js similarity index 100% rename from src/js/components/concepts/edition-creation/controls/controls-layout.spec.js rename to app/src/js/components/concepts/edition-creation/controls/controls-layout.spec.js diff --git a/src/js/components/concepts/edition-creation/controls/controls.spec.js b/app/src/js/components/concepts/edition-creation/controls/controls.spec.js similarity index 100% rename from src/js/components/concepts/edition-creation/controls/controls.spec.js rename to app/src/js/components/concepts/edition-creation/controls/controls.spec.js diff --git a/src/js/components/concepts/edition-creation/controls/index.js b/app/src/js/components/concepts/edition-creation/controls/index.js similarity index 100% rename from src/js/components/concepts/edition-creation/controls/index.js rename to app/src/js/components/concepts/edition-creation/controls/index.js diff --git a/src/js/components/concepts/edition-creation/creation-container.js b/app/src/js/components/concepts/edition-creation/creation-container.js similarity index 100% rename from src/js/components/concepts/edition-creation/creation-container.js rename to app/src/js/components/concepts/edition-creation/creation-container.js diff --git a/src/js/components/concepts/edition-creation/edition-container.js b/app/src/js/components/concepts/edition-creation/edition-container.js similarity index 100% rename from src/js/components/concepts/edition-creation/edition-container.js rename to app/src/js/components/concepts/edition-creation/edition-container.js diff --git a/src/js/components/concepts/edition-creation/general.js b/app/src/js/components/concepts/edition-creation/general.js similarity index 100% rename from src/js/components/concepts/edition-creation/general.js rename to app/src/js/components/concepts/edition-creation/general.js diff --git a/src/js/components/concepts/edition-creation/general.spec.js b/app/src/js/components/concepts/edition-creation/general.spec.js similarity index 100% rename from src/js/components/concepts/edition-creation/general.spec.js rename to app/src/js/components/concepts/edition-creation/general.spec.js diff --git a/src/js/components/concepts/edition-creation/home.js b/app/src/js/components/concepts/edition-creation/home.js similarity index 100% rename from src/js/components/concepts/edition-creation/home.js rename to app/src/js/components/concepts/edition-creation/home.js diff --git a/src/js/components/concepts/edition-creation/home.spec.js b/app/src/js/components/concepts/edition-creation/home.spec.js similarity index 100% rename from src/js/components/concepts/edition-creation/home.spec.js rename to app/src/js/components/concepts/edition-creation/home.spec.js diff --git a/src/js/components/concepts/edition-creation/links/concept-to-link.js b/app/src/js/components/concepts/edition-creation/links/concept-to-link.js similarity index 100% rename from src/js/components/concepts/edition-creation/links/concept-to-link.js rename to app/src/js/components/concepts/edition-creation/links/concept-to-link.js diff --git a/src/js/components/concepts/edition-creation/links/concept-to-link.spec.js b/app/src/js/components/concepts/edition-creation/links/concept-to-link.spec.js similarity index 100% rename from src/js/components/concepts/edition-creation/links/concept-to-link.spec.js rename to app/src/js/components/concepts/edition-creation/links/concept-to-link.spec.js diff --git a/src/js/components/concepts/edition-creation/links/index.js b/app/src/js/components/concepts/edition-creation/links/index.js similarity index 100% rename from src/js/components/concepts/edition-creation/links/index.js rename to app/src/js/components/concepts/edition-creation/links/index.js diff --git a/src/js/components/concepts/edition-creation/links/links.spec.js b/app/src/js/components/concepts/edition-creation/links/links.spec.js similarity index 100% rename from src/js/components/concepts/edition-creation/links/links.spec.js rename to app/src/js/components/concepts/edition-creation/links/links.spec.js diff --git a/src/js/components/concepts/edition-creation/links/search-concepts-by-label.js b/app/src/js/components/concepts/edition-creation/links/search-concepts-by-label.js similarity index 100% rename from src/js/components/concepts/edition-creation/links/search-concepts-by-label.js rename to app/src/js/components/concepts/edition-creation/links/search-concepts-by-label.js diff --git a/src/js/components/concepts/edition-creation/links/search-concepts-by-label.spec.js b/app/src/js/components/concepts/edition-creation/links/search-concepts-by-label.spec.js similarity index 100% rename from src/js/components/concepts/edition-creation/links/search-concepts-by-label.spec.js rename to app/src/js/components/concepts/edition-creation/links/search-concepts-by-label.spec.js diff --git a/src/js/components/concepts/edition-creation/notes.js b/app/src/js/components/concepts/edition-creation/notes.js similarity index 100% rename from src/js/components/concepts/edition-creation/notes.js rename to app/src/js/components/concepts/edition-creation/notes.js diff --git a/src/js/components/concepts/edition-creation/notes.spec.js b/app/src/js/components/concepts/edition-creation/notes.spec.js similarity index 100% rename from src/js/components/concepts/edition-creation/notes.spec.js rename to app/src/js/components/concepts/edition-creation/notes.spec.js diff --git a/src/js/components/concepts/export/home-container.js b/app/src/js/components/concepts/export/home-container.js similarity index 100% rename from src/js/components/concepts/export/home-container.js rename to app/src/js/components/concepts/export/home-container.js diff --git a/src/js/components/concepts/export/home.js b/app/src/js/components/concepts/export/home.js similarity index 100% rename from src/js/components/concepts/export/home.js rename to app/src/js/components/concepts/export/home.js diff --git a/src/js/components/concepts/export/home.spec.js b/app/src/js/components/concepts/export/home.spec.js similarity index 100% rename from src/js/components/concepts/export/home.spec.js rename to app/src/js/components/concepts/export/home.spec.js diff --git a/src/js/components/concepts/home-container.js b/app/src/js/components/concepts/home-container.js similarity index 100% rename from src/js/components/concepts/home-container.js rename to app/src/js/components/concepts/home-container.js diff --git a/src/js/components/concepts/home.js b/app/src/js/components/concepts/home.js similarity index 100% rename from src/js/components/concepts/home.js rename to app/src/js/components/concepts/home.js diff --git a/src/js/components/concepts/home.spec.js b/app/src/js/components/concepts/home.spec.js similarity index 100% rename from src/js/components/concepts/home.spec.js rename to app/src/js/components/concepts/home.spec.js diff --git a/src/js/components/menu/concepts/concepts.scss b/app/src/js/components/concepts/menu/concepts.scss similarity index 100% rename from src/js/components/menu/concepts/concepts.scss rename to app/src/js/components/concepts/menu/concepts.scss diff --git a/src/js/components/menu/concepts/concepts.spec.js b/app/src/js/components/concepts/menu/concepts.spec.js similarity index 84% rename from src/js/components/menu/concepts/concepts.spec.js rename to app/src/js/components/concepts/menu/concepts.spec.js index c8e77177a..9fecdfe94 100644 --- a/src/js/components/menu/concepts/concepts.spec.js +++ b/app/src/js/components/concepts/menu/concepts.spec.js @@ -1,6 +1,6 @@ import React from 'react'; import { shallow } from 'enzyme'; -import MenuConcepts from './'; +import MenuConcepts from '.'; describe('menu-concepts', () => { it('renders without crashing', () => { diff --git a/src/js/components/menu/concepts/index.js b/app/src/js/components/concepts/menu/index.js similarity index 93% rename from src/js/components/menu/concepts/index.js rename to app/src/js/components/concepts/menu/index.js index ce998ac4d..83eb55d58 100644 --- a/src/js/components/menu/concepts/index.js +++ b/app/src/js/components/concepts/menu/index.js @@ -1,10 +1,12 @@ import React, { Component } from 'react'; import { Link, withRouter } from 'react-router-dom'; -import MenuReferentiels from '../referentiels'; +import MenuReferentiels from 'js/components/menu/referentiels'; import check from 'js/utils/auth'; import { propTypes as permissionOverviewPropTypes } from 'js/utils/auth/permission-overview'; import D from 'js/i18n'; import './concepts.scss'; +import { compose } from 'recompose'; +import { withPermissions } from 'js/components/menu/home-container'; class MenuConcepts extends Component { constructor(props) { @@ -132,4 +134,7 @@ MenuConcepts.propTypes = { permission: permissionOverviewPropTypes.isRequired, }; -export default withRouter(MenuConcepts); +export default compose( + withRouter, + withPermissions +)(MenuConcepts); diff --git a/src/js/components/router/concepts.js b/app/src/js/components/concepts/routes/index.js similarity index 50% rename from src/js/components/router/concepts.js rename to app/src/js/components/concepts/routes/index.js index a8de5470b..160dce93c 100644 --- a/src/js/components/router/concepts.js +++ b/app/src/js/components/concepts/routes/index.js @@ -23,87 +23,99 @@ import Help from 'js/components/help/home'; import Administration from 'js/components/administration/home-container'; import ConceptsDashboard from 'js/components/administration/dashboard/concepts/home-container'; import D from 'js/i18n'; +import Menu from 'js/components/concepts/menu'; export default () => { document.title = 'Bauhaus - ' + D.conceptsTitle; return ( - - - - - - - - - - - - - - - - - - - + <> + + + + + + + + + + + + + + + + + + + + - - + + + ); }; diff --git a/src/js/components/concepts/send/controls.js b/app/src/js/components/concepts/send/controls.js similarity index 100% rename from src/js/components/concepts/send/controls.js rename to app/src/js/components/concepts/send/controls.js diff --git a/src/js/components/concepts/send/controls.spec.js b/app/src/js/components/concepts/send/controls.spec.js similarity index 100% rename from src/js/components/concepts/send/controls.spec.js rename to app/src/js/components/concepts/send/controls.spec.js diff --git a/src/js/components/concepts/send/home-container.js b/app/src/js/components/concepts/send/home-container.js similarity index 100% rename from src/js/components/concepts/send/home-container.js rename to app/src/js/components/concepts/send/home-container.js diff --git a/src/js/components/concepts/send/home.js b/app/src/js/components/concepts/send/home.js similarity index 100% rename from src/js/components/concepts/send/home.js rename to app/src/js/components/concepts/send/home.js diff --git a/src/js/components/concepts/send/home.spec.js b/app/src/js/components/concepts/send/home.spec.js similarity index 100% rename from src/js/components/concepts/send/home.spec.js rename to app/src/js/components/concepts/send/home.spec.js diff --git a/src/js/components/concepts/send/status.js b/app/src/js/components/concepts/send/status.js similarity index 100% rename from src/js/components/concepts/send/status.js rename to app/src/js/components/concepts/send/status.js diff --git a/src/js/components/concepts/send/status.spec.js b/app/src/js/components/concepts/send/status.spec.js similarity index 100% rename from src/js/components/concepts/send/status.spec.js rename to app/src/js/components/concepts/send/status.spec.js diff --git a/src/js/components/concepts/validation/home-container.js b/app/src/js/components/concepts/validation/home-container.js similarity index 100% rename from src/js/components/concepts/validation/home-container.js rename to app/src/js/components/concepts/validation/home-container.js diff --git a/src/js/components/concepts/validation/home.js b/app/src/js/components/concepts/validation/home.js similarity index 100% rename from src/js/components/concepts/validation/home.js rename to app/src/js/components/concepts/validation/home.js diff --git a/src/js/components/concepts/validation/home.spec.js b/app/src/js/components/concepts/validation/home.spec.js similarity index 100% rename from src/js/components/concepts/validation/home.spec.js rename to app/src/js/components/concepts/validation/home.spec.js diff --git a/src/js/components/concepts/visualization/controls.js b/app/src/js/components/concepts/visualization/controls.js similarity index 100% rename from src/js/components/concepts/visualization/controls.js rename to app/src/js/components/concepts/visualization/controls.js diff --git a/src/js/components/concepts/visualization/controls.spec.js b/app/src/js/components/concepts/visualization/controls.spec.js similarity index 100% rename from src/js/components/concepts/visualization/controls.spec.js rename to app/src/js/components/concepts/visualization/controls.spec.js diff --git a/src/js/components/concepts/visualization/general.js b/app/src/js/components/concepts/visualization/general.js similarity index 100% rename from src/js/components/concepts/visualization/general.js rename to app/src/js/components/concepts/visualization/general.js diff --git a/src/js/components/concepts/visualization/general.spec.js b/app/src/js/components/concepts/visualization/general.spec.js similarity index 100% rename from src/js/components/concepts/visualization/general.spec.js rename to app/src/js/components/concepts/visualization/general.spec.js diff --git a/src/js/components/concepts/visualization/home-container.js b/app/src/js/components/concepts/visualization/home-container.js similarity index 100% rename from src/js/components/concepts/visualization/home-container.js rename to app/src/js/components/concepts/visualization/home-container.js diff --git a/src/js/components/concepts/visualization/home.js b/app/src/js/components/concepts/visualization/home.js similarity index 100% rename from src/js/components/concepts/visualization/home.js rename to app/src/js/components/concepts/visualization/home.js diff --git a/src/js/components/concepts/visualization/home.spec.js b/app/src/js/components/concepts/visualization/home.spec.js similarity index 100% rename from src/js/components/concepts/visualization/home.spec.js rename to app/src/js/components/concepts/visualization/home.spec.js diff --git a/src/js/components/concepts/visualization/links.js b/app/src/js/components/concepts/visualization/links.js similarity index 100% rename from src/js/components/concepts/visualization/links.js rename to app/src/js/components/concepts/visualization/links.js diff --git a/src/js/components/concepts/visualization/notes.js b/app/src/js/components/concepts/visualization/notes.js similarity index 100% rename from src/js/components/concepts/visualization/notes.js rename to app/src/js/components/concepts/visualization/notes.js diff --git a/src/js/components/concepts/visualization/notes.spec.js b/app/src/js/components/concepts/visualization/notes.spec.js similarity index 100% rename from src/js/components/concepts/visualization/notes.spec.js rename to app/src/js/components/concepts/visualization/notes.spec.js diff --git a/src/js/components/concepts/visualization/stand-by.js b/app/src/js/components/concepts/visualization/stand-by.js similarity index 100% rename from src/js/components/concepts/visualization/stand-by.js rename to app/src/js/components/concepts/visualization/stand-by.js diff --git a/src/js/components/concepts/visualization/stand-by.spec.js b/app/src/js/components/concepts/visualization/stand-by.spec.js similarity index 100% rename from src/js/components/concepts/visualization/stand-by.spec.js rename to app/src/js/components/concepts/visualization/stand-by.spec.js diff --git a/src/js/components/help/content-classifications.js b/app/src/js/components/help/content-classifications.js similarity index 100% rename from src/js/components/help/content-classifications.js rename to app/src/js/components/help/content-classifications.js diff --git a/src/js/components/help/content-concepts.js b/app/src/js/components/help/content-concepts.js similarity index 100% rename from src/js/components/help/content-concepts.js rename to app/src/js/components/help/content-concepts.js diff --git a/src/js/components/help/content-operations.js b/app/src/js/components/help/content-operations.js similarity index 100% rename from src/js/components/help/content-operations.js rename to app/src/js/components/help/content-operations.js diff --git a/src/js/components/help/footer.js b/app/src/js/components/help/footer.js similarity index 100% rename from src/js/components/help/footer.js rename to app/src/js/components/help/footer.js diff --git a/src/js/components/help/footer.spec.js b/app/src/js/components/help/footer.spec.js similarity index 100% rename from src/js/components/help/footer.spec.js rename to app/src/js/components/help/footer.spec.js diff --git a/src/js/components/help/help.scss b/app/src/js/components/help/help.scss similarity index 100% rename from src/js/components/help/help.scss rename to app/src/js/components/help/help.scss diff --git a/src/js/components/help/home.js b/app/src/js/components/help/home.js similarity index 100% rename from src/js/components/help/home.js rename to app/src/js/components/help/home.js diff --git a/src/js/components/help/home.spec.js b/app/src/js/components/help/home.spec.js similarity index 100% rename from src/js/components/help/home.spec.js rename to app/src/js/components/help/home.spec.js diff --git a/src/js/components/help/menu.js b/app/src/js/components/help/menu.js similarity index 100% rename from src/js/components/help/menu.js rename to app/src/js/components/help/menu.js diff --git a/src/js/components/help/menu.spec.js b/app/src/js/components/help/menu.spec.js similarity index 100% rename from src/js/components/help/menu.spec.js rename to app/src/js/components/help/menu.spec.js diff --git a/src/js/components/menu/_menu.default.scss b/app/src/js/components/menu/_menu.default.scss similarity index 100% rename from src/js/components/menu/_menu.default.scss rename to app/src/js/components/menu/_menu.default.scss diff --git a/app/src/js/components/menu/home-container.js b/app/src/js/components/menu/home-container.js new file mode 100644 index 000000000..2d57042e2 --- /dev/null +++ b/app/src/js/components/menu/home-container.js @@ -0,0 +1,23 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import * as select from 'js/reducers'; + +export function withPermissions(WrappedComponent) { + const mapStateToProps = state => { + const permission = select.getPermission(state); + return { permission }; + }; + + class MenuContainer extends React.Component { + render() { + return ( + + ); + } + } + + return connect(mapStateToProps)(MenuContainer); +} diff --git a/app/src/js/components/menu/referentiels/index.js b/app/src/js/components/menu/referentiels/index.js new file mode 100644 index 000000000..2bbbd2f47 --- /dev/null +++ b/app/src/js/components/menu/referentiels/index.js @@ -0,0 +1,46 @@ +import React from 'react'; +import { Link } from 'react-router-dom'; +import D from 'js/i18n'; +import homeLogo from 'img/accueil.png'; +import './referentiels.scss'; + +function MenuReferentiels() { + return ( +
+ +
+ ); +} + +export default MenuReferentiels; diff --git a/src/js/components/menu/referentiels/referentiels.scss b/app/src/js/components/menu/referentiels/referentiels.scss similarity index 100% rename from src/js/components/menu/referentiels/referentiels.scss rename to app/src/js/components/menu/referentiels/referentiels.scss diff --git a/app/src/js/components/menu/referentiels/referentiels.spec.js b/app/src/js/components/menu/referentiels/referentiels.spec.js new file mode 100644 index 000000000..31d7af32a --- /dev/null +++ b/app/src/js/components/menu/referentiels/referentiels.spec.js @@ -0,0 +1,34 @@ +import React from 'react'; +import { shallow } from 'enzyme'; +import MenuReferentiels from '.'; +import { Link } from 'react-router-dom'; + +describe('menu-referenciels', () => { + it('renders without crashing', () => { + shallow(); + }); + + it('should display the home logo', () => { + process.env.REACT_APP_APPLICATIONS = ''; + const component = shallow(); + expect(component.find(Link).length).toBe(1); + }); + + it('should display two lists if the REACT_APP_APPLICATIONS contain one application', () => { + process.env.REACT_APP_APPLICATIONS = 'operations'; + const component = shallow(); + expect(component.find(Link).length).toBe(2); + }); + + it('should display three lists if the REACT_APP_APPLICATIONS contain two applications', () => { + process.env.REACT_APP_APPLICATIONS = 'operations,concepts'; + const component = shallow(); + expect(component.find(Link).length).toBe(3); + }); + + it('should display three lists if the REACT_APP_APPLICATIONS contain two applications, even if there is an extra space in environment variable', () => { + process.env.REACT_APP_APPLICATIONS = 'operations, concepts'; + const component = shallow(); + expect(component.find(Link).length).toBe(3); + }); +}); diff --git a/src/js/components/operations/document/edition/edition.js b/app/src/js/components/operations/document/edition/edition.js similarity index 99% rename from src/js/components/operations/document/edition/edition.js rename to app/src/js/components/operations/document/edition/edition.js index 6edc48f5a..49096e73b 100644 --- a/src/js/components/operations/document/edition/edition.js +++ b/app/src/js/components/operations/document/edition/edition.js @@ -220,7 +220,7 @@ class OperationsDocumentationEdition extends Component { { - const value = date.split('T')[0]; + const value = date && date.split('T')[0]; this.onChange({ target: { value, id: 'updatedDate' } }); }} placement="top" diff --git a/src/js/components/operations/document/edition/index.js b/app/src/js/components/operations/document/edition/index.js similarity index 100% rename from src/js/components/operations/document/edition/index.js rename to app/src/js/components/operations/document/edition/index.js diff --git a/src/js/components/operations/document/edition/validation.js b/app/src/js/components/operations/document/edition/validation.js similarity index 93% rename from src/js/components/operations/document/edition/validation.js rename to app/src/js/components/operations/document/edition/validation.js index 6b30dad6f..a8cffd15e 100644 --- a/src/js/components/operations/document/edition/validation.js +++ b/app/src/js/components/operations/document/edition/validation.js @@ -49,6 +49,9 @@ export function validate(document, type, files) { } else if (type === LINK && !/https*\:\/\//.test(document.url)) { errorMessage = D.badUrl; fields.url = true; + } else if (type === DOCUMENT && !document.updatedDate) { + errorMessage = D.requiredUpdatedDate; + fields.updatedDate = true; } else if (type === DOCUMENT && !haveFiles(files)) { return { errorMessage: D.requiredFile, diff --git a/src/js/components/operations/document/edition/validation.spec.js b/app/src/js/components/operations/document/edition/validation.spec.js similarity index 87% rename from src/js/components/operations/document/edition/validation.spec.js rename to app/src/js/components/operations/document/edition/validation.spec.js index 438d299c6..645e7de17 100644 --- a/src/js/components/operations/document/edition/validation.spec.js +++ b/app/src/js/components/operations/document/edition/validation.spec.js @@ -15,6 +15,7 @@ describe('validate', () => { fields: { prefLabelLg1: false, prefLabelLg2: true }, }); }); + it('should return an error if the lang is not defined', () => { expect( validate( @@ -22,6 +23,7 @@ describe('validate', () => { labelLg1: '1', labelLg2: '2', url: 'http://url.com', + updatedDate: 'updatedDate', }, type, [{ name: 'name_without_space' }] @@ -76,7 +78,24 @@ describe('validate', () => { labelLg1: '1', labelLg2: '2', lang: 'fr', + updatedDate: 'updatedDate', }; + it('should return an error if the updatedDate is not defined', () => { + expect( + validate( + { + labelLg1: '1', + labelLg2: '2', + url: 'http://url.com', + }, + type, + [{ name: 'name_without_space' }] + ) + ).toEqual({ + errorMessage: 'The update date is required', + fields: { updatedDate: true }, + }); + }); it('should return an error if the files is undefined', () => { expect(validate(document, type)).toEqual({ errorMessage: 'The file is required', diff --git a/src/js/components/operations/document/home.js b/app/src/js/components/operations/document/home.js similarity index 72% rename from src/js/components/operations/document/home.js rename to app/src/js/components/operations/document/home.js index 81dc5416b..1373269b7 100644 --- a/src/js/components/operations/document/home.js +++ b/app/src/js/components/operations/document/home.js @@ -5,6 +5,8 @@ import SearchRmes from 'js/components/shared/search-rmes/search-rmes'; import D from 'js/i18n'; import { Link } from 'react-router-dom'; import { BOTH, DOCUMENT, LINK, isLink, isDocument } from './utils'; +import Auth from 'js/utils/auth/components/auth'; +import { INDICATOR_CREATOR, ADMIN, SERIES_CREATOR } from 'js/utils/auth/roles'; import './home.scss'; function DocumentHome({ documents }) { @@ -21,32 +23,35 @@ function DocumentHome({ documents }) { <>
-
- {[ - ['/operations/document/create', D.document], - ['/operations/link/create', D.link], - ].map(([url, title]) => ( -
-
- -
+ ))} +
+ +
{ ); const notes = wrapper.find(Note); expect(notes).toHaveLength(4); - - expect(notes.get(2).props.text).toBe('2019-2-1'); }); }); diff --git a/src/js/components/operations/document/visualization/index.js b/app/src/js/components/operations/document/visualization/index.js similarity index 88% rename from src/js/components/operations/document/visualization/index.js rename to app/src/js/components/operations/document/visualization/index.js index e6279ce5a..8d376dad4 100644 --- a/src/js/components/operations/document/visualization/index.js +++ b/app/src/js/components/operations/document/visualization/index.js @@ -16,6 +16,8 @@ import { withRouter } from 'react-router-dom'; import OperationsDocumentVisualization from './home'; import { compose } from 'recompose'; import PageTitleBlock from 'js/components/shared/page-title-block'; +import Auth from 'js/utils/auth/components/auth'; +import { INDICATOR_CREATOR, ADMIN, SERIES_CREATOR } from 'js/utils/auth/roles'; const extractId = buildExtract('id'); @@ -56,11 +58,12 @@ class DocumentationVisualizationContainer extends Component { />
- -
; @@ -64,7 +76,11 @@ class FamilyVisualizationContainer extends PureComponent {
-
+
+
+ +
+
); } @@ -58,7 +86,7 @@ class SearchListContainer extends Component { super(props); this.state = {}; } - componentWillMount() { + componentDidMount() { api.getIndicatorsSearchList().then(data => { this.setState({ data }); }); @@ -66,9 +94,17 @@ class SearchListContainer extends Component { render() { const { data } = this.state; + const { organisations } = this.props; + if (!data) return ; - return ; + return ; } } -export default SearchListContainer; +const mapStateToProps = state => { + return { + organisations: state.operationsOrganisations.results, + }; +}; + +export default connect(mapStateToProps)(SearchListContainer); diff --git a/src/js/components/operations/indicators/visualization/general.js b/app/src/js/components/operations/indicators/visualization/general.js similarity index 100% rename from src/js/components/operations/indicators/visualization/general.js rename to app/src/js/components/operations/indicators/visualization/general.js diff --git a/src/js/components/operations/indicators/visualization/general.spec.js b/app/src/js/components/operations/indicators/visualization/general.spec.js similarity index 100% rename from src/js/components/operations/indicators/visualization/general.spec.js rename to app/src/js/components/operations/indicators/visualization/general.spec.js diff --git a/src/js/components/operations/indicators/visualization/index.js b/app/src/js/components/operations/indicators/visualization/index.js similarity index 100% rename from src/js/components/operations/indicators/visualization/index.js rename to app/src/js/components/operations/indicators/visualization/index.js diff --git a/src/js/components/operations/indicators/visualization/index.spec.js b/app/src/js/components/operations/indicators/visualization/index.spec.js similarity index 100% rename from src/js/components/operations/indicators/visualization/index.spec.js rename to app/src/js/components/operations/indicators/visualization/index.spec.js diff --git a/src/js/components/menu/operations/index.js b/app/src/js/components/operations/menu/index.js similarity index 98% rename from src/js/components/menu/operations/index.js rename to app/src/js/components/operations/menu/index.js index 9940bc5cf..d262276e7 100644 --- a/src/js/components/menu/operations/index.js +++ b/app/src/js/components/operations/menu/index.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Link, withRouter } from 'react-router-dom'; -import MenuReferentiels from '../referentiels'; +import MenuReferentiels from 'js/components/menu/referentiels'; import { connect } from 'react-redux'; import D from 'js/i18n'; @@ -134,7 +134,7 @@ class MenuOperations extends Component { if (activePath === '/') return null; return ( - + <>
{menuRef && } -
+ ); } } diff --git a/src/js/components/menu/operations/operations.scss b/app/src/js/components/operations/menu/operations.scss similarity index 100% rename from src/js/components/menu/operations/operations.scss rename to app/src/js/components/operations/menu/operations.scss diff --git a/src/js/components/menu/operations/operations.spec.js b/app/src/js/components/operations/menu/operations.spec.js similarity index 84% rename from src/js/components/menu/operations/operations.spec.js rename to app/src/js/components/operations/menu/operations.spec.js index 89f6a3646..ac1d671cd 100644 --- a/src/js/components/menu/operations/operations.spec.js +++ b/app/src/js/components/operations/menu/operations.spec.js @@ -1,6 +1,6 @@ import React from 'react'; import { shallow } from 'enzyme'; -import MenuOperations from './'; +import MenuOperations from '.'; describe('menu-operations', () => { it('renders without crashing', () => { diff --git a/src/js/components/operations/msd/__mocks__/utils.js b/app/src/js/components/operations/msd/__mocks__/utils.js similarity index 100% rename from src/js/components/operations/msd/__mocks__/utils.js rename to app/src/js/components/operations/msd/__mocks__/utils.js diff --git a/src/js/components/operations/msd/documents/documents-bloc/index.js b/app/src/js/components/operations/msd/documents/documents-bloc/index.js similarity index 100% rename from src/js/components/operations/msd/documents/documents-bloc/index.js rename to app/src/js/components/operations/msd/documents/documents-bloc/index.js diff --git a/src/js/components/operations/msd/documents/documents-bloc/index.spec.js b/app/src/js/components/operations/msd/documents/documents-bloc/index.spec.js similarity index 100% rename from src/js/components/operations/msd/documents/documents-bloc/index.spec.js rename to app/src/js/components/operations/msd/documents/documents-bloc/index.spec.js diff --git a/src/js/components/operations/msd/documents/documents-bloc/style.scss b/app/src/js/components/operations/msd/documents/documents-bloc/style.scss similarity index 100% rename from src/js/components/operations/msd/documents/documents-bloc/style.scss rename to app/src/js/components/operations/msd/documents/documents-bloc/style.scss diff --git a/src/js/components/operations/msd/help-information/__snapshots__/index.spec.js.snap b/app/src/js/components/operations/msd/help-information/__snapshots__/index.spec.js.snap similarity index 100% rename from src/js/components/operations/msd/help-information/__snapshots__/index.spec.js.snap rename to app/src/js/components/operations/msd/help-information/__snapshots__/index.spec.js.snap diff --git a/src/js/components/operations/msd/help-information/index.js b/app/src/js/components/operations/msd/help-information/index.js similarity index 100% rename from src/js/components/operations/msd/help-information/index.js rename to app/src/js/components/operations/msd/help-information/index.js diff --git a/src/js/components/operations/msd/help-information/index.spec.js b/app/src/js/components/operations/msd/help-information/index.spec.js similarity index 100% rename from src/js/components/operations/msd/help-information/index.spec.js rename to app/src/js/components/operations/msd/help-information/index.spec.js diff --git a/src/js/components/operations/msd/index.js b/app/src/js/components/operations/msd/index.js similarity index 100% rename from src/js/components/operations/msd/index.js rename to app/src/js/components/operations/msd/index.js diff --git a/src/js/components/operations/msd/index.spec.js b/app/src/js/components/operations/msd/index.spec.js similarity index 100% rename from src/js/components/operations/msd/index.spec.js rename to app/src/js/components/operations/msd/index.spec.js diff --git a/src/js/components/operations/msd/layout/index.js b/app/src/js/components/operations/msd/layout/index.js similarity index 100% rename from src/js/components/operations/msd/layout/index.js rename to app/src/js/components/operations/msd/layout/index.js diff --git a/src/js/components/operations/msd/layout/style.scss b/app/src/js/components/operations/msd/layout/style.scss similarity index 100% rename from src/js/components/operations/msd/layout/style.scss rename to app/src/js/components/operations/msd/layout/style.scss diff --git a/src/js/components/operations/msd/outline/index.js b/app/src/js/components/operations/msd/outline/index.js similarity index 100% rename from src/js/components/operations/msd/outline/index.js rename to app/src/js/components/operations/msd/outline/index.js diff --git a/src/js/components/operations/msd/outline/index.spec.js b/app/src/js/components/operations/msd/outline/index.spec.js similarity index 100% rename from src/js/components/operations/msd/outline/index.spec.js rename to app/src/js/components/operations/msd/outline/index.spec.js diff --git a/src/js/components/operations/msd/outline/outline-block.js b/app/src/js/components/operations/msd/outline/outline-block.js similarity index 100% rename from src/js/components/operations/msd/outline/outline-block.js rename to app/src/js/components/operations/msd/outline/outline-block.js diff --git a/src/js/components/operations/msd/outline/outline-block.spec.js b/app/src/js/components/operations/msd/outline/outline-block.spec.js similarity index 100% rename from src/js/components/operations/msd/outline/outline-block.spec.js rename to app/src/js/components/operations/msd/outline/outline-block.spec.js diff --git a/src/js/components/operations/msd/outline/style.scss b/app/src/js/components/operations/msd/outline/style.scss similarity index 100% rename from src/js/components/operations/msd/outline/style.scss rename to app/src/js/components/operations/msd/outline/style.scss diff --git a/src/js/components/operations/msd/pages/help/index.js b/app/src/js/components/operations/msd/pages/help/index.js similarity index 100% rename from src/js/components/operations/msd/pages/help/index.js rename to app/src/js/components/operations/msd/pages/help/index.js diff --git a/src/js/components/operations/msd/pages/sims-creation/index.js b/app/src/js/components/operations/msd/pages/sims-creation/index.js similarity index 100% rename from src/js/components/operations/msd/pages/sims-creation/index.js rename to app/src/js/components/operations/msd/pages/sims-creation/index.js diff --git a/src/js/components/operations/msd/pages/sims-creation/sims-field.js b/app/src/js/components/operations/msd/pages/sims-creation/sims-field.js similarity index 100% rename from src/js/components/operations/msd/pages/sims-creation/sims-field.js rename to app/src/js/components/operations/msd/pages/sims-creation/sims-field.js diff --git a/src/js/components/operations/msd/pages/sims-creation/sims-field.scss b/app/src/js/components/operations/msd/pages/sims-creation/sims-field.scss similarity index 100% rename from src/js/components/operations/msd/pages/sims-creation/sims-field.scss rename to app/src/js/components/operations/msd/pages/sims-creation/sims-field.scss diff --git a/src/js/components/operations/msd/pages/sims-creation/sims-field.spec.js b/app/src/js/components/operations/msd/pages/sims-creation/sims-field.spec.js similarity index 100% rename from src/js/components/operations/msd/pages/sims-creation/sims-field.spec.js rename to app/src/js/components/operations/msd/pages/sims-creation/sims-field.spec.js diff --git a/src/js/components/operations/msd/pages/sims-visualisation/index.js b/app/src/js/components/operations/msd/pages/sims-visualisation/index.js similarity index 100% rename from src/js/components/operations/msd/pages/sims-visualisation/index.js rename to app/src/js/components/operations/msd/pages/sims-visualisation/index.js diff --git a/src/js/components/operations/msd/utils.js b/app/src/js/components/operations/msd/utils.js similarity index 100% rename from src/js/components/operations/msd/utils.js rename to app/src/js/components/operations/msd/utils.js diff --git a/src/js/components/operations/msd/utils.spec.js b/app/src/js/components/operations/msd/utils.spec.js similarity index 100% rename from src/js/components/operations/msd/utils.spec.js rename to app/src/js/components/operations/msd/utils.spec.js diff --git a/src/js/components/operations/operations/edition/edition.js b/app/src/js/components/operations/operations/edition/edition.js similarity index 100% rename from src/js/components/operations/operations/edition/edition.js rename to app/src/js/components/operations/operations/edition/edition.js diff --git a/src/js/components/operations/operations/edition/index.js b/app/src/js/components/operations/operations/edition/index.js similarity index 100% rename from src/js/components/operations/operations/edition/index.js rename to app/src/js/components/operations/operations/edition/index.js diff --git a/src/js/components/operations/operations/edition/validation.js b/app/src/js/components/operations/operations/edition/validation.js similarity index 100% rename from src/js/components/operations/operations/edition/validation.js rename to app/src/js/components/operations/operations/edition/validation.js diff --git a/src/js/components/operations/operations/home.js b/app/src/js/components/operations/operations/home.js similarity index 95% rename from src/js/components/operations/operations/home.js rename to app/src/js/components/operations/operations/home.js index 57d5c0bfa..ad2f4c562 100644 --- a/src/js/components/operations/operations/home.js +++ b/app/src/js/components/operations/operations/home.js @@ -11,8 +11,8 @@ function OperationsHome({ operations }) { roles={[ADMIN, SERIES_CREATOR]} title={D.operationsSearchTitle} childPath="operations/operation" - searchURL="/operations/search" createURL="/operations/operation/create" + advancedSearch={false} /> ); } diff --git a/src/js/components/operations/operations/index.js b/app/src/js/components/operations/operations/index.js similarity index 100% rename from src/js/components/operations/operations/index.js rename to app/src/js/components/operations/operations/index.js diff --git a/src/js/components/operations/operations/index.spec.js b/app/src/js/components/operations/operations/index.spec.js similarity index 100% rename from src/js/components/operations/operations/index.spec.js rename to app/src/js/components/operations/operations/index.spec.js diff --git a/src/js/components/operations/operations/search.js b/app/src/js/components/operations/operations/search.js similarity index 100% rename from src/js/components/operations/operations/search.js rename to app/src/js/components/operations/operations/search.js diff --git a/src/js/components/operations/operations/visualization/controls.js b/app/src/js/components/operations/operations/visualization/controls.js similarity index 100% rename from src/js/components/operations/operations/visualization/controls.js rename to app/src/js/components/operations/operations/visualization/controls.js diff --git a/src/js/components/operations/operations/visualization/home.js b/app/src/js/components/operations/operations/visualization/home.js similarity index 100% rename from src/js/components/operations/operations/visualization/home.js rename to app/src/js/components/operations/operations/visualization/home.js diff --git a/src/js/components/operations/operations/visualization/home.spec.js b/app/src/js/components/operations/operations/visualization/home.spec.js similarity index 100% rename from src/js/components/operations/operations/visualization/home.spec.js rename to app/src/js/components/operations/operations/visualization/home.spec.js diff --git a/src/js/components/operations/operations/visualization/index.js b/app/src/js/components/operations/operations/visualization/index.js similarity index 100% rename from src/js/components/operations/operations/visualization/index.js rename to app/src/js/components/operations/operations/visualization/index.js diff --git a/src/js/components/operations/operations/visualization/index.spec.js b/app/src/js/components/operations/operations/visualization/index.spec.js similarity index 100% rename from src/js/components/operations/operations/visualization/index.spec.js rename to app/src/js/components/operations/operations/visualization/index.spec.js diff --git a/src/js/components/router/operations/document.js b/app/src/js/components/operations/routes/document.js similarity index 100% rename from src/js/components/router/operations/document.js rename to app/src/js/components/operations/routes/document.js diff --git a/src/js/components/router/operations/family.js b/app/src/js/components/operations/routes/family.js similarity index 100% rename from src/js/components/router/operations/family.js rename to app/src/js/components/operations/routes/family.js diff --git a/app/src/js/components/operations/routes/index.js b/app/src/js/components/operations/routes/index.js new file mode 100644 index 000000000..9b23acd0b --- /dev/null +++ b/app/src/js/components/operations/routes/index.js @@ -0,0 +1,47 @@ +import React, { Component } from 'react'; +import { Route } from 'react-router-dom'; +import { connect } from 'react-redux'; + +import { loadSetup } from 'js/actions/operations/utils/setup'; + +import D from 'js/i18n'; +import { ApplicationContext } from 'js/context'; + +import FamilyRoutes from 'js/components/operations/routes/family'; +import SeriesRoutes from 'js/components/operations/routes/series'; +import OperationsRoutes from 'js/components/operations/routes/operation'; +import DocumentRoutes from 'js/components/operations/routes/document'; +import IndicatorRoutes from 'js/components/operations/routes/indicator'; +import SimsRoutes from 'js/components/operations/routes/sims'; +import Menu from 'js/components/operations/menu'; + +class RootComponent extends Component { + componentDidMount() { + this.props.loadSetup(); + document.title = 'Bauhaus - ' + D.operationsTitle; + } + render() { + return ( + <> + + + + + + + + + + + ); + } +} +const mapDispatchToProps = { + loadSetup, +}; +const ConnectedRootComponent = connect( + undefined, + mapDispatchToProps +)(RootComponent); + +export default () => ; diff --git a/src/js/components/router/operations/indicator.js b/app/src/js/components/operations/routes/indicator.js similarity index 100% rename from src/js/components/router/operations/indicator.js rename to app/src/js/components/operations/routes/indicator.js diff --git a/src/js/components/router/operations/operation.js b/app/src/js/components/operations/routes/operation.js similarity index 81% rename from src/js/components/router/operations/operation.js rename to app/src/js/components/operations/routes/operation.js index c2e8b0115..d07caeba2 100644 --- a/src/js/components/router/operations/operation.js +++ b/app/src/js/components/operations/routes/operation.js @@ -5,7 +5,6 @@ import OperationsContainer from 'js/components/operations/operations/'; import OperationVisualizationContainer from 'js/components/operations/operations/visualization/'; import OperationEditionContainer from 'js/components/operations/operations/edition'; -import OperationsSearchContainer from 'js/components/operations/operations/search'; export default () => { return ( @@ -27,11 +26,6 @@ export default () => { path="/operations/operation/:id/modify" component={OperationEditionContainer} /> - ); }; diff --git a/src/js/components/router/operations/series.js b/app/src/js/components/operations/routes/series.js similarity index 100% rename from src/js/components/router/operations/series.js rename to app/src/js/components/operations/routes/series.js diff --git a/src/js/components/router/operations/sims.js b/app/src/js/components/operations/routes/sims.js similarity index 100% rename from src/js/components/router/operations/sims.js rename to app/src/js/components/operations/routes/sims.js diff --git a/src/js/components/operations/series/edition/edition.js b/app/src/js/components/operations/series/edition/edition.js similarity index 100% rename from src/js/components/operations/series/edition/edition.js rename to app/src/js/components/operations/series/edition/edition.js diff --git a/src/js/components/operations/series/edition/index.js b/app/src/js/components/operations/series/edition/index.js similarity index 100% rename from src/js/components/operations/series/edition/index.js rename to app/src/js/components/operations/series/edition/index.js diff --git a/src/js/components/operations/series/edition/validation.js b/app/src/js/components/operations/series/edition/validation.js similarity index 100% rename from src/js/components/operations/series/edition/validation.js rename to app/src/js/components/operations/series/edition/validation.js diff --git a/src/js/components/operations/series/home.js b/app/src/js/components/operations/series/home.js similarity index 100% rename from src/js/components/operations/series/home.js rename to app/src/js/components/operations/series/home.js diff --git a/src/js/components/operations/series/index.js b/app/src/js/components/operations/series/index.js similarity index 100% rename from src/js/components/operations/series/index.js rename to app/src/js/components/operations/series/index.js diff --git a/src/js/components/operations/series/search.js b/app/src/js/components/operations/series/search.js similarity index 82% rename from src/js/components/operations/series/search.js rename to app/src/js/components/operations/series/search.js index d6928f77d..b915fc848 100644 --- a/src/js/components/operations/series/search.js +++ b/app/src/js/components/operations/series/search.js @@ -14,7 +14,14 @@ import { toSelectModel } from '../shared/utils/itemToSelectModel'; const filterLabel = filterKeyDeburr(['prefLabelLg1']); const filterTypeCode = filterKeyDeburr(['typeCode']); const filterCreator = filterKeyDeburr(['creator']); -const fields = ['prefLabelLg1', 'typeCode', 'creator', 'dataCollector']; +const filterGestionnaire = filterKeyDeburr(['gestionnaire']); +const fields = [ + 'prefLabelLg1', + 'typeCode', + 'creator', + 'dataCollector', + 'gestionnaire', +]; class SearchFormList extends AbstractSearchComponent { static defaultState = { @@ -22,6 +29,7 @@ class SearchFormList extends AbstractSearchComponent { typeCode: '', creator: '', dataCollector: '', + gestionnaire: '', organisations: [], }; @@ -30,11 +38,18 @@ class SearchFormList extends AbstractSearchComponent { } handlers = this.handleChange(fields, newState => { - const { prefLabelLg1, typeCode, creator, dataCollector } = newState; + const { + prefLabelLg1, + typeCode, + creator, + dataCollector, + gestionnaire, + } = newState; return this.props.data .filter(filterLabel(prefLabelLg1)) .filter(filterTypeCode(typeCode)) .filter(filterCreator(creator)) + .filter(filterGestionnaire(gestionnaire)) .filter(series => { return ( !dataCollector || @@ -46,7 +61,14 @@ class SearchFormList extends AbstractSearchComponent { }); render() { - const { data, prefLabelLg1, typeCode, creator, dataCollector } = this.state; + const { + data, + prefLabelLg1, + typeCode, + creator, + dataCollector, + gestionnaire, + } = this.state; const { categories, organisations } = this.props; const organisationsOptions = toSelectModel(organisations); @@ -94,6 +116,23 @@ class SearchFormList extends AbstractSearchComponent {
+
+
+ +
+
diff --git a/src/js/components/operations/shared/list/index.spec.js b/app/src/js/components/operations/shared/list/index.spec.js similarity index 100% rename from src/js/components/operations/shared/list/index.spec.js rename to app/src/js/components/operations/shared/list/index.spec.js diff --git a/app/src/js/components/operations/shared/relations/index.js b/app/src/js/components/operations/shared/relations/index.js new file mode 100644 index 000000000..85055ee2b --- /dev/null +++ b/app/src/js/components/operations/shared/relations/index.js @@ -0,0 +1,82 @@ +import React from 'react'; +import { Note } from 'js/components/shared/note/note'; +import './relations.scss'; +import { Link } from 'react-router-dom'; + +export function RelationsViewPerLgContent({ + children, + childrenTitle, + childrenPath, + parent, + parentTitle, + parentPath, + langSuffix, +}) { + return ( + <> + {parent && ( +

+ {parentTitle}: + + {parent[`label${langSuffix}`]} + +

+ )} + {children && ( + <> +

+ {childrenTitle}: +

+
    + {children + .sort(function(a, b) { + return a[`label${langSuffix}`].localeCompare( + b[`label${langSuffix}`] + ); + }) + .map(item => ( +
  • + + {item[`label${langSuffix}`]} + +
  • + ))} +
+ + )} + + ); +} + +export function RelationsViewPerLg(props) { + return ( + } + title={props.title} + lang={props.currentLang} + alone={!props.secondLang} + allowEmpty={true} + /> + ); +} + +function RelationsView(props) { + return ( +
+ + {props.secondLang && ( + + )} +
+ ); +} + +export default RelationsView; diff --git a/src/js/components/operations/shared/relations/relations.scss b/app/src/js/components/operations/shared/relations/relations.scss similarity index 100% rename from src/js/components/operations/shared/relations/relations.scss rename to app/src/js/components/operations/shared/relations/relations.scss diff --git a/src/js/components/operations/shared/seeAlso/index.js b/app/src/js/components/operations/shared/seeAlso/index.js similarity index 100% rename from src/js/components/operations/shared/seeAlso/index.js rename to app/src/js/components/operations/shared/seeAlso/index.js diff --git a/src/js/components/operations/shared/seeAlso/index.spec.js b/app/src/js/components/operations/shared/seeAlso/index.spec.js similarity index 100% rename from src/js/components/operations/shared/seeAlso/index.spec.js rename to app/src/js/components/operations/shared/seeAlso/index.spec.js diff --git a/src/js/components/operations/shared/utils/itemToSelectModel.js b/app/src/js/components/operations/shared/utils/itemToSelectModel.js similarity index 100% rename from src/js/components/operations/shared/utils/itemToSelectModel.js rename to app/src/js/components/operations/shared/utils/itemToSelectModel.js diff --git a/src/js/components/operations/shared/utils/itemToSelectModel.spec.js b/app/src/js/components/operations/shared/utils/itemToSelectModel.spec.js similarity index 100% rename from src/js/components/operations/shared/utils/itemToSelectModel.spec.js rename to app/src/js/components/operations/shared/utils/itemToSelectModel.spec.js diff --git a/app/src/js/components/operations/shared/validationButton/index.js b/app/src/js/components/operations/shared/validationButton/index.js new file mode 100644 index 000000000..afb3b9c4f --- /dev/null +++ b/app/src/js/components/operations/shared/validationButton/index.js @@ -0,0 +1,19 @@ +import D from 'js/i18n'; +import React, { useCallback } from 'react'; +import Button from 'js/components/shared/button'; + +export default ({ object = {}, callback, disabled = false }) => { + const state = object.validationState || ''; + + const clickHandler = useCallback(() => { + console.log('hello'); + callback(object); + }, []); + + if (state.indexOf('validated') >= 0) { + return