From 439050398a744faf0a95ebdfc07646c146fb6504 Mon Sep 17 00:00:00 2001 From: Shubhamservaapty Date: Tue, 4 Feb 2025 17:54:39 +0530 Subject: [PATCH 1/2] fixed-remote-url --- src/main/ts/components/Editor.tsx | 5 ----- src/test/ts/browser/LoadTinyTest.ts | 34 ----------------------------- 2 files changed, 39 deletions(-) diff --git a/src/main/ts/components/Editor.tsx b/src/main/ts/components/Editor.tsx index b9d3876d..75c98164 100644 --- a/src/main/ts/components/Editor.tsx +++ b/src/main/ts/components/Editor.tsx @@ -309,11 +309,6 @@ export class Editor extends React.Component { } }); } - // fallback to the cloud when the tinymceScriptSrc is not specified - const channel = this.props.cloudChannel as Version; // `cloudChannel` is in `defaultProps`, so it's always defined. - const apiKey = this.props.apiKey ? this.props.apiKey : 'no-api-key'; - const cloudTinyJs = `https://cdn.tiny.cloud/1/${apiKey}/tinymce/${channel}/tinymce.min.js`; - return [{ src: cloudTinyJs, async, defer }]; } private getInitialValue() { diff --git a/src/test/ts/browser/LoadTinyTest.ts b/src/test/ts/browser/LoadTinyTest.ts index cd6e3f42..acf4c736 100644 --- a/src/test/ts/browser/LoadTinyTest.ts +++ b/src/test/ts/browser/LoadTinyTest.ts @@ -39,38 +39,4 @@ describe('LoadTinyTest', () => { assertTinymceVersion(version); }); }); - - CLOUD_VERSIONS.forEach((version) => { - it(`Should be able to load TinyMCE from Cloud (${version})`, async () => { - const apiKey = 'a-fake-api-key'; - using _ = await render({ apiKey, cloudChannel: version }); - assertTinymceVersion(version); - Assertions.assertEq( - 'TinyMCE should have been loaded from Cloud', - `https://cdn.tiny.cloud/1/${apiKey}/tinymce/${version}`, - Global.tinymce.baseURI.source - ); - }); - - it(`Should be able to load TinyMCE (${version}) in hybrid`, async () => { - using _ = await render({ - tinymceScriptSrc: [ - `/project/node_modules/tinymce-${version}/tinymce.min.js`, - `https://cdn.tiny.cloud/1/${VALID_API_KEY}/tinymce/${version}/cloud-plugins.min.js?tinydrive=${version}` - ], - plugins: [ 'tinydrive' ] - }); - assertTinymceVersion(version); - Assertions.assertEq( - 'TinyMCE should have been loaded locally', - `/project/node_modules/tinymce-${version}`, - Global.tinymce.baseURI.path - ); - Assertions.assertEq( - 'The tinydrive plugin should have defaults for the cloud', - `https://cdn.tiny.cloud/1/${VALID_API_KEY}/tinymce-plugins/tinydrive/${version}/plugin.min.js`, - (Global.tinymce.defaultOptions || Global.tinymce.defaultSettings)?.custom_plugin_urls?.tinydrive - ); - }); - }); }); From b833e851718fcd5f9e2bbe0dcb40a2fb61f9ce70 Mon Sep 17 00:00:00 2001 From: Shubhamservaapty Date: Tue, 4 Feb 2025 19:24:21 +0530 Subject: [PATCH 2/2] added config.yaml --- .github/workflows/config.yaml | 94 +++++++++++++++++++++++++++++++++++ package.json | 4 +- 2 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/config.yaml diff --git a/.github/workflows/config.yaml b/.github/workflows/config.yaml new file mode 100644 index 00000000..01ae709d --- /dev/null +++ b/.github/workflows/config.yaml @@ -0,0 +1,94 @@ +name: CI +on: + push: + branches: + - development + - qa + - staging + - production + - labs + pull_request: + branches: + - "*" + +jobs: + rules: + name: Rules + runs-on: ubuntu-latest + outputs: + branch_name: ${{ steps.validations.outputs.branch_name }} + should_deploy: ${{ steps.validations.outputs.should_deploy}} + steps: + - name: Fetch Branch Name + uses: aptyInc/gha-branch-name@master + id: validations + + lint: + name: LINT_TEST + needs: [rules] + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Caching node modules + id: modules-cache + uses: actions/cache@v2 + with: + path: "node_modules" + key: node-modules-${{ hashFiles('package.json') }} + + - name: Install node modules + if: steps.modules-cache.outputs.cache-hit != 'true' + run: npm install + + deploy: + needs: [rules, lint] + name: Deploy + runs-on: ubuntu-latest + if: ${{ needs.rules.outputs.should_deploy == 'true' }} + steps: + - uses: actions/checkout@master + - uses: actions/setup-node@v1 + + - uses: webfactory/ssh-agent@v0.4.1 + with: + ssh-private-key: ${{ secrets.SSH_KEY }} + + - name: Caching node modules + id: modules-cache + uses: actions/cache@v2 + with: + path: "node_modules" + key: node-modules-${{ hashFiles('package.json') }} + + - name: Install node modules + if: steps.modules-cache.outputs.cache-hit != 'true' + run: npm install + + - name: Building code + run: npm run build && cp package.json build/package.json + + - name: Commit code for tinymce-react + run: | + cp package.json ./build + cd build + git init + git config user.email "admin@apty.io" + git config user.name "git-ci" + git add . + git commit -m "${{needs.rules.outputs.branch_name}}-${{github.event.head_commit.message}}" -a + git remote add origin "git@github.com:aptyInc/tinymce-react.git" + git checkout -b "${{needs.rules.outputs.branch_name}}-${{ github.sha }}" + git push origin "${{needs.rules.outputs.branch_name}}-${{ github.sha }}" + notifications: + name: Notification + runs-on: ubuntu-latest + needs: [rules, deploy] + steps: + - uses: actions/checkout@master + - name: Getting user profile url + id: user_profile + uses: saiumesh535/gh-avatar-url@main + with: + username: ${{github.actor}} \ No newline at end of file diff --git a/package.json b/package.json index 9b681e08..c397e6b7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "description": "Official TinyMCE React Component", + "description": "Apty TinyMCE React component", "repository": { - "url": "https://github.com/tinymce/tinymce-react" + "url": "https://github.com/aptyInc/tinymce-react" }, "files": [ "lib",