[Monitor | Trunk]: Hide private stakeholders
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-monitor-portal/trunk/monitor@60097 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
48d529488c
commit
e9ce82d27f
|
@ -244,11 +244,11 @@ export class HomeComponent {
|
||||||
this.subscriberErrorMessage = "";
|
this.subscriberErrorMessage = "";
|
||||||
this.subscriptions.push(this._stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL).subscribe(
|
this.subscriptions.push(this._stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL).subscribe(
|
||||||
stakeholders => {
|
stakeholders => {
|
||||||
|
stakeholders = stakeholders.filter(stakeholder => stakeholder.visibility !== 'PRIVATE');
|
||||||
if (!stakeholders || stakeholders.length == 0) {
|
if (!stakeholders || stakeholders.length == 0) {
|
||||||
this.status = this.errorCodes.NONE;
|
this.status = this.errorCodes.NONE;
|
||||||
} else {
|
} else {
|
||||||
this.stakeholders = stakeholders;
|
this.stakeholders = stakeholders;
|
||||||
console.debug(stakeholders);
|
|
||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
},
|
},
|
||||||
|
|
|
@ -128,6 +128,7 @@ export class SearchStakeholdersComponent {
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
data = data.filter(stakeholder => stakeholder.visibility !== 'PRIVATE');
|
||||||
for (let i = 0; i < data.length; i++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
this.totalResults[i] = data[i];
|
this.totalResults[i] = data[i];
|
||||||
this.totalResults[i].isManager = this.isStakeholderManager(data[i]);
|
this.totalResults[i].isManager = this.isStakeholderManager(data[i]);
|
||||||
|
@ -168,8 +169,7 @@ export class SearchStakeholdersComponent {
|
||||||
let ret = [];
|
let ret = [];
|
||||||
for (let result of this.results) {
|
for (let result of this.results) {
|
||||||
if(result.visibility === 'PUBLIC' ||
|
if(result.visibility === 'PUBLIC' ||
|
||||||
(result.visibility === 'RESTRICTED' && this.isStakeholderMember(result)) ||
|
(result.visibility === 'RESTRICTED' && this.isStakeholderMember(result))
|
||||||
(result.visibility === 'PRIVATE' && this.isStakeholderManager(result))
|
|
||||||
) {
|
) {
|
||||||
ret.push(result);
|
ret.push(result);
|
||||||
}
|
}
|
||||||
|
@ -308,12 +308,12 @@ export class SearchStakeholdersComponent {
|
||||||
results.push(this.results[i]);
|
results.push(this.results[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (value.replace(/["']/g, "") == 'private') {
|
} /*else if (value.replace(/["']/g, "") == 'private') {
|
||||||
if (this.results[i].visibility === 'PRIVATE') {
|
if (this.results[i].visibility === 'PRIVATE') {
|
||||||
results.push(this.results[i]);
|
results.push(this.results[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -459,8 +459,8 @@ export class SearchStakeholdersComponent {
|
||||||
if (this.user) {
|
if (this.user) {
|
||||||
filter_names.push("Accessibility");
|
filter_names.push("Accessibility");
|
||||||
filter_ids.push("access");
|
filter_ids.push("access");
|
||||||
value_names.push(["Public", "Restricted", "Private"]);
|
value_names.push(["Public", "Restricted"]);
|
||||||
value_original_ids.push(["public", "restricted", "private"]);
|
value_original_ids.push(["public", "restricted"]);
|
||||||
filter_names.push("Role");
|
filter_names.push("Role");
|
||||||
filter_ids.push("role");
|
filter_ids.push("role");
|
||||||
value_names.push(["Manager", "Member"]);
|
value_names.push(["Manager", "Member"]);
|
||||||
|
|
Loading…
Reference in New Issue