Milimetric has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398411 )

Change subject: Add links to the rendered config wiki article
......................................................................

Add links to the rendered config wiki article

Three main things get added in the header/footer/or sidebar depending on
which layout is being shown:

* credit for Dashiki and link to Dashiki documentation (so people know
  what the heck built this thing they're looking at)
* link to the config page that built this dashboard
* data license CC0

Bug: T182477
Change-Id: Ib809030be60b65fa304fdd0a51e064e97e1e8953
---
A LICENSE
M README.md
M gulpfile.js
M package.json
M semantic.json
M src/app/apis/config-api.js
M src/app/config.js
M src/app/startup.js
M src/components/layouts/compare/compare.html
A src/components/layouts/created-by/created-by.html
A src/components/layouts/created-by/created-by.js
M src/components/layouts/metrics-by-project/metrics-by-project.html
M src/components/layouts/tabs/tabs.html
M src/layouts/compare/index.js
M src/layouts/compare/styles.css
M src/layouts/metrics-by-project/index.js
M src/layouts/metrics-by-project/styles.css
M src/layouts/tabs/index.js
M src/layouts/tabs/styles.css
M test/app/apis.js
20 files changed, 108 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/dashiki 
refs/changes/11/398411/1

diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..9f793ec
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,7 @@
+Copyright 2014 Wikimedia Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal 
in the Software without restriction, including without limitation the rights to 
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of the Software, and to permit persons to whom the Software is furnished to do 
so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
diff --git a/README.md b/README.md
index 82b393c..0d6deb9 100644
--- a/README.md
+++ b/README.md
@@ -20,7 +20,9 @@
 sudo npm install -g gulp
 cd semantic && gulp build
 
-NOTE: yarn install is under consideration, some incompabilities remain
+NOTE: on Ubuntu, you may need to do `sudo apt-get install libcairo2-dev 
libjpeg-dev libgif-dev` to get npm to work.
+
+NOTE: yarn install is under consideration, some incompabilities remain.
 
 How to build some dashboards:
 gulp --layout metrics-by-project --config Dashiki:VitalSigns
diff --git a/gulpfile.js b/gulpfile.js
index 9d7cd97..f9e9b3b 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -24,7 +24,7 @@
 
     layoutsRoot     : './src/layouts/',
     wiki            : 'meta.wikimedia.org',
-    namespace       : 'Config:', // NOTE: set this up on meta
+    namespace       : 'Config:',
     buildConfigPath : './src/config-from-build.js',
     outputPath      : 'dist/',
     requireConfig   : './src/app/require.config',
diff --git a/package.json b/package.json
index beea58a..ec2b944 100644
--- a/package.json
+++ b/package.json
@@ -9,6 +9,7 @@
   "author": "milimetric <[email protected]>",
   "license": "MIT",
   "dependencies": {
+    "bower": "^1.8.2",
     "d3": "^3.5.17",
     "d3-scale-chromatic": "^1.1.0",
     "dygraphs": "^1.1.1",
diff --git a/semantic.json b/semantic.json
index a681d3f..fb4f4a7 100644
--- a/semantic.json
+++ b/semantic.json
@@ -18,5 +18,5 @@
   "permission": false,
   "autoInstall": false,
   "rtl": false,
-  "version": "2.2.6"
+  "version": "2.2.13"
 }
\ No newline at end of file
diff --git a/src/app/apis/config-api.js b/src/app/apis/config-api.js
index 049bb6d..24b0671 100644
--- a/src/app/apis/config-api.js
+++ b/src/app/apis/config-api.js
@@ -29,10 +29,10 @@
 
         // The dashboard page can be injected by the build (see gulpfile.js)
         // For development, samples exist at config.defaultDashboardPageRoot
-        var dashboardPage =
-            this.config.dashboardPage ||
+        var dashboardArticle =
+            this.config.dashboardArticle ||
             this.config.defaultDashboardPageRoot + '/' + layout;
-        this.getConfig(dashboardPage, callback);
+        this.getConfig(dashboardArticle, callback);
 
     };
 
diff --git a/src/app/config.js b/src/app/config.js
index 3c07f9e..173e20b 100644
--- a/src/app/config.js
+++ b/src/app/config.js
@@ -50,10 +50,11 @@
 
         // indicates which mediawiki host and pages contain the configuration
         configApi: {
-            endpoint: 'meta.wikimedia.org',
+            endpoint: buildConfig ? buildConfig.endpoint : 
'meta.wikimedia.org',
             // next two fields are mediawiki page names
             categorizedMetricsPage: 'Dashiki:CategorizedMetrics',
-            dashboardPage: buildConfig ? buildConfig.dashboardArticle : null,
+            dashboardArticle: buildConfig ? buildConfig.dashboardArticle : 
null,
+            dashboardConfigLink: buildConfig ? '//' + buildConfig.endpoint + 
'/wiki/' + buildConfig.dashboardArticle : null,
             defaultDashboardPageRoot: 'Config:Dashiki:Sample',
             //https://meta.wikimedia.org/wiki/Dashiki:OutOfService
             outOfService: 'Dashiki:OutOfService',
diff --git a/src/app/startup.js b/src/app/startup.js
index 60862ef..6fc60f8 100644
--- a/src/app/startup.js
+++ b/src/app/startup.js
@@ -13,6 +13,7 @@
 
     // out-of-service component is common
     ko.components.register('out-of-service', {require: 
'components/layouts/out-of-service/out-of-service'    });
+    ko.components.register('created-by', {require: 
'components/layouts/created-by/created-by'    });
 
     // separate layouts, TODO: make each layout register its own components
 
diff --git a/src/components/layouts/compare/compare.html 
b/src/components/layouts/compare/compare.html
index 875fe24..f722853 100644
--- a/src/components/layouts/compare/compare.html
+++ b/src/components/layouts/compare/compare.html
@@ -1,3 +1,4 @@
+<created-by></created-by>
 <section>
     <out-of-service></out-of-service>
 </section>
@@ -36,4 +37,5 @@
         </div>
         <!-- /ko -->
     </comparisons>
+
 </section>
diff --git a/src/components/layouts/created-by/created-by.html 
b/src/components/layouts/created-by/created-by.html
new file mode 100644
index 0000000..f1b188e
--- /dev/null
+++ b/src/components/layouts/created-by/created-by.html
@@ -0,0 +1,11 @@
+<div class="created by">
+    Created by
+    <a target="_blank" 
href="https://wikitech.wikimedia.org/wiki/Analytics/Systems/Dashiki";
+    title="Dashiki is a dashboarding tool built by the Wikimedia Analytics 
team.  It lets users declare dashboards using configs on a wiki.">Dashiki</a>
+    with
+    <a target="_blank" data-bind="attr: { href: link }, text: name"
+    title="This configuration wiki article, along with the data, is all that's 
needed to set up this dashboard."></a>
+    <hr/>
+    <p style="font-size: 12px;">All data, charts, and other content is 
available under the Creative Commons CC0 dedication.</p>
+</div>
+
diff --git a/src/components/layouts/created-by/created-by.js 
b/src/components/layouts/created-by/created-by.js
new file mode 100644
index 0000000..9f0e26e
--- /dev/null
+++ b/src/components/layouts/created-by/created-by.js
@@ -0,0 +1,21 @@
+'use strict';
+/**
+ * To explains how this dashboard was created, link to documentation for:
+ *   * Dashiki
+ *   * the configuration for this dashboard
+ **/
+define(function (require) {
+
+    var templateMarkup = require('text!./created-by.html'),
+        config = require('config');
+
+    function CreatedBy() {
+        this.link = config.configApi.dashboardConfigLink || 
'http://meta.wikimedia.org/wiki/Config:Dashiki:Sample/tabs';
+        this.name = config.configApi.dashboardArticle || 'on-wiki config 
(loaded at build-time)';
+        console.log(this.link);
+    }
+    return {
+        viewModel: CreatedBy,
+        template: templateMarkup
+    };
+});
diff --git a/src/components/layouts/metrics-by-project/metrics-by-project.html 
b/src/components/layouts/metrics-by-project/metrics-by-project.html
index 6a86f1b..10d16e9 100644
--- a/src/components/layouts/metrics-by-project/metrics-by-project.html
+++ b/src/components/layouts/metrics-by-project/metrics-by-project.html
@@ -12,6 +12,9 @@
         <!-- ko if: selectedMetric() && selectedMetric().breakdown -->
         <breakdown-toggle params="metric: selectedMetric, 
breakdownColumns:breakdownColumns, patterns:patterns"></breakdown-toggle>
         <!-- /ko -->
+
+        <hr style="margin-top: 24px;"/>
+        <created-by></created-by>
     </section>
 
     <section class="right columnar flexer flexed">
diff --git a/src/components/layouts/tabs/tabs.html 
b/src/components/layouts/tabs/tabs.html
index 9313e63..b43763d 100644
--- a/src/components/layouts/tabs/tabs.html
+++ b/src/components/layouts/tabs/tabs.html
@@ -1,3 +1,5 @@
+<created-by></created-by>
+
 <section>
     <out-of-service></out-of-service>
 </section>
diff --git a/src/layouts/compare/index.js b/src/layouts/compare/index.js
index 8ac80f4..290d907 100644
--- a/src/layouts/compare/index.js
+++ b/src/layouts/compare/index.js
@@ -6,6 +6,7 @@
             include: [
                 'requireLib',
                 'components/layouts/compare/compare',
+                'components/layouts/created-by/created-by',
                 'components/controls/dropdown/dropdown',
                 'components/controls/button-group/button-group',
                 'components/controls/button-group/button-group',
diff --git a/src/layouts/compare/styles.css b/src/layouts/compare/styles.css
index f649eb5..4d17972 100644
--- a/src/layouts/compare/styles.css
+++ b/src/layouts/compare/styles.css
@@ -1,6 +1,22 @@
 body {
     font-family: "Nimbus Sans L","Liberation Sans","Helvetica 
Neue","Helvetica","Arial",sans-serif;
 }
+
+.created.by {
+    position: fixed;
+    bottom: 0;
+    right: 0;
+    padding: 5px;
+    font-size: 16px;
+    text-align: right;
+}
+.created.by hr {
+    margin: 2px;
+}
+.created.by p {
+    font-size: 12px;
+}
+
 .columnar.flexer {
     display: flex;
     flex-direction: column;
diff --git a/src/layouts/metrics-by-project/index.js 
b/src/layouts/metrics-by-project/index.js
index 8ae999f..b055372 100644
--- a/src/layouts/metrics-by-project/index.js
+++ b/src/layouts/metrics-by-project/index.js
@@ -6,6 +6,7 @@
             include: [
                 'requireLib',
                 'components/layouts/metrics-by-project/metrics-by-project',
+                'components/layouts/created-by/created-by',
                 'components/visualizers/wikimetrics/wikimetrics',
                 'components/selectors/metric/metric',
             ],
diff --git a/src/layouts/metrics-by-project/styles.css 
b/src/layouts/metrics-by-project/styles.css
index 59693be..70b6a3b 100644
--- a/src/layouts/metrics-by-project/styles.css
+++ b/src/layouts/metrics-by-project/styles.css
@@ -1,6 +1,20 @@
 body {
     font-family: "Nimbus Sans L","Liberation Sans","Helvetica 
Neue","Helvetica","Arial",sans-serif;
 }
+
+.created.by {
+    margin: 10px;
+    color: white;
+    font-size: 16px;
+}
+.created.by p {
+    font-size: 12px;
+}
+.created.by a {
+    color: #bababa;
+    font-weight: bold;
+}
+
 .clickable {
     cursor: pointer;
 }
diff --git a/src/layouts/tabs/index.js b/src/layouts/tabs/index.js
index 1aaf523..50ab336 100644
--- a/src/layouts/tabs/index.js
+++ b/src/layouts/tabs/index.js
@@ -6,6 +6,7 @@
             include: [
                 'requireLib',
                 'components/layouts/tabs/tabs',
+                'components/layouts/created-by/created-by',
                 'components/visualizers/visualizer/visualizer',
             ],
             bundles: {
diff --git a/src/layouts/tabs/styles.css b/src/layouts/tabs/styles.css
index 94d181b..10cb80a 100644
--- a/src/layouts/tabs/styles.css
+++ b/src/layouts/tabs/styles.css
@@ -8,6 +8,21 @@
     color: #999999;
 }
 
+.created.by {
+    position: fixed;
+    top: 0;
+    right: 0;
+    padding: 5px;
+    font-size: 16px;
+    text-align: right;
+}
+.created.by hr {
+    margin: 2px;
+}
+.created.by p {
+    font-size: 12px;
+}
+
 .resizable.container {
     width: 100%;
     height: 100%;
diff --git a/test/app/apis.js b/test/app/apis.js
index 88224b3..0d6d5b2 100644
--- a/test/app/apis.js
+++ b/test/app/apis.js
@@ -278,7 +278,7 @@
 
             this.configApi.config = {
                 endpoint: 'test',
-                dashboardPage: 'dash',
+                dashboardArticle: 'dash',
                 defaultDashboardPageRoot: 'defaultDash',
                 categorizedMetricsPage: 'metrics',
             };

-- 
To view, visit https://gerrit.wikimedia.org/r/398411
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib809030be60b65fa304fdd0a51e064e97e1e8953
Gerrit-PatchSet: 1
Gerrit-Project: analytics/dashiki
Gerrit-Branch: master
Gerrit-Owner: Milimetric <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to