mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-10 17:53:36 +02:00
Remove caseInsensitiveInOperators flag (#9670)
The flag has never made it out of dev, and has not been turned on consistently since 2023. There was a project for it, but we have since abandoned it.
This commit is contained in:
parent
6e947a8ba6
commit
f6e786a6c0
@ -9,7 +9,6 @@ import {
|
|||||||
DATE_AFTER,
|
DATE_AFTER,
|
||||||
IN,
|
IN,
|
||||||
stringOperators,
|
stringOperators,
|
||||||
inOperators,
|
|
||||||
} from 'constants/operators';
|
} from 'constants/operators';
|
||||||
import { resolveText } from './helpers';
|
import { resolveText } from './helpers';
|
||||||
import { oneOf } from 'utils/oneOf';
|
import { oneOf } from 'utils/oneOf';
|
||||||
@ -25,7 +24,6 @@ import { InvertedOperatorButton } from '../StyledToggleButton/InvertedOperatorBu
|
|||||||
import { CaseSensitiveButton } from '../StyledToggleButton/CaseSensitiveButton/CaseSensitiveButton';
|
import { CaseSensitiveButton } from '../StyledToggleButton/CaseSensitiveButton/CaseSensitiveButton';
|
||||||
import { ConstraintAccordionHeaderActions } from '../../ConstraintAccordionHeaderActions/ConstraintAccordionHeaderActions';
|
import { ConstraintAccordionHeaderActions } from '../../ConstraintAccordionHeaderActions/ConstraintAccordionHeaderActions';
|
||||||
import { styled } from '@mui/material';
|
import { styled } from '@mui/material';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
|
||||||
|
|
||||||
interface IConstraintAccordionViewHeader {
|
interface IConstraintAccordionViewHeader {
|
||||||
localConstraint: IConstraint;
|
localConstraint: IConstraint;
|
||||||
@ -103,13 +101,8 @@ export const ConstraintAccordionEditHeader = ({
|
|||||||
const { contextName, operator } = localConstraint;
|
const { contextName, operator } = localConstraint;
|
||||||
const [showCaseSensitiveButton, setShowCaseSensitiveButton] =
|
const [showCaseSensitiveButton, setShowCaseSensitiveButton] =
|
||||||
useState(false);
|
useState(false);
|
||||||
const { uiConfig } = useUiConfig();
|
|
||||||
|
|
||||||
const caseInsensitiveInOperators = Boolean(
|
/* We need a special case to handle the currentTime context field. Since
|
||||||
uiConfig.flags.caseInsensitiveInOperators,
|
|
||||||
);
|
|
||||||
|
|
||||||
/* We need a special case to handle the currenTime context field. Since
|
|
||||||
this field will be the only one to allow DATE_BEFORE and DATE_AFTER operators
|
this field will be the only one to allow DATE_BEFORE and DATE_AFTER operators
|
||||||
this will check if the context field is the current time context field AND check
|
this will check if the context field is the current time context field AND check
|
||||||
if it is not already using one of the date operators (to not overwrite if there is existing
|
if it is not already using one of the date operators (to not overwrite if there is existing
|
||||||
@ -131,21 +124,12 @@ export const ConstraintAccordionEditHeader = ({
|
|||||||
setOperator(IN);
|
setOperator(IN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (oneOf(stringOperators, operator)) {
|
||||||
oneOf(stringOperators, operator) ||
|
|
||||||
(oneOf(inOperators, operator) && caseInsensitiveInOperators)
|
|
||||||
) {
|
|
||||||
setShowCaseSensitiveButton(true);
|
setShowCaseSensitiveButton(true);
|
||||||
} else {
|
} else {
|
||||||
setShowCaseSensitiveButton(false);
|
setShowCaseSensitiveButton(false);
|
||||||
}
|
}
|
||||||
}, [
|
}, [contextName, setOperator, operator, setLocalConstraint]);
|
||||||
contextName,
|
|
||||||
setOperator,
|
|
||||||
operator,
|
|
||||||
setLocalConstraint,
|
|
||||||
caseInsensitiveInOperators,
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (!context) {
|
if (!context) {
|
||||||
return null;
|
return null;
|
||||||
@ -156,10 +140,7 @@ export const ConstraintAccordionEditHeader = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onOperatorChange = (operator: Operator) => {
|
const onOperatorChange = (operator: Operator) => {
|
||||||
if (
|
if (oneOf(stringOperators, operator)) {
|
||||||
oneOf(stringOperators, operator) ||
|
|
||||||
(oneOf(inOperators, operator) && caseInsensitiveInOperators)
|
|
||||||
) {
|
|
||||||
setShowCaseSensitiveButton(true);
|
setShowCaseSensitiveButton(true);
|
||||||
} else {
|
} else {
|
||||||
setShowCaseSensitiveButton(false);
|
setShowCaseSensitiveButton(false);
|
||||||
|
@ -9,7 +9,6 @@ import {
|
|||||||
DATE_AFTER,
|
DATE_AFTER,
|
||||||
IN,
|
IN,
|
||||||
stringOperators,
|
stringOperators,
|
||||||
inOperators,
|
|
||||||
} from 'constants/operators';
|
} from 'constants/operators';
|
||||||
import { resolveText } from './helpers';
|
import { resolveText } from './helpers';
|
||||||
import { oneOf } from 'utils/oneOf';
|
import { oneOf } from 'utils/oneOf';
|
||||||
@ -25,7 +24,6 @@ import { InvertedOperatorButton } from '../StyledToggleButton/InvertedOperatorBu
|
|||||||
import { CaseSensitiveButton } from '../StyledToggleButton/CaseSensitiveButton/CaseSensitiveButton';
|
import { CaseSensitiveButton } from '../StyledToggleButton/CaseSensitiveButton/CaseSensitiveButton';
|
||||||
import { ConstraintAccordionHeaderActions } from '../../ConstraintAccordionHeaderActions/ConstraintAccordionHeaderActions';
|
import { ConstraintAccordionHeaderActions } from '../../ConstraintAccordionHeaderActions/ConstraintAccordionHeaderActions';
|
||||||
import { styled } from '@mui/material';
|
import { styled } from '@mui/material';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
|
||||||
|
|
||||||
interface IConstraintAccordionViewHeader {
|
interface IConstraintAccordionViewHeader {
|
||||||
localConstraint: IConstraint;
|
localConstraint: IConstraint;
|
||||||
@ -107,13 +105,8 @@ export const ConstraintAccordionEditHeader = ({
|
|||||||
const { contextName, operator } = localConstraint;
|
const { contextName, operator } = localConstraint;
|
||||||
const [showCaseSensitiveButton, setShowCaseSensitiveButton] =
|
const [showCaseSensitiveButton, setShowCaseSensitiveButton] =
|
||||||
useState(false);
|
useState(false);
|
||||||
const { uiConfig } = useUiConfig();
|
|
||||||
|
|
||||||
const caseInsensitiveInOperators = Boolean(
|
/* We need a special case to handle the currentTime context field. Since
|
||||||
uiConfig.flags.caseInsensitiveInOperators,
|
|
||||||
);
|
|
||||||
|
|
||||||
/* We need a special case to handle the currenTime context field. Since
|
|
||||||
this field will be the only one to allow DATE_BEFORE and DATE_AFTER operators
|
this field will be the only one to allow DATE_BEFORE and DATE_AFTER operators
|
||||||
this will check if the context field is the current time context field AND check
|
this will check if the context field is the current time context field AND check
|
||||||
if it is not already using one of the date operators (to not overwrite if there is existing
|
if it is not already using one of the date operators (to not overwrite if there is existing
|
||||||
@ -135,21 +128,12 @@ export const ConstraintAccordionEditHeader = ({
|
|||||||
setOperator(IN);
|
setOperator(IN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (oneOf(stringOperators, operator)) {
|
||||||
oneOf(stringOperators, operator) ||
|
|
||||||
(oneOf(inOperators, operator) && caseInsensitiveInOperators)
|
|
||||||
) {
|
|
||||||
setShowCaseSensitiveButton(true);
|
setShowCaseSensitiveButton(true);
|
||||||
} else {
|
} else {
|
||||||
setShowCaseSensitiveButton(false);
|
setShowCaseSensitiveButton(false);
|
||||||
}
|
}
|
||||||
}, [
|
}, [contextName, setOperator, operator, setLocalConstraint]);
|
||||||
contextName,
|
|
||||||
setOperator,
|
|
||||||
operator,
|
|
||||||
setLocalConstraint,
|
|
||||||
caseInsensitiveInOperators,
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (!context) {
|
if (!context) {
|
||||||
return null;
|
return null;
|
||||||
@ -160,10 +144,7 @@ export const ConstraintAccordionEditHeader = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const onOperatorChange = (operator: Operator) => {
|
const onOperatorChange = (operator: Operator) => {
|
||||||
if (
|
if (oneOf(stringOperators, operator)) {
|
||||||
oneOf(stringOperators, operator) ||
|
|
||||||
(oneOf(inOperators, operator) && caseInsensitiveInOperators)
|
|
||||||
) {
|
|
||||||
setShowCaseSensitiveButton(true);
|
setShowCaseSensitiveButton(true);
|
||||||
} else {
|
} else {
|
||||||
setShowCaseSensitiveButton(false);
|
setShowCaseSensitiveButton(false);
|
||||||
|
@ -14,7 +14,6 @@ import {
|
|||||||
type Operator,
|
type Operator,
|
||||||
allOperators,
|
allOperators,
|
||||||
dateOperators,
|
dateOperators,
|
||||||
inOperators,
|
|
||||||
stringOperators,
|
stringOperators,
|
||||||
} from 'constants/operators';
|
} from 'constants/operators';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
@ -24,7 +23,6 @@ import { CaseSensitiveButton } from 'component/common/NewConstraintAccordion/Con
|
|||||||
import { InvertedOperatorButton } from 'component/common/NewConstraintAccordion/ConstraintAccordionEdit/StyledToggleButton/InvertedOperatorButton/InvertedOperatorButton';
|
import { InvertedOperatorButton } from 'component/common/NewConstraintAccordion/ConstraintAccordionEdit/StyledToggleButton/InvertedOperatorButton/InvertedOperatorButton';
|
||||||
import { ResolveInput } from 'component/common/NewConstraintAccordion/ConstraintAccordionEdit/ConstraintAccordionEditBody/ResolveInput/ResolveInput';
|
import { ResolveInput } from 'component/common/NewConstraintAccordion/ConstraintAccordionEdit/ConstraintAccordionEditBody/ResolveInput/ResolveInput';
|
||||||
import { useConstraintInput } from 'component/common/NewConstraintAccordion/ConstraintAccordionEdit/ConstraintAccordionEditBody/useConstraintInput/useConstraintInput';
|
import { useConstraintInput } from 'component/common/NewConstraintAccordion/ConstraintAccordionEdit/ConstraintAccordionEditBody/useConstraintInput/useConstraintInput';
|
||||||
import { useUiFlag } from 'hooks/useUiFlag';
|
|
||||||
|
|
||||||
const StyledDeleteButton = styled(IconButton)({
|
const StyledDeleteButton = styled(IconButton)({
|
||||||
marginRight: '-6px',
|
marginRight: '-6px',
|
||||||
@ -136,8 +134,6 @@ export const ProjectActionsFilterItem = ({
|
|||||||
const [showCaseSensitiveButton, setShowCaseSensitiveButton] =
|
const [showCaseSensitiveButton, setShowCaseSensitiveButton] =
|
||||||
useState(false);
|
useState(false);
|
||||||
|
|
||||||
const caseInsensitiveInOperators = useUiFlag('caseInsensitiveInOperators');
|
|
||||||
|
|
||||||
const validOperators = allOperators.filter(
|
const validOperators = allOperators.filter(
|
||||||
(operator) => !oneOf(dateOperators, operator),
|
(operator) => !oneOf(dateOperators, operator),
|
||||||
);
|
);
|
||||||
@ -167,21 +163,15 @@ export const ProjectActionsFilterItem = ({
|
|||||||
}, [value, error]);
|
}, [value, error]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (oneOf(stringOperators, operator)) {
|
||||||
oneOf(stringOperators, operator) ||
|
|
||||||
(oneOf(inOperators, operator) && caseInsensitiveInOperators)
|
|
||||||
) {
|
|
||||||
setShowCaseSensitiveButton(true);
|
setShowCaseSensitiveButton(true);
|
||||||
} else {
|
} else {
|
||||||
setShowCaseSensitiveButton(false);
|
setShowCaseSensitiveButton(false);
|
||||||
}
|
}
|
||||||
}, [operator, caseInsensitiveInOperators]);
|
}, [operator]);
|
||||||
|
|
||||||
const onOperatorChange = (operator: Operator) => {
|
const onOperatorChange = (operator: Operator) => {
|
||||||
if (
|
if (oneOf(stringOperators, operator)) {
|
||||||
oneOf(stringOperators, operator) ||
|
|
||||||
(oneOf(inOperators, operator) && caseInsensitiveInOperators)
|
|
||||||
) {
|
|
||||||
setShowCaseSensitiveButton(true);
|
setShowCaseSensitiveButton(true);
|
||||||
} else {
|
} else {
|
||||||
setShowCaseSensitiveButton(false);
|
setShowCaseSensitiveButton(false);
|
||||||
|
@ -55,7 +55,6 @@ export type UiFlags = {
|
|||||||
maintenanceMode?: boolean;
|
maintenanceMode?: boolean;
|
||||||
messageBanner?: Variant;
|
messageBanner?: Variant;
|
||||||
banner?: Variant;
|
banner?: Variant;
|
||||||
caseInsensitiveInOperators?: boolean;
|
|
||||||
notifications?: boolean;
|
notifications?: boolean;
|
||||||
personalAccessTokensKillSwitch?: boolean;
|
personalAccessTokensKillSwitch?: boolean;
|
||||||
demo?: boolean;
|
demo?: boolean;
|
||||||
|
@ -13,7 +13,6 @@ export type IFlagKey =
|
|||||||
| 'responseTimeWithAppNameKillSwitch'
|
| 'responseTimeWithAppNameKillSwitch'
|
||||||
| 'maintenanceMode'
|
| 'maintenanceMode'
|
||||||
| 'messageBanner'
|
| 'messageBanner'
|
||||||
| 'caseInsensitiveInOperators'
|
|
||||||
| 'strictSchemaValidation'
|
| 'strictSchemaValidation'
|
||||||
| 'personalAccessTokensKillSwitch'
|
| 'personalAccessTokensKillSwitch'
|
||||||
| 'migrationLock'
|
| 'migrationLock'
|
||||||
@ -101,10 +100,6 @@ const flags: IFlags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_MESSAGE_BANNER_PAYLOAD ?? '',
|
process.env.UNLEASH_EXPERIMENTAL_MESSAGE_BANNER_PAYLOAD ?? '',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
caseInsensitiveInOperators: parseEnvVarBoolean(
|
|
||||||
process.env.UNLEASH_EXPERIMENTAL_CASE_INSENSITIVE_IN_OPERATORS,
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
strictSchemaValidation: parseEnvVarBoolean(
|
strictSchemaValidation: parseEnvVarBoolean(
|
||||||
process.env.UNLEASH_STRICT_SCHEMA_VALIDTION,
|
process.env.UNLEASH_STRICT_SCHEMA_VALIDTION,
|
||||||
false,
|
false,
|
||||||
|
Loading…
Reference in New Issue
Block a user