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

Framework: re-added the missing duration property for notices #3063

Merged
merged 1 commit into from
Feb 10, 2016

Conversation

klimeryk
Copy link
Contributor

@klimeryk klimeryk commented Feb 4, 2016

It seems that during the move to global notices, the duration got lost in the process.

/cc @artpi

@klimeryk klimeryk added Framework [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. Components labels Feb 4, 2016
@klimeryk klimeryk self-assigned this Feb 4, 2016
@artpi
Copy link
Contributor

artpi commented Feb 4, 2016

@klimeryk : I'm not quite sure this prop was there.
Seems like it is only for old notice 'system'
But even when this prop would have been there, the notices wouldnt use it, because I moved the handling of duration to notice component in PR:
#2711

So, by the look of it, it could have been broken for a long time.

If you have reproduction path for the bug it solves, it would be helpful :)

@klimeryk
Copy link
Contributor Author

klimeryk commented Feb 5, 2016

I stumbled upon this bug when working on #2262. But you can pick any notices.success in Calypso, add the duration option and test it with and without this patch:

notices.success( 'Doing some testing.', { duration: 5000 } );

Without this patch, the notice is never dismissed. With this patch, it's dismissed after the specified duration.
Looking at the old notices system, the duration option was definitely supported (not sure if it was used anywhere in the actual app though). As I understand it, the old notices system now goes through your global-notices (by listening on its store). And then the render function renders the notices - first the ones from the old system, then from the new one. And in the first part, there's no duration mapping (probably more properties are missing, looking at this list). This PR adds that property - I don't see why it shouldn't work - since the same component is using it few lines below.
I'm sure you know all this, since it's your code :D But I wanted to make sure I understand it correctly too - please correct me if got something wrong.

@gwwar
Copy link
Contributor

gwwar commented Feb 10, 2016

🚢

@gwwar gwwar added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Feb 10, 2016
klimeryk added a commit that referenced this pull request Feb 10, 2016
…ices

Framework: re-added the missing duration property for notices
@klimeryk klimeryk merged commit c284886 into master Feb 10, 2016
@klimeryk klimeryk deleted the fix/missing-duration-for-notices branch February 10, 2016 00:38
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.

4 participants