mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-03 06:03:12 +00:00
Fix types issue post schema changes (#5161)
This commit is contained in:
parent
628296d294
commit
4b33693ffd
@ -11,10 +11,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import { goToAddNewServicePage, testServiceCreationAndIngestion } from '../../common/common';
|
||||||
goToAddNewServicePage,
|
|
||||||
testServiceCreationAndIngestion,
|
|
||||||
} from '../../common/common';
|
|
||||||
|
|
||||||
describe('Metabase Ingestion', () => {
|
describe('Metabase Ingestion', () => {
|
||||||
it('add and ingest data', () => {
|
it('add and ingest data', () => {
|
||||||
@ -31,9 +28,6 @@ describe('Metabase Ingestion', () => {
|
|||||||
cy.get('#root_hostPort')
|
cy.get('#root_hostPort')
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.type(Cypress.env('metabaseHostPort'));
|
.type(Cypress.env('metabaseHostPort'));
|
||||||
cy.get('#root_dbServiceName')
|
|
||||||
.scrollIntoView()
|
|
||||||
.type(Cypress.env('metabaseDbServiceName'));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const addIngestionInput = () => {
|
const addIngestionInput = () => {
|
||||||
|
@ -143,9 +143,9 @@ describe('TeamsAndUsers page', () => {
|
|||||||
|
|
||||||
it('Add and remove user to team should work properly', () => {
|
it('Add and remove user to team should work properly', () => {
|
||||||
const searchString = 'aaron';
|
const searchString = 'aaron';
|
||||||
|
|
||||||
cy.wait(1000)
|
cy.wait(1000);
|
||||||
cy.get('[data-testid="add-new-user"]').should('be.visible');
|
cy.get('[data-testid="add-new-user"]').should('be.visible');
|
||||||
cy.get('[data-testid="add-new-user"]').click();
|
cy.get('[data-testid="add-new-user"]').click();
|
||||||
cy.get('.tw-modal-container').should('be.visible');
|
cy.get('.tw-modal-container').should('be.visible');
|
||||||
cy.get(
|
cy.get(
|
||||||
@ -276,11 +276,12 @@ describe('TeamsAndUsers page', () => {
|
|||||||
).as('searchApi');
|
).as('searchApi');
|
||||||
|
|
||||||
cy.wait('@searchApi');
|
cy.wait('@searchApi');
|
||||||
|
|
||||||
cy.get('[data-testid="table-link"]')
|
cy.get('[data-testid="table-link"]')
|
||||||
.first()
|
.first()
|
||||||
.contains(SEARCH_ENTITY_TABLE.table_1.term)
|
.contains(SEARCH_ENTITY_TABLE.table_1.term)
|
||||||
.click();
|
.as('resultLink');
|
||||||
|
cy.wait(500); // Wait for result to load after api success
|
||||||
|
cy.get('@resultLink').click();
|
||||||
|
|
||||||
cy.get('[data-testid="Manage"]').should('be.visible').click();
|
cy.get('[data-testid="Manage"]').should('be.visible').click();
|
||||||
cy.get('[data-testid="owner-dropdown"]').should('be.visible').click();
|
cy.get('[data-testid="owner-dropdown"]').should('be.visible').click();
|
||||||
|
@ -23,15 +23,15 @@ import { FilterPatternEnum } from '../../enums/filterPattern.enum';
|
|||||||
import { FormSubmitType } from '../../enums/form.enum';
|
import { FormSubmitType } from '../../enums/form.enum';
|
||||||
import { ServiceCategory } from '../../enums/service.enum';
|
import { ServiceCategory } from '../../enums/service.enum';
|
||||||
import {
|
import {
|
||||||
ConfigClass,
|
|
||||||
CreateIngestionPipeline,
|
CreateIngestionPipeline,
|
||||||
LogLevels,
|
LogLevels,
|
||||||
PipelineType,
|
PipelineType,
|
||||||
} from '../../generated/api/services/ingestionPipelines/createIngestionPipeline';
|
} from '../../generated/api/services/ingestionPipelines/createIngestionPipeline';
|
||||||
import {
|
import {
|
||||||
ConfigType,
|
ConfigClass,
|
||||||
FilterPattern,
|
FilterPattern,
|
||||||
IngestionPipeline,
|
IngestionPipeline,
|
||||||
|
TypeEnum,
|
||||||
} from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
|
} from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
|
||||||
import {
|
import {
|
||||||
DatabaseServiceMetadataPipelineClass,
|
DatabaseServiceMetadataPipelineClass,
|
||||||
@ -219,13 +219,13 @@ const AddIngestion = ({
|
|||||||
const usageIngestionType = useMemo(() => {
|
const usageIngestionType = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
(data?.source.sourceConfig.config as ConfigClass)?.type ??
|
(data?.source.sourceConfig.config as ConfigClass)?.type ??
|
||||||
ConfigType.DatabaseUsage
|
TypeEnum.DatabaseUsage
|
||||||
);
|
);
|
||||||
}, [data]);
|
}, [data]);
|
||||||
const profilerIngestionType = useMemo(() => {
|
const profilerIngestionType = useMemo(() => {
|
||||||
return (
|
return (
|
||||||
(data?.source.sourceConfig.config as ConfigClass)?.type ??
|
(data?.source.sourceConfig.config as ConfigClass)?.type ??
|
||||||
ConfigType.Profiler
|
TypeEnum.Profiler
|
||||||
);
|
);
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
@ -399,7 +399,7 @@ const AddIngestion = ({
|
|||||||
),
|
),
|
||||||
markDeletedTables,
|
markDeletedTables,
|
||||||
...DatabaseConfigData,
|
...DatabaseConfigData,
|
||||||
type: ConfigType.DatabaseMetadata,
|
type: TypeEnum.DatabaseMetadata,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
case ServiceCategory.MESSAGING_SERVICES: {
|
case ServiceCategory.MESSAGING_SERVICES: {
|
||||||
@ -408,7 +408,7 @@ const AddIngestion = ({
|
|||||||
topicFilterPattern,
|
topicFilterPattern,
|
||||||
showTopicFilter
|
showTopicFilter
|
||||||
),
|
),
|
||||||
type: ConfigType.MessagingMetadata,
|
type: TypeEnum.MessagingMetadata,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
case ServiceCategory.DASHBOARD_SERVICES: {
|
case ServiceCategory.DASHBOARD_SERVICES: {
|
||||||
@ -421,7 +421,7 @@ const AddIngestion = ({
|
|||||||
dashboardFilterPattern,
|
dashboardFilterPattern,
|
||||||
showDashboardFilter
|
showDashboardFilter
|
||||||
),
|
),
|
||||||
type: ConfigType.DashboardMetadata,
|
type: TypeEnum.DashboardMetadata,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@ -476,7 +476,9 @@ const AddIngestion = ({
|
|||||||
type: serviceCategory.slice(0, -1),
|
type: serviceCategory.slice(0, -1),
|
||||||
},
|
},
|
||||||
sourceConfig: {
|
sourceConfig: {
|
||||||
config: getConfigData(pipelineType),
|
config: getConfigData(
|
||||||
|
pipelineType
|
||||||
|
) as CreateIngestionPipeline['sourceConfig']['config'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -74,7 +74,9 @@ const ConnectionConfigForm: FunctionComponent<Props> = ({
|
|||||||
data.hasOwnProperty('connection')
|
data.hasOwnProperty('connection')
|
||||||
? ((data as DatabaseService | MessagingService | DashboardService)
|
? ((data as DatabaseService | MessagingService | DashboardService)
|
||||||
.connection.config as ConfigData)
|
.connection.config as ConfigData)
|
||||||
: ({ pipelineUrl: (data as PipelineService).pipelineUrl } as ConfigData)
|
: ({
|
||||||
|
pipelineUrl: (data as PipelineService).connection.config?.hostPort,
|
||||||
|
} as ConfigData)
|
||||||
: ({} as ConfigData);
|
: ({} as ConfigData);
|
||||||
|
|
||||||
const handleSave = (data: ISubmitEvent<ConfigData>) => {
|
const handleSave = (data: ISubmitEvent<ConfigData>) => {
|
||||||
|
@ -735,31 +735,12 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
setIsEdit(false);
|
setIsEdit(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getServiceSpecificData = (serviceDetails?: ServiceDataObj) => {
|
|
||||||
switch (serviceCategory) {
|
|
||||||
case ServiceCategory.DATABASE_SERVICES:
|
|
||||||
case ServiceCategory.MESSAGING_SERVICES:
|
|
||||||
case ServiceCategory.DASHBOARD_SERVICES:
|
|
||||||
return {
|
|
||||||
connection: serviceDetails?.connection,
|
|
||||||
};
|
|
||||||
|
|
||||||
case ServiceCategory.PIPELINE_SERVICES:
|
|
||||||
return {
|
|
||||||
pipelineUrl: serviceDetails?.pipelineUrl,
|
|
||||||
};
|
|
||||||
|
|
||||||
default:
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const onDescriptionUpdate = (updatedHTML: string) => {
|
const onDescriptionUpdate = (updatedHTML: string) => {
|
||||||
if (description !== updatedHTML && !isUndefined(serviceDetails)) {
|
if (description !== updatedHTML && !isUndefined(serviceDetails)) {
|
||||||
const { id } = serviceDetails;
|
const { id } = serviceDetails;
|
||||||
|
|
||||||
const updatedServiceDetails = {
|
const updatedServiceDetails = {
|
||||||
...getServiceSpecificData(serviceDetails),
|
...serviceDetails,
|
||||||
name: serviceDetails.name,
|
name: serviceDetails.name,
|
||||||
serviceType: serviceDetails.serviceType,
|
serviceType: serviceDetails.serviceType,
|
||||||
description: updatedHTML,
|
description: updatedHTML,
|
||||||
@ -788,7 +769,7 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
|
|
||||||
const handleUpdateOwner = (owner: ServiceDataObj['owner']) => {
|
const handleUpdateOwner = (owner: ServiceDataObj['owner']) => {
|
||||||
const updatedData = {
|
const updatedData = {
|
||||||
...getServiceSpecificData(serviceDetails),
|
...serviceDetails,
|
||||||
name: serviceDetails?.name,
|
name: serviceDetails?.name,
|
||||||
serviceType: serviceDetails?.serviceType,
|
serviceType: serviceDetails?.serviceType,
|
||||||
owner,
|
owner,
|
||||||
|
@ -308,7 +308,7 @@ const ServicesPage = () => {
|
|||||||
<span
|
<span
|
||||||
className=" tw-ml-1 tw-font-normal tw-text-grey-body"
|
className=" tw-ml-1 tw-font-normal tw-text-grey-body"
|
||||||
data-testid="pipeline-url">
|
data-testid="pipeline-url">
|
||||||
{pipelineService.pipelineUrl}
|
{pipelineService.connection.config?.hostPort}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user