department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
283 stars 204 forks source link

[FSR] Front End Discovery - Review page edit and view only #60585

Closed Dr-Pongo closed 1 year ago

Dr-Pongo commented 1 year ago

Issue Description

Discovery ticket to investigate review page effort, and make necessary tickets.

When we're making the read only tickets, and the header links, we can probably break these up by chapter so we can divvy up the work. (Income chapters will probably be bigger)

Design Files: see Review request (C7)


Paths with CustomPageReview Component

"VIC" stands for "Veteran Information Chapter" "HIC" for "Household Income Chapter" "HAC" for "Household Assets Chapter" "HEC" for "Household Expenses Chapter"

Chapter Page Path CustomPageReview
VIC currentContactInformation current-contact-information ContactInfoReview
VIC editMobilePhone edit-mobile-phone EditMobilePhone
VIC editEmailAddress edit-email-address EditEmail
VIC editMailingAddress edit-mailing-address EditAddress
HIC dependentAges dependent-ages DependentAgesReview
HAC otherAssetsSummary other-assets-summary OtherAssetsSummaryReview
HEC utilityBillSummary utility-bill-summary UtilityBillSummaryReview
HEC otherExpensesSummary other-expenses-summary OtherExpensesSummaryReview

Paths with CustomPageReview null

Note: I need to confirm this but it's also likely these are all custom schema pages

      uiSchema: {},
      schema: { type: 'object', properties: {} },
Chapter Page Path CustomPageReview
HIC employmentQuestion employment-question null
HIC enhancedEmploymentRecords enhanced-employment-records null
HIC grossMonthlyIncome gross-monthly-income null
HIC payrollDeductionChecklist deduction-checklist null
HIC payrollDeductionInputList deduction-values null
HIC employmentHistorySummary employment-history null
HIC editBenefitsEnhanced edit-benefits null
HIC otherIncomeSummary other-income-summary null
HIC addOtherIncome add-other-income null
HIC spouseEmploymentQuestion enhanced-spouse-employment-question null
HIC enhancedSpouseEmploymentRecords enhanced-spouse-employment-records null
HIC enhancedSpouseGrossMonthlyIncome spouse-gross-monthly-income null
HIC spousePayrollDeductionChecklist spouse-deduction-checklist null
HIC spousePayrollDeductionInputList spouse-deduction-values null
HIC spouseEmploymentHistory spouse-employment-history null
HIC spouseOtherIncomeSummary spouse-other-income-summary null
HIC spouseAddOtherIncome spouse-add-other-income null
HAC enhancedVehicleRecords your-vehicle-records null
HAC vehiclesSummary vehicles-summary null
HAC addOtherAsset add-other-asset null
HEC addUtilityBill add-utility-bill null
HEC addEditCreditCardBills your-credit-card-bills null
HEC creditCardBillSummary credit-card-bills-summary null
HEC addEditInstallmentContract your-installment-contracts null
HEC installmentContractSummary installment-contracts-summary null
HEC addOtherExpenses add-other-expense null

Paths with editModeOnReviewPage: true

Chapter Page Path editModeOnReviewPage
VIC veteranInfo veteran-information true
HIC employmentRecords employment-records true
HIC enhancedEmploymentRecords enhanced-employment-records true
HIC grossMonthlyIncome gross-monthly-income true
HIC payrollDeductionChecklist deduction-checklist true
HIC employmentHistorySummary employment-history true
HIC income income/:index true
HIC additionalIncomeRecords additional-income-records true
HIC otherIncomeSummary other-income-summary true
HIC enhancedSpouseEmploymentRecords enhanced-spouse-employment-records true
HIC enhancedSpouseGrossMonthlyIncome spouse-gross-monthly-income true
HIC spousePayrollDeductionChecklist spouse-deduction-checklist true
HIC spouseEmploymentHistory spouse-employment-history true
HIC spouseEmploymentRecords spouse-employment-records true
HIC spouseIncome spouse/income/:index true
HIC spouseAdditionalIncomeRecords spouse-additional-income-records true
HIC spouseOtherIncomeSummary spouse-other-income-summary true
HIC dependentRecords dependent-records true
HAC realEstateRecords real-estate-asset-records true
HAC vehicleRecords vehicle-records true
HAC enhancedVehicleRecords your-vehicle-records true
HAC vehiclesSummary vehicles-summary true
HAC recreationalVehicleRecordsListLoop recreational-vehicle-records true
HAC otherAssetRecords other-asset-records true
HAC otherAssetsSummary other-assets-summary true
HEC utilityRecords utility-records true
HEC utilityBillSummary utility-bill-summary true
HEC repaymentRecords repayment-records true
HEC addEditCreditCardBills your-credit-card-bills true
HEC creditCardBillSummary credit-card-bills-summary true
HEC addEditInstallmentContract your-installment-contracts true
HEC installmentContractSummary installment-contracts-summary true
HEC otherExpenseRecords other-expense-records true
HEC otherExpensesSummary other-expenses-summary true

Paths with editOnReviewPage: false

Chapter Page Path editModeOnReviewPage
HIC spouseEmploymentQuestion enhanced-spouse-employment-question false
HIC dependentAges dependent-ages false
HAC enhancedRealEstate enhanced-real-estate-assets false
HAC enhancedRealEstateRecords enhanced-real-estate-asset-records false
HAC recreationalVehicleRecords cfsr-recreational-vehicle-records false

Pages without customPageReview or editModeOnReviewPage keys in page definition

Chapter / Page Path
veteranInformationChapter - availableDebts available-debts
veteranInformationChapter - combinedAvailableDebts all-available-debts
veteranInformationChapter - contactInfo contact-information
householdIncomeChapter - employment employment
householdIncomeChapter - benefits benefits
householdIncomeChapter - benefitsEnhanced your-benefits
householdIncomeChapter - socialSecurity social-security
householdIncomeChapter - socialSecurityRecords social-security-records
householdIncomeChapter - additionalIncome additional-income
householdIncomeChapter - additionalIncomeChecklist additional-income-checklist
householdIncomeChapter - additionalIncomeValues additional-income-values
householdIncomeChapter - spouseInformation spouse-information
householdIncomeChapter - spouseName spouse-name
householdIncomeChapter - spouseEmployment spouse-employment
householdIncomeChapter - spouseBenefits spouse-benefits
householdIncomeChapter - spouseBenefitRecords spouse-benefit-records
householdIncomeChapter - spouseSocialSecurity spouse-social-security
householdIncomeChapter - spouseSocialSecurityRecords spouse-social-security-records
householdIncomeChapter - spouseAdditionalIncome spouse-additional-income
householdIncomeChapter - spouseAdditionalIncomeCheckList spouse-additional-income-checklist
householdIncomeChapter - spouseAdditionalIncomeValues spouse-additional-income-values
householdIncomeChapter - dependents dependents
householdIncomeChapter - dependentCount dependents-count
householdAssetsChapter - monetary monetary-assets
householdAssetsChapter - monetaryChecklist monetary-asset-checklist
householdAssetsChapter - monetaryValues monetary-asset-values
householdAssetsChapter - realEstate real-estate-assets
householdAssetsChapter - vehicles vehicles
householdAssetsChapter - recreationalVehicles recreational-vehicles
householdAssetsChapter - otherAssets other-assets
householdAssetsChapter - otherAssetsChecklist other-assets-checklist
householdAssetsChapter - otherAssetsValues other-assets-values
householdExpensesChapter - expensesExplainer expenses-explainer
householdExpensesChapter - expenses expenses
householdExpensesChapter - householdExpensesChecklist household-expenses-checklist
householdExpensesChapter - householdExpensesInputList household-expenses-values
householdExpensesChapter - utilities utilities
householdExpensesChapter - utilityBillChecklist utility-bill-checklist
householdExpensesChapter - utilityBillValues utility-bill-values
householdExpensesChapter - repayments repayments
householdExpensesChapter - creditCardBills credit-card-bills
householdExpensesChapter - installmentContracts installment-contracts
householdExpensesChapter - otherExpenses other-expenses
householdExpensesChapter - otherExpensesChecklist other-expenses-checklist
householdExpensesChapter - otherExpensesValues other-expenses-values
resolutionOptionsChapter - optionExplainer option-explainer
resolutionOptionsChapter - resolutionOptions resolution-options
resolutionOptionsChapter - resolutionOption resolution-option/:index
resolutionOptionsChapter - resolutionComment resolution-comment/:index
resolutionOptionsChapter - resolutionWaiverCheck resolution-waiver-agreement/:index
resolutionOptionsChapter - resolutionComments resolution-comments
bankruptcyAttestationChapter - bankruptcyHistory bankruptcy-history
bankruptcyAttestationChapter - bankruptcyHistoryRecords bankruptcy-history-records
bankruptcyAttestationChapter - enhancedBankruptcyHistoryRecords enhanced-bankruptcy-history-records

Tasks

Acceptance Criteria

amponce commented 1 year ago

Simple way to search up paths based on whatever criteria we need


import formConfig from '../config/form';

  const extractPathAndComponent = () => {
    Object.entries(formConfig.chapters).forEach(([chapterKey, chapter]) => {
      if (chapter.pages) {
        Object.entries(chapter.pages).forEach(([pageKey, page]) => {
          if (page.editModeOnReviewPage === false) {
            console.log(`Chapter: ${chapterKey}, Page: ${pageKey}`);
            console.log(`Path: ${page.path}`);
            console.log(`editModeOnReviewPage: ${page.editModeOnReviewPage}`);
          }
        });
      }
    });
  };

  // Or by various chapter keys

const extractPathAndComponent = () => {
    Object.entries(formConfig.chapters).forEach(([chapterKey, chapter]) => {
      if (chapter.pages) {
        Object.entries(chapter.pages).forEach(([pageKey, page]) => {
          if (
            page.CustomPageReview !== undefined &&
            page.CustomPageReview !== null
          ) {
            console.log(`Chapter: ${chapterKey}, Page: ${pageKey}`);
            console.log(`Path: ${page.path}`);
            console.log(`CustomPageReview: ${page.CustomPageReview.name}`);
          }
        });
      }
    });
  };

    // then call this function inside your component
  useEffect(() => {
    extractPathAndComponent();
  }, []);
amponce commented 1 year ago

Summary of Completed Work

  1. Classification of the form's chapters, pages, and corresponding paths into distinct categories, including:

    • Paths with the 'CustomPageReview' component
    • Paths where 'CustomPageReview' is null, potentially suggesting these pages follow custom schemas
    • Paths where 'editModeOnReviewPage' is enabled (true)
    • Paths where 'editModeOnReviewPage' is disabled (false)
    • Pages lacking 'customPageReview' or 'editModeOnReviewPage' keys in their page definitions
  2. Compiled the above information into comprehensive tables. These tables encapsulate details about the chapter, page, path, and any particular component parameters (such as 'CustomPageReview' or 'editModeOnReviewPage').

Next Steps

Our upcoming task is to devise a strategy for activating read-only mode across each section category. This requires careful planning as the implementation approach may vary across different sections due to the unique properties of each category.

@Dr-Pongo @HeatherRienks

amponce commented 1 year ago

Household Income Chapter

Employment History

Spouse Employment History

Component: EmploymentCustomReview

Additional Income

Spouse Additional Income

Component: AdditionalIncomeReview

Household Assets Chapter

Household Expenses Chapter

Dr-Pongo commented 1 year ago

Okay in short this is what I'm thinking ticket wise.

Headers get a little weird. Currently we don't really have a way to just show a page only on the final review and I don't want to make a huge mess with platform level changes, but we can leverage CustomPageReview on the first page in each chapter to slide in a header and "Edit section" button. This will involve displaying information for that page and the header. Some pages like Assets we won't necessarily need to worry about bc we're not showing the checklist on the review. If we take this approach we'll need the following ticket (might not be worth to have split up into multiple tickets for consistency):