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

Make required services unable to be removed or archived #17676

Closed
3 of 5 tasks
omahane opened this issue Mar 28, 2024 · 6 comments
Closed
3 of 5 tasks

Make required services unable to be removed or archived #17676

omahane opened this issue Mar 28, 2024 · 6 comments
Assignees
Labels
CY24-Q2 Calendar year Q2 2024 priority Drupal engineering CMS team practice area Enhancement Issue type: New feature or request Facilities Facilities products (VAMC, Vet Center, etc) sitewide Vet Center CMS managed product owned by Facilities team

Comments

@omahane
Copy link
Contributor

omahane commented Mar 28, 2024

User Story or Problem Statement

As a user with privilege to edit facility services, I want to be assured that I cannot "remove" or archive a facility service that is required.

Acceptance Criteria

  • A user with permissions to edit the service should be able to see on node:edit whether the service is required or optional.
  • Non-admin user is unable to archive a required service
  • Non-admin user is unable to "remove" a required service from a facility
  • Admin user is able to archive a required service, if currently true in production
  • Admin user is able to "remove" a required service from a facility, if currently true in production

Implementation steps

  1. The most certain way is to add some server-side validation, like a constraint, that checks whether a service is required and throws an error when the user submits a form that would archive a service. Of course, we'd need to not throw it if the user is a content admin or admin, as it may actually be necessary to do this.
  2. Another way would be to disable the Archive option in Moderation state for people for whom hasAdminRole() is not true.

333667772-50d05616-25b9-4cf8-8738-739b414a3814

@omahane omahane added Enhancement Issue type: New feature or request Needs refining Issue status Facilities Facilities products (VAMC, Vet Center, etc) labels Mar 28, 2024
@jilladams jilladams added Drupal engineering CMS team practice area Vet Center CMS managed product owned by Facilities team labels Mar 29, 2024
@davidmpickett davidmpickett added the CY24-Q2 Calendar year Q2 2024 priority label Apr 11, 2024
@jilladams
Copy link
Contributor

This ticket doesn't yet account for archiving / removing optional services as an editor. The same proces/mechanism should apply to Editors handling optional services.

@omahane
Copy link
Contributor Author

omahane commented May 28, 2024

@davidmpickett I was looking at your comment on #17929 and was thinking that this box about required or optional services could be clearer, something like the following:

Required services

Screenshot 2024-05-28 at 10 54 04 AM

Optional services

Screenshot 2024-05-28 at 11 10 14 AM

@davidmpickett
Copy link
Contributor

Great edits! I was going to say, "won't it be hard to have the header change?" but then I realized it won't be any harder than changing the sentence that says "This is an optional service." You'll be doing conditional form alters no matter what and this makes it much clearer at a glance.

@davidmpickett
Copy link
Contributor

@omahane I went ahead and pointed this at a 3 based on your LOE estimate from #17929. We can still discuss it in a refinement, but it think this is more or less Ready.

@omahane
Copy link
Contributor Author

omahane commented Jun 13, 2024

@jilladams @Agile6MSkinner @davidmpickett In reviewing the PR, I found something we'll want to add to the IEF removal work: #18321

@davidmpickett
Copy link
Contributor

Confirmed on Staging as a Vet Center editor

Screenshot 2024-06-24 at 3 11 02 PM

Screenshot 2024-06-24 at 3 11 27 PM

And as Admin

Screenshot 2024-06-24 at 3 15 51 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CY24-Q2 Calendar year Q2 2024 priority Drupal engineering CMS team practice area Enhancement Issue type: New feature or request Facilities Facilities products (VAMC, Vet Center, etc) sitewide Vet Center CMS managed product owned by Facilities team
Projects
None yet
Development

No branches or pull requests

4 participants