Skip to content

feat: add required Project combobox on agreement details edit#5197

Merged
fpigeonjr merged 9 commits intomainfrom
OPS-5195/project-combobox-on-agreement
Mar 5, 2026
Merged

feat: add required Project combobox on agreement details edit#5197
fpigeonjr merged 9 commits intomainfrom
OPS-5195/project-combobox-on-agreement

Conversation

@fpigeonjr
Copy link
Copy Markdown
Contributor

@fpigeonjr fpigeonjr commented Mar 3, 2026

Summary

  • add Project combobox to agreement details edit form (non-wizard only), placed under Agreement Nickname
  • source options from /projects and keep wizard flow unchanged (project still selected in step 1)
  • support type-ahead by title and short title via Title (Short Title) option labels
  • make project required in details edit with validation, disabled Save state, and required hint/error messaging
  • strengthen unit tests for project combobox behavior and details-vs-wizard rendering/disabled save behavior
  • closes ui: add Project select to Agreement form #5195

Screenshots

image image

Automated Testing

  • cd frontend && bun run format
  • cd frontend && bun run lint
  • cd frontend && bun run test --watch=false src/components/Projects/ProjectComboBox/ProjectComboBox.test.js src/components/Agreements/AgreementEditor/AgreementEditForm.project.test.jsx src/pages/agreements/details/AgreementDetailsEdit.test.js
  • cd frontend && bun run test:coverage src/components/Projects/ProjectComboBox/ProjectComboBox.test.js src/components/Agreements/AgreementEditor/AgreementEditForm.project.test.jsx src/pages/agreements/details/AgreementDetailsEdit.test.js

Manual Tests

  • edit an agreement
  • change the project
  • save changes
  • profit

Notes

  • backend agreement-history update for project_id is intentionally out of scope for this PR and will be handled separately

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a required Project combobox to the non-wizard Agreement Details edit form, sourcing options from /projects while keeping the wizard flow unchanged.

Changes:

  • Introduces/updates ProjectComboBox to display options as Title (Short Title) and support required hint/error rendering.
  • Wires project fetching/selection/validation into the non-wizard AgreementEditForm + disables Save when project_id is missing.
  • Expands unit + Cypress coverage for wizard-vs-details rendering and required/disabled behaviors.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
frontend/src/pages/agreements/details/AgreementDetailsEdit.test.js Updates API mocks to include projects query and richer loading/error shape.
frontend/src/components/Projects/ProjectComboBox/ProjectComboBox.test.js Extends tests for Title (Short Title) labels and required/error messaging.
frontend/src/components/Projects/ProjectComboBox/ProjectComboBox.jsx Adds label customization, required hint/error UI, and option label formatting using short_title.
frontend/src/components/Agreements/AgreementEditor/AgreementEditFormSuite.js Adds project_id validation rule.
frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.project.test.jsx New tests for non-wizard-only rendering and disabled Save behavior.
frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.jsx Renders ProjectComboBox under nickname in non-wizard mode; loading includes projects.
frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.hooks.js Fetches projects, adds selection handler, validates/blocks Save when project is missing.
frontend/cypress/e2e/editAgreement.cy.js Confirms project combobox is not shown in wizard flow.
frontend/cypress/e2e/agreementDetailsEdit.cy.js Confirms project label exists in details edit.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.hooks.js Outdated
@fpigeonjr fpigeonjr merged commit dd0d611 into main Mar 5, 2026
55 checks passed
@fpigeonjr fpigeonjr deleted the OPS-5195/project-combobox-on-agreement branch March 5, 2026 17:39
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 5, 2026

🎉 This PR is included in version 1.316.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui: add Project select to Agreement form

4 participants