mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-02 19:48:17 +00:00
Feat(ui): Add "Metric" as an Option for Entity Reference Type Dropdown (#22272)
* added matric to entity reference * updated tests
This commit is contained in:
parent
9a364a5a8c
commit
b397e8861a
@ -52,7 +52,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'containers',
|
entityApiType: 'containers',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -73,7 +73,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'dashboards',
|
entityApiType: 'dashboards',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -94,7 +94,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'databases',
|
entityApiType: 'databases',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -115,7 +115,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'databaseSchemas',
|
entityApiType: 'databaseSchemas',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -136,7 +136,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'glossaryTerm',
|
entityApiType: 'glossaryTerm',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -157,7 +157,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'mlmodels',
|
entityApiType: 'mlmodels',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -178,7 +178,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'pipelines',
|
entityApiType: 'pipelines',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -199,7 +199,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'searchIndexes',
|
entityApiType: 'searchIndexes',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -220,7 +220,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'storedProcedures',
|
entityApiType: 'storedProcedures',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -241,7 +241,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'tables',
|
entityApiType: 'tables',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -262,7 +262,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'topics',
|
entityApiType: 'topics',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -282,7 +282,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'apiCollections',
|
entityApiType: 'apiCollections',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -303,7 +303,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'apiEndpoints',
|
entityApiType: 'apiEndpoints',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -323,7 +323,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'dataProducts',
|
entityApiType: 'dataProducts',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -343,7 +343,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'domains',
|
entityApiType: 'domains',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -363,7 +363,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'dashboardDataModels',
|
entityApiType: 'dashboardDataModels',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
@ -383,7 +383,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
|||||||
dateFormatConfig: 'yyyy-MM-dd',
|
dateFormatConfig: 'yyyy-MM-dd',
|
||||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||||
timeFormatConfig: 'HH:mm:ss',
|
timeFormatConfig: 'HH:mm:ss',
|
||||||
entityReferenceConfig: ['User', 'Team'],
|
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||||
entityObj: {},
|
entityObj: {},
|
||||||
entityApiType: 'metrics',
|
entityApiType: 'metrics',
|
||||||
tableConfig: {
|
tableConfig: {
|
||||||
|
|||||||
@ -784,7 +784,7 @@ export const editCreatedProperty = async (
|
|||||||
page.locator(
|
page.locator(
|
||||||
`[data-row-key="${propertyName}"] [data-testid="${propertyName}-config"]`
|
`[data-row-key="${propertyName}"] [data-testid="${propertyName}-config"]`
|
||||||
)
|
)
|
||||||
).toContainText('["user","team","table"]');
|
).toContainText('["user","team","metric","table"]');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -111,6 +111,11 @@ export const ENTITY_REFERENCE_OPTIONS = [
|
|||||||
value: 'team',
|
value: 'team',
|
||||||
label: 'Team',
|
label: 'Team',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'metric',
|
||||||
|
value: 'metric',
|
||||||
|
label: 'Metric',
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
// supported date formats on backend
|
// supported date formats on backend
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import {
|
|||||||
DEFAULT_DATE_FORMAT,
|
DEFAULT_DATE_FORMAT,
|
||||||
DEFAULT_DATE_TIME_FORMAT,
|
DEFAULT_DATE_TIME_FORMAT,
|
||||||
DEFAULT_TIME_FORMAT,
|
DEFAULT_TIME_FORMAT,
|
||||||
|
ENTITY_REFERENCE_OPTIONS,
|
||||||
SUPPORTED_DATE_TIME_FORMATS_ANTD_FORMAT_MAPPING,
|
SUPPORTED_DATE_TIME_FORMATS_ANTD_FORMAT_MAPPING,
|
||||||
} from '../constants/CustomProperty.constants';
|
} from '../constants/CustomProperty.constants';
|
||||||
import {
|
import {
|
||||||
@ -168,4 +169,47 @@ describe('CustomProperty.utils', () => {
|
|||||||
expect(result).toBe(expectedFormat);
|
expect(result).toBe(expectedFormat);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Entity Reference Options', () => {
|
||||||
|
it('should have correct structure for metric option', () => {
|
||||||
|
const metricOption = ENTITY_REFERENCE_OPTIONS.find(
|
||||||
|
(option) => option.key === 'metric'
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(metricOption).toMatchObject({
|
||||||
|
key: 'metric',
|
||||||
|
value: 'metric',
|
||||||
|
label: 'Metric',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have all expected entity types including metric', () => {
|
||||||
|
const expectedEntityTypes = [
|
||||||
|
'table',
|
||||||
|
'storedProcedure',
|
||||||
|
'databaseSchema',
|
||||||
|
'database',
|
||||||
|
'dashboard',
|
||||||
|
'dashboardDataModel',
|
||||||
|
'pipeline',
|
||||||
|
'topic',
|
||||||
|
'container',
|
||||||
|
'searchIndex',
|
||||||
|
'mlmodel',
|
||||||
|
'glossaryTerm',
|
||||||
|
'tag',
|
||||||
|
'user',
|
||||||
|
'team',
|
||||||
|
'metric',
|
||||||
|
];
|
||||||
|
|
||||||
|
const actualEntityTypes = ENTITY_REFERENCE_OPTIONS.map(
|
||||||
|
(option) => option.key
|
||||||
|
);
|
||||||
|
|
||||||
|
expectedEntityTypes.forEach((entityType) => {
|
||||||
|
expect(actualEntityTypes).toContain(entityType);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user