Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadNavOptPopularityForChildren(options) {
const self = this;
options = catalogUtils.setSilencedErrors(options);
if (!self.dataCatalog.canHaveNavOptMetadata()) {
return $.Deferred()
.reject()
.promise();
}
if (self.navOptPopularityForChildrenPromise && (!options || !options.refreshCache)) {
return catalogUtils.applyCancellable(self.navOptPopularityForChildrenPromise, options);
}
const deferred = $.Deferred();
const cancellablePromises = [];
if (self.definition && self.definition.navOptLoaded && (!options || !options.refreshCache)) {
cancellablePromises.push(
self
.getChildren(options)
.done(childEntries => {
getNavOptMeta(options) {
const self = this;
options = catalogUtils.setSilencedErrors(options);
if (!self.dataCatalog.canHaveNavOptMetadata() || !self.isTableOrView()) {
return $.Deferred()
.reject()
.promise();
}
if (options && options.cachedOnly) {
return (
catalogUtils.applyCancellable(self.navOptMetaPromise, options) ||
$.Deferred()
.reject(false)
.promise()
);
}
if (options && options.refreshCache) {
return catalogUtils.applyCancellable(reloadNavOptMeta(self, options), options);
getNavigatorMeta(options) {
const self = this;
options = catalogUtils.setSilencedErrors(options);
if (!self.canHaveNavigatorMetadata()) {
return $.Deferred()
.reject()
.promise();
}
if (options && options.cachedOnly) {
return (
catalogUtils.applyCancellable(self.navigatorMetaPromise, options) ||
$.Deferred()
.reject(false)
.promise()
);
}
if (options && options.refreshCache) {
return catalogUtils.applyCancellable(reloadNavigatorMeta(self, options), options);
loadNavOptPopularityForTables(options) {
const self = this;
const deferred = $.Deferred();
const cancellablePromises = [];
let popularEntries = [];
const pathsToLoad = [];
options = catalogUtils.setSilencedErrors(options);
const existingPromises = [];
options.paths.forEach(path => {
const existingDeferred = $.Deferred();
self
.getEntry({ namespace: options.namespace, compute: options.compute, path: path })
.done(tableEntry => {
if (tableEntry.navOptPopularityForChildrenPromise) {
tableEntry.navOptPopularityForChildrenPromise
.done(existingPopularEntries => {
popularEntries = popularEntries.concat(existingPopularEntries);
existingDeferred.resolve();
})
.fail(existingDeferred.reject);
} else if (tableEntry.definition && tableEntry.definition.navOptLoaded) {
cancellablePromises.push(
loadNavigatorMetaForChildren(options) {
const self = this;
options = catalogUtils.setSilencedErrors(options);
if (!self.canHaveNavigatorMetadata() || self.isField()) {
return $.Deferred()
.reject()
.promise();
}
if (self.navigatorMetaForChildrenPromise && (!options || !options.refreshCache)) {
return catalogUtils.applyCancellable(self.navigatorMetaForChildrenPromise, options);
}
const deferred = $.Deferred();
const cancellablePromises = [];
cancellablePromises.push(