Skip to content

Commit

Permalink
Merge pull request #45 from EmmanuelDemey/master
Browse files Browse the repository at this point in the history
Some Fix for A11Y
  • Loading branch information
alicela authored May 17, 2019
2 parents 3b329ef + 0821e04 commit 0d6273f
Show file tree
Hide file tree
Showing 16 changed files with 382 additions and 173 deletions.
4 changes: 4 additions & 0 deletions cypress/integration/home.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
describe('Home Page', function() {
it(`Should go to the Concepts page and come back`, function() {
cy.server().visit(`/`);

cy.get('li:nth-child(1) a').click();

cy.url().should('match', /\/concepts$/);
cy.get('title').contains('Bauhaus - Concepts');
cy.go('back');
cy.get('.page-title').contains(
'Application de gestion des métadonnées de référence'
Expand All @@ -14,6 +16,7 @@ describe('Home Page', function() {
cy.server().visit(`/`);
cy.get('li:nth-child(2) a').click();
cy.url().should('match', /\/classifications$/);
cy.get('title').contains('Bauhaus - Nomenclatures');
cy.go('back');
cy.get('.page-title').contains(
'Application de gestion des métadonnées de référence'
Expand All @@ -23,6 +26,7 @@ describe('Home Page', function() {
cy.server().visit(`/`);
cy.get('li:nth-child(3) a').click();
cy.url().should('match', /\/operations\/series$/);
cy.get('title').contains('Bauhaus - Opérations');
cy.go('back');
cy.get('.page-title').contains(
'Application de gestion des métadonnées de référence'
Expand Down
69 changes: 55 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@
"moment": "2.23.0",
"moment-range": "3.0.3",
"prop-types": "15.7.2",
"react": "16.8.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.2",
"react-dom": "16.8.6",
"react-draft-wysiwyg": "1.12.0",
"react-loading": "2.0.3",
"react-modal": "3.1.8",
Expand Down Expand Up @@ -100,7 +100,7 @@
"node-sass": "4.11.0",
"npm-run-all": "4.1.5",
"prettier": "1.16.4",
"react-test-renderer": "16.8.2",
"react-test-renderer": "16.8.6",
"start-server-and-test": "1.7.11",
"term-size": "^1.2.0"
},
Expand Down
2 changes: 2 additions & 0 deletions src/js/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import operationsLogo from 'img/operations.jpg';
import D from 'js/i18n';

function App() {
document.title = 'Bauhaus';

return (
<React.Fragment>
<div className="centered page-title">
Expand Down
5 changes: 5 additions & 0 deletions src/js/components/menu/_menu.default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
padding-right: 5px;
}
}

.navbar-nav {
width: 100%;
}

.navbar-icon {
color: #ffffff;
font-size: 17px;
Expand Down
6 changes: 2 additions & 4 deletions src/js/components/menu/concepts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ class MenuConcepts extends Component {
{D.collectionsTitle}
</Link>
</li>
</ul>
<ul className="nav navbar-nav navbar-nav-concepts navbar-right">
<li className={paths.help.className}>
<li className={paths.help.className + ' navbar-right'}>
<Link
to={paths.help.path}
onClick={() => this.changeActivePath(paths.help.path)}
Expand All @@ -108,7 +106,7 @@ class MenuConcepts extends Component {
</Link>
</li>
{adminOrContributor && (
<li className={paths.administration.className}>
<li className={paths.help.className + ' navbar-right'}>
<Link
to={paths.administration.path}
onClick={() =>
Expand Down
4 changes: 1 addition & 3 deletions src/js/components/menu/operations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ class MenuOperations extends Component {
{D.indicatorsTitle}
</Link>
</li>
</ul>
<ul className="nav navbar-nav navbar-nav-operations navbar-right">
<li className={paths.help.className}>
<li className={paths.help.className + ' navbar-right'}>
<Link
to={paths.help.path}
onClick={() => this.changeActivePath(paths.help.path)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function DocumentsBloc({
<input
className="form-control"
id="documentFilter"
placeholder="Searcgh"
placeholder={D.search}
value={filter}
onChange={e => setFilter(e.target.value)}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/js/components/operations/msd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class MSDContainer extends Component {
}
}

const mapStateToProps = (state, ownProps) => {
export const mapStateToProps = (state, ownProps) => {
if (!state.operationsMetadataStructureList) {
return {
metadataStructureStatus: NOT_LOADED,
Expand Down
138 changes: 138 additions & 0 deletions src/js/components/operations/msd/index.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import { mapStateToProps, HELP, VIEW, CREATE } from './index';
import { NOT_LOADED, LOADED } from 'js/constants';

describe('', () => {
it('should return NOT_LOADED for the metadataStructureStatus', () => {
const input = {};
const expected = {
metadataStructureStatus: NOT_LOADED,
metadataStructure: [],
};
expect(mapStateToProps(input)).toEqual(expected);
});

it('should return a empty object as currenSims for the HELP MODE', () => {
const input = {
operationsMetadataStructureList: {
results: 'operationsMetadataStructureList',
status: LOADED,
},
app: {
properties: {
lg1: 'lg1',
lg2: 'lg2',
},
},
};

const props = {
mode: HELP,
match: {
params: {
id: 1,
},
},
};
const output = mapStateToProps(input, props);
expect(output.currentSims).toEqual({});
});

it('should return a currenSims with a default label for the CREATE MODE', () => {
const input = {
operationsMetadataStructureList: {
results: 'operationsMetadataStructureList',
status: LOADED,
},
app: {
properties: {
lg1: 'lg1',
lg2: 'lg2',
},
},
operationsSeriesCurrentStatus: LOADED,
operationsSeriesCurrent: {
id: 2,
prefLabelLg1: 'prefLabelLg1',
prefLabelLg2: 'prefLabelLg2',
},
};

const props = {
mode: CREATE,
match: {
params: {
idParent: 2,
0: 'series',
},
},
};
const output = mapStateToProps(input, props);
expect(output.currentSims).toEqual({
labelLg1: 'prefLabelLg1 SIMS',
labelLg2: 'SIMS de la série prefLabelLg2',
});
expect(output.parentType).toEqual('series');
});

it('should return a complete currenSims for the VIEW MODE', () => {
const input = {
operationsMetadataStructureList: {
results: 'operationsMetadataStructureList',
status: LOADED,
},
app: {
properties: {
lg1: 'lg1',
lg2: 'lg2',
},
},
operationsSimsCurrent: {
id: 1,
idOperation: 2,
},
};

const props = {
mode: VIEW,
match: {
params: {
id: 1,
},
},
};
const output = mapStateToProps(input, props);
expect(output.currentSims).toEqual({
id: 1,
idOperation: 2,
});
expect(output.parentType).toEqual('operation');
});

it('should return the langes', () => {
const input = {
operationsMetadataStructureList: {
results: 'operationsMetadataStructureList',
status: LOADED,
},
app: {
properties: {
lg1: 'lg1',
lg2: 'lg2',
},
},
};

const props = {
mode: HELP,
match: {
params: {
id: 1,
},
},
};
expect(mapStateToProps(input, props).langs).toEqual({
lg1: 'lg1',
lg2: 'lg2',
});
});
});
Loading

0 comments on commit 0d6273f

Please sign in to comment.