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

Unify Rubric Configuration Modal #7952

Open
wants to merge 7 commits into
base: refactor-payroll-management
Choose a base branch
from

Conversation

jniles
Copy link
Collaborator

@jniles jniles commented Dec 31, 2024

The goal of this PR is to reduce complexity, both for users and developers. It accomplishes this by removing unnecessary steps for the user, and by namespacing and reducing the amount of code for developers.

Update: it also fixes a bug in the IPR Config client code. See the "Bug Fix" section below.

Specifically, the rubric configuration modal UI and API have been updated to remove separate routes and interfaces for the /setting routes that configured rubric_config_items. This creates a single modal for the user to manage. On the developer side, it namespaces the API route to behind the payroll/ prefix and updates the data model in transit to make rubric_config_items a property of the rubric_config option, similar to how invoices, vouchers, and cash payments work with their associated _items.

Here is the updated User Interface.
image

In the future, we might use the bh-checkbox-tree for the rubrics, but that relies on having a sane classify() function for the different types of rubrics. At the moment, the rubric classification is not well enough understood by me to make those kinds of changes.

Bug Fix: IPR Config

In addition to the refactoring of the Rubric Configuration interface, I have also fixed a race condition in the IPR tax configuration modal. In some cases the vm.taxIprId was not defined, which could lead to undefined behavior. I added the $q module to do the following:

  1. Ensure that all promises are settled before the modal is usable. Also ensure that variables used between HTTP connections are ordered correctly.
  2. Ensure that there is common error handling for all promises/HTTP requests.
  3. Clarify the control flow between the update/create states in the modal.

Additionally, I also refactored the URL handling to remove the duplicate configuration text in the URL. Previously, the URL for editing a configuration was /ipr_tax/configuration/1/configuration/4/edit. Now, it is simply /ipr_tax/configuration/1/edit/4, which more closely follows standard REST conventions of namespace/{id} than previously.

@jniles jniles force-pushed the refactor-unify-rubric-configuration branch from 91bdb83 to 682c780 Compare December 31, 2024 22:17
@jniles jniles marked this pull request as ready for review December 31, 2024 22:48
@jniles jniles requested a review from jmcameron December 31, 2024 22:49
@jniles jniles force-pushed the refactor-payroll-management branch from 5bd908f to cd1a9d8 Compare January 1, 2025 16:32
@jniles jniles force-pushed the refactor-unify-rubric-configuration branch from 682c780 to 7d2bf75 Compare January 1, 2025 16:33
@jniles jniles force-pushed the refactor-payroll-management branch from cd1a9d8 to a10945c Compare January 7, 2025 17:32
jniles added 3 commits January 7, 2025 12:02
Unifies the rubric configuration modal to configure both the label and
checkboxes for applied rubrics at the same time for a more streamlined
configuration.
Migrates the rubric configuration server controllers to use the
`payroll/` prefix in routes.  It also removes the `/setting` suffix from
the routes, opting instead to have an API similar to the cash payments
or invoices API where the items are provided as an array in the main
payment configuration object.

The next step will be to unify the client UI to allow simultaneous
configuration for the payroll rubrics.
Uses a unified interface for the rubric configuration service.
@jniles jniles force-pushed the refactor-unify-rubric-configuration branch 2 times, most recently from 83e610a to c76496d Compare January 8, 2025 18:25
@jniles
Copy link
Collaborator Author

jniles commented Jan 8, 2025

@jmcameron, I'm pretty sure this is finally able to be reviewed when you get a chance!

EDIT: Finally got the end to end tests stable here.

Fixes a race condition that caused buggy behavior in the Tax IPR Config
Modal controller.  Now, the submit button is disabled until all the data
is available to use.
@jniles jniles force-pushed the refactor-unify-rubric-configuration branch from c76496d to 9bbafd3 Compare January 8, 2025 19:22
jniles added 2 commits January 8, 2025 13:57
Removes extraneous file from the repository.
Does not crash when the rubric items are empty.
@jniles jniles force-pushed the refactor-unify-rubric-configuration branch from 5167db1 to 5cd0d39 Compare January 9, 2025 18:19
Block modal submission when required fields are not filled in and ensure
that `unset` tests work to allow creating a modal with empty rubric
fields.
@jniles jniles force-pushed the refactor-unify-rubric-configuration branch from 895d222 to 7aa1945 Compare January 9, 2025 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant