When returning to this project:
- Run
npm run devto test locally - If all flows work → ready for release (see Release Checklist below)
- Key docs:
CLAUDE.md(project overview),publishing.md(npm workflow)
Current state: All flows implemented. Using qa-bot-core@0.2.3-beta.6. Ready for testing.
| Phase | Description | Notes |
|---|---|---|
| Phase 1: User Context | User info in flows | Props flow through AccessQABot → UserInfo → flow-context.ts. Skips form fields when data available. |
| Phase 2: File Attachments | Upload component | Implemented in @snf/qa-bot-core. Imported as FileUploadComponent. |
| Phase 4: ACCESS Login Flow | 10-step ticket flow | Full flow with file upload, validation, summary, JIRA submission. |
| Phase 4: Resource Login Flow | 10-step ticket flow | For resource provider login issues. Uses loginProvider ticket type. |
| Phase 5: General Help Flow | Multi-step general help | Keywords, priority, category, resource involvement. Uses support ticket type. |
| Phase 6: Security Incident Flow | Security reporting | Priority levels, file attachments, submits to security-incidents endpoint. |
| Phase 7: Metrics/XDMoD Flow | Usage queries | Q&A loop against metrics API with feedback buttons. |
| Phase 8: Main Menu | Navigation | Routes between Q&A, tickets, metrics, security. All 4 options wired up. |
| Infrastructure | Build system, types, API | ESM/UMD/Standalone builds, TypeScript definitions, ticket API with Netlify proxy. |
| Footer Fix | qa-bot-core bug fix | Fixed footer flash issue - moved config from useEffect to useMemo. |
| Login State Refactor | Replace enabled with isLoggedIn |
Implemented in qa-bot-core v0.2.3-beta.4. See local-notes/ARCHITECTURE_PROPOSAL_LOGIN_STATE.md |
| chatDisabled Pattern | Auto-set via applyFlowSettings |
Implemented in qa-bot-core v0.2.3-beta.6. Removed 55 explicit statements from flows. |
| Documentation | Updated CLAUDE.md, created publishing.md | CLAUDE.md reflects current state. publishing.md has npm workflow. |
See: local-notes/ARCHITECTURE_PROPOSAL_LOGIN_STATE.md
| Prop | Type | Default | Purpose |
|---|---|---|---|
isLoggedIn |
boolean |
required | Login state: header icon + Q&A gating |
allowAnonAccess |
boolean |
false |
Escape hatch: bypass Q&A gating |
qa-bot-core (v0.2.3-beta.4):
- Removed
enabledprop - Added required
isLoggedInprop - Added optional
allowAnonAccessprop - Q&A gated when
isLoggedIn === false(unlessallowAnonAccess) - Input never globally disabled
access-qa-bot:
- Changed
enabled={isLoggedIn}→isLoggedIn={isLoggedIn} - Gating is automatic, no second prop needed
Problem: react-chatbotify does not reliably fall back to settings.chatInput.disabled when transitioning between steps. If a step has chatDisabled: true and the next step omits it, the input stays disabled.
Solution: applyFlowSettings utility in qa-bot-core v0.2.3-beta.6.
import { applyFlowSettings } from '@snf/qa-bot-core';
const customFlow = useMemo(() => {
const rawFlow = { ...flow1, ...flow2 };
return applyFlowSettings(rawFlow, { disableOnOptions: true });
}, [deps]);When disableOnOptions: true:
- Steps with
optionsorcheckboxes→chatDisabled: true - Steps without →
chatDisabled: false - Steps with explicit
chatDisabled→ unchanged
Removed 55 explicit chatDisabled statements from access-qa-bot flows. Only one dynamic chatDisabled function remains (in security-flow.tsx for conditional contact info).
All user-facing strings match the old qa-bot repo:
qa-bot/src/utils/flows/main-menu-flow.jsqa-bot/src/utils/flows/tickets/*.jsqa-bot/src/utils/flows/security-flow.jsqa-bot/src/utils/flows/metrics-flow.js
Complete in src/utils/ticket-api.ts:
submitTicket()- High-level submission function- Request type IDs: SUPPORT=17, LOGIN_ACCESS=30, LOGIN_PROVIDER=31, SECURITY=26
The old qa-bot uses "affiliated" for resource login. We renamed to "resource" for clarity:
- Old:
affiliated_help,affiliated_login_* - New:
resource_help,resource_login_*
This repo replaces qa-bot but publishes to the same npm package (@snf/access-qa-bot):
| Repo | Version Range | Status |
|---|---|---|
qa-bot (old) |
v0.x - v2.x | To be deprecated |
access-qa-bot (this) |
v3.0.0+ | Active |
From consumers' perspective (e.g., access-ci-ui), this is just a version bump.
| Step | Status | Command/Action |
|---|---|---|
| 1. Test locally | ⏳ Pending | npm run dev, verify all flows work |
| 2. qa-bot-core stable | ⏳ Pending | Publish stable release in qa-bot-core repo |
| 3. Update dependency | ⏳ Pending | npm install @snf/qa-bot-core@latest (after stable) |
| 4. Publish this repo | ⏳ Pending | Follow publishing.md workflow |
| 5. Deprecate old repo | ⏳ Pending | See below |
See publishing.md for detailed npm publishing workflow.
After v3.0.0 is published and verified:
-
Update old repo's README.md:
# ⚠️ DEPRECATED This repository has been superseded by a rewrite. **New repository:** [access-qa-bot](https://github.com/necyberteam/access-qa-bot) The npm package `@snf/access-qa-bot` continues from v3.0.0 in the new repo. - For v2.x and earlier: This repo (archived) - For v3.0.0+: See [access-qa-bot](https://github.com/necyberteam/access-qa-bot)
-
Archive the repo on GitHub (Settings → Archive)
-
Old versions remain available -
npm install @snf/access-qa-bot@2.7.3still works
After publishing v3.0.0:
- Update dependency:
npm install @snf/access-qa-bot@latest - Props change:
enabled→isLoggedIn(breaking change, documented) - Test in Drupal environment
src/
├── components/
│ └── AccessQABot.tsx # Main wrapper component
├── config/
│ └── constants.ts # API endpoints, bot config
├── flows/
│ ├── index.ts # Flow exports
│ ├── main-menu-flow.ts # Top-level navigation
│ ├── ticket-flow.ts # Ticket type selection + combines flows
│ ├── access-login-flow.tsx # ACCESS login issues
│ ├── resource-login-flow.tsx # Resource login issues
│ ├── general-help-flow.tsx # General help tickets
│ ├── security-flow.tsx # Security incidents
│ └── metrics-flow.ts # XDMoD queries
├── utils/
│ ├── flow-context.ts # Form state management
│ ├── ticket-api.ts # JIRA submission
│ ├── validation.ts # Input validators
│ └── session.ts # Session ID management
└── types/
├── index.ts # TypeScript definitions
└── qa-bot-core.d.ts # Type declarations for @snf/qa-bot-core