Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #5742 feat(nimbus): implement UI for manual enrollment end
Because: * we want to change ending enrollment from an automatic to a manual action This commit: * refactors the Settings page and ChangeApprovalOperations components * tweak the DB queries and Celery tasks to handle manually-approved enrollment end * adds more exhaustive stories for launch, end enrollment, and end cases on PageSummary * refactors handling of strings describing lifecycle review flows, moves all the strings into shared constants
- Loading branch information
Showing
24 changed files
with
607 additions
and
268 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
app/experimenter/nimbus-ui/src/components/ChangeApprovalOperations/RejectionReason.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
import React, { useMemo } from "react"; | ||
import Alert from "react-bootstrap/Alert"; | ||
import { LIFECYCLE_REVIEW_FLOWS } from "../../lib/constants"; | ||
import { humanDate } from "../../lib/dateUtils"; | ||
import { getExperiment_experimentBySlug } from "../../types/getExperiment"; | ||
import { | ||
NimbusChangeLogOldStatus, | ||
NimbusChangeLogOldStatusNext, | ||
} from "../../types/globalTypes"; | ||
|
||
export const RejectionReason = ({ | ||
rejectionEvent, | ||
}: { | ||
rejectionEvent: getExperiment_experimentBySlug["rejection"]; | ||
}) => { | ||
const { message, changedOn, changedBy, oldStatus, oldStatusNext } = | ||
rejectionEvent!; | ||
|
||
const rejectionActionDescription = useMemo(() => { | ||
if (oldStatus === NimbusChangeLogOldStatus.LIVE) { | ||
if (oldStatusNext === NimbusChangeLogOldStatusNext.LIVE) { | ||
return LIFECYCLE_REVIEW_FLOWS.PAUSE.description; | ||
} | ||
return LIFECYCLE_REVIEW_FLOWS.END.description; | ||
} | ||
if (oldStatus === NimbusChangeLogOldStatus.DRAFT) { | ||
return LIFECYCLE_REVIEW_FLOWS.LAUNCH.description; | ||
} | ||
}, [rejectionEvent]); | ||
|
||
return ( | ||
<Alert variant="warning" data-testid="rejection-notice"> | ||
<div className="text-body"> | ||
<p className="mb-2"> | ||
The request to {rejectionActionDescription} was{" "} | ||
<strong>Rejected</strong> due to: | ||
</p> | ||
<p className="mb-2"> | ||
{changedBy!.email} on {humanDate(changedOn!)}: | ||
</p> | ||
<p className="bg-white rounded border p-2 mb-0">{message}</p> | ||
</div> | ||
</Alert> | ||
); | ||
}; | ||
|
||
export default RejectionReason; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.