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',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'containers',
|
||||
tableConfig: {
|
||||
@ -73,7 +73,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'dashboards',
|
||||
tableConfig: {
|
||||
@ -94,7 +94,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'databases',
|
||||
tableConfig: {
|
||||
@ -115,7 +115,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'databaseSchemas',
|
||||
tableConfig: {
|
||||
@ -136,7 +136,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'glossaryTerm',
|
||||
tableConfig: {
|
||||
@ -157,7 +157,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'mlmodels',
|
||||
tableConfig: {
|
||||
@ -178,7 +178,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'pipelines',
|
||||
tableConfig: {
|
||||
@ -199,7 +199,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'searchIndexes',
|
||||
tableConfig: {
|
||||
@ -220,7 +220,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'storedProcedures',
|
||||
tableConfig: {
|
||||
@ -241,7 +241,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'tables',
|
||||
tableConfig: {
|
||||
@ -262,7 +262,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'topics',
|
||||
tableConfig: {
|
||||
@ -282,7 +282,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'apiCollections',
|
||||
tableConfig: {
|
||||
@ -303,7 +303,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'apiEndpoints',
|
||||
tableConfig: {
|
||||
@ -323,7 +323,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'dataProducts',
|
||||
tableConfig: {
|
||||
@ -343,7 +343,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'domains',
|
||||
tableConfig: {
|
||||
@ -363,7 +363,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'dashboardDataModels',
|
||||
tableConfig: {
|
||||
@ -383,7 +383,7 @@ export const CUSTOM_PROPERTIES_ENTITIES = {
|
||||
dateFormatConfig: 'yyyy-MM-dd',
|
||||
dateTimeFormatConfig: 'yyyy-MM-dd HH:mm:ss',
|
||||
timeFormatConfig: 'HH:mm:ss',
|
||||
entityReferenceConfig: ['User', 'Team'],
|
||||
entityReferenceConfig: ['User', 'Team', 'Metric'],
|
||||
entityObj: {},
|
||||
entityApiType: 'metrics',
|
||||
tableConfig: {
|
||||
|
||||
@ -784,7 +784,7 @@ export const editCreatedProperty = async (
|
||||
page.locator(
|
||||
`[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',
|
||||
label: 'Team',
|
||||
},
|
||||
{
|
||||
key: 'metric',
|
||||
value: 'metric',
|
||||
label: 'Metric',
|
||||
},
|
||||
];
|
||||
|
||||
// supported date formats on backend
|
||||
|
||||
@ -14,6 +14,7 @@ import {
|
||||
DEFAULT_DATE_FORMAT,
|
||||
DEFAULT_DATE_TIME_FORMAT,
|
||||
DEFAULT_TIME_FORMAT,
|
||||
ENTITY_REFERENCE_OPTIONS,
|
||||
SUPPORTED_DATE_TIME_FORMATS_ANTD_FORMAT_MAPPING,
|
||||
} from '../constants/CustomProperty.constants';
|
||||
import {
|
||||
@ -168,4 +169,47 @@ describe('CustomProperty.utils', () => {
|
||||
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