Skip to content

Commit

Permalink
open-metadata#13912: Extend application schema files (open-metadata#1…
Browse files Browse the repository at this point in the history
…4208)

* Extend application schema files

* minor changes

* properties change
  • Loading branch information
Ashish8689 authored and Shiyang Xiao committed Dec 12, 2023
1 parent a976228 commit 9ee634b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -97,10 +98,10 @@ const AppDetails = () => {
include: Include.All,
});
setAppData(data);
const schema = await import(
`../../../utils/ApplicationSchemas/${fqn}.json`
);
setJsonSchema(schema);

const schema = await applicationSchemaClassBase.importSchema(fqn);

setJsonSchema(schema.default);
} catch (error) {
showErrorToast(error as AxiosError);
} finally {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 importSchema(fqn: string) {
return import(`../../../utils/ApplicationSchemas/${fqn}.json`);
}
}

const applicationSchemaClassBase = new ApplicationSchemaClassBase();

export default applicationSchemaClassBase;
export { ApplicationSchemaClassBase };

0 comments on commit 9ee634b

Please sign in to comment.