fix: lint errors

This commit is contained in:
Baptiste Grob
2021-01-22 11:52:24 +01:00
parent 5d65364885
commit a0909399f8
25 changed files with 74 additions and 75 deletions

View File

@@ -22,7 +22,7 @@ export function clickOutside($document: ng.IDocumentService) {
$scope.$apply(attrs.clickOutside);
didApplyClickOutside = true;
}
};
}
$scope.$on('$destroy', () => {
attrs.clickOutside = undefined;

View File

@@ -16,23 +16,23 @@ export function delayHide($timeout: ng.ITimeoutService) {
scopeAny.hidePromise = null;
}
showElement(true);
}
};
const hideSpinner = () => {
scopeAny.hidePromise = $timeout(
showElement.bind(this as any, false),
getDelay()
);
}
};
const showElement = (show: boolean) => {
show ? elem.css({ display: '' }) : elem.css({ display: 'none' });
}
};
const getDelay = () => {
const delay = parseInt(scopeAny.delay);
return angular.isNumber(delay) ? delay : 200;
}
};
showElement(false);
// Whenever the scope variable updates we simply

View File

@@ -5,7 +5,7 @@ export function elemReady($parse: ng.IParseService) {
link: function($scope: ng.IScope, elem: JQLite, attrs: any) {
elem.ready(function() {
$scope.$apply(function() {
var func = $parse(attrs.elemReady);
const func = $parse(attrs.elemReady);
func($scope);
});
});

View File

@@ -19,7 +19,7 @@ export function infiniteScroll() {
};
elem.on('scroll', scopeAny.onScroll);
scope.$on('$destroy', () => {
elem.off('scroll', scopeAny.onScroll);;
elem.off('scroll', scopeAny.onScroll);
});
}
};

View File

@@ -140,7 +140,7 @@ class AccountMenuCtrl extends PureViewCtrl<unknown, AccountMenuState> {
syncInProgress: sync.inProgress,
syncError: sync.errorMessage,
});
})
});
this.removeBetaWarningListener = autorun(() => {
this.setState({
showBetaWarning: this.appState.showBetaWarning

View File

@@ -40,7 +40,7 @@ type ActionsMenuState = {
}[]
}
class ActionsMenuCtrl extends PureViewCtrl<{}, ActionsMenuState> implements ActionsMenuScope {
class ActionsMenuCtrl extends PureViewCtrl<unknown, ActionsMenuState> implements ActionsMenuScope {
application!: WebApplication
item!: SNItem
private removeHiddenExtensionsListener?: IReactionDisposer;
@@ -63,7 +63,7 @@ class ActionsMenuCtrl extends PureViewCtrl<{}, ActionsMenuState> implements Acti
hiddenExtensions: this.appState.actionsMenu.hiddenExtensions
});
});
};
}
deinit() {
this.removeHiddenExtensionsListener?.();
@@ -74,7 +74,7 @@ class ActionsMenuCtrl extends PureViewCtrl<{}, ActionsMenuState> implements Acti
const extensions = this.application.actionsManager!.getExtensions().sort((a, b) => {
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
});
let extensionsState: Record<UuidString, ExtensionState> = {};
const extensionsState: Record<UuidString, ExtensionState> = {};
extensions.map((extension) => {
extensionsState[extension.uuid] = {
loading: false,
@@ -114,7 +114,7 @@ class ActionsMenuCtrl extends PureViewCtrl<{}, ActionsMenuState> implements Acti
return {
...action,
subrows: this.subRowsForAction(action, extension)
}
};
} else {
return action;
}

View File

@@ -159,7 +159,7 @@ class ComponentViewCtrl implements ComponentViewScope {
this.$timeout(() => {
this.reloading = false;
});
})
});
}
private onVisibilityChange() {
@@ -228,6 +228,7 @@ class ComponentViewCtrl implements ComponentViewScope {
if (!iframe.contentWindow!.origin || iframe.contentWindow!.origin === 'null') {
desktopError = true;
}
// eslint-disable-next-line no-empty
} catch (e) { }
}
this.$timeout.cancel(this.loadTimeout);

View File

@@ -52,14 +52,14 @@ class EditorMenuCtrl extends PureViewCtrl implements EditorMenuScope {
editors: editors,
defaultEditor: defaultEditor
});
};
}
selectComponent(component: SNComponent) {
if (component) {
if (component.conflictOf) {
this.application.changeAndSaveItem(component.uuid, (mutator) => {
mutator.conflictOf = undefined;
})
});
}
}
this.$timeout(() => {
@@ -87,7 +87,7 @@ class EditorMenuCtrl extends PureViewCtrl implements EditorMenuScope {
this.application.changeItem(currentDefault.uuid, (m) => {
const mutator = m as ComponentMutator;
mutator.defaultEditor = false;
})
});
}
this.application.changeAndSaveItem(component.uuid, (m) => {
const mutator = m as ComponentMutator;

View File

@@ -16,7 +16,7 @@ interface HistoryScope {
item: SNItem
}
class HistoryMenuCtrl extends PureViewCtrl<{}, HistoryState> implements HistoryScope {
class HistoryMenuCtrl extends PureViewCtrl<unknown, HistoryState> implements HistoryScope {
diskEnabled = false
autoOptimize = false

View File

@@ -6,12 +6,12 @@ import { debounce } from '@/utils';
enum PanelSide {
Right = 'right',
Left = 'left'
};
}
enum MouseEventType {
Move = 'mousemove',
Down = 'mousedown',
Up = 'mouseup'
};
}
enum CssClass {
Hoverable = 'hoverable',
AlwaysVisible = 'always-visible',
@@ -19,7 +19,7 @@ enum CssClass {
NoSelection = 'no-selection',
Collapsed = 'collapsed',
AnimateOpacity = 'animate-opacity',
};
}
const WINDOW_EVENT_RESIZE = 'resize';
type ResizeFinishCallback = (

View File

@@ -7,7 +7,7 @@ const DEFAULT_CONTINUE_TITLE = "Continue";
enum Steps {
PasswordStep = 1,
FinishStep = 2
};
}
type FormData = {
currentPassword?: string,