Skip to content

Commit 005121b

Browse files
committed
Update query helper to match the key name in the TSP
Signed-off-by: Simon Delisle <simon.delisle@ericsson.com>
1 parent 9136e05 commit 005121b

File tree

2 files changed

+18
-26
lines changed

2 files changed

+18
-26
lines changed

src/models/query/query-helper.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,39 @@ export class QueryHelper {
77
/**
88
* Time requested key
99
*/
10-
public static TIME_REQUESTED: string = 'timeRequested';
10+
public static readonly REQUESTED_TIME_KEY: string = 'requested_times_key';
1111

1212
/**
1313
* Selected items key
1414
*/
15-
public static SELECTED_ITEMS: string = 'items';
15+
public static readonly REQUESTED_ITEMS_KEY: string = 'requested_items_key';
1616

1717
/**
1818
* Starting index key
1919
*/
20-
public static INDEX: string = 'index';
20+
public static readonly REQUESTED_TABLE_INDEX_KEY: string = 'requested_table_index_key';
2121

2222
/**
2323
* Key for the number of element to return
2424
*/
25-
public static COUNT: string = 'count';
25+
public static readonly REQUESTED_TABLE_COUNT_KEY: string = 'requested_table_count_key';
2626

2727
/**
2828
* Table column IDs key
2929
*/
30-
public static SELECTED_COLUMNS = 'columnId';
30+
public static readonly REQUESTED_COLUMN_IDS_KEY = 'requested_table_column_ids_key';
3131

3232
/**
3333
* Build a simple time query
3434
* @param timeRequested Array of requested times
3535
* @param filters Array of filter IDs
3636
* @param additionalProperties Use this optional parameter to add custom properties to your query
3737
*/
38-
public static timeQuery(timeRequested: number[], filters?: number[], additionalProperties?: { [key: string]: any }): Query {
38+
public static timeQuery(timeRequested: number[], additionalProperties?: { [key: string]: any }): Query {
3939
const timeObj = {
40-
[this.TIME_REQUESTED]: timeRequested
40+
[this.REQUESTED_TIME_KEY]: timeRequested
4141
};
42-
return new Query({ ...timeObj, ...additionalProperties }, filters);
42+
return new Query({ ...timeObj, ...additionalProperties });
4343
}
4444

4545
/**
@@ -49,13 +49,13 @@ export class QueryHelper {
4949
* @param filters Array of filter IDs
5050
* @param additionalProperties Use this optional parameter to add custom properties to your query
5151
*/
52-
public static selectionTimeQuery(timeRequested: number[], items: number[], filters?: number[], additionalProperties?: { [key: string]: any }): Query {
52+
public static selectionTimeQuery(timeRequested: number[], items: number[], additionalProperties?: { [key: string]: any }): Query {
5353
const selectionTimeObj = {
54-
[this.TIME_REQUESTED]: timeRequested,
55-
[this.SELECTED_ITEMS]: items
54+
[this.REQUESTED_TIME_KEY]: timeRequested,
55+
[this.REQUESTED_ITEMS_KEY]: items
5656
};
5757

58-
return new Query({ ...selectionTimeObj, ...additionalProperties }, filters);
58+
return new Query({ ...selectionTimeObj, ...additionalProperties });
5959
}
6060

6161
/**
@@ -66,14 +66,14 @@ export class QueryHelper {
6666
* @param filters Array of filter IDs
6767
* @param additionalProperties Use this optional parameter to add custom properties to your query
6868
*/
69-
public static tableQuery(columnsId: number[], index: number, count: number, filters?: number[], additionalProperties?: { [key: string]: any }) {
69+
public static tableQuery(columnsId: number[], index: number, count: number, additionalProperties?: { [key: string]: any }) {
7070
const tableObj = {
71-
[this.INDEX]: index,
72-
[this.COUNT]: count,
73-
[this.SELECTED_COLUMNS]: columnsId
71+
[this.REQUESTED_TABLE_INDEX_KEY]: index,
72+
[this.REQUESTED_TABLE_COUNT_KEY]: count,
73+
[this.REQUESTED_COLUMN_IDS_KEY]: columnsId
7474
};
7575

76-
return new Query({ ...tableObj, ...additionalProperties }, filters);
76+
return new Query({ ...tableObj, ...additionalProperties });
7777
}
7878

7979
/**

src/models/query/query.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,12 @@ export class Query {
99
*/
1010
private parameters: object;
1111

12-
/**
13-
* Array of filter Ids to apply
14-
*/
15-
private filters: number[] = new Array<number>();
16-
1712
/**
1813
* Constructor
1914
* @param parameters Object use to send parameters to the server
2015
* @param filters Optional array of filter IDs to apply
2116
*/
22-
constructor(parameters: object, filters?: number[]) {
17+
constructor(parameters: object) {
2318
this.parameters = parameters;
24-
if (filters) {
25-
this.filters = filters;
26-
}
2719
}
2820
}

0 commit comments

Comments
 (0)