1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-29 18:52:22 +01:00

poc features-tour

This commit is contained in:
Sylvain 2020-01-28 15:55:22 +01:00
parent ebd4bab4fb
commit 528877bc76
8 changed files with 63 additions and 9 deletions

View File

@ -20,9 +20,10 @@ angular.module('application', ['ngCookies', 'ngResource', 'ngSanitize', 'ui.rout
'ui.select', 'ui.calendar', 'angularMoment', 'Devise', 'DeviseModal', 'angular-growl', 'xeditable',
'checklist-model', 'unsavedChanges', 'angular-loading-bar', 'ngTouch', 'angular-google-analytics',
'angularUtils.directives.dirDisqus', 'summernote', 'elasticsearch', 'angular-medium-editor', 'naif.base64',
'minicolors', 'pascalprecht.translate', 'ngFitText', 'ngAside', 'ngCapsLock', 'vcRecaptcha', 'ui.codemirror'])
.config(['$httpProvider', 'AuthProvider', 'growlProvider', 'unsavedWarningsConfigProvider', 'AnalyticsProvider', 'uibDatepickerPopupConfig', '$provide', '$translateProvider',
function ($httpProvider, AuthProvider, growlProvider, unsavedWarningsConfigProvider, AnalyticsProvider, uibDatepickerPopupConfig, $provide, $translateProvider) {
'minicolors', 'pascalprecht.translate', 'ngFitText', 'ngAside', 'ngCapsLock', 'vcRecaptcha', 'ui.codemirror',
'bm.uiTour'])
.config(['$httpProvider', 'AuthProvider', 'growlProvider', 'unsavedWarningsConfigProvider', 'AnalyticsProvider', 'uibDatepickerPopupConfig', '$provide', '$translateProvider', 'TourConfigProvider',
function ($httpProvider, AuthProvider, growlProvider, unsavedWarningsConfigProvider, AnalyticsProvider, uibDatepickerPopupConfig, $provide, $translateProvider, TourConfigProvider) {
// Google analytics
// first we check the user acceptance
const cookiesConsent = document.cookie.replace(/(?:(?:^|.*;\s*)fab-manager-cookies-consent\s*=\s*([^;]*).*$)|^.*$/, '$1');
@ -63,6 +64,8 @@ angular.module('application', ['ngCookies', 'ngResource', 'ngSanitize', 'ui.rout
$translateProvider.useMessageFormatInterpolation();
// Set the langage of the instance (from ruby configuration)
$translateProvider.preferredLanguage(Fablab.locale);
// End the tour when the user clicks the forward or back buttons of the browser
TourConfigProvider.enableNavigationInterceptors();
}]).run(['$rootScope', '$log', 'AuthService', 'Auth', 'amMoment', '$state', 'editableOptions', 'Analytics',
function ($rootScope, $log, AuthService, Auth, amMoment, $state, editableOptions, Analytics) {
// Angular-moment (date-time manipulations library)

View File

@ -72,6 +72,11 @@
//= require codemirror/mode/css/css
//= require codemirror/mode/sass/sass
//= require angular-ui-codemirror/src/ui-codemirror
//= require angular-hotkeys/build/hotkeys
//= require hone/dist/hone
//= require tether/dist/js/tether
//= require angular-bind-html-compile/angular-bind-html-compile
//= require angular-ui-tour/dist/angular-ui-tour
//= require_tree ./controllers
//= require_tree ./services
//= require_tree ./directives

View File

@ -1,7 +1,7 @@
'use strict';
Application.Controllers.controller('HomeController', ['$scope', '$stateParams', 'homeContentPromise',
function ($scope, $stateParams, homeContentPromise) {
Application.Controllers.controller('HomeController', ['$scope', '$stateParams', 'homeContentPromise', 'uiTourService',
function ($scope, $stateParams, homeContentPromise, uiTourService) {
/* PUBLIC SCOPE */
// Home page HTML content
@ -21,6 +21,10 @@ Application.Controllers.controller('HomeController', ['$scope', '$stateParams',
// We set the home page content, with the directives replacing the placeholders
$scope.homeContent = insertDirectives(homeContentPromise.setting.value);
// setup the tour
const uitour = uiTourService.getTour();
uitour.start();
};
const insertDirectives = function (html) {

View File

@ -0,0 +1,4 @@
.ui-tour-backdrop {
background-color: rgba(0, 0, 0, 0.5);
fill: rgba(0, 0, 0, 0.5);
}

View File

@ -1,5 +1,5 @@
<div class="navbar-header">
<div class="navbar-header" tour-step tour-step-title="Welcome" tour-step-content="Fab-Manager is awesome" tour-step-order="0" tour-step-placement="bottom">
<a ng-click="toggleNavSize($event)" class="btn btn-link visible-xs" data-toggle="class:nav-off-screen" data-target="#nav"><i class="fa fa-bars"></i></a>
<a ui-sref="app.public.home" class="navbar-brand" ng-click="goabout = false">
<img ng-src="{{logo.custom_asset_file_attributes.attachment_url}}" alt="{{logo.custom_asset_file_attributes.attachment}}" class="m-r-sm"/>

View File

@ -89,7 +89,7 @@
<![endif]-->
</head>
<body ng-controller="ApplicationController" ng-init="setCurrentUser(<%= current_user ? current_user.to_json : 'null' %>)" ng-cloak>
<body ng-controller="ApplicationController" ng-init="setCurrentUser(<%= current_user ? current_user.to_json : 'null' %>)" ng-cloak ui-tour>
<div growl></div>
<%= flash_messages %>

View File

@ -52,6 +52,7 @@
"angular-ui-bootstrap": "0.14.3",
"angular-ui-calendar": "https://github.com/angular-ui/ui-calendar.git#1.0.1",
"angular-ui-codemirror": "^0.3.0",
"angular-ui-tour": "^0.9.4",
"angular-unsavedchanges": "0.2",
"angular-xeditable": "0.10",
"bootstrap-switch": "3.3.2",

View File

@ -77,6 +77,10 @@ angular-base64-upload@^0.0.9:
resolved "https://registry.yarnpkg.com/angular-base64-upload/-/angular-base64-upload-0.0.9.tgz#d8ed8bac5e8c104e7311e353f9800345bed9da96"
integrity sha1-2O2LrF6MEE5zEeNT+YADRb7Z2pY=
"angular-bind-html-compile@git+https://github.com/incuna/angular-bind-html-compile.git#1.4.1":
version "1.4.1"
resolved "git+https://github.com/incuna/angular-bind-html-compile.git#7626140a0eb7c724dc5c1eb3f7715bf06adf4c2a"
angular-bootstrap-switch@0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/angular-bootstrap-switch/-/angular-bootstrap-switch-0.4.0.tgz#8f4d45a0de5ff1227bd6ae2c5348e4c821d9303a"
@ -96,6 +100,11 @@ angular-google-analytics@1.1:
version "0.7.9"
resolved "https://github.com/JanStevens/angular-growl-2.git#2a3a40e01419af879f80f582baaeceef3408e295"
angular-hotkeys@1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/angular-hotkeys/-/angular-hotkeys-1.7.0.tgz#052e6b6f44dfcd824427798b7f10e1917e8700a1"
integrity sha1-BS5rb0TfzYJEJ3mLfxDhkX6HAKE=
angular-i18n@1.7:
version "1.7.9"
resolved "https://registry.yarnpkg.com/angular-i18n/-/angular-i18n-1.7.9.tgz#3ecdfd6ef1cb1c5eec4658d64a2fdb402e1d2578"
@ -131,7 +140,7 @@ angular-resource@1.7:
resolved "https://registry.yarnpkg.com/angular-resource/-/angular-resource-1.7.9.tgz#fa53623fae2c60debe2410d692447dcb0ba02396"
integrity sha512-rXXhCE2qT31Pn4Sl+2XL+ntv4zxnA2OzY+clCl8/pOp/s/gIzxpQlEtXipo3QK8Qur3glbIkeF/bJw+gjVAdUw==
angular-sanitize@1.7:
angular-sanitize@1.7, angular-sanitize@>=1.5:
version "1.7.9"
resolved "https://registry.yarnpkg.com/angular-sanitize/-/angular-sanitize-1.7.9.tgz#6b4d5e826abdabd352b13a7c65c8c74daf6a7b15"
integrity sha512-nB/xe7JQWF9nLvhHommAICQ3eWrfRETo0EVGFESi952CDzDa+GAJ/2BFBNw44QqQPxj1Xua/uYKrbLsOGWZdbQ==
@ -141,6 +150,11 @@ angular-scroll@0.6:
resolved "https://registry.yarnpkg.com/angular-scroll/-/angular-scroll-0.6.5.tgz#2c5bbd9e4f72315b0f73146f857fd559252f941d"
integrity sha1-LFu9nk9yMVsPcxRvhX/VWSUvlB0=
angular-scroll@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/angular-scroll/-/angular-scroll-1.0.2.tgz#2768ff35dbe1ce40e0c3fbedd4534888299c3e2d"
integrity sha1-J2j/NdvhzkDgw/vt1FNIiCmcPi0=
angular-summernote@0.7.1:
version "0.7.1"
resolved "https://registry.yarnpkg.com/angular-summernote/-/angular-summernote-0.7.1.tgz#c4bfa83020c4e32f96955b9974c43e5eaeea342e"
@ -187,6 +201,19 @@ angular-ui-codemirror@^0.3.0:
resolved "https://registry.yarnpkg.com/angular-ui-codemirror/-/angular-ui-codemirror-0.3.0.tgz#e4286fc50f393f2a6e697c1bf3170424e12cbb60"
integrity sha1-5ChvxQ85PypuaXwb8xcEJOEsu2A=
angular-ui-tour@^0.9.4:
version "0.9.4"
resolved "https://registry.yarnpkg.com/angular-ui-tour/-/angular-ui-tour-0.9.4.tgz#332aac5026da55e0a43bdf1936c8be29ece37d55"
integrity sha512-W4VIDnunjcpQilI4u4b5cI/XFDG9hZnnNHpXZPBOqKoIwHoSwXSa2UNrxSTl26ITMm1k4QdxnMnZpHH5NsamOQ==
dependencies:
angular ">=1.5"
angular-bind-html-compile "https://github.com/incuna/angular-bind-html-compile.git#1.4.1"
angular-hotkeys "1.7.0"
angular-sanitize ">=1.5"
angular-scroll "1.0.2"
hone "1.1.0"
tether "1.4.0"
angular-unsavedchanges@0.2:
version "0.2.5"
resolved "https://registry.yarnpkg.com/angular-unsavedchanges/-/angular-unsavedchanges-0.2.5.tgz#34be961d547051f2c6d536c60a5b42f565c8858b"
@ -199,7 +226,7 @@ angular-xeditable@0.10:
dependencies:
angular "~1.x"
angular@1.7, "angular@>=1.2.26 <=1.7", angular@^1.0.8, angular@~1.x:
angular@1.7, "angular@>=1.2.26 <=1.7", angular@>=1.5, angular@^1.0.8, angular@~1.x:
version "1.7.9"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.7.9.tgz#e52616e8701c17724c3c238cfe4f9446fd570bc4"
integrity sha512-5se7ZpcOtu0MBFlzGv5dsM1quQDoDeUTwZrWjGtTNA7O88cD8TEk5IEKCTDa3uECV9XnvKREVUr7du1ACiWGFQ==
@ -773,6 +800,11 @@ holderjs@2.6:
resolved "https://registry.yarnpkg.com/holderjs/-/holderjs-2.6.0.tgz#e2ab6e02d4177684c0fe1414ecea013bc4b1505e"
integrity sha1-4qtuAtQXdoTA/hQU7OoBO8SxUF4=
hone@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/hone/-/hone-1.1.0.tgz#b6ce8d0716ee78c424e1ff83f2bb497493a88639"
integrity sha512-OT6AXfa+pMwM0jJbpyZk6/pgQ4m9vMkiUSKMfRbYv+Tnca/IRLsfBbmJy/FcsrqujW54Yvn6g+ApBwUnD8MQZg==
hosted-git-info@^2.1.4:
version "2.7.1"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
@ -1486,6 +1518,11 @@ taskgroup@^4.0.5, taskgroup@^4.2.0:
ambi "^2.2.0"
csextends "^1.0.3"
tether@1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/tether/-/tether-1.4.0.tgz#0f9fa171f75bf58485d8149e94799d7ae74d1c1a"
integrity sha1-D5+hcfdb9YSF2BSelHmdeudNHBo=
text-table@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"