diff --git a/src/routes/settings/platformProjects/platformProjects.tsx b/src/routes/settings/platformProjects/platformProjects.tsx index 2bd16617e..5b35480a2 100644 --- a/src/routes/settings/platformProjects/platformProjects.tsx +++ b/src/routes/settings/platformProjects/platformProjects.tsx @@ -107,17 +107,18 @@ const PlatformProjects: React.FC = ({ canWrite }) => { }; const getToolbar = (categories: SettingsData[]) => { - const hasEnabledItem = selectedItems.find(item => item.enabled); - const hasDisabledItem = selectedItems.find(item => !item.enabled); + const hasEnabledPlatformGroup = selectedItems.find(item => item.group === 'Platform' && !item.default); + const hasDisabledPlatformGroup = selectedItems.find(item => item.group !== 'Platform' && !item.default); const itemsTotal = settings?.meta ? settings.meta.count : 0; + const unAvailableCategories = categories.filter(item => item.default); return ( = ({ canWrite }) => { } else if (action === 'page') { const newSelectedItems = [...selectedItems]; getCategories().map(val => { - if (!newSelectedItems.find(item => item.project === val.project)) { + if (!newSelectedItems.find(item => item.project === val.project) && !val.default) { newSelectedItems.push(val); } }); @@ -175,10 +176,14 @@ const PlatformProjects: React.FC = ({ canWrite }) => { const handleOnRemove = () => { if (selectedItems.length > 0) { - const payload = selectedItems.map(item => ({ - project: item.project, - group: null, - })); + const payload = selectedItems.map(item => { + if (!item.default) { + return { + project: item.project, + group: item.group, + }; + } + }); setSelectedItems([], () => { dispatch(settingsActions.updateSettings(SettingsType.platformProjectsRemove, payload as any)); });