mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-06 01:08:21 +01:00
[bug] summary of create training availability shows incorrect alert about slot splitting
This commit is contained in:
parent
8611a2753b
commit
933ce5df71
@ -9,6 +9,7 @@
|
|||||||
- Updated Sidekiq to 6.0.7
|
- Updated Sidekiq to 6.0.7
|
||||||
- Fix a bug: managers do not see the name of the user who reserved a slot
|
- Fix a bug: managers do not see the name of the user who reserved a slot
|
||||||
- Fix a bug: OpenAPI documentation is not available
|
- Fix a bug: OpenAPI documentation is not available
|
||||||
|
- Fix a bug: summary of create training availability shows incorrect alert about slot splitting
|
||||||
- Fix a security issue: updated websocket-extensions to 0.1.5 to fix [CVE-2020-7663](https://nvd.nist.gov/vuln/detail/CVE-2020-7663)
|
- Fix a security issue: updated websocket-extensions to 0.1.5 to fix [CVE-2020-7663](https://nvd.nist.gov/vuln/detail/CVE-2020-7663)
|
||||||
- [TODO DEPLOY] `rails fablab:setup:env_to_db`
|
- [TODO DEPLOY] `rails fablab:setup:env_to_db`
|
||||||
- [TODO DEPLOY] `\curl -sSL https://raw.githubusercontent.com/sleede/fab-manager/master/scripts/redis-upgrade.sh | bash`
|
- [TODO DEPLOY] `\curl -sSL https://raw.githubusercontent.com/sleede/fab-manager/master/scripts/redis-upgrade.sh | bash`
|
||||||
|
@ -637,7 +637,7 @@ Application.Controllers.controller('CreateEventModalController', ['$scope', '$ui
|
|||||||
const count = $scope.selectedMachines.length;
|
const count = $scope.selectedMachines.length;
|
||||||
$scope.selectedMachines = [];
|
$scope.selectedMachines = [];
|
||||||
$scope.selectedMachinesBinding = {};
|
$scope.selectedMachinesBinding = {};
|
||||||
if (count == 0) {
|
if (count === 0) {
|
||||||
$scope.machines.forEach(function (machine) {
|
$scope.machines.forEach(function (machine) {
|
||||||
$scope.selectedMachines.push(machine);
|
$scope.selectedMachines.push(machine);
|
||||||
$scope.selectedMachinesBinding[machine.id] = true;
|
$scope.selectedMachinesBinding[machine.id] = true;
|
||||||
@ -665,7 +665,7 @@ Application.Controllers.controller('CreateEventModalController', ['$scope', '$ui
|
|||||||
const count = $scope.selectedPlans.length;
|
const count = $scope.selectedPlans.length;
|
||||||
$scope.selectedPlans = [];
|
$scope.selectedPlans = [];
|
||||||
$scope.selectedPlansBinding = {};
|
$scope.selectedPlansBinding = {};
|
||||||
if (count == 0) {
|
if (count === 0) {
|
||||||
plansPromise.forEach(function (plan) {
|
plansPromise.forEach(function (plan) {
|
||||||
$scope.selectedPlans.push(plan);
|
$scope.selectedPlans.push(plan);
|
||||||
$scope.selectedPlansBinding[plan.id] = true;
|
$scope.selectedPlansBinding[plan.id] = true;
|
||||||
@ -705,7 +705,7 @@ Application.Controllers.controller('CreateEventModalController', ['$scope', '$ui
|
|||||||
* Move the modal UI to the next step
|
* Move the modal UI to the next step
|
||||||
*/
|
*/
|
||||||
$scope.next = function () {
|
$scope.next = function () {
|
||||||
if ($scope.step === 1) { $scope.setNbTotalPlaces(); }
|
if ($scope.step === 1) { return validateType(); }
|
||||||
if ($scope.step === 2) { return validateSelection(); }
|
if ($scope.step === 2) { return validateSelection(); }
|
||||||
if ($scope.step === 5) { return validateRecurrence(); }
|
if ($scope.step === 5) { return validateRecurrence(); }
|
||||||
return $scope.step++;
|
return $scope.step++;
|
||||||
@ -722,13 +722,14 @@ Application.Controllers.controller('CreateEventModalController', ['$scope', '$ui
|
|||||||
$scope.cancel = function () { $uibModalInstance.dismiss('cancel'); };
|
$scope.cancel = function () { $uibModalInstance.dismiss('cancel'); };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For training avaiabilities, set the maximum number of people allowed to register on this slot
|
* For training/space availabilities, set the maximum number of people allowed registering on this slot.
|
||||||
|
* Also, set the default slot duration
|
||||||
*/
|
*/
|
||||||
$scope.setNbTotalPlaces = function () {
|
$scope.setNbTotalPlaces = function () {
|
||||||
if ($scope.availability.available_type === 'training') {
|
if ($scope.availability.available_type === 'training') {
|
||||||
return $scope.availability.nb_total_places = $scope.selectedTraining.nb_total_places;
|
$scope.availability.nb_total_places = $scope.selectedTraining.nb_total_places;
|
||||||
} else if ($scope.availability.available_type === 'space') {
|
} else if ($scope.availability.available_type === 'space') {
|
||||||
return $scope.availability.nb_total_places = $scope.selectedSpace.default_places;
|
$scope.availability.nb_total_places = $scope.selectedSpace.default_places;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -876,6 +877,19 @@ Application.Controllers.controller('CreateEventModalController', ['$scope', '$ui
|
|||||||
$scope.step++;
|
$scope.step++;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize some settings, depending on the availability type, before continuing to step 2 (select a machine/training/space)
|
||||||
|
*/
|
||||||
|
const validateType = function () {
|
||||||
|
$scope.setNbTotalPlaces();
|
||||||
|
if ($scope.availability.available_type === 'training') {
|
||||||
|
$scope.availability.slot_duration = undefined;
|
||||||
|
} else {
|
||||||
|
$scope.availability.slot_duration = parseInt(slotDurationPromise.setting.value, 10);
|
||||||
|
}
|
||||||
|
$scope.step++;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute the various occurrences of the availability, according to the recurrence settings
|
* Compute the various occurrences of the availability, according to the recurrence settings
|
||||||
*/
|
*/
|
||||||
|
@ -222,7 +222,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li ng-repeat="slot in occurrences">{{slot.start_at | amDateFormat:'L LT'}} - {{slot.end_at | amDateFormat:'LT'}}</li>
|
<li ng-repeat="slot in occurrences">{{slot.start_at | amDateFormat:'L LT'}} - {{slot.end_at | amDateFormat:'LT'}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="alert alert-info text-xs">
|
<div class="alert alert-info text-xs" ng-show="availability.slot_duration">
|
||||||
<i class="fa fa-lightbulb-o m-r" aria-hidden="true"></i>
|
<i class="fa fa-lightbulb-o m-r" aria-hidden="true"></i>
|
||||||
<span translate translate-values="{DURATION: availability.slot_duration, COUNT: occurrences.length}"> {{ 'app.admin.calendar.divided_in_slots' }}</span>
|
<span translate translate-values="{DURATION: availability.slot_duration, COUNT: occurrences.length}"> {{ 'app.admin.calendar.divided_in_slots' }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user