From 966d012c097b1f3daa69875bcb07c33679f90042 Mon Sep 17 00:00:00 2001 From: argirok Date: Thu, 9 May 2024 16:46:27 +0300 Subject: [PATCH 1/2] [develop | DONE ADDED] add direct linking for organizations and manage organization links --- .../admin-stakeholder-routing.module.ts | 9 ++++ src/app/app.component.ts | 3 ++ .../claimsAdmin/claimsAdmin-routing.module.ts | 18 ++++++++ .../claimsAdmin/claimsAdmin.component.ts | 46 +++++++++++++++++++ .../claims/claimsAdmin/claimsAdmin.module.ts | 25 ++++++++++ .../directLinking-routing.module.ts | 19 ++++++++ .../directLinking/directLinking.component.ts | 46 +++++++++++++++++++ .../directLinking/directLinking.module.ts | 21 +++++++++ src/app/claims/monitorClaims.properties.ts | 14 ++++++ src/app/users/users.component.html | 1 + src/environments/environment.beta.ts | 4 +- src/environments/environment.prod.ts | 4 +- src/environments/environment.ts | 3 +- src/styles.less | 1 + 14 files changed, 211 insertions(+), 3 deletions(-) create mode 100644 src/app/claims/claimsAdmin/claimsAdmin-routing.module.ts create mode 100644 src/app/claims/claimsAdmin/claimsAdmin.component.ts create mode 100644 src/app/claims/claimsAdmin/claimsAdmin.module.ts create mode 100644 src/app/claims/directLinking/directLinking-routing.module.ts create mode 100644 src/app/claims/directLinking/directLinking.component.ts create mode 100644 src/app/claims/directLinking/directLinking.module.ts create mode 100644 src/app/claims/monitorClaims.properties.ts diff --git a/src/app/admin-stakeholder/admin-stakeholder-routing.module.ts b/src/app/admin-stakeholder/admin-stakeholder-routing.module.ts index 656baa3..42cb714 100644 --- a/src/app/admin-stakeholder/admin-stakeholder-routing.module.ts +++ b/src/app/admin-stakeholder/admin-stakeholder-routing.module.ts @@ -9,6 +9,10 @@ import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class"; loadChildren: () => import('../openaireLibrary/monitor-admin/general/general.module').then(m => m.GeneralModule), pathMatch: 'full' }, + { + path: 'users/links', + loadChildren: () => import('../claims/claimsAdmin/claimsAdmin.module').then(m => m.LibClaimsAdminModule), pathMatch: 'full', data: {param: 'stakeholder', parentClass: 'monitor'} + }, { path: 'users', redirectTo: 'users/manager', @@ -29,6 +33,11 @@ import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class"; path: 'admin-tools', loadChildren: () => import('../admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule), data: {param: 'stakeholder', parentClass: 'monitor'} + }, + { + path: 'claims/link', + loadChildren: () => import('../claims/directLinking/directLinking.module').then(m => m.LibDirectLinkingModule), + data: {param: 'stakeholder', parentClass: 'monitor'} } ])] }) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 1ed0d96..af332c4 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -286,6 +286,9 @@ export class AppComponent extends SidebarBaseComponent implements OnInit { if (this.isCurator()) { this.adminMenuItems.push(new MenuItem("admin-tools", "Pages & Entities", "", "/admin/" + this.stakeholder.alias + "/admin-tools/pages", false, [], [], {}, {name: 'description'}, null, "uk-visible@m", "/admin/" + this.stakeholder.alias + "/admin-tools")); } + if(this.stakeholder.type == "organization") { + this.adminMenuItems.push(new MenuItem("claim", "Link results", "", "/admin/" + this.stakeholder.alias + "/claims/link", false, [], [], {}, {name: 'link'}, null, "uk-visible@m", "/admin/" + this.stakeholder.alias + "/claims/link")); + } } this.backItem = new MenuItem("back", "Manage profiles", "", "/admin", false, [], null, {}, {name: 'west'}); this.sideBarItems = items; diff --git a/src/app/claims/claimsAdmin/claimsAdmin-routing.module.ts b/src/app/claims/claimsAdmin/claimsAdmin-routing.module.ts new file mode 100644 index 0000000..f0256d3 --- /dev/null +++ b/src/app/claims/claimsAdmin/claimsAdmin-routing.module.ts @@ -0,0 +1,18 @@ +import {NgModule} from '@angular/core'; +import {RouterModule} from '@angular/router'; +import {OpenaireClaimsAdminComponent} from './claimsAdmin.component'; +import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {properties} from "../../../environments/environment"; + + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: OpenaireClaimsAdminComponent, data: { + redirect: properties.errorLink + }, canDeactivate: [PreviousRouteRecorder]}, + + ]) + ] +}) +export class ClaimsAdminRoutingModule { } diff --git a/src/app/claims/claimsAdmin/claimsAdmin.component.ts b/src/app/claims/claimsAdmin/claimsAdmin.component.ts new file mode 100644 index 0000000..2afe060 --- /dev/null +++ b/src/app/claims/claimsAdmin/claimsAdmin.component.ts @@ -0,0 +1,46 @@ +import {Component, OnInit} from '@angular/core'; +import {properties} from "../../../environments/environment"; +import {ActivatedRoute} from "@angular/router"; +import {StakeholderService} from "../../openaireLibrary/monitor/services/stakeholder.service"; +import {Title} from "@angular/platform-browser"; + +@Component({ + selector: 'openaire-claims-admin', + template: ` +
+
+ +
+
+ + + +
+
+ `, +}) +export class OpenaireClaimsAdminComponent implements OnInit { + claimsInfoURL: string; + userInfoURL: string; + subscriptions = [] + fetchId = null + constructor( private route: ActivatedRoute, private stakeholderService: StakeholderService, private title: Title) { + } + + public ngOnInit() { + this.claimsInfoURL = properties.claimsInformationLink; + if(this.route.snapshot.data.param === 'stakeholder') { + this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => { + if(stakeholder) { + this.fetchId = stakeholder.index_id; + this.title.setTitle(stakeholder.name + ' | Manage claims'); + } + })); + } + } +} diff --git a/src/app/claims/claimsAdmin/claimsAdmin.module.ts b/src/app/claims/claimsAdmin/claimsAdmin.module.ts new file mode 100644 index 0000000..6d88845 --- /dev/null +++ b/src/app/claims/claimsAdmin/claimsAdmin.module.ts @@ -0,0 +1,25 @@ +import { NgModule } from '@angular/core'; + +import { SharedModule } from '../../openaireLibrary/shared/shared.module'; +import { OpenaireClaimsAdminComponent } from './claimsAdmin.component'; +import { ClaimsAdminRoutingModule } from './claimsAdmin-routing.module'; +import{ClaimsAdminModule } from '../../openaireLibrary/claims/claimsAdmin/claimsAdmin.module'; +import{ ClaimsCuratorGuard} from '../../openaireLibrary/login/claimsCuratorGuard.guard'; +import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'; +import {PageContentModule} from "../../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module"; + + +@NgModule({ + imports: [ + SharedModule, + ClaimsAdminRoutingModule, + ClaimsAdminModule, + PageContentModule + ], + providers:[ClaimsCuratorGuard, PreviousRouteRecorder,IsRouteEnabled], + declarations: [ + OpenaireClaimsAdminComponent + ] +}) +export class LibClaimsAdminModule { } diff --git a/src/app/claims/directLinking/directLinking-routing.module.ts b/src/app/claims/directLinking/directLinking-routing.module.ts new file mode 100644 index 0000000..50507ed --- /dev/null +++ b/src/app/claims/directLinking/directLinking-routing.module.ts @@ -0,0 +1,19 @@ +import {NgModule} from '@angular/core'; +import {RouterModule} from '@angular/router'; + +import {OpenaireDirectLinkingComponent} from './directLinking.component'; +import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {properties} from "../../../environments/environment"; + + +@NgModule({ + imports: [ + RouterModule.forChild([ + { path: '', component: OpenaireDirectLinkingComponent, data: { + redirect: properties.errorLink, community : 'openaire' + }, canDeactivate: [PreviousRouteRecorder]}, + + ]) + ] +}) +export class DirectLinkingRoutingModule { } diff --git a/src/app/claims/directLinking/directLinking.component.ts b/src/app/claims/directLinking/directLinking.component.ts new file mode 100644 index 0000000..22f26ea --- /dev/null +++ b/src/app/claims/directLinking/directLinking.component.ts @@ -0,0 +1,46 @@ +import {Component, Input} from '@angular/core'; +import {ActivatedRoute} from "@angular/router"; +import {StakeholderService} from "../../openaireLibrary/monitor/services/stakeholder.service"; +import {Title} from "@angular/platform-browser"; +import {MonitorClaimsProperties} from "../monitorClaims.properties"; + +@Component({ + selector: 'openaire-directLinking', + template: ` +
+
+ +
+
+ +
+
+ ` +}) +export class OpenaireDirectLinkingComponent { + id; + alias; + subscriptions = []; + claimsProperties; + + + constructor(private route: ActivatedRoute, private stakeholderService: StakeholderService, private title: Title) { + this.claimsProperties = new MonitorClaimsProperties(); + + console.log(this.claimsProperties) + } + + public ngOnInit() { + if (this.route.snapshot.data.param === 'stakeholder') { + this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(stakeholder => { + if (stakeholder) { + this.alias = stakeholder.alias; + this.id = stakeholder.index_id; + this.title.setTitle(stakeholder.name + ' | Claim Organization'); + } + })); + } + } +} + + diff --git a/src/app/claims/directLinking/directLinking.module.ts b/src/app/claims/directLinking/directLinking.module.ts new file mode 100644 index 0000000..b78a7fd --- /dev/null +++ b/src/app/claims/directLinking/directLinking.module.ts @@ -0,0 +1,21 @@ +import { NgModule } from '@angular/core'; + +import { SharedModule } from '../../openaireLibrary/shared/shared.module'; +import { OpenaireDirectLinkingComponent } from './directLinking.component'; +import{ DirectLinkingModule} from '../../openaireLibrary/claims/directLinking/directLinking.module'; +import {DirectLinkingRoutingModule} from './directLinking-routing.module'; +import {LoginGuard} from '../../openaireLibrary/login/loginGuard.guard'; +import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard'; +import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'; +import {PageContentModule} from "../../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module"; + +@NgModule({ + imports: [ + SharedModule, DirectLinkingModule, DirectLinkingRoutingModule, PageContentModule + ], + providers:[LoginGuard, PreviousRouteRecorder, IsRouteEnabled], + declarations: [ + OpenaireDirectLinkingComponent + ], exports:[OpenaireDirectLinkingComponent] +}) +export class LibDirectLinkingModule { } diff --git a/src/app/claims/monitorClaims.properties.ts b/src/app/claims/monitorClaims.properties.ts new file mode 100644 index 0000000..dd16f23 --- /dev/null +++ b/src/app/claims/monitorClaims.properties.ts @@ -0,0 +1,14 @@ +import {ClaimsProperties} from "../openaireLibrary/claims/claim-utils/claims.properties"; + +export class MonitorClaimsProperties extends ClaimsProperties{ + constructor() { + super(); + this.ALLOW_ORGANIZATION_LINKING = true; + this.INLINE_ENTITY.show = false; + this.INLINE_ENTITY.guideText = "Lorem ipsum"; + this.BASKET.target_title = "Link to"; + this.METADATA_PREVIEW.edit_target_icon = "west"; + this.METADATA_PREVIEW.edit_target_title = "Go to search for results" + + } +} diff --git a/src/app/users/users.component.html b/src/app/users/users.component.html index 788112b..0b232e9 100644 --- a/src/app/users/users.component.html +++ b/src/app/users/users.component.html @@ -8,6 +8,7 @@ diff --git a/src/environments/environment.beta.ts b/src/environments/environment.beta.ts index 3273100..ab113b0 100644 --- a/src/environments/environment.beta.ts +++ b/src/environments/environment.beta.ts @@ -12,7 +12,9 @@ let props: EnvProperties = { adminToolsCommunity: "monitor", useHelpTexts:true, baseLink: "/dashboard", - domain: "https://beta.monitor.openaire.eu" + domain: "https://beta.monitor.openaire.eu", + myClaimsLink: "../../users/links" + }; export let properties: EnvProperties = { diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index d2aac67..067ce80 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -12,7 +12,9 @@ let props: EnvProperties = { adminToolsCommunity: "monitor", useHelpTexts: true, baseLink: "/dashboard", - domain: "https://monitor.openaire.eu" + domain: "https://monitor.openaire.eu", + myClaimsLink: "../../users/links" + }; export let properties: EnvProperties = { diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 5f6d27b..2161ab5 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -19,7 +19,8 @@ let props: EnvProperties = { adminToolsCommunity: "monitor", useHelpTexts: true, baseLink: "/", - domain: "http://mpagasas.di.uoa.gr:4600" + domain: "http://mpagasas.di.uoa.gr:4600", + myClaimsLink: "../../users/links" }; export let properties: EnvProperties = { diff --git a/src/styles.less b/src/styles.less index 9bbe777..1cfd18c 100644 --- a/src/styles.less +++ b/src/styles.less @@ -7,5 +7,6 @@ @import "~src/assets/common-assets/less/dashboard"; @import "~src/assets/common-assets/less/indicators"; @import "~src/assets/common-assets/less/ckeditor"; +@import "~src/assets/common-assets/less/linking"; @import "~src/assets/monitor-dashboard-custom"; @import "assets/print.css"; From 59d85d3a30250db3fe5733dc10b261bb1133a65c Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 31 May 2024 11:37:53 +0300 Subject: [PATCH 2/2] [develop | DONE]: Change position of buttons of multi indicator paths to bottom right and add slider-tabs. --- src/app/monitor/monitor.component.html | 20 +++++++------------- src/app/openaireLibrary | 2 +- src/assets/openaire-theme | 2 +- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/app/monitor/monitor.component.html b/src/app/monitor/monitor.component.html index 8d0de5c..19015be 100644 --- a/src/app/monitor/monitor.component.html +++ b/src/app/monitor/monitor.component.html @@ -185,19 +185,6 @@
{{indicator.name + " "}}
-