Skip to content

Conversation

israr-ulhaq
Copy link
Contributor

@israr-ulhaq israr-ulhaq commented Sep 10, 2025

https://mhclgdigital.atlassian.net/browse/FLS-1450

Summary

Integrates the Form Designer with Pre-Award API for centralised form storage, replacing the Form Runner (whichuse the Redis cache).

Changes Made

New Pre-Award API Integration

  • PreAwardApiClient - New HTTP client for form operations
  • Direct API storage - Forms saved to centralised Pre-Award database
  • Real-time sync - Form changes immediately available across services

Core Functionality

  • Create forms → Save to Pre-Award API instead of S3/file storage
  • Edit forms → Load from and save to Pre-Award API
  • List forms → Fetch from Pre-Award API instead of file listings
  • Form selection → Direct editing instead of file-based cloning

Key Files Added/Modified

  • server/lib/preAwardApiClient.ts - New API client
  • server/config.ts - Added Pre-Award API URL configuration
  • server/plugins/routes/api.ts - Extended routes with API integration
  • server/plugins/routes/newConfig.ts - API-based form creation
  • server/plugins/routes/PutFormWithIdRouteRegister.ts - Dual save (API + runner for preview)
  • client/pages/landing-page/ViewFundForms.tsx - Direct form editing behaviour
  • PRE_AWARD_API_URL - Environment variable for API endpoint

Testing

  • Added comprehensive test suite
  • Covers API client, route integration, and error handling
  • Mocked HTTP calls for reliable testing

- Add PreAwardApiClient for centralized form storage
- Replace file-based persistence with direct API calls
- Update form selection to edit directly instead of cloning
- Maintain preview functionality via runner publishing
- Remove feature flag complexity for simplified architecture
- Add unit tests for PreAwardApiClient with error handling
- Add integration tests for API routes and form operations
- Add configuration tests for environment variables
- Configure Lab testing framework with TypeScript support
- Add npm test scripts for development workflow
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@wjrm500
Copy link
Collaborator

wjrm500 commented Sep 15, 2025

@israr-ulhaq do you mind closing this if it has been superseded by #221? Thanks

@israr-ulhaq israr-ulhaq deleted the FLS-1450-pre-award-api-integration branch September 15, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants