- Split SlackHandler class methods into individual handler functions
- Created separate files for each endpoint: initiate-oauth, handle-oauth-callback, get-integration, remove-integration, update-integration, get-channels
- Updated route definitions in index.ts to use new handler functions
- Created comprehensive unit tests for each new handler function
- Added missing updateIntegrationSettings function to slack-helpers.ts
- Removed old handler.ts and handler.test.ts files
- Updated integration tests to work with new structure
- Fixed formatting and import organization issues
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Add missing 'channels:join' and 'channels:manage' to required OAuth scopes
- Update scope validation to handle comma-separated scope format
- Include defaultChannel in 're_install_required' status response
- Ensures complete integration data is returned in all status cases
Fixes scope validation for existing integrations and missing default channel data in API responses.
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Add missing status field to GET /api/v2/slack/integration response
- Ensures 're_install_required' status reaches the UI for yellow button display
- Critical fix for scope validation feature to work end-to-end
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Create validateScopes helper to avoid code duplication
- Use shared function in both initiateOAuth and getIntegrationStatus
- Addresses code review feedback from greptile-apps[bot]
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Add deduplicateFilesByVersion helper function with informative logging
- Modify selectFilesForResponse to handle version-based deduplication
- Balance priority logic (dashboards over standalone created metrics) with deduplication
- Default missing version numbers to 1
- Add comprehensive tests for deduplication scenarios
- Preserve existing priority logic when no deduplication is needed
Fixes BUS-1434
Co-Authored-By: Dallin Bentley <dallinbentley98@gmail.com>
- Added functions to check if a user has access to metrics and dashboards through associated chats.
- Updated permission handling in `get_metric_data_handler`, `get_metric_for_dashboard_handler`, and `get_metric_handler` to include chat access checks.
- Enhanced error handling for cases where users lack access to both dashboards and chats.
- Updated `asset_access_checks` to include new chat access functions and modified the public interface in `lib.rs` accordingly.