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 { useChangeRequestsEnabled } from 'hooks/useChangeRequestsEnabled';
import { Dialogue } from 'component/common/Dialogue/Dialogue'; import { Dialogue } from 'component/common/Dialogue/Dialogue';
import { changesCount } from '../changesCount.ts'; import { changesCount } from '../changesCount.ts';
import { ChangeRequestReviewers } from './ChangeRequestReviewers/ChangeRequestReviewers.tsx';
import { ChangeRequestRejectDialogue } from './ChangeRequestRejectDialog/ChangeRequestRejectDialog.tsx'; import { ChangeRequestRejectDialogue } from './ChangeRequestRejectDialog/ChangeRequestRejectDialog.tsx';
import { ApplyButton } from './ApplyButton/ApplyButton.tsx'; import { ApplyButton } from './ApplyButton/ApplyButton.tsx';
import { import {
@ -42,7 +41,6 @@ import { ScheduleChangeRequestDialog } from './ChangeRequestScheduledDialogs/Sch
import type { PlausibleChangeRequestState } from '../changeRequest.types'; import type { PlausibleChangeRequestState } from '../changeRequest.types';
import { useNavigate } from 'react-router-dom'; import { useNavigate } from 'react-router-dom';
import { useActionableChangeRequests } from 'hooks/api/getters/useActionableChangeRequests/useActionableChangeRequests'; import { useActionableChangeRequests } from 'hooks/api/getters/useActionableChangeRequests/useActionableChangeRequests';
import { useUiFlag } from 'hooks/useUiFlag.ts';
import { ChangeRequestRequestedApprovers } from './ChangeRequestRequestedApprovers/ChangeRequestRequestedApprovers.tsx'; import { ChangeRequestRequestedApprovers } from './ChangeRequestRequestedApprovers/ChangeRequestRequestedApprovers.tsx';
const breakpoint = 'md'; const breakpoint = 'md';
@ -166,7 +164,6 @@ export const ChangeRequestOverview: FC = () => {
useChangeRequestsEnabled(projectId); useChangeRequestsEnabled(projectId);
const [disabled, setDisabled] = useState(false); const [disabled, setDisabled] = useState(false);
const navigate = useNavigate(); const navigate = useNavigate();
const approversEnabled = useUiFlag('changeRequestApproverEmails');
const theme = useTheme(); const theme = useTheme();
if (!changeRequest) { if (!changeRequest) {
@ -353,18 +350,8 @@ export const ChangeRequestOverview: FC = () => {
{...timelineProps} {...timelineProps}
timestamps={changeRequest.stateTimestamps} timestamps={changeRequest.stateTimestamps}
/> />
<ConditionallyRender <ChangeRequestRequestedApprovers
condition={approversEnabled} changeRequest={changeRequest}
show={
<ChangeRequestRequestedApprovers
changeRequest={changeRequest}
/>
}
elseShow={
<ChangeRequestReviewers
changeRequest={changeRequest}
/>
}
/> />
</StyledAsideBox> </StyledAsideBox>
<StyledDiv> <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 <ConditionallyRender
condition={ condition={
changeRequest.state === 'Scheduled' changeRequest.state === 'Scheduled'
@ -551,10 +516,7 @@ export const ChangeRequestOverview: FC = () => {
</StyledInnerContainer> </StyledInnerContainer>
</StyledPaper> </StyledPaper>
<ConditionallyRender <ConditionallyRender
condition={ condition={changeRequest.state === 'Approved'}
changeRequest.state === 'Approved' &&
approversEnabled
}
show={ show={
<StyledApplyPaper elevation={0}> <StyledApplyPaper elevation={0}>
<StyledApplyInnerContainer> <StyledApplyInnerContainer>

View File

@ -24,7 +24,6 @@ import Input from 'component/common/Input/Input';
import { ChangeRequestTitle } from './ChangeRequestTitle.tsx'; import { ChangeRequestTitle } from './ChangeRequestTitle.tsx';
import { UpdateCount } from 'component/changeRequest/UpdateCount'; import { UpdateCount } from 'component/changeRequest/UpdateCount';
import { useChangeRequestApi } from 'hooks/api/actions/useChangeRequestApi/useChangeRequestApi'; import { useChangeRequestApi } from 'hooks/api/actions/useChangeRequestApi/useChangeRequestApi';
import { useUiFlag } from 'hooks/useUiFlag';
import { DraftChangeRequestActions } from '../DraftChangeRequestActions/DraftChangeRequestActions.tsx'; import { DraftChangeRequestActions } from '../DraftChangeRequestActions/DraftChangeRequestActions.tsx';
import type { AvailableReviewerSchema } from 'hooks/api/getters/useAvailableChangeRequestReviewers/useAvailableChangeRequestReviewers.ts'; import type { AvailableReviewerSchema } from 'hooks/api/getters/useAvailableChangeRequestReviewers/useAvailableChangeRequestReviewers.ts';
@ -78,7 +77,6 @@ export const EnvironmentChangeRequest: FC<{
const [reviewers, setReviewers] = useState<AvailableReviewerSchema[]>([]); const [reviewers, setReviewers] = useState<AvailableReviewerSchema[]>([]);
const [disabled, setDisabled] = useState(false); const [disabled, setDisabled] = useState(false);
const approversEnabled = useUiFlag('changeRequestApproverEmails');
const sendToReview = async (project: string) => { const sendToReview = async (project: string) => {
setDisabled(true); setDisabled(true);
try { try {
@ -167,49 +165,17 @@ export const EnvironmentChangeRequest: FC<{
<ConditionallyRender <ConditionallyRender
condition={environmentChangeRequest?.state === 'Draft'} condition={environmentChangeRequest?.state === 'Draft'}
show={ show={
<ConditionallyRender <DraftChangeRequestActions
condition={approversEnabled} environmentChangeRequest={
show={ environmentChangeRequest
<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>
</>
} }
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; edgeObservability?: boolean;
customMetrics?: boolean; customMetrics?: boolean;
impactMetrics?: boolean; impactMetrics?: boolean;
changeRequestApproverEmails?: boolean;
reportUnknownFlags?: boolean; reportUnknownFlags?: boolean;
lifecycleGraphs?: boolean; lifecycleGraphs?: boolean;
addConfiguration?: boolean; addConfiguration?: boolean;

View File

@ -55,7 +55,6 @@ export type IFlagKey =
| 'reportUnknownFlags' | 'reportUnknownFlags'
| 'customMetrics' | 'customMetrics'
| 'impactMetrics' | 'impactMetrics'
| 'changeRequestApproverEmails'
| 'lifecycleGraphs' | 'lifecycleGraphs'
| 'addConfiguration' | 'addConfiguration'
| 'etagByEnv' | 'etagByEnv'
@ -251,10 +250,6 @@ const flags: IFlags = {
process.env.UNLEASH_EXPERIMENTAL_REPORT_UNKNOWN_FLAGS, process.env.UNLEASH_EXPERIMENTAL_REPORT_UNKNOWN_FLAGS,
false, false,
), ),
changeRequestApproverEmails: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_CHANGE_REQUEST_APPROVER_EMAILS,
false,
),
impactMetrics: parseEnvVarBoolean( impactMetrics: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_IMPACT_METRICS, process.env.UNLEASH_EXPERIMENTAL_IMPACT_METRICS,
false, false,