Merge pull request #922 from menakaj/master

Redirecting to listing pages after creating and editing Roles, Users, Policies and Groups.
revert-70aa11f8
Madawa Soysa 7 years ago committed by GitHub
commit 62141db52e

@ -73,18 +73,7 @@
<div class="wr-form">
<p class="page-sub-title">Group was created successfully.</p>
<br>Please click <b>"Add Another Group"</b>, if you wish to add another group or click
<b>"View Group List"</b> to complete the process and go back to the group list.
<hr/>
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/groups'">View Group List
</button>
<a href="{{@app.context}}/group/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Another Group
</a>
<br>You will be redirected to the Group Listing page in a moment.
</div>
</div>

@ -47,6 +47,9 @@ $(function () {
if (resp.status == 201) {
$("#group-create-form").addClass("hidden");
$("#group-created-msg").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/groups";
}, 1000);
} else {
displayErrors(resp.status);
}

@ -16,7 +16,7 @@
under the License.
}}
{{unit "cdmf.unit.ui.title" pageTitle="User Management | Add User"}}
{{unit "cdmf.unit.ui.modal"}}
{{#zone "breadcrumbs"}}
<li>
<a href="{{@app.context}}/">
@ -122,26 +122,14 @@
<button id="add-user-btn" class="wr-btn">Add User</button>
</div>
</div>
<div id="user-created-msg" class="container col-centered wr-content hidden">
<div class="wr-form">
<p class="page-sub-title">User was added successfully.</p>
<p>
An invitation mail will be sent to this user to initiate device enrollment.
</p>
<br>Please click <b>"Add Another User"</b>, if you wish to add another user or click
<b>"View User List"</b> to complete the process and go back to the user list.
<hr/>
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/users'">View User List
</button>
<a href="{{@app.context}}/user/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Another User
</a>
<div id="modal-content-user-created" class="hide">
<div id="notification-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<h4>
An invitation mail will be sent to this user to initiate device enrollment.
</h4>
</div>
<!-- /content -->
</div>

@ -226,7 +226,7 @@ $(document).ready(function () {
var firstname = firstnameInput.val();
var lastname = lastnameInput.val();
var emailAddress = $("input#emailAddress").val();
var roles ;
var roles;
if ($("#roles").length > 0) {
roles = $("select#roles").val();
}
@ -282,7 +282,13 @@ $(document).ready(function () {
}
// Refreshing with success message
$("#user-create-form").addClass("hidden");
$("#user-created-msg").removeClass("hidden");
modalDialog.header('<span class="fw-stack">' +
'<i class="fw fw-info fw-stack-1x"></i> </span> User was added successfully');
modalDialog.content($("#modal-content-user-created").html());
modalDialog.footer('<div class="buttons"> ' +
'<a href="/devicemgt/users" id="reset-password-yes-link" class="btn-operations"> OK' +
'</a></div>');
modalDialog.show();
generateQRCode("#user-created-msg .qr-code");
}

@ -123,18 +123,7 @@
<div class="wr-form">
<p class="page-sub-title">User was updated successfully.</p>
<br>Please click <b>"View Updated User"</b>, if you wish to view the updated user or click
<b>"View User List"</b> to complete the process and go back to the user list.
<hr/>
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/users'">View User List
</button>
<a href="{{@app.context}}/user/view?username={{editUser.username}}" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i>
</span>
View Updated User
</a>
<br>You will be redirected to User Listing Page in a moment.
</div>
</div>
<!-- /content -->

@ -248,6 +248,10 @@ $(document).ready(function () {
// Refreshing with success message
$("#user-create-form").addClass("hidden");
$("#user-created-msg").removeClass("hidden");
setTimeout(function () {
window.location.href = "/devicemgt/users"
}, 1000);
}
}, function (jqXHR) {
var payload = JSON.parse(jqXHR.responseText);

@ -69,7 +69,7 @@
<!--suppress HtmlFormInputWithoutLabel -->
<input id="policy-name-input" class="form-control" type="text" value=""/>
<label class="error nameEmpty hidden" for="summary">Policy name is required
& Should be be 1-to-30 characters long.</label>
and should be 1-to-30 characters long.</label>
</div>
<br class="c-both"/>
</div>

@ -428,8 +428,10 @@ var savePolicy = function (policy, isActive, serviceURL) {
$(".add-policy").addClass("hidden");
$(".policy-naming").addClass("hidden");
$(".policy-message").removeClass("hidden");
setTimeout(function(){}, 1000);
setTimeout(function() {
window.location.href = "/devicemgt/policies";
}, 1000);
},
function (data) {
}

@ -35,20 +35,8 @@
<div class="wr-form">
<h1 id="policy-message-page-wizard-title" class="page-sub-title">Policy is successfully
re-configured.</h1>
<br>Please click <b>"Add Another Policy"</b>, if you wish to add another policy or click
<b>"View policy list"</b> to complete the process and go back to the policy list.
<hr>
<button class="wr-btn wizard-stepper" data-current="policy-message"
data-direct="{{@app.context}}/policies/">
View policy list
</button>
<a href="{{@app.context}}/policies/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add another policy
</a>
<br>You will be redirected to Policy Listing page in a moment.
</div>
</div>
</div>

@ -495,6 +495,9 @@ var updatePolicy = function (policy, state) {
if (jqXHR.status == 200) {
$(".add-policy").addClass("hidden");
$(".policy-message").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/policies";
}, 1000);
}
},
// on error
@ -513,6 +516,9 @@ var updatePolicy = function (policy, state) {
$(".add-policy").addClass("hidden");
$(".policy-naming").addClass("hidden");
$(".policy-message").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/policies";
}, 1000);
}
},
// on error

@ -69,19 +69,8 @@
<div id="role-created-msg" class="container col-centered wr-content hidden">
<div class="wr-form">
<p class="page-sub-title">Permissions were assigned to the role successfully.</p>
<br>Please click <b>"Add Another Role"</b>, if you wish to add another role or click
<b>"View Role List"</b> to complete the process and go back to the role list.
<br>You will be redirected to Roles Listing Page in a moment.
<hr />
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/roles'">
View Role List
</button>
<a href="{{@app.context}}/role/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Another Role
</a>
</div>
</div>
<!-- /content -->

@ -184,6 +184,9 @@ $(document).ready(function () {
// Refreshing with success message
$("#role-create-form").addClass("hidden");
$("#role-created-msg").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/roles";
}, 1000);
}
}, function (data) {
var payload = JSON.parse(data.responseText);

@ -73,20 +73,7 @@
<div id="role-created-msg" class="container col-centered wr-content hidden">
<div class="wr-form">
<p class="page-sub-title">Role was updated successfully.</p>
<br>Please click <b>"View Updated Role"</b>, if you wish to view the updated role or click
<b>"View Role List"</b> to complete the process and go back to the role list.
<hr/>
<button class="wr-btn" onclick="window.location.href='{{@app.context}}/roles'">
View Role List
</button>
<a href="{{@app.context}}/roles/edit-role/{{role.roleName}}"
class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
View Updated Role
</a>
<br>You will be redirected to Roles Listing Page in a moment.
</div>
</div>
<!-- /content -->

@ -210,6 +210,9 @@ $(document).ready(function () {
// Refreshing with success message
$("#role-create-form").addClass("hidden");
$("#role-created-msg").removeClass("hidden");
setTimeout(function() {
window.location.href = "/devicemgt/roles";
}, 1000);
}
}, function (data) {

Loading…
Cancel
Save