Change new login/logout/userInfo properties in development. Search stakeholders: make request only in first load

This commit is contained in:
Konstantinos Triantafyllou 2021-11-05 13:31:07 +02:00
parent 7a6221e568
commit 0da51e2356
3 changed files with 29 additions and 24 deletions

@ -1 +1 @@
Subproject commit 104c54a3e861d65817aac59c56640457664eeaab
Subproject commit 0aa44646b1c57974569aadcaa4ba67a8a5028ef4

View File

@ -21,7 +21,7 @@ import {Subscriber} from "rxjs";
<new-search-page pageTitle="OpenAIRE-Monitor | Browse"
[hasPrefix]=false [piwikSiteId]="piwikSiteId"
[formPlaceholderText]="'Search profiles'"
type="organizations" entityType="stakeholder"
[type]="(results.length > 1)?'organizations':'organization'" entityType="stakeholder"
[results]="results" [searchUtils]="searchUtils"
[showResultCount]=true
[disableForms]="disableForms"
@ -37,7 +37,7 @@ export class SearchStakeholdersComponent {
private errorCodes: ErrorCodes;
private errorMessages: ErrorMessagesComponent;
public results: StakeholderInfo[] = [];
public totalResults: StakeholderInfo[] = [];
public totalResults: StakeholderInfo[];
public subscriptions = [];
public filters = [];
public searchFields: SearchFields = new SearchFields();
@ -117,24 +117,29 @@ export class SearchStakeholdersComponent {
* @param params
*/
private initFunders(params) {
this.subscriptions.push(this._stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL).subscribe(
data => {
if (!data) {
return;
if(this.totalResults) {
this._getResults(params);
} else {
this.subscriptions.push(this._stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL).subscribe(
data => {
if (!data) {
return;
}
this.totalResults = [];
for (let i = 0; i < data.length; i++) {
this.totalResults[i] = data[i];
this.totalResults[i].isManager = this.isManager(data[i]);
this.totalResults[i].isMember = this.isMember(data[i]);
}
this._getResults(params);
},
err => {
this.handleError('Error getting stakeholders', err);
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
this.disableForms = false;
}
for (let i = 0; i < data.length; i++) {
this.totalResults[i] = data[i];
this.totalResults[i].isManager = this.isManager(data[i]);
this.totalResults[i].isMember = this.isMember(data[i]);
}
this._getResults(params);
},
err => {
this.handleError('Error getting stakeholders', err);
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
this.disableForms = false;
}
));
));
}
}
@ -457,7 +462,7 @@ export class SearchStakeholdersComponent {
originalFilterId: this.refineFields[i],
values: values,
countSelectedValues: 0,
"filterOperator": 'or',
filterOperator: 'or',
valueIsExact: true,
filterType: "checkbox"
};

View File

@ -40,9 +40,9 @@ export let properties: EnvProperties = {
piwikBaseUrl: "https://analytics.openaire.eu/piwik.php?idsite=",
piwikSiteId: "298",
registryUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/registry/',
loginUrl: "http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/openid_connect_login",
userInfoUrl: "http://dl170.madgik.di.uoa.gr:8180/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=",
logoutUrl: "http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/openid_logout",
loginUrl: "http://mpagasas.di.uoa.gr:8080/login-service//openid_connect_login",
userInfoUrl: "http://mpagasas.di.uoa.gr:8080/login-service/userInfo",
logoutUrl: "http://mpagasas.di.uoa.gr:8080/login-service/openid_logout",
cookieDomain: ".di.uoa.gr",
feedbackmail: "openaire.test@gmail.com",
cacheUrl: "http://scoobydoo.di.uoa.gr:3000/get?url=",