|
@@ -10,9 +10,9 @@ import NavTabs from 'sentry/components/navTabs';
|
|
|
import SearchBar from 'sentry/components/searchBar';
|
|
|
import {DEFAULT_DEBOUNCE_DURATION} from 'sentry/constants';
|
|
|
import categoryList, {
|
|
|
- deprecatedPlatforms,
|
|
|
+ createablePlatforms,
|
|
|
filterAliases,
|
|
|
-} from 'sentry/data/platformCategories';
|
|
|
+} from 'sentry/data/platformPickerCategories';
|
|
|
import platforms, {otherPlatform} from 'sentry/data/platforms';
|
|
|
import {IconClose, IconProject} from 'sentry/icons';
|
|
|
import {t, tct} from 'sentry/locale';
|
|
@@ -20,14 +20,6 @@ import {space} from 'sentry/styles/space';
|
|
|
import {Organization, PlatformIntegration, PlatformKey} from 'sentry/types';
|
|
|
import {trackAnalytics} from 'sentry/utils/analytics';
|
|
|
|
|
|
-export const PLATFORM_CATEGORIES: {
|
|
|
- id: string;
|
|
|
- name: string;
|
|
|
- platforms?: PlatformKey[];
|
|
|
-}[] = [...JSON.parse(JSON.stringify(categoryList)), {id: 'all', name: t('All')}];
|
|
|
-
|
|
|
-const activePlatforms = platforms.filter(({id}) => !deprecatedPlatforms.has(id));
|
|
|
-
|
|
|
const PlatformList = styled('div')`
|
|
|
display: grid;
|
|
|
gap: ${space(1)};
|
|
@@ -35,7 +27,11 @@ const PlatformList = styled('div')`
|
|
|
margin-bottom: ${space(2)};
|
|
|
`;
|
|
|
|
|
|
-export type Category = (typeof PLATFORM_CATEGORIES)[number]['id'];
|
|
|
+const selectablePlatforms = platforms.filter(platform =>
|
|
|
+ createablePlatforms.has(platform.id)
|
|
|
+);
|
|
|
+
|
|
|
+export type Category = (typeof categoryList)[number]['id'];
|
|
|
|
|
|
export type Platform = PlatformIntegration & {
|
|
|
category: Category;
|
|
@@ -64,7 +60,7 @@ class PlatformPicker extends Component<PlatformPickerProps, State> {
|
|
|
};
|
|
|
|
|
|
state: State = {
|
|
|
- category: this.props.defaultCategory ?? PLATFORM_CATEGORIES[0].id,
|
|
|
+ category: this.props.defaultCategory ?? categoryList[0].id,
|
|
|
filter: this.props.noAutoFilter ? '' : (this.props.platform || '').split('-')[0],
|
|
|
};
|
|
|
|
|
@@ -81,14 +77,10 @@ class PlatformPicker extends Component<PlatformPickerProps, State> {
|
|
|
filterAliases[platform.id as PlatformKey]?.some(alias => alias.includes(filter));
|
|
|
|
|
|
const categoryMatch = (platform: PlatformIntegration) => {
|
|
|
- if (category === 'all') {
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- return (currentCategory?.platforms as undefined | string[])?.includes(platform.id);
|
|
|
+ return currentCategory?.platforms?.has(platform.id);
|
|
|
};
|
|
|
|
|
|
- const filtered = activePlatforms
|
|
|
+ const filtered = selectablePlatforms
|
|
|
.filter(this.state.filter ? subsetMatch : categoryMatch)
|
|
|
.sort((a, b) => a.id.localeCompare(b.id));
|
|
|
|
|
@@ -115,7 +107,7 @@ class PlatformPicker extends Component<PlatformPickerProps, State> {
|
|
|
<Fragment>
|
|
|
<NavContainer>
|
|
|
<CategoryNav>
|
|
|
- {PLATFORM_CATEGORIES.map(({id, name}) => (
|
|
|
+ {categoryList.map(({id, name}) => (
|
|
|
<ListLink
|
|
|
key={id}
|
|
|
onClick={(e: React.MouseEvent) => {
|