feat: always show curl export option in non-production environments#4768
feat: always show curl export option in non-production environments#4768MillenniumFalconMechanic merged 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Updates AnVIL curl-export behavior to be environment-aware so that curl export is always visible in non-production environments while retaining NRES/Unrestricted access gating in production, and adds route-level guards to prevent accessing curl-download pages in production when the required consent groups aren’t present.
Changes:
- Added
isProductionEnvironment()utility based onNEXT_PUBLIC_SITE_CONFIG. - Updated AnVIL CMG curl export visibility to always render in non-production environments.
- Added production-only runtime 404 guards for curl download routes/pages when NRES/Unrestricted access consent groups are absent.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
app/config/utils.ts |
Adds isProductionEnvironment() helper used for environment-aware behavior. |
app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.tsx |
Updates cohort/dataset curl export conditional rendering to always show in non-prod. |
pages/export/get-curl-command.tsx |
Adds production-only runtime guard to render 404 without NRES/Unrestricted access in current selection (AnVIL). |
pages/[entityListType]/[...params].tsx |
Adds production-only runtime guard for dataset curl download routes based on dataset consent group. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Adds environment-aware behavior for AnVIL curl export so it’s always visible in non-production environments while remaining restricted in production unless NRES/Unrestricted access consent groups are present.
Changes:
- Introduces
isProductionEnvironment()based onNEXT_PUBLIC_SITE_CONFIGto distinguish prod vs non-prod. - Updates AnVIL curl export visibility logic to always show in non-production.
- Adds production-only runtime guards that return a 404 UI for curl download routes when required consent groups aren’t present.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pages/export/get-curl-command.tsx | Adds production-only guard for curl-command export page using manifest consent groups. |
| pages/[entityListType]/[...params].tsx | Adds production-only guard for dataset curl-download route and broadens consent check to include Unrestricted access. |
| app/viewModelBuilders/azul/anvil-cmg/common/viewModelBuilders.tsx | Exposes hasNRESConsentGroup(...) and makes curl export options always visible in non-prod. |
| app/config/utils.ts | Adds isProductionEnvironment() (and a new consent-group helper). |
| app/components/Export/.../downloadSection.tsx | Updates call site to new hasNRESConsentGroup(...) signature. |
| app/apis/azul/anvil-cmg/common/transformers.ts | Adds isNRESOrUnrestrictedAccess(...) helper for consent group checks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...ponents/AnVILExplorer/components/ExportCohort/components/DownloadSection/downloadSection.tsx
Show resolved
Hide resolved
…4767 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add isNRESOrUnrestrictedAccess to transformers.ts - Update isNRESDataset to check for both NRES and Unrestricted access - Remove isNRESConsentGroup wrapper, use hasNRESConsentGroup directly Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
107f9ec to
32b09f5
Compare
Ticket
Closes #4767
Summary
isProductionEnvironment()utility to detect production vs non-production environments based onNEXT_PUBLIC_SITE_CONFIGTest plan
/export/get-curl-commandworks in dev, returns 404 in prod without NRES/datasets/{id}/export/get-curl-commandworks in dev, returns 404 in prod without NRES🤖 Generated with Claude Code