Implement API Integration for Permission Settings

Summary

Connect the DAP permission settings frontend components to backend APIs for reading, updating, and persisting permission configurations.

Background

The permission settings component needs to communicate with backend APIs to load current settings, save changes, and handle validation errors from the server.

Requirements

API Integration

  • Connect to backend APIs for reading permission settings
  • Implement save/update functionality for permission changes
  • Handle both instance-level and group-level API endpoints
  • Support both REST and GraphQL endpoints as available

Data Management

  • Load current permission settings on component mount
  • Handle form state management and dirty checking
  • Implement optimistic updates with rollback on failure
  • Cache settings appropriately to avoid unnecessary API calls

Error Handling

  • Handle API failures gracefully with user-friendly messages
  • Show validation errors from backend
  • Implement retry mechanisms for failed requests
  • Handle network connectivity issues

User Feedback

  • Show loading states during API operations
  • Display success notifications after saving
  • Show error notifications with actionable messages
  • Implement proper form validation feedback

Technical Implementation

  • Use GitLab's API utilities and patterns
  • Implement proper Vue data binding
  • Add form validation and submission handling
  • Use appropriate HTTP methods (GET, PUT, POST)
  • Handle authentication and authorization

API Endpoints

Based on backend implementation:

  • Instance-level: GET/PUT /api/v4/admin/ai_settings or GraphQL equivalent
  • Group-level: GET/PUT /api/v4/groups/:id/namespace_settings or GraphQL equivalent

Acceptance Criteria

  • Component loads current permission settings from API
  • Changes can be saved successfully to backend
  • Proper error handling for API failures
  • Loading states shown during API operations
  • Success/error notifications displayed appropriately
  • Form validation works with backend validation
  • Works for both instance-level and group-level contexts

Related Issues

  • Parent Epic: #19742 (closed) - [Frontend] Role-based permissions controls DAP
  • Parent Epic: #19601 - Implement role-based access permissions for DAP
  • Depends on: Issue #1 (closed) - Create DAP Permission Settings Component
  • Depends on: #578552 (closed) - Backend API implementation
  • Related: #578551 (closed) - Role-based permissions DAP - Model implementation
Edited by 🤖 GitLab Bot 🤖