[![Internal Docs](https://shields.io/badge/-Internal_Docs-f41963)](https://internal-docs.vtex.com/Admin/admin-iframe-compatibility/)

<p align="center">
  <img alt="VTEX Admin" src="./assets/vtex-logo.svg" height="100" width="117" />
  <h3 align="center">VTEX Admin Iframe Compatibility</h3>
  <p align="center">Reach us on #team-admin channel on Slack | Tag us with @dev-team-admin on Slack</p>
</p>

---

## There is nothing glamorous to see here

This package is just a static JS with jquery code that runs on catalog admin pages. It is responsible for handling translations for legacy applications, messaging the admin shell to adapt its iframe container height to match its children height, and initializing Crowdin in Context script for legacy apps.

## Developing locally

- Setup:

```bash
npm install
```

- You will need the requestly chrome extension [linked here](https://chrome.google.com/webstore/detail/requestly-redirect-url-mo/mdnleldcmiljblolnjhpnblkcekpdkpa)

- Open requestly, and create Redirect Rules with the following semantics:

```
Request URL Contains /npm/admin-iframe-compatibility/index.js
Destination http://localhost:4200/index.js

Request URL Contains /npm/admin-iframe-compatibility/cms-iframe.js
Destination http://localhost:4200/cms-iframe.js
```

- Save the rules and leave it on
- Run the server
  ```bash
  npm start
  ```
- Edit the JS, save it, run `npm start` again and refresh the admin page to see your changes.

## Publishing a new version

Just run:

```bash
npm run deploy
```

or

```bash
npm run deploy:beta
```

A github workflow will be automatically triggered once new tags are pushed to the repository.
