]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7230 better collapse file path
authorStas Vilchik <vilchiks@gmail.com>
Mon, 18 Apr 2016 14:39:44 +0000 (16:39 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 18 Apr 2016 14:40:03 +0000 (16:40 +0200)
server/sonar-web/src/main/js/components/source-viewer/templates/source-viewer-coverage-popup.hbs
server/sonar-web/src/main/js/helpers/handlebars/collapsePath.js [new file with mode: 0644]

index d0ee94c797c803aeaea2a51be60149ea14be61cb..9906d547398cc32acded5aadc5c34448701d1a81 100644 (file)
@@ -16,7 +16,7 @@
   {{#each testFiles}}
     <div class="bubble-popup-section">
       <a class="component-viewer-popup-test-file link-action" data-id="{{file.id}}" title="{{file.longName}}">
-        <span>{{collapsedDirFromPath file.longName}}</span><span class="component-name-file">{{fileFromPath file.longName}}</span>
+        <span>{{collapsePath file.longName}}</span>
       </a>
       <ul class="bubble-popup-list">
         {{#each tests}}
diff --git a/server/sonar-web/src/main/js/helpers/handlebars/collapsePath.js b/server/sonar-web/src/main/js/helpers/handlebars/collapsePath.js
new file mode 100644 (file)
index 0000000..ff7ed23
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2016 SonarSource SA
+ * mailto:contact 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 { collapsePath } from '../path';
+
+module.exports = function (path) {
+  return collapsePath(path);
+};