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

Create a new Pro-Gear Weight Section in Office PPM Tab #3289

Merged
merged 8 commits into from Jan 14, 2020

Conversation

@jim
Copy link
Contributor

jim commented Jan 8, 2020

Description

We've been including the weights of proper in a PPM shipment's net weight. There are situations where we need to be able to work with the shipment's program weight separately from the weight of other goods. This PR is a part of ongoing work to split these weights apart.

With this change, the amounts shown to office users in the weights panel are derived from weight tickets instead of using the net_weight value stored on the PPM model. This allows us to have more involved logic as a part of the presentation:

  • Net Weight only includes weight tickets that have been marked OK and that are for cat/trailer/truck weight tickets.
  • ProGear only includes weight tickets that have been marked OK and that have a weight_ticket_set_type of PROGREAR.

Reviewer Notes

As a part of this work, I renamed vehicle_options to weight_ticket_set_type throughout the application. The new name is a better representation of the values stored by the field.

Setup

Add any steps or code to run in this section to help others prepare to run your code:

$ make server_run
$ make office_client_run
$ make db_dev_e2e_populate
  1. Login as an office user
  2. Select a PPM move with a payment requested (this is important, as otherwise the alerts won't appear.
  3. Add some weight ticket sets. When one is added and its weight_ticket_set_type is PROGEAR, its weight should be included in the Proper weight in the weights panel. All other weight ticket set types should be included in Net Weight. The weight ticket sets must be OKed for this to happen.
  4. Verify that if you add a weight ticket set that isn't set to OK or Exclude, an alert appears mentioning that there are weight tickets to be reviewed.

Code Review Verification Steps

  • Any new migrations/schema changes:
    • Follow our guidelines for zero-downtime deploys (see Zero-Downtime Deploys)
    • Have been communicated to #dp3-engineering
  • There are no aXe warnings for UI.
  • This works in Supported Browsers and their phone views (Chrome, Firefox, IE, Edge).
  • User facing changes have been reviewed by design.
  • Request review from a member of a different team.
  • Have the Jira acceptance criteria been met for this change?

References

Screenshots

Screen Shot 2020-01-08 at 4 27 39 PM

Screen Shot 2020-01-08 at 4 27 00 PM

@jim jim changed the title Jb mb 703 progear in office [DNR] Jb mb 703 progear in office Jan 8, 2020
@jim jim changed the title [DNR] Jb mb 703 progear in office [WIP] Jb mb 703 progear in office Jan 8, 2020
@jim jim marked this pull request as ready for review Jan 9, 2020
@jim jim changed the title [WIP] Jb mb 703 progear in office Create a new Pro-Gear Weight Section in Office PPM Tab Jan 9, 2020
@ralren ralren added the roci label Jan 9, 2020
@mkrump
mkrump approved these changes Jan 9, 2020
Copy link
Contributor

mkrump left a comment

looks good works as expected. 🚢 !

);
};
// MoveDocument filter functions
const onlyPending = ({ status }) => ![MOVE_DOC_STATUS.OK, MOVE_DOC_STATUS.EXCLUDE].includes(status);

This comment has been minimized.

Copy link
@mkrump

mkrump Jan 9, 2020

Contributor

👍

@@ -110,13 +114,13 @@ class WeightTicketListItem extends Component {
) : (
<p>Full weight ticket {full_weight} lbs</p>
)}
{vehicle_options === 'CAR_TRAILER' && trailer_ownership_missing && (
{weight_ticket_set_type === 'CAR_TRAILER' && trailer_ownership_missing && (

This comment has been minimized.

Copy link
@mkrump

mkrump Jan 9, 2020

Contributor

could use values from constants.js rather than string 'CAR_TRAILER'

<MissingLabel>
Missing ownership documentation{' '}
<FontAwesomeIcon style={{ color: 'red' }} className="icon" icon={faExclamationCircle} />
</MissingLabel>
)}
{vehicle_options === 'CAR_TRAILER' && !trailer_ownership_missing && <p>Ownership documentation</p>}
{weight_ticket_set_type === 'CAR_TRAILER' && !trailer_ownership_missing && <p>Ownership documentation</p>}

This comment has been minimized.

Copy link
@mkrump

mkrump Jan 9, 2020

Contributor

could use values from constants.js rather than string 'CAR_TRAILER'

@ralren
ralren approved these changes Jan 9, 2020
// Common combinations of MoveDocument filters
export function findOKedVehicleWeightTickets(moveDocs) {
return moveDocs
.filter(onlyWeightTickets)

This comment has been minimized.

Copy link
@ralren

ralren Jan 9, 2020

Contributor

NOICE

Copy link
Contributor

reggieriser left a comment

Database changes look fine (evaluating those as a code owner).

Copy link
Contributor

chrisgilmerproj left a comment

🚀

@jim jim merged commit 5bc0cec into master Jan 14, 2020
16 checks passed
16 checks passed
auto-approve dependabot PRs
Details
ci/circleci: acceptance_tests_experimental Your tests passed on CircleCI!
Details
ci/circleci: acceptance_tests_local Your tests passed on CircleCI!
Details
ci/circleci: acceptance_tests_staging Your tests passed on CircleCI!
Details
ci/circleci: build_app Your tests passed on CircleCI!
Details
ci/circleci: build_migrations Your tests passed on CircleCI!
Details
ci/circleci: build_storybook_app Your tests passed on CircleCI!
Details
ci/circleci: build_tasks Your tests passed on CircleCI!
Details
ci/circleci: build_tools Your tests passed on CircleCI!
Details
ci/circleci: check_generated_code Your tests passed on CircleCI!
Details
ci/circleci: client_test Your tests passed on CircleCI!
Details
ci/circleci: integration_tests Your tests passed on CircleCI!
Details
ci/circleci: pre_deps_golang Your tests passed on CircleCI!
Details
ci/circleci: pre_deps_yarn Your tests passed on CircleCI!
Details
ci/circleci: pre_test Your tests passed on CircleCI!
Details
ci/circleci: server_test Your tests passed on CircleCI!
Details
@jim jim deleted the jb-MB-703-progear-in-office branch Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.