feat: support editing Drupal MySQL connection details#1089
Conversation
- LoadUploadFile: make Host/Database/User editable for SQL format; forward to validation - upload.service: send mysql details as headers for drupal validation - upload-api: persist UI-entered mysql details into config.mysql; keep localPath as "sql" fix: correct content mapper status icons and migration CTA state - ContentMapper: update status icon on entry selection; hide Save footer when empty; fix empty-state layout - MigrationFlowHeader: disable CTA only while migration is in progress, re-enable as Restart once complete
🔒 Security Scan Results
⏱️ SLA Breach Summary
🟡 Medium Severity - SLA Breached Issues (with fixes)Showing 1 issue(s) that have exceeded the 90-day SLA threshold:
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
❌ BUILD FAILED - Security checks failed Please review and fix the security vulnerabilities before merging. |
1 similar comment
🔒 Security Scan Results
⏱️ SLA Breach Summary
🟡 Medium Severity - SLA Breached Issues (with fixes)Showing 1 issue(s) that have exceeded the 90-day SLA threshold:
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
❌ BUILD FAILED - Security checks failed Please review and fix the security vulnerabilities before merging. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
🟡 Medium Severity - SLA Breached Issues (with fixes)Showing 1 issue(s) that have exceeded the 90-day SLA threshold:
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
❌ BUILD FAILED - Security checks failed Please review and fix the security vulnerabilities before merging. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
There was a problem hiding this comment.
Pull request overview
This PR adds end-to-end support for editing Drupal MySQL connection details from the UI during “Check Connection” validation, and includes UI fixes to better reflect Content Mapper selection state and migration CTA availability.
Changes:
- Forward UI-entered Drupal MySQL connection fields to upload-api and persist them into
config.mysqlwhile keeping"sql"as the SQL-mode sentinel. - Update Content Mapper UI to reflect entry selection status via content type icons and hide Save footers when there’s nothing to save; improve empty-state layout.
- Fix Migration header CTA disabling logic to disable only while a migration is actively running.
Reviewed changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| upload-api/src/routes/index.ts | Reads MySQL connection fields from request headers and passes them into config update during validation. |
| upload-api/src/helper/index.ts | Extends updateConfigFile to persist Drupal MySQL edits and preserve the "sql" sentinel behavior. |
| upload-api/package.json | Adjusts npm overrides related to diff (scoped to @wordpress/block-editor). |
| upload-api/migration-drupal/libs/createInitialMapper.js | Adds extractEntries dependency import for Drupal mapper generation. |
| ui/src/services/api/upload.service.ts | Sends optional MySQL fields as headers during validation requests. |
| ui/src/services/api/service.interface.ts | Extends FileValidationParams with optional mysql details. |
| ui/src/components/MigrationFlowHeader/index.tsx | Updates CTA disabled logic to only block while migration is in progress. |
| ui/src/components/LegacyCms/legacyCms.scss | Adds layout styling for grouped SQL edit inputs. |
| ui/src/components/LegacyCms/Actions/LoadUploadFile.tsx | Adds UI editing flow for SQL MySQL fields and forwards values into validation. |
| ui/src/components/ContentMapper/index.tsx | Updates content type status icon based on entry selection and conditionally hides the footer when empty. |
| ui/src/components/ContentMapper/index.scss | Ensures empty state fills available viewport space. |
| ui/src/components/ContentMapper/entryMapper.tsx | Emits entry-selection changes upward and hides footer when there are no entries. |
| ui/package-lock.json | Lockfile updates from dependency resolution changes. |
| api/package-lock.json | Lockfile updates from dependency resolution changes. |
Files not reviewed (2)
- api/package-lock.json: Language not supported
- ui/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const resolvedFilePath = | ||
| isDrupal || trimmed.toLowerCase() === 'sql' ? 'sql' : path.resolve(trimmed); |
| // No filePath, but drupal mysql details changed — persist them and return updated config. | ||
| if (isDrupal && mysqlDetails && typeof mysqlDetails === 'object') { | ||
| const configContent = JSON.stringify(config, null, 2); | ||
| await fs.promises.writeFile(configFilePath, configContent, 'utf8'); | ||
| } |
| <TextInput | ||
| value={sqlDetails.host} | ||
| onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSqlDetails((prev) => ({ ...prev, host: e.target.value }))} | ||
| width="full" | ||
| version="v2" | ||
| placeholder="Enter host" | ||
| aria-label="host" | ||
| autoFocus | ||
| /> | ||
| <TextInput | ||
| value={sqlDetails.database} | ||
| onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSqlDetails((prev) => ({ ...prev, database: e.target.value }))} | ||
| width="full" | ||
| version="v2" | ||
| placeholder="Enter database" | ||
| aria-label="database" | ||
| /> | ||
| <TextInput | ||
| value={sqlDetails.user} | ||
| onChange={(e: React.ChangeEvent<HTMLInputElement>) => setSqlDetails((prev) => ({ ...prev, user: e.target.value }))} | ||
| width="full" | ||
| version="v2" | ||
| placeholder="Enter user" | ||
| aria-label="user" | ||
| /> |
| "@wordpress/block-editor": { | ||
| "diff": "4.0.4" | ||
| }, |
🔗 Jira Ticket
. CMG-993
· CMG-994
· CMG-995
· CMG-996
📋 PR Type
📝 Description
What changed?
Feature — Drupal MySQL connection editing
mysql_host/mysql_database/mysql_userheaders for drupal validationconfig.mysql; keeplocalPathas the"sql"sentinel instead of resolving it to a filesystem pathBug Fix — content mapper & migration CTA
Why?
Drupal sources connect via MySQL rather than a file, but the connection details were read-only, so users couldn't correct them across iterations. The content mapper status icons and Save footer didn't reflect actual entry/field state, and the migration CTA stayed disabled even after completion.
🧩 Affected Areas
api— Node.js backendui— React frontendupload-api— Upload API serverdocker/docker-compose🧪 How to Test
config.mysql.Expected result: Drupal MySQL details are editable and persisted; content mapper icons/footer reflect real state; CTA only disables during active migration.
📸 Screenshots / Recordings
🔗 Related PRs / Dependencies
✅ Author Checklist
feature/,bugfix/, orhotfix/+ 5–30 lowercase chars.env/example.envupdated if new environment variables were addednpm test)README.md/ docs updated if behaviour changed👀 Reviewer Notes
updateConfigFilenow branches on drupal to persistconfig.mysqland to keeplocalPathas"sql". Confirm non-drupal flows are unaffected.package.jsonoverride swapped the top-leveldiffconstraint for a nested@wordpress/block-editoroverride pinningdiff@4.0.2— please confirm that's intended.