Commit bbab5166 authored by Axel Bocciarelli's avatar Axel Bocciarelli
Browse files

Flatten config folder

parent 2aa60a4e
Pipeline #32495 failed with stage
in 3 minutes and 10 seconds
......@@ -17,7 +17,7 @@ Currently, datahub depends on:
- [Installation](#installation)
- [Configuration](#configuration)
- [Developments](#developments)
- [Development](#development)
# Installation
......@@ -39,11 +39,10 @@ Currently, datahub depends on:
Datahub configuration is spread among different files located in <kbd>src/config</kbd>. These files are:
- [icat.js](#icatjs) : configure access to the metadata catalogue.
- [icatPlus.js](#icatplusjs) : configure access to the ICAT+ server
- [techniques.js](#techniquesjs) : configure the known techniques
- [gui.config.js](#guiconfigjs) : configuration file for the logbook (to be moved to config.js)
- [config.js](#configjs) : UI general configuration of the GUI
- `icat.js` - configure access to metadata catalogue
- `icatPlus.js` - configure access to ICAT+ server
- [`techniques.js`](#techniquesjs) - configure known techniques
- [`ui.js`](#uijs) - general UI configuration
Some of the configuration options in these files are stored in [environment variables](#environment-variables).
......@@ -61,7 +60,7 @@ The following portal configuration variables are declared in <kbd>.env</kbd>:
In development, you can override any of these variables by creating a file called `.env.local`. This file is ignored from version control.
## techniques.js
## `techniques.js`
The file [techniques.js](src/config/techniques/techniques.js) complements short named techniques as stored in ICAT metadata catalogue. It maps a short name to a description and display settings.
......@@ -81,23 +80,12 @@ color: "#97E0FE"
},
```
## gui.config.js
Edit the file [gui.config.js](src/config/gui.config.js) with your favorite text editor and set the GUI configuration following the indications below.
<!--START configurationGUI -->
```js
```
<!--END configurationGUI -->
## ui.config.js
## `ui.js`
<!--START config -->
```js
var UI = {
const UI = {
status: {
offline: {
enabled: false,
......@@ -105,20 +93,21 @@ var UI = {
},
},
menu: {
applicationTittle: 'Data Portal',
applicationTitle: 'Data Portal',
isSearchVisible: true,
isClosedDataVisible: true,
isOpenDataVisible: true,
isMySelectionVisible: true,
},
sampleTracking: {
//** Makes visible or invisible the menus and tabs related to sample tracking */
enabled: true,
},
loginForm: {
header: '',
/** Text displayed on top of the username sigin form. Someone can customize the text as: User office account, ESRF Account, Umbrella account, etc... */
usernameLabel: 'Username',
sso: {
title: 'Sign in with SSO',
buttonText: 'ESRF SSO',
},
ssoBtnLabel: 'Sign in with ESRF SSO',
},
investigationContainer: {
isDatasetListVisible: true,
......@@ -147,11 +136,14 @@ var UI = {
* When it is set to false, the event list is not refreshed but the amount of new events which arriived is shown.*/
AUTOREFRESH_EVENTLIST: true,
/* Time interval between requests checking whether new events arrived. (in milliseconds) */
AUTOREFRESH_DELAY: 20000,
AUTOREFRESH_DELAY: 60000,
},
dangerousGoodsHelp:
'Please ensure you reply correctly to this question after consultation with your lab safety referent and/or the transport company. This question is for ESRF internal use only - you must correctly declare your parcel in the official transport documents',
footer: {
text: 'European Synchrotron Radiation Facility',
},
samplePageTemplateURL: 'https://smis.esrf.fr/misapps/SMISWebClient/protected/samplesheet/view.do?pk=',
};
export default UI;
......@@ -159,7 +151,7 @@ export default UI;
<!--END config -->
# Developments
# Development
- [Tests](#tests)
- [Code quality](#code-quality)
......
......@@ -2,7 +2,7 @@ import React, { useEffect } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { Route, Switch, Redirect, useLocation } from 'react-router-dom';
import Footer from './components/Footer';
import UI from './config/ui/config';
import UI from './config/ui';
import AddressesPage from './containers/AddressesPage';
import LoginPage from './containers/LoginPage';
import MyDataPage from './containers/MyDataPage';
......
import axios from 'axios';
import ICATPLUS from '../config/icat/icatPlus';
import ICATPLUS from '../config/icatPlus';
import {
LOGGED_IN,
LOGIN_ERROR,
......@@ -7,7 +7,7 @@ import {
LOG_OUT,
} from '../constants/actionTypes';
import keycloak from '../keycloak';
import ICAT from '../config/icat/icat';
import ICAT from '../config/icat';
export function doLogOut(params = { expired: false }) {
return { type: LOG_OUT, ...params };
......
import ICATPLUS from '../../config/icat/icatPlus';
import ICATPLUS from '../../config/icatPlus';
/** To be removed from here */
const IDS = {
......
......@@ -8,7 +8,7 @@ import {
} from '../../constants/parameterTypes';
import DOIBadge from '../doi/DOIBadge';
import ResponsiveTable from '../Table/ResponsiveTable';
import UI from '../../config/ui/config';
import UI from '../../config/ui';
class DataCollectionTable extends React.Component {
doiFormatter(cell) {
......
......@@ -2,7 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import { Glyphicon } from 'react-bootstrap';
import moment from 'moment';
import TECHNIQUES from '../../config/techniques/techniques';
import TECHNIQUES from '../../config/techniques';
import { FILE_COUNT, VOLUME } from '../../constants/parameterTypes';
import { getDatasetParameterByName, stringifyBytesSize } from '../../helpers';
import ResponsiveTable from '../Table/ResponsiveTable';
......
import React from 'react';
import { Badge, Panel, Tab, Tabs } from 'react-bootstrap';
import TECHNIQUES from '../../config/techniques/techniques';
import TECHNIQUES from '../../config/techniques';
import { FILE_COUNT } from '../../constants/parameterTypes';
import { getDatasetParameterByPrefixName } from '../../helpers';
import DatasetFileTree from '../File/DatasetFileTree';
......
import React from 'react';
import UI from '../config/ui/config';
import UI from '../config/ui';
import logo from '../images/ebs.gif';
import styles from './Footer.module.css';
......
......@@ -16,7 +16,7 @@ import {
LOCALSTORAGE_KEY_EDITED_EVENT_CONTENT_IN_PLAINTEXT_FORMAT,
LOCALSTORAGE_KEY_EDITED_EVENT_CONTENT_IN_HTML_FORMAT,
} from '../../../constants/eventTypes';
import UI from '../../../config/ui/config';
import UI from '../../../config/ui';
import { getFileByEventId, uploadFile } from '../../../api/icat/icatPlus';
const EDITOR_ID_FOR_CREATION = 'myEditorForCreation';
......
import PropTypes from 'prop-types';
import React from 'react';
import ReactPaginate from 'react-paginate';
import UI from '../../config/ui/config';
import UI from '../../config/ui';
/* This class handles the display of pages for the logbook */
class LogbookPager extends React.Component {
......
......@@ -14,7 +14,7 @@ import {
Row,
} from 'react-bootstrap';
import { GithubPicker } from 'react-color';
import UI from '../../../config/ui/config';
import UI from '../../../config/ui';
function renderPopoverColorPickerBottom(callback) {
return (
......
......@@ -2,7 +2,7 @@ import { intersectionWith } from 'lodash-es';
import PropTypes from 'prop-types';
import React from 'react';
import CreatableSelect from 'react-select/lib/Creatable';
import UI from '../../../config/ui/config';
import UI from '../../../config/ui';
class TagSelector extends React.Component {
constructor(props) {
......
import React from 'react';
import { Button } from 'react-bootstrap';
import ICAT from '../../config/icat/icat';
import ICAT from '../../config/icat';
import { doSignIn } from '../../actions/login';
import { useDispatch } from 'react-redux';
......
......@@ -8,7 +8,7 @@ import {
FormGroup,
ControlLabel,
} from 'react-bootstrap';
import UI from '../../config/ui/config';
import UI from '../../config/ui';
import ErrorUserMessage from '../UserMessages/ErrorUserMessage';
import AnonymousSignIn from './AnonymousSignIn';
import { useSelector, useDispatch } from 'react-redux';
......
import React from 'react';
import { Panel, Tab, Tabs } from 'react-bootstrap';
import ICAT from '../../config/icat/icat';
import ICAT from '../../config/icat';
import SSO from './SSO';
import LoginForm from './LoginForm';
......
import React from 'react';
import UI from '../../config/ui/config';
import UI from '../../config/ui';
import Loader from '../Loader';
import ErrorUserMessage from '../UserMessages/ErrorUserMessage';
import AnonymousSignIn from './AnonymousSignIn';
......@@ -49,7 +49,7 @@ function SSO() {
bsSize="large"
onClick={handleClick}
>
{UI.loginForm.sso.title}
{UI.loginForm.ssoBtnLabel}
</Button>
<AnonymousSignIn />
......
......@@ -2,7 +2,7 @@ import React from 'react';
import { Glyphicon, Nav, Navbar, NavDropdown, NavItem } from 'react-bootstrap';
import { LinkContainer } from 'react-router-bootstrap';
import { Link } from 'react-router-dom';
import UI from '../../config/ui/config';
import UI from '../../config/ui';
import BreadCrumbs from '../Breadcrumbs/BreadCrumbs';
import ManagerMenu from './ManagerMenu';
import keycloak from '../../keycloak';
......
import React, { useState } from 'react';
import { Alert, Button, HelpBlock, Modal } from 'react-bootstrap';
import { useForm } from 'react-hook-form';
import UI from '../../config/ui/config';
import UI from '../../config/ui';
function DangerousGoodsModal(props) {
const { onConfirm, onCloseModal, isProcessing } = props;
......
......@@ -3,7 +3,7 @@ import { Badge, Glyphicon, Nav, NavItem } from 'react-bootstrap';
import { useSelector } from 'react-redux';
import { useParams } from 'react-router';
import { LinkContainer } from 'react-router-bootstrap';
import UI from '../../config/ui/config';
import UI from '../../config/ui';
function TabContainerMenu(props) {
const { doi } = props;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment