-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
1,905 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,39 @@ | ||
name: Vercel Production Deployment | ||
name: Production Deployment | ||
|
||
env: | ||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
Deploy-Production: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install Dependencies | ||
run: npm install | ||
|
||
- name: Build React App | ||
run: npm run build | ||
|
||
- name: Install Vercel CLI | ||
run: npm install --global vercel@latest | ||
|
||
- name: Pull Vercel Environment Information | ||
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | ||
- name: Build Project Artifacts | ||
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | ||
|
||
- name: Deploy Project Artifacts to Vercel | ||
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} | ||
run: vercel deploy --prod --token=${{ secrets.VERCEL_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
class NepflowWidget { | ||
constructor() { | ||
this.baseUrl = 'http://localhost:5173/'; | ||
} | ||
|
||
load(elementId, params) { | ||
const widgetElement = document.getElementById(elementId); | ||
if (!widgetElement) { | ||
console.error('Integration widget element not found.'); | ||
return; | ||
} | ||
|
||
// Create URLSearchParams from the params object | ||
const searchParams = new URLSearchParams(); | ||
for (const [key, value] of Object.entries(params)) { | ||
searchParams.append(key, value.toString()); | ||
} | ||
|
||
// Create the iframe element | ||
const iframe = document.createElement('iframe'); | ||
iframe.src = `${this.baseUrl}?${searchParams.toString()}`; | ||
iframe.style.width = '100%'; | ||
iframe.style.height = '100%'; | ||
iframe.frameBorder = '0'; | ||
|
||
// Append the iframe to the integration-widget element | ||
widgetElement.innerHTML = ''; | ||
widgetElement.appendChild(iframe); | ||
|
||
// Handler for messages from the iframe | ||
window.addEventListener('message', (event) => { | ||
if (event.origin !== this.baseUrl) { | ||
console.debug('[Nepflow] Received message from unknown origin:', event.origin); | ||
return; | ||
} | ||
|
||
console.debug('[Nepflow] Received message:', event.data); | ||
}); | ||
} | ||
} | ||
|
||
window.nepflow = new NepflowWidget(); |
Oops, something went wrong.