+ {renderCustomStrategies()}
+
+ >
+ }
+ />
+
);
};
diff --git a/frontend/src/component/feature/strategy/EditStrategyModal/EditStrategyModal.jsx b/frontend/src/component/feature/strategy/EditStrategyModal/EditStrategyModal.jsx
index bf90bd4d7e..d90692eb11 100644
--- a/frontend/src/component/feature/strategy/EditStrategyModal/EditStrategyModal.jsx
+++ b/frontend/src/component/feature/strategy/EditStrategyModal/EditStrategyModal.jsx
@@ -1,12 +1,5 @@
-import React from 'react';
+import { useState } from 'react';
import PropTypes from 'prop-types';
-import {
- Button,
- Dialog,
- DialogContent,
- DialogTitle,
- DialogActions,
-} from '@material-ui/core';
import FlexibleStrategy from './FlexibleStrategy';
import DefaultStrategy from './default-strategy';
@@ -15,6 +8,7 @@ import GeneralStrategy from './general-strategy';
import StrategyConstraints from '../StrategyConstraint/StrategyConstraintInput';
import { getHumanReadbleStrategyName } from '../../../../utils/strategy-names';
+import Dialogue from '../../../common/Dialogue';
const EditStrategyModal = ({
onCancel,
@@ -24,6 +18,8 @@ const EditStrategyModal = ({
strategyDefinition,
context,
}) => {
+ const [constraintError, setConstraintError] = useState({});
+
const updateParameters = parameters => {
const updatedStrategy = { ...strategy, parameters };
updateStrategy(updatedStrategy);
@@ -57,47 +53,66 @@ const EditStrategyModal = ({
const { parameters } = strategy;
+ const disabledPrimaryButton = Object.keys(constraintError).some(key => {
+ return constraintError[key];
+ });
+
+ const save = () => {
+ const { constraints } = strategy;
+ let valid = true;
+
+ constraints.forEach((constraint, index) => {
+ const { values } = constraint;
+
+ if (values.length === 0) {
+ setConstraintError(prev => ({
+ ...prev,
+ [`${constraint.contextName}-${index}`]:
+ 'You need to specify at least one value',
+ }));
+ valid = false;
+ }
+ });
+
+ if (valid) {
+ saveStrategy();
+ }
+ };
+
return (
-
-
+ |
|
-
+ |
|
-
+ |
option.label}
- getOptionSelected={(option, value) =>
- option.value === value.value
- }
- filterSelectedOptions
- filterOptions={options =>
- options.filter(
- o => !values.some(v => v.value === o.value)
- )
- }
- onChange={(evt, values) =>
- handleChangeValue(values)
- }
- renderInput={params => (
-
- )}
- />
+
+ option.label}
+ onBlur={onBlur}
+ onFocus={() => resetError()}
+ getOptionSelected={(option, value) =>
+ option.value === value.value
+ }
+ filterSelectedOptions
+ filterOptions={options =>
+ options.filter(
+ o =>
+ !values.some(
+ v => v.value === o.value
+ )
+ )
+ }
+ onChange={(evt, values) =>
+ handleChangeValue(values)
+ }
+ renderInput={params => (
+
+ )}
+ />
+
}
elseShow={
-
- updateConstraint(values, 'values')
- }
- />
+
+
+ updateConstraint(values, 'values')
+ }
+ helperText={error}
+ FormHelperTextProps={{
+ classes: {
+ root: styles.helperText,
+ },
+ }}
+ />
+
}
/>
|
-
+ |
diff --git a/frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/StrategyConstraintInputField.styles.js b/frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/StrategyConstraintInputField.styles.js
index 6bbfae29da..8a604270ff 100644
--- a/frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/StrategyConstraintInputField.styles.js
+++ b/frontend/src/component/feature/strategy/StrategyConstraint/StrategyConstraintInputField/StrategyConstraintInputField.styles.js
@@ -7,4 +7,21 @@ export const useStyles = makeStyles({
operator: {
minWidth: '105px',
},
+ inputContainer: {
+ position: 'relative',
+ },
+ inputError: {
+ position: 'absolute',
+ fontSize: '0.9rem',
+ color: 'red',
+ top: '10px',
+ left: '12px',
+ },
+ tableCell: {
+ paddingBottom: '1.25rem',
+ },
+ helperText: {
+ position: 'absolute',
+ top: '35px',
+ },
});
diff --git a/frontend/src/component/feature/variant/AddVariant/AddVariant.jsx b/frontend/src/component/feature/variant/AddVariant/AddVariant.jsx
index b857026722..90d210aff8 100644
--- a/frontend/src/component/feature/variant/AddVariant/AddVariant.jsx
+++ b/frontend/src/component/feature/variant/AddVariant/AddVariant.jsx
@@ -187,6 +187,8 @@ const AddVariant = ({
primaryButtonText="Save"
secondaryButtonText="Cancel"
title={title}
+ fullWidth
+ maxWidth="md"
>
);
diff --git a/frontend/src/component/feature/variant/AddVariant/OverrideConfig/OverrideConfig.jsx b/frontend/src/component/feature/variant/AddVariant/OverrideConfig/OverrideConfig.jsx
index c72eb9677f..a02790b3b5 100644
--- a/frontend/src/component/feature/variant/AddVariant/OverrideConfig/OverrideConfig.jsx
+++ b/frontend/src/component/feature/variant/AddVariant/OverrideConfig/OverrideConfig.jsx
@@ -41,7 +41,13 @@ const OverrideConfig = ({
return (
-
+
-
+
0}
show={
@@ -68,6 +74,7 @@ const OverrideConfig = ({
getOptionLabel={option => option}
defaultValue={o.values}
value={o.values}
+ style={{ width: '100%' }}
filterSelectedOptions
size="small"
renderInput={params => (
@@ -75,6 +82,7 @@ const OverrideConfig = ({
{...params}
variant="outlined"
label="Legal values"
+ style={{ width: '100%' }}
/>
)}
/>
diff --git a/frontend/src/component/menu/Footer/Footer.jsx b/frontend/src/component/menu/Footer/Footer.jsx
index f643d6721f..197d54e803 100644
--- a/frontend/src/component/menu/Footer/Footer.jsx
+++ b/frontend/src/component/menu/Footer/Footer.jsx
@@ -16,255 +16,253 @@ export const Footer = () => {
-
-
-
-
- Server SDKs
-
-
-
- Node.js
-
- }
- />
-
-
-
- Java
-
- }
- />
-
-
-
- Go
-
- }
- />
- {' '}
-
-
- Ruby
-
- }
- />
- {' '}
-
-
- Python
-
- }
- />
-
-
-
- .NET
-
- }
- />
-
-
-
- PHP
-
- }
- />
-
-
-
- All SDKs
-
- }
- />
-
-
-
-
-
-
- Frontend SDKs
-
-
-
- Unleash Proxy
-
- }
- />
-
-
-
- JavaScript SDK
-
- }
- />
-
-
-
- React SDK
-
- }
- />
-
-
-
- iOS SDK
-
- }
- />
-
-
-
- Android SDK
-
- }
- />
-
-
-
-
-
-
- About
-
-
-
- getunleash.io
-
- }
- />
-
-
-
- Twitter
-
- }
- />
-
-
-
- LinkedIn
-
- }
- />
-
-
-
- GitHub
-
- }
- />
-
-
-
+
+
+
+
+ Server SDKs
+
+
+
+ Node.js
+
+ }
+ />
+
+
+
+ Java
+
+ }
+ />
+
+
+
+ Go
+
+ }
+ />
+ {' '}
+
+
+ Ruby
+
+ }
+ />
+ {' '}
+
+
+ Python
+
+ }
+ />
+
+
+
+ .NET
+
+ }
+ />
+
+
+
+ PHP
+
+ }
+ />
+
+
+
+ All SDKs
+
+ }
+ />
+
+
+
+
+
+
+ Frontend SDKs
+
+
+
+ Unleash Proxy
+
+ }
+ />
+
+
+
+ JavaScript SDK
+
+ }
+ />
+
+
+
+ React SDK
+
+ }
+ />
+
+
+
+ iOS SDK
+
+ }
+ />
+
+
+
+ Android SDK
+
+ }
+ />
+
+
+
+
+
+
+ About
+
+
+
+ getunleash.io
+
+ }
+ />
+
+
+
+ Twitter
+
+ }
+ />
+
+
+
+ LinkedIn
+
+ }
+ />
+
+
+
+ GitHub
+
+ }
+ />
+
+
+
+
+
-
-
-
-
);
};
diff --git a/frontend/src/component/menu/__tests__/__snapshots__/footer-test.jsx.snap b/frontend/src/component/menu/__tests__/__snapshots__/footer-test.jsx.snap
index 09ae63ad5c..ffd6e7d91c 100644
--- a/frontend/src/component/menu/__tests__/__snapshots__/footer-test.jsx.snap
+++ b/frontend/src/component/menu/__tests__/__snapshots__/footer-test.jsx.snap
@@ -199,7 +199,6 @@ exports[`should render DrawerMenu 1`] = `
|