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

After Updating/Deleting/Adding a segment, force a refresh of the dashboard #10969

Merged
merged 1 commit into from Dec 6, 2016

Conversation

mattab
Copy link
Member

@mattab mattab commented Dec 6, 2016

the refresh is currently needed for not only this one bug, but other bugs as well. The Segmentation editor JS was not implemented in a modern way and segment listing is buggy without the page reload after a change to segments.

Later sometime we'll rewrite the Segment Editor in AngularJS later so this reload will not be needed and the segment editor will be responsive and easy to use on mobile.

fixes #10626
Reverting 5daf6c2
part of 0c9c30b

…board

the refresh is  currently needed for several reasons as the Segmentation editor is not coded properly and does not just work without the page reload.
 Ideally we'll rewrite the Segment Editor in AngularJS later so this reload will not be needed.

fixes #10626
Reverting 5daf6c2
part of 0c9c30b
@mattab mattab added 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. labels Dec 6, 2016
@mattab mattab added this to the 3.0.0-rc milestone Dec 6, 2016
} else {
return broadcast.propagateNewPage('segment=' + segmentDefinition, true);
}
return broadcast.propagateNewPage('segment=' + segmentDefinition, true);
Copy link
Member

@tsteur tsteur Dec 6, 2016

Choose a reason for hiding this comment

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

Doesn't this always do a reload? Also when not editing segment?

Copy link
Member

Choose a reason for hiding this comment

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

This would be a big downside

Copy link
Member Author

Choose a reason for hiding this comment

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

yes this is what we need to do, force a page reload to ensure the state of segment editor is valid

Copy link
Member Author

Choose a reason for hiding this comment

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

It is a big downside that when adding/updating segments the page will reload. But we can't afford to introduce other bugs in this release. maybe we can patch the editor to work well without reload in 3.1 or so (without doing full rewrite which we can't do at this time).

Good thing is that changing segments still load fast..

Copy link
Member

Choose a reason for hiding this comment

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

I haven't tested it but looks like it would also do a reload when changing the segment. If that's the case it would be no good.

What are the bugs? maybe it would be a simple fix instead of just reverting it?

Copy link
Member Author

Choose a reason for hiding this comment

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

One bug is #10626 and another I found while testing, that segment attributes such as "Available to all users" are not restored when re-editing the segment right after, causing actually a user editing multiple times a segment to lose some changes if not careful. Would be really great to have in 3.0.x even!

@mattab mattab merged commit 401977c into 3.x-dev Dec 6, 2016
@mattab mattab deleted the 10626 branch December 6, 2016 11:01
@tsteur
Copy link
Member

tsteur commented Dec 6, 2016

I wouldn't say anything if it was only when adding or deleting, but this is also when switching a segment and this hugely decreases the usability and performance etc.

@mattab
Copy link
Member Author

mattab commented Dec 6, 2016

Yes definitely agree... will try to work on this later today #10972

tsteur added a commit that referenced this pull request Dec 14, 2016
mattab pushed a commit that referenced this pull request Dec 15, 2016
* Revert "After Updating/Deleting/Adding a segment, force a refresh of the dashboard (#10969)"

This reverts commit 401977c.

* do not reload page when applying a segment

* Fix JS error when segment name contains %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Segments created in Piwik 3, appear with creator 'undefined' instead of the username
2 participants