utils.tsx 736 B

12345678910111213141516
  1. import {replayFrontendPlatforms} from 'sentry/data/platformCategories';
  2. import platforms from 'sentry/data/platforms';
  3. import type {PlatformIntegration} from 'sentry/types/project';
  4. export function replayJsFrameworkOptions(): PlatformIntegration[] {
  5. // the platforms array is sorted alphabetically, but we want javascript to be
  6. // at the front so that it shows up by default in the onboarding.
  7. const frameworks = platforms.filter(p => replayFrontendPlatforms.includes(p.id));
  8. const jsPlatformIdx = frameworks.findIndex(p => p.id === 'javascript');
  9. const jsPlatform = frameworks[jsPlatformIdx];
  10. // move javascript to the front
  11. frameworks.splice(jsPlatformIdx, 1);
  12. frameworks.unshift(jsPlatform);
  13. return frameworks;
  14. }