1
0
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:
unleash-bot[bot] 2025-09-02 08:51:00 +02:00 committed by GitHub
parent 9ef81be488
commit 547f7ac14e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 91 deletions

View File

@ -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,18 +350,8 @@ export const ChangeRequestOverview: FC = () => {
{...timelineProps}
timestamps={changeRequest.stateTimestamps}
/>
<ConditionallyRender
condition={approversEnabled}
show={
<ChangeRequestRequestedApprovers
changeRequest={changeRequest}
/>
}
elseShow={
<ChangeRequestReviewers
changeRequest={changeRequest}
/>
}
<ChangeRequestRequestedApprovers
changeRequest={changeRequest}
/>
</StyledAsideBox>
<StyledDiv>
@ -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>

View File

@ -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 {
@ -167,49 +165,17 @@ export const EnvironmentChangeRequest: FC<{
<ConditionallyRender
condition={environmentChangeRequest?.state === 'Draft'}
show={
<ConditionallyRender
condition={approversEnabled}
show={
<DraftChangeRequestActions
environmentChangeRequest={
environmentChangeRequest
}
reviewers={reviewers}
setReviewers={setReviewers}
onReview={onReview}
onDiscard={onDiscard}
sendToReview={sendToReview}
disabled={disabled}
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>
</>
<DraftChangeRequestActions
environmentChangeRequest={
environmentChangeRequest
}
reviewers={reviewers}
setReviewers={setReviewers}
onReview={onReview}
onDiscard={onDiscard}
sendToReview={sendToReview}
disabled={disabled}
setDisabled={setDisabled}
/>
}
/>

View File

@ -86,7 +86,6 @@ export type UiFlags = {
edgeObservability?: boolean;
customMetrics?: boolean;
impactMetrics?: boolean;
changeRequestApproverEmails?: boolean;
reportUnknownFlags?: boolean;
lifecycleGraphs?: boolean;
addConfiguration?: boolean;

View File

@ -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,