mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-01-24 23:36:48 -06:00
Fixed an issue while saving grant wizard data with user-defined functions. Fixes #6826
This commit is contained in:
parent
8ac38a076b
commit
3da85f415d
@ -100,11 +100,38 @@ export default function GrantWizard({ sid, did, nodeInfo, nodeData }) {
|
||||
},
|
||||
{
|
||||
Header: 'Name',
|
||||
accessor: 'name',
|
||||
accessor: 'name_with_args',
|
||||
sortble: true,
|
||||
resizable: true,
|
||||
disableGlobalFilter: false,
|
||||
minWidth: 280
|
||||
},
|
||||
{
|
||||
Header: 'parameters',
|
||||
accessor: 'proargs',
|
||||
sortble: false,
|
||||
resizable: false,
|
||||
disableGlobalFilter: false,
|
||||
minWidth: 280,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
Header: 'Name',
|
||||
accessor: 'name',
|
||||
sortble: false,
|
||||
resizable: false,
|
||||
disableGlobalFilter: false,
|
||||
minWidth: 280,
|
||||
isVisible: false
|
||||
},
|
||||
{
|
||||
Header: 'ID',
|
||||
accessor: 'oid',
|
||||
sortble: false,
|
||||
resizable: false,
|
||||
disableGlobalFilter: false,
|
||||
minWidth: 280,
|
||||
isVisible: false
|
||||
}
|
||||
];
|
||||
var steps = ['Object Selection', 'Privilege Selection', 'Review Selection'];
|
||||
@ -168,6 +195,11 @@ export default function GrantWizard({ sid, did, nodeInfo, nodeData }) {
|
||||
element['icon'] = {
|
||||
'object_type': element.icon
|
||||
};
|
||||
if(element.object_type === 'Function') {
|
||||
element.name_with_args = element.name + '(' + (typeof(element.proargs) != 'undefined' ? element.proargs : '') + ')';
|
||||
} else {
|
||||
element.name_with_args = element.name;
|
||||
}
|
||||
});
|
||||
setTableData(data);
|
||||
setLoaderText('');
|
||||
|
@ -118,7 +118,8 @@ export default function PgTable({ columns, data, isSelectRow, ...props }) {
|
||||
prepareRow,
|
||||
selectedFlatRows,
|
||||
state: { selectedRowIds },
|
||||
setGlobalFilter
|
||||
setGlobalFilter,
|
||||
setHiddenColumns
|
||||
} = useTable(
|
||||
{
|
||||
columns,
|
||||
@ -170,6 +171,21 @@ export default function PgTable({ columns, data, isSelectRow, ...props }) {
|
||||
}
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
setHiddenColumns(
|
||||
columns
|
||||
.filter((column) => {
|
||||
if (column.isVisible === undefined || columns.isVisible === true) {
|
||||
return false;
|
||||
} else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
)
|
||||
.map((column) => column.accessor)
|
||||
);
|
||||
}, [setHiddenColumns, columns]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (props.setSelectedRows) {
|
||||
props.setSelectedRows(selectedFlatRows);
|
||||
|
Loading…
Reference in New Issue
Block a user