Skip to content

build configure-workflow urls via URLSearchParams; keep ROUTES as pure paths #1488

Description

@frano-m

Context

Raised during review of #1484.

CONFIGURE_WORKFLOW / CONFIGURE_ORGANISM_WORKFLOW in packages/shared/routes/constants.ts now embed a ?trsId={trsId} query string, which is filled by replaceParameters — a path tool doing a raw String.replace with no URL-encoding.

This works today only because every caller pre-sanitizes trsId to [a-zA-Z0-9-] (via formatTrsId). A future value containing &, =, #, or a space would break the URL silently. The ROUTES.CONFIGURE_ORGANISM_WORKFLOW.split("?")[0] in the e2e spec is a tell that a path constant is being used as something it isn't.

Proposal

Keep ROUTES entries as pure path templates and build the query string at the call site using URLSearchParams, e.g. a small helper:

buildConfigureWorkflowUrl(entityId, trsId) // -> "/data/assemblies/<id>/analyze/workflows?trsId=<encoded>"

Acceptance criteria

  • ROUTES contains no embedded query strings.
  • Configure-workflow URLs are built via URLSearchParams (proper encoding).
  • No .split("?") workarounds in tests.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions