-
Notifications
You must be signed in to change notification settings - Fork 0
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
Task/cu 86942hp4v/7 shop create retail plugin for gg #69
Task/cu 86942hp4v/7 shop create retail plugin for gg #69
Conversation
Task linked: CU-86942hp4v 7Shop - Create Retail plugin for GG |
This comment has been minimized.
This comment has been minimized.
Analysis Details6 IssuesCoverage and DuplicationsProject ID: seven-gravity-gateway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also try to fix SonarQube errors: Unexpected var, use let or const instead.
Does this means that slave would now have to initialize GG like: import Gateway from '@nsoft/seven-gravity-gateway/slave';
import BarcodeScanPlugin from '@nsoft/seven-gravity-gateway/plugin-barcode-scan';
import RetailPlugin from '@nsoft/seven-gravity-gateway/retail';
Gateway({
...
plugins: [new BarcodeScanPlugin(), new RetailPlugin()]
...
}); @dikaso we mentioned that it would be nice to 'bundle up' necessary plugins for retail app to Retail plugin (i.e. other plugins like barcode would be implicitly initialized from Retail plugin). Could this be done in this PR so slave would in the end only need to do Gateway({
...
plugins: [new RetailPlugin()]
...
}); Also, @thedev966 please add appropriate documentation regarding this new plugin. |
We'll bundle up plugins in the next task. Updated wiki to include section for Retail plugin. |
}; | ||
|
||
Retail.prototype.onLoad = function(slave, loadData) { | ||
loadData.data.settings.preventKeys.forEach(function(key) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If preventKeys
is not sent for some reason this will throw error. @thedev966
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dikaso It's possible case? Okay, I'll add some check in this next task I'm on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so. It is not required to set preventKeys
for a tenant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But, we will always set preventKeys
, by default empty array, and override settings per tenant when needed. forEach
shouldn't throw any error..
References:
https://app.clickup.com/t/86942hp4v