Conversation
lib/_config/router.js
Outdated
| }; | ||
|
|
||
| Router.onBeforeAction(function() { | ||
| var configRequired = Meteor.call('checkRequiredSettings'); |
There was a problem hiding this comment.
Since this code is relying on a server method, it is asynchronous. So, we need to handle the return value from checkRequiredSettings in a callback:
// Instead of
// var configRequired = Meteor.call("checkRequiredSettings");
// It should read
// Get a named reference to current router
// for use inside the server method callback
const currentRouter = this;
Meteor.call("checkRequiredSettings", function (error, result) {
// if error....
// throw error message
// check the result of the method call
if (result === false) {
// If checkRequiredSettings returns false
Router.go("settingsWizard");
} else {
// call this.next() using the currentRouter variable from above
currentRouter.next()
}
});|
Good work so far. Just a couple of minor details to catch at this point. |
| }, | ||
| 'click #save-settings': function() { | ||
| // when configuration is done, call server method to set initialSetupComplete to true, so that the settings alert is no longer shown | ||
| Meteor.call("initialSetupCompleteTrue"); |
There was a problem hiding this comment.
Move this method call to the AutoForm.onSuccess callback.
|
@brylie I made the changes you suggested. However, I made a slight change in the logic - I have introduced a new field I have also removed the alert logic from the master layout file. Currently the alert is not being shown anywhere. Please review. |
|
Ok, make sure that the problem is not related to meteor restarting when editing the project sourcecode. I.e. If you take the collection approach, be sure to create a publication that only publishes the |
|
I made the changes. |
|
Great! :-) Is this ready for review/merge? |
|
@brylie Yes, this is ready for review. |
|
@Alapan project stop works for me if I do |
24140db to
95387ca
Compare
|
@shaliko I made a small change. Could you please test and let me know if you are still getting the same error? |
|
When starting Apinf without any settings, i.e. without the One goal of this task is that Apinf should start with no initial settings, so the Wizard can display. |
|
It seems like
|
|
We cannot figure out how to get the settings wizard to display. |
|
Currently, after running Also, even after configuring the settings successfully, the following errors are being seen in the console:
|
|
Ah, yes. We had the same validation issue, possibly because of the port number. As a second thought, it is probably unnecessary to provide the HOST value for the Apinf platform, since Meteor is already aware of this value, so lets deprecate that from the setup wizard/settings. |
|
@frenchbread, what is your recollection of why we add the |
|
@Alapan regarding the 'clientId' and 'username' errors, we need to check the existance of these fields before trying to use them. Try commenting out lines 11 and 24 of |
|
@Alapan and @shaliko Could you do some pair programming on this one to try solve the issues Alapan is facing? Sometimes even just explaining the problem to someone else might already help. Shaliko is not available 9 May, but should be back at work 10 May. |
|
I tried commenting the lines as @brylie suggested, but it didn't help. Please note, there was no problem in running the application - just that those 2 TypeErrors are present after filling in the settings details. |
|
Ah, I understand now. Are they happening when you submit the form? It may still be a validation problem, where the schema is not passed in the fields it needs for validation. |
|
@shaliko are you available today to help troubleshoot this task? |
|
@brylie Today joining to this task. |
…ecion before calls
e3756c4 to
9d187c3
Compare
|
@frenchbread Done. |
|
@frenchbread As discussed I assign myself to check out this as you have work on the other PR. |
|
@Alapan Reviewing |
Closes #922
Important changes:
initialSetupComplete. If this returnsfalse, an initial setup wizard is to be shown.