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