Fix: condition improved
@@ -25,26 +25,27 @@ export const ViewInfoListItems: React.FunctionComponent<IViewInfoListItemsProps>
]);
const getTableRows = () => {
- const sizedRows: IRow[] = [];
+ const tableRows: IRow[] = [];
for (const row of props.filteredAndSorted) {
const rowValues: IRow = [];
const theValue = {
title: row.viewName,
} as IRow;
rowValues.push(theValue);
- const nodePath = row.nodePath.join('/');
- rowValues.push(nodePath)
- if(row.isUpdate){
- rowValues.push(<Label type="warning">Update</Label>)
- }else{
- rowValues.push(<span/>);
- }
+ const nodePath = `/${row.nodePath.join('/')}`;
+ rowValues.push(nodePath);
+ const updateLabel = row.isUpdate ? (
+ <Label type="warning">Update</Label>
+ ) : (
+ <span />
+ );
+ rowValues.push(updateLabel);
if (props.selectedViewNames.includes(row.viewName)) {
rowValues.selected = true;
}
- sizedRows.push(rowValues);
+ tableRows.push(rowValues);
}
- return sizedRows.length > 0 ? sizedRows : [];
+ return tableRows.length > 0 ? tableRows : [];
};
let rowsList = getTableRows();
@@ -61,7 +62,6 @@ export const ViewInfoListItems: React.FunctionComponent<IViewInfoListItemsProps>
setColumns(updatedColumn);
},[rowUpdate]);
-
const onSelect = (event: any, isSelected: any, rowId: any) => {
let rows;
if (rowId === -1) {
