Skip to content

Descoping CR Feature#4206

Open
wavehassman wants to merge 44 commits into
developfrom
feature/descoping-cr
Open

Descoping CR Feature#4206
wavehassman wants to merge 44 commits into
developfrom
feature/descoping-cr

Conversation

@wavehassman
Copy link
Copy Markdown
Contributor

@wavehassman wavehassman commented May 13, 2026

Changes

Removes all legacy CR UI elements and updates the CR detail page as part of the broader CR descoping epic. Specifically:

  • Removed "Request Change" option from project and work package dropdown menus: "Edit" is now the only entry point
  • Make these one button: "Submit and Implement" for auto-implementing changes (leadership), "Create Change Request" for changes requiring manual approval
  • New project creation now directly implements without requiring a change request: "Change Request" button hidden and "Create Project" button always enabled
  • Reviewer selection made optional on CR submission: removed browser-level HTML required attribute from the reviewer autocomplete
  • Updated CR detail page to display the new why field directly, removing references to deleted scopeChangeRequest, proposedSolutions, and wbsProposedChanges fields
  • Fixed backend car filter queries (getAllChangeRequests, getToReviewChangeRequests, getUnreviewedChangeRequests, getApprovedChangeRequests) to include CRs linked to CAR-level WBS elements, so new project proposal CRs show up correctly in all CR list views
  • Updated E2E tests to reflect the new simplified CR form, removing assertions on deleted fields (ISSUE/DEFINITION_CHANGE/OTHER types, "What needs to be changed") and adding a test verifying CR submission works without a reviewer
  • Removed Create Change Request button from Change Request page

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Screenshots section)
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No yarn.lock changes (unless dependencies have changed)
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #4157

wavehassman and others added 30 commits April 21, 2026 17:03
…k-notif-diff-on-cr-submit

#4171 Slack Notification with Diff
…e-gate-input

#4176 added dateCompleted to stage gate
Copy link
Copy Markdown
Contributor

@chpy04 chpy04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality notes:

  • When I change the lead and then change another part of a project (such as the name or description or budget), it gives this error: Image (this does not appear to be an issue on work packages)
  • Changing only the budget on a project makes a standard change request not a budget change request (I believe this was already a bug). This also feeds into functionality that I don't think we don't have right now: we should make multiple change requests if different kinds are required. For example, if I change the leadership, budget, and description, there should be a leadership CR, a standard CR, and a budget CR. On a completely seperate not I don't think we shoul dactually need CRs for changing project information other than budget, but thats another thing. If we want to say this bullet is out of scope for this branch thats fine but should definately go in the fall CR epic
  • When I have the modal to submit a CR and click the dropdown to select a reviewer it is cut off by the modal and I have to scroll Image
  • After I submit a CR it takes me back to the CR page. it should take me to the change requests page
  • implement and create change request buttons are not merged into one but they should be
  • Allow any head or admin plus requested reviewer to review on slack

@wavehassman wavehassman requested a review from chpy04 May 15, 2026 19:35

try {
// Action-specific validation: verify action_id
if (firstAction.action_id !== 'approve_cr') {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure this is unreachable code? If its not Im confused when this would happen and we should have a more specific error message / guard. If anything we should not be calling the controller if this was the case


// Action-specific validation: verify value format
let actionValue: CrApprovalActionValue;
try {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really not a fan of nested try catches

Prisma.validator<Prisma.Project_Proposed_ChangesDefaultArgs>()({
include: {
teams: getTeamQueryArgs(organizationId),
car: { include: { wbsElement: true } },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select

Prisma.validator<Prisma.Work_Package_Proposed_ChangesDefaultArgs>()({
include: {
wbsProposedChanges: {
include: {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select

include: {
wbsProposedChanges: {
include: {
links: { where: { dateDeleted: null }, include: { linkType: true } },
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select

SET
why = CONCAT(
'Type: ', cr.type::text,
CASE WHEN sc.what IS NOT NULL THEN CONCAT(' | What: ', sc.what) ELSE '' END,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use newlines instead of pipes? the pipes are kind of hard to interpret retrospectively


const addDiff = (label: string, before: string | number | null | undefined, after: string | number | null | undefined) => {
const b = String(before ?? '(none)');
const a = String(after ?? '(none)');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if before or after could be a number, they could be 0, so lets guard against that getting changed to '(none)'

): string => {
if (!proposed) return '';

const isWpChange = 'startDate' in proposed;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very fragile way to determine which type we are working with. In this case an isntanceof actually makes a lot more sense. In addittion, you can actuall get kind of fance with the types and do something like:

const isWpChange(cr: ProjectProposedChangesCreateArgs | WorkPackageProposedChangesCreateArgs | undefined): cr is WorkPackageProposedChangesCreateArgs {
return cr instanceof WorkPackageProposedChangesCreateArgs
}

and vise versa with the project. The cr is <type> means that if the predicate passes in an if guard (like below), you the type checker will automatically narrow into that specific type and you don't need to cast


await Promise.all(changePromises);
if (isWpChange) {
const wpProposed = proposed as WorkPackageProposedChangesCreateArgs;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't be needed if you use the above syntax

addNew('Manager', wpProposed.managerId);
addNew('Start date', wpProposed.startDate);
addNew('Duration', wpProposed.duration);
addNew('Stage', wpProposed.stage);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we should be able to collablse the addNew and addDiff into a single function that just knows an empty value means you are adding a new, but if I'm missing something this is fine to leave as is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Change Requests] - Descoping

4 participants