mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-05 17:53:12 +02:00
chore(AI): changeRequestApproverEmails flag cleanup (#10572)
This commit is contained in:
parent
9ef81be488
commit
547f7ac14e
@ -31,7 +31,6 @@ import { usePendingChangeRequests } from 'hooks/api/getters/usePendingChangeRequ
|
||||
import { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled';
|
||||
import { Dialogue } from 'component/common/Dialogue/Dialogue';
|
||||
import { changesCount } from '../changesCount.ts';
|
||||
import { ChangeRequestReviewers } from './ChangeRequestReviewers/ChangeRequestReviewers.tsx';
|
||||
import { ChangeRequestRejectDialogue } from './ChangeRequestRejectDialog/ChangeRequestRejectDialog.tsx';
|
||||
import { ApplyButton } from './ApplyButton/ApplyButton.tsx';
|
||||
import {
|
||||
@ -42,7 +41,6 @@ import { ScheduleChangeRequestDialog } from './ChangeRequestScheduledDialogs/Sch
|
||||
import type { PlausibleChangeRequestState } from '../changeRequest.types';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useActionableChangeRequests } from 'hooks/api/getters/useActionableChangeRequests/useActionableChangeRequests';
|
||||
import { useUiFlag } from 'hooks/useUiFlag.ts';
|
||||
import { ChangeRequestRequestedApprovers } from './ChangeRequestRequestedApprovers/ChangeRequestRequestedApprovers.tsx';
|
||||
|
||||
const breakpoint = 'md';
|
||||
@ -166,7 +164,6 @@ export const ChangeRequestOverview: FC = () => {
|
||||
useChangeRequestsEnabled(projectId);
|
||||
const [disabled, setDisabled] = useState(false);
|
||||
const navigate = useNavigate();
|
||||
const approversEnabled = useUiFlag('changeRequestApproverEmails');
|
||||
const theme = useTheme();
|
||||
|
||||
if (!changeRequest) {
|
||||
@ -353,19 +350,9 @@ export const ChangeRequestOverview: FC = () => {
|
||||
{...timelineProps}
|
||||
timestamps={changeRequest.stateTimestamps}
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={approversEnabled}
|
||||
show={
|
||||
<ChangeRequestRequestedApprovers
|
||||
changeRequest={changeRequest}
|
||||
/>
|
||||
}
|
||||
elseShow={
|
||||
<ChangeRequestReviewers
|
||||
changeRequest={changeRequest}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
</StyledAsideBox>
|
||||
<StyledDiv>
|
||||
<StyledPaper elevation={0}>
|
||||
@ -441,28 +428,6 @@ export const ChangeRequestOverview: FC = () => {
|
||||
}
|
||||
/>
|
||||
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
changeRequest.state === 'Approved' &&
|
||||
!approversEnabled
|
||||
}
|
||||
show={
|
||||
<ApplyButton
|
||||
onApply={onApplyChanges}
|
||||
disabled={
|
||||
!allowChangeRequestActions ||
|
||||
disabled
|
||||
}
|
||||
onSchedule={() =>
|
||||
setShowScheduleChangeDialog(
|
||||
true,
|
||||
)
|
||||
}
|
||||
>
|
||||
Apply or schedule changes
|
||||
</ApplyButton>
|
||||
}
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
changeRequest.state === 'Scheduled'
|
||||
@ -551,10 +516,7 @@ export const ChangeRequestOverview: FC = () => {
|
||||
</StyledInnerContainer>
|
||||
</StyledPaper>
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
changeRequest.state === 'Approved' &&
|
||||
approversEnabled
|
||||
}
|
||||
condition={changeRequest.state === 'Approved'}
|
||||
show={
|
||||
<StyledApplyPaper elevation={0}>
|
||||
<StyledApplyInnerContainer>
|
||||
|
@ -24,7 +24,6 @@ import Input from 'component/common/Input/Input';
|
||||
import { ChangeRequestTitle } from './ChangeRequestTitle.tsx';
|
||||
import { UpdateCount } from 'component/changeRequest/UpdateCount';
|
||||
import { useChangeRequestApi } from 'hooks/api/actions/useChangeRequestApi/useChangeRequestApi';
|
||||
import { useUiFlag } from 'hooks/useUiFlag';
|
||||
import { DraftChangeRequestActions } from '../DraftChangeRequestActions/DraftChangeRequestActions.tsx';
|
||||
import type { AvailableReviewerSchema } from 'hooks/api/getters/useAvailableChangeRequestReviewers/useAvailableChangeRequestReviewers.ts';
|
||||
|
||||
@ -78,7 +77,6 @@ export const EnvironmentChangeRequest: FC<{
|
||||
const [reviewers, setReviewers] = useState<AvailableReviewerSchema[]>([]);
|
||||
|
||||
const [disabled, setDisabled] = useState(false);
|
||||
const approversEnabled = useUiFlag('changeRequestApproverEmails');
|
||||
const sendToReview = async (project: string) => {
|
||||
setDisabled(true);
|
||||
try {
|
||||
@ -166,9 +164,6 @@ export const EnvironmentChangeRequest: FC<{
|
||||
<Box sx={{ display: 'flex', mt: 3 }}>
|
||||
<ConditionallyRender
|
||||
condition={environmentChangeRequest?.state === 'Draft'}
|
||||
show={
|
||||
<ConditionallyRender
|
||||
condition={approversEnabled}
|
||||
show={
|
||||
<DraftChangeRequestActions
|
||||
environmentChangeRequest={
|
||||
@ -183,35 +178,6 @@ export const EnvironmentChangeRequest: FC<{
|
||||
setDisabled={setDisabled}
|
||||
/>
|
||||
}
|
||||
elseShow={
|
||||
<>
|
||||
<SubmitChangeRequestButton
|
||||
onClick={() =>
|
||||
onReview(sendToReview)
|
||||
}
|
||||
count={changesCount(
|
||||
environmentChangeRequest,
|
||||
)}
|
||||
disabled={disabled}
|
||||
/>
|
||||
|
||||
<Button
|
||||
sx={{ ml: 2 }}
|
||||
variant='outlined'
|
||||
disabled={disabled}
|
||||
onClick={() => {
|
||||
setDisabled(true);
|
||||
onDiscard(
|
||||
environmentChangeRequest.id,
|
||||
);
|
||||
}}
|
||||
>
|
||||
Discard changes
|
||||
</Button>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={
|
||||
|
@ -86,7 +86,6 @@ export type UiFlags = {
|
||||
edgeObservability?: boolean;
|
||||
customMetrics?: boolean;
|
||||
impactMetrics?: boolean;
|
||||
changeRequestApproverEmails?: boolean;
|
||||
reportUnknownFlags?: boolean;
|
||||
lifecycleGraphs?: boolean;
|
||||
addConfiguration?: boolean;
|
||||
|
@ -55,7 +55,6 @@ export type IFlagKey =
|
||||
| 'reportUnknownFlags'
|
||||
| 'customMetrics'
|
||||
| 'impactMetrics'
|
||||
| 'changeRequestApproverEmails'
|
||||
| 'lifecycleGraphs'
|
||||
| 'addConfiguration'
|
||||
| 'etagByEnv'
|
||||
@ -251,10 +250,6 @@ const flags: IFlags = {
|
||||
process.env.UNLEASH_EXPERIMENTAL_REPORT_UNKNOWN_FLAGS,
|
||||
false,
|
||||
),
|
||||
changeRequestApproverEmails: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_CHANGE_REQUEST_APPROVER_EMAILS,
|
||||
false,
|
||||
),
|
||||
impactMetrics: parseEnvVarBoolean(
|
||||
process.env.UNLEASH_EXPERIMENTAL_IMPACT_METRICS,
|
||||
false,
|
||||
|
Loading…
Reference in New Issue
Block a user