VirtoCommerce / vc-module-marketing

Marketing module: promotions and dynamic content
Other
9 stars 11 forks source link

Added extensibility point to prepare data for changed promotion #227

Closed asvishnyakov closed 6 months ago

asvishnyakov commented 7 months ago

Description

Marketing module scripts do some additional work after loading promotion, such as transforming coupons or preparing dynamic expression blocks, including loading additional data for categories and products. This change moves this code into additional function which can be called if promotion was created or changed outside of the blade and then passed to it.

In module:

initialzieBladeData(data)

...

function initializeBladeData(data)
{
  ...
  blade.prepareData(data)
  ...
}

From outside:

api.update(options, function (data) // created or updated promotion
{
  blade.parentBlade.prepareData(data).then(function () {
    blade.parentBlade.currentEntity = data;
  });
});

References

QA-test:

Jira-link:

Artifact URL:

https://vc3prerelease.blob.core.windows.net/packages/VirtoCommerce.Marketing_3.807.0-pr-227-be37.zip

vc-ci commented 7 months ago

Reveiw task created: https://virtocommerce.atlassian.net/browse/VCST-902

sonarcloud[bot] commented 6 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud