Commit 213bd9c0 authored by sourabh_roy's avatar sourabh_roy
Browse files

fixed issue number #145,#146,#120,#127,#128,#134

parent 73fc5d1f
Pipeline #36323 passed with stages
in 8 minutes and 29 seconds
......@@ -52,6 +52,7 @@ export class AddMemberComponent implements OnInit {
this.errorMessge='Please fill all the fields'
}
else{
this.spinner.show();
let timer = this.auth.refreshTokenTimer(this.auth.getIdToken());
if(timer<=0){
this.auth.subscribeRefreshToken();
......@@ -62,12 +63,12 @@ export class AddMemberComponent implements OnInit {
"role": this.selectedRole
}
this.restService.addMemberGroup(data,this.selectedGroupType).subscribe((result) => {
this.spinner.hide();
if(typeof(result) != 'string'){
this.isSuccess=true;
this.isError=false;
this.successMessge='Member ' +this.selectedmemberEmail + ' has beed added successfully.';
//this.passEntryAdd.emit({ data: passData });
this.passEntryAdd.emit({ data: passData });
this.selectedRole='0';
this.selectedmemberEmail='';
var resetForm = <HTMLFormElement>document.getElementById('myForm');
......
......@@ -53,7 +53,7 @@
<span class="info">Enter Resource Name/ Service Name here</span>
</p>
</div>
<input type="text" value="" id="resourceName" (focusout)="selParam('Resource',$event.target.value)" [(ngModel)]="selectedresourceName" name="selectedresourceName" placeholder="Resource Name or Service Name"/>
<input type="text" value="" id="resourceName" (input)="selParam('Resource',$event.target.value)" [(ngModel)]="selectedresourceName" name="selectedresourceName" placeholder="Resource Name or Service Name"/>
</div>
</div>
......
......@@ -72,6 +72,7 @@ export class CreatGroupComponent implements OnInit {
if(timer<=0){
this.auth.subscribeRefreshToken();
}
this.spinner.show();
this.restService.createEntitlementGroup(data).subscribe((result) => {
this.spinner.hide();
......@@ -82,10 +83,12 @@ export class CreatGroupComponent implements OnInit {
this.successMessge="You have successfully created "+this.selectedgroupName+ " group!"
this.passEntryAdd.emit({ data:data });
resetForm.reset();
this.selectedPermissionLevel='';
this.selectedGroupType='';
this.selectedgroupName='';
this.myFormreset();
// resetForm.reset();
// this.selectedPermissionLevel='0';
// this.selectedGroupType='0';
// this.selectedgroupName='';
}, (err) => {
this.spinner.hide();
this.isError=true;
......@@ -102,6 +105,7 @@ export class CreatGroupComponent implements OnInit {
if(type=='Group'){
// this.selectedgroupName=val;
this.permissionLevel=this.groupListNew.filter(x=>x.group==val)[0].value;
this.selectedPermissionLevel="0";
}
if(type=='Permission'){
// this.selectedgroupName=this.selectedGroupType+'.'+val;
......@@ -112,7 +116,13 @@ export class CreatGroupComponent implements OnInit {
// }
if(this.selectedresourceName==""){
if(this.selectedPermissionLevel=="0"){
this.selectedgroupName=this.selectedGroupType;
if(this.selectedGroupType=="0"){
this.selectedgroupName=this.selectedresourceName
}
else{
this.selectedgroupName=this.selectedGroupType;
}
}
else{
this.selectedgroupName=this.selectedGroupType + '.' + this.selectedPermissionLevel;
......@@ -120,7 +130,13 @@ export class CreatGroupComponent implements OnInit {
}
else{
if(this.selectedPermissionLevel=="0"){
this.selectedgroupName=this.selectedGroupType +'.'+this.selectedresourceName;
if(this.selectedGroupType=="0"){
this.selectedgroupName=this.selectedresourceName;
}
else{
this.selectedgroupName=this.selectedGroupType +'.'+this.selectedresourceName;
}
}
else{
this.selectedgroupName=this.selectedGroupType + '.' + this.selectedresourceName + '.' + this.selectedPermissionLevel;
......@@ -133,6 +149,11 @@ export class CreatGroupComponent implements OnInit {
myFormreset(){
var resetForm = <HTMLFormElement>document.getElementById('myForm');
resetForm.reset();
this.permissionLevel=[];
this.selectedgroupName="";
this.selectedGroupType="0";
this.selectedPermissionLevel="0";
this.selectedresourceName="";
}
}
......@@ -78,12 +78,14 @@ export class ManageGroupsComponent implements OnInit {
getEntitlements(){
this.spinner.show();
this.restService.getEntitlementGroups().subscribe((result) => {
console.log(result)
// console.log(result)
this.error_Message_Div='';
this.UserList=result.groups;
this.fullUserList=result.groups;
this.cmnSrvc.EandOgroupEmailList=result.groups.map(x=>x.email);
this.headers=Object.keys(result.groups[0])
this.headers=Object.keys(result.groups[0]);
this.istoggle=false;
this.sort('email');
this.spinner.hide();
}, (err) => {
......@@ -119,9 +121,10 @@ export class ManageGroupsComponent implements OnInit {
const modalRef = this.modalService.open(CreatGroupComponent);
let that=this;
modalRef.componentInstance.passEntryAdd.subscribe((result) => {
that.UserList.push({"name":result.data.name,"description":result.data.description,"email":result.data.name})
// that.cmnSrvc.EandOgroupEmailList.push(result.data.name+result.data.domain);
// alert("hi")
this.getEntitlements();
// that.UserList.push({"name":result.data.name,"description":result.data.description,"email":result.data.name})
})
}
......
......@@ -136,14 +136,15 @@ export class ManageUsersComponent implements OnInit {
openModalCreate(){
const modalRef = this.modalService.open(AddMemberComponent);
modalRef.componentInstance.groupName=this.selectedGroupType;
// let that=this;
// modalRef.componentInstance.passEntryAdd.subscribe((result) => {
// if(that.headers.length>0){
// if(that.selectedGroupType==result.data.group){
// that.memberList.push({"email":result.data.email,"role":result.data.role})
// }
// }
// })
let that=this;
modalRef.componentInstance.passEntryAdd.subscribe((result) => {
this.showDataGroup(result.data.group)
// if(that.headers.length>0){
// if(that.selectedGroupType==result.data.group){
// that.memberList.push({"email":result.data.email,"role":result.data.role})
// }
// }
})
}
searchFilter(search){
......
declare var swal:any;
import { Component, ElementRef, EventEmitter, OnInit, Output, ViewChild } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { NgxSpinnerService } from 'ngx-spinner';
......@@ -59,7 +60,90 @@ export class AddLegalTagComponent implements OnInit {
}
closePopup(){
this.activeModal.close();
let str="Unsaved data exists. Do you want to continue and cancel?";
let that=this;
let count=0;
for(let element in this){
if(element.startsWith('selected')){
if(this[element]!=null){
if(this[element].toString()=='' || this[element].toString()=='0' || this[element].toString()==null || this[element].toString()==undefined){
//count=0;
}
else{
count+=1;
}
}
}
}
if(count==0){
that.activeModal.close();
}
else{
swal({
title: str,
showCancelButton: true,
type: 'warning',
confirmButtonClass: "btn-danger",
confirmButtonText: "Yes",
cancelButtonText: "No",
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
that.activeModal.close();
}
})
}
}
legalTagProperties(){
this.spinner.show();
this.restService.getLegalTagProperties().subscribe((result) => {
this.spinner.hide();
let tempList = [];
let index = 0;
tempList = Object.entries(result["countriesOfOrigin"]);
let countrylists=[];
tempList.forEach(element => {
countrylists.push({ "item_id": element[0], "item_text": element[0]+',('+element[1]+')' })
});
countrylists.sort((a, b) => (a["item_id"].toLowerCase() < b["item_id"].toLowerCase() ? -1 : 1));
this.countryList=countrylists;
// this.countryList.sort();
this.dropdownSettings = {
singleSelection: false,
idField: 'item_id',
textField: 'item_text',
selectAllText: 'Select All',
unSelectAllText: 'UnSelect All',
closeDropDownOnSelection:true,
itemsShowLimit: 2,
allowSearchFilter: true
};
this.dataTypeList = result["dataTypes"];
this.personalDataTypeList = result["personalDataTypes"]
this.securityClassificationList = result["securityClassifications"];
this.exportClassificationList = result["exportClassificationControlNumbers"];
}, (err) => {
this.spinner.hide();
console.log(err);
});
}
requestSubmit() {
......@@ -173,42 +257,6 @@ export class AddLegalTagComponent implements OnInit {
// this.activeModal.close();
}
legalTagProperties(){
this.restService.getLegalTagProperties().subscribe((result) => {
this.spinner.hide();
let tempList = [];
let index = 0;
tempList = Object.entries(result["countriesOfOrigin"]);
let countrylists=[];
tempList.forEach(element => {
countrylists.push({ "item_id": element[0], "item_text": element[0]+',('+element[1]+')' })
});
this.countryList=countrylists;
this.dropdownSettings = {
singleSelection: false,
idField: 'item_id',
textField: 'item_text',
selectAllText: 'Select All',
unSelectAllText: 'UnSelect All',
closeDropDownOnSelection:true,
itemsShowLimit: 2,
allowSearchFilter: true
};
this.dataTypeList = result["dataTypes"];
this.personalDataTypeList = result["personalDataTypes"]
this.securityClassificationList = result["securityClassifications"];
this.exportClassificationList = result["exportClassificationControlNumbers"];
}, (err) => {
this.spinner.hide();
console.log(err);
});
}
validateLegalName(val){
this.isNameSpin = true;
......
......@@ -114,6 +114,7 @@ export class LegalTagsComponent implements OnInit {
searchLegalTag(){
if (this.selectedLegalTagNames.length == 0) {
this.LegalTagList = this.legalTagsFullDetails;
this.LegalTagListFull = this.legalTagsFullDetails;
let hProp=[];
hProp = Object.keys(this.LegalTagList[0].properties)
let cval = 2;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment