Skip to content

Commit

Permalink
Merge branch 'master' into refactor-gsconnection
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshg999 authored Feb 6, 2024
2 parents 4d65618 + bb06b25 commit 76c8754
Show file tree
Hide file tree
Showing 40 changed files with 167 additions and 109 deletions.
12 changes: 6 additions & 6 deletions apps/about/src/about/templates/admin_wizard.mako
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,10 @@ ${ layout.menubar(section='quick_start') }
connector: connector.id
}, function(data) {
if (data.message) {
$(document).trigger('info', data.message);
huePubSub.publish('hue.global.info', { message: data.message });
}
if (data.errorMessage) {
huePubSub.publish('hue.global.error', {message: data.errorMessage});
huePubSub.publish('hue.global.error', { message: data.errorMessage });
}
if (data.status == 0 && $(event.target).data("is-connector")) {
huePubSub.publish('cluster.config.refresh.config');
Expand All @@ -350,9 +350,9 @@ ${ layout.menubar(section='quick_start') }
$.post(button.data("sample-url"), function(data) {
if (data.status == 0) {
if (data.message) {
$(document).trigger('info', data.message);
huePubSub.publish('hue.global.info', { message: data.message });
} else {
$(document).trigger('info', '${ _("Examples refreshed") }');
huePubSub.publish('hue.global.info', { message: '${ _("Examples refreshed") }'});
}
if ($(button).data("is-connector")) {
huePubSub.publish('cluster.config.refresh.config');
Expand Down Expand Up @@ -413,7 +413,7 @@ ${ layout.menubar(section='quick_start') }
});
$.when.apply(this, calls)
.then(function() {
$(document).trigger('info', '${ _("Examples refreshed") }');
huePubSub.publish('hue.global.info', { message: '${ _("Examples refreshed") }'});
})
.always(function(data) {
$(button).button('reset');
Expand Down Expand Up @@ -491,7 +491,7 @@ ${ layout.menubar(section='quick_start') }
$(".updatePreferences").click(function () {
$.post("${ url('about:update_preferences') }", $("input").serialize(), function(data) {
if (data.status == 0) {
$(document).trigger('info', '${ _("Configuration updated") }');
huePubSub.publish('hue.global.info', { message: '${ _("Configuration updated") }'});
} else {
huePubSub.publish('hue.global.error', {message: data.data});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ function hac_errorHandler(data) {
$(document).trigger('error.autocomplete');
if (typeof HIVE_AUTOCOMPLETE_FAILS_SILENTLY_ON == "undefined" || data.code == null || HIVE_AUTOCOMPLETE_FAILS_SILENTLY_ON.indexOf(data.code) == -1){
if (typeof HIVE_AUTOCOMPLETE_FAILS_QUIETLY_ON != "undefined" && HIVE_AUTOCOMPLETE_FAILS_QUIETLY_ON.indexOf(data.code) > -1){
$(document).trigger('info', data.error);
huePubSub.publish('hue.global.info', { message: data.error });
}
else {
huePubSub.publish('hue.global.error', {message: data.error});
huePubSub.publish('hue.global.error', { message: data.error });
}
}
}
4 changes: 2 additions & 2 deletions apps/beeswax/src/beeswax/templates/execute.mako
Original file line number Diff line number Diff line change
Expand Up @@ -2392,7 +2392,7 @@ $(document).on('server.unmanageable_error', function (e, responseText) {
// Other
$(document).on('saved.design', function (e, id) {
$('#saveAs').modal('hide');
$(document).trigger('info', "${_('Query saved.')}");
huePubSub.publish('hue.global.info', { message: "${_('Query saved.')}"});
huePubSub.publish('open.link', "/${ app_name }/execute/design/" + id);
});
$(document).on('error_save.design', function (e, message) {
Expand Down Expand Up @@ -2440,7 +2440,7 @@ $(document).on('error_cancel.query', function (e, message) {
huePubSub.publish('hue.global.error', {message: "${ _('Problem: ') }" + message});
});
$(document).on('cancelled.query', function (e) {
$(document).trigger("info", "${ _('Query canceled!') }")
huePubSub.publish('hue.global.info', { message: "${ _('Query canceled!') }"});
});
function updateSidebarTooltips(selector) {
Expand Down
33 changes: 33 additions & 0 deletions apps/filebrowser/src/filebrowser/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import logging
import posixpath
import os

from django.http import HttpResponse
from django.utils.translation import gettext as _
Expand Down Expand Up @@ -97,3 +98,35 @@ def mkdir(request):
request.fs.mkdir(request.fs.join(path, name))
return HttpResponse(status=200)


@error_handler
def touch(request):
path = request.POST.get('path')
name = request.POST.get('name')

if name and (posixpath.sep in name):
raise Exception(_("Error creating %s file. Slashes are not allowed in filename." % name))

request.fs.create(request.fs.join(path, name))
return HttpResponse(status=200)

@error_handler
def rename(request):
src_path = request.POST.get('src_path')
dest_path = request.POST.get('dest_path')

if "#" in dest_path:
raise Exception(_(
"Error renaming %s to %s. Hashes are not allowed in file or directory names." % (os.path.basename(src_path), dest_path)
))

# If dest_path doesn't have a directory specified, use same dir.
if "/" not in dest_path:
src_dir = os.path.dirname(src_path)
dest_path = request.fs.join(src_dir, dest_path)

if request.fs.exists(dest_path):
raise Exception(_('The destination path "%s" already exists.') % dest_path)

request.fs.rename(src_path, dest_path)
return HttpResponse(status=200)
Original file line number Diff line number Diff line change
Expand Up @@ -2093,10 +2093,10 @@ else:
onComplete: function (id, fileName, response) {
self.pendingUploads(self.pendingUploads() - 1);
if (response.status != 0) {
$(document).trigger('error', "${ _('Error: ') }" + response.data);
huePubSub.publish('hue.global.error', {message: "${ _('Error: ') }" + response.data});
}
else {
$(document).trigger('info', response.path + "${ _(' uploaded successfully.') }");
huePubSub.publish('hue.global.info', {message: response.path + "${ _(' uploaded successfully.') }"});
self.filesToHighlight.push(response.path);
}
if (self.pendingUploads() == 0) {
Expand Down Expand Up @@ -2158,10 +2158,11 @@ else:
onComplete: function (id, fileName, response) {
self.pendingUploads(self.pendingUploads() - 1);
if (response.status != 0) {
$(document).trigger('error', "${ _('Error: ') }" + response.data);
huePubSub.publish('hue.global.error', {message: "${ _('Error: ') }" + response.data});
}
else {
$(document).trigger('info', response.path + "${ _(' uploaded successfully.') }");
huePubSub.publish('hue.global.info', {message: response.path + "${ _(' uploaded successfully.') }");
self.filesToHighlight.push(response.path);
}
if (self.pendingUploads() == 0) {
Expand Down Expand Up @@ -2374,7 +2375,7 @@ else:
if (response.status != 0) {
huePubSub.publish('hue.global.error', {message: response.data});
} else {
$(document).trigger('info', response.path + ' ' + I18n('uploaded successfully'));
huePubSub.publish('hue.global.info', { message: response.path + ' ' + I18n('uploaded successfully')});
fileBrowserViewModel.filesToHighlight.push(response.path);
}
}
Expand Down
10 changes: 5 additions & 5 deletions apps/jobbrowser/src/jobbrowser/templates/job_browser.mako
Original file line number Diff line number Diff line change
Expand Up @@ -3478,7 +3478,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
});
} else {
vm.jobs._control([self.id()], action, function(data) {
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
self.fetchStatus();
});
}
Expand Down Expand Up @@ -3519,7 +3519,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
"auto_resize_cpu": self.updateClusterAutoResizeCpu()
}, function(data) {
console.log(ko.mapping.toJSON(data));
## $(document).trigger("info", ko.mapping.toJSON(data));
## huePubSub.publish('hue.global.info', { message: ko.mapping.toJSON(data) });
self.updateJob();
});
}
Expand Down Expand Up @@ -3895,7 +3895,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
"namespace_name": "crn:altus:sdx:us-west-1:12a0079b-1591-4ca0-b721-a446bda74e67:namespace:analytics/7ea35fe5-dbc9-4b17-92b1-97a1ab32e410"
}, function(data) {
console.log(ko.mapping.toJSON(data));
$(document).trigger("info", ko.mapping.toJSON(data));
huePubSub.publish('hue.global.info', { message: ko.mapping.toJSON(data) });
self.updateJobs();
huePubSub.publish('context.catalog.refresh');
});
Expand All @@ -3914,7 +3914,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
}, function(data) {
console.log(ko.mapping.toJSON(data));
self.createClusterFormReset();
##$(document).trigger("info", ko.mapping.toJSON(data));
##huePubSub.publish('hue.global.info', { message: ko.mapping.toJSON(data) });
self.updateJobs();
huePubSub.publish('context.catalog.refresh');
});
Expand Down Expand Up @@ -3957,7 +3957,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
}),
action,
function(data) {
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
self.updateJobs();
}
)
Expand Down
2 changes: 1 addition & 1 deletion apps/oozie/src/oozie/static/oozie/js/bundle-editor.ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ var BundleEditorViewModel = function (bundle_json, coordinators_json, can_edit_j
}
self.bundle.id(data.id);
self.bundle.tracker().markCurrentStateAsClean();
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
hueUtils.changeURL('/hue/oozie/editor/bundle/edit/?bundle=' + data.id);
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ var CoordinatorEditorViewModel = (function () {
if (typeof cb === 'function') {
cb(data);
} else {
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
}
if (!cb) { // cb from integrated scheduler
hueUtils.changeURL('/hue/oozie/editor/coordinator/edit/?coordinator=' + data.id);
Expand Down
2 changes: 1 addition & 1 deletion apps/oozie/src/oozie/static/oozie/js/workflow-editor.ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ var WorkflowEditorViewModel = function (layout_json, workflow_json, credentials_
shareViewModel.setDocUuid(data.doc_uuid);
}
self.workflow.id(data.id);
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
self.workflow.tracker().markCurrentStateAsClean();
huePubSub.publish('assist.document.refresh');
hueUtils.changeURL('/hue/oozie/editor/workflow/edit/?workflow=' + data.id);
Expand Down
6 changes: 3 additions & 3 deletions apps/oozie/src/oozie/templates/editor/edit_workflow.mako
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ function workflow_save_success(data) {
if (data.status != 0) {
huePubSub.publish('hue.global.error', {message: interpret_server_error(data, "${ _('Could not save workflow') }")});
} else {
$(document).trigger("info", "${ _('Workflow saved') }");
huePubSub.publish('hue.global.info', { message: "${ _('Workflow saved') }"});
workflow.reload(data.data);
workflow.is_dirty( false );
workflow.loading( false );
Expand Down Expand Up @@ -902,7 +902,7 @@ $('#importJobsub').on('click', '.action-row', function(e) {
workflow.el.trigger('workflow:rebuild');
routie('editWorkflow');
$(document).trigger("info", "${ _('Action imported at the top of the workflow.') } ");
huePubSub.publish('hue.global.info', { message: "${ _('Action imported at the top of the workflow.') } "});
} else {
huePubSub.publish('hue.global.error', {message: interpret_server_error(data, "${ _('Received invalid response from server') }")});
}
Expand Down Expand Up @@ -943,7 +943,7 @@ $('#importOozieAction').on('click', '.action-row', function(e) {
workflow.el.trigger('workflow:rebuild');
routie('editWorkflow');
$(document).trigger("info", "${ _('Action imported at the top of the workflow.') }");
huePubSub.publish('hue.global.info', { message: "${ _('Action imported at the top of the workflow.') }"});
}
});
Expand Down
2 changes: 1 addition & 1 deletion apps/pig/src/pig/templates/app.mako
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,7 @@ ${ commonshare() | n,unicode }
};
function showAlert(msg) {
$(document).trigger("info", msg);
huePubSub.publish('hue.global.info', { message: msg });
}
</script>
Expand Down
6 changes: 3 additions & 3 deletions apps/security/src/security/static/security/js/hive.ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ var HiveViewModel = (function () {
role: ko.mapping.toJSON(self)
}, function (data) {
if (data.status == 0) {
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
vm.showCreateRole(false);
self.reset();
var role = new Role(vm, data.role);
Expand All @@ -314,7 +314,7 @@ var HiveViewModel = (function () {
role: ko.mapping.toJSON(self)
}, function (data) {
if (data.status == 0) {
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
vm.showCreateRole(false);
vm.list_sentry_privileges_by_authorizable();
$(document).trigger("createdRole");
Expand Down Expand Up @@ -1131,7 +1131,7 @@ var HiveViewModel = (function () {
},
success: function (data) {
if (data.status == 0) {
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
self.assist.refreshTree();
self.clearTempRoles();
$(document).trigger("createdRole");
Expand Down
6 changes: 3 additions & 3 deletions apps/security/src/security/static/security/js/sentry.ko.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ var SentryViewModel = (function () {
component: vm.component()
}, function (data) {
if (data.status == 0) {
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
vm.showCreateRole(false);
self.reset();
var role = new Role(vm, data.role);
Expand All @@ -331,7 +331,7 @@ var SentryViewModel = (function () {
component: vm.component()
}, function (data) {
if (data.status == 0) {
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
vm.showCreateRole(false);
vm.list_sentry_privileges_by_authorizable();
$(document).trigger("createdRole");
Expand Down Expand Up @@ -1199,7 +1199,7 @@ var SentryViewModel = (function () {
},
success: function (data) {
if (data.status == 0) {
$(document).trigger("info", data.message);
huePubSub.publish('hue.global.info', { message: data.message });
self.assist.refreshTree();
self.clearTempRoles();
$(document).trigger("createdRole");
Expand Down
8 changes: 4 additions & 4 deletions apps/security/src/security/templates/hdfs.mako
Original file line number Diff line number Diff line change
Expand Up @@ -352,21 +352,21 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
});
$(document).on("updatedAcls", function() {
$(document).trigger("info", "${ _('The selected ACLs have been successfully updated.') }");
huePubSub.publish('hue.global.info', { message: "${ _('The selected ACLs have been successfully updated.') }"});
});
$(document).on("addedBulkAcls", function() {
$(document).trigger("info", "${ _('The current ACLs have been successfully added to the checked paths.') }");
huePubSub.publish('hue.global.info', { message: "${ _('The current ACLs have been successfully added to the checked paths.') }"});
$("#bulkActionsModal").modal("hide");
});
$(document).on("deletedBulkAcls", function() {
$(document).trigger("info", "${ _('All the ACLs have been successfully removed from the checked paths.') }");
huePubSub.publish('hue.global.info', { message: "${ _('All the ACLs have been successfully removed from the checked paths.') }"});
$("#bulkActionsModal").modal("hide");
});
$(document).on("syncdBulkAcls", function() {
$(document).trigger("info", "${ _('All the ACLs for the checked items have been replaced with the current selection.') }");
huePubSub.publish('hue.global.info', { message: "${ _('All the ACLs for the checked items have been replaced with the current selection.') }"});
$("#bulkActionsModal").modal("hide");
});
Expand Down
6 changes: 3 additions & 3 deletions apps/security/src/security/templates/hive.mako
Original file line number Diff line number Diff line change
Expand Up @@ -725,17 +725,17 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
});
$(document).on("addedBulkPrivileges", function() {
$(document).trigger("info", "${ _('The current privileges have been successfully added to the checked items.') }");
huePubSub.publish('hue.global.info', { message: "${ _('The current privileges have been successfully added to the checked items.') }"});
$("#bulkActionsModal").modal("hide");
});
$(document).on("deletedBulkPrivileges", function() {
$(document).trigger("info", "${ _('All the privileges have been successfully removed from the checked items.') }");
huePubSub.publish('hue.global.info', { message: "${ _('All the privileges have been successfully removed from the checked items.') }"});
$("#bulkActionsModal").modal("hide");
});
$(document).on("syncdBulkPrivileges", function() {
$(document).trigger("info", "${ _('All the privileges for the checked items have been replaced with the current selection.') }");
huePubSub.publish('hue.global.info', { message: "${ _('All the privileges for the checked items have been replaced with the current selection.') }"});
$("#bulkActionsModal").modal("hide");
});
Expand Down
6 changes: 3 additions & 3 deletions apps/security/src/security/templates/sentry.mako
Original file line number Diff line number Diff line change
Expand Up @@ -779,17 +779,17 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
});
$(document).on("addedBulkPrivileges", function () {
$(document).trigger("info", "${ _('The current privileges have been successfully added to the checked items.') }");
huePubSub.publish('hue.global.info', { message: "${ _('The current privileges have been successfully added to the checked items.') }"});
$("#bulkActionsModal").modal("hide");
});
$(document).on("deletedBulkPrivileges", function () {
$(document).trigger("info", "${ _('All the privileges have been successfully removed from the checked items.') }");
huePubSub.publish('hue.global.info', { message: "${ _('All the privileges have been successfully removed from the checked items.') }"});
$("#bulkActionsModal").modal("hide");
});
$(document).on("syncdBulkPrivileges", function () {
$(document).trigger("info", "${ _('All the privileges for the checked items have been replaced with the current selection.') }");
huePubSub.publish('hue.global.info', { message: "${ _('All the privileges for the checked items have been replaced with the current selection.') }"});
$("#bulkActionsModal").modal("hide");
});
Expand Down
Loading

0 comments on commit 76c8754

Please sign in to comment.