mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-08 03:57:31 +00:00
Compare commits
2 Commits
languy-res
...
users/vira
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b52f425b4c | ||
|
|
3530633fa2 |
@@ -21,17 +21,13 @@ module.exports = {
|
|||||||
collectCoverage: true,
|
collectCoverage: true,
|
||||||
|
|
||||||
// An array of glob patterns indicating a set of files for which coverage information should be collected
|
// An array of glob patterns indicating a set of files for which coverage information should be collected
|
||||||
// collectCoverageFrom: [
|
collectCoverageFrom: ["src/**/*.{js,jsx,ts,tsx}"],
|
||||||
// "src/Common/Headers*"
|
|
||||||
// ],
|
|
||||||
|
|
||||||
// The directory where Jest should output its coverage files
|
// The directory where Jest should output its coverage files
|
||||||
coverageDirectory: "coverage",
|
coverageDirectory: "coverage",
|
||||||
|
|
||||||
// An array of regexp pattern strings used to skip coverage collection
|
// An array of regexp pattern strings used to skip coverage collection
|
||||||
// coveragePathIgnorePatterns: [
|
coveragePathIgnorePatterns: ["/node_modules/"],
|
||||||
// "/node_modules/"
|
|
||||||
// ],
|
|
||||||
|
|
||||||
// A list of reporter names that Jest uses when writing coverage reports
|
// A list of reporter names that Jest uses when writing coverage reports
|
||||||
coverageReporters: ["json", "text", "cobertura"],
|
coverageReporters: ["json", "text", "cobertura"],
|
||||||
@@ -39,10 +35,10 @@ module.exports = {
|
|||||||
// An object that configures minimum threshold enforcement for coverage results
|
// An object that configures minimum threshold enforcement for coverage results
|
||||||
coverageThreshold: {
|
coverageThreshold: {
|
||||||
global: {
|
global: {
|
||||||
branches: 22,
|
branches: 25,
|
||||||
functions: 28,
|
functions: 25,
|
||||||
lines: 33,
|
lines: 30,
|
||||||
statements: 31,
|
statements: 30,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -349,8 +349,8 @@ export default class Explorer {
|
|||||||
async () => {
|
async () => {
|
||||||
this.isNotebookEnabled(
|
this.isNotebookEnabled(
|
||||||
!this.isAuthWithResourceToken() &&
|
!this.isAuthWithResourceToken() &&
|
||||||
((await this._containsDefaultNotebookWorkspace(this.databaseAccount())) ||
|
((await this._containsDefaultNotebookWorkspace(this.databaseAccount())) ||
|
||||||
this.isFeatureEnabled(Constants.Features.enableNotebooks))
|
this.isFeatureEnabled(Constants.Features.enableNotebooks))
|
||||||
);
|
);
|
||||||
|
|
||||||
TelemetryProcessor.trace(Action.NotebookEnabled, ActionModifiers.Mark, {
|
TelemetryProcessor.trace(Action.NotebookEnabled, ActionModifiers.Mark, {
|
||||||
@@ -372,7 +372,7 @@ export default class Explorer {
|
|||||||
this.isSparkEnabledForAccount() &&
|
this.isSparkEnabledForAccount() &&
|
||||||
this.arcadiaWorkspaces() &&
|
this.arcadiaWorkspaces() &&
|
||||||
this.arcadiaWorkspaces().length > 0) ||
|
this.arcadiaWorkspaces().length > 0) ||
|
||||||
this.isFeatureEnabled(Constants.Features.enableSpark)
|
this.isFeatureEnabled(Constants.Features.enableSpark)
|
||||||
);
|
);
|
||||||
if (this.isSparkEnabled()) {
|
if (this.isSparkEnabled()) {
|
||||||
appInsights.trackEvent(
|
appInsights.trackEvent(
|
||||||
@@ -2006,7 +2006,11 @@ export default class Explorer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const databaseAccount = this.databaseAccount();
|
const databaseAccount = this.databaseAccount();
|
||||||
const databaseAccountLocation = databaseAccount && databaseAccount.location.toLowerCase();
|
const databaseAccountLocations = databaseAccount && [
|
||||||
|
databaseAccount?.location.toLowerCase(),
|
||||||
|
...databaseAccount?.properties?.readLocations?.map(location => location?.locationName?.toLowerCase()),
|
||||||
|
...databaseAccount?.properties?.writeLocations?.map(location => location?.locationName?.toLowerCase())
|
||||||
|
];
|
||||||
const disallowedLocationsUri = `${configContext.BACKEND_ENDPOINT}/api/disallowedLocations`;
|
const disallowedLocationsUri = `${configContext.BACKEND_ENDPOINT}/api/disallowedLocations`;
|
||||||
const authorizationHeader = getAuthorizationHeader();
|
const authorizationHeader = getAuthorizationHeader();
|
||||||
try {
|
try {
|
||||||
@@ -2031,9 +2035,15 @@ export default class Explorer {
|
|||||||
this.isNotebooksEnabledForAccount(true);
|
this.isNotebooksEnabledForAccount(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const isAccountInAllowedLocation = !disallowedLocations.some(
|
const isAccountInAllowedLocation = databaseAccountLocations?.some(
|
||||||
(disallowedLocation) => disallowedLocation === databaseAccountLocation
|
(accountLocation) => {
|
||||||
);
|
if (!accountLocation) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !disallowedLocations.some(disallowedLocation => disallowedLocation === accountLocation); // not a disallowed location
|
||||||
|
}
|
||||||
|
) || false;
|
||||||
this.isNotebooksEnabledForAccount(isAccountInAllowedLocation);
|
this.isNotebooksEnabledForAccount(isAccountInAllowedLocation);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Logger.logError(getErrorMessage(error), "Explorer/isNotebooksEnabledForAccount");
|
Logger.logError(getErrorMessage(error), "Explorer/isNotebooksEnabledForAccount");
|
||||||
@@ -2532,12 +2542,12 @@ export default class Explorer {
|
|||||||
this.isFeatureEnabled(Constants.Features.enableKOPanel)
|
this.isFeatureEnabled(Constants.Features.enableKOPanel)
|
||||||
? this.deleteCollectionConfirmationPane.open()
|
? this.deleteCollectionConfirmationPane.open()
|
||||||
: this.openSidePanel(
|
: this.openSidePanel(
|
||||||
"Delete Collection",
|
"Delete Collection",
|
||||||
<DeleteCollectionConfirmationPanel
|
<DeleteCollectionConfirmationPanel
|
||||||
explorer={this}
|
explorer={this}
|
||||||
closePanel={() => this.closeSidePanel()}
|
closePanel={() => this.closeSidePanel()}
|
||||||
openNotificationConsole={() => this.expandConsole()}
|
openNotificationConsole={() => this.expandConsole()}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user