-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add GitHub Pages demo with mock data #4
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
Draft
talissoncosta
wants to merge
15
commits into
feat/6424-add-tests
Choose a base branch
from
feat/github-pages-demo
base: feat/6424-add-tests
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,591
−62
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add static demo deployment for showcasing the plugin: - Vite config for standalone demo build - Demo app with MSW mock handlers - Demo banner indicating mock data usage - GitHub Actions workflow for auto-deploy to Pages - Build script: yarn build:demo Demo URL: https://flagsmith.github.io/flagsmith-backstage-plugin/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add interactive demo configuration:
- Initial setup screen with mock/live mode selection
- Live mode: connect to real Flagsmith with API key
- Mock mode: use MSW for sample data
- Configuration persisted in localStorage
- Reconfigure button in demo banner
Add PR preview deployments:
- Each PR deploys to /pr-{number}/ on GitHub Pages
- Bot comments on PR with preview URL
- Automatic cleanup when PR is closed/merged
- Dynamic base path via VITE_BASE_PATH env variable
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4ac04c7 to
d901671
Compare
- Check if gh-pages branch exists before checkout - Create orphan gh-pages branch if it doesn't exist - Update cleanup job to handle missing branch gracefully 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Demo PreviewPreview URL: https://Flagsmith.github.io/flagsmith-backstage-plugin/pr-4/ This preview will be automatically cleaned up when the PR is closed. |
- Sort mock URL patterns by length to match more specific patterns first - Fix dashboard link test to use 'link' role instead of 'button' - Remove unused mockEntity import 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The FlagsmithClient appends /flagsmith to the base URL from discovery API. MSW handlers expect patterns like */proxy/flagsmith/..., so the discovery API must return /api/proxy (not /api) for mock mode to work correctly. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
FlagsmithClient appends /flagsmith to all URLs (designed for Backstage proxy routing). In live mode, we hit the Flagsmith API directly, so strip /flagsmith from the path to get correct API URLs. Before: https://api.flagsmith.com/api/v1/flagsmith/projects/123/ After: https://api.flagsmith.com/api/v1/projects/123/ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Convert all inline styles to Material-UI makeStyles for consistency: - FlagsTab: add errorHint, header classes - ExpandableRow: add collapseCell, loadingContainer classes - EnvironmentTable: add envName class - FeatureDetailsGrid: add tagsContainer, serverKeyChip classes - SegmentOverridesSection: add statusLabel class - FlagStatusIndicator: add size variant classes (dotSmall/dotMedium) - LoadingState: add container, message classes - FlagsmithUsageCard: add errorHint class - UsageTooltip: add container, title, content classes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace inline styles with makeStyles in demo App LoadingScreen for consistency with the rest of the codebase. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove required validation for projectId and orgId fields - Auto-fetch first available org/project when not provided - Update helper text to clarify optional fields - Clarify API Key is Master API Key from Organisation Settings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add console logs for MSW service worker initialization to help debug mock mode issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add mockServiceWorker.js generated by MSW for intercepting API requests in mock mode demo. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a theme toggle button in the toolbar that allows users to switch between light and dark modes. Theme state is managed in the App component and passed to all child components. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Replace hardcoded dark background with color="default" on AppBar - Add conditional text color for title based on theme mode - Make Tabs background adapt to light/dark mode 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add key prop to ThemeProvider to force remount on theme change - Apply background.default to main content area for proper theming - Use explicit background/text colors on AppBar for consistent styling - Adjust Tabs background opacity for better visual balance 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The artifact was being lost when switching branches because git checkout replaces the working directory. Move artifact to /tmp before checkout. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a GitHub Pages deployment for showcasing the Flagsmith Backstage plugin with mock data.
Features
Demo URL
After merging:
https://flagsmith.github.io/flagsmith-backstage-plugin/Files Added
vite.config.demo.ts- Vite build configurationdemo/directory with App, DemoBanner, main entry point.github/workflows/deploy-demo.yml- Deployment workflow.eslintignore- Exclude demo from lintingScripts Added
yarn build:demo- Build static demoyarn preview:demo- Preview demo locallyTest Plan
yarn lintpassesyarn buildpassesyarn build:demoproduces static files indist-demo/Screenshots
Demo can be previewed locally with
yarn build:demo && yarn preview:demo🤖 Generated with Claude Code