Add Grist dataset-review surface to cockpit-admin#77
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Grist dataset-review surface to the cockpit-admin SPA by embedding a configurable Grist review doc in a new route and vendoring a companion “review-console” widget under /review-console/ for use as a Grist custom widget.
Changes:
- Add
/review-datasetsroute (with “not configured” fallback) and a “Review” nav link in the admin header. - Vendor the
review-consolestatic widget into the admin build output and adjust nginx routing to return real 404s for missing/review-console/*assets. - Thread
VITE_GRIST_URLthrough typing, Docker build args, and deployment env templates; add route-level tests.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| Dockerfile | Adds VITE_GRIST_URL build arg/env so Vite can bake the Grist URL into the admin build. |
| deploy/nginx/spa.conf | Adds /review-console/ location to avoid SPA fallback for missing widget assets. |
| deploy/docker-compose.yml | Passes VITE_GRIST_URL into the admin image build args. |
| deploy/.env.example | Documents VITE_GRIST_URL for deployments. |
| apps/cockpit-admin/tests/review-datasets.test.tsx | Adds tests for iframe vs. fallback behavior based on VITE_GRIST_URL. |
| apps/cockpit-admin/src/vite-env.d.ts | Types import.meta.env.VITE_GRIST_URL. |
| apps/cockpit-admin/src/routeTree.gen.ts | Registers the new /review-datasets route in the generated route tree. |
| apps/cockpit-admin/src/routes/review-datasets.index.tsx | Implements the Grist iframe route + fallback message. |
| apps/cockpit-admin/src/routes/__root.tsx | Adds “Review” link to the top navigation. |
| apps/cockpit-admin/public/review-console/index.html | Adds the vendored Grist custom-widget HTML/JS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+15
to
+18
| # Review-console vendored widget — real 404 on missing files, no SPA fallback | ||
| location /review-console/ { | ||
| try_files $uri $uri/ =404; | ||
| } |
Comment on lines
+19
to
+24
| return ( | ||
| <iframe | ||
| title="Grist dataset review" | ||
| src={gristUrl} | ||
| className="h-[calc(100vh-6rem)] w-full border-0" | ||
| /> |
Comment on lines
+48
to
+49
| const REVIEWER = "clems"; // adjust to the reviewer's Grist choice value | ||
|
|
Comment on lines
+10
to
+14
| vi.stubEnv('VITE_GRIST_URL', 'https://grist.saillant.cc/o/docs/abc'); | ||
| render(<ReviewDatasetsPage />); | ||
| const frame = screen.getByTitle('Grist dataset review'); | ||
| expect(frame.tagName).toBe('IFRAME'); | ||
| expect(frame).toHaveAttribute('src', 'https://grist.saillant.cc/o/docs/abc'); |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Surfaces a Grist dataset-review experience inside the
cockpit-adminSPA (served at
admin.ailiance.frbehind Keycloak SSO):review-consolewidget intopublic/review-console/so the Vite build publishes it at
/review-console/./review-datasetsroute embedding the Grist review doc in an<iframe>, with a graceful "not configured" fallback when the URL isunset, plus a
Reviewnav link.VITE_GRIST_URLenv var throughvite-env.d.ts, the rootDockerfile, anddeploy/docker-compose.yml(documented in
deploy/.env.example).location /review-console/block so the vendoredwidget returns a real 404 instead of the SPA shell on missing files.
7 commits, each spec-reviewed; final holistic review verdict
MERGE-READY.
Test plan
pnpm test— 45/45 green (14 files), including 2 new tests forthe route (iframe rendered when
VITE_GRIST_URLset; fallback shownwhen unset)
pnpm build— succeeds; widget lands indist/review-console/;/review-datasetsregistered in the route treeVITE_GRIST_URLinthe deployment env, rebuild & redeploy
cockpit-adminhttps://admin.ailiance.fr/review-console/index.html