Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Move feedback formatting to alert service + make documentediting use it #112

Merged
merged 2 commits into from
Jan 21, 2016

Conversation

asaunier
Copy link
Member

Please note that errors triggered when trying to save a document without being authenticated cannot be managed the right way because the API does not return a correct error message, see c2corg/v6_api#85

@asaunier asaunier mentioned this pull request Jan 19, 2016
25 tasks
@asaunier
Copy link
Member Author

The main changes of this PR are:

  • formatErrorMsg_ and filterStr_ functions are moved to the alerts service since useful for most alerts (not only auth alerts).
  • the documentediting tool + the logout button also use the alerts service.

@asaunier
Copy link
Member Author

Any objection?

@asaunier
Copy link
Member Author

Could anyone review this PR please?
I need it for PR #116

@@ -58,7 +58,7 @@ appx.SearchDocumentLocale;

/**
* @typedef {{
* msg: string,
* msg: (string|Object),
Copy link
Member

Choose a reason for hiding this comment

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

@gberaudo would want a type for this. ;)

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, I also expected @gberaudo would say something here :p
That would make sense indeed, especially since the alerts service expects this is a response object with a response['data']['errors'] property. But are the API responses always formatted the same way? I'm also afraid that the type is a bit complicated.

@tsauerwein
Copy link
Member

Two small comments, otherwise it looks ok.

* @private
*/
app.Alerts.prototype.formatErrorMsg_ = function(response) {
var errors = response['data']['errors'],
Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps I should add an assert here to make sure that response['data']['errors'] is available.

@asaunier
Copy link
Member Author

Two small comments, otherwise it looks ok.

Thanks for reviewing @tsauerwein !
I will make the few changes I have just mentioned and will merge if there is no other objections.

asaunier added a commit that referenced this pull request Jan 21, 2016
Move feedback formatting to alert service + make documentediting use it
@asaunier asaunier merged commit 637d903 into master Jan 21, 2016
@asaunier asaunier deleted the alert-feedbacks branch January 21, 2016 09:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants