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 - Feature Flag List #798

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

Admin Dashboard - Feature Flag List #798

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

Comments

@tobi-bams
Copy link
Collaborator

tobi-bams commented Dec 19, 2024

Description:

Develop a user interface in the Admin Dashboard to display, manage, and interact with all feature flags and their associated endpoints. The UI should support toggling, editing, deleting, managing endpoints, and creating feature flags.


Deliverables

  1. Feature Flags Tab:

    • Add a dedicated tab or section in the Admin Dashboard for feature flags.

    • On tab load, fetch feature flag data using the GET /feature_flags endpoint.

    • API Response Example:

      {
        "success": true,
        "message": "Feature flags fetched successfully",
        "data": [
          {
            "name": "Chat",
            "description": "Enable the chat feature",
            "enabled": false,
            "uuid": "uuid-123",
            "endpoints": [
              { "path": "/api/chat", "uuid": "uuid-ep-1" },
              { "path": "/api/chat/:id", "uuid": "uuid-ep-2" }
            ]
          }
        ]
      }
  2. Table Layout:

    • Columns:

      • Name (Feature flag name)
      • Description (Feature flag description)
      • Status (Toggle for enabled/disabled state)
      • Actions (Buttons for edit, delete, and manage endpoints)
    • Row Actions:

      • Toggle: Enable or disable the feature flag by interacting with the PUT /feature_flags/{id} endpoint.
      • Edit Button: Logs "Edit Button has been clicked" to the console
      • Delete Button: Logs "Delete Button has been clicked" to the console
      • Manage Endpoints Button: Logs "Manage Endpoints button has been clicked" to the console
  3. Create Feature Flag Button:

    • A button placed prominently above or near the table.
    • Clicking the button opens a modal or navigates to a new page for feature flag creation:
      • Fields: Name, Description, Enabled (default: false), Endpoints (dynamically add input fields).
      • API integration with POST /feature_flags.
      • API Request Body
          {
            "name": "Chat",
            "description": "Enable the chat feature",
            "enabled": false,
            "endpoints": [
               "/api/chat",
              "/api/chat/:id"
            ]
          }
      
  4. Responsive Design:

    • Ensure the table and buttons are responsive for different screen sizes:
      • Collapse table columns into a card view on smaller screens.
      • Actions (toggle, edit, delete) should remain easily accessible.
  5. Integration:

    • On Page Load:
      • Fetch the feature flags data using GET /feature_flags and populate the table.
    • Actions:
      • Handle all user interactions with appropriate API calls (PUT, DELETE, etc.).
      • Update the UI dynamically based on the API responses.

UI Mockup Context

  1. Feature Flags Table (Desktop View):

    • Table headers: Name | Description | Status | Actions
    • Example row:
      | Chat | Enable the chat feature | ❌ Disabled | [Toggle] [Edit] [Delete] [Manage Endpoints] |
  2. Feature Flags Table (Mobile View):

    • Collapse rows into cards:
      Name: Chat
      Description: Enable the chat feature
      Status: ❌ Disabled
      Actions: [Toggle] [Edit] [Delete] [Manage Endpoints]
      
  3. Create Feature Flag Modal:

    • Form fields: Name (text input), Description (textarea), Enabled (toggle), Endpoints (dynamically add input fields).

Expected API Requests

  • GET /feature_flags: Populate the table with all feature flags.
  • PUT /feature_flags/{id}: Update the enabled status dynamically from the toggle.
  • POST /feature_flags: Create a new feature flag.

Testing Checklist

  • Ensure the table accurately reflects the API response.
  • Test toggle functionality for enabling/disabling flags.
  • Validate the modals for creating feature flags.
  • Verify all API interactions return proper success messages and data updates.

UX Context:
Admins can view all feature flags in a table format. Toggles make it easy to change status, while buttons allow for more granular management.

@aliraza556
Copy link
Contributor

@tobi-bams assign me

@Shoaibdev7
Copy link
Contributor

@tobi-bams @humansinstitute I can help?

@saithsab877
Copy link
Contributor

@humansinstitute assign me?

@tobi-bams tobi-bams changed the title Admin Dashboard - Feature Flag Lis Admin Dashboard - Feature Flag List Dec 19, 2024
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