mirror of https://github.com/nocodb/nocodb
Wing-Kam Wong
2 years ago
55 changed files with 1550 additions and 1167 deletions
@ -0,0 +1,24 @@
|
||||
version: '3' |
||||
|
||||
x-uffizzi: |
||||
ingress: |
||||
service: nocodb |
||||
port: 8080 |
||||
|
||||
services: |
||||
postgres: |
||||
image: postgres |
||||
restart: always |
||||
environment: |
||||
POSTGRES_PASSWORD: password |
||||
POSTGRES_USER: postgres |
||||
POSTGRES_DB: root_db |
||||
nocodb: |
||||
image: "${NOCODB_IMAGE}" |
||||
ports: |
||||
- "8080:8080" |
||||
restart: always |
||||
environment: |
||||
NC_DB: "pg://localhost:5432?u=postgres&p=password&d=root_db" |
||||
NC_ADMIN_EMAIL: admin@nocodb.com |
||||
NC_ADMIN_PASSWORD: password |
@ -0,0 +1,88 @@
|
||||
name: Deploy Uffizzi Preview |
||||
|
||||
on: |
||||
workflow_run: |
||||
workflows: |
||||
- "PR Release" |
||||
types: |
||||
- completed |
||||
|
||||
jobs: |
||||
cache-compose-file: |
||||
name: Cache Compose File |
||||
runs-on: ubuntu-latest |
||||
outputs: |
||||
compose-file-cache-key: ${{ env.COMPOSE_FILE_HASH }} |
||||
pr-number: ${{ env.PR_NUMBER }} |
||||
steps: |
||||
- name: 'Download artifacts' |
||||
# Fetch output (zip archive) from the workflow run that triggered this workflow. |
||||
uses: actions/github-script@v6 |
||||
with: |
||||
script: | |
||||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ |
||||
owner: context.repo.owner, |
||||
repo: context.repo.repo, |
||||
run_id: context.payload.workflow_run.id, |
||||
}); |
||||
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => { |
||||
return artifact.name == "preview-spec" |
||||
})[0]; |
||||
let download = await github.rest.actions.downloadArtifact({ |
||||
owner: context.repo.owner, |
||||
repo: context.repo.repo, |
||||
artifact_id: matchArtifact.id, |
||||
archive_format: 'zip', |
||||
}); |
||||
let fs = require('fs'); |
||||
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/preview-spec.zip`, Buffer.from(download.data)); |
||||
|
||||
- name: 'Unzip artifact' |
||||
run: unzip preview-spec.zip |
||||
|
||||
- name: Read Event into ENV |
||||
run: | |
||||
echo 'EVENT_JSON<<EOF' >> $GITHUB_ENV |
||||
cat event.json >> $GITHUB_ENV |
||||
echo 'EOF' >> $GITHUB_ENV |
||||
|
||||
- name: Hash Rendered Compose File |
||||
id: hash |
||||
# If the previous workflow was triggered by a PR close event, we will not have a compose file artifact. |
||||
if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} |
||||
run: echo "COMPOSE_FILE_HASH=$(md5sum docker-compose.rendered.yml | awk '{ print $1 }')" >> $GITHUB_ENV |
||||
|
||||
- name: Cache Rendered Compose File |
||||
if: ${{ fromJSON(env.EVENT_JSON).action != 'closed' }} |
||||
uses: actions/cache@v3 |
||||
with: |
||||
path: docker-compose.rendered.yml |
||||
key: ${{ env.COMPOSE_FILE_HASH }} |
||||
|
||||
- name: Read PR Number From Event Object |
||||
id: pr |
||||
run: echo "PR_NUMBER=${{ fromJSON(env.EVENT_JSON).number }}" >> $GITHUB_ENV |
||||
|
||||
- name: DEBUG - Print Job Outputs |
||||
if: ${{ runner.debug }} |
||||
run: | |
||||
echo "PR number: ${{ env.PR_NUMBER }}" |
||||
echo "Compose file hash: ${{ env.COMPOSE_FILE_HASH }}" |
||||
cat event.json |
||||
|
||||
deploy-uffizzi-preview: |
||||
name: Use Remote Workflow to Preview on Uffizzi |
||||
needs: |
||||
- cache-compose-file |
||||
uses: UffizziCloud/preview-action/.github/workflows/reusable.yaml@v2 |
||||
with: |
||||
# If this workflow was triggered by a PR close event, cache-key will be an empty string |
||||
# and this reusable workflow will delete the preview deployment. |
||||
compose-file-cache-key: ${{ needs.cache-compose-file.outputs.compose-file-cache-key }} |
||||
compose-file-cache-path: docker-compose.rendered.yml |
||||
server: https://app.uffizzi.com |
||||
pr-number: ${{ needs.cache-compose-file.outputs.pr-number }} |
||||
permissions: |
||||
contents: read |
||||
pull-requests: write |
||||
id-token: write |
@ -1,117 +0,0 @@
|
||||
import { expect, test } from '@playwright/test'; |
||||
import { DashboardPage } from '../pages/Dashboard'; |
||||
import setup from '../setup'; |
||||
|
||||
test.describe('Grid operations', () => { |
||||
let dashboard: DashboardPage; |
||||
let context: any; |
||||
|
||||
test.beforeEach(async ({ page }) => { |
||||
context = await setup({ page }); |
||||
dashboard = new DashboardPage(page, context.project); |
||||
}); |
||||
|
||||
test('Clipboard support', async () => { |
||||
// close 'Team & Auth' tab
|
||||
await dashboard.closeTab({ title: 'Team & Auth' }); |
||||
|
||||
await dashboard.treeView.createTable({ title: 'Sheet1' }); |
||||
|
||||
await dashboard.grid.column.create({ |
||||
title: 'Number', |
||||
type: 'Number', |
||||
}); |
||||
await dashboard.grid.column.create({ |
||||
title: 'Checkbox', |
||||
type: 'Checkbox', |
||||
}); |
||||
await dashboard.grid.column.create({ |
||||
title: 'Date', |
||||
type: 'Date', |
||||
}); |
||||
await dashboard.grid.column.create({ |
||||
title: 'Attachment', |
||||
type: 'Attachment', |
||||
}); |
||||
|
||||
await dashboard.grid.addNewRow({ |
||||
index: 0, |
||||
}); |
||||
await dashboard.grid.cell.click({ |
||||
index: 0, |
||||
columnHeader: 'Number', |
||||
}); |
||||
await dashboard.grid.cell.fillText({ |
||||
index: 0, |
||||
columnHeader: 'Number', |
||||
text: '123', |
||||
}); |
||||
await dashboard.grid.cell.click({ |
||||
index: 0, |
||||
columnHeader: 'Checkbox', |
||||
}); |
||||
|
||||
const today = new Date().toISOString().slice(0, 10); |
||||
await dashboard.grid.cell.date.open({ |
||||
index: 0, |
||||
columnHeader: 'Date', |
||||
}); |
||||
await dashboard.grid.cell.date.selectDate({ |
||||
date: today, |
||||
}); |
||||
await dashboard.grid.cell.date.close(); |
||||
|
||||
await dashboard.grid.cell.attachment.addFile({ |
||||
index: 0, |
||||
columnHeader: 'Attachment', |
||||
filePath: `${process.cwd()}/fixtures/sampleFiles/1.json`, |
||||
}); |
||||
|
||||
await dashboard.grid.cell.copyToClipboard({ |
||||
index: 0, |
||||
columnHeader: 'Title', |
||||
}); |
||||
expect(await dashboard.grid.cell.getClipboardText()).toBe('Row 0'); |
||||
|
||||
await dashboard.grid.cell.copyToClipboard({ |
||||
index: 0, |
||||
columnHeader: 'Number', |
||||
}); |
||||
expect(await dashboard.grid.cell.getClipboardText()).toBe('123'); |
||||
|
||||
await dashboard.grid.cell.copyToClipboard( |
||||
{ |
||||
index: 0, |
||||
columnHeader: 'Checkbox', |
||||
}, |
||||
{ position: { x: 1, y: 1 } } |
||||
); |
||||
await new Promise(resolve => setTimeout(resolve, 5000)); |
||||
expect(await dashboard.grid.cell.getClipboardText()).toBe('true'); |
||||
|
||||
await dashboard.grid.cell.click({ |
||||
index: 0, |
||||
columnHeader: 'Checkbox', |
||||
}); |
||||
await dashboard.grid.cell.copyToClipboard( |
||||
{ |
||||
index: 0, |
||||
columnHeader: 'Checkbox', |
||||
}, |
||||
{ position: { x: 1, y: 1 } } |
||||
); |
||||
expect(await dashboard.grid.cell.getClipboardText()).toBe('false'); |
||||
|
||||
await dashboard.grid.cell.copyToClipboard({ |
||||
index: 0, |
||||
columnHeader: 'Date', |
||||
}); |
||||
expect(await dashboard.grid.cell.getClipboardText()).toBe(today); |
||||
|
||||
await dashboard.grid.cell.copyToClipboard({ |
||||
index: 0, |
||||
columnHeader: 'Attachment', |
||||
}); |
||||
// expect(await dashboard.grid.cell.getClipboardText()).toBe('1.json');
|
||||
}); |
||||
}); |
Loading…
Reference in new issue