0.3.0 • Published 10 months ago

@vtex/admin-instore-utils v0.3.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
10 months ago

Admin inStore Utils

Export utils callbacks so admin can call and inStore can do a custom logic based on it.

How to include a new account on the Admin Allow List

Step 1 - Go to the file containing the allow list

Go to the file that contains the allow list of accounts on this Github: react/validator/inStoreConstants.ts

Step 2 - Open a Pull Request with your change

Click on the edit this file:

npm.io

Add your new account in the end of the variable ALLOW_LIST in the format 'accountName', just like in this example that I added 'imaginarium',:

npm.io

Just like the image change the default option below Commit changes to be: Create a new branch for this commit and start a pull request..

And name your Pull Request's branch to be: feature/add-accountName just like I did above with the name feature/add-imaginarium.

Finally click on the "Propose changes" button and after on the "Create pull request" button.

Step 3 - Merge your PR

Now you are on your PR (Pull Request) page.

Select the option patch on the VTEX IO Bot just like below:

npm.io

And click the "Merge pull request" button

Step 4 - Install on the account the new app version

After merging the PR it generated a version, let's say for example: vtex.admin-instore-utils@0.0.5

To install on the workpace master of your accountName go to (replace accountName for the real account you just added to the allow list and 0.0.5 with the real version generated from your PR): https://accountName.myvtex.com/admin/apps/vtex.admin-instore-utils@0.0.5/install/

Click on the install button and confirm on the popup.

After this the version is installed and you can test accessing https://accountName.myvtex.com/admin with a sales associate email.

Step 5 - For this rule to be on the backend also

Finally to block on the backend, you need to:

  • Clone this repository if not already
  • Run the command yarn release && sh ./scripts/npm-publish.sh on the root of this project so it can generate a version on npm
  • Then you need to open an PR to https://github.com/vtex/admin-iframe updating the dependency to the new version generated by the previous command. To update the dependency clone this admin-iframe project, enter the node folder (cd node) and run: yarn add @vtex/admin-instore-utils

An example of a PR (needs to include CHANGELOG, change to node/package.json with the new version and change to node/yarn.lock after you ran the previously yarn add command): https://github.com/vtex/admin-iframe/pull/31/files

npm.io

If you want to use the IO CLI to first install on a workspace

You can use the VTEX IO CLI (installation instructions here) to install the new version with the commands (replace accountName for the real account you just added to the allow list and workspace for the workspace name you normally use like your personal last name):

vtex login accountName
vtex use workspace
vtex workspace reset -p
vtex install vtex.admin-instore-utils
vtex install vtex.admin-iframe

Than test on https://workspace--accountName.myvtex.com/admin if the blocking is happening before moving on.

If it worked on a workspace, it will work on https://accountName.myvtex.com/admin as well.

Finally to promote this version to this final url execute:

vtex workspace promote
0.3.0

10 months ago

0.2.10

1 year ago

0.2.6

2 years ago

0.2.2

2 years ago

0.2.1-beta.0

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago