+
-
- {getEntityName(personaDetails)}
-
+
+
+ }
+ name={personaDetails?.name}
+ serviceName={personaDetails.name}
+ />
{
);
const [testCaseSummary, setTestCaseSummary] = useState();
+ const tableFqn = useMemo(
+ () =>
+ getPartialNameFromTableFQN(
+ datasetFQN,
+ [FqnPart.Service, FqnPart.Database, FqnPart.Schema, FqnPart.Table],
+ FQN_SEPARATOR_CHAR
+ ),
+ [datasetFQN]
+ );
+
const extraDropdownContent = useMemo(
() =>
entityUtilClassBase.getManageExtraOptions(
EntityType.TABLE,
- datasetFQN,
+ tableFqn,
tablePermissions
),
- [tablePermissions, datasetFQN]
+ [tablePermissions, tableFqn]
);
const { viewUsagePermission, viewTestCasePermission } = useMemo(
@@ -160,16 +170,6 @@ const TableDetailsPageV1: React.FC = () => {
[tablePermissions]
);
- const tableFqn = useMemo(
- () =>
- getPartialNameFromTableFQN(
- datasetFQN,
- [FqnPart.Service, FqnPart.Database, FqnPart.Schema, FqnPart.Table],
- FQN_SEPARATOR_CHAR
- ),
- [datasetFQN]
- );
-
const isViewTableType = useMemo(
() => tableDetails?.tableType === TableType.View,
[tableDetails?.tableType]
@@ -560,7 +560,7 @@ const TableDetailsPageV1: React.FC = () => {
{
editCustomAttributePermission
}
editTagPermission={editTagsPermission}
- entityFQN={datasetFQN}
+ entityFQN={tableFqn}
entityId={tableDetails?.id ?? ''}
entityType={EntityType.TABLE}
selectedTags={tableTags}
@@ -635,14 +635,22 @@ const TableDetailsPageV1: React.FC = () => {
),
[
+ isTourPage,
+ tableTags,
+ joinedTables,
+ tableFqn,
isEdit,
+ deleted,
tableDetails,
entityName,
onDescriptionEdit,
onDescriptionUpdate,
+ testCaseSummary,
editTagsPermission,
editDescriptionPermission,
editAllPermission,
+ viewAllPermission,
+ editCustomAttributePermission,
]
);
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.test.tsx
index 06ebac77d8e..4cfb863ab1f 100644
--- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.test.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.test.tsx
@@ -58,6 +58,9 @@ jest.mock('../../../utils/TasksUtils', () => ({
getBreadCrumbList: jest.fn().mockReturnValue([]),
getTaskMessage: jest.fn().mockReturnValue('Task message'),
getTaskAssignee: jest.fn().mockReturnValue(MOCK_TASK_ASSIGNEE),
+ getTaskEntityFQN: jest
+ .fn()
+ .mockReturnValue('sample_data.ecommerce_db.shopify.dim_location'),
}));
jest.mock('../shared/Assignees', () =>
jest.fn().mockImplementation(() => Assignees.component
)
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.tsx
index ce44320100f..1dc32d813b7 100644
--- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestDescriptionPage/RequestDescriptionPage.tsx
@@ -47,6 +47,7 @@ import {
fetchOptions,
getBreadCrumbList,
getTaskAssignee,
+ getTaskEntityFQN,
getTaskMessage,
} from '../../../utils/TasksUtils';
import { showErrorToast, showSuccessToast } from '../../../utils/ToastUtils';
@@ -64,7 +65,7 @@ const RequestDescription = () => {
const { entityType } = useParams<{ entityType: EntityType }>();
- const { fqn: decodedEntityFQN } = useFqn();
+ const { fqn } = useFqn();
const queryParams = new URLSearchParams(location.search);
const field = queryParams.get('field');
@@ -76,6 +77,11 @@ const RequestDescription = () => {
const [suggestion, setSuggestion] = useState('');
const [isLoading, setIsLoading] = useState(false);
+ const entityFQN = useMemo(
+ () => getTaskEntityFQN(entityType, fqn),
+ [fqn, entityType]
+ );
+
const taskMessage = useMemo(
() =>
getTaskMessage({
@@ -116,7 +122,7 @@ const RequestDescription = () => {
const data: CreateThread = {
from: currentUser?.name as string,
message: value.title || taskMessage,
- about: getEntityFeedLink(entityType, decodedEntityFQN, getTaskAbout()),
+ about: getEntityFeedLink(entityType, entityFQN, getTaskAbout()),
taskDetails: {
assignees: assignees.map((assignee) => ({
id: assignee.value,
@@ -138,7 +144,7 @@ const RequestDescription = () => {
history.push(
entityUtilClassBase.getEntityLink(
entityType,
- decodedEntityFQN,
+ entityFQN,
EntityTabs.ACTIVITY_FEED,
ActivityFeedTabs.TASKS
)
@@ -152,8 +158,8 @@ const RequestDescription = () => {
};
useEffect(() => {
- fetchEntityDetail(entityType, decodedEntityFQN, setEntityData);
- }, [decodedEntityFQN, entityType]);
+ fetchEntityDetail(entityType, entityFQN, setEntityData);
+ }, [entityFQN, entityType]);
useEffect(() => {
const defaultAssignee = getTaskAssignee(entityData as Glossary);
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.test.tsx
index 65c854ac854..9185b67dd5f 100644
--- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.test.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.test.tsx
@@ -59,6 +59,9 @@ jest.mock('../../../utils/TasksUtils', () => ({
getBreadCrumbList: jest.fn().mockReturnValue([]),
getTaskMessage: jest.fn().mockReturnValue('Task message'),
getTaskAssignee: jest.fn().mockReturnValue(MOCK_TASK_ASSIGNEE),
+ getTaskEntityFQN: jest
+ .fn()
+ .mockReturnValue('sample_data.ecommerce_db.shopify.dim_location'),
}));
jest.mock('../shared/Assignees', () =>
jest.fn().mockImplementation(() => Assignees.component
)
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.tsx
index eaff073b797..a5eb04e32ce 100644
--- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/RequestTagPage/RequestTagPage.tsx
@@ -46,6 +46,7 @@ import {
fetchOptions,
getBreadCrumbList,
getTaskAssignee,
+ getTaskEntityFQN,
getTaskMessage,
} from '../../../utils/TasksUtils';
import { showErrorToast, showSuccessToast } from '../../../utils/ToastUtils';
@@ -61,7 +62,7 @@ const RequestTag = () => {
const history = useHistory();
const [form] = useForm();
const { entityType } = useParams<{ entityType: EntityType }>();
- const { fqn: entityFQN } = useFqn();
+ const { fqn } = useFqn();
const queryParams = new URLSearchParams(location.search);
const field = queryParams.get('field');
@@ -73,6 +74,11 @@ const RequestTag = () => {
const [suggestion] = useState([]);
const [isLoading, setIsLoading] = useState(false);
+ const entityFQN = useMemo(
+ () => getTaskEntityFQN(entityType, fqn),
+ [fqn, entityType]
+ );
+
const taskMessage = useMemo(
() =>
getTaskMessage({
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.test.tsx
index 029decf955a..de9a49fb270 100644
--- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.test.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.test.tsx
@@ -80,6 +80,9 @@ jest.mock('../../../utils/TasksUtils', () => ({
description: mockTableData.columns[0].description,
})),
getTaskAssignee: jest.fn().mockReturnValue(MOCK_TASK_ASSIGNEE),
+ getTaskEntityFQN: jest
+ .fn()
+ .mockReturnValue('sample_data.ecommerce_db.shopify.dim_location'),
}));
jest.mock('../shared/Assignees', () =>
jest.fn().mockImplementation(() => Assignees.component
)
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.tsx
index fc551d633f4..a63d616cc3c 100644
--- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateDescriptionPage/UpdateDescriptionPage.tsx
@@ -50,6 +50,7 @@ import {
getColumnObject,
getEntityColumnsDetails,
getTaskAssignee,
+ getTaskEntityFQN,
getTaskMessage,
} from '../../../utils/TasksUtils';
import { showErrorToast, showSuccessToast } from '../../../utils/ToastUtils';
@@ -66,7 +67,7 @@ const UpdateDescription = () => {
const [form] = useForm();
const { entityType } = useParams<{ entityType: EntityType }>();
- const { fqn: entityFQN } = useFqn();
+ const { fqn } = useFqn();
const queryParams = new URLSearchParams(location.search);
const field = queryParams.get('field');
@@ -78,6 +79,11 @@ const UpdateDescription = () => {
const [currentDescription, setCurrentDescription] = useState('');
const [isLoading, setIsLoading] = useState(false);
+ const entityFQN = useMemo(
+ () => getTaskEntityFQN(entityType, fqn),
+ [fqn, entityType]
+ );
+
const sanitizeValue = useMemo(
() => value?.replaceAll(TASK_SANITIZE_VALUE_REGEX, '') ?? '',
[value]
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.test.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.test.tsx
index 1fa9b84980c..028c01e8c9e 100644
--- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.test.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.test.tsx
@@ -90,6 +90,9 @@ jest.mock('../../../utils/TasksUtils', () => ({
getColumnObject: jest.fn().mockImplementation(() => ({
tags: mockTableData.columns[0].tags,
})),
+ getTaskEntityFQN: jest
+ .fn()
+ .mockReturnValue('sample_data.ecommerce_db.shopify.dim_location'),
getTaskAssignee: jest.fn().mockReturnValue(MOCK_TASK_ASSIGNEE),
}));
jest.mock('../shared/Assignees', () =>
diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.tsx
index 27079ba4a04..a76afaf72bc 100644
--- a/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/pages/TasksPage/UpdateTagPage/UpdateTagPage.tsx
@@ -51,6 +51,7 @@ import {
getColumnObject,
getEntityColumnsDetails,
getTaskAssignee,
+ getTaskEntityFQN,
getTaskMessage,
} from '../../../utils/TasksUtils';
import { showErrorToast, showSuccessToast } from '../../../utils/ToastUtils';
@@ -68,7 +69,7 @@ const UpdateTag = () => {
const { entityType } = useParams<{ entityType: EntityType }>();
- const { fqn: entityFQN } = useFqn();
+ const { fqn } = useFqn();
const queryParams = new URLSearchParams(location.search);
const field = queryParams.get('field');
@@ -83,6 +84,11 @@ const UpdateTag = () => {
const [suggestion, setSuggestion] = useState([]);
const [isLoading, setIsLoading] = useState(false);
+ const entityFQN = useMemo(
+ () => getTaskEntityFQN(entityType, fqn),
+ [fqn, entityType]
+ );
+
const sanitizeValue = useMemo(
() => value?.replaceAll(TASK_SANITIZE_VALUE_REGEX, '') ?? '',
[value]
diff --git a/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less b/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less
index 778b076e16a..d0897617df8 100644
--- a/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less
+++ b/openmetadata-ui/src/main/resources/ui/src/styles/components/size.less
@@ -174,6 +174,9 @@
.w-max-full-140 {
max-width: calc(100% - 140px);
}
+.w-max-stretch {
+ max-width: stretch;
+}
.w-auto {
width: auto;
diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts
index 952d0f3a023..d08fad88811 100644
--- a/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts
+++ b/openmetadata-ui/src/main/resources/ui/src/utils/AdvancedSearchClassBase.ts
@@ -12,7 +12,7 @@
*/
import { t } from 'i18next';
-import { sortBy } from 'lodash';
+import { isEmpty, sortBy } from 'lodash';
import {
AsyncFetchListValues,
AsyncFetchListValuesResult,
@@ -97,19 +97,6 @@ class AdvancedSearchClassBase {
},
},
- 'columns.name.keyword': {
- label: t('label.column'),
- type: 'select',
- mainWidgetProps: this.mainWidgetProps,
- fieldSettings: {
- asyncFetch: this.autocomplete({
- searchIndex: SearchIndex.TABLE,
- entityField: EntityFields.COLUMN,
- }),
- useAsyncSearch: true,
- },
- },
-
tableType: {
label: t('label.table-type'),
type: 'select',
@@ -320,18 +307,6 @@ class AdvancedSearchClassBase {
useAsyncSearch: true,
},
},
- 'columns.name.keyword': {
- label: t('label.data-model-column'),
- type: 'select',
- mainWidgetProps: this.mainWidgetProps,
- fieldSettings: {
- asyncFetch: this.autocomplete({
- searchIndex: SearchIndex.DASHBOARD_DATA_MODEL,
- entityField: EntityFields.COLUMN,
- }),
- useAsyncSearch: true,
- },
- },
'project.keyword': {
label: t('label.project'),
type: 'select',
@@ -551,6 +526,36 @@ class AdvancedSearchClassBase {
};
}
+ // Since the column field key 'columns.name.keyword` is common in table and data model,
+ // Following function is used to get the column field config based on the search index
+ // or if it is an explore page
+ public getColumnConfig = (entitySearchIndex: SearchIndex[]) => {
+ const searchIndexWithColumns = entitySearchIndex.filter(
+ (index) =>
+ index === SearchIndex.TABLE ||
+ index === SearchIndex.DASHBOARD_DATA_MODEL ||
+ index === SearchIndex.DATA_ASSET ||
+ index === SearchIndex.ALL
+ );
+
+ return !isEmpty(searchIndexWithColumns)
+ ? {
+ 'columns.name.keyword': {
+ label: t('label.column'),
+ type: 'select',
+ mainWidgetProps: this.mainWidgetProps,
+ fieldSettings: {
+ asyncFetch: this.autocomplete({
+ searchIndex: searchIndexWithColumns,
+ entityField: EntityFields.COLUMN,
+ }),
+ useAsyncSearch: true,
+ },
+ },
+ }
+ : {};
+ };
+
/**
* Get entity specific fields for the query builder
*/
@@ -631,6 +636,7 @@ class AdvancedSearchClassBase {
...this.getCommonConfig({ entitySearchIndex, tierOptions }),
...(shouldAddServiceField ? serviceQueryBuilderFields : {}),
...this.getEntitySpecificQueryBuilderFields(entitySearchIndex),
+ ...this.getColumnConfig(entitySearchIndex),
};
// Sort the fields according to the label
@@ -648,7 +654,7 @@ class AdvancedSearchClassBase {
isExplorePage?: boolean
) => BasicConfig = (tierOptions, entitySearchIndex, isExplorePage) => {
const searchIndexWithServices = [
- SearchIndex.ALL,
+ SearchIndex.DATA_ASSET,
SearchIndex.TABLE,
SearchIndex.DASHBOARD,
SearchIndex.PIPELINE,
diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.test.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.test.tsx
index 0f286429427..b141b35405e 100644
--- a/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.test.tsx
+++ b/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.test.tsx
@@ -21,6 +21,7 @@ import {
fetchOptions,
getEntityTableName,
getTaskAssignee,
+ getTaskEntityFQN,
getTaskMessage,
} from './TasksUtils';
@@ -298,3 +299,28 @@ describe('Tests for getTaskAssignee', () => {
]);
});
});
+
+describe('Tests for getTaskEntityFQN', () => {
+ it('should return fqn for table entity', async () => {
+ const fqn = 'sample_data.ecommerce_db.shopify."dim.product"';
+ const response = getTaskEntityFQN(EntityType.TABLE, fqn);
+
+ expect(response).toEqual(fqn);
+ });
+
+ it('should return table fqn only when column name present in fqn', async () => {
+ const response = getTaskEntityFQN(
+ EntityType.TABLE,
+ 'sample_data.ecommerce_db.shopify."dim.product".address_id'
+ );
+
+ expect(response).toEqual('sample_data.ecommerce_db.shopify."dim.product"');
+ });
+
+ it('should return fqn as it is if entity type is not table', async () => {
+ const fqn = 'sample_looker.customers';
+ const response = getTaskEntityFQN(EntityType.DASHBOARD, fqn);
+
+ expect(response).toEqual(fqn);
+ });
+});
diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.ts
index 6ac37869555..01bbfc20cd3 100644
--- a/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.ts
+++ b/openmetadata-ui/src/main/resources/ui/src/utils/TasksUtils.ts
@@ -19,6 +19,7 @@ import { ReactComponent as CancelColored } from '../assets/svg/cancel-colored.sv
import { ReactComponent as EditColored } from '../assets/svg/edit-colored.svg';
import { ReactComponent as SuccessColored } from '../assets/svg/success-colored.svg';
import { ActivityFeedTabs } from '../components/ActivityFeed/ActivityFeedTab/ActivityFeedTab.interface';
+import { FQN_SEPARATOR_CHAR } from '../constants/char.constants';
import {
getEntityDetailsPath,
getGlossaryTermDetailsPath,
@@ -901,3 +902,15 @@ export const getTaskAssignee = (entityData: Glossary): Option[] => {
return defaultAssignee;
};
+
+export const getTaskEntityFQN = (entityType: EntityType, fqn: string) => {
+ if (entityType === EntityType.TABLE) {
+ return getPartialNameFromTableFQN(
+ fqn,
+ [FqnPart.Service, FqnPart.Database, FqnPart.Schema, FqnPart.Table],
+ FQN_SEPARATOR_CHAR
+ );
+ }
+
+ return fqn;
+};