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

[PACKS] # 1 Add custom request units at organizational level #4396

Closed
2 tasks
cielf opened this issue May 30, 2024 · 3 comments · Fixed by #4432
Closed
2 tasks

[PACKS] # 1 Add custom request units at organizational level #4396

cielf opened this issue May 30, 2024 · 3 comments · Fixed by #4432
Assignees

Comments

@cielf
Copy link
Collaborator

cielf commented May 30, 2024

Summary

Add custom request units at organizational level (requires PACKS #0 completion first)

Why

This is step #1 of adding the ability to specify "packs" versus "units" for requests

Details

Add custom request units used to the organization, on both edit and show.

Prompts, fields and buttons for edit:

Custom request units used (please use singular form -- e.g. pack, not packs) :
Custom request unit : [text field] [Remove]
[+Add another unit]

For show:

Custom request units used:
list the units, one to a line
none, if no units selected

Rules:
Can not be duplicated within the organization
Can not be removed if any items are using the unit.

These will be used as the basis for allowing customized units on specific items.

N.B.

All of the UI changes for PACKS must be implemented behind a flipper flag "enable_packs"
Here are the things you need to know to work with flipper:

1/ Flipper works by enabling or disabling a tag (for the PACKS issues, that is enable_packs)
2/ Here is a code snippet illustrating how to use it in your code, with enable_packs as the example tag:
if Flipper.enabled?(:enable_packs)
// do the thing we are guarding with the tag
end
3/ How to check out if it works manually (with the example tag: enable_packs ):
You have to enable the flipper tag on your localhost (note - the tag is stored in your db, so if you reset your db you have to do it again)

localhost:3000/flipper

userid:  admin
password:  password
    Sign In

Click: Add feature
enable_packs
Click: Add feature

Click:  Fully enable


To set it back (to check that your nifty changes haven’t broken anything when the flag is off)
Sign in as above:
click on “enable_packs”
click “Delete”
type      enable_packs     in the “Are you sure” dialog and click ok

Screen hint for organization edit placement

Image

Screen hint for organization view

Image

Note from dev discussion

It's not problematic to remove a unit that has previously been active for item (and used in requests). The restriction in the Rules section above is only for units that are currently active on an item.

Criteria for completion

  • functionality as described above
  • tests that support the functionality as described above

Background

The following sections have been identified as required for the PACKS implementation. These should be implemented in numerical order. The pre-work [PACKS #0] must be completed first.

Image

@cielf cielf added the Ruby for Good 2024 DC Issues for RFG 2024 DC label May 30, 2024
@awwaiid awwaiid added this to the Packs milestone May 31, 2024
@Eccatoe
Copy link
Collaborator

Eccatoe commented May 31, 2024

I can take this one 👍

Copy link
Contributor

github-actions bot commented Jul 3, 2024

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

@github-actions github-actions bot added the stale label Jul 3, 2024
@awwaiid awwaiid assigned awwaiid and unassigned srinikotla and Eccatoe Jul 7, 2024
awwaiid added a commit that referenced this issue Jul 14, 2024
dorner pushed a commit that referenced this issue Jul 16, 2024
* WIP Added Custom request units at ogranizational level

* Add unique validation to custom organization unit name

* Added flipper conditionals and specs

* Fixed the button name and delete issue

* Updated to allow organizations to delete units

* Clean out some lint!

* Use select2 in tags-mode for Bank unit configuration

* Modify select2 to allow multiple instances on the same page

* Update spec to match request units param

* Hide the select2 drop-down for units [#4396]

* Use unit-names instead of id's when configuring bank [#4396]

* Update some org-unit config specs [#4396]

* Remove outdated comment [#4396]

* Use a dup of params and don't mutate the original [#4396]

* Remove implicit rails_helper require [#4396]

* Explicitly check for packs-disabled case [#4396]

* Move most organization system specs to request spec [#4396]

* Clean out some lint [#4396]

* Switch two more unit-name validation consts [#4396]

---------

Co-authored-by: Liz Catoe <liz.catoe@priviahealth.com>
Co-authored-by: srinikotla <38926870+srinikotla@users.noreply.github.com>
@awwaiid
Copy link
Collaborator

awwaiid commented Jul 21, 2024

Merged!

@awwaiid awwaiid closed this as completed Jul 21, 2024
@awwaiid awwaiid linked a pull request Jul 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment