fixed typescript strict of CqlUtilities.test.ts CapabilityUtils.ts file (#787)

Co-authored-by: Steve Faulkner <southpolesteve@gmail.com>
This commit is contained in:
Sunil Kumar Yadav 2021-07-15 11:21:36 +05:30 committed by GitHub
parent 7dd8bd567f
commit 103b3bf6c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 7 deletions

View File

@ -1,4 +1,5 @@
export function getQuotedCqlIdentifier(identifier: string): string { // Added return type optional undefined because passing undefined from test cases.
export function getQuotedCqlIdentifier(identifier: string | undefined): string | undefined {
let result = identifier; let result = identifier;
if (!identifier) { if (!identifier) {
return result; return result;

View File

@ -1,7 +1,12 @@
import * as Constants from "../Common/Constants"; import * as Constants from "../Common/Constants";
import { userContext } from "../UserContext"; import { userContext } from "../UserContext";
export const isCapabilityEnabled = (capabilityName: string): boolean => export const isCapabilityEnabled = (capabilityName: string): boolean => {
userContext.databaseAccount?.properties?.capabilities?.some((capability) => capability.name === capabilityName); const { databaseAccount } = userContext;
if (databaseAccount && databaseAccount.properties && databaseAccount.properties.capabilities) {
return databaseAccount.properties.capabilities.some((capability) => capability.name === capabilityName);
}
return false;
};
export const isServerlessAccount = (): boolean => isCapabilityEnabled(Constants.CapabilityNames.EnableServerless); export const isServerlessAccount = (): boolean => isCapabilityEnabled(Constants.CapabilityNames.EnableServerless);

View File

@ -8,9 +8,6 @@
"noUnusedParameters": true "noUnusedParameters": true
}, },
"files": [ "files": [
"./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerSplashScreen.tsx",
"./src/Explorer/Panes/PanelContainerComponent.tsx",
"./src/hooks/useSidePanel.ts",
"./src/AuthType.ts", "./src/AuthType.ts",
"./src/Bindings/ReactBindingHandler.ts", "./src/Bindings/ReactBindingHandler.ts",
"./src/Common/ArrayHashMap.ts", "./src/Common/ArrayHashMap.ts",
@ -68,12 +65,16 @@
"./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerUtils.ts", "./src/Explorer/Notebook/SchemaAnalyzer/SchemaAnalyzerUtils.ts",
"./src/Explorer/OpenFullScreen.test.tsx", "./src/Explorer/OpenFullScreen.test.tsx",
"./src/Explorer/OpenFullScreen.tsx", "./src/Explorer/OpenFullScreen.tsx",
"./src/Explorer/Panes/PanelContainerComponent.test.tsx",
"./src/Explorer/Panes/PanelContainerComponent.tsx",
"./src/Explorer/Panes/PanelFooterComponent.tsx", "./src/Explorer/Panes/PanelFooterComponent.tsx",
"./src/Explorer/Panes/PanelInfoErrorComponent.tsx", "./src/Explorer/Panes/PanelInfoErrorComponent.tsx",
"./src/Explorer/Panes/PanelLoadingScreen.tsx", "./src/Explorer/Panes/PanelLoadingScreen.tsx",
"./src/Explorer/Panes/PanelStyles.ts",
"./src/Explorer/Panes/Tables/Validators/EntityPropertyNameValidator.ts", "./src/Explorer/Panes/Tables/Validators/EntityPropertyNameValidator.ts",
"./src/Explorer/Panes/Tables/Validators/EntityPropertyValidationCommon.ts", "./src/Explorer/Panes/Tables/Validators/EntityPropertyValidationCommon.ts",
"./src/Explorer/Tables/Constants.ts", "./src/Explorer/Tables/Constants.ts",
"./src/Explorer/Tables/CqlUtilities.test.ts",
"./src/Explorer/Tables/CqlUtilities.ts", "./src/Explorer/Tables/CqlUtilities.ts",
"./src/Explorer/Tables/DataTable/CacheBase.ts", "./src/Explorer/Tables/DataTable/CacheBase.ts",
"./src/Explorer/Tables/Entities.ts", "./src/Explorer/Tables/Entities.ts",
@ -96,7 +97,9 @@
"./src/Shared/Constants.ts", "./src/Shared/Constants.ts",
"./src/Shared/DefaultExperienceUtility.ts", "./src/Shared/DefaultExperienceUtility.ts",
"./src/Shared/ExplorerSettings.ts", "./src/Shared/ExplorerSettings.ts",
"./src/Shared/LocalStorageUtility.ts",
"./src/Shared/PriceEstimateCalculator.ts", "./src/Shared/PriceEstimateCalculator.ts",
"./src/Shared/SessionStorageUtility.ts",
"./src/Shared/StorageUtility.test.ts", "./src/Shared/StorageUtility.test.ts",
"./src/Shared/StorageUtility.ts", "./src/Shared/StorageUtility.ts",
"./src/Shared/StringUtility.test.ts", "./src/Shared/StringUtility.test.ts",
@ -108,6 +111,8 @@
"./src/Utils/Base64Utils.test.ts", "./src/Utils/Base64Utils.test.ts",
"./src/Utils/Base64Utils.ts", "./src/Utils/Base64Utils.ts",
"./src/Utils/BlobUtils.ts", "./src/Utils/BlobUtils.ts",
"./src/Utils/CapabilityUtils.ts",
"./src/Utils/CloudUtils.ts",
"./src/Utils/GitHubUtils.test.ts", "./src/Utils/GitHubUtils.test.ts",
"./src/Utils/GitHubUtils.ts", "./src/Utils/GitHubUtils.ts",
"./src/Utils/MessageValidation.test.ts", "./src/Utils/MessageValidation.test.ts",
@ -155,4 +160,4 @@
"src/Terminal/**/*", "src/Terminal/**/*",
"src/Utils/arm/**/*" "src/Utils/arm/**/*"
] ]
} }