Skip to content

Commit

Permalink
added sorting components
Browse files Browse the repository at this point in the history
Signed-off-by: Saurabh Kumar Singh <[email protected]>
  • Loading branch information
singh1203 committed Aug 1, 2024
1 parent 37b9e42 commit b7faceb
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 68 deletions.
121 changes: 99 additions & 22 deletions ui/components/DashboardComponent/resources/configuration/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -158,8 +165,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -293,8 +307,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -410,8 +431,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -529,8 +557,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -692,8 +727,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -811,8 +853,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -988,8 +1037,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -1105,8 +1161,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -1224,8 +1287,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -1356,8 +1426,15 @@ export const ConfigurationTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down
11 changes: 9 additions & 2 deletions ui/components/DashboardComponent/resources/namespace/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ export const NamespaceTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down
55 changes: 45 additions & 10 deletions ui/components/DashboardComponent/resources/network/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,15 @@ export const NetWorkTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -269,8 +276,15 @@ export const NetWorkTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -387,8 +401,15 @@ export const NetWorkTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -534,8 +555,15 @@ export const NetWorkTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down Expand Up @@ -670,8 +698,15 @@ export const NetWorkTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down
11 changes: 9 additions & 2 deletions ui/components/DashboardComponent/resources/nodes/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,15 @@ export const NodeTableConfig = (
label: 'Name',
options: {
sort: true,
customHeadRender: function CustomHead({ ...column }) {
return <DefaultTableCell columnData={column} />;
customHeadRender: function CustomHead({ index, ...column }, sortColumn, columnMeta) {
return (
<SortableTableCell
index={index}
columnData={column}
columnMeta={columnMeta}
onSort={() => sortColumn(index)}
/>
);
},
customBodyRender: function CustomBody(value, tableMeta) {
return (
Expand Down
Loading

0 comments on commit b7faceb

Please sign in to comment.