mirror of
https://github.com/Unleash/unleash.git
synced 2025-06-04 01:18:20 +02:00
chore: Change request flags removed (#4601)
This commit is contained in:
parent
ad9d9d9745
commit
5ae86ef196
@ -18,8 +18,6 @@ import { APPROVE_CHANGE_REQUEST } from 'component/providers/AccessProvider/permi
|
|||||||
import PermissionButton from 'component/common/PermissionButton/PermissionButton';
|
import PermissionButton from 'component/common/PermissionButton/PermissionButton';
|
||||||
import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser';
|
import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser';
|
||||||
import AccessContext from 'contexts/AccessContext';
|
import AccessContext from 'contexts/AccessContext';
|
||||||
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
|
|
||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
|
||||||
import CheckBox from '@mui/icons-material/Check';
|
import CheckBox from '@mui/icons-material/Check';
|
||||||
import Clear from '@mui/icons-material/Clear';
|
import Clear from '@mui/icons-material/Clear';
|
||||||
|
|
||||||
@ -28,7 +26,6 @@ export const ReviewButton: FC<{
|
|||||||
onReject: () => void;
|
onReject: () => void;
|
||||||
onApprove: () => void;
|
onApprove: () => void;
|
||||||
}> = ({ disabled, onReject, onApprove, children }) => {
|
}> = ({ disabled, onReject, onApprove, children }) => {
|
||||||
const { uiConfig } = useUiConfig();
|
|
||||||
const { isAdmin } = useContext(AccessContext);
|
const { isAdmin } = useContext(AccessContext);
|
||||||
const projectId = useRequiredPathParam('projectId');
|
const projectId = useRequiredPathParam('projectId');
|
||||||
const id = useRequiredPathParam('id');
|
const id = useRequiredPathParam('id');
|
||||||
@ -111,11 +108,6 @@ export const ReviewButton: FC<{
|
|||||||
Approve changes
|
Approve changes
|
||||||
</ListItemText>
|
</ListItemText>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<ConditionallyRender
|
|
||||||
condition={Boolean(
|
|
||||||
uiConfig?.flags?.changeRequestReject
|
|
||||||
)}
|
|
||||||
show={
|
|
||||||
<MenuItem onClick={onReject}>
|
<MenuItem onClick={onReject}>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<Clear fontSize="small" />
|
<Clear fontSize="small" />
|
||||||
@ -124,8 +116,6 @@ export const ReviewButton: FC<{
|
|||||||
Reject changes
|
Reject changes
|
||||||
</ListItemText>
|
</ListItemText>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
}
|
|
||||||
/>
|
|
||||||
</MenuList>
|
</MenuList>
|
||||||
</ClickAwayListener>
|
</ClickAwayListener>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
@ -76,8 +76,6 @@ export const EditSegment = ({ modal }: IEditSegmentProps) => {
|
|||||||
const highestPermissionChangeRequestEnv =
|
const highestPermissionChangeRequestEnv =
|
||||||
useHighestPermissionChangeRequestEnvironment(segment?.project);
|
useHighestPermissionChangeRequestEnvironment(segment?.project);
|
||||||
const changeRequestEnv = highestPermissionChangeRequestEnv();
|
const changeRequestEnv = highestPermissionChangeRequestEnv();
|
||||||
const activateSegmentChangeRequests =
|
|
||||||
uiConfig?.flags?.segmentChangeRequests && changeRequestEnv;
|
|
||||||
const { addChange } = useChangeRequestApi();
|
const { addChange } = useChangeRequestApi();
|
||||||
|
|
||||||
const handleSubmit = async (e: React.FormEvent) => {
|
const handleSubmit = async (e: React.FormEvent) => {
|
||||||
@ -85,7 +83,7 @@ export const EditSegment = ({ modal }: IEditSegmentProps) => {
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
clearErrors();
|
clearErrors();
|
||||||
try {
|
try {
|
||||||
if (activateSegmentChangeRequests) {
|
if (changeRequestEnv) {
|
||||||
await addChange(segment.project || '', changeRequestEnv, {
|
await addChange(segment.project || '', changeRequestEnv, {
|
||||||
action: 'updateSegment',
|
action: 'updateSegment',
|
||||||
feature: null,
|
feature: null,
|
||||||
@ -102,9 +100,7 @@ export const EditSegment = ({ modal }: IEditSegmentProps) => {
|
|||||||
}
|
}
|
||||||
setToastData({
|
setToastData({
|
||||||
title: `Segment ${
|
title: `Segment ${
|
||||||
activateSegmentChangeRequests
|
changeRequestEnv ? 'change added to draft' : 'updated'
|
||||||
? 'change added to draft'
|
|
||||||
: 'updated'
|
|
||||||
}`,
|
}`,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
});
|
});
|
||||||
@ -143,7 +139,7 @@ export const EditSegment = ({ modal }: IEditSegmentProps) => {
|
|||||||
disabled={!hasValidConstraints || overSegmentValuesLimit}
|
disabled={!hasValidConstraints || overSegmentValuesLimit}
|
||||||
data-testid={SEGMENT_SAVE_BTN_ID}
|
data-testid={SEGMENT_SAVE_BTN_ID}
|
||||||
>
|
>
|
||||||
{activateSegmentChangeRequests ? 'Add to draft' : 'Save'}
|
{changeRequestEnv ? 'Add to draft' : 'Save'}
|
||||||
</UpdateButton>
|
</UpdateButton>
|
||||||
</SegmentForm>
|
</SegmentForm>
|
||||||
</FormTemplate>
|
</FormTemplate>
|
||||||
|
@ -52,8 +52,6 @@ export interface IFlags {
|
|||||||
advancedPlayground?: boolean;
|
advancedPlayground?: boolean;
|
||||||
customRootRolesKillSwitch?: boolean;
|
customRootRolesKillSwitch?: boolean;
|
||||||
strategyVariant?: boolean;
|
strategyVariant?: boolean;
|
||||||
segmentChangeRequests?: boolean;
|
|
||||||
changeRequestReject?: boolean;
|
|
||||||
lastSeenByEnvironment?: boolean;
|
lastSeenByEnvironment?: boolean;
|
||||||
newApplicationList?: boolean;
|
newApplicationList?: boolean;
|
||||||
integrationsRework?: boolean;
|
integrationsRework?: boolean;
|
||||||
|
@ -70,7 +70,6 @@ exports[`should create default config 1`] = `
|
|||||||
"flags": {
|
"flags": {
|
||||||
"anonymiseEventLog": false,
|
"anonymiseEventLog": false,
|
||||||
"caseInsensitiveInOperators": false,
|
"caseInsensitiveInOperators": false,
|
||||||
"changeRequestReject": false,
|
|
||||||
"customRootRolesKillSwitch": false,
|
"customRootRolesKillSwitch": false,
|
||||||
"demo": false,
|
"demo": false,
|
||||||
"disableBulkToggle": false,
|
"disableBulkToggle": false,
|
||||||
@ -97,7 +96,6 @@ exports[`should create default config 1`] = `
|
|||||||
"personalAccessTokensKillSwitch": false,
|
"personalAccessTokensKillSwitch": false,
|
||||||
"proPlanAutoCharge": false,
|
"proPlanAutoCharge": false,
|
||||||
"responseTimeWithAppNameKillSwitch": false,
|
"responseTimeWithAppNameKillSwitch": false,
|
||||||
"segmentChangeRequests": false,
|
|
||||||
"slackAppAddon": false,
|
"slackAppAddon": false,
|
||||||
"strategyVariant": false,
|
"strategyVariant": false,
|
||||||
"strictSchemaValidation": false,
|
"strictSchemaValidation": false,
|
||||||
@ -107,7 +105,6 @@ exports[`should create default config 1`] = `
|
|||||||
"experiments": {
|
"experiments": {
|
||||||
"anonymiseEventLog": false,
|
"anonymiseEventLog": false,
|
||||||
"caseInsensitiveInOperators": false,
|
"caseInsensitiveInOperators": false,
|
||||||
"changeRequestReject": false,
|
|
||||||
"customRootRolesKillSwitch": false,
|
"customRootRolesKillSwitch": false,
|
||||||
"demo": false,
|
"demo": false,
|
||||||
"disableBulkToggle": false,
|
"disableBulkToggle": false,
|
||||||
@ -134,7 +131,6 @@ exports[`should create default config 1`] = `
|
|||||||
"personalAccessTokensKillSwitch": false,
|
"personalAccessTokensKillSwitch": false,
|
||||||
"proPlanAutoCharge": false,
|
"proPlanAutoCharge": false,
|
||||||
"responseTimeWithAppNameKillSwitch": false,
|
"responseTimeWithAppNameKillSwitch": false,
|
||||||
"segmentChangeRequests": false,
|
|
||||||
"slackAppAddon": false,
|
"slackAppAddon": false,
|
||||||
"strategyVariant": false,
|
"strategyVariant": false,
|
||||||
"strictSchemaValidation": false,
|
"strictSchemaValidation": false,
|
||||||
|
@ -104,10 +104,8 @@ export class SegmentService implements ISegmentService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async update(id: number, data: unknown, user: User): Promise<void> {
|
async update(id: number, data: unknown, user: User): Promise<void> {
|
||||||
if (this.flagResolver.isEnabled('segmentChangeRequests')) {
|
|
||||||
const input = await segmentSchema.validateAsync(data);
|
const input = await segmentSchema.validateAsync(data);
|
||||||
await this.stopWhenChangeRequestsEnabled(input.project, user);
|
await this.stopWhenChangeRequestsEnabled(input.project, user);
|
||||||
}
|
|
||||||
return this.unprotectedUpdate(id, data, user);
|
return this.unprotectedUpdate(id, data, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,9 +136,7 @@ export class SegmentService implements ISegmentService {
|
|||||||
|
|
||||||
async delete(id: number, user: User): Promise<void> {
|
async delete(id: number, user: User): Promise<void> {
|
||||||
const segment = await this.segmentStore.get(id);
|
const segment = await this.segmentStore.get(id);
|
||||||
if (this.flagResolver.isEnabled('segmentChangeRequests')) {
|
|
||||||
await this.stopWhenChangeRequestsEnabled(segment.project, user);
|
await this.stopWhenChangeRequestsEnabled(segment.project, user);
|
||||||
}
|
|
||||||
await this.segmentStore.delete(id);
|
await this.segmentStore.delete(id);
|
||||||
await this.eventStore.store({
|
await this.eventStore.store({
|
||||||
type: SEGMENT_DELETED,
|
type: SEGMENT_DELETED,
|
||||||
|
@ -24,8 +24,6 @@ export type IFlagKey =
|
|||||||
| 'slackAppAddon'
|
| 'slackAppAddon'
|
||||||
| 'filterInvalidClientMetrics'
|
| 'filterInvalidClientMetrics'
|
||||||
| 'lastSeenByEnvironment'
|
| 'lastSeenByEnvironment'
|
||||||
| 'segmentChangeRequests'
|
|
||||||
| 'changeRequestReject'
|
|
||||||
| 'customRootRolesKillSwitch'
|
| 'customRootRolesKillSwitch'
|
||||||
| 'newApplicationList'
|
| 'newApplicationList'
|
||||||
| 'integrationsRework'
|
| 'integrationsRework'
|
||||||
@ -115,14 +113,6 @@ const flags: IFlags = {
|
|||||||
process.env.LAST_SEEN_BY_ENVIRONMENT,
|
process.env.LAST_SEEN_BY_ENVIRONMENT,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
segmentChangeRequests: parseEnvVarBoolean(
|
|
||||||
process.env.UNLEASH_EXPERIMENTAL_SEGMENT_CHANGE_REQUESTS,
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
changeRequestReject: parseEnvVarBoolean(
|
|
||||||
process.env.UNLEASH_EXPERIMENTAL_CHANGE_REQUEST_REJECT,
|
|
||||||
false,
|
|
||||||
),
|
|
||||||
customRootRolesKillSwitch: parseEnvVarBoolean(
|
customRootRolesKillSwitch: parseEnvVarBoolean(
|
||||||
process.env.UNLEASH_EXPERIMENTAL_CUSTOM_ROOT_ROLES_KILL_SWITCH,
|
process.env.UNLEASH_EXPERIMENTAL_CUSTOM_ROOT_ROLES_KILL_SWITCH,
|
||||||
false,
|
false,
|
||||||
|
@ -40,7 +40,6 @@ process.nextTick(async () => {
|
|||||||
strategyVariant: true,
|
strategyVariant: true,
|
||||||
slackAppAddon: true,
|
slackAppAddon: true,
|
||||||
lastSeenByEnvironment: true,
|
lastSeenByEnvironment: true,
|
||||||
segmentChangeRequests: true,
|
|
||||||
newApplicationList: true,
|
newApplicationList: true,
|
||||||
doraMetrics: true,
|
doraMetrics: true,
|
||||||
instanceHealthDashboard: true,
|
instanceHealthDashboard: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user