Skip to content

Commit 0b6d1ad

Browse files
committed
update workspace tables
Signed-off-by: aabidsofi19 <[email protected]>
1 parent 092ab07 commit 0b6d1ad

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

src/custom/CatalogDesignTable/DesignTableColumnConfig.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ interface ColumnConfigProps {
2828
handleCopyUrl: (type: string, name: string, id: string) => void;
2929
handleClone: (name: string, id: string) => void;
3030
handleShowDetails: (designId: string, designName: string) => void;
31+
handleOpenInDesigner?: (designId: string, designName: string) => void;
3132
handleDownload?: (design: Pattern) => void;
3233
getDownloadUrl?: (id: string) => string;
3334
isDownloadAllowed: boolean;
@@ -39,6 +40,7 @@ interface ColumnConfigProps {
3940
isFromWorkspaceTable?: boolean;
4041
isRemoveAllowed?: boolean;
4142
theme?: Theme;
43+
showPlaygroundActions: boolean;
4244
}
4345

4446
export const colViews: ColView[] = [
@@ -68,6 +70,8 @@ export const createDesignsColumnsConfig = ({
6870
isDownloadAllowed,
6971
isRemoveAllowed,
7072
theme,
73+
handleOpenInDesigner,
74+
showPlaygroundActions = true,
7175
isFromWorkspaceTable = false
7276
}: ColumnConfigProps): MUIDataTableColumn[] => {
7377
return [
@@ -208,6 +212,7 @@ export const createDesignsColumnsConfig = ({
208212
},
209213
{
210214
title: 'Open in Playground',
215+
hidden: showPlaygroundActions == false,
211216
onClick: () => {
212217
window.open(
213218
`https://playground.meshery.io/extension/meshmap?mode=${
@@ -220,13 +225,25 @@ export const createDesignsColumnsConfig = ({
220225
<KanvasIcon width={24} height={24} primaryFill={theme?.palette.icon.secondary} />
221226
)
222227
},
228+
229+
{
230+
hidden: !handleOpenInDesigner,
231+
title: 'Open in Designer',
232+
// disabled : !handleOpenInDesigner,
233+
onClick: () =>
234+
handleOpenInDesigner && handleOpenInDesigner(rowData?.id, rowData?.name),
235+
icon: (
236+
<KanvasIcon width={24} height={24} primaryFill={theme?.palette.icon.secondary} />
237+
)
238+
},
239+
223240
{
224241
title: isFromWorkspaceTable ? 'Move Design' : 'Delete',
225242
disabled: isFromWorkspaceTable ? !isRemoveAllowed : !isDeleteAllowed,
226243
onClick: () => handleDeleteModal(rowData)(),
227244
icon: <L5DeleteIcon />
228245
}
229-
];
246+
].filter((a) => a.hidden != true);
230247

231248
const publishAction = {
232249
title: 'Publish',

src/custom/Workspaces/DesignTable.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import useDesignAssignment from './hooks/useDesignAssignment';
2121
import { L5EditIcon, TableHeader, TableRightActionHeader } from './styles';
2222
export interface DesignTableProps {
2323
workspaceId: string;
24+
isKanvasEnabled: boolean;
2425
workspaceName: string;
2526
designsOfWorkspace: any;
2627
meshModelModelsData: any;
@@ -56,6 +57,8 @@ export interface DesignTableProps {
5657
isAssignAllowed: boolean;
5758
isRemoveAllowed: boolean;
5859
setDesignSearch: (value: string) => void;
60+
handleOpenInDesigner?: (designId: string, designName: string) => void;
61+
showPlaygroundActions?: boolean;
5962
}
6063

6164
export interface PublishModalState {
@@ -96,7 +99,9 @@ const DesignTable: React.FC<DesignTableProps> = ({
9699
isAssignAllowed,
97100
isRemoveAllowed,
98101
useGetWorkspaceDesignsQuery,
99-
setDesignSearch
102+
setDesignSearch,
103+
handleOpenInDesigner,
104+
showPlaygroundActions = true
100105
}) => {
101106
const [publishModal, setPublishModal] = useState<PublishModalState>({
102107
open: false,
@@ -132,7 +137,9 @@ const DesignTable: React.FC<DesignTableProps> = ({
132137
isUnpublishAllowed,
133138
isFromWorkspaceTable: true,
134139
isRemoveAllowed,
135-
theme
140+
theme,
141+
handleOpenInDesigner,
142+
showPlaygroundActions
136143
});
137144

138145
const [publishSchema, setPublishSchema] = useState<{

src/custom/Workspaces/WorkspaceViewsTable.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ interface ViewsTableProps {
3838
isRemoveAllowed: boolean;
3939
isAssignAllowed: boolean;
4040
handleShowDetails: (viewId: string, viewName: string, filterType: string) => void;
41+
handleOpenInOperator?: (designId: string, viewName: string, filterType: string) => void;
42+
showPlaygroundActions?: boolean;
4143
}
4244

4345
const colViews: ColView[] = [

0 commit comments

Comments
 (0)