summaryrefslogtreecommitdiffstats
path: root/cds-ui
diff options
context:
space:
mode:
Diffstat (limited to 'cds-ui')
-rw-r--r--cds-ui/client/src/app/common/constants/app-constants.ts4
-rw-r--r--cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.html8
-rw-r--r--cds-ui/server/src/controllers/data-dictionary.controller.ts11
-rw-r--r--cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts17
-rw-r--r--cds-ui/server/src/services/resource-dictionary.service.ts3
5 files changed, 38 insertions, 5 deletions
diff --git a/cds-ui/client/src/app/common/constants/app-constants.ts b/cds-ui/client/src/app/common/constants/app-constants.ts
index 283ce735f..bcfcc4e0c 100644
--- a/cds-ui/client/src/app/common/constants/app-constants.ts
+++ b/cds-ui/client/src/app/common/constants/app-constants.ts
@@ -96,5 +96,7 @@ export const GlobalContants = {
export const ResourceDictionaryURLs = {
saveResourceDictionary: '/resourcedictionary/save',
searchResourceDictionaryByTags: '/resourcedictionary/search',
- searchResourceDictionaryByName: ''
+ searchResourceDictionaryByName: '',
+ getSources: '/resourcedictionary/source-mapping',
+ getModelType: '/resourcedictionary/model-type'
} \ No newline at end of file
diff --git a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.html b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.html
index 5be2a1457..19db82cc6 100644
--- a/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.html
+++ b/cds-ui/client/src/app/feature-modules/resource-definition/resource-edit/resource-edit.component.html
@@ -21,9 +21,10 @@
*/-->
-<button disabled style="opacity: 0.5;" (click) ="changeView()" class="toggle-view-btn">{{viewText}}</button>
+<button (click) ="changeView()" class="toggle-view-btn">{{viewText}}</button>
<br><br>
-<div *ngIf="designerMode">
+<!-- <div *ngIf="designerMode"> -->
+<div [hidden] = "!designerMode">
<mat-card class="metadata-card">
<mat-card-header>
<mat-card-title>Resource Metadata</mat-card-title>
@@ -45,7 +46,8 @@
</mat-card>
</div>
-<div *ngIf="editorMode">
+<!-- <div *ngIf="editorMode"> -->
+<div [hidden] = "!editorMode">
<json-editor class="jsoneditor" *ngIf="editorMode" [options]="options" [data]="resources" on-change="onChange($event)"></json-editor>
</div>
diff --git a/cds-ui/server/src/controllers/data-dictionary.controller.ts b/cds-ui/server/src/controllers/data-dictionary.controller.ts
index 486c28658..63587e6b3 100644
--- a/cds-ui/server/src/controllers/data-dictionary.controller.ts
+++ b/cds-ui/server/src/controllers/data-dictionary.controller.ts
@@ -84,4 +84,15 @@ export class DataDictionaryController {
}) resourceDictionaryList: JSON): Promise<any> {
return await this.rdservice.searchbyNames(resourceDictionaryList);
}
+
+ @get('/resourcedictionary/model-type/{source}', {
+ responses: {
+ '200': {
+ content: { 'application/json': {} },
+ },
+ },
+ })
+ async getmodelType(@param.path.string('source') source: string) {
+ return await this.rdservice.getModelType(source);
+ }
}
diff --git a/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts b/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts
index c749eee62..af96aca04 100644
--- a/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts
+++ b/cds-ui/server/src/datasources/resource-dictionary.datasource-template.ts
@@ -87,6 +87,23 @@ export default {
"searchbyNames": ["resourceDictionaryList"]
}
+ },
+ ,
+ {
+ "template": {
+ "method": "GET",
+ "url": controllerApiConfig.http.url + "/model-type/{source}",
+ "headers": {
+ "accepts": "application/json",
+ "content-type": "application/json",
+ "authorization": controllerApiConfig.http.authToken
+ },
+ "responsePath": "$.*"
+ },
+ "functions": {
+ "getModelType": ["source"]
+
+ }
}
]
}; \ No newline at end of file
diff --git a/cds-ui/server/src/services/resource-dictionary.service.ts b/cds-ui/server/src/services/resource-dictionary.service.ts
index 8bc61fad1..9a781d6b8 100644
--- a/cds-ui/server/src/services/resource-dictionary.service.ts
+++ b/cds-ui/server/src/services/resource-dictionary.service.ts
@@ -7,7 +7,8 @@ export interface ResourceDictionaryService {
getSourceMapping(): Promise<JSON>;
getByTags(tags: string): Promise<JSON>;
save(resourceDictionary: JSON): Promise<JSON>;
- searchbyNames(resourceDictionaryList: JSON): Promise<JSON>;
+ searchbyNames(resourceDictionaryList: JSON): Promise<JSON>;
+ getModelType(source: string): Promise<JSON>;
}
export class ResourceDictionaryServiceProvider implements Provider<ResourceDictionaryService> {