1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-11-29 10:24:20 +01:00

(quality) log errors to the JS console

This commit is contained in:
Sylvain 2023-01-04 16:49:47 +01:00
parent cdc7dc963d
commit c24673fefa
25 changed files with 38 additions and 2 deletions

View File

@ -50,7 +50,7 @@ const ReservationsSummary: React.FC<ReservationsSummaryProps> = ({ slot, custome
}, [slot]);
useEffect(() => {
if (customer) {
if (customer && cart) {
CartAPI.setCustomer(cart, customer.id).then(setCart).catch(onError);
}
}, [customer]);

View File

@ -121,6 +121,7 @@ Application.Controllers.controller('NewAuthenticationController', ['$scope', '$s
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};
@ -147,6 +148,7 @@ Application.Controllers.controller('EditAuthenticationController', ['$scope', '$
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -454,6 +454,7 @@ Application.Controllers.controller('NewEventController', ['$scope', '$state', 'C
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};
@ -483,6 +484,7 @@ Application.Controllers.controller('EditEventController', ['$scope', '$state', '
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -125,6 +125,7 @@ Application.Controllers.controller('InvoicesController', ['$scope', '$state', 'I
* Callback triggered in case of error
*/
$scope.onError = (message) => {
console.error(message);
growl.error(message);
};

View File

@ -23,6 +23,7 @@ Application.Controllers.controller('AdminMachinesController', ['$scope', 'CSRF',
* Shows an error message forwarded from a child component
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -869,6 +869,7 @@ Application.Controllers.controller('EditMemberController', ['$scope', '$state',
* Callback triggered in case of error
*/
$scope.onError = (message) => {
console.error(message);
growl.error(message);
};
@ -1055,6 +1056,7 @@ Application.Controllers.controller('NewMemberController', ['$scope', '$state', '
* Callback triggered in case of error
*/
$scope.onError = (message) => {
console.error(message);
growl.error(message);
};

View File

@ -15,6 +15,7 @@ Application.Controllers.controller('AdminShowOrdersController', ['$rootScope', '
* Callback triggered in case of error
*/
$scope.onError = (message) => {
console.error(message);
growl.error(message);
};

View File

@ -30,6 +30,7 @@ Application.Controllers.controller('NewPlanController', ['$scope', '$uibModal',
* Shows an error message forwarded from a child component
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};
@ -56,6 +57,7 @@ Application.Controllers.controller('EditPlanController', ['$scope', 'groups', 'p
* Shows an error message forwarded from a child component
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};
@ -87,6 +89,7 @@ Application.Controllers.controller('PlanCategoriesController', ['$scope', 'growl
};
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};
}

View File

@ -652,6 +652,7 @@ Application.Controllers.controller('EditPricingController', ['$scope', '$state',
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -276,6 +276,7 @@ Application.Controllers.controller('AdminProjectsController', ['$scope', '$state
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -325,6 +325,7 @@ Application.Controllers.controller('SettingsController', ['$scope', '$rootScope'
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};
@ -471,6 +472,7 @@ Application.Controllers.controller('SettingsController', ['$scope', '$rootScope'
};
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -40,6 +40,7 @@ Application.Controllers.controller('AdminStoreController', ['$scope', 'CSRF', 'g
* Callback triggered in case of error
*/
$scope.onError = (message) => {
console.error(message);
growl.error(message);
};

View File

@ -16,6 +16,7 @@ Application.Controllers.controller('AdminStoreProductController', ['$scope', 'CS
* Callback triggered in case of error
*/
$scope.onError = (message) => {
console.error(message);
growl.error(message);
};

View File

@ -96,6 +96,7 @@ Application.Controllers.controller('NewTrainingController', ['$scope', '$state',
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};
@ -137,6 +138,7 @@ Application.Controllers.controller('EditTrainingController', ['$scope', '$state'
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -39,6 +39,7 @@ Application.Controllers.controller('CartController', ['$scope', 'CSRF', 'growl',
* Callback triggered in case of error
*/
$scope.onError = (message) => {
console.error(message);
growl.error(message);
};

View File

@ -47,6 +47,7 @@ Application.Controllers.controller('DashboardController', ['$scope', 'memberProm
* Callback used in PaymentScheduleDashboard, in case of error
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -114,6 +114,7 @@ Application.Controllers.controller('MachinesController', ['$scope', '$state', '_
* Shows an error message forwarded from a child component
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
}
@ -238,6 +239,7 @@ Application.Controllers.controller('NewMachineController', ['$scope', '$state',
* Shows an error message forwarded from a child component
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
}
@ -270,6 +272,7 @@ Application.Controllers.controller('EditMachineController', ['$scope', '$state',
* Shows an error message forwarded from a child component
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};
@ -344,6 +347,7 @@ Application.Controllers.controller('ShowMachineController', ['$scope', '$state',
* Shows an error message forwarded from a child component
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
}
@ -643,6 +647,7 @@ Application.Controllers.controller('ReserveMachineController', ['$scope', '$tran
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -289,6 +289,7 @@ Application.Controllers.controller('EditProfileController', ['$scope', '$rootSco
* @param message {string}
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -15,6 +15,7 @@ Application.Controllers.controller('ShowOrdersController', ['$rootScope', '$scop
* Callback triggered in case of error
*/
$scope.onError = (message) => {
console.error(message);
growl.error(message);
};

View File

@ -99,6 +99,7 @@ Application.Controllers.controller('PlansIndexController', ['$scope', '$rootScop
* @param message {string}
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -28,6 +28,7 @@ Application.Controllers.controller('ShowProductController', ['$scope', 'CSRF', '
* Callback triggered in case of error
*/
$scope.onError = (message) => {
console.error(message);
growl.error(message);
};

View File

@ -216,6 +216,7 @@ Application.Controllers.controller('CompleteProfileController', ['$scope', '$roo
* @param message {string}
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -228,6 +228,7 @@ Application.Controllers.controller('NewSpaceController', ['$scope', '$state', 'C
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};
@ -256,6 +257,7 @@ Application.Controllers.controller('EditSpaceController', ['$scope', '$state', '
* Callback triggered by react components
*/
$scope.onError = function (message) {
console.error(message);
growl.error(message);
};

View File

@ -11,6 +11,7 @@ Application.Controllers.controller('StoreController', ['$scope', 'CSRF', 'growl'
* Callback triggered in case of error
*/
$scope.onError = (message) => {
console.error(message);
growl.error(message);
};

View File

@ -28,7 +28,8 @@ class Availabilities::AvailabilitiesService
# list all slots for the given machines, with visibility relative to the given user
def machines(machines, user, window)
ma_availabilities = Availability.includes('machines_availabilities')
ma_availabilities = Availability.includes(:machines_availabilities, :availability_tags, :machines, :slots_reservations,
slots: [:slots_reservations])
.where('machines_availabilities.machine_id': machines.map(&:id))
availabilities = availabilities(ma_availabilities, 'machines', user, window[:start], window[:end])