Cdentinger has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/212316

Change subject: moves persistence stuff to new dir, add defaultTables.js
......................................................................

moves persistence stuff to new dir, add defaultTables.js

also adds temp image for a/b test widget

Change-Id: I9f44ef61d625034cc6e3023500f895eda2cd5def
---
A persistence/defaultTables.js
R persistence/persistence.js
R persistence/persistence.sql
M routes/board.js
M routes/library.js
M routes/user.js
M routes/widget.js
M server.js
A src/images/abtesting.svg
9 files changed, 27 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/fundraising/dash 
refs/changes/16/212316/1

diff --git a/persistence/defaultTables.js b/persistence/defaultTables.js
new file mode 100644
index 0000000..ac393a6
--- /dev/null
+++ b/persistence/defaultTables.js
@@ -0,0 +1,18 @@
+module.exports = {
+       default_boards: [
+               {
+                       display_name: 'Big English',
+                       widgets: [
+                               'totals-earned-chart',
+                               'distance-to-goal-chart',
+                               'amt-per-second-chart'
+                       ]
+               },
+               {
+                       display_name: 'A/B Testing',
+                       widgets: [
+                       'ab-testing'
+                       ]
+               }
+       ]
+}
diff --git a/persistence.js b/persistence/persistence.js
similarity index 99%
rename from persistence.js
rename to persistence/persistence.js
index ab8640f..0f1d6b9 100644
--- a/persistence.js
+++ b/persistence/persistence.js
@@ -1,4 +1,4 @@
-var config = require( './config.js' ),
+var config = require( '../config.js' ),
        promiseDbLib = require( 'mysql-promise' );
 
 function getConnection() {
diff --git a/persistence.sql b/persistence/persistence.sql
similarity index 95%
rename from persistence.sql
rename to persistence/persistence.sql
index 3767d1d..a7adf2e 100644
--- a/persistence.sql
+++ b/persistence/persistence.sql
@@ -64,6 +64,7 @@
 INSERT IGNORE INTO dash_widget ( code, display_name, description, preview_path 
) VALUES ( 'distance-to-goal-chart', 'Distance to Goal', 'Line chart showing 
USD needed to reach overall Big English goal', 'images/distance-to-goal.png');
 INSERT IGNORE INTO dash_widget ( code, display_name, description, preview_path 
) VALUES ( 'totals-earned-chart', 'Totals Earned', 'Main Big English bar chart 
showing daily and hourly donation totals and counts', 
'images/totals-earned.png');
 INSERT IGNORE INTO dash_widget ( code, display_name, description, preview_path 
) VALUES ( 'cat-trombone', 'Trombone Cat', 'A cat is playing a TROMBONE', 
'images/catmusician.gif');
+INSERT IGNORE INTO dash_widget ( code, display_name, description, preview_path 
) VALUES ( 'ab-testing', 'A/B Testing', 'Banner A/B test results', 
'images/abtesting.svg');
 
 /* Tailor these to your liking
 GRANT INSERT, SELECT, UPDATE, DELETE ON dash_widget_instance_board TO 
'testuser'@'localhost';
@@ -71,4 +72,4 @@
 GRANT INSERT, SELECT, UPDATE, DELETE ON dash_widget_instance TO 
'testuser'@'localhost';
 GRANT INSERT, SELECT, UPDATE, DELETE ON dash_widget TO 'testuser'@'localhost';
 GRANT INSERT, SELECT, UPDATE, DELETE ON dash_user TO 'testuser'@'localhost';
-*/
\ No newline at end of file
+*/
diff --git a/routes/board.js b/routes/board.js
index d8e3727..38097fb 100644
--- a/routes/board.js
+++ b/routes/board.js
@@ -1,4 +1,4 @@
-var persistence = require( '../persistence.js' );
+var persistence = require( '../persistence/persistence.js' );
 
 module.exports = {
        save: function( req, res ) {
diff --git a/routes/library.js b/routes/library.js
index a504415..bd3342e 100644
--- a/routes/library.js
+++ b/routes/library.js
@@ -1,4 +1,4 @@
-//var persistence = require( '../persistence.js' );
+//var persistence = require( '../persistence/persistence.js' );
 
 module.exports = {
        //find all widgets
@@ -6,4 +6,4 @@
        get: function( req, res ) {
                return res;
        }
-};
\ No newline at end of file
+};
diff --git a/routes/user.js b/routes/user.js
index 51c2430..6309d4c 100644
--- a/routes/user.js
+++ b/routes/user.js
@@ -1,4 +1,4 @@
-var persistence = require( '../persistence.js' );
+var persistence = require( '../persistence/persistence.js' );
 
 module.exports = {
        info: function( req, res ) {
diff --git a/routes/widget.js b/routes/widget.js
index a999acb..7ccb5d1 100644
--- a/routes/widget.js
+++ b/routes/widget.js
@@ -1,4 +1,4 @@
-var persistence = require( '../persistence.js' );
+var persistence = require( '../persistence/persistence.js' );
 
 module.exports = {
        list: function( req, res ) {
diff --git a/server.js b/server.js
index e1e48b8..688c3de 100644
--- a/server.js
+++ b/server.js
@@ -7,7 +7,7 @@
        url                             = require( 'url' ),
        logger                  = require( './logger.js' ),
        config                  = require( './config.js' ),
-       persistence             = require( './persistence.js' ),
+       persistence             = require( './persistence/persistence.js' ),
        server,
        serverConfig,
        loginCheck;
diff --git a/src/images/abtesting.svg b/src/images/abtesting.svg
new file mode 100644
index 0000000..9185058
--- /dev/null
+++ b/src/images/abtesting.svg
Binary files differ

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f44ef61d625034cc6e3023500f895eda2cd5def
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/fundraising/dash
Gerrit-Branch: master
Gerrit-Owner: Cdentinger <cdentin...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to