Skip to content

Commit fccc96d

Browse files
ianwiedsclaude
andcommitted
Rebuild marketing calendar with Firestore backend, campaign previews, list view, and page consolidation
Replace localStorage-based calendar with full Firestore integration for the marketing-campaigns collection. Campaigns (email + push) are now created, edited, and deleted via BEM API with real-time Firestore reads. Core changes: - Firestore real-time subscriptions with range-based queries per view - Recurring campaign support: virtual occurrence generation, pattern-based scheduling (daily/weekly/monthly/quarterly/yearly), history record overlay - Optimistic rendering: instant UI updates on drag-and-drop reschedule, cached data reuse across view switches - Campaign previews: Edit/Preview tabs in editor modal with markdown-it for email preview and mobile device frame for push notification preview - List view: 5th calendar view mode showing chronological campaign table with date headers, type/status badges, and click-to-edit - Campaign editor: type toggle (email/push), recurrence config, provider checkboxes (SendGrid/Beehiiv), targeting (lists/segments/all), discount code, test mode, UTM overrides, advanced settings - Results modal: read-only view for sent/failed campaigns with retry option - Page consolidation: deleted separate notification and newsletter admin pages, simplified sidebar to single Calendar link under Marketing - Create Campaign button in page header for quick access New file: campaign-preview.js (markdown + push preview rendering module) New dependency: markdown-it@^14.1.1 (dynamic import, code-split by webpack) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent dd16052 commit fccc96d

File tree

21 files changed

+2277
-1699
lines changed

21 files changed

+2277
-1699
lines changed

CLAUDE.md

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,11 @@ UJ provides JSON configuration files for common sections like navigation and foo
131131
**Configuration Files:**
132132
- `src/defaults/src/_includes/frontend/sections/nav.json` - Navigation configuration
133133
- `src/defaults/src/_includes/frontend/sections/footer.json` - Footer configuration
134+
- `src/defaults/src/_includes/global/sections/account.json` - Account dropdown configuration (shared across frontend nav, backend topbar, admin topbar)
134135

135136
**How It Works:**
136137
1. JSON files contain structured data (links, labels, settings)
137-
2. HTML templates in `src/defaults/dist/_includes/themes/[theme-id]/frontend/sections/` read and render this data
138+
2. HTML templates in `src/defaults/dist/_includes/themes/[theme-id]/` read and render this data
138139
3. The build process converts `.json` → data loaded by `.html` templates
139140

140141
**Customizing Navigation/Footer:**
@@ -143,6 +144,68 @@ Consuming projects should create their own JSON files in `src/_includes/frontend
143144
- `src/_includes/frontend/sections/nav.json`
144145
- `src/_includes/frontend/sections/footer.json`
145146

147+
### Account Dropdown (Shared Component)
148+
149+
The account dropdown (avatar + user info + menu items) is a shared component used across the frontend nav, backend topbar, and admin topbar. It is defined once and included everywhere.
150+
151+
**Data Source:** `src/defaults/src/_includes/global/sections/account.json`
152+
153+
This is the single source of truth for account dropdown menu items. Consuming projects can override it by creating `src/_includes/global/sections/account.json`.
154+
155+
**Example: account.json**
156+
```json5
157+
{
158+
dropdown: [
159+
{ label: 'Account', href: '/account#profile', icon: 'user-gear' },
160+
{ label: 'Dashboard', href: '/dashboard', icon: 'gauge-high' },
161+
{ divider: true, attributes: [['data-wm-bind', '@show auth.account.roles.admin']] },
162+
{ label: 'Admin Panel', href: '/admin/dashboard', icon: 'shield-halved', attributes: [['data-wm-bind', '@show auth.account.roles.admin']] },
163+
{ divider: true },
164+
{ label: 'Sign Out', icon: 'arrow-right-from-bracket', class: 'auth-signout-btn text-danger' }
165+
]
166+
}
167+
```
168+
169+
**Include:** `src/defaults/dist/_includes/themes/classy/global/sections/account.html`
170+
171+
This renders the full account dropdown: avatar button with profile photo, user info header (displayName + email), and the menu items from `account.json`.
172+
173+
**Parameters:**
174+
175+
| Parameter | Default | Description |
176+
|-----------|---------|-------------|
177+
| `size` | `md` | Avatar size class (`sm`, `md`, `lg`) |
178+
| `attributes` | none | Array of `[name, value]` attribute pairs for the dropdown wrapper |
179+
180+
**Usage in templates:**
181+
```liquid
182+
{% include themes/classy/global/sections/account.html size="md" attributes=action.attributes %}
183+
```
184+
185+
**How it's wired into nav/topbar:**
186+
187+
In `nav.json` or `topbar.json`, set `type: 'account'` on an action — the rendering templates detect this type and include the shared account dropdown automatically. No `dropdown` array is needed on the action:
188+
189+
```json5
190+
{
191+
type: 'account',
192+
attributes: [
193+
['data-wm-bind', '@show auth.user'],
194+
['hidden', '']
195+
],
196+
}
197+
```
198+
199+
**File Locations:**
200+
201+
| Purpose | Path |
202+
|---------|------|
203+
| Account data (SSOT) | `src/defaults/src/_includes/global/sections/account.json` |
204+
| Account include | `src/defaults/dist/_includes/themes/classy/global/sections/account.html` |
205+
| Frontend nav (uses include) | `src/defaults/dist/_includes/themes/classy/frontend/sections/nav.html` |
206+
| Backend topbar (uses include) | `src/defaults/dist/_includes/themes/classy/backend/sections/topbar.html` |
207+
| Admin topbar (wraps backend) | `src/defaults/dist/_includes/themes/classy/admin/sections/topbar.html` |
208+
146209
**Example: Footer Configuration**
147210

148211
```json

package-lock.json

Lines changed: 50 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ultimate-jekyll-manager",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "Ultimate Jekyll dependency manager",
55
"main": "dist/index.js",
66
"exports": {
@@ -95,6 +95,7 @@
9595
"json5": "^2.2.3",
9696
"libsodium-wrappers": "^0.8.2",
9797
"lodash": "^4.17.23",
98+
"markdown-it": "^14.1.1",
9899
"minimatch": "^10.2.4",
99100
"node-powertools": "^3.0.0",
100101
"npm-api": "^1.0.1",

0 commit comments

Comments
 (0)