Skip to content

Commit

Permalink
Merge pull request #63 from EmmanuelDemey/master
Browse files Browse the repository at this point in the history
zenika
  • Loading branch information
NicoLaval authored Aug 26, 2019
2 parents 7ddb1e1 + b8dc903 commit 2ac3ad0
Show file tree
Hide file tree
Showing 869 changed files with 3,527 additions and 19,802 deletions.
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -34,4 +32,5 @@ yarn-error.log*
cypress/videos
cypress/screenshots

coverage
coverage
build
18 changes: 6 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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 "[email protected]"
- 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
Expand Down
3 changes: 3 additions & 0 deletions app/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REACT_APP_API_BASE_HOST = './api'

REACT_APP_APPLICATIONS = "classifications,concepts,operations"
3 changes: 3 additions & 0 deletions app/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
REACT_APP_API_BASE_HOST = 'http://localhost:8081/api'

REACT_APP_APPLICATIONS = "classifications,concepts,operations"
18 changes: 18 additions & 0 deletions app/.eslintrc
Original file line number Diff line number Diff line change
@@ -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
}
}
3 changes: 3 additions & 0 deletions app/.storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
import '@storybook/addon-knobs/register';
11 changes: 11 additions & 0 deletions app/.storybook/config.js
Original file line number Diff line number Diff line change
@@ -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);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
116 changes: 116 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]"
}
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion src/app.scss → app/src/app.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@import 'src/styles/mixin.scss';

// Define concepts colors
$color_concepts_1: #044173;
$color_concepts_2: #234ca5;
$color_concepts_3: #457dbb;
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
14 changes: 9 additions & 5 deletions src/index.js → app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -32,10 +34,12 @@ const renderApp = (Component, initState, props) => {

ReactDOM.render(
<Provider store={store}>
<main>
<Component {...props} />
<BackToTop />
</main>
<I18NContext.Provider value={bauhausLibraryDictionary}>
<main>
<Component {...props} />
<BackToTop />
</main>
</I18NContext.Provider>
</Provider>,
document.getElementById('root')
);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 2ac3ad0

Please sign in to comment.