Skip to content

Conversation

@fpigeonjr
Copy link
Contributor

@fpigeonjr fpigeonjr commented Dec 17, 2025

What changed

This PR implements field disabling functionality for the agreement edit form based on agreement status. When an agreement is awarded, certain fields (name, contract type, service requirement type, product service code, procurement shop, agreement reason, requesting agency, and servicing agency) become immutable and are visually disabled with explanatory tooltips. Super users retain the ability to edit these fields even on awarded agreements.

Key changes include:

Backend logic to return immutable fields list based on agreement awarded status
Frontend form components updated to support disabled states with tooltips
Helper function to determine field disablement based on user role and field status
Comprehensive E2E tests to verify field disabling behavior for regular users and super users

Issue

How to test

  1. visit /agreements/10 which is an awarded agreement with type CONTRACT
  2. edit agreement metadata and verify disabled form fields and tooltips

Definition of Done Checklist

  • OESA: Code refactored for clarity
  • OESA: Dependency rules followed
  • Automated unit tests updated and passed
  • Automated integration tests updated and passed
  • Automated quality tests updated and passed
  • Automated load tests updated and passed
  • Automated a11y tests updated and passed
  • Automated security tests updated and passed
  • 90%+ Code coverage achieved
  • [-] Form validations updated

Copy link
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

This PR implements field disabling functionality for the agreement edit form based on agreement status. When an agreement is awarded, certain fields (name, contract type, service requirement type, product service code, procurement shop, agreement reason, requesting agency, and servicing agency) become immutable and are visually disabled with explanatory tooltips. Super users retain the ability to edit these fields even on awarded agreements.

Key changes include:

  • Backend logic to return immutable fields list based on agreement awarded status
  • Frontend form components updated to support disabled states with tooltips
  • Helper function to determine field disablement based on user role and field status
  • Comprehensive E2E tests to verify field disabling behavior for regular users and super users

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
backend/models/agreements.py Added conditional logic to immutable_awarded_fields property to return empty list when agreement is not awarded
backend/ops_api/tests/ops/agreement/test_agreement_immutable_awarded_fields.py Updated all tests to create awarded procurement actions before asserting immutable fields behavior
frontend/src/components/UI/Form/Input/Input.jsx Added isDisabled and tooltipMsg props with conditional rendering for disabled state; removed PropTypes
frontend/src/components/UI/Form/Select/Select.jsx Added isDisabled and tooltipMsg props with conditional rendering for disabled state and tooltip
frontend/src/components/UI/Form/ComboBox/ComboBox.jsx Added isDisabled and tooltipMsg props with conditional rendering for disabled ComboBox
frontend/src/components/Agreements/ProductServiceCodeSelect.jsx Added isDisabled and tooltipMsg props with conditional rendering for disabled select
frontend/src/components/Agreements/AgreementReasonSelect.jsx Added isDisabled and tooltipMsg props with conditional rendering for disabled fieldset and select
frontend/src/components/ServicesComponents/ContractTypeSelect/ContractTypeSelect.jsx Added isDisabled prop and removed PropTypes
frontend/src/components/ServicesComponents/ServiceReqTypeSelect/ServiceReqTypeSelect.jsx Added isDisabled and tooltipMsg props and removed PropTypes
frontend/src/components/Agreements/AgencySelect/AgencySelect.jsx Added isDisabled and tooltipMsg props to pass through to ComboBox
frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.jsx Applied field disabling logic to all immutable awarded fields using isFieldDisabled helper
frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.hooks.js Extracted immutable_awarded_fields from agreement metadata and added super user check to procurement shop disabling
frontend/src/components/Agreements/AgreementEditor/AgreementEditForm.helpers.js New helper file with isFieldDisabled function to determine field disablement based on field type, immutable fields list, and user role
frontend/src/pages/agreements/agreements.constants.js Added Name field to AgreementFields enum
frontend/src/pages/agreements/details/AgreementDetailsEdit.test.js Updated mock agreement data to include _meta.immutable_awarded_fields property
frontend/cypress/e2e/editAgreement.cy.js Added comprehensive E2E tests for awarded agreement field disabling and super user override behavior

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

@weimiao67 weimiao67 added python Pull requests that update Python code javascript Pull requests that update Javascript code labels Dec 22, 2025
@weimiao67 weimiao67 marked this pull request as ready for review December 23, 2025 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update Javascript code python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ui: disable fields from Edit Agreement form

5 participants