diff --git a/docs/portal_config.md b/docs/portal_config.md index 7f4ecaa042..e3ccf50f87 100644 --- a/docs/portal_config.md +++ b/docs/portal_config.md @@ -192,6 +192,7 @@ Below is an example, with inline comments describing what each JSON block config // lacks support for search filter state, accessibility state, table state. "explorerHideEmptyFilterSection": false, // optional, when filtering data hide FilterSection when they are empty. "explorerFilterValuesToHide": ["array of strings"], // optional, Values set in array will be hidden in guppy filters. Intended use is to hide missing data category from filters, for this it should be set to the same as `missing_data_alias` in Guppy server config + "forceSingleLoginDropdownOptions": [], // optional, Values set in array will be used to force single login option dropdown for a list of IdPs. For example, if a single InCommon login needs to be shown as dropdown, this option will contain `["InCommon Login"]` and will be displayed as such. "studyRegistration": true, // optional, whether to enable the study registration feature "workspaceRegistration": true, // optional, whether to enable the workspace registration feature "workspaceTokenServiceRefreshTokenAtLogin": true, // optional, whether to refresh the WTS token directly at portal login (recommended mode). If not set, this refresh happens only when the user enters the workspace section of the portal (default/old/previous mode). diff --git a/src/Login/Login.jsx b/src/Login/Login.jsx index 693ec73f37..5d388107a2 100644 --- a/src/Login/Login.jsx +++ b/src/Login/Login.jsx @@ -3,13 +3,17 @@ import querystring from 'querystring'; import PropTypes from 'prop-types'; // see https://github.com/facebook/prop-types#prop-types import Select, { createFilter } from 'react-select'; import Button from '@gen3/ui-component/dist/components/Button'; -import { basename } from '../localconf'; +import { basename, forceSingleLoginDropdownOptions } from '../localconf'; import { components } from '../params'; import './Login.less'; const getInitialState = (height) => ({ height }); +const determineIfEntryLoginSelectShown = (name, loginOptionsLength) => ((forceSingleLoginDropdownOptions + && forceSingleLoginDropdownOptions.includes(name)) + || loginOptionsLength > 1); + // Get a url for a given "location" (location object should have at least the .from attribute) export const getUrlForRedirectLocation = (location) => { // compose next according to location.from @@ -157,7 +161,7 @@ class Login extends React.Component { // over the login options' names (e.g. "The University of // Chicago") and not the actual option values, which are // URLs. - loginOptions[i].length > 1 && ( + determineIfEntryLoginSelectShown(p.name, loginOptions[i].length) && (