diff --git a/frontend/src/common.styles.js b/frontend/src/common.styles.js index f61dcac6ed..25764ca2a1 100644 --- a/frontend/src/common.styles.js +++ b/frontend/src/common.styles.js @@ -77,6 +77,8 @@ export const useCommonStyles = makeStyles(theme => ({ right: '40px', bottom: '40px', transform: 'translateY(400px)', + zIndex: 300, + position: 'relative', }, fadeInBottomEnter: { transform: 'translateY(0)', diff --git a/frontend/src/component/common/ProjectSelect/ProjectSelect.jsx b/frontend/src/component/common/ProjectSelect/ProjectSelect.jsx index f1866aeffa..bdca6ac04c 100644 --- a/frontend/src/component/common/ProjectSelect/ProjectSelect.jsx +++ b/frontend/src/component/common/ProjectSelect/ProjectSelect.jsx @@ -1,16 +1,26 @@ -import React from 'react'; +import React, { useEffect } from 'react'; import { MenuItem } from '@material-ui/core'; import PropTypes from 'prop-types'; import DropdownMenu from '../DropdownMenu/DropdownMenu'; +import useProjects from '../../../hooks/api/getters/useProjects/useProjects'; const ALL_PROJECTS = { id: '*', name: '> All projects' }; -const ProjectSelect = ({ - projects, - currentProjectId, - updateCurrentProject, - ...rest -}) => { +const ProjectSelect = ({ currentProjectId, updateCurrentProject, ...rest }) => { + const { projects } = useProjects(); + + useEffect(() => { + let currentProject = projects.find(i => i.id === currentProjectId); + + if (currentProject) { + setProject(currentProject.id); + return; + } + + setProject('*'); + /* eslint-disable-next-line */ + }, []); + const setProject = v => { const id = typeof v === 'string' ? v.trim() : ''; updateCurrentProject(id); diff --git a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListActions/FeatureToggleListActions.jsx b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListActions/FeatureToggleListActions.jsx index 34db58ead4..541400d159 100644 --- a/frontend/src/component/feature/FeatureToggleList/FeatureToggleListActions/FeatureToggleListActions.jsx +++ b/frontend/src/component/feature/FeatureToggleList/FeatureToggleListActions/FeatureToggleListActions.jsx @@ -9,6 +9,8 @@ import DropdownMenu from '../../../common/DropdownMenu/DropdownMenu'; import ProjectSelect from '../../../common/ProjectSelect'; import { useStyles } from './styles'; import useLoading from '../../../../hooks/useLoading'; +import useUiConfig from '../../../../hooks/api/getters/useUiConfig/useUiConfig'; +import ConditionallyRender from '../../../common/ConditionallyRender'; const sortingOptions = [ { type: 'name', displayName: 'Name' }, @@ -29,6 +31,7 @@ const FeatureToggleListActions = ({ loading, }) => { const styles = useStyles(); + const { uiConfig } = useUiConfig(); const ref = useLoading(loading); const handleSort = e => { @@ -94,14 +97,19 @@ const FeatureToggleListActions = ({ style={{ textTransform: 'lowercase', fontWeight: 'normal' }} data-loading /> - + } /> ); diff --git a/frontend/src/component/feature/strategy/EditStrategyModal/EditStrategyModal.jsx b/frontend/src/component/feature/strategy/EditStrategyModal/EditStrategyModal.jsx index d90692eb11..f2629dc419 100644 --- a/frontend/src/component/feature/strategy/EditStrategyModal/EditStrategyModal.jsx +++ b/frontend/src/component/feature/strategy/EditStrategyModal/EditStrategyModal.jsx @@ -61,6 +61,11 @@ const EditStrategyModal = ({ const { constraints } = strategy; let valid = true; + if (!constraints) { + saveStrategy(); + return; + } + constraints.forEach((constraint, index) => { const { values } = constraint;