#13912: Extend application schema files (#14208)

* Extend application schema files

* minor changes

* properties change
This commit is contained in:
Ashish Gupta 2023-12-05 23:51:23 +05:30 committed by GitHub
parent da6830ffcc
commit 0fb03358a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 45 deletions

View File

@ -35,47 +35,7 @@
} }
}, },
"lifeCycle": { "lifeCycle": {
"properties": { "type": "object"
"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"
}
}
}
}
}, },
"sizeInByte": { "sizeInByte": {
"type": "double" "type": "double"

View File

@ -77,6 +77,7 @@ import AppSchedule from '../AppSchedule/AppSchedule.component';
import { ApplicationTabs } from '../MarketPlaceAppDetails/MarketPlaceAppDetails.interface'; import { ApplicationTabs } from '../MarketPlaceAppDetails/MarketPlaceAppDetails.interface';
import './app-details.less'; import './app-details.less';
import { AppAction } from './AppDetails.interface'; import { AppAction } from './AppDetails.interface';
import applicationSchemaClassBase from './ApplicationSchemaClassBase';
const AppDetails = () => { const AppDetails = () => {
const { t } = useTranslation(); const { t } = useTranslation();
@ -97,10 +98,10 @@ const AppDetails = () => {
include: Include.All, include: Include.All,
}); });
setAppData(data); setAppData(data);
const schema = await import(
`../../../utils/ApplicationSchemas/${fqn}.json` const schema = await applicationSchemaClassBase.importSchema(fqn);
);
setJsonSchema(schema); setJsonSchema(schema.default);
} catch (error) { } catch (error) {
showErrorToast(error as AxiosError); showErrorToast(error as AxiosError);
} finally { } finally {

View File

@ -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 };