[Eurostep] Adapt widget-builder to multi channel (MSF) #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What? Why?
The PR wants to allow the developer to publish the widget-template to a channel different from the default channel.
Starting from the automatically created environment variable in the widget folder WIDGET_BUILDER_CHANNEL_ID, the developer can add in his local a list of channels (comma separated) where he wants to publish the template, ex:
WIDGET_BUILDER_CHANNEL_ID=1,2
The change in the library removes the hardcoding to the default channel, and runs the publish for each channel inserted in the .env variable.
We preferred to manage it from the .env variable instead of using options since it's common to publish and update the widgets to every available channels during the project (so the dev shouldn't have to add options like --c=1,2 for every push, but instead change the the .env when he needs to do something different from the daily routine).
For any doubts about the implementation please send an email to:
Testing / Proof
The PR doesn't include implementations in the test files, ofc it is tested and working on Eurostep Commerce stores.
TBAdded: there is no check if the channel exists on the publish, if a channel doesn't exist the dev will receive a successful message even if nothing was published (since the channel id is not existent)