async clearInput(elem: ElementFinder) {
const types = ['text', 'number'];
if ((await elem.getTagName()) === 'input' && types.includes(await elem.getAttribute('type'))) {
- await elem.sendKeys(
+ return await elem.sendKeys(
protractor.Key.chord(protractor.Key.CONTROL, 'a'),
protractor.Key.BACK_SPACE
);
if (first && _.isUndefined(first['info'])) {
return this.i18n('Unavailable gateway(s)');
}
+
+ return undefined;
}
getDeleteDisableDesc(): string | undefined {
if (first && first['info'] && first['info']['num_sessions']) {
return this.i18n('Target has active sessions');
}
+
+ return undefined;
}
prepareResponse(resp: any): any[] {
if (!control.value.match(/^[\w\-_]*$/)) {
return { invalidClusterName: { value: control.value } };
}
+
+ return undefined;
}
validateClientID(control: AbstractControl) {
if (!control.value.match(/^(?!client\.)[\w\-_.]*$/)) {
return { invalidClientID: { value: control.value } };
}
+
+ return undefined;
}
validateMonAddr(control: AbstractControl) {
if (!control.value.match(/^[,; ]*([\w.\-_\[\]]+(:[\d]+)?[,; ]*)*$/)) {
return { invalidMonAddr: { value: control.value } };
}
+
+ return undefined;
}
validateKey(control: AbstractControl) {
if (pool && pool['peer_uuids']) {
return pool['peer_uuids'][0];
}
+
+ return undefined;
}
updateSelection(selection: CdTableSelection) {
return this.i18n('Namespace contains images');
}
}
+
+ return undefined;
}
}
if (!featuresName.includes('layering')) {
return this.i18n('Parent image must support Layering');
}
+
+ return undefined;
}
}
return typeValidators.validators;
}
+
+ return undefined;
}
getStep(type: string, value: number): number | undefined {
if (!this.orchestratorAvailable) {
return this.i18n('Host operation is disabled because orchestrator is unavailable');
}
+
+ return undefined;
}
}
return this.i18n('This Manager module is always on.');
}
}
+
+ return undefined;
}
/**
getMinSize(): number {
if (!this.info || this.info.osd_count < 1) {
- return;
+ return undefined;
}
const rule = this.form.getValue('crushRule');
if (rule) {
getMaxSize(): number {
if (!this.info || this.info.osd_count < 1) {
- return;
+ return undefined;
}
const osds: number = this.info.osd_count;
if (this.form.getValue('crushRule')) {
if (sizeControl.valid && size > 0) {
return pgs / size;
}
+
+ return undefined;
}
private erasurePgCalc(pgs): number {
if ((ecpControl.valid || ecpControl.disabled) && ecp) {
return pgs / (ecp.k + ecp.m);
}
+
+ return undefined;
}
private alignPgs(pgs = this.form.getValue('pgNum')) {
'Pool deletion is disabled by the mon_allow_pool_delete configuration setting.'
);
}
+
+ return undefined;
}
}
return { color: '#f0ad4e' };
}
}
+
+ return undefined;
}
toggleSubMenu(menu: string) {
}
private getExpirationDays(pwdExpirationDate: number): number {
- if (pwdExpirationDate) {
- const current = new Date();
- const expiration = new Date(pwdExpirationDate * 1000);
- return Math.floor((expiration.valueOf() - current.valueOf()) / (1000 * 3600 * 24));
- }
+ const current = new Date();
+ const expiration = new Date(pwdExpirationDate * 1000);
+ return Math.floor((expiration.valueOf() - current.valueOf()) / (1000 * 3600 * 24));
}
close() {
*/
getCurrentButton(): CdTableAction {
if (this.dropDownOnly) {
- return;
+ return undefined;
}
let buttonAction = this.dropDownActions.find((tableAction) => this.showableAction(tableAction));
if (!buttonAction && this.dropDownActions.length > 0) {
useRouterLink(action: CdTableAction): string {
if (!action.routerLink || this.disableSelectionAction(action)) {
- return;
+ return undefined;
}
return _.isString(action.routerLink) ? action.routerLink : action.routerLink();
}
private makePairs(data: any): KeyValueItem[] {
let result: KeyValueItem[] = [];
if (!data) {
- return; // Wait for data
+ return undefined; // Wait for data
} else if (_.isArray(data)) {
result = this.makePairsFromArray(data);
} else if (_.isObject(data)) {
return value.filter((row) => {
let result = true;
- args.forEach((filter) => {
+ args.forEach((filter): boolean | void => {
if (!filter.value) {
- return;
+ return undefined;
}
result = result && filter.applyFilter(row, filter.value);
rules: PrometheusRule[]
): AlertmanagerSilenceMatcherMatch {
if (matchers.some((matcher) => matcher.isRegex)) {
- return;
+ return undefined;
}
matchers.forEach((matcher) => {
rules = this.getMatchedRules(matcher, rules);
private getTaskAction(tasks: ExecutingTask[]): string {
if (tasks.length === 0) {
- return;
+ return undefined;
}
return tasks
.map((task) => {
calculateDate(date: Date, duration: string, reverse?: boolean): Date {
const time = +date;
if (_.isNaN(time)) {
- return;
+ return undefined;
}
const diff = this.getDurationMs(duration) * (reverse ? -1 : 1);
return new Date(time + diff);
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noImplicitThis": true,
+ "noImplicitReturns": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"