Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds initial mhv-supply-reordering application #33224

Merged
merged 33 commits into from
Dec 3, 2024
Merged

Adds initial mhv-supply-reordering application #33224

merged 33 commits into from
Dec 3, 2024

Conversation

radavis
Copy link
Contributor

@radavis radavis commented Nov 25, 2024

Are you removing, renaming or moving a folder in this PR?

  • No, I'm not changing any folders (skip to TeamSites and delete the rest of this section)
  • Yes, I'm removing, renaming or moving a folder

⚠️ TeamSites ⚠️

Examples of a TeamSite: https://va.gov/health and https://benefits.va.gov/benefits/. This scenario is also referred to as the "injected" header and footer. You can reach out in the #sitewide-public-websites Slack channel for questions.

Did you change site-wide styles, platform utilities or other infrastructure?

Summary

Related issue(s)

Testing done

  • Follow readme instructions to develop the app, locally
  • UI for alerting conditions: see containers/Alerts.jsx and components/Alert*.jsx
  • UI for displaying and selecting supplies, editing email and address
  • Note: Form submission won't work because this application is a work in progress.

Screenshots

Note: This field is mandatory for UI changes (non-component work should NOT have screenshots).

Before After
Mobile
Desktop

What areas of the site does it impact?

(Describe what parts of the site are impacted if code touched other areas)

Acceptance criteria

Quality Assurance & Testing

  • I fixed|updated|added unit tests and integration tests for each feature (if applicable).
  • No sensitive information (i.e. PII/credentials/internal URLs/etc.) is captured in logging, hardcoded, or specs
  • Linting warnings have been addressed
  • Documentation has been updated (link to documentation *if necessary)
  • Screenshot of the developed feature is added
  • Accessibility testing has been performed

Error Handling

  • Browser console contains no warnings or errors.
  • Events are being sent to the appropriate logging solution
  • Feature/bug has a monitor built into Datadog or Grafana (if applicable)

Authentication

  • Did you login to a local build and verify all authenticated routes work as expected with a test user

Requested Feedback

(OPTIONAL) What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?

@radavis radavis requested a review from a team as a code owner November 25, 2024 19:05
Copy link

@va-vfs-bot va-vfs-bot left a comment

Choose a reason for hiding this comment

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

ESLint is disabled

vets-website uses ESLint to help enforce code quality. In most situations we would like ESLint to remain enabled.

What you can do

See if the code can be refactored to avoid disabling ESLint, or wait for a VSP review.

},
};

// eslint-disable-next-line no-unused-vars

Choose a reason for hiding this comment

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

ESLint disabled here

],
};

// eslint-disable-next-line no-unused-vars

Choose a reason for hiding this comment

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

ESLint disabled here

],
};

// eslint-disable-next-line no-unused-vars

Choose a reason for hiding this comment

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

ESLint disabled here

@@ -0,0 +1,18 @@
const delay = require('mocker-api/lib/delay'); // eslint-disable-line no-unused-vars

Choose a reason for hiding this comment

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

ESLint disabled here

@@ -0,0 +1,68 @@
/* eslint-disable camelcase */

Choose a reason for hiding this comment

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

ESLint disabled here

@radavis radavis requested a review from a team November 25, 2024 19:29
@va-vfs-bot va-vfs-bot temporarily deployed to master/order-supplies/main November 25, 2024 23:25 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/order-supplies/main November 26, 2024 15:12 Inactive
@radavis radavis requested a review from acrollet November 26, 2024 15:18
@va-vfs-bot va-vfs-bot temporarily deployed to master/order-supplies/main November 26, 2024 15:30 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/order-supplies/main November 26, 2024 16:39 Inactive
Copy link
Contributor

@acrollet acrollet left a comment

Choose a reason for hiding this comment

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

This is excellent work! I really love seeing all the decomposition and how much cleaner everything is. I have a few small comments but don't see anything show-stopping at all.


A web-component-pattern is a group of web-component-fields that can span one or more pages (e.g. - a multi-page form). These can be found at `src/platform/forms-system/src/js/web-component-patterns`.

## Form Flow
Copy link
Contributor

Choose a reason for hiding this comment

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

I love this thorough README and the docs references!

@@ -0,0 +1,12 @@
import React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

really like these clean little components

const STATE_NAMES = filteredStates.map(state => state.label);

/*
const NONBLANK_PATTERN = '^.*\\S.*';
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the commented out code being kept for a specific reason?

Copy link
Contributor Author

@radavis radavis Nov 26, 2024

Choose a reason for hiding this comment

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

There's still some work to be completed with this component. I'll clear out any commented code.

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry if I jumped the gun on the review!

import React, { useState } from 'react';
import UnsavedFieldNote from './UnsavedFieldNote';

const EditEmail = ({ data, goToPath, setFormData }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we doing any validation on the entered email address?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm.... Not yet, but we should!


const SuppliesUnavailable = ({ supplies }) => {
const cards = supplies
?.sort((a, b) => a.productName.localeCompare(b.productName))
Copy link
Contributor

Choose a reason for hiding this comment

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

It could be nice to move this logic to a sortedSupplies utility function

something went wrong on our end.
</p>
<p className="vads-u-font-weight--bold vads-u-margin-y--1 vads-u-font-family--serif">
What you can do
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be a heading? Genuinely not sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Couldn't hurt to make this an h4, but I might hold off changing it until an a11y review.

src/applications/mhv-supply-reordering/config/form.js Outdated Show resolved Hide resolved
suppliesUi,
} from '../utils/helpers';

const numberOfSuppliesPhrase = count => {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we could move this to a shared utility and use it other places the pattern occurs? (I know I saw it at least one other place)

Copy link

@va-vfs-bot va-vfs-bot left a comment

Choose a reason for hiding this comment

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

ESLint is disabled

vets-website uses ESLint to help enforce code quality. In most situations we would like ESLint to remain enabled.

What you can do

See if the code can be refactored to avoid disabling ESLint, or wait for a VSP review.

@@ -0,0 +1,105 @@
// eslint-disable-next-line no-unused-vars

Choose a reason for hiding this comment

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

ESLint disabled here

Copy link
Contributor

@nichia nichia left a comment

Choose a reason for hiding this comment

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

The structure/setup for supply reordering is looking good.


## App

Form app generated with `yarn app:new`. Changes to the following files were reverted, since `VA_FORM_IDS.FORM_VA_2346A` already exists.
Copy link
Contributor

Choose a reason for hiding this comment

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

correction: yarn app:new --> yarn new:app

@va-vfs-bot va-vfs-bot temporarily deployed to master/order-supplies/main November 27, 2024 14:09 Inactive
@va-vfs-bot va-vfs-bot temporarily deployed to master/order-supplies/main December 2, 2024 16:39 Inactive
Copy link
Contributor

@dcloud dcloud left a comment

Choose a reason for hiding this comment

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

I think this is good to move forward. Just some minor feedback below.

One piece of feedback is that you might consider moving/merging your mocks into src/platform/mhv/api/mocks. This is something I keep meaning to discuss around the mhv-landing-page mocks as well, since it seems potentially useful to buy into the shared MHV mocks.

I also approve this assuming you'll address the proptypes warnings in a future PR, though I am ambivalent on the value of proptypes validation myself.

@radavis radavis merged commit cd0d6bc into main Dec 3, 2024
58 of 59 checks passed
@radavis radavis deleted the order-supplies branch December 3, 2024 15:08
Khoa-V-Nguyen pushed a commit that referenced this pull request Dec 16, 2024
* Adds initial mhv-supply-reorder form app
* Adds mocks
* Adds alerts
* Moves breadcrumbs to IntroductionPage
* Sets useTopBackLink: true in formConfig (large continue button)
* Show subtitle on IntroductionPage, only
* Sets 'Finish this order later' content for save link
* Removes margin from paragraph in informative va-alert
* Sets Select supplies as first page
* Sets supply count, 'No supplies selected/found' text
* Adds formatDate helper
* Adds checkboxes for selecting supplies
* Adds product description
* Updates readme
* No e2e specs, yet
* Adds unit specs
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.

6 participants