1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

reposition tour modals to prevent screen overflow

also: fix issue on tour completed
+ fix issue on statistics when no plans created
+ info area on statistics when no plans created
This commit is contained in:
Sylvain 2020-03-03 11:20:17 +01:00
parent d0be17073b
commit f5955b74d2
15 changed files with 74 additions and 43 deletions

View File

@ -310,7 +310,8 @@ Application.Controllers.controller('AdminCalendarController', ['$scope', '$state
order: 1,
title: _t('app.admin.tour.calendar.agenda.title'),
content: _t('app.admin.tour.calendar.agenda.content'),
placement: 'right'
placement: 'right',
popupClass: 'width-350'
});
uitour.createStep({
selector: '.admin-calendar .export-xls-button',

View File

@ -575,7 +575,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
placement: 'bottom',
orphan: true
});
if (!Fablab.withoutInvoices) {
if (!Fablab.withoutInvoices && $scope.invoices.length > 0) {
uitour.createStep({
selector: '.invoices-management .invoices-list',
stepId: 'list',
@ -584,7 +584,6 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
content: _t('app.admin.tour.invoices.list.content'),
placement: 'top'
});
if ($scope.invoices.length > 0) {
uitour.createStep({
selector: '.invoices-management .invoices-list .chained-indicator',
stepId: 'chained',
@ -610,7 +609,6 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
placement: 'left'
});
}
}
uitour.createStep({
selector: '.invoices-management .invoices-settings',
stepId: 'settings',
@ -641,7 +639,8 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
order: 8,
title: _t('app.admin.tour.invoices.periods.title'),
content: _t('app.admin.tour.invoices.periods.content'),
placement: 'bottom'
placement: 'bottom',
popupClass: 'shift-left-50'
});
uitour.createStep({
selector: 'body',

View File

@ -389,7 +389,8 @@ Application.Controllers.controller('AdminMembersController', ['$scope', '$sce',
order: 10,
title: _t('app.admin.tour.members.sso.title'),
content: _t('app.admin.tour.members.sso.content'),
placement: 'bottom'
placement: 'bottom',
popupClass: 'shift-left-50'
});
uitour.createStep({
selector: 'body',

View File

@ -681,7 +681,8 @@ Application.Controllers.controller('EditPricingController', ['$scope', '$state',
order: 6,
title: _t('app.admin.tour.pricing.coupons.title'),
content: _t('app.admin.tour.pricing.coupons.content'),
placement: 'bottom'
placement: 'bottom',
popupClass: 'shift-left-50'
});
uitour.createStep({
selector: 'body',

View File

@ -179,7 +179,8 @@ Application.Controllers.controller('ProjectElementsController', ['$scope', '$sta
order: 1,
title: _t('app.admin.tour.project_elements.abuses.title'),
content: _t('app.admin.tour.project_elements.abuses.content'),
placement: 'bottom'
placement: 'bottom',
popupClass: 'shift-left-40'
});
uitour.createStep({
selector: 'body',

View File

@ -368,7 +368,7 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state',
order: 2,
title: _t('app.admin.tour.statistics.trending.title'),
content: _t('app.admin.tour.statistics.trending.content'),
placement: 'bottom'
placement: 'left'
});
uitour.createStep({
selector: 'body',
@ -441,7 +441,7 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state',
* Force update the statistics table, querying elasticSearch according to the current config values
*/
const refreshStats = function () {
if ($scope.selectedIndex && !$scope.preventRefresh) {
if ($scope.selectedIndex && !$scope.preventRefresh && $scope.type.active) {
$scope.data = [];
$scope.sumCA = 0;
$scope.averageAge = 0;
@ -637,14 +637,19 @@ Application.Controllers.controller('StatisticsController', ['$scope', '$state',
{ key: 'userId', label: _t('app.admin.statistics.user_id'), values: ['input_number'] },
{ key: 'gender', label: _t('app.admin.statistics.gender'), values: [{ key: 'male', label: _t('app.admin.statistics.man') }, { key: 'female', label: _t('app.admin.statistics.woman') }] },
{ key: 'age', label: _t('app.admin.statistics.age'), values: ['input_number'] },
{ key: 'subType', label: _t('app.admin.statistics.type'), values: $scope.type.active.subtypes },
{ key: 'ca', label: _t('app.admin.statistics.revenue'), values: ['input_number'] }
];
// if no plans were created, there's no types for statisticIndex=subscriptions
if ($scope.type.active) {
$scope.filters.splice(4, 0, { key: 'subType', label: _t('app.admin.statistics.type'), values: $scope.type.active.subtypes })
if (!$scope.type.active.simple) {
const f = { key: 'stat', label: $scope.type.active.label, values: ['input_number'] };
$scope.filters.push(f);
}
}
return angular.forEach($scope.selectedIndex.additional_fields, function (field) {
const filter = { key: field.key, label: field.label, values: [] };

View File

@ -197,7 +197,8 @@ Application.Controllers.controller('HomeController', ['$scope', '$stateParams',
order: 10,
title: _t('app.public.tour.welcome.about.title'),
content: _t('app.public.tour.welcome.about.content'),
placement: 'bottom'
placement: 'bottom',
popupClass: 'shift-right-40'
});
uitour.createStep({
selector: '.navbar.header li.notification-center-link',
@ -213,7 +214,8 @@ Application.Controllers.controller('HomeController', ['$scope', '$stateParams',
order: 12,
title: _t('app.public.tour.welcome.profile.title'),
content: _t('app.public.tour.welcome.profile.content'),
placement: 'bottom'
placement: 'bottom',
popupClass: 'shift-left-80'
});
if ($scope.status.news && settingsPromise.home_blogpost) {
uitour.createStep({
@ -232,7 +234,7 @@ Application.Controllers.controller('HomeController', ['$scope', '$stateParams',
order: 14,
title: _t('app.public.tour.welcome.last_projects.title'),
content: _t('app.public.tour.welcome.last_projects.content'),
placement: 'top'
placement: 'right'
});
}
if ($scope.status.twitter) {

View File

@ -41,7 +41,7 @@ Application.Services.factory('Member', ['$resource', '$q', function ($resource,
Fablab.sessionTours.push(response.data.tours[0]);
return { tours: Fablab.sessionTours };
}
return response;
return response.data;
}
}
}

View File

@ -22,3 +22,10 @@
}
}
.shift-right-40 { margin-left: 40px; }
.shift-left-40 { margin-left: -40px; }
.shift-left-50 { margin-left: -50px; }
.shift-left-80 { margin-left: -80px; }
.width-350 { width: 350px; }

View File

@ -245,6 +245,12 @@
</ul>
</div>
<div class="alert alert-info" ng-show="selectedIndex.es_type_key === 'subscription' && selectedIndex.types.length === 0">
<i class="fa fa-lightbulb-o m-r" aria-hidden="true"></i>
<span translate>{{ 'app.admin.statistics.create_plans_to_start' }}</span>
<a ui-sref="app.admin.plans.new" translate>{{ 'app.admin.statistics.click_here' }}</a>
</div>
<table class="table">
<thead>
<tr>

View File

@ -845,6 +845,8 @@ en:
man: "Man"
woman: "Woman"
export_is_running_you_ll_be_notified_when_its_ready: "Export is running. You'll be notified when it's ready."
create_plans_to_start: "Start by creating new subscription plans."
click_here: "Click here to create your first one."
stats_graphs:
# statistics graphs

View File

@ -845,6 +845,8 @@ es:
man: "Man"
woman: "Woman"
export_is_running_you_ll_be_notified_when_its_ready: "Export is running. You'll be notified when it's ready."
create_plans_to_start: "Start by creating new subscription plans."
click_here: "Click here to create your first one."
stats_graphs:
#statistics graphs

View File

@ -845,6 +845,8 @@ fr:
man: "Homme"
woman: "Femme"
export_is_running_you_ll_be_notified_when_its_ready: "L'export est en cours. Vous serez notifié lorsqu'il sera prêt."
create_plans_to_start: "Pour commencer, créez de nouvelles formules d'abonnement."
click_here: "Cliquez ici pour créer votre première formule."
stats_graphs:
# graphiques de statistiques

View File

@ -845,6 +845,8 @@ pt:
man: "Man"
woman: "Woman"
export_is_running_you_ll_be_notified_when_its_ready: "Export is running. You'll be notified when it's ready."
create_plans_to_start: "Start by creating new subscription plans."
click_here: "Click here to create your first one."
stats_graphs:
# statistics graphs

View File

@ -15,8 +15,8 @@ ActiveRecord::Schema.define(version: 20200218092221) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
enable_extension "pg_trgm"
enable_extension "unaccent"
enable_extension "pg_trgm"
create_table "abuses", force: :cascade do |t|
t.integer "signaled_id"