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