[Trunk | Connect]: Merging branch 'use-UoaAdminToolsLibrary' into trunk for revisions 58407:59466

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@59467 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-09-24 11:43:34 +00:00
parent ccbb19b173
commit 90392fc79a
8 changed files with 108 additions and 97 deletions

View File

@ -5,7 +5,7 @@
[ngClass]="(!fullView)?'uk-card-body':'uk-card-media-top uk-padding-small'">
<div class="uk-align-center">
<img *ngIf="organization.logo_url != null && organization.logo_url != '' "
src="{{organization.logo_url}}" alt="{{(organization.name)?organization.name:''}} logo">
src="{{urlPrefix(organization.logo_url) + organization.logo_url}}" alt="{{(organization.name)?organization.name:''}} logo">
<span *ngIf="organization.logo_url == null || organization.logo_url == ''" class="uk-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" icon="image" ratio="2.5"><circle cx="16.1" cy="6.1"
r="1.1"></circle><rect

View File

@ -11,6 +11,7 @@ import {SubscribeService} from './openaireLibrary/utils/subscribe/subscribe.serv
import {HelperFunctions} from "./openaireLibrary/utils/HelperFunctions.class";
import {UserManagementService} from "./openaireLibrary/services/user-management.service";
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
import {properties} from '../environments/environment';
@Component({
//changeDetection: ChangeDetectionStrategy.Default,
@ -47,7 +48,7 @@ import {ConfigurationService} from "./openaireLibrary/utils/configuration/config
</main>
</div>
<div id="subscribeAndInviteBtn" *ngIf="isClient && properties && community">
<subscribe [communityId]="communityId" [properties]="properties"></subscribe>
<subscribe [communityId]="community.id" [properties]="properties"></subscribe>
<invite *ngIf="managerOfCommunities" [longView]=false [buttonSizeSmall]=false [properties]="properties"></invite>
</div>
<!--feedback *ngIf= "isClient && properties" portalName="Connect" [feedbackQuestionaire]=properties.feedbackQuestionaire></feedback-->
@ -102,9 +103,10 @@ export class AppComponent {
}
ngOnInit() {
this.propertiesService.loadEnvironment()
.then(es => {
this.properties = this.propertiesService.envSpecific;
// this.propertiesService.loadEnvironment()
// .then(es => {
// this.properties = this.propertiesService.envSpecific;
this.properties = properties;
this._communitiesService.updateCommunities(this.properties, this.properties.communitiesAPI);
if (typeof document !== 'undefined') {
try {
@ -117,11 +119,11 @@ export class AppComponent {
this.init();
},
error => this.init());
}, error => {
console.log("App couldn't fetch properties");
console.log(error);
});
// }, error => {
// console.log("App couldn't fetch properties");
// console.log(error);
//
// });
}
private init() {
@ -130,12 +132,18 @@ export class AppComponent {
this.showMenu = false;
this.route.queryParams.subscribe(params => {
communityId = (params['communityId']) ? params['communityId'] : ConnectHelper.getCommunityFromDomain(this.properties.domain);
if(communityId) {
this.properties.adminToolsPortalType = "community";
}
this.configurationService.initCommunityInformation(this.properties, communityId);
this.buildMenu(communityId);
})
} else {
this.showMenu = false;
communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
if(communityId) {
this.properties.adminToolsPortalType = "community";
}
this.configurationService.initCommunityInformation(this.properties, communityId);
this.buildMenu(communityId);
}

View File

@ -64,11 +64,11 @@
</div>
<div *ngFor="let affiliation of curator.affiliations">
<span *ngIf="!affiliation.website_url">
<img [src]="affiliation.logo_url" [alt]="affiliation.name">
<img [src]="urlPrefix(affiliation.logo_url) + affiliation.logo_url" [alt]="affiliation.name">
</span>
<a *ngIf="affiliation.website_url"
target="_blank" [href]="urlPrefix(affiliation.website_url) + affiliation.website_url">
<img [src]="affiliation.logo_url" [alt]="affiliation.name">
<img [src]="urlPrefix(affiliation.logo_url) + affiliation.logo_url" [alt]="affiliation.name">
</a>
</div>
</div>

View File

@ -75,7 +75,7 @@ export class CuratorsComponent {
this.updateDescription("OpenAIRE - Connect, Community Gateway, research community");
}
this.downloadUrl = this.properties.utilsService + '/download/';
if (properties.environment !== 'development') {
//if (properties.environment !== 'development') {
if (!this.longView) {
let emails = this.managers.join();
this.subs.push(this.curatorsService.getCurators(this.properties, emails).subscribe(curators => {
@ -109,29 +109,29 @@ export class CuratorsComponent {
}));
}));
}
} else {
this.subs.push(this.route.queryParams.subscribe(data => {
this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
if (!this.communityId) {
this.communityId = data['communityId'];
}
if(this.longView) {
//this.getDivContents();
this.getPageContents();
}
this.subs.push(this.userRegistryService.getManagersEmail('community', this.communityId).subscribe(managers => {
let emails = managers.map(manager => manager.email).join();
this.subs.push(this.curatorsService.getCurators(this.properties, emails).subscribe(curators => {
this.curators = curators;
for (let i = 0; i < this.curators.length; i++) {
this.showMore[i] = false;
}
this.showLoading = false;
HelperFunctions.scroll();
}));
}));
}));
}
// } else {
// this.subs.push(this.route.queryParams.subscribe(data => {
// this.communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
// if (!this.communityId) {
// this.communityId = data['communityId'];
// }
// if(this.longView) {
// //this.getDivContents();
// this.getPageContents();
// }
// this.subs.push(this.userRegistryService.getManagersEmail('community', this.communityId).subscribe(managers => {
// let emails = managers.map(manager => manager.email).join();
// this.subs.push(this.curatorsService.getCurators(this.properties, emails).subscribe(curators => {
// this.curators = curators;
// for (let i = 0; i < this.curators.length; i++) {
// this.showMore[i] = false;
// }
// this.showLoading = false;
// HelperFunctions.scroll();
// }));
// }));
// }));
// }
}
ngOnDestroy() {

View File

@ -116,8 +116,8 @@ export class SubscribeComponent {
}
private isSubscribed() {
this.subscribed = Session.isSubscribedTo('community', this.communityId, this.user);
if (!this.subscribed) {
// this.subscribed = Session.isSubscribedTo('community', this.communityId, this.user);
// if (!this.subscribed) {
this.subs.push(this._subscribeService.isSubscribed.subscribe(
res => {
this.subscribed = res;
@ -128,13 +128,13 @@ export class SubscribeComponent {
}
}
));
} else {
if (this.subscribed) {
this.subscribeEvent.emit({
value: "ok"
});
}
}
// } else {
// if (this.subscribed) {
// this.subscribeEvent.emit({
// value: "ok"
// });
// }
// }
}
private init() {
@ -150,7 +150,7 @@ export class SubscribeComponent {
}
} else {
if (this.communityId) {
if (properties.environment !== 'development') {
//if (properties.environment !== 'development') {
this.subs.push(this._subscribeService.getNumberOfCommunitySubscribers(this.properties, this.communityId).subscribe(
res => {
this.subscribers = (res && res.value) ? res.value : 0;//(res && res.subscribers && res.subscribers.length) ? res.subscribers.length : 0;
@ -161,17 +161,17 @@ export class SubscribeComponent {
error => {
this.handleError("Error getting community subscribers for community with id: " + this.communityId, error);
}));
} else {
this.subs.push(this.userRegistryService.getSubscribersCount('community', this.communityId).subscribe(res => {
this.subscribers = (res && res.response) ? res.response : 0;
this.countSubscribersEvent.emit({
value: this.subscribers
});
},
error => {
this.handleError("Error getting community subscribers for community with id: " + this.communityId, error);
}));
}
// } else {
// this.subs.push(this.userRegistryService.getSubscribersCount('community', this.communityId).subscribe(res => {
// this.subscribers = (res && res.response) ? res.response : 0;
// this.countSubscribersEvent.emit({
// value: this.subscribers
// });
// },
// error => {
// this.handleError("Error getting community subscribers for community with id: " + this.communityId, error);
// }));
// }
}
}
if (this.communityId) {
@ -221,24 +221,24 @@ export class SubscribeComponent {
});
} else {
this.loading = true;
this.showLoginAlert = false;
if(properties.environment === 'development') {
this.subs.push(this.userRegistryService.subscribeTo('community', this.communityId).subscribe(res => {
this.userManagementService.updateUserInfo();
this.loading = false;
this.successfulSubscribe(email);
},error => {
this.loading = false;
UIkit.notification({
message: '<strong>An error occurred. Please try again!<strong>',
status: 'warning',
timeout: 3000,
pos: 'top-center'
});
//console.log(error)
this.handleError("Error subscribing email: " + email + " from community with id: " + this.communityId, error);
}));
}
// this.showLoginAlert = false;
// if(properties.environment === 'development') {
// this.subs.push(this.userRegistryService.subscribeTo('community', this.communityId).subscribe(res => {
// this.userManagementService.updateUserInfo();
// this.loading = false;
// this.successfulSubscribe(email);
// },error => {
// this.loading = false;
// UIkit.notification({
// message: '<strong>An error occurred. Please try again!<strong>',
// status: 'warning',
// timeout: 3000,
// pos: 'top-center'
// });
// //console.log(error)
// this.handleError("Error subscribing email: " + email + " from community with id: " + this.communityId, error);
// }));
// }
this.subs.push(this._subscribeService.subscribeToCommunity(this.properties, this.communityId).subscribe(
res => {
this.loading = false;
@ -279,23 +279,23 @@ export class SubscribeComponent {
this.subscribed = false;
} else {
this.loading = true;
if(properties.environment === 'development') {
this.subs.push(this.userRegistryService.unsubscribeFrom('community', this.communityId).subscribe(res => {
this.userManagementService.updateUserInfo();
this.loading = false;
this.subscribed = false;
},error => {
this.loading = false;
UIkit.notification({
message: '<strong>An error occurred. Please try again!<strong>',
status: 'warning',
timeout: 3000,
pos: 'top-center'
});
//console.log(error)
this.handleError("Error unsubscribing email: " + email + " from community with id: " + this.communityId, error);
}));
}
// if(properties.environment === 'development') {
// this.subs.push(this.userRegistryService.unsubscribeFrom('community', this.communityId).subscribe(res => {
// this.userManagementService.updateUserInfo();
// this.loading = false;
// this.subscribed = false;
// },error => {
// this.loading = false;
// UIkit.notification({
// message: '<strong>An error occurred. Please try again!<strong>',
// status: 'warning',
// timeout: 3000,
// pos: 'top-center'
// });
// //console.log(error)
// this.handleError("Error unsubscribing email: " + email + " from community with id: " + this.communityId, error);
// }));
// }
this.subs.push(this._subscribeService.unSubscribeToCommunity(this.properties, this.communityId).subscribe(
res => {
this.loading = false;

View File

@ -57,9 +57,10 @@
"cacheUrl" :"http://dl170.madgik.di.uoa.gr:3000/get?url=",
"adminToolsAPIURL" :"http://duffy.di.uoa.gr:8080/uoa-admin-tools/",
"adminToolsAPIURL" :"http://duffy.di.uoa.gr:8080/uoa-admin-tools-branch/",
"adminToolsCommunity" :"connect",
"adminToolsPortalType": "connect",
"datasourcesAPI": "https://beta.services.openaire.eu/openaire/ds/search/",
"contextsAPI":"https://dev-openaire.d4science.org/openaire/context",
"communityAPI": "https://dev-openaire.d4science.org/openaire/community/",

View File

@ -2,6 +2,7 @@ import {EnvProperties} from "../app/openaireLibrary/utils/properties/env-propert
export let properties: EnvProperties = {
environment: "production",
adminToolsPortalType: "connect",
dashboard: "connect",
enablePiwikTrack: true,
useCache: false,

View File

@ -7,6 +7,7 @@ import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-propert
export let properties: EnvProperties = {
environment: 'development',
adminToolsPortalType: "connect",
dashboard: 'connect',
enablePiwikTrack: false,
useCache: false,
@ -51,13 +52,13 @@ export let properties: EnvProperties = {
vocabulariesAPI: 'https://dev-openaire.d4science.org/provision/mvc/vocabularies/',
piwikBaseUrl: 'https://analytics.openaire.eu/piwik.php?idsite=',
piwikSiteId: '80',
loginUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/openid_connect_login',
userInfoUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=',
registryUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/registry/',
logoutUrl: 'https://openaire-dev.aai-dev.grnet.gr/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=',
loginUrl: "http://dl170.madgik.di.uoa.gr:8180/dnet-login/openid_connect_login",
userInfoUrl: "http://dl170.madgik.di.uoa.gr:8180/dnet-openaire-users-1.0.0-SNAPSHOT/api/users/getUserInfo?accessToken=",
logoutUrl: "https://aai.openaire.eu/proxy/saml2/idp/SingleLogoutService.php?ReturnTo=",
cookieDomain: '.di.uoa.gr',
feedbackmail: 'openaire.test@gmail.com',
cacheUrl: 'http://dl170.madgik.di.uoa.gr:3000/get?url=',
cacheUrl: 'http://duffy.di.uoa.gr:3000/get?url=',
adminToolsAPIURL: 'http://duffy.di.uoa.gr:8080/uoa-admin-tools/',
adminToolsCommunity: 'connect',
datasourcesAPI: 'https://beta.services.openaire.eu/openaire/ds/search/',