2019-11-08 13:07:39 +01:00
|
|
|
import {Component, Input} from '@angular/core';
|
|
|
|
import {Title, Meta} from '@angular/platform-browser';
|
2020-11-11 15:43:13 +01:00
|
|
|
import {User} from "../../login/utils/helper.class";
|
2019-09-13 09:01:19 +02:00
|
|
|
import {UserManagementService} from "../../services/user-management.service";
|
2020-03-26 13:18:18 +01:00
|
|
|
import {LoginErrorCodes} from "../../login/utils/guardHelper.class";
|
|
|
|
import {Router} from "@angular/router";
|
2020-11-11 15:43:13 +01:00
|
|
|
import {Subscriber} from "rxjs";
|
Replace meta service import and use with meta and title from angular/platform-browser for user, publication, claimAdmin,claimsByToken, directLinking, linkingGeneric, myClaims, depositBySubject, depositBySubjectResult, deposit, depositResult, dataProvider, htmlProjectReport, organization, project, software, search, advancedSearchPage, searchPage and searchPageTableView component
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@51835 d315682c-612b-4755-9ff5-7f18f6832af3
2018-04-17 15:00:23 +02:00
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
|
|
|
|
@Component({
|
2019-11-08 13:07:39 +01:00
|
|
|
selector: 'claims-admin',
|
|
|
|
template: `
|
2022-07-13 19:25:19 +02:00
|
|
|
<div [class.uk-section]="!isConnect">
|
2021-04-13 15:32:58 +02:00
|
|
|
<div uk-grid class="uk-margin-small-top">
|
2022-07-13 19:25:19 +02:00
|
|
|
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first">
|
2021-04-13 15:32:58 +02:00
|
|
|
<div [class.uk-container]="!isConnect" [class.uk-container-large]="!isConnect">
|
2022-07-05 16:48:28 +02:00
|
|
|
<h1 *ngIf="!isConnect" class="uk-h2">
|
2019-11-08 13:07:39 +01:00
|
|
|
Manage links
|
2022-07-05 16:48:28 +02:00
|
|
|
</h1>
|
2017-12-19 13:53:46 +01:00
|
|
|
<div>
|
2019-10-01 10:46:18 +02:00
|
|
|
<displayClaims *ngIf="user" [user]="user" [enableDelete]=true [myClaims]=false
|
2019-11-08 13:07:39 +01:00
|
|
|
[isAdmin]=true [fetchBy]="(fetchId=='openaire')?null:fetchBy"
|
2022-07-13 19:25:19 +02:00
|
|
|
[fetchId]="(fetchId=='openaire')?null:fetchId" [actions]="isConnect"
|
2019-11-08 13:07:39 +01:00
|
|
|
[communityId]="(fetchBy && fetchBy == 'Context' && fetchId && fetchId!='openaire')?fetchId:null"
|
2019-10-01 10:46:18 +02:00
|
|
|
[externalPortalUrl]=externalPortalUrl [claimsInfoURL]=claimsInfoURL
|
2021-04-19 18:28:36 +02:00
|
|
|
pageTitle="Manage links"></displayClaims>
|
2017-12-19 13:53:46 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-11-08 13:07:39 +01:00
|
|
|
`,
|
2017-12-19 13:53:46 +01:00
|
|
|
})
|
|
|
|
export class ClaimsAdminComponent {
|
2019-11-08 13:07:39 +01:00
|
|
|
@Input() fetchBy: string;
|
|
|
|
@Input() fetchId: string;
|
|
|
|
@Input() isConnect: boolean = false;
|
|
|
|
@Input() externalPortalUrl: string;
|
|
|
|
@Input() claimsInfoURL: string;
|
2019-09-13 09:01:19 +02:00
|
|
|
public user: User = null;
|
2020-11-11 15:43:13 +01:00
|
|
|
sub;
|
2021-03-19 17:51:02 +01:00
|
|
|
|
2019-11-08 13:07:39 +01:00
|
|
|
constructor(private _meta: Meta, private _title: Title,
|
2020-03-26 13:18:18 +01:00
|
|
|
private userManagementService: UserManagementService, private _router: Router) {
|
2021-03-19 17:51:02 +01:00
|
|
|
if (!this.isConnect) {
|
|
|
|
this._title.setTitle("OpenAIRE | Manage links ");
|
|
|
|
}
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
2021-03-19 17:51:02 +01:00
|
|
|
|
2020-11-11 15:43:13 +01:00
|
|
|
ngOnDestroy() {
|
|
|
|
if (this.sub instanceof Subscriber) {
|
|
|
|
this.sub.unsubscribe();
|
|
|
|
}
|
|
|
|
}
|
2021-03-19 17:51:02 +01:00
|
|
|
|
2017-12-19 13:53:46 +01:00
|
|
|
ngOnInit() {
|
2020-11-11 15:43:13 +01:00
|
|
|
this.sub = this.userManagementService.getUserInfo().subscribe(user => {
|
2019-11-08 13:07:39 +01:00
|
|
|
this.user = user;
|
2020-03-26 13:18:18 +01:00
|
|
|
if (!user) {
|
|
|
|
this._router.navigate(['/user-info'], {
|
|
|
|
queryParams: {
|
|
|
|
"errorCode": LoginErrorCodes.NOT_VALID,
|
|
|
|
"redirectUrl": this._router.url
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2019-11-08 13:07:39 +01:00
|
|
|
});
|
2017-12-19 13:53:46 +01:00
|
|
|
}
|
|
|
|
}
|