Skip to content

Commit

Permalink
Merge branch 'acceptance'
Browse files Browse the repository at this point in the history
  • Loading branch information
alicela committed Apr 22, 2021
2 parents 32d60e2 + c46e20b commit e19c766
Show file tree
Hide file tree
Showing 187 changed files with 7,459 additions and 4,457 deletions.
2 changes: 1 addition & 1 deletion app/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_APP_API_BASE_HOST = 'http://localhost:6969/Bauhaus-Back-Office/api'
REACT_APP_API_BASE_HOST = 'http://localhost:8080/Bauhaus_BO_war/api'

REACT_APP_APPLICATIONS = "concepts,classifications"
2 changes: 1 addition & 1 deletion app/.env.production
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
REACT_APP_API_BASE_HOST = './api'
REACT_APP_APPLICATIONS = "concepts,classifications,operations"

REACT_APP_APPLICATIONS = "concepts,classifications"
3 changes: 1 addition & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Bauhaus",
"version": "2.1.2",
"version": "3.0.0",
"description": "Web application for the management of concepts, classifications and other statistical objects",
"repository": {
"type": "git",
Expand All @@ -27,7 +27,6 @@
"dependencies": {
"@inseefr/iam": "^0.0.1-rc11",
"@inseefr/wilco": "0.0.5",
"axios": "^0.19.0",
"bauhaus-structures": "^0.0.0",
"bauhaus-operations": "^0.0.0",
"bootstrap": "3.4.1",
Expand Down
Binary file removed app/src/img/accueil.jpg
Binary file not shown.
Binary file removed app/src/img/accueil.png
Binary file not shown.
Binary file removed app/src/img/admin.png
Binary file not shown.
Binary file removed app/src/img/classifications.jpg
Binary file not shown.
41 changes: 41 additions & 0 deletions app/src/img/codelists_blanc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions app/src/img/codelists_noir.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/img/concepts.jpg
Binary file not shown.
Binary file removed app/src/img/operations.jpg
Binary file not shown.
Binary file removed app/src/img/structures.jpg
Binary file not shown.
Binary file removed app/src/img/work-in-progress.png
Binary file not shown.
6 changes: 0 additions & 6 deletions app/src/js/actions/constants/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ export const LOAD_PROPERTIES_FAILURE = 'LOAD_PROPERTIES_FAILURE';
//SAVE_USER_PROPS
export const SAVE_USER_PROPS = 'SAVE_USER_PROPS';

//LOAD DISSEMINTATION STATUS
export const LOAD_DISSEMINATION_STATUS_LIST = 'LOAD_DISSEMINATION_STATUS_LIST';
export const LOAD_DISSEMINATION_STATUS_LIST_SUCCESS =
'LOAD_DISSEMINATION_STATUS_LIST_SUCCESS';
export const LOAD_DISSEMINATION_STATUS_LIST_FAILURE =
'LOAD_DISSEMINATION_STATUS_LIST_FAILURE';

//LOAD STAMPS
export const LOAD_STAMP_LIST = 'LOAD_STAMP_LIST';
Expand Down
1 change: 1 addition & 0 deletions app/src/js/actions/constants/operations/sims.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export const PUBLISH_OPERATIONS_SIMS_SUCCESS =
'PUBLISH_OPERATIONS_SIMS_SUCCESS';
export const PUBLISH_OPERATIONS_SIMS_FAILURE =
'PUBLISH_OPERATIONS_SIMS_FAILURE';
export const DELETE_SIMS_SUCCESS = 'DELETE_SIMS_SUCCESS';
22 changes: 0 additions & 22 deletions app/src/js/actions/dissemination-status.js

This file was deleted.

7 changes: 4 additions & 3 deletions app/src/js/actions/operations/sims/item.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import api from 'js/remote-api/operations-api';
import * as A from 'js/actions/constants';
import { LOADING } from 'js/constants';
import { D1, D2 } from 'js/i18n';

import { getPublishFactory } from '../utils';

Expand All @@ -22,8 +23,8 @@ function getFetchLabelsPromise(sims, promise) {
function mergeLabels(parent) {
return {
...sims,
labelLg1: parent.prefLabelLg1,
labelLg2: parent.prefLabelLg2,
labelLg1: D1.simsTitle + parent.prefLabelLg1,
labelLg2: D2.simsTitle + parent.prefLabelLg2,
};
}
if (sims.idOperation) {
Expand All @@ -44,7 +45,7 @@ function getFetchLabelsPromise(sims, promise) {
/**
* This method is called when we need to save a SIMS.
* If the sims passed as a parameter already have an id,
* we will send a PUR request. If this property is not
* we will send a PUT request. If this property is not
* present, a POST request will be send.
*
* @param {Sims} sims
Expand Down
19 changes: 12 additions & 7 deletions app/src/js/applications/auth/basic-auth/login-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,31 @@ class LoginBasicContainer extends Component {
updateRequested: false,
};
this.onClickValidate = (data) => {
const { stamp, role } = data;
this.props.checkAuth({ stamp, roles: role.map((r) => r.value) });
this.setState({
updateRequested: true,
});
api.postFakeUser( {
stamp: data.stamp,
roles: data.role.map(r => r.value)
}).finally(() => {
const { stamp, role } = data;
this.props.checkAuth({ stamp, roles: role.map((r) => r.value) });
this.setState({
updateRequested: true,
});
})

};
}

componentWillMount() {
const { stampList } = this.props;
const { roleList } = this.state;

if (!roleList) {
api.getRoleList().then((roleList) => {
this.setState({
roleList,
});
});
}
if (!stampList) this.props.loadStampList();
if (stampList.length === 0) this.props.loadStampList();
}

render() {
Expand Down
27 changes: 12 additions & 15 deletions app/src/js/applications/auth/hoc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react';
import React from 'react';
import { connect } from 'react-redux';
import LoginNoAuth from 'js/applications/auth/no-auth/login';
import LoginBasic from 'js/applications/auth/basic-auth/login-container';
Expand All @@ -7,21 +7,18 @@ import * as Impl from 'js/utils/auth/auth-impl';
import { Auth } from 'bauhaus-utilities';

const auth = WrappedComponent => {
class AuthComponent extends Component {
render() {
const { authType, roles } = this.props;
if (authType === Impl.OPEN_ID_CONNECT_AUTH)
return <LoginOpenIDConnect WrappedComponent={WrappedComponent} />;
const AuthComponent = ({ authType, roles }) => {
if (authType === Impl.OPEN_ID_CONNECT_AUTH)
return <LoginOpenIDConnect WrappedComponent={WrappedComponent} />;

if (roles) return <WrappedComponent />;
switch (authType) {
case Impl.NO_AUTH:
return <LoginNoAuth />;
case Impl.BASIC_AUTH:
return <LoginBasic />;
default:
return <div>Error</div>;
}
if (roles) return <WrappedComponent />;
switch (authType) {
case Impl.NO_AUTH:
return <LoginNoAuth />;
case Impl.BASIC_AUTH:
return <LoginBasic />;
default:
return <div>Error</div>;
}
}

Expand Down
1 change: 1 addition & 0 deletions app/src/js/applications/auth/hoc.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { mapStateToProps } from './hoc';

describe('mapStateToProps', () => {
it('should return the auth object with a role', () => {
const input = {
Expand Down
1 change: 0 additions & 1 deletion app/src/js/applications/classifications/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import Menu from 'js/applications/classifications/menu';

export default () => {
document.title = 'Bauhaus - ' + D.classificationsTitle;
document.getElementById('root-app').classList = ['classifications'];
return (
<>
<Menu />
Expand Down
1 change: 1 addition & 0 deletions app/src/js/applications/codelists/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const defaultRoute = '';
22 changes: 22 additions & 0 deletions app/src/js/applications/codelists/routes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import { Switch, Route } from 'react-router-dom';

import { Home } from 'bauhaus-codelists';

import D from 'js/i18n';

const CodesListComponent = () => {
console.log("yo")
document.title = 'Bauhaus - ' + D.structuresTitle;
return (
<>
<div className="container">
<Switch>
<Route exact path="/codelists" component={Home} />
</Switch>
</div>
</>
);
};

export default CodesListComponent;
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class CreationContainer extends Component {
const { conceptList, collectionList, stampList } = this.props;
if (!conceptList) this.props.loadConceptList();
if (!collectionList) this.props.loadCollectionList();
if (!stampList) this.props.loadStampList();
if (stampList.length === 0) this.props.loadStampList();
}

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class EditionContainer extends Component {
if (!collection) this.props.loadCollection(id);
if (!collectionList) this.props.loadCollectionList();
if (!conceptList) this.props.loadConceptList();
if (!stampList) this.props.loadStampList();
if (stampList.length === 0) this.props.loadStampList();
}

render() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CollectionVisualizationContainer extends Component {
componentWillMount() {
const { id, collection, stampList } = this.props;
if (!collection) this.props.loadCollections(id);
if (!stampList) this.props.loadStampList();
if (stampList.length === 0) this.props.loadStampList();
}

componentWillReceiveProps({ id, validationStatus }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Loading } from '@inseefr/wilco';
import * as select from 'js/reducers';
import ConceptSearchList from './home';
import loadStampList from 'js/actions/stamp';
import loadDisseminationStatusList from 'js/actions/dissemination-status';
import loadConceptSearchList from 'js/actions/concepts/search-list';
import { Stores } from 'bauhaus-utilities';

Expand All @@ -16,8 +15,8 @@ class ConceptSearchListContainer extends Component {
disseminationStatusList,
} = this.props;
if (!conceptSearchList) this.props.loadConceptSearchList();
if (!stampList) this.props.loadStampList();
if (!disseminationStatusList) this.props.loadDisseminationStatusList();
if (stampList.length === 0) this.props.loadStampList();
if (disseminationStatusList.length === 0) this.props.loadDisseminationStatusList();
}

render() {
Expand All @@ -43,12 +42,12 @@ class ConceptSearchListContainer extends Component {
const mapStateToProps = (state) => ({
conceptSearchList: select.getConceptSearchList(state),
stampList: Stores.Stamps.getStampList(state),
disseminationStatusList: select.getDisseminationStatusList(state),
disseminationStatusList: Stores.DisseminationStatus.getDisseminationStatusList(state),
});
const mapDispatchToProps = {
loadConceptSearchList,
loadStampList,
loadDisseminationStatusList,
loadDisseminationStatusList: Stores.DisseminationStatus.loadDisseminationStatusList,
};

export default connect(
Expand Down
Loading

0 comments on commit e19c766

Please sign in to comment.