Skip to content

API Endpoint Modal Alignment (Elements Modal) #923

@matKlju

Description

@matKlju

AS A Service-Module developer
I WANT the API Elements section in the Elemendid modal to align with #871 endpoint store and verification contracts
SO THAT endpoint management is deterministic and consistent across UIs


Description

Redesign the API Elements section as a lightweight view backed by the global endpoints store and persisted verification state.
Reuse shared Test URL logic. No new backend behavior.

Image

Acceptance Criteria

1. Visibility

  • Display only:
    • Public endpoints (is_common = true)
    • Current-service private endpoints (is_common = false AND service_id = currentService)

2. Data Mapping

Column Source
Nimi (Name) definitions[0].label
Avalikkus (Visibility) is_common
Staatus (Status) verificationStatus
Skeem (Schema) schemaCaptured
  • Status states:
    • Verified → 2xx
    • Failed → non-2xx
    • Unverified → never tested
  • 204 treated as successful test (no schema)
  • Schema state updates only on 2xx

3. Display Rules

  • Nimi

    • Max 25 characters, truncated if longer
    • Tooltip shows:
      • Full name
      • Description
      • Method (GET/POST)
      • URL (url / openApiUrl / path)
  • Avalikkus

    • No visible text, only lock icon
    • Tooltip:
      • avalik (public)
      • privaatne (private)
  • Staatus

    • If untested → display ---
    • Tooltip:
      • 2xx (successful)
      • non-2xx (failed)
      • testimata (not tested)
  • Skeem

    • If untested → display ---
    • Tooltip:
      • skeem jäädvustatud (captured)
      • skeemi pole jäädvustatud (not captured)
      • testimata (not tested)
  • If endpoint never tested:

    • Staatus = ---
    • Skeem = ---
    • Avalikkus still indicated via tooltip

4. Row Actions

Kopeeri (Copy)

  • Clone configuration:
    • Method
    • URL / path / openApiUrl
    • Request structure
    • Default test parameters
    • Visibility
  • New name format: old_name_dd_mm-yyyy-hh-mm-ss
  • Persist new endpoint
  • Reset verification fields:
    • verificationStatus = unverified
    • lastTestAt = null
    • lastStatusCode = null
    • schemaCaptured = false

Testi (Test)

  • Use shared backend verification logic
  • Send stored definition + default test parameters
  • Update verification fields
  • Per-row loading state
  • Refresh from persisted values

Muuda (Edit)

  • Open global endpoint configuration modal
  • Edit existing endpoint

Kustuta (Delete)

  • Confirmation required
  • Remove endpoint from endpoints table
  • Remove row after success
  • Backend errors visible (no silent fail)

5. Search & Sorting

  • Case-insensitive search by name
  • Default sort:
    • created_at desc if available
    • else name asc
  • Sort toggles:
    • Name
    • Visibility (+ secondary name)
    • Status (+ secondary name)
    • Schema (+ secondary name)
  • Execution order: filter → sort → paginate
  • Reset on modal close

6. Pagination & Layout

  • Default 5 per page
  • Options: 5 / 10 / 20
  • Pagination controls
  • Fixed modal height
  • Scrollable table area
  • Auto-resize only if fewer than 5 rows

7. Integrity Constraints

  • Single shared Test URL backend
  • Verification never blocks edit/create
  • Schema preserved on failed verification
  • No LLM execution

Metadata

Metadata

Assignees

Labels

Projects

Status

No status

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions