123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- var Unibase;
- (function (Unibase) {
- let Platform;
- (function (Platform) {
- let InviteUsers;
- (function (InviteUsers) {
- let Components;
- (function (Components) {
- class UserLockUnLockStatus extends Platform.Core.BaseComponent {
- cssFiles() {
- return [];
- }
- jsFiles() {
- return ['platform/membership/managers/accountmanager.js'];
- }
- html(id, containerid) {
- let html = ``;
- return html;
- }
- load(id, containerid, callback) {
- }
- init(containerid) {
- var instance = this;
- instance.fileCacheHelper.loadJsFile("platform/membership/managers/accountmanager.js", function () {
- Unibase.Platform.Membership.Managers.AccountManager.Instance();
- instance.render(containerid);
- });
- }
- render(containerid) {
- var instance = this;
- let html = `<div class="invite-section-container" id="invitesection_div">
- <div class="" id="UserLockStatusDiv" >
- <div class="card invite-card">
- <div class="card-header border-1">
- <span class="biz-highlight-bg-color">Lock & UnLock</span>
- </div>
- <div class="card-body bg-white px-20 py-5">
- <div class="row my-sm-2">
- <div class="col-6 my-2 ">
- <button
- class="btn btn-outline-red rounded-4 font-14 p-3 text-left" onclick='' id="btnChangeLockStatus"><i
- class="fa fa-lock mr-5 font-18"></i>
- Lock User</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="col-12 p-0" id="UserUnLockStatusDiv">
- <div class="card">
- <div class="card-header border-1">
- <span class="biz-highlight-bg-color">Lock & UnLock</span>
- </div>
- <div class="card-body px-20 py-5" >
- <div class="row my-sm-2">
- <div class="col-6 my-2 ">
- <button
- class="btn btn-outline-green rounded-4 font-14 p-3 text-left font-weight-500" id="btnChangeUnLockStatus"><i
- class="fa fa-unlock-alt font-18 mr-5"></i>
- UnLock</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- `;
- $("." + containerid).append(html);
- instance.loadDetails();
- }
- loadDetails() {
- $("#UserUnLockStatusDiv").hide();
- let instance = this;
- $("#btnChangeLockStatus").click(function () {
- var status = "Lock";
- let tenantid = Unibase.Platform.Membership.Infos.Identity.currentUser.tenantId;
- bootbox.confirm("User gets " + status + " Are you sure?", function (result) {
- if (result) {
- Unibase.Platform.Membership.Managers.AccountManager.Instance().ChangeUsersLockStatus(status, tenantid).then(function (response) {
- MessageHelper.Instance().showSuccess(response.message, '');
- $("#UserLockStatusDiv").hide();
- $("#UserUnLockStatusDiv").show();
- });
- }
- });
- });
- $("#btnChangeUnLockStatus").click(function () {
- var status = "UnLock";
- let tenantid = Unibase.Platform.Membership.Infos.Identity.currentUser.tenantId;
- bootbox.confirm("User gets " + status + " Are you sure?", function (result) {
- if (result) {
- Unibase.Platform.Membership.Managers.AccountManager.Instance().ChangeUsersLockStatus(status, tenantid).then(function (response) {
- MessageHelper.Instance().showSuccess(response.message, '');
- $("#UserUnLockStatusDiv").hide();
- $("#UserLockStatusDiv").show();
- });
- }
- });
- });
- instance.LockDetails();
- }
- LockDetails() {
- let instance = this;
- let status = "";
- let tenantid = Unibase.Platform.Membership.Infos.Identity.currentUser.tenantId;
- Unibase.Platform.Membership.Managers.AccountManager.Instance().ValidateUsersLockStatus(tenantid).then(function (response) {
- if (response != undefined && response.toString() == "Lock") {
- instance.lockstatus = 'Lock';
- $("#UserLockStatusDiv").hide();
- $("#UserUnLockStatusDiv").show();
- }
- else if (response != undefined && response.toString() == "UnLock") {
- instance.lockstatus = 'Un-Lock';
- $("#UserUnLockStatusDiv").hide();
- $("#UserLockStatusDiv").show();
- }
- });
- }
- static Instance() {
- if (this.instance === undefined) {
- this.instance = new UserLockUnLockStatus();
- }
- return this.instance;
- }
- }
- Components.UserLockUnLockStatus = UserLockUnLockStatus;
- })(Components = InviteUsers.Components || (InviteUsers.Components = {}));
- })(InviteUsers = Platform.InviteUsers || (Platform.InviteUsers = {}));
- })(Platform = Unibase.Platform || (Unibase.Platform = {}));
- })(Unibase || (Unibase = {}));
|