Revert "lint"

This reverts commit 36887abf88.
This commit is contained in:
Johannes Zellner
2024-06-20 15:47:49 +02:00
parent 324ee4641f
commit 6ba1953acb
2 changed files with 30 additions and 2 deletions
+30 -1
View File
@@ -1,7 +1,6 @@
'use strict';
/* global angular:false */
/* global window, localStorage, document */
/* global $:false */
/* global async */
/* global ERROR,ISTATES,HSTATES,RSTATES,APP_TYPES,NOTIFICATION_TYPES */
@@ -485,6 +484,36 @@ app.directive('ngClickSelect', function () {
};
});
// handles various states and triggers a href or configure/repair view
// used by attaching to controller $scope
// if $scope.appPostInstallConfirm.show(app); exists it will be called if not yet confirmed
function onAppClick(app, $event, isOperator, $scope) {
function stopEvent() {
$event.originalEvent.stopPropagation();
$event.originalEvent.preventDefault();
}
if (app.installationState !== ISTATES.INSTALLED) {
if (app.installationState === ISTATES.ERROR && isOperator) $scope.showAppConfigure(app, 'repair');
return stopEvent();
}
// app.health can also be null to indicate insufficient data
if (!app.health) return stopEvent();
if (app.runState === RSTATES.STOPPED) return stopEvent();
if (app.runState === RSTATES.STOPPED) return stopEvent();
if (app.health === HSTATES.UNHEALTHY || app.health === HSTATES.ERROR || app.health === HSTATES.DEAD) {
if (isOperator) $scope.showAppConfigure(app, 'repair');
return stopEvent();
}
if (app.pendingPostInstallConfirmation && $scope.appPostInstallConfirm) {
$scope.appPostInstallConfirm.show(app);
return stopEvent();
}
}
app.directive('ngClickReveal', function () {
return {
restrict: 'A',