Skip to content

Commit

Permalink
Merge pull request #211 from InseeFr/release3.0.8
Browse files Browse the repository at this point in the history
Release3.0.8
  • Loading branch information
MichaelC67 authored Sep 30, 2021
2 parents 881a21d + 1b5fb31 commit 0831485
Show file tree
Hide file tree
Showing 98 changed files with 1,672 additions and 985 deletions.
2 changes: 1 addition & 1 deletion .kubernetes/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: bauhaus
image: nicolaslaval/bauhaus:3.0.7
image: nicolaslaval/bauhaus:3.0.8
env:
- name: API_BASE_HOST
value: 'https://bauhaus-api.toto.fr/api'
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Bauhaus",
"version": "3.0.7",
"version": "3.0.8",
"description": "Web application for the management of concepts, classifications and other statistical objects",
"repository": {
"type": "git",
Expand Down
1 change: 1 addition & 0 deletions app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import '@inseefr/iam/dist/index.css';
import 'bauhaus-operations/dist/index.css';
import 'bauhaus-structures/dist/index.css';
import 'bauhaus-utilities/dist/index.css';
import 'bauhaus-codelists/dist/index.css';

import 'main.scss';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useCallback } from 'react';
import React, { useEffect, useCallback, useState } from 'react';
import { connect } from 'react-redux';
import { useHistory } from 'react-router-dom';
import Keycloak from 'keycloak';
Expand All @@ -10,6 +10,7 @@ const kcConfig = `${window.location.origin}/keycloak.json`;

const kc = Keycloak(kcConfig);
const LoginOpenIDConnect = ({ saveUserProps, authenticated, WrappedComponent }) => {
const [token, setToken] = useState(Auth.getToken())
const history = useHistory()
const refreshToken = useCallback(() => {
kc
Expand Down Expand Up @@ -42,7 +43,10 @@ const LoginOpenIDConnect = ({ saveUserProps, authenticated, WrappedComponent })
saveUserProps(
Auth.getAuthPropsFromToken(kc.tokenParsed)
);
kc.token && Auth.setToken(kc.token);
if(kc.token) {
Auth.setToken(kc.token);
setToken(kc.token)
}
setInterval(() => refreshToken(), 20000);
history.push({ pathname: history.location.pathname, state: 'init' });
})
Expand All @@ -53,7 +57,6 @@ const LoginOpenIDConnect = ({ saveUserProps, authenticated, WrappedComponent })
initLogin();
}, [initLogin])

const token = Auth.getToken();
if (authenticated && token && Auth.isTokenValid(token))
return <WrappedComponent />;
return <Loading textType="authentification" />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';
import { PageTitle, SearchableList } from '@inseefr/wilco';
import D from 'js/i18n';
import { useTitle } from 'bauhaus-utilities';

const CorrespondencesHome = ({ correspondences }) => {
useTitle(D.classificationsTitle, D.correspondencesTitle);
return (
<div className="container">
<div className="row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
import React, { Component } from 'react';
import React from 'react';
import { PageTitle, Note } from '@inseefr/wilco';
import CorrespondenceControls from './controls';
import { generalFields } from './general-fields';
import { ExplanatoryNote } from 'js/applications/shared/explanatory-note';
import { D1, D2 } from 'js/i18n';
import { propTypes as correspondencePropTypes } from 'js/applications/classifications/utils/correspondence/general';
import { CheckSecondLang } from 'bauhaus-utilities';
import { CheckSecondLang, useTitle } from 'bauhaus-utilities';
import D from '../../../../i18n/build-dictionary';

class HomeGeneral extends Component {
static propTypes = {
correspondence: correspondencePropTypes.isRequired,
};
render() {
const {
correspondence,
secondLang,
langs: { lg1, lg2 },
} = this.props;
const {
labelLg1,
labelLg2,
firstClassLabelLg2,
secondClassLabelLg2,
} = correspondence;
const title = secondLang ? labelLg2 : labelLg1;
return (
<div>
{title && <PageTitle title={title} />}
<CorrespondenceControls />
<CheckSecondLang />
<div className="row">
{(!secondLang ||
(secondLang && (firstClassLabelLg2 || secondClassLabelLg2))) && (
<Note
text={generalFields(correspondence, secondLang)}
title={D1.globalInformationsTitle}
alone={true}
allowEmpty={true}
/>
)}
</div>
<span>
const HomeGeneral = ({
correspondence,
secondLang,
langs: { lg1, lg2 },
}) => {
const {
labelLg1,
labelLg2,
firstClassLabelLg2,
secondClassLabelLg2,
} = correspondence;
const title = secondLang ? labelLg2 : labelLg1;

useTitle(D.classificationsTitle, labelLg1);

return (
<div>
{title && <PageTitle title={title} />}
<CorrespondenceControls />
<CheckSecondLang />
<div className="row">
{(!secondLang ||
(secondLang && (firstClassLabelLg2 || secondClassLabelLg2))) && (
<Note
text={generalFields(correspondence, secondLang)}
title={D1.globalInformationsTitle}
alone={true}
allowEmpty={true}
/>
)}
</div>
<span>
{correspondence.descriptionLg1 && (
<div className="row">
<ExplanatoryNote
Expand All @@ -60,9 +58,8 @@ class HomeGeneral extends Component {
</div>
)}
</span>
</div>
);
}
</div>
);
}

export default HomeGeneral;
2 changes: 2 additions & 0 deletions app/src/js/applications/classifications/families/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import React from 'react';
import PropTypes from 'prop-types';
import { PageTitle, SearchableList } from '@inseefr/wilco';
import D from 'js/i18n';
import { useTitle } from 'bauhaus-utilities';

const FamiliesHome = ({ families }) => {
useTitle(D.classificationsTitle, D.familiesTitle);
return (
<div className="container">
<div className="row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import React from 'react';
import { PageTitle } from '@inseefr/wilco';
import Controls from './controls';
import Members from './members';
import { CheckSecondLang } from 'bauhaus-utilities';
import { CheckSecondLang, useTitle } from 'bauhaus-utilities';
import D from '../../../../i18n/build-dictionary';

const FamilyVisualization = ({
family: {
Expand All @@ -11,6 +12,8 @@ const FamilyVisualization = ({
},
secondLang,
}) => {
useTitle(D.classificationsTitle, prefLabelLg1);

return (
<div className="container">
<PageTitle title={prefLabelLg1} context="classifications" />
Expand Down
3 changes: 3 additions & 0 deletions app/src/js/applications/classifications/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import React from 'react';
import PropTypes from 'prop-types';
import { PageTitle, SearchableList } from '@inseefr/wilco';
import D from 'js/i18n';
import { useTitle } from 'bauhaus-utilities';

const ClassificationsHome = ({ classifications }) => {
useTitle(D.classificationsTitle, D.classificationsTitle);

return (
<div className="container">
<div className="row">
Expand Down
3 changes: 3 additions & 0 deletions app/src/js/applications/classifications/series/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import React from 'react';
import PropTypes from 'prop-types';
import { PageTitle, SearchableList } from '@inseefr/wilco';
import D from 'js/i18n';
import { useTitle } from 'bauhaus-utilities';

const SeriesHome = ({ series }) => {
useTitle(D.classificationsTitle, D.seriesTitle);

return (
<div className="container">
<div className="row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import React, { Component } from 'react';
import React from 'react';
import { PageSubtitle, PageTitle } from '@inseefr/wilco';
import Controls from './controls';
import General from './general';
import Notes from './notes';
import Members from './members';
import { CheckSecondLang } from 'bauhaus-utilities';
import { CheckSecondLang, useTitle } from 'bauhaus-utilities';
import D from '../../../../i18n/build-dictionary';

class SeriesVisualization extends Component {
render() {
const {
series: { general, members },
secondLang,
langs,
} = this.props;
const notes = {
const SeriesVisualization = ({
series: { general, members },
secondLang,
langs,
}) => {
useTitle(D.classificationsTitle, general?.prefLabelLg1);

const notes = {
scopeNoteLg1: general.scopeNoteLg1,
scopeNoteLg2: general.scopeNoteLg2,
};
Expand All @@ -34,7 +35,6 @@ class SeriesVisualization extends Component {
)}
</div>
);
}
}

export default SeriesVisualization;
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import General from './general';
import Notes from './notes';
import Levels from './levels';
import D from 'js/i18n';
import { CheckSecondLang } from 'bauhaus-utilities';
import { CheckSecondLang, useTitle } from 'bauhaus-utilities';

const ClassificationVisualization = props => {
const {
Expand All @@ -15,6 +15,8 @@ const ClassificationVisualization = props => {
secondLang,
langs,
} = props;
useTitle(D.classificationsTitle, general?.prefLabelLg1);

const notes = {
scopeNoteLg1: general.scopeNoteLg1,
scopeNoteLg2: general.scopeNoteLg2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import { PageTitle } from '@inseefr/wilco';
import Controls from './controls';
import DnDTree from 'js/applications/shared/tree/dnd';
import D from 'js/i18n';
import { CheckSecondLang } from 'bauhaus-utilities';
import { CheckSecondLang, useTitle } from 'bauhaus-utilities';

const ClassificationTree = ({ data, prefLabel }) => {
useTitle(D.classificationsTitle, D.classificationTreeTitle + ': ' + prefLabel);

return (
<div>
<div className="container">
Expand Down
2 changes: 0 additions & 2 deletions app/src/js/applications/codelists/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import {
Home,
CodelistComponentView,
CodelistEdit,
D,
SearchFormList,
} from 'bauhaus-codelists';

const CodesListComponent = () => {
document.title = 'Bauhaus - ' + D.codelistsTitle;
document.getElementById('root-app').classList = ['codelists'];
return (
<>
Expand Down
4 changes: 3 additions & 1 deletion app/src/js/applications/collections/edition-creation/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import CollectionEditionCreationControls from './controls';
import GeneralEdition from './general';
import MembersEdition from './members';
import { propTypes as generalPropTypes } from 'js/utils/collections/general';
import { withTitle } from 'bauhaus-utilities';
import D from '../../../i18n/build-dictionary';

class CollectionEditionCreation extends Component {
constructor(props) {
Expand Down Expand Up @@ -140,4 +142,4 @@ CollectionEditionCreation.propTypes = {
langs: PropTypes.object.isRequired,
};

export default CollectionEditionCreation;
export default withTitle(CollectionEditionCreation, D.collectionsTitle, props => props.general.prefLabelLg1 || D.createCollectionTitle);
4 changes: 4 additions & 0 deletions app/src/js/applications/collections/export/home-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ import { Loading } from '@inseefr/wilco';
import exportCollectionList from 'js/actions/collections/export-multi';
import loadCollectionList from 'js/actions/collections/list';
import { OK } from 'js/constants';
import { useTitle } from 'bauhaus-utilities';
import D from '../../../i18n/build-dictionary';

const CollectionsToExportContainer = ({
collections,
exportStatus,
loadCollectionList,
exportCollectionList,
}) => {
useTitle(D.collectionsTitle, D.exportTitle)

const [exportRequested, setExportRequested] = useState(false);

const handleExportCollectionList = useCallback(
Expand Down
Loading

0 comments on commit 0831485

Please sign in to comment.