Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const reloadPartitions = function(dataCatalogEntry, apiOptions) {
return dataCatalogEntry.trackedPromise(
'partitionsPromise',
catalogUtils.fetchAndSave('fetchPartitions', 'partitions', dataCatalogEntry, apiOptions)
);
};
const reloadSample = function(dataCatalogEntry, apiOptions) {
return dataCatalogEntry.trackedPromise(
'samplePromise',
catalogUtils.fetchAndSave('fetchSample', 'sample', dataCatalogEntry, apiOptions)
);
};
cancellablePromises.push(
catalogUtils
.fetchAndSave('fetchSourceMetadata', 'sourceMeta', dataCatalogEntry, options)
.done(deferred.resolve)
.fail(deferred.reject)
);
});
return dataCatalogEntry.trackedPromise(
'sourceMetaPromise',
new CancellablePromise(deferred, undefined, cancellablePromises)
);
}
return dataCatalogEntry.trackedPromise(
'sourceMetaPromise',
catalogUtils.fetchAndSave('fetchSourceMetadata', 'sourceMeta', dataCatalogEntry, options)
);
};
const reloadNavOptMeta = function(dataCatalogEntry, apiOptions) {
if (dataCatalogEntry.dataCatalog.canHaveNavOptMetadata()) {
return dataCatalogEntry.trackedPromise(
'navOptMetaPromise',
catalogUtils.fetchAndSave('fetchNavOptMeta', 'navOptMeta', dataCatalogEntry, apiOptions)
);
}
dataCatalogEntry.navOptMetaPromise = $.Deferred.reject().promise();
return dataCatalogEntry.navOptMetaPromise;
};
const reloadNavigatorMeta = function(dataCatalogEntry, apiOptions) {
if (dataCatalogEntry.canHaveNavigatorMetadata()) {
return dataCatalogEntry
.trackedPromise(
'navigatorMetaPromise',
catalogUtils.fetchAndSave(
'fetchNavigatorMetadata',
'navigatorMeta',
dataCatalogEntry,
apiOptions
)
)
.done(navigatorMeta => {
if (navigatorMeta && dataCatalogEntry.commentObservable) {
dataCatalogEntry.commentObservable(dataCatalogEntry.getResolvedComment());
}
});
}
dataCatalogEntry.navigatorMetaPromise = $.Deferred().reject();
return dataCatalogEntry.navigatorMetaPromise;
};
const reloadAnalysis = function(dataCatalogEntry, apiOptions) {
return dataCatalogEntry.trackedPromise(
'analysisPromise',
catalogUtils.fetchAndSave(
apiOptions && apiOptions.refreshAnalysis ? 'refreshAnalysis' : 'fetchAnalysis',
'analysis',
dataCatalogEntry,
apiOptions
)
);
};
const genericNavOptReload = function(
multiTableEntry,
options,
promiseAttribute,
dataAttribute,
apiHelperFunction
) {
if (multiTableEntry.dataCatalog.canHaveNavOptMetadata()) {
return multiTableEntry.trackedPromise(
promiseAttribute,
catalogUtils.fetchAndSave(apiHelperFunction, dataAttribute, multiTableEntry, options)
);
}
multiTableEntry[promiseAttribute] = $.Deferred().reject();
return multiTableEntry[promiseAttribute];
};