From 26da725ec4c6d8da54067caa338099c20ac73873 Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Wed, 4 Oct 2017 22:27:12 +0200 Subject: [PATCH] Onboarding (#128) * starting to add ngOnboarding * initial onboarding test * trying hopscotch instead * changing vendor files * remove unnecesary files * make jshint ignore hopscotch * remove i18next dependency in avAdminElections directive * adding vendor css * trying to add vendor css * solving css problems * fixing a typo * trying to fix css * add missing option to grunt * using abs paths * trying to not use minimized vendor hopscotch files * fix hopscotch css * adding jquery integration for state changes * making easier to find through paths dashboard actions * making easier to find through paths dashboard actions 2 * adding onboarding tour * hopscotch ignore * moving start election to the end * improving onboarding tour service * make it compile * missing semicolon * removing jslint ignore * fix nextTour * fix help tour * adding OnboardingTourService to head scope so that it can be shown in helpList * testing onboarding translations * fix typo * adding onboarding tour i18n * launch wizard on first time too * fix typo --- Gruntfile.js | 50 +- app.js | 2 + .../admin-directives/dashboard/dashboard.html | 6 +- .../admin-directives/elections/elections.js | 128 +- .../admin-head-directive.js | 3 +- avAdmin/admin-profile/admin-profile.js | 31 +- .../admin-sidebar-directive.html | 2 +- avAdmin/onboarding-tour-service.js | 234 ++ index.html | 12 +- locales/en.json | 38 + locales/es.json | 38 + vendor/hopscotch-0.3.1/LICENSE | 177 ++ vendor/hopscotch-0.3.1/css/hopscotch.css | 519 ++++ vendor/hopscotch-0.3.1/img/sprite-green.png | Bin 0 -> 5405 bytes vendor/hopscotch-0.3.1/img/sprite-orange.png | Bin 0 -> 5374 bytes vendor/hopscotch-0.3.1/js/hopscotch.js | 2511 +++++++++++++++++ 16 files changed, 3662 insertions(+), 89 deletions(-) create mode 100644 avAdmin/onboarding-tour-service.js create mode 100644 vendor/hopscotch-0.3.1/LICENSE create mode 100644 vendor/hopscotch-0.3.1/css/hopscotch.css create mode 100644 vendor/hopscotch-0.3.1/img/sprite-green.png create mode 100644 vendor/hopscotch-0.3.1/img/sprite-orange.png create mode 100644 vendor/hopscotch-0.3.1/js/hopscotch.js diff --git a/Gruntfile.js b/Gruntfile.js index 7242a164..ecdc4b64 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -88,7 +88,7 @@ module.exports = function (grunt) { fs.readFile('avPluginsConfig.js', function(err, data) { if (err) { grunt.log.ok('No avPluginsConfig.js file found, creating...'); - var avPluginsConfigText = + var avPluginsConfigText = "var AV_PLUGINS_CONFIG_VERSION = '" + AV_CONFIG_VERSION + "';\n" + "angular.module('avPluginsConfig', [])\n" + " .factory('PluginsConfigService', function() {\n" + @@ -103,19 +103,19 @@ module.exports = function (grunt) { " return new PluginsConfigServiceProvider();\n" + " }];\n" + " });"; - fs.writeFile("avPluginsConfig.js", - avPluginsConfigText, + fs.writeFile("avPluginsConfig.js", + avPluginsConfigText, function(err) { if(err) { grunt.log.error( 'Error creating avPluginsConfig.js file'); done(false); } else { - grunt.log.ok('Created avPluginsConfig.js file, ' + + grunt.log.ok('Created avPluginsConfig.js file, ' + 'trying to read it again...'); checkAvPluginsConfig(); } - }); + }); } else { var match = data.toString().match( /AV_PLUGINS_CONFIG_VERSION = [\'\"]([\w\.]*)[\'\"];/); @@ -164,7 +164,11 @@ module.exports = function (grunt) { main: { options: { jshintrc: '.jshintrc', - reporter: require('jshint-stylish') + reporter: require('jshint-stylish'), + ignores: [ + 'vendor/hopscotch-0.3.1/js/hopscotch.js' + ] + }, src: createFolderGlobs('*.js') } @@ -220,6 +224,12 @@ module.exports = function (grunt) { main: { files: [ {src: ['img/**'], dest: 'dist/'}, + { + expand: true, + cwd:'vendor/hopscotch-0.3.1/img/', + src: ['**'], + dest: 'dist/img/' + }, {src: ['img/**'], dest: 'dist/'}, {src: ['temp_data/**'], dest: 'dist/'}, {src: ['bower_components/avCommon/dist/img/flags.png'], dest: 'dist/img/flags.png'}, @@ -281,7 +291,8 @@ module.exports = function (grunt) { {selector:'body',html:''}, {selector:'head',html:''}, {selector:'head',html:''}, - {selector:'head',html:''} + {selector:'head',html:''}, + {selector:'head',html:''} ] }, src:'index.html', @@ -290,20 +301,29 @@ module.exports = function (grunt) { }, cssmin: { main: { - files: [{ - expand: true, - cwd:'temp/bower_components/avCommon/themes', - src: ['**/app.css'], - dest: 'dist/themes/', - ext: '.min.css', - extDot: 'first' - }] + files: [ + { + expand: true, + cwd:'temp/bower_components/avCommon/themes', + src: ['**/app.css'], + dest: 'dist/themes/', + ext: '.min.css', + extDot: 'first' + }, + { + src: ['vendor/hopscotch-0.3.1/css/hopscotch.css'], + dest: 'dist/vendor.min.css' + } + ] }, }, concat: { main: { files: { 'dist/plugins.css': ['temp/plugins/**/*.css'], + 'dist/vendor.css': [ + 'vendor/hopscotch-0.3.1/css/hopscotch.css' + ], 'temp/libcompat.js': [ 'vendor/jquery.compat/jquery-1.11.1.js', 'vendor/json3/json-v3.3.2.js', diff --git a/app.js b/app.js index 9d62d09e..d3050c78 100755 --- a/app.js +++ b/app.js @@ -33,6 +33,7 @@ angular.module( 'avPluginsConfig', 'jm.i18next', 'avUi', + 'ngOnboarding', 'avRegistration', 'avTest', 'avAdmin', @@ -271,6 +272,7 @@ angular.module('agora-gui-admin').run(function($http, $rootScope, ConfigService) function(event, toState, toParams, fromState, fromParams) { console.log("change success"); $("#angular-preloading").hide(); + $(window).trigger("angular-state-change-success", [event, toState, toParams, fromState, fromParams]); }); }); diff --git a/avAdmin/admin-directives/dashboard/dashboard.html b/avAdmin/admin-directives/dashboard/dashboard.html index af39c5d5..b9d8f8fa 100644 --- a/avAdmin/admin-directives/dashboard/dashboard.html +++ b/avAdmin/admin-directives/dashboard/dashboard.html @@ -11,7 +11,7 @@

{{ status }}
- '; + } ; +__p += '\n '; + if(buttons.showCTA){ ; +__p += ''; + } ; +__p += '\n '; + if(buttons.showNext){ ; +__p += ''; + } ; +__p += '\n \n '; + if(buttons.showClose){ ; +__p += ''; + } ; +__p += '\n\n
\n
\n
\n
\n'; +return __p +}; + }).call(winHopscotch); + + var winHopscotch$1 = winHopscotch; + + return winHopscotch$1; + +})));