Skip to content

Commit

Permalink
Feat remove feature group (#72)
Browse files Browse the repository at this point in the history
* feat: remove featureGroup and update management category

Signed-off-by: Lin Wang <wonglam@amazon.com>

* feat: filter out empty feature category

Signed-off-by: Lin Wang <wonglam@amazon.com>

---------

Signed-off-by: Lin Wang <wonglam@amazon.com>
  • Loading branch information
wanglam authored and SuZhou-Joe committed Aug 31, 2023
1 parent 69849fd commit a5f4c40
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/core/public/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,6 @@ export interface App<HistoryLocationState = unknown> {
*/
exactRoute?: boolean;

/**
* The feature group of workspace, won't be displayed as feature if feature set is ADMIN.
*/
featureGroup?: Array<'WORKSPACE' | 'ADMIN'>;

/**
* The dependencies of one application, required feature will be automatic select and can't
* be unselect in the workspace configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ import {
} from '@elastic/eui';

import { WorkspaceTemplate } from '../../../../../core/types';
import { App, AppNavLinkStatus, ApplicationStart } from '../../../../../core/public';
import {
App,
AppNavLinkStatus,
ApplicationStart,
DEFAULT_APP_CATEGORIES,
} from '../../../../../core/public';
import { useApplications, useWorkspaceTemplate } from '../../hooks';
import { WORKSPACE_OP_TYPE_CREATE, WORKSPACE_OP_TYPE_UPDATE } from '../../../common/constants';
import {
Expand Down Expand Up @@ -122,17 +127,20 @@ export const WorkspaceForm = ({
const apps = category2Applications[currentKey];
const features = apps
.filter(
({ navLinkStatus, chromeless, featureGroup }) =>
({ navLinkStatus, chromeless, category }) =>
navLinkStatus !== AppNavLinkStatus.hidden &&
!chromeless &&
featureGroup?.includes('WORKSPACE')
category?.id !== DEFAULT_APP_CATEGORIES.management.id
)
.map(({ id, title, workspaceTemplate, dependencies }) => ({
id,
name: title,
templates: workspaceTemplate || [],
dependencies,
}));
if (features.length === 0) {
return previousValue;
}
if (features.length === 1 || currentKey === 'undefined') {
return [...previousValue, ...features];
}
Expand Down

0 comments on commit a5f4c40

Please sign in to comment.