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

Clicking "no" in users manager when changing permission doesn't reset the role setting #20531

Closed
tsteur opened this issue Mar 30, 2023 · 4 comments · Fixed by #20535
Closed
Assignees
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Mar 30, 2023

Context

When selecting "no" when editing a user role in Matomo admin it doesn't change back the role setting.

image

Steps to Reproduce (for Bugs)

  • Go to users manager
  • Click on Edit a user
  • Change the role, eg from No access to Write
  • Click on "No"
    --> It will keep the newly selected role . It looks like the role was changed despite clicking on "No" (or maybe it actually even did change it)

Expected Behavior

--> It should switch back to the previously role that the user actually has.

@tsteur tsteur added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Mar 30, 2023
@sgiehl sgiehl added Regression Indicates a feature used to work in a certain way but it no longer does even though it should. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Mar 30, 2023
@sgiehl
Copy link
Member

sgiehl commented Mar 30, 2023

It doesn't set the role, but it indeed doesn't reset the select when clicking 'no'. To me this looks like a regression from the vue migration.

@sgiehl sgiehl added this to the 5.0.0 milestone Mar 30, 2023
@sgiehl
Copy link
Member

sgiehl commented Mar 30, 2023

@diosmosis It looks like the code actually does try to reset the value, but the select box isn't updated correctly. Do you maybe have a quick idea how to fix this?

@diosmosis
Copy link
Member

@sgiehl this is the vue issue where if we don't modify the model value, it still keeps the changed value in the input, because vue won't detect the lack of a change. It was worked around w/ this: https://github.com/matomo-org/matomo/blob/5.x-dev/plugins/CorePluginsAdmin/vue/src/FormField/FieldText.vue#L76-L87 (using an "abortable" modifier, and then doing event.abort() in the case we don't actually want to change anything). There's an example of it's use in ManageFunnel.vue.

I can fix this if desired, but it will be a couple days before I am able.

@sgiehl
Copy link
Member

sgiehl commented Mar 30, 2023

@diosmosis Thanks for the hint. I did remember that there was a similar problem, but couldn't remember how we solved it. Will try to propose a fix myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants