diff --git a/package-lock.json b/package-lock.json index cb062277..3df5f045 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5704,9 +5704,9 @@ } }, "node_modules/@map-colonies/schemas": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/@map-colonies/schemas/-/schemas-1.12.1.tgz", - "integrity": "sha512-0nlyjsI1cIJkhHkMDXp31VyE1qtPw5kb8R1bQ0ftIbeB2vl7XuYzACtdvU/gjeAluxlYTN4XDnDlUDQj22vAPg==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/@map-colonies/schemas/-/schemas-1.12.2.tgz", + "integrity": "sha512-rQUIdBdeWrJB56ViB+HRZSMy5SBXaI14/4ipT9RVJAuiLRfpVa8JGPr3t4cLI1MJzaP2b3nIpD0R2MiilkLuCw==", "license": "MIT" }, "node_modules/@map-colonies/telemetry": { @@ -34225,7 +34225,7 @@ "@map-colonies/js-logger": "^2.0.0", "@map-colonies/openapi-express-viewer": "^4.0.0", "@map-colonies/read-pkg": "^1.0.0", - "@map-colonies/schemas": "^1.12.1", + "@map-colonies/schemas": "^1.12.2", "@map-colonies/telemetry": "^10.0.1", "@opentelemetry/api": "^1.9.0", "async-cache-dedupe": "^2.2.0", diff --git a/packages/kiosk-ui/src/components/main-page/application-card.tsx b/packages/kiosk-ui/src/components/main-page/application-card.tsx index e9f312b4..f38f44a7 100644 --- a/packages/kiosk-ui/src/components/main-page/application-card.tsx +++ b/packages/kiosk-ui/src/components/main-page/application-card.tsx @@ -1,9 +1,10 @@ -import { CheckCircle, ExternalLink } from 'lucide-react'; +import { ExternalLink } from 'lucide-react'; import { Card, CardContent } from '@/components/ui/card'; import classNames from 'classnames'; import { cn } from '@/lib/utils'; interface ApplicationCardProps { + disable?: boolean; icon: string; iconAlt: string; title: string; @@ -15,16 +16,32 @@ interface ApplicationCardProps { shadowColor?: string; } -export function ApplicationCard({ icon, iconAlt, title, subtitle, description, iconBgColor, checkColor, link, shadowColor }: ApplicationCardProps) { +export function ApplicationCard({ + icon, + iconAlt, + title, + subtitle, + description, + iconBgColor, + checkColor, + link, + shadowColor, + disable, +}: ApplicationCardProps) { // Use a stronger shadow in dark mode, but keep it subtle const darkShadow = shadowColor ? shadowColor.replace(/0\.15\)/, '0.35)') : undefined; const isDark = typeof window !== 'undefined' && window.matchMedia('(prefers-color-scheme: dark)').matches; const appliedShadow = shadowColor ? (isDark ? darkShadow : shadowColor) : undefined; + const isDisabled = !!disable; + const content = ( {subtitle}

{description}

- {/* Use ExternalLink icon if clickable, else CheckCircle */} - {link ? ( - - ) : ( - - )} + {/* Show icon only if not disabled and link exists, else nothing */} + {link && !isDisabled ? : null}
); - return link ? ( - - {content} - - ) : ( - content - ); + if (link && !isDisabled) { + return ( + + {content} + + ); + } + return content; } diff --git a/packages/kiosk-ui/src/components/main-page/supported-applications.tsx b/packages/kiosk-ui/src/components/main-page/supported-applications.tsx index d1d01c98..8f6d01b3 100644 --- a/packages/kiosk-ui/src/components/main-page/supported-applications.tsx +++ b/packages/kiosk-ui/src/components/main-page/supported-applications.tsx @@ -14,6 +14,7 @@ export function SupportedApplications() { {/* QGIS Card */} ; + 'application/xml': string | Record; }; }; /** @description Unauthorized - No valid token */ @@ -316,8 +323,8 @@ export interface operations { 'application/json': components['schemas']['error']; }; }; - /** @description Not Found - QLR file not available */ - 404: { + /** @description Forbidden - User is banned */ + 403: { headers: { [name: string]: unknown; }; diff --git a/packages/token-kiosk/openapi3.yaml b/packages/token-kiosk/openapi3.yaml index f1741e22..1cbcbc97 100644 --- a/packages/token-kiosk/openapi3.yaml +++ b/packages/token-kiosk/openapi3.yaml @@ -230,6 +230,7 @@ components: required: - qgis - arcgis + - enabled type: object properties: qgis: @@ -238,6 +239,9 @@ components: arcgis: type: string description: Link to ArcGIS Pro documentation + enabled: + type: boolean + description: Whether the guides are enabled fileTypes: type: string enum: [qlr, lyrx] diff --git a/packages/token-kiosk/package.json b/packages/token-kiosk/package.json index 4ceebfc7..9acfd51f 100644 --- a/packages/token-kiosk/package.json +++ b/packages/token-kiosk/package.json @@ -38,7 +38,7 @@ "@map-colonies/js-logger": "^2.0.0", "@map-colonies/openapi-express-viewer": "^4.0.0", "@map-colonies/read-pkg": "^1.0.0", - "@map-colonies/schemas": "^1.12.1", + "@map-colonies/schemas": "^1.12.2", "@map-colonies/telemetry": "^10.0.1", "@opentelemetry/api": "^1.9.0", "async-cache-dedupe": "^2.2.0", diff --git a/packages/token-kiosk/src/openapi.d.ts b/packages/token-kiosk/src/openapi.d.ts index 567a35a2..112a95cc 100644 --- a/packages/token-kiosk/src/openapi.d.ts +++ b/packages/token-kiosk/src/openapi.d.ts @@ -124,6 +124,8 @@ export type components = { qgis: string; /** @description Link to ArcGIS Pro documentation */ arcgis: string; + /** @description Whether the guides are enabled */ + enabled: boolean; }; /** * @description Type of file to retrieve (qlr for QGIS, lyrx for ArcGIS Pro) @@ -300,8 +302,13 @@ export interface operations { [name: string]: unknown; }; content: { - 'application/xml': string; - 'application/json': string; + 'application/json': + | { + [key: string]: unknown; + } + | string + | Record; + 'application/xml': string | Record; }; }; /** @description Unauthorized - No valid token */ @@ -313,8 +320,8 @@ export interface operations { 'application/json': components['schemas']['error']; }; }; - /** @description Not Found - QLR file not available */ - 404: { + /** @description Forbidden - User is banned */ + 403: { headers: { [name: string]: unknown; }; diff --git a/packages/token-kiosk/tests/guides/guides.spec.ts b/packages/token-kiosk/tests/guides/guides.spec.ts index 0110d9d7..08ef11aa 100644 --- a/packages/token-kiosk/tests/guides/guides.spec.ts +++ b/packages/token-kiosk/tests/guides/guides.spec.ts @@ -56,6 +56,7 @@ describe('guides', function () { expect(res.body).toEqual({ qgis: 'https://example.com/qgis-guide', arcgis: 'https://example.com/arcgis-guide', + enabled: true, }); }); });