diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2017-01-24 13:11:34 +0100 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2017-01-24 17:37:23 +0100 |
commit | be36f35e637ace99705b843c7d4ef31d2eb9d59f (patch) | |
tree | 09982a725ee2d32112b7d873dac076924563125b /server/sonar-web/src/main/js/api | |
parent | f55c90fa06e82cd70639eda3c2a6f686a13fbee7 (diff) | |
download | sonarqube-be36f35e637ace99705b843c7d4ef31d2eb9d59f.tar.gz sonarqube-be36f35e637ace99705b843c7d4ef31d2eb9d59f.zip |
SONAR-8692 Replace calls to api/timemachine/index WS by api/measures/search_history
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r-- | server/sonar-web/src/main/js/api/time-machine.js | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/api/time-machine.js b/server/sonar-web/src/main/js/api/time-machine.js index 25d65c43c71..8f81cd82f94 100644 --- a/server/sonar-web/src/main/js/api/time-machine.js +++ b/server/sonar-web/src/main/js/api/time-machine.js @@ -17,10 +17,29 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +// @flow import { getJSON } from '../helpers/request'; -export function getTimeMachineData (componentKey, metrics) { - const url = '/api/timemachine/index'; - const data = { resource: componentKey, metrics }; - return getJSON(url, data); -} +type Response = { + measures: Array<{ + metric: string, + history: Array<{ + date: string, + value: string + }> + }>, + paging: { + pageIndex: number, + pageSize: number, + total: number + } +}; + +export const getTimeMachineData = (component: string, metrics: Array<string>, other?: {}): Promise<Response> => ( + getJSON('/api/measures/search_history', { + component, + metrics: metrics.join(), + ps: 1000, + ...other + }) +); |