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

Add possiblity to open sites manager and directly edit a specific site using URL parameter #17726

Merged
merged 5 commits into from Jul 1, 2021

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Jun 29, 2021

Description:

Needed for some plugin. Adding &editsiteid=\d+ should open the specified site directly. There may be edge cases where multiple sites match a searched number maybe but that be edge case as it likely would be only an issue if > 10 sites matched the specified number. Basically, the URL parameter triggers a search for that number / idsite and the site will be opened directly.

Review

  • Functional review done
  • Potential edge cases thought about (behavior of the code with strange input, with strange internal state or possible interactions with other Matomo subsystems)
  • Usability review done (is anything maybe unclear or think about anything that would cause people to reach out to support)
  • Security review done see checklist
  • Code review done
  • Tests were added if useful/possible
  • Reviewed for breaking changes
  • Developer changelog updated if needed
  • Documentation added if needed
  • Existing documentation updated if needed

@tsteur tsteur marked this pull request as draft June 29, 2021 22:19
@tsteur tsteur added the Needs Review PRs that need a code review label Jun 29, 2021
@tsteur tsteur added this to the 4.4.0 milestone Jun 29, 2021
@tsteur tsteur marked this pull request as ready for review June 29, 2021 22:51
@diosmosis
Copy link
Member

Works for me locally. I'm wondering if we should remove the editsiteid parameter after the user finished editing, otherwise the parameter might stick around and open the same site the next time they visit the manage measurables page.

@tsteur
Copy link
Member Author

tsteur commented Jul 1, 2021

good point @diosmosis 👍 changed it and also refactored slightly to have less duplicated code.

To be able to change the URL I had to move the id from a search query parameter to a hash so I can remove it without reloading the page. When saving or canceling then I remove the hash but not removing the search query as it's tricky to do and not really needed for now as this link will be used extremely rare. People can in worst case always click on left menu again to get all sites I reckon.

@diosmosis diosmosis merged commit bb7abdb into 4.x-dev Jul 1, 2021
@diosmosis diosmosis deleted the editsiteid branch July 1, 2021 01:05
@mattab mattab added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants