Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin Dashboard - Manage Endpoints #801

Open
tobi-bams opened this issue Dec 19, 2024 · 3 comments
Open

Admin Dashboard - Manage Endpoints #801

tobi-bams opened this issue Dec 19, 2024 · 3 comments
Labels

Comments

@tobi-bams
Copy link
Collaborator

Admin Dashboard - Manage Endpoints


Description:

Implement functionality to manage endpoints associated with a feature flag directly from the Admin Dashboard.


Deliverables:

  1. Manage Endpoints Button:

    • Use the "Manage Endpoints" button on the feature flags table.
  2. Endpoints Management Modal:

    • Clicking "Manage Endpoints" should open a modal displaying:
      • Header: Feature Flag Name.
      • List of Current Endpoints:
        • Display each endpoint's path with an "Edit" and "Delete" button.
  3. Add Endpoints Section:

    • Include a text input for adding multiple new endpoint paths (one-by-one or have a button that dynamically adds new input fields).
    • Add a button labeled "Add Endpoints" to submit the new paths.
  4. API Integrations:

    • POST /feature_flags/{feature_flag_id}/endpoints:

      • Add new endpoints.
      • Request Body Example:
        ["/api/new", "/api/another_new"]
      • Response Format:
        {
          "success": true,
          "message": "Endpoints added successfully",
          "data": {
            "feature_name": "Chat",
            "description": "Feature for chat operations",
            "uuid": "uuid-123",
            "endpoints": [
              { "path": "/api/chat", "uuid": "uuid-ep-1" },
              { "path": "/api/chat/:id", "uuid": "uuid-ep-2" },
              { "path": "/api/new", "uuid": "uuid-ep-3" },
              { "path": "/api/another_new", "uuid": "uuid-ep-4" }
            ]
          }
        }
    • PUT /feature_flags/{feature_flag_id}/endpoints/{endpoint_id}:

      • Update an existing endpoint's path.
      • Request Body Example:
        { "new_endpoint_path": "/api/updated_endpoint" }
      • Response Format:
        {
          "success": true,
          "message": "Endpoint updated successfully",
          "data": {
            "feature_name": "Chat",
            "description": "Feature for chat operations",
            "uuid": "uuid-123",
            "endpoints": [
              { "path": "/api/chat", "uuid": "uuid-ep-1" },
              { "path": "/api/updated_endpoint", "uuid": "uuid-ep-2" }
            ]
          }
        }
    • DELETE /feature_flags/{feature_flag_id}/endpoints/{endpoint_id}:

      • Delete an existing endpoint.
      • Response Format:
        {
          "success": true,
          "message": "Endpoint deleted successfully"
        }
  5. Dynamic UI Update:

    • Refresh the endpoints list dynamically in the modal upon successful API calls for add, edit, or delete operations.
  6. Validation & Error Handling:

    • Ensure endpoint paths are valid and non-duplicate.
    • Handle API errors and display feedback to the user within the modal.

Testing Checklist:

  • Verify the "Manage Endpoints" button opens the modal with the correct feature flag name and associated endpoints.
  • Test that endpoints are displayed accurately.
  • Validate that adding, updating, and deleting endpoints dynamically updates the UI and reflects on the backend.
  • Ensure duplicate or invalid endpoint paths are handled gracefully.
  • Confirm error messages are user-friendly and actionable.
@jordan-ae
Copy link
Contributor

I'm available

@Ekep-Obasi
Copy link
Contributor

@tobi-bams @humansinstitute please assign me

@AhsanFarooqDev
Copy link
Contributor

@tobi-bams can I help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants