Strict Null Checks on platform/accounts (#6735)

* add some patches for strict null

* renable strict null checks

* wip

* finish adding account to strict nulls

* fix backup component

* wip

* fix tests
This commit is contained in:
Anthony Dresser
2019-08-14 20:26:21 -07:00
committed by GitHub
parent 7b8530a21e
commit 4966ed8b42
22 changed files with 153 additions and 161 deletions

View File

@@ -15,6 +15,6 @@ export interface IAccountPickerService {
addAccountCompleteEvent: Event<void>;
addAccountErrorEvent: Event<string>;
addAccountStartEvent: Event<void>;
onAccountSelectionChangeEvent: Event<azdata.Account>;
selectedAccount: azdata.Account;
onAccountSelectionChangeEvent: Event<azdata.Account | undefined>;
selectedAccount: azdata.Account | undefined;
}

View File

@@ -17,7 +17,7 @@ export class AccountPickerViewModel {
private _updateAccountListEmitter: Emitter<UpdateAccountListEventParams>;
public get updateAccountListEvent(): Event<UpdateAccountListEventParams> { return this._updateAccountListEmitter.event; }
public selectedAccount: azdata.Account;
public selectedAccount: azdata.Account | undefined;
constructor(
private _providerId: string,

View File

@@ -89,7 +89,7 @@ export default class AccountStore implements IAccountStore {
activeOperation = activeOperation.then(op);
// Add a catch at the end to make sure we can continue after any errors
activeOperation = activeOperation.then(null, (err) => {
activeOperation = activeOperation.then(undefined, (err) => {
// TODO: Log the error
});
@@ -107,7 +107,7 @@ export default class AccountStore implements IAccountStore {
accountAdded: false,
accountModified: false,
accountRemoved: false,
changedAccount: null,
changedAccount: undefined,
updatedAccounts: accounts
};
}
@@ -135,7 +135,7 @@ export default class AccountStore implements IAccountStore {
accountAdded: false,
accountModified: false,
accountRemoved: match >= 0,
changedAccount: null,
changedAccount: undefined,
updatedAccounts: accounts
};
}
@@ -149,7 +149,7 @@ export default class AccountStore implements IAccountStore {
accountAdded: false,
accountModified: false,
accountRemoved: false,
changedAccount: null,
changedAccount: undefined,
updatedAccounts: accounts
};
}

View File

@@ -22,7 +22,7 @@ export interface AccountAdditionResult {
/**
* The account that was added/updated (with any updates applied)
*/
changedAccount: azdata.Account;
changedAccount: azdata.Account | undefined;
}
/**

View File

@@ -10,7 +10,7 @@ import * as azdata from 'azdata';
*/
export class FirewallRuleViewModel {
public isIPAddressSelected: boolean;
public selectedAccount: azdata.Account;
public selectedAccount: azdata.Account | undefined;
private _defaultIPAddress: string;
private _defaultFromSubnetIPRange: string;