Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.isRightPanelVisible.subscribe(val => {
if (!self.assistWithoutStorage()) {
apiHelper.setInTotalStorage('assist', 'right_assist_panel_visible', val);
}
});
self.leftAssistVisible.subscribe(val => {
if (!self.assistWithoutStorage()) {
apiHelper.setInTotalStorage('assist', 'left_assist_panel_visible', val);
}
hueAnalytics.convert('hue', 'leftAssistVisible/' + val);
window.setTimeout(() => {
huePubSub.publish('split.panel.resized');
$(window).trigger('resize');
}, 0);
});
const found = self[TYPES_INDEX.compute.available]().some(compute => {
if (namespace.id === compute.namespace) {
self[TYPES_INDEX.compute.name](compute);
apiHelper.setInTotalStorage(
'contextSelector',
TYPES_INDEX.compute.totalStorageId,
namespace
);
return true;
}
});
setEnableLiveAutocompletion: function(enabled) {
editor.setOption('enableLiveAutocompletion', enabled);
apiHelper.setInTotalStorage('hue.ace', 'enableLiveAutocompletion', enabled);
if (enabled && $('#setEnableAutocompleter:checked').length === 0) {
$('#setEnableAutocompleter').trigger('click');
}
},
getEnableLiveAutocompletion: function() {
editor.customMenuOptions.setClearIgnoredSyntaxChecks = function() {
apiHelper.setInTotalStorage('hue.syntax.checker', 'suppressedRules', {});
$('#setClearIgnoredSyntaxChecks')
.hide()
.before('<div style="margin-top:5px;float:right;">done</div>');
};
editor.customMenuOptions.getClearIgnoredSyntaxChecks = function() {
self[type.onSelect] = function(selectedVal, previousVal) {
if (params[type.onSelect]) {
params[type.onSelect](selectedVal, previousVal);
}
apiHelper.setInTotalStorage('contextSelector', type.totalStorageId, selectedVal);
if (selectedVal && type === TYPES_INDEX.compute) {
self.setMatchingNamespace(selectedVal);
} else if (selectedVal && type === TYPES_INDEX.namespace) {
self.setMatchingCompute(selectedVal);
}
};
if (self[type.name]) {
exec: function() {
darkThemeEnabled = !darkThemeEnabled;
apiHelper.setInTotalStorage('ace', 'dark.theme.enabled', darkThemeEnabled);
editor.setTheme(darkThemeEnabled ? 'ace/theme/hue_dark' : 'ace/theme/hue');
}
});
this.isRightPanelVisible.subscribe(val => {
if (!this.assistWithoutStorage()) {
apiHelper.setInTotalStorage('assist', 'right_assist_panel_visible', val);
}
});
this.showOptimizer.subscribe(newValue => {
if (newValue !== null) {
apiHelper.setInTotalStorage('editor', 'show.optimizer', newValue);
}
});
huePubSub.subscribe('assist.adls.go.home', () => {
loadPath(window.USER_HOME_DIR);
apiHelper.setInTotalStorage('assist', 'currentAdlsPath', window.USER_HOME_DIR);
});