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

Task/cu 86942hp4v/7 shop create retail plugin for gg #69

Merged

Conversation

thedev966
Copy link
Contributor

@thedev966 thedev966 self-assigned this Mar 14, 2024
@thedev966 thedev966 requested a review from a team as a code owner March 14, 2024 15:04
@nsoft-bot
Copy link

@sonarqubepr-nsoft

This comment has been minimized.

@sonarqubepr-nsoft
Copy link

Failed

  • 0.00% Coverage on New Code (is less than 80.00%)

Analysis Details

6 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 6 Code Smells

Coverage and Duplications

  • Coverage 0.00% Coverage (0.00% Estimated after merge)
  • Duplications 0.00% Duplicated Code (10.90% Estimated after merge)

Project ID: seven-gravity-gateway

View in SonarQube

Copy link
Member

@dev387 dev387 left a 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.

src/plugin/retail.js Show resolved Hide resolved
@ZvonimirBusic ZvonimirBusic requested a review from Lanchi March 15, 2024 07:26
@Lanchi
Copy link
Member

Lanchi commented Mar 15, 2024

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.

@thedev966
Copy link
Contributor Author

thedev966 commented Mar 15, 2024

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.

@thedev966 thedev966 requested a review from dev387 March 15, 2024 09:33
@thedev966 thedev966 merged commit a6697eb into master Mar 15, 2024
2 of 3 checks passed
};

Retail.prototype.onLoad = function(slave, loadData) {
loadData.data.settings.preventKeys.forEach(function(key) {
Copy link
Collaborator

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

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

Copy link
Contributor Author

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..

@thedev966 thedev966 mentioned this pull request Mar 21, 2024
@ZvonimirBusic ZvonimirBusic deleted the task/CU-86942hp4v/7Shop---Create-Retail-plugin-for-GG branch October 31, 2024 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants