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

Hide Adding Option Value for Locked Groups #11962

Conversation

mickadoo
Copy link
Contributor

@mickadoo mickadoo commented Apr 9, 2018

Overview

You can edit option values from a few different places:

  1. civicrm/admin/options?gid=<option_group_id>
  2. civicrm/admin/options/<option_group_name>
  3. civicrm/admin/custom/group/field/option?action=browse&gid=<custom_group_id>&fid=<custom_field_id>

When "is_locked" = 1 only the first method hides the button to add new option values In all. In all places you can delete option values, despite the notice on locked group edit pages saying:

This option group is reserved for system use. You cannot add or delete options in this list.

The button to add an option value will be hidden for locked option groups by this PR. It will also remove the option to delete option values for locked option groups.

Before

From Custom Field Edit page

image

From Option Group Edit Page Using Group ID

image

From Option Group Edit Page Using Group Name

image

After

From Custom Field Edit page

image

From Option Group Edit Page Using Group Name

image

From Option Group Edit Page Using Group ID

image


Link to Issue

Notes

I fixed a few unrelated typos and removed one unused $config variable in this

@mickadoo mickadoo changed the title 55 hide adding option value for locked groups Hide Adding Option Value for Locked Groups Apr 9, 2018
Copy link
Contributor

@ajesamson ajesamson left a comment

Choose a reason for hiding this comment

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

Looks good. Await more reviews from others (non compucorp)

@ajesamson
Copy link
Contributor

  • Explain (r-explain)
    • PASS : The goal/problem/solution have been adequately explained in the PR.
  • Test results (r-test)
    • UNREVIEWED
  • Code quality (r-code)
    • PASS: The functionality, purpose, and style of the code seems clear+sensible.
  • Documentation (r-doc)
    • UNREVIEWED
  • Maintainability (r-maint)
    • UNREVIEWED
  • Run it (r-run)
    • PASS: A new civicrm was setup with civibuild civibuild create civi47 --type drupal-demo --civi-ver master --url "http://civi47.local:9091" --admin-pass admin --web-root /vagrant/civi47 locally. After setup, the reported issues were verified, visiting all the three links specified in the overview. The option value is_locked was set to 1 to confirm add options button is still visible. Hub was setup and used in switching branch to this PR. The links were re-visited to confirm the add options button was hidden from user's view.
  • User impact (r-user)
    • PASS: The change would be intuitive or unnoticeable for a majority of users who work with this feature.

@mickadoo
Copy link
Contributor Author

mickadoo commented May 3, 2018

@colemanw any chance we could get a review for this? Willing to put in time reviewing another PR if needed

@colemanw
Copy link
Member

colemanw commented May 7, 2018

@mickadoo in the last screenshot it says "You cannot add or delete options in this list" right above items that contain a "Delete" button beside them... ?

@mickadoo
Copy link
Contributor Author

@colemanw that's a good point, it looks like this message never matched functionality. I've added 3 new commits to remove the option to delete option values for locked options groups, both in the custom field edit screen and the option group edit screen.

Copy link
Contributor

@ajesamson ajesamson left a comment

Choose a reason for hiding this comment

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

Approved

@ajesamson
Copy link
Contributor

Updates approved @mickadoo.

@colemanw
Copy link
Member

I give a Pass to the remaining items in the checklist.

@colemanw
Copy link
Member

@civicrm-builder retest this please

@eileenmcnaughton eileenmcnaughton merged commit 8fe5378 into civicrm:master May 16, 2018
mickadoo added a commit to compucorp/civicrm-core that referenced this pull request May 16, 2018
mickadoo added a commit to compucorp/civicrm-core that referenced this pull request May 16, 2018
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.

5 participants