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

Adds confirmation when changing segments definition #10199

Merged
merged 5 commits into from Jul 16, 2016
Merged

Adds confirmation when changing segments definition #10199

merged 5 commits into from Jul 16, 2016

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented May 31, 2016

Saving a changed segment definition will now trigger a confirmation:

image

Maybe there's a better text to show. Suggestions welcome

fixes #9984

@sgiehl sgiehl added the Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. label May 31, 2016
@sgiehl sgiehl added this to the 2.16.2 milestone May 31, 2016
@sgiehl sgiehl added c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels May 31, 2016
@adaqus
Copy link

adaqus commented Jun 9, 2016

Looks ok 👍

Though maybe it would be better to change 'segment-change-confirm' to 'segment-definition-change-confirm' and 'ChangingSegmentConfirmation' to 'ChangingSegmentDefinitionConfirmation' to point out this functionality concerns segment definition change?

@sgiehl
Copy link
Member Author

sgiehl commented Jun 13, 2016

@adaqus thanks for the comment. I've changed the name/id as you suggested.

@mattab is the message for the confirmation fine or should it be changed? If not, I would merge this PR.

@mattab
Copy link
Member

mattab commented Jul 8, 2016

Review:

  • let's add a UI test for this use case, so it won't regress
  • change text to: You're about to change the segment definition. Your analytics reports for this new segment won't be available until the reports are re-processed. It may take a few hours for reports data to show for this segment. Proceed anyway?

@sgiehl
Copy link
Member Author

sgiehl commented Jul 8, 2016

@sgiehl sgiehl added the PP label Jul 8, 2016
@mattab
Copy link
Member

mattab commented Jul 11, 2016

just realised we can make things a bit more clear and reduce some possible confusion from the wording:

  • if( ! Rules::isRequestAuthorizedToArchive() || globalConfig.General.browser_archiving_disabled_enforce ) then print the message Your analytics reports for this new segment won't be available until the reports are re-processed. It may take a few hours for reports data to show for this segment..
  • Otherwise (ie. case where reports will be processed in the browser), maybe write Your analytics reports for this new segment will be re-processed the next time you request them, which may take some time.

(the if statement logic reproduces some sub logic of Rules::isArchivingDisabledFor() and can be added as a method there)

After this change LGTM and feel free to merge!

@sgiehl
Copy link
Member Author

sgiehl commented Jul 12, 2016

@mattab I've tried to implement your suggestion. Not sure if I got that correct. Would you please have a look at cd05517
If it's correct, feel free to merge,

Note: We need to update the UI test screenshot afterwards

@mattab
Copy link
Member

mattab commented Jul 12, 2016

Review:

  • just saw again that our segments can individually be set to be pre-processed only, so let's make the message variant depending on the segment.auto_archive as well
  • after clicking Proceed Anyway -> No, then editing the segment and clicking Save again, nothing happens (no popup, no save).
  • If users often edit segments, the message may get a bit too much... I'm wondering whether:
    • we could hide the message completely when browser archiving is available for this segment?
    • or maybe we could add a check box [ ] Hide this notice in the future that would be saved in the user preference?

@@ -6,6 +6,8 @@
"AreYouSureDeleteSegment": "Are you sure you want to delete this segment?",
"AutoArchivePreProcessed": "segmented reports are pre-processed (faster, requires cron)",
"AutoArchiveRealTime": "segmented reports are processed in real time",
"ChangingSegmentDefinitionConfirmationNotProcessedOnRequest": "You're about to change the segment definition. Your analytics reports for this new segment won't be available until the reports are re-processed. It may take a few hours for reports data to show for this segment. Proceed anyway?",
Copy link
Member

Choose a reason for hiding this comment

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

maybe refactor in separate translation strings the You're about to change the segment definition. and Proceed anyway? ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure we could do that. But maybe it's better to have complete messages as one string. That prevents from having only parts of it translated, which would look very ugly in the UI I think.

@sgiehl
Copy link
Member Author

sgiehl commented Jul 13, 2016

just saw again that our segments can individually be set to be pre-processed only, so let's make the message variant depending on the segment.auto_archive as well

I'm a bit confused now. What will happen when the segment setting and the config setting differ? Will a segment not be processed at all if I choose real time processing for the segment, but have a config setting enforcing not to do it? (or vice versa)

@mattab
Copy link
Member

mattab commented Jul 13, 2016

What will happen when the segment setting and the config setting differ? Will a segment not be processed at all if I choose real time processing for the segment, but have a config setting enforcing not to do it? (or vice versa)

If a segment is set to real time processing, but browser archiving (real time processing) is disabled in the UI, and enforced via General.browser_archiving_disabled_enforce=1 in config, then the segment will be processed in the next core:archive run (via crontab).

FYI: if a segment is set to "real time processing" but the browser archiving is disabled and enforced, then the data for the segment cannot be processed, and we show this popup:

segment not applied

@mattab mattab removed the PP label Jul 14, 2016
@sgiehl
Copy link
Member Author

sgiehl commented Jul 14, 2016

New attempt ;) Confirmation should now also work as expected (more than once). Message now also depends on segments auto-archive option, but will only be displayed if browser archiving is not available.
I've also implemented an checkbox to hide the message in the future.

@mattab
Copy link
Member

mattab commented Jul 15, 2016

If a segment is set to real time processing, but browser archiving (real time processing) is disabled in the UI, and enforced via General.browser_archiving_disabled_enforce=1 in config, then the segment will be processed in the next core:archive run (via crontab).

fyi: after double checking what I wrote yesterday I realised it wasn't actually working this way. Created bug report: #10307 and PR: #10309

@sgiehl
Copy link
Member Author

sgiehl commented Jul 15, 2016

Ok I'll have a look at your PR. What about this one? Did you have another look? Can we merge?

@sgiehl sgiehl merged commit 1dd78c2 into matomo-org:master Jul 16, 2016
@sgiehl sgiehl deleted the PCC-7 branch July 16, 2016 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Usability For issues that let users achieve a defined goal more effectively or efficiently. Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants