-
Notifications
You must be signed in to change notification settings - Fork 12
Adds Common Alerting Protocol (CAP) 1.2 Edge App #559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
As discussed, I'll continue on this PR from this point forward (i.e., refine implementation, write tests, increase coverage). |
edge-apps/cap-alerting/screenly.yml
Outdated
| test_mode: | ||
| type: string | ||
| title: Test Mode | ||
| optional: true | ||
| default_value: 'false' | ||
| help_text: Use bundled test CAP file for testing (true/false). | ||
| demo_mode: | ||
| type: string | ||
| title: Demo Mode | ||
| optional: true | ||
| default_value: 'false' | ||
| help_text: Enable demo mode with realistic CAP alerts (randomly selected). Only active when test_mode is disabled and no feed URL is set (true/false). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mode: [production, test, demo]
| title: Offline Mode | ||
| optional: true | ||
| default_value: 'false' | ||
| help_text: When enabled, avoid network fetches and use cached data (true/false). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Let's ensure that our system can work offline by default. Otherwise, human factors could affect its reliability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
libedgeapp
edge-apps/cap-alerting/screenly.yml
Outdated
| audio_alert: | ||
| type: string | ||
| title: Play Audio Alerts | ||
| optional: true | ||
| default_value: 'false' | ||
| help_text: Play audio from CAP resources when available (true/false). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| audio_alert: | |
| type: string | |
| title: Play Audio Alerts | |
| optional: true | |
| default_value: 'false' | |
| help_text: Play audio from CAP resources when available (true/false). | |
| mute_sound: | |
| type: string | |
| title: Play Audio Alerts | |
| optional: true | |
| default_value: 'false' | |
| help_text: Play audio from CAP resources when available (true/false). Not available for Screenly Anywhere. |
Probably, audio alerts should be on by default.
Also, not available on Anywhere yet.
| type: string | ||
| title: Play Audio Alerts | ||
| optional: true | ||
| default_value: 'false' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be on by default.
| offline_mode: | ||
| type: string | ||
| title: Offline Mode | ||
| optional: true | ||
| default_value: 'false' | ||
| help_text: When enabled, avoid network fetches and use cached data (true/false). | ||
| test_mode: | ||
| type: string | ||
| title: Test Mode | ||
| optional: true | ||
| default_value: 'false' | ||
| help_text: Use bundled test CAP file for testing (true/false). | ||
| demo_mode: | ||
| type: string | ||
| title: Demo Mode | ||
| optional: true | ||
| default_value: 'false' | ||
| help_text: Enable demo mode with realistic CAP alerts (randomly selected). Only active when test_mode is disabled and no feed URL is set (true/false). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this setting show as a drop-down selector.
| max_alerts: | ||
| type: string | ||
| title: Maximum Alerts | ||
| optional: true | ||
| default_value: '3' | ||
| help_text: Maximum number of alerts to display simultaneously. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the default. Maybe, we should show as many as the screens allows?
The change was made by Bun when `bun install` was executed.
- Include `cap-alerting/` in `.gitignore` - Have the unit tests be run via `bun run test:unit` instead
- Extract common build flags into shared scripts to reduce duplication - Add build:css:common and build:js:common scripts - Add watch mode for CSS and JS builds - Add npm-run-all2 dependency for parallel task execution
- Update isAnywhereScreen to check for empty string or undefined - Use isAnywhereScreen in cap-alerting demo mode logic
- Extract CAP type definitions into separate types/cap.ts file - Use getTags() helper instead of direct metadata access
… setting - Replace separate demo_mode and test_mode boolean settings with single mode enumeration - Mode supports three values: production, demo, test - Add CAPMode type for type-safe mode handling - Update screenly.yml and screenly_qc.yml with mode setting as select type - Update src/main.ts and index.ts to use CAPMode type
User description
Still requires testing, but the foundation is in here.
PR Type
Tests, Enhancement
Description
Add comprehensive CAP v1.2 parser tests
Implement robust CAP feed fetcher
Add fetcher unit tests with caching
Configure project and tooling
Diagram Walkthrough
File Walkthrough
3 files
Comprehensive CAP v1.2 parser test suiteUnit tests for CAPFetcher caching and retriesTest CAP sample file5 files
Implement CAP feed fetcher with cache and backoffApp HTML shell and script includesEdge app bootstrap and integrationCAP XML parsing and app logicCompiled frontend logic bundle7 files
Add TypeScript ESLint configurationTailwind configuration with extended breakpointsTypeScript compiler configuration for appPrettier formatting configurationProject package metadata and scriptsScreenly app manifestScreenly QC configuration7 files
Add demo CAP alert: active shooter scenarioAdd demo CAP alert: hazmat spillAdd demo CAP alert: flood warningAdd demo CAP alert: earthquake advisoryAdd demo CAP alert: tornado warningAdd demo CAP alert: fire emergencyDocumentation for CAP Alerting app2 files
Compiled stylesheet for app UITailwind input styles