Compare commits

...

9 Commits

13 changed files with 139 additions and 14 deletions

View File

@ -1,6 +1,6 @@
{
"name": "monitor",
"version": "1.0.2",
"version": "1.0.4",
"scripts": {
"ng": "ng",
"start": " ng serve --port 4500 --disable-host-check --host 0.0.0.0",

View File

@ -9,6 +9,10 @@ const routes: Routes = [
path: 'about',
loadChildren: () => import('./about/about.module').then(m => m.AboutModule)
},
{
path: 'subscriptions',
loadChildren: () => import('./subscriptions/subscriptions.module').then(m => m.SubscriptionsModule)
},
{
path: 'support',
loadChildren: () => import('./support/support.module').then(m => m.SupportModule),

View File

@ -23,12 +23,16 @@ import {StakeholderEntities} from './openaireLibrary/monitor/entities/stakeholde
import {ResourcesService} from "./openaireLibrary/monitor/services/resources.service";
import {LayoutService} from "./openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
import {HelperService} from "./openaireLibrary/utils/helper/helper.service";
@Component({
selector: 'app-root',
template: `
<div>
<div id="modal-container"></div>
<div *ngIf="divContents && divContents['banner']" class="uk-tile uk-tile-default uk-padding uk-border-bottom">
<helper [texts]="divContents['banner']"></helper>
</div>
<navbar *ngIf="properties && showMenu && header" #navbar portal="monitor" [header]="header" [onlyTop]="false"
[userMenuItems]=userMenuItems [menuItems]=menuItems [user]="user"
[showMenu]=showMenu [properties]="properties">
@ -100,9 +104,9 @@ export class AppComponent {
@ViewChild('bottom', {read: ElementRef}) bottom: ElementRef;
private subscriptions: any[] = [];
public stakeholderEntities = StakeholderEntities;
divContents: any;
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
private configurationService: ConfigurationService,
constructor(private configurationService: ConfigurationService,
private router: Router, private stakeholderService: StakeholderService, private smoothScroll: SmoothScroll,
private userManagementService: UserManagementService,
private quickContactService: QuickContactService,
@ -110,17 +114,18 @@ export class AppComponent {
private fb: UntypedFormBuilder,
private emailService: EmailService,
private resourcesService: ResourcesService,
private helper: HelperService,
private cdr: ChangeDetectorRef) {
this.subscriptions.push(router.events.forEach((event) => {
this.subscriptions.push(this.router.events.forEach((event) => {
if (event instanceof NavigationEnd) {
this.showGetStarted = event.url !== '/get-started';
}
}));
}
ngOnInit() {
this.configurationService.initPortal(this.properties, "monitor");
this.getDivContents();
this.userManagementService.fixRedirectURL = properties.afterLoginRedirectLink;
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
this.user = user;
@ -185,6 +190,12 @@ export class AppComponent {
this.smoothScroll.clearSubscriptions();
}
private getDivContents() {
this.subscriptions.push(this.helper.getDivHelpContents(this.properties, 'monitor', '/').subscribe(contents => {
this.divContents = contents;
}));
}
public buildMenu() {
this.menuItems = [];
this.menuItems.push(
@ -202,6 +213,9 @@ export class AppComponent {
new MenuItem("", "Blog", "https://blogs.openaire.eu/", "", false, [], [], {}),
new MenuItem("", "Contact us", "https://beta.openaire.eu/contact-us", "", false, [], [], {})
];
this.menuItems.push(
new MenuItem("subscriptions", "Subscriptions", "", "/subscriptions", false, [], null, {}, null, null)
);
this.menuItems.push(
new MenuItem("contact-us", "Contact us", "", "/contact-us", false, [], null, {}, null, null, "uk-hidden@m")
);

View File

@ -20,6 +20,7 @@ import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.servi
import {SharedModule} from "./openaireLibrary/shared/shared.module";
import {AlertModalModule} from "./openaireLibrary/utils/modal/alertModal.module";
import {isDevelopmentGuard} from './openaireLibrary/error/isDevelopmentGuard.guard';
import {HelperModule} from "./openaireLibrary/utils/helper/helper.module";
@NgModule({
@ -37,7 +38,8 @@ import {isDevelopmentGuard} from './openaireLibrary/error/isDevelopmentGuard.gua
BrowserModule,
AppRoutingModule,
Schema2jsonldModule,
AlertModalModule
AlertModalModule,
HelperModule
],
declarations: [AppComponent, OpenaireErrorPageComponent],
exports: [AppComponent],

View File

@ -249,7 +249,7 @@ export class HomeComponent implements OnInit, OnDestroy, AfterViewInit, IDeactiv
public getStakeholders() {
this.loading = true;
this.status = this.errorCodes.LOADING;
this.subscriptions.push(this._stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL).subscribe(
this.subscriptions.push(this._stakeholderService.getStakeholders().subscribe(
stakeholders => {
if (!stakeholders || stakeholders.length == 0) {
this.status = this.errorCodes.NONE;

View File

@ -101,7 +101,7 @@ export class MyStakeholdersComponent {
this.status = this.errorCodes.LOADING;
this.subscriberErrorMessage = "";
this.stakeholders = [];
this.subscriptions.push(this.stakeholderService.getMyStakeholders(properties.monitorServiceAPIURL).subscribe(
this.subscriptions.push(this.stakeholderService.getMyStakeholders().subscribe(
stakeholders => {
this.stakeholders = StakeholderInfo.toStakeholderInfo(stakeholders.standalone.concat(stakeholders.umbrella), this.user);
this.sort(this.stakeholders);

@ -1 +1 @@
Subproject commit 4396999ce03bb96543f258f64e64459546b86e19
Subproject commit 59cb69736c4efdbdffa790e8da7a0c31171737a6

View File

@ -136,7 +136,7 @@ export class SearchStakeholdersComponent {
this.totalResults = StakeholderInfo.toStakeholderInfo(this.totalResults, this.user);
this._getResults(params);
} else {
this.subscriptions.push(this._stakeholderService.getStakeholders(this.properties.monitorServiceAPIURL).subscribe(
this.subscriptions.push(this._stakeholderService.getStakeholders().subscribe(
data => {
this.totalResults = StakeholderInfo.toStakeholderInfo(data, this.user);
this._getResults(params);

View File

@ -0,0 +1,82 @@
import {Component} from "@angular/core";
import {Router} from '@angular/router';
import {Meta, Title} from '@angular/platform-browser';
import {PiwikService} from '../openaireLibrary/utils/piwik/piwik.service';
import {SEOService} from "../openaireLibrary/sharedComponents/SEO/SEO.service";
import {Subscriber} from "rxjs";
import {Breadcrumb} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.component";
import {EnvProperties} from "../openaireLibrary/utils/properties/env-properties";
import {properties} from "../../environments/environment";
import {BaseComponent} from "../openaireLibrary/sharedComponents/base/base.component";
import {HelperService} from "../openaireLibrary/utils/helper/helper.service";
@Component({
selector: 'subscriptions',
template: `
<div>
<div class="uk-position-relative">
<div class="uk-background-muted">
<div class="uk-container uk-container-large uk-section uk-section-small">
<div class="uk-padding-small uk-padding-remove-horizontal">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div>
<div class="uk-flex uk-flex-column uk-flex-center uk-margin-bottom"
uk-scrollspy="target: [uk-scrollspy-class]; cls: uk-animation-fade; delay: 250">
<h1 class="uk-margin-medium-top" uk-scrollspy-class>Subscriptions<span
class="uk-text-primary">.</span></h1>
<div uk-scrollspy-class>
As demand for our services grows, along with the features included in each of them,
traditional sources of funding may not be sufficient. By introducing subscription fees, we
can ensure their long-term sustainability; by achieving financial stability we can
continue to invest in better resources, technology, and talent, thereby increasing our
capacity to deliver impactful programs and services to all interested parties.
Subscriptions support immediate operational needs, while at the same time enabling us to
scale our efforts and make a greater, more sustainable difference in the communities we
serve.
</div>
</div>
</div>
</div>
</div>
<helper *ngIf="divContents" [texts]="divContents.plans"></helper>
</div>
`
})
export class SubscriptionsComponent extends BaseComponent {
public divContents = null;
public title: string = "OpenAIRE - Monitor | Subscriptions";
public description: string = "OpenAIRE - Monitor | Subscriptions";
public breadcrumbs: Breadcrumb[] = [{name: 'home', route: '/'}, {name: 'Subscriptions'}];
public properties: EnvProperties = properties;
subscriptions = [];
constructor(
protected _router: Router,
protected _meta: Meta,
protected _title: Title,
protected seoService: SEOService,
protected _piwikService: PiwikService,
private helper: HelperService) {
super();
}
ngOnInit() {
this.setMetadata();
this.getDivContents();
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscriber) {
subscription.unsubscribe();
}
});
}
private getDivContents() {
this.subscriptions.push(this.helper.getDivHelpContents(this.properties, 'monitor', this._router.url).subscribe(contents => {
this.divContents = contents;
}));
}
}

View File

@ -0,0 +1,23 @@
import {CommonModule} from "@angular/common";
import {NgModule} from "@angular/core";
import {RouterModule} from "@angular/router";
import {PreviousRouteRecorder} from "../openaireLibrary/utils/piwik/previousRouteRecorder.guard";
import {SubscriptionsComponent} from "./subscriptions.component";
import {BreadcrumbsModule} from "../openaireLibrary/utils/breadcrumbs/breadcrumbs.module";
import {PiwikService} from "../openaireLibrary/utils/piwik/piwik.service";
import {SliderTabsModule} from "../openaireLibrary/sharedComponents/tabs/slider-tabs.module";
import {HelperModule} from "../openaireLibrary/utils/helper/helper.module";
import {IconsModule} from "../openaireLibrary/utils/icons/icons.module";
@NgModule({
declarations: [SubscriptionsComponent],
imports: [CommonModule, RouterModule.forChild([
{
path: '',
component: SubscriptionsComponent
}
]), BreadcrumbsModule, SliderTabsModule, HelperModule, IconsModule],
exports: [SubscriptionsComponent],
providers: [PreviousRouteRecorder, PiwikService]
})
export class SubscriptionsModule {}

@ -1 +1 @@
Subproject commit 5026b8b38fcae493ec7bcdc272bf167798c18fa3
Subproject commit a4d8923b82a59ac1cc41e9c0574f1d64a61c0c1b

@ -1 +1 @@
Subproject commit 6524ee362c8fc8fa6e482144920e305198e54fc8
Subproject commit 55765bf0829910661a55337e0e7ca7b1262b7298

View File

@ -6,7 +6,7 @@ let props: EnvProperties = {
enablePiwikTrack: false,
useCache: false,
showContent: true,
adminToolsAPIURL: "http://duffy.di.uoa.gr:19380/uoa-monitor-service/",
adminToolsAPIURL: "http://mpagasas.di.uoa.gr:19380/uoa-monitor-service/",
adminToolsPortalType: "monitor",
adminToolsCommunity: "monitor",
domain : "http://mpagasas.di.uoa.gr:4000",