diff --git a/frontend/web/components/FeatureRow.js b/frontend/web/components/FeatureRow.js
index 5c609d44e63f..3004faccd197 100644
--- a/frontend/web/components/FeatureRow.js
+++ b/frontend/web/components/FeatureRow.js
@@ -141,20 +141,20 @@ class TheComponent extends Component {
const changeRequestsEnabled = Utils.changeRequestsEnabled(
environment && environment.minimum_change_request_approvals,
)
- const onChange = ()=> {
- if(disableControls) {
- return;
- }
- if (
- projectFlag?.multivariate_options?.length ||
- Utils.changeRequestsEnabled(
- environment.minimum_change_request_approvals,
- )
- ) {
- this.editFeature(projectFlag, environmentFlags[id])
- return
- }
- this.confirmToggle()
+ const onChange = () => {
+ if (disableControls) {
+ return
+ }
+ if (
+ projectFlag?.multivariate_options?.length ||
+ Utils.changeRequestsEnabled(
+ environment.minimum_change_request_approvals,
+ )
+ ) {
+ this.editFeature(projectFlag, environmentFlags[id])
+ return
+ }
+ this.confirmToggle()
}
const isCompact = getViewMode() === 'compact'
if (this.props.condensed) {
diff --git a/frontend/web/components/PasswordRequirements.js b/frontend/web/components/PasswordRequirements.js
index 0e0454025cbf..828f352eaf96 100644
--- a/frontend/web/components/PasswordRequirements.js
+++ b/frontend/web/components/PasswordRequirements.js
@@ -1,39 +1,56 @@
-import React, { useEffect } from 'react';
-import PropTypes from 'prop-types';
+import React, { useEffect } from 'react'
+import PropTypes from 'prop-types'
import { close, checkmark } from 'ionicons/icons'
import { IonIcon } from '@ionic/react'
-const PasswordRequirements = ({ password, onRequirementsMet}) => {
+const PasswordRequirements = ({ password, onRequirementsMet }) => {
const requirements = [
{ label: 'At least 8 characters', test: password.length >= 8 },
{ label: 'Contains a number', test: /\d/.test(password) },
- { label: 'Contains a special character', test: /[!@#$%^&*(),.?":{}|<>[\]\\\/_+=-]/.test(password) },
+ {
+ label: 'Contains a special character',
+ test: /[!@#$%^&*(),.?":{}|<>[\]\\\/_+=-]/.test(password),
+ },
{ label: 'Contains an uppercase letter', test: /[A-Z]/.test(password) },
{ label: 'Contains a lowercase letter', test: /[a-z]/.test(password) },
- ];
+ ]
- const allRequirementsMet = requirements.every(req => req.test);
+ const allRequirementsMet = requirements.every((req) => req.test)
useEffect(() => {
- onRequirementsMet(allRequirementsMet);
- }, [allRequirementsMet, onRequirementsMet]);
+ onRequirementsMet(allRequirementsMet)
+ }, [allRequirementsMet, onRequirementsMet])
return (
-
+
{requirements.map((req, index) => (
-
- {req.label}
+
+
+ {req.label}
))}
- );
-};
+ )
+}
PasswordRequirements.propTypes = {
- password: PropTypes.string.isRequired,
- onRequirementsMet: PropTypes.func.isRequired,
- };
+ password: PropTypes.string.isRequired,
+ onRequirementsMet: PropTypes.func.isRequired,
+}
-export default PasswordRequirements;
+export default PasswordRequirements
diff --git a/frontend/web/components/modals/CreateFlag.js b/frontend/web/components/modals/CreateFlag.js
index 0944af419e66..fad5f01ac568 100644
--- a/frontend/web/components/modals/CreateFlag.js
+++ b/frontend/web/components/modals/CreateFlag.js
@@ -45,7 +45,7 @@ import ExternalResourcesLinkTab from 'components/ExternalResourcesLinkTab'
import { saveFeatureWithValidation } from 'components/saveFeatureWithValidation'
import PlanBasedBanner from 'components/PlanBasedAccess'
import FeatureHistory from 'components/FeatureHistory'
-import WarningMessage from 'components/WarningMessage';
+import WarningMessage from 'components/WarningMessage'
const CreateFlag = class extends Component {
static displayName = 'CreateFlag'
@@ -400,17 +400,20 @@ const CreateFlag = class extends Component {
},
})
}
-parseError = (error)=>{
+ parseError = (error) => {
const { projectFlag } = this.props
- let featureError = error?.message || error?.name?.[0] || error
- let featureWarning = ''
- //Treat multivariate no changes as warnings
- if(featureError?.includes?.("no changes") && projectFlag?.multivariate_options?.length) {
- featureWarning = `Your feature contains no changes to its value, enabled state or environment weights. If you have adjusted any variation values this will have been saved for all environments.`
- featureError = ''
+ let featureError = error?.message || error?.name?.[0] || error
+ let featureWarning = ''
+ //Treat multivariate no changes as warnings
+ if (
+ featureError?.includes?.('no changes') &&
+ projectFlag?.multivariate_options?.length
+ ) {
+ featureWarning = `Your feature contains no changes to its value, enabled state or environment weights. If you have adjusted any variation values this will have been saved for all environments.`
+ featureError = ''
+ }
+ return { featureError, featureWarning }
}
- return {featureError, featureWarning}
-}
drawChart = (data) => {
return data?.length ? (
@@ -719,131 +722,134 @@ parseError = (error)=>{
)
const Value = (error, projectAdmin, createFeature, hideValue) => {
- const {featureError, featureWarning}= this.parseError(error)
+ const { featureError, featureWarning } = this.parseError(error)
return (
- <>
- {!!isEdit && (
-
- )}
- {!isEdit && (
-
- (this.input = e)}
- data-test='featureID'
- inputProps={{
- className: 'full-width',
- maxLength: FEATURE_ID_MAXLENGTH,
- name: 'featureID',
- readOnly: isEdit,
- }}
- value={name}
- onChange={(e) => {
- const newName = Utils.safeParseEventValue(e).replace(/ /g, '_')
- this.setState({
- name: caseSensitive ? newName.toLowerCase() : newName,
- })
- }}
- isValid={!!name && regexValid}
- type='text'
+ <>
+ {!!isEdit && (
+
+ )}
+ {!isEdit && (
+
+ (this.input = e)}
+ data-test='featureID'
+ inputProps={{
+ className: 'full-width',
+ maxLength: FEATURE_ID_MAXLENGTH,
+ name: 'featureID',
+ readOnly: isEdit,
+ }}
+ value={name}
+ onChange={(e) => {
+ const newName = Utils.safeParseEventValue(e).replace(
+ / /g,
+ '_',
+ )
+ this.setState({
+ name: caseSensitive ? newName.toLowerCase() : newName,
+ })
+ }}
+ isValid={!!name && regexValid}
+ type='text'
+ title={
+ <>
+
-
-
- {isEdit ? 'ID / Name' : 'ID / Name*'}
-
-
-
- }
- >
- The ID that will be used by SDKs to retrieve the feature
- value and enabled state. This cannot be edited once the
- feature has been created.
-
- {!!regex && !isEdit && (
-
- {' '}
-
- {' '}
- This must conform to the regular expression{' '}
- {regex}
-
-
- )}
- >
- }
- placeholder='E.g. header_size'
- />
-
- )}
-
-
- {identity && description && (
-
-
- this.setState({ description: Utils.safeParseEventValue(e) })
+
+
+ {isEdit ? 'ID / Name' : 'ID / Name*'}
+
+
+
}
- type='text'
- title={identity ? 'Description' : 'Description (optional)'}
- placeholder='No description'
- />
-
- )}
- {!hideValue && (
-
- {
- this.setState({ identityVariations, valueChanged: true })
- }}
- environmentFlag={this.props.environmentFlag}
- projectFlag={projectFlag}
- onValueChange={(e) => {
- const initial_value = Utils.getTypedValue(
- Utils.safeParseEventValue(e),
- )
- this.setState({ initial_value, valueChanged: true })
- }}
- onCheckedChange={(default_enabled) =>
- this.setState({ default_enabled })
- }
- />
-
- )}
- {!isEdit &&
- !identity &&
- Settings(projectAdmin, createFeature, featureContentType)}
- >
+ >
+ The ID that will be used by SDKs to retrieve the feature
+ value and enabled state. This cannot be edited once the
+ feature has been created.
+
+ {!!regex && !isEdit && (
+
+ {' '}
+
+ {' '}
+ This must conform to the regular expression{' '}
+ {regex}
+
+
+ )}
+ >
+ }
+ placeholder='E.g. header_size'
+ />
+
+ )}
+
+
+ {identity && description && (
+
+
+ this.setState({ description: Utils.safeParseEventValue(e) })
+ }
+ type='text'
+ title={identity ? 'Description' : 'Description (optional)'}
+ placeholder='No description'
+ />
+
+ )}
+ {!hideValue && (
+
+ {
+ this.setState({ identityVariations, valueChanged: true })
+ }}
+ environmentFlag={this.props.environmentFlag}
+ projectFlag={projectFlag}
+ onValueChange={(e) => {
+ const initial_value = Utils.getTypedValue(
+ Utils.safeParseEventValue(e),
+ )
+ this.setState({ initial_value, valueChanged: true })
+ }}
+ onCheckedChange={(default_enabled) =>
+ this.setState({ default_enabled })
+ }
+ />
+
+ )}
+ {!isEdit &&
+ !identity &&
+ Settings(projectAdmin, createFeature, featureContentType)}
+ >
)
}
return (
@@ -1036,9 +1042,7 @@ parseError = (error)=>{
project.total_features,
project.max_features_allowed,
)
- const {featureError, featureWarning}= this.parseError(error)
-
-
+ const { featureError, featureWarning } = this.parseError(error)
return (
{
return (
<>
-
- {this.props.isDisableAccountText && (
-
- )}
-
-
-
- Pay Yearly (Save 10%)
-
- {
- this.setState({ yearly: !this.state.yearly });
- }}
- />
-
- Pay Monthly
-
-
-
-
-
-
-
-
- Start-Up
-
-
- $
-
- {this.state.yearly ? '40' : '45'} /mo
-
-
- {!viewOnly ? (
- <>
-
- {plan.includes('startup') ? 'Purchased' : '14 Day Free Trial'}
-
-
- {plan.includes('startup') ? 'Purchased' : '14 Day Free Trial'}
-
- >
- ) : null}
-
-
-
-
- All from Free, plus
-
-