Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
},
"devDependencies": {
"@eslint/eslintrc": "^3.2.0",
"@next/eslint-plugin-next": "^15.3.3",
"@tailwindcss/typography": "^0.5.15",
"@types/escape-html": "^1.0.4",
"@types/node": "22.5.4",
Expand All @@ -92,6 +93,7 @@
"eslint": "^9.17.0",
"eslint-config-next": "15.1.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-react-hooks": "^5.2.0",
"husky": "^9.1.7",
"lint-staged": "^15.5.0",
"postcss": "^8.4.49",
Expand Down
16 changes: 16 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/app/(payload)/admin/importMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { default as default_55a7d1ebef7afeed563b856ae2e2cbf4 } from '@/component
import { default as default_9d7720c4b50db35595dfefa592fabd33 } from '@/components/TenantSelector'
import { LinkLabelDescription as LinkLabelDescription_cc2cf53f1598892c0c926f3cb616a721 } from '@/fields/navLink/components/LinkLabelDescription'
import { SlugComponent as SlugComponent_92cc057d0a2abb4f6cf0307edf59f986 } from '@/fields/slug/SlugComponent'
import { Description as Description_dec1f3f80f9e0d72e62ee0edc85ffb4e } from '@/globals/NACWidgetsConfig/components/Description'
import { TenantField as TenantField_1d0591e3cf4f332c83a86da13a0de59a } from '@payloadcms/plugin-multi-tenant/client'
import {
GlobalViewRedirect as GlobalViewRedirect_d6d5f193a167989e2ee7d14202901e62,
Expand Down Expand Up @@ -83,6 +84,8 @@ export const importMap = {
'@/collections/Roles/components/RulesCell#RulesCell': RulesCell_649699f5b285e7a5429592dc58fd6f0c,
'@/fields/navLink/components/LinkLabelDescription#LinkLabelDescription':
LinkLabelDescription_cc2cf53f1598892c0c926f3cb616a721,
'@/globals/NACWidgetsConfig/components/Description#Description':
Description_dec1f3f80f9e0d72e62ee0edc85ffb4e,
'@payloadcms/plugin-multi-tenant/rsc#GlobalViewRedirect':
GlobalViewRedirect_d6d5f193a167989e2ee7d14202901e62,
'@/components/BeforeDashboard#default': default_1a7510af427896d367a49dbf838d2de6,
Expand Down
2 changes: 1 addition & 1 deletion src/endpoints/seed/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const collections: CollectionSlug[] = [
const globalsMap: Record<GlobalSlug, { requiredFields: any }> = {
nacWidgetsConfig: {
requiredFields: {
version: '20250602',
version: 'latest',
baseUrl: 'https://du6amfiq9m9h7.cloudfront.net/public/v2',
},
},
Expand Down
22 changes: 22 additions & 0 deletions src/globals/NACWidgetsConfig/components/Description.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export function Description() {
return (
<div className="mb-12 flex flex-col gap-4">
<p>
Controls the baseUrl and version used for loading of NAC widgets across all Avy-Web
avalanche center websites.
</p>
<p>
The version should typically be set to &quot;latest&quot; but can be changed to a specific
date version if needed.
</p>
<p>
The version refers to the published date version of the{' '}
<a href="https://github.com/NationalAvalancheCenter" target="_blank" rel="noreferrer">
afp-public-widgets
</a>{' '}
repo. <a href="mailto:[email protected]">Chris Lundy</a> is the point of contact if there
is an issue with widget loading.
</p>
</div>
)
}
12 changes: 9 additions & 3 deletions src/globals/NACWidgetsConfig/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ const validateExternalUrl: TextFieldSingleValidation = (val) =>
export const NACWidgetsConfig: GlobalConfig = {
slug: 'nacWidgetsConfig',
label: 'NAC Widgets Config',
admin: {
description: 'Controls the loading of NAC widgets across all avalanche center websites.',
},
access: accessByGlobalRole('nacWidgetsConfig'),
fields: [
{
type: 'ui',
name: 'description',
admin: {
components: {
Field: '@/globals/NACWidgetsConfig/components/Description#Description',
},
},
},
{
type: 'text',
name: 'version',
Expand Down
2 changes: 0 additions & 2 deletions src/payload-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2621,8 +2621,6 @@ export interface PayloadMigrationsSelect<T extends boolean = true> {
createdAt?: T;
}
/**
* Controls the loading of NAC widgets across all avalanche center websites.
*
* This interface was referenced by `Config`'s JSON-Schema
* via the `definition` "nacWidgetsConfig".
*/
Expand Down