aboutsummaryrefslogtreecommitdiffstats
path: root/cds-ui/server
diff options
context:
space:
mode:
Diffstat (limited to 'cds-ui/server')
-rw-r--r--cds-ui/server/src/controllers/blueprint-rest.controller.ts34
-rw-r--r--cds-ui/server/src/datasources/blueprint.datasource-template.ts8
-rw-r--r--cds-ui/server/src/services/blueprint.service.ts4
3 files changed, 14 insertions, 32 deletions
diff --git a/cds-ui/server/src/controllers/blueprint-rest.controller.ts b/cds-ui/server/src/controllers/blueprint-rest.controller.ts
index 7b2c78329..2319e0a5e 100644
--- a/cds-ui/server/src/controllers/blueprint-rest.controller.ts
+++ b/cds-ui/server/src/controllers/blueprint-rest.controller.ts
@@ -20,34 +20,14 @@ limitations under the License.
*/
-import {
- Count,
- CountSchema,
- Filter,
- repository,
- Where,
-} from '@loopback/repository';
-import {
- post,
- param,
- get,
- getFilterSchemaFor,
- getWhereSchemaFor,
- patch,
- put,
- del,
- requestBody,
- Request,
- Response,
- RestBindings,
-} from '@loopback/rest';
+import {get, param, post, Request, requestBody, Response, RestBindings} from '@loopback/rest';
import {Blueprint} from '../models';
import {inject} from '@loopback/core';
import {BlueprintService} from '../services';
import * as fs from 'fs';
import * as multiparty from 'multiparty';
import * as request_lib from 'request';
-import {processorApiConfig, appConfig} from '../config/app-config';
+import {appConfig, processorApiConfig} from '../config/app-config';
import {bluePrintManagementServiceGrpcClient} from '../clients/blueprint-management-service-grpc-client';
import {BlueprintDetail} from '../models/blueprint.detail.model';
@@ -94,8 +74,9 @@ export class BlueprintRestController {
async getPagedBlueprints(
@param.query.number('limit') limit: number,
@param.query.number('offset') offset: number,
- @param.query.string('sort') sort: string) {
- return await this.bpservice.getPagedBueprints(limit, offset, sort);
+ @param.query.string('sort') sort: string,
+ @param.query.string('sortType') sortType: string) {
+ return await this.bpservice.getPagedBueprints(limit, offset, sort, sortType);
}
@get('/controllerblueprint/metadata/paged/{keyword}', {
@@ -110,8 +91,9 @@ export class BlueprintRestController {
@param.path.string('keyword') keyword: string,
@param.query.number('limit') limit: number,
@param.query.number('offset') offset: number,
- @param.query.string('sort') sort: string) {
- return await this.bpservice.getMetaDataPagedBlueprints(limit, offset, sort, keyword);
+ @param.query.string('sort') sort: string,
+ @param.query.string('sortType') sortType: string) {
+ return await this.bpservice.getMetaDataPagedBlueprints(limit, offset, sort, keyword, sortType);
}
@get('/controllerblueprint/meta-data/{keyword}', {
diff --git a/cds-ui/server/src/datasources/blueprint.datasource-template.ts b/cds-ui/server/src/datasources/blueprint.datasource-template.ts
index d7ac14b26..9b8e06a13 100644
--- a/cds-ui/server/src/datasources/blueprint.datasource-template.ts
+++ b/cds-ui/server/src/datasources/blueprint.datasource-template.ts
@@ -73,7 +73,7 @@ export default {
{
"template": {
"method": "GET",
- "url": processorApiConfig.http.url + "/blueprint-model/paged?limit={limit}&offset={offset}&sort={sort}",
+ "url": processorApiConfig.http.url + "/blueprint-model/paged?limit={limit}&offset={offset}&sort={sort}&sortType={sortType}",
"headers": {
"accepts": "application/json",
"content-type": "application/json",
@@ -82,13 +82,13 @@ export default {
"responsePath": "$",
},
"functions": {
- "getPagedBueprints": ["limit", "offset", "sort"],
+ "getPagedBueprints": ["limit", "offset", "sort","sortType"],
}
},
{
"template": {
"method": "GET",
- "url": processorApiConfig.http.url + "/blueprint-model/paged/meta-data/{keyword}?limit={limit}&offset={offset}&sort={sort}",
+ "url": processorApiConfig.http.url + "/blueprint-model/paged/meta-data/{keyword}?limit={limit}&offset={offset}&sort={sort}&sortType={sortType}",
"headers": {
"accepts": "application/json",
"content-type": "application/json",
@@ -97,7 +97,7 @@ export default {
"responsePath": "$",
},
"functions": {
- "getMetaDataPagedBlueprints": ["limit", "offset", "sort", "keyword"],
+ "getMetaDataPagedBlueprints": ["limit", "offset", "sort", "keyword","sortType"],
}
},
{
diff --git a/cds-ui/server/src/services/blueprint.service.ts b/cds-ui/server/src/services/blueprint.service.ts
index cb601f3cf..2680e105a 100644
--- a/cds-ui/server/src/services/blueprint.service.ts
+++ b/cds-ui/server/src/services/blueprint.service.ts
@@ -7,8 +7,8 @@ export interface BlueprintService {
getAllblueprints(): Promise<any>;
getBlueprintsByKeyword(keyword: string): Promise<any>;
getByTags(tags: string): Promise<JSON>;
- getPagedBueprints(limit: number, offset: number , sort: string): Promise<any>;
- getMetaDataPagedBlueprints(limit: number, offset: number, sort: string, keyword: string): Promise<any>;
+ getPagedBueprints(limit: number, offset: number , sort: string,sortType: String): Promise<any>;
+ getMetaDataPagedBlueprints(limit: number, offset: number, sort: string, keyword: string,sortType: String): Promise<any>;
getBlueprintByNameAndVersion(name:string, version:string): Promise<any>;