Configuration

The data portal configuration is spread among different files located in src/config. These files are:

  • icat.js - configure access to metadata catalogue
  • icatPlus.js - configure access to ICAT+ server
  • techniques.js - configure known techniques
  • ui.js - general UI configuration

Some of the configuration options in these files are stored in environment variables.

Environment variables

Create React App loads environment variables from environment files (.env, .env.test, etc.) according to the Node environment (NODE_ENV). File .env is loaded in every environment with the lowest priority and is therefore used to declare default values and development fallbacks.

The following portal configuration variables are declared in .env:

  • REACT_APP_ICATPLUS_URL - the URL of the ICAT+ server (used in src/config/icatPlus.js)
  • REACT_APP_SSO_AUTH_ENABLED - whether to allow users to sign-in to ICAT with SSO (used in src/config/icat.js)
  • REACT_APP_ANONYMOUS_AUTH_ENABLED - whether to allow users to sign-in to ICAT as anonymous (used in src/config/icat.js)
  • REACT_APP_DB_AUTH_ENABLED - whether to allow users to sign-in to ICAT with database credentials (used in src/config/icat.js)

In development, you can override any of these variables by creating a file called .env.local. This file is ignored from version control.

Techniques

The file techniques.js complements short named techniques as stored in ICAT metadata catalogue. It maps a short name to a description and display settings.

To add a new technique, use the following object to fully define the technique.

/** Object defining the new technique */
{
/** Full name of the technique */
name: "Ptychography",
/** Short name of the technique as stored in ICAT */
shortname: "PTYCHO",
/** Full description of the technique */
description: "Ptychography is a technique invented by Walter Hoppe that aims to solve the diffraction-pattern phase problem by interfering adjacent Bragg reflections coherently and thereby determine their relative phase.",
/** Font color */
color: "#97E0FE"
},

UI

See ui.js