B #2024: Sunstone reloads the page with a group change of a user (#2026)

(cherry picked from commit 426f4bc9cf)
This commit is contained in:
Abel Coronado authored and Tino Vazquez committed 2018-04-25 15:24:00 +02:00
1 parent 555542a133
commit 242bb7ca54
2 files changed
+22 -21

No files matched your search

@@ -108,7 +108,7 @@ define(function(require) {
this.groupsTableEdit.selectResourceTableSelect({ids: this.groups});
var that = this;
$("#cancel_update_group").hide();
$("#cancel_update_group").hide();
var that = this;
context.off("click", "#update_group");
context.on("click", "#update_group", function() {
@@ -122,21 +122,21 @@ define(function(require) {
});
$(".show_labels").hide();
$(".select_labels").show();
$("#submit-group").show();
});
context.off("click", "#cancel_update_group");
context.on("click", "#cancel_update_group", function() {
$(".select_labels").hide();
$(".show_labels").show();
$("#submit-group").hide();
});
$('#Form_change_second_grp').submit(function() {
var selectPrimaryGrp = $("#choose_primary_grp .resource_list_select").val();
var selectedGroupsList = that.groupsTableEdit.retrieveResourceTableSelect();
if (selectPrimaryGrp != -1 && selectPrimaryGrp != that.element.GID) {
if (selectPrimaryGrp != -1 && selectPrimaryGrp != that.element.GID) {
Sunstone.runAction("User.chgrp", [that.element.ID], selectPrimaryGrp);
}
@@ -158,6 +158,7 @@ define(function(require) {
Sunstone.runAction('User.refresh');
}, 1500);
return false;
});
return false;
}
@@ -13,16 +13,16 @@
{{! See the License for the specific language governing permissions and }}
{{! limitations under the License. }}
{{! -------------------------------------------------------------------------- }}
<div class="row">
<button type="submit" class="button primary small radius right show_labels" id="update_group">
<span class= "fa fa-pencil-square-o"></span>
{{tr "Edit"}}
</button>
<button type="submit" class="button secondary small radius right select_labels" id="cancel_update_group" hidden="true">
<span class= "fa fa-times-circle"></span>
</button>
</div>
<form data-abide novalidate id="Form_change_second_grp">
<div class="row">
<button type="submit" class="button primary small radius right show_labels" id="update_group">
<span class= "fas fa-edit"></span>
{{tr "Edit"}}
</button>
<button type="submit" class="button secondary small radius right select_labels" id="cancel_update_group" hidden="true">
<span class= "fas fa-times-circle"></span>
</button>
</div>
<form data-abide novalidate id="Form_change_second_grp">
<div class="row">
<fieldset style="margin-bottom: 0rem;">
<legend>{{tr "Primary Group"}}</legend>
@@ -31,7 +31,7 @@
</fieldset>
</div>
<div class="row">
<fieldset>
<fieldset>
<legend>{{tr "Secondary Group"}}</legend>
<div class="show_labels">
<div class="large-12 columns show_labels">
@@ -46,9 +46,9 @@
</fieldset>
</div>
<div class="confirm-resources-header"></div>
<div class="form_buttons row">
<button type="submit" class="button success radius right" >
{{tr "Apply changes"}}
</button>
</div>
</form>
<div class="form_buttons row" id="submit-group" hidden="true">
<button type="submit" class="button success radius right">
{{tr "Apply changes"}}
</button>
</div>
</form>