mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-15 02:13:44 +00:00
fix(ui): pass encoded fqn to fetch table permission (#14538)
This commit is contained in:
parent
d3a75652cf
commit
a457e7a664
@ -28,6 +28,7 @@ import {
|
|||||||
import { EntityTags, TagFilterOptions } from 'Models';
|
import { EntityTags, TagFilterOptions } from 'Models';
|
||||||
import React, { useEffect, useMemo, useState } from 'react';
|
import React, { useEffect, useMemo, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useParams } from 'react-router-dom';
|
||||||
import { ReactComponent as IconEdit } from '../../assets/svg/edit-new.svg';
|
import { ReactComponent as IconEdit } from '../../assets/svg/edit-new.svg';
|
||||||
import FilterTablePlaceHolder from '../../components/common/ErrorWithPlaceholder/FilterTablePlaceHolder';
|
import FilterTablePlaceHolder from '../../components/common/ErrorWithPlaceholder/FilterTablePlaceHolder';
|
||||||
import EntityNameModal from '../../components/Modals/EntityNameModal/EntityNameModal.component';
|
import EntityNameModal from '../../components/Modals/EntityNameModal/EntityNameModal.component';
|
||||||
@ -48,6 +49,7 @@ import {
|
|||||||
getEntityName,
|
getEntityName,
|
||||||
getFrequentlyJoinedColumns,
|
getFrequentlyJoinedColumns,
|
||||||
} from '../../utils/EntityUtils';
|
} from '../../utils/EntityUtils';
|
||||||
|
import { getDecodedFqn } from '../../utils/StringsUtils';
|
||||||
import {
|
import {
|
||||||
getAllTags,
|
getAllTags,
|
||||||
searchTagInData,
|
searchTagInData,
|
||||||
@ -79,7 +81,6 @@ const SchemaTable = ({
|
|||||||
joins,
|
joins,
|
||||||
isReadOnly = false,
|
isReadOnly = false,
|
||||||
onThreadLinkSelect,
|
onThreadLinkSelect,
|
||||||
entityFqn,
|
|
||||||
tableConstraints,
|
tableConstraints,
|
||||||
tablePartitioned,
|
tablePartitioned,
|
||||||
}: SchemaTableProps) => {
|
}: SchemaTableProps) => {
|
||||||
@ -90,6 +91,8 @@ const SchemaTable = ({
|
|||||||
const [tablePermissions, setTablePermissions] =
|
const [tablePermissions, setTablePermissions] =
|
||||||
useState<OperationPermission>();
|
useState<OperationPermission>();
|
||||||
const [editColumn, setEditColumn] = useState<Column>();
|
const [editColumn, setEditColumn] = useState<Column>();
|
||||||
|
const { fqn: entityFqn } = useParams<{ fqn: string }>();
|
||||||
|
const decodedEntityFqn = getDecodedFqn(entityFqn);
|
||||||
|
|
||||||
const [editColumnDisplayName, setEditColumnDisplayName] = useState<Column>();
|
const [editColumnDisplayName, setEditColumnDisplayName] = useState<Column>();
|
||||||
const { getEntityPermissionByFqn } = usePermissionProvider();
|
const { getEntityPermissionByFqn } = usePermissionProvider();
|
||||||
@ -114,13 +117,16 @@ const SchemaTable = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const data = React.useMemo(
|
const data = React.useMemo(
|
||||||
() => makeData(searchedColumns),
|
() => makeData(searchedColumns),
|
||||||
[searchedColumns]
|
[searchedColumns]
|
||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchResourcePermission(entityFqn);
|
fetchResourcePermission(entityFqn);
|
||||||
}, [entityFqn]);
|
}, [entityFqn]);
|
||||||
|
|
||||||
const handleEditColumn = (column: Column): void => {
|
const handleEditColumn = (column: Column): void => {
|
||||||
setEditColumn(column);
|
setEditColumn(column);
|
||||||
};
|
};
|
||||||
@ -253,7 +259,7 @@ const SchemaTable = ({
|
|||||||
fqn: record.fullyQualifiedName ?? '',
|
fqn: record.fullyQualifiedName ?? '',
|
||||||
field: record.description,
|
field: record.description,
|
||||||
}}
|
}}
|
||||||
entityFqn={entityFqn}
|
entityFqn={decodedEntityFqn}
|
||||||
entityType={EntityType.TABLE}
|
entityType={EntityType.TABLE}
|
||||||
hasEditPermission={hasDescriptionEditAccess}
|
hasEditPermission={hasDescriptionEditAccess}
|
||||||
index={index}
|
index={index}
|
||||||
@ -426,7 +432,7 @@ const SchemaTable = ({
|
|||||||
filterIcon: getFilterIcon('tag-filter'),
|
filterIcon: getFilterIcon('tag-filter'),
|
||||||
render: (tags: TagLabel[], record: Column, index: number) => (
|
render: (tags: TagLabel[], record: Column, index: number) => (
|
||||||
<TableTags<Column>
|
<TableTags<Column>
|
||||||
entityFqn={entityFqn}
|
entityFqn={decodedEntityFqn}
|
||||||
entityType={EntityType.TABLE}
|
entityType={EntityType.TABLE}
|
||||||
handleTagSelection={handleTagSelection}
|
handleTagSelection={handleTagSelection}
|
||||||
hasTagEditAccess={hasTagEditAccess}
|
hasTagEditAccess={hasTagEditAccess}
|
||||||
@ -451,7 +457,7 @@ const SchemaTable = ({
|
|||||||
filterIcon: getFilterIcon('glossary-filter'),
|
filterIcon: getFilterIcon('glossary-filter'),
|
||||||
render: (tags: TagLabel[], record: Column, index: number) => (
|
render: (tags: TagLabel[], record: Column, index: number) => (
|
||||||
<TableTags<Column>
|
<TableTags<Column>
|
||||||
entityFqn={entityFqn}
|
entityFqn={decodedEntityFqn}
|
||||||
entityType={EntityType.TABLE}
|
entityType={EntityType.TABLE}
|
||||||
handleTagSelection={handleTagSelection}
|
handleTagSelection={handleTagSelection}
|
||||||
hasTagEditAccess={hasTagEditAccess}
|
hasTagEditAccess={hasTagEditAccess}
|
||||||
@ -469,7 +475,7 @@ const SchemaTable = ({
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
entityFqn,
|
decodedEntityFqn,
|
||||||
isReadOnly,
|
isReadOnly,
|
||||||
tableConstraints,
|
tableConstraints,
|
||||||
hasTagEditAccess,
|
hasTagEditAccess,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user