From 8e707d1f393331c53272e82ae631b9543eaf8ebc Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Sat, 2 Dec 2023 19:37:39 +0530 Subject: [PATCH 1/3] Extend application schema files --- .../AppDetails/AppDetails.component.tsx | 7 +++--- .../AppDetails/ApplicationSchemaClassBase.ts | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/ApplicationSchemaClassBase.ts diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx index 266731c5fccd..611bcecfbabb 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx @@ -77,6 +77,7 @@ import AppSchedule from '../AppSchedule/AppSchedule.component'; import { ApplicationTabs } from '../MarketPlaceAppDetails/MarketPlaceAppDetails.interface'; import './app-details.less'; import { AppAction } from './AppDetails.interface'; +import applicationSchemaClassBase from './ApplicationSchemaClassBase'; const AppDetails = () => { const { t } = useTranslation(); @@ -97,9 +98,9 @@ const AppDetails = () => { include: Include.All, }); setAppData(data); - const schema = await import( - `../../../utils/ApplicationSchemas/${fqn}.json` - ); + + const schema = await applicationSchemaClassBase.schema(fqn); + setJsonSchema(schema); } catch (error) { showErrorToast(error as AxiosError); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/ApplicationSchemaClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/ApplicationSchemaClassBase.ts new file mode 100644 index 000000000000..8a0ef45ded7f --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/ApplicationSchemaClassBase.ts @@ -0,0 +1,23 @@ +/* + * Copyright 2023 Collate. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +class ApplicationSchemaClassBase { + public schema(fqn: string) { + return import(`../../../utils/ApplicationSchemas/${fqn}.json`); + } +} + +const applicationSchemaClassBase = new ApplicationSchemaClassBase(); + +export default applicationSchemaClassBase; +export { ApplicationSchemaClassBase }; From 8a87550f3a6275a7dd8351690ae5891395149732 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Tue, 5 Dec 2023 14:34:20 +0530 Subject: [PATCH 2/3] minor changes --- .../Applications/AppDetails/AppDetails.component.tsx | 4 ++-- .../Applications/AppDetails/ApplicationSchemaClassBase.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx index 611bcecfbabb..68d362b464c3 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/AppDetails.component.tsx @@ -99,9 +99,9 @@ const AppDetails = () => { }); setAppData(data); - const schema = await applicationSchemaClassBase.schema(fqn); + const schema = await applicationSchemaClassBase.importSchema(fqn); - setJsonSchema(schema); + setJsonSchema(schema.default); } catch (error) { showErrorToast(error as AxiosError); } finally { diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/ApplicationSchemaClassBase.ts b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/ApplicationSchemaClassBase.ts index 8a0ef45ded7f..1d07e4c0d4d1 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/ApplicationSchemaClassBase.ts +++ b/openmetadata-ui/src/main/resources/ui/src/components/Applications/AppDetails/ApplicationSchemaClassBase.ts @@ -12,7 +12,7 @@ */ class ApplicationSchemaClassBase { - public schema(fqn: string) { + public importSchema(fqn: string) { return import(`../../../utils/ApplicationSchemas/${fqn}.json`); } } From c03c8a1a87b258ca63ade53e9c22b94ec54ce094 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Tue, 5 Dec 2023 17:40:59 +0530 Subject: [PATCH 3/3] properties change --- .../raw_cost_analysis_report_data_index.json | 42 +------------------ 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/openmetadata-service/src/main/resources/elasticsearch/raw_cost_analysis_report_data_index.json b/openmetadata-service/src/main/resources/elasticsearch/raw_cost_analysis_report_data_index.json index 293af93ae5a0..244058a8ce42 100644 --- a/openmetadata-service/src/main/resources/elasticsearch/raw_cost_analysis_report_data_index.json +++ b/openmetadata-service/src/main/resources/elasticsearch/raw_cost_analysis_report_data_index.json @@ -35,47 +35,7 @@ } }, "lifeCycle": { - "properties": { - "created": { - "properties": { - "timestamp": { - "type": "date" - }, - "accessedBy": { - "type": "keyword" - }, - "accessedByAProcess": { - "type": "keyword" - } - } - }, - "updated": { - "properties": { - "timestamp": { - "type": "date" - }, - "accessedBy": { - "type": "keyword" - }, - "accessedByAProcess": { - "type": "keyword" - } - } - }, - "accessed": { - "properties": { - "timestamp": { - "type": "date" - }, - "accessedBy": { - "type": "keyword" - }, - "accessedByAProcess": { - "type": "keyword" - } - } - } - } + "type": "object" }, "sizeInByte": { "type": "double"