Skip to content

Commit

Permalink
Merge pull request #56 from EmmanuelDemey/master
Browse files Browse the repository at this point in the history
zenika
  • Loading branch information
Evargalo authored Aug 6, 2019
2 parents 73b09ca + d3fc28d commit 95752e1
Show file tree
Hide file tree
Showing 105 changed files with 19,375 additions and 4,919 deletions.
2 changes: 1 addition & 1 deletion cypress.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"baseUrl": "http://localhost:3000",
"defaultCommandTimeout": 8000,
"env": {
"API": "http://localhost:8080/api/"
"API": "http://localhost:8081/api/"
}
}
2 changes: 1 addition & 1 deletion cypress/integration/family.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Family page', () => {
.click();
cy.url().should('include', '/operations/family/');
cy.get('.panel-body > ul > :nth-child(1) > a').click();
cy.url().should('include', '/operations/series/s1485');
cy.url().should('include', '/operations/series/s1501');
cy.get('.btn-line button')
.first()
.click();
Expand Down
2 changes: 1 addition & 1 deletion cypress/integration/sims.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ describe('SIMS Page', function() {
},
});
cy.get('.btn-line').contains('Créer le SIMS');
cy.get(':nth-child(3) > .btn').click();
cy.get(':nth-child(4) > .btn').click();

// Create Page
cy.url().should('contains', '/sims/create');
Expand Down
7,161 changes: 3,160 additions & 4,001 deletions package-lock.json

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"start-https": "cross-env HTTPS=true REACT_APP_VERSION=$npm_package_version REACT_APP_NAME=$npm_package_name react-scripts start",
"start-storybook": "cross-env NODE_PATH=src/ start-storybook -p 9999",
"test": "react-scripts test",
"test:coverage": "cross-env CI=true react-scripts test --coverage --collectCoverageFrom=src/**/*.js --collectCoverageFrom=!src/**/*.spec.js --collectCoverageFrom=!src/**/*.stories.js"
"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"
},
"husky": {
"hooks": {
Expand Down Expand Up @@ -63,16 +63,16 @@
"react-dropzone": "^10.1.5",
"react-loading": "2.0.3",
"react-modal": "3.1.8",
"react-redux": "5.1.1",
"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.1",
"redux-logger": "2.8.1",
"redux-thunk": "2.2.0"
"redux": "4.0.4",
"redux-logger": "3.0.6",
"redux-thunk": "2.3.0"
},
"devDependencies": {
"@babel/core": "7.3.3",
Expand All @@ -83,26 +83,26 @@
"@storybook/react": "5.1.0-rc.1",
"@types/cypress": "1.1.3",
"@types/jest": "24.0.12",
"axe-core": "3.2.2",
"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.2.0",
"cypress-axe": "0.4.1",
"cypress": "3.4.1",
"cypress-axe": "0.5.1",
"cypress-skip-and-only-ui": "^1.1.0",
"enzyme": "3.9.0",
"enzyme-adapter-react-16": "1.9.1",
"eslint-config-prettier": "4.0.0",
"eslint-config-react-app": "3.0.7",
"eslint-plugin-import": "2.16.0",
"eslint-plugin-jsx-a11y": "6.2.1",
"eslint-plugin-react": "7.12.4",
"husky": "2.3.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",
"husky": "3.0.2",
"jest-localstorage-mock": "2.4.0",
"node-sass": "4.12.0",
"npm-run-all": "4.1.5",
"prettier": "1.16.4",
"prettier": "1.18.2",
"react-test-renderer": "16.8.6",
"start-server-and-test": "1.9.1",
"term-size": "^1.2.0"
Expand Down
6 changes: 6 additions & 0 deletions src/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ a {
@include btn-group-vertical();
}

@media (max-width: 1000px) {
.operations-list {
width: 100%;
}
}

.btn-line {
margin-top: 15px;
margin-bottom: 15px;
Expand Down
2 changes: 1 addition & 1 deletion src/js/actions/operations/families/item.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import get, { saveFamily } from './item';
import { saveFamily } from './item';
import * as A from 'js/actions/constants';
import api from 'js/remote-api/operations-api';

Expand Down
2 changes: 1 addition & 1 deletion src/js/actions/operations/indicators/item.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import get, { saveIndicator } from './item';
import { saveIndicator } from './item';
import * as A from 'js/actions/constants';
import api from 'js/remote-api/operations-api';

Expand Down
9 changes: 6 additions & 3 deletions src/js/actions/operations/operations/item.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ export const saveOperation = (operation, callback) => dispatch => {
const method = operation.id ? 'putOperation' : 'postOperation';

return api[method](operation).then(
results => {
id => {
dispatch({
type: A.SAVE_OPERATIONS_OPERATION_SUCCESS,
payload: operation,
payload: {
...operation,
id,
},
});
callback(null, results);
callback(null, id);
},
err => {
dispatch({
Expand Down
5 changes: 2 additions & 3 deletions src/js/actions/operations/operations/item.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import get, { saveOperation } from './item';
import { saveOperation } from './item';
import * as A from 'js/actions/constants';
import api from 'js/remote-api/operations-api';
import { LOADING, NOT_LOADED } from 'js/constants';

const dispatch = jest.fn();
jest.mock('js/remote-api/operations-api');
Expand All @@ -12,7 +11,7 @@ describe('Operation actions', () => {
describe('save a operation', () => {
it('should call dispatch SAVE_OPERATIONS_OPERATION_SUCCESS action with the udpated operation', async () => {
api.putOperation = function(id) {
return Promise.resolve('');
return Promise.resolve('1');
};

const operation = { label: 'aaa', id: '1' };
Expand Down
62 changes: 29 additions & 33 deletions src/js/components/classifications/correspondences/home.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,38 @@
import React, { Component } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import PageTitle from 'js/components/shared/page-title';
import SearchRmes from 'js/components/shared/search-rmes/search-rmes';
import D from 'js/i18n';

class CorrespondencesHome extends Component {
static propTypes = {
items: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
}).isRequired
),
};
render() {
const { correspondences } = this.props;
return (
<div>
<div className="container">
<div className="row">
<div className="col-md-8 col-md-offset-2 centered">
<PageTitle
title={D.correspondencesSearchTitle}
col={12}
offset={0}
context="classifications"
/>
<SearchRmes
items={correspondences}
childPath="classifications/correspondence"
context="classifications"
/>
</div>
</div>
const CorrespondencesHome = ({ correspondences }) => {
return (
<div className="container">
<div className="row">
<div className="col-md-8 col-md-offset-2 centered">
<PageTitle
title={D.correspondencesSearchTitle}
col={12}
offset={0}
context="classifications"
/>
<SearchRmes
items={correspondences}
childPath="classifications/correspondence"
context="classifications"
/>
</div>
</div>
);
}
}
</div>
);
};

CorrespondencesHome.propTypes = {
items: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
}).isRequired
),
};

export default CorrespondencesHome;
63 changes: 29 additions & 34 deletions src/js/components/classifications/families/home.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
import React, { Component } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import PageTitle from 'js/components/shared/page-title';
import SearchRmes from 'js/components/shared/search-rmes/search-rmes';
import D from 'js/i18n';

class FamiliesHome extends Component {
static propTypes = {
items: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
}).isRequired
),
};

render() {
const { families } = this.props;
return (
<div>
<div className="container">
<div className="row">
<div className="col-md-8 col-md-offset-2 centered">
<PageTitle
title={D.familiesSearchTitle}
col={12}
offset={0}
context="classifications"
/>
<SearchRmes
items={families}
childPath="classifications/family"
context="classifications"
/>
</div>
</div>
const FamiliesHome = ({ families }) => {
return (
<div className="container">
<div className="row">
<div className="col-md-8 col-md-offset-2 centered">
<PageTitle
title={D.familiesSearchTitle}
col={12}
offset={0}
context="classifications"
/>
<SearchRmes
items={families}
childPath="classifications/family"
context="classifications"
/>
</div>
</div>
);
}
}
</div>
);
};

FamiliesHome.propTypes = {
items: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
}).isRequired
),
};

export default FamiliesHome;
63 changes: 29 additions & 34 deletions src/js/components/classifications/home.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,38 @@
import React, { Component } from 'react';
import React from 'react';
import PropTypes from 'prop-types';
import PageTitle from 'js/components/shared/page-title';
import SearchRmes from 'js/components/shared/search-rmes/search-rmes';
import D from 'js/i18n';

class ClassificationsHome extends Component {
static propTypes = {
items: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
}).isRequired
),
};

render() {
const { classifications } = this.props;
return (
<div>
<div className="container">
<div className="row">
<div className="col-md-8 col-md-offset-2 centered">
<PageTitle
title={D.classificationsSearchTitle}
col={12}
offset={0}
context="classifications"
/>
<SearchRmes
items={classifications}
childPath="classifications/classification"
context="classifications"
/>
</div>
</div>
const ClassificationsHome = ({ classifications }) => {
return (
<div className="container">
<div className="row">
<div className="col-md-8 col-md-offset-2 centered">
<PageTitle
title={D.classificationsSearchTitle}
col={12}
offset={0}
context="classifications"
/>
<SearchRmes
items={classifications}
childPath="classifications/classification"
context="classifications"
/>
</div>
</div>
);
}
}
</div>
);
};

ClassificationsHome.propTypes = {
items: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string.isRequired,
label: PropTypes.string.isRequired,
}).isRequired
),
};

export default ClassificationsHome;
Loading

0 comments on commit 95752e1

Please sign in to comment.