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, order: 1,
title: _t('app.admin.tour.calendar.agenda.title'), title: _t('app.admin.tour.calendar.agenda.title'),
content: _t('app.admin.tour.calendar.agenda.content'), content: _t('app.admin.tour.calendar.agenda.content'),
placement: 'right' placement: 'right',
popupClass: 'width-350'
}); });
uitour.createStep({ uitour.createStep({
selector: '.admin-calendar .export-xls-button', selector: '.admin-calendar .export-xls-button',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -197,7 +197,8 @@ Application.Controllers.controller('HomeController', ['$scope', '$stateParams',
order: 10, order: 10,
title: _t('app.public.tour.welcome.about.title'), title: _t('app.public.tour.welcome.about.title'),
content: _t('app.public.tour.welcome.about.content'), content: _t('app.public.tour.welcome.about.content'),
placement: 'bottom' placement: 'bottom',
popupClass: 'shift-right-40'
}); });
uitour.createStep({ uitour.createStep({
selector: '.navbar.header li.notification-center-link', selector: '.navbar.header li.notification-center-link',
@ -213,7 +214,8 @@ Application.Controllers.controller('HomeController', ['$scope', '$stateParams',
order: 12, order: 12,
title: _t('app.public.tour.welcome.profile.title'), title: _t('app.public.tour.welcome.profile.title'),
content: _t('app.public.tour.welcome.profile.content'), content: _t('app.public.tour.welcome.profile.content'),
placement: 'bottom' placement: 'bottom',
popupClass: 'shift-left-80'
}); });
if ($scope.status.news && settingsPromise.home_blogpost) { if ($scope.status.news && settingsPromise.home_blogpost) {
uitour.createStep({ uitour.createStep({
@ -232,7 +234,7 @@ Application.Controllers.controller('HomeController', ['$scope', '$stateParams',
order: 14, order: 14,
title: _t('app.public.tour.welcome.last_projects.title'), title: _t('app.public.tour.welcome.last_projects.title'),
content: _t('app.public.tour.welcome.last_projects.content'), content: _t('app.public.tour.welcome.last_projects.content'),
placement: 'top' placement: 'right'
}); });
} }
if ($scope.status.twitter) { 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]); Fablab.sessionTours.push(response.data.tours[0]);
return { tours: Fablab.sessionTours }; 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> </ul>
</div> </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"> <table class="table">
<thead> <thead>
<tr> <tr>

View File

@ -845,6 +845,8 @@ en:
man: "Man" man: "Man"
woman: "Woman" woman: "Woman"
export_is_running_you_ll_be_notified_when_its_ready: "Export is running. You'll be notified when it's ready." 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: stats_graphs:
# statistics graphs # statistics graphs

View File

@ -845,6 +845,8 @@ es:
man: "Man" man: "Man"
woman: "Woman" woman: "Woman"
export_is_running_you_ll_be_notified_when_its_ready: "Export is running. You'll be notified when it's ready." 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: stats_graphs:
#statistics graphs #statistics graphs

View File

@ -845,6 +845,8 @@ fr:
man: "Homme" man: "Homme"
woman: "Femme" 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." 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: stats_graphs:
# graphiques de statistiques # graphiques de statistiques

View File

@ -845,6 +845,8 @@ pt:
man: "Man" man: "Man"
woman: "Woman" woman: "Woman"
export_is_running_you_ll_be_notified_when_its_ready: "Export is running. You'll be notified when it's ready." 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: stats_graphs:
# statistics 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 # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
enable_extension "pg_trgm"
enable_extension "unaccent" enable_extension "unaccent"
enable_extension "pg_trgm"
create_table "abuses", force: :cascade do |t| create_table "abuses", force: :cascade do |t|
t.integer "signaled_id" t.integer "signaled_id"