Skip to content

Commit 4122c7b

Browse files
committed
Change tooltip request to a POST
Replace the GET request with a POST request. Use the fetch parameters to identify the requested element. Signed-off-by: Patrick Tasse <patrick.tasse@ericsson.com>
1 parent 4323bb7 commit 4122c7b

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

src/models/query/query-helper.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ export class QueryHelper {
1414
*/
1515
public static readonly REQUESTED_ITEMS_KEY: string = 'requested_items';
1616

17+
/**
18+
* Selected items key
19+
*/
20+
public static readonly REQUESTED_ELEMENT_KEY: string = 'requested_element';
21+
1722
/**
1823
* Starting index key
1924
*/

src/protocol/tsp-client.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -244,26 +244,15 @@ export class TspClient {
244244
}
245245

246246
/**
247-
* Fetch Time Graph tooltip for states and arrows
247+
* Fetch tooltip for a Time Graph element.
248248
* @param expUUID Experiment UUID
249249
* @param outputID Output ID
250-
* @param time X value
251-
* @param entryID Entry ID to identify precisely the states
252-
* @param targetID Optional target ID in case the tooltip is for an arrow
250+
* @param parameters Query object
253251
* @returns Map of key=name of the property and value=string value associated
254252
*/
255-
public async fetchTimeGraphToolTip(expUUID: string, outputID: string, time: number,
256-
entryID?: string, targetID?: string): Promise<TspClientResponse<GenericResponse<{ [key: string]: string }>>> {
253+
public async fetchTimeGraphTooltip(expUUID: string, outputID: string, parameters: Query): Promise<TspClientResponse<GenericResponse<{ [key: string]: string }>>> {
257254
const url = this.baseUrl + '/experiments/' + expUUID + '/outputs/timeGraph/' + outputID + '/tooltip';
258-
const parametersMap: Map<string, string> = new Map();
259-
parametersMap.set('time', time.toString());
260-
if (entryID) {
261-
parametersMap.set('entryId', entryID);
262-
}
263-
if (targetID) {
264-
parametersMap.set('targetId', targetID);
265-
}
266-
return await RestClient.get<GenericResponse<{ [key: string]: string }>>(url, parametersMap);
255+
return await RestClient.post<GenericResponse<{ [key: string]: string }>>(url, parameters);
267256
}
268257

269258
/**

0 commit comments

Comments
 (0)