aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/api
diff options
context:
space:
mode:
authorJeremy Davis <jeremy.davis@sonarsource.com>2019-08-09 13:54:33 +0200
committerSonarTech <sonartech@sonarsource.com>2019-09-24 20:21:15 +0200
commitff0e7573b8beb8321f1ab4024b819e2af16b7e9f (patch)
treeee986b63032509893193dd33ecf8c06dbbd08743 /server/sonar-web/src/main/js/api
parent035fbea593106d85be9e8a9a823f3ed8ae2fc024 (diff)
downloadsonarqube-ff0e7573b8beb8321f1ab4024b819e2af16b7e9f.tar.gz
sonarqube-ff0e7573b8beb8321f1ab4024b819e2af16b7e9f.zip
SONAR-11630 Project setting for new code period
Diffstat (limited to 'server/sonar-web/src/main/js/api')
-rw-r--r--server/sonar-web/src/main/js/api/baseline.ts34
-rw-r--r--server/sonar-web/src/main/js/api/newCodePeriod.ts4
2 files changed, 38 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/api/baseline.ts b/server/sonar-web/src/main/js/api/baseline.ts
new file mode 100644
index 00000000000..b94a76ef64c
--- /dev/null
+++ b/server/sonar-web/src/main/js/api/baseline.ts
@@ -0,0 +1,34 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2019 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import { getJSON } from 'sonar-ui-common/helpers/request';
+import throwGlobalError from '../app/utils/throwGlobalError';
+
+export function getBranchAnalyses(
+ data: {
+ project: string;
+ category?: string;
+ from?: string;
+ to?: string;
+ p?: number;
+ ps?: number;
+ } & T.BranchParameters
+) {
+ return getJSON('/api/project_analyses/search', data).catch(throwGlobalError);
+}
diff --git a/server/sonar-web/src/main/js/api/newCodePeriod.ts b/server/sonar-web/src/main/js/api/newCodePeriod.ts
index d198d171c71..1aa0f57eb50 100644
--- a/server/sonar-web/src/main/js/api/newCodePeriod.ts
+++ b/server/sonar-web/src/main/js/api/newCodePeriod.ts
@@ -35,3 +35,7 @@ export function setNewCodePeriod(data: {
}): Promise<void> {
return post('/api/new_code_periods/set', data).catch(throwGlobalError);
}
+
+export function resetNewCodePeriod(data: { project?: string; branch?: string }): Promise<void> {
+ return post('/api/new_code_periods/unset', data).catch(throwGlobalError);
+}