aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/projects/query.ts
diff options
context:
space:
mode:
authorGrégoire Aubert <gregoire.aubert@sonarsource.com>2018-07-18 11:46:04 +0200
committerSonarTech <sonartech@sonarsource.com>2018-07-19 20:21:26 +0200
commit4ac88f47bbc707c5bfcffefaa2cde5dded30b9ca (patch)
tree70216dd51c21d41ed71e5b593117bfffdaaf4e95 /server/sonar-web/src/main/js/apps/projects/query.ts
parent5125859626af0e748b599cd9db45c6f178fb26cf (diff)
downloadsonarqube-4ac88f47bbc707c5bfcffefaa2cde5dded30b9ca.tar.gz
sonarqube-4ac88f47bbc707c5bfcffefaa2cde5dded30b9ca.zip
SONARCLOUD-77 Display correct empty project page
Diffstat (limited to 'server/sonar-web/src/main/js/apps/projects/query.ts')
-rw-r--r--server/sonar-web/src/main/js/apps/projects/query.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/projects/query.ts b/server/sonar-web/src/main/js/apps/projects/query.ts
index 54cb473e714..ebe03ae2677 100644
--- a/server/sonar-web/src/main/js/apps/projects/query.ts
+++ b/server/sonar-web/src/main/js/apps/projects/query.ts
@@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+/* eslint-disable camelcase */
import { VISUALIZATIONS } from './utils';
import { RawQuery } from '../../helpers/query';
@@ -112,6 +113,20 @@ export function convertToFilter(query: Query, isFavorite: boolean): string {
return conditions.join(' and ');
}
+const visualizationParams = ['sort', 'view', 'visualization'];
+
+export function hasFilterParams(query: Query) {
+ return Object.keys(query)
+ .filter(key => !visualizationParams.includes(key))
+ .some(key => query[key] !== undefined);
+}
+
+export function hasVisualizationParams(query: Query) {
+ return Object.keys(query)
+ .filter(key => visualizationParams.includes(key))
+ .some(key => query[key] !== undefined);
+}
+
function getAsNumericRating(value: any): number | undefined {
if (value === '' || value == null || isNaN(value)) {
return undefined;