1. Change message in role verification if an error is occurred. 2. Add isCurator in create a category. 3. Hide delete section if it not permitted and make manage roles visible to curators and superAdmins
This commit is contained in:
parent
53a39d0a34
commit
2492f737b8
|
@ -5,9 +5,7 @@
|
|||
</div>
|
||||
<div *ngIf="!loading" class="uk-grid" uk-grid>
|
||||
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
||||
|
||||
<div *ngIf="!server" class="uk-container uk-container-small uk-position-relative">
|
||||
|
||||
<div *ngIf="loggedIn && !errorCode" class="">
|
||||
<div class="uk-h2 uk-text-center">User Information</div>
|
||||
<div>
|
||||
|
@ -19,13 +17,13 @@
|
|||
<div *ngIf="user.role.length > 1">
|
||||
<span class="uk-text-muted"> Roles </span> <span> {{getTheRolesFormatted(user.role)}} </span>
|
||||
</div>
|
||||
<div class="uk-margin-top " *ngIf="user.role.length > 1">
|
||||
<a class="uk-button uk-button-primary" href="https://aai.openaire.eu/roles/index.php"
|
||||
<div class="uk-margin-top" *ngIf="user.role.length > 1">
|
||||
<a *ngIf="isCurator" class="uk-button uk-button-primary" href="https://aai.openaire.eu/roles/index.php"
|
||||
target="_blank">Manage your roles</a> {{" "}}
|
||||
<a *ngIf="user && isUserManager()" class="uk-button uk-button-primary"
|
||||
<a *ngIf="isUserManager" class="uk-button uk-button-primary uk-margin-top"
|
||||
href="https://aai.openaire.eu/roles/admin.php"
|
||||
target="_blank">Manage role requests</a>{{" "}}
|
||||
<a *ngIf="user && isUserManager()" class="uk-button uk-button-primary"
|
||||
<a *ngIf="isUserManager" class="uk-button uk-button-primary uk-margin-top"
|
||||
href="https://aai.openaire.eu/registry"
|
||||
target="_blank">Manage users</a>
|
||||
</div>
|
||||
|
@ -33,25 +31,6 @@
|
|||
|
||||
<!-- <button (click)="logout()" class=" uk-button uk-button-default">Log out</button> -->
|
||||
</div>
|
||||
<!--form *ngIf="!loggedIn" class=" ">
|
||||
|
||||
<h3>Welcome to OpenAIRE's Discover Portal</h3>
|
||||
|
||||
<p>This service uses the same ldap sign-in as the OpenAIRE services so you can use the same
|
||||
credentials.</p>
|
||||
|
||||
<p>Login in. To see it in action.</p>
|
||||
<div class="uk-margin">
|
||||
<input class="uk-input uk-form-width-medium" placeholder="Username" type="text" name="username" [(ngModel)]="username">
|
||||
</div>
|
||||
|
||||
<div class="uk-margin">
|
||||
<input placeholder="Password" class="uk-input uk-form-width-medium" type="password" name="password" [(ngModel)]="password">
|
||||
</div>
|
||||
<div class="uk-margin">
|
||||
<button (click)="login()" class=" uk-button uk-button-primary">Login</button>
|
||||
</div>
|
||||
</form-->
|
||||
<div *ngIf="errorCode == '1' || (!loggedIn && errorCode != '3' && errorCode != '6')" class="uk-alert uk-alert-warning">
|
||||
The requested page requires authentication.
|
||||
<span *ngIf="!loggedIn">Please <a class="uk-link" (click)="logIn()"> sign in</a> to continue.
|
||||
|
@ -68,10 +47,7 @@
|
|||
<div *ngIf="errorCode == '5'" class="uk-alert uk-alert-warning">
|
||||
There is no research community selected.
|
||||
</div>
|
||||
|
||||
<div *ngIf="!loggedIn && errorMessage.length > 0" class="uk-alert uk-alert-danger">{{errorMessage}}</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -99,8 +99,12 @@ export class UserComponent {
|
|||
}
|
||||
return formattedRoles.join(", ");
|
||||
}
|
||||
|
||||
get isCurator() {
|
||||
return Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user);
|
||||
}
|
||||
|
||||
isUserManager() {
|
||||
get isUserManager() {
|
||||
return Session.isUserManager(this.user);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ import { RouterModule } from "@angular/router";
|
|||
|
||||
import {UserMiniComponent} from "./userMini.component";
|
||||
import {IconsModule} from "../utils/icons/icons.module";
|
||||
import {IconsService} from "../utils/icons/icons.service";
|
||||
import {login} from "../utils/icons/icons";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@ -19,4 +21,7 @@ import {IconsModule} from "../utils/icons/icons.module";
|
|||
]
|
||||
})
|
||||
export class UserMiniModule {
|
||||
constructor(private iconsService: IconsService) {
|
||||
this.iconsService.registerIcons([login])
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,13 +62,17 @@ import {Composer} from "../utils/email/composer";
|
|||
</modal-alert>
|
||||
<modal-alert #errorModal (alertOutput)="cancel()" [overflowBody]="false">
|
||||
<div>
|
||||
We are unable to process the request because the link is invalid, or it has expired.
|
||||
We are unable to process the request. What happened?
|
||||
<ol>
|
||||
<li>You are logged in with <a [routerLink]="[userInfoLinkPrefix + '/user-info']" (click)="errorModal.cancel()">a different email</a>, than the one you have received the invitation.</li>
|
||||
<li>The invitation has been canceled.</li>
|
||||
<li>The URL is invalid.</li>
|
||||
</ol>
|
||||
</div>
|
||||
</modal-alert>
|
||||
`
|
||||
})
|
||||
export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewInit {
|
||||
|
||||
@Input()
|
||||
public id: string;
|
||||
@Input()
|
||||
|
@ -77,6 +81,8 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn
|
|||
public name: string;
|
||||
@Input()
|
||||
public service: "connect" | "monitor" = "monitor";
|
||||
@Input()
|
||||
public userInfoLinkPrefix = '';
|
||||
public user: User;
|
||||
public verification: any;
|
||||
public code: UntypedFormControl;
|
||||
|
|
|
@ -6,9 +6,10 @@ import {ReactiveFormsModule} from "@angular/forms";
|
|||
import {LoadingModule} from "../utils/loading/loading.module";
|
||||
import {InputModule} from "../sharedComponents/input/input.module";
|
||||
import {EmailService} from "../utils/email/email.service";
|
||||
import {RouterModule} from "@angular/router";
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, AlertModalModule, ReactiveFormsModule, LoadingModule, InputModule],
|
||||
imports: [CommonModule, AlertModalModule, ReactiveFormsModule, LoadingModule, InputModule, RouterModule],
|
||||
declarations: [RoleVerificationComponent],
|
||||
exports: [RoleVerificationComponent],
|
||||
providers: [EmailService]
|
||||
|
|
|
@ -107,4 +107,9 @@ export const newsletter = {
|
|||
name: 'newsletter',
|
||||
data: '<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><circle cx="3.12" cy="16.8" r="1.85"></circle><path fill="none" stroke="#000" stroke-width="3" d="M1.5,8.2 C1.78,8.18 2.06,8.16 2.35,8.16 C7.57,8.16 11.81,12.37 11.81,17.57 C11.81,17.89 11.79,18.19 11.76,18.5"></path><path fill="none" stroke="#000" stroke-width="3" d="M1.5,2.52 C1.78,2.51 2.06,2.5 2.35,2.5 C10.72,2.5 17.5,9.24 17.5,17.57 C17.5,17.89 17.49,18.19 17.47,18.5"></path></svg>'
|
||||
}
|
||||
|
||||
export const login = {
|
||||
name: 'login',
|
||||
data: '<svg width="20px" height="20px" viewBox="0 0 700 700" xmlns="http://www.w3.org/2000/svg"><g><path d="m151.67 536.67c0-109.47 88.863-198.34 198.33-198.34s198.33 88.867 198.33 198.34c0 6.4375 5.2266 11.664 11.668 11.664s11.668-5.2266 11.668-11.664c0-122.34-99.332-221.67-221.67-221.67s-221.67 99.328-221.67 221.67c0 6.4375 5.2266 11.664 11.668 11.664s11.668-5.2266 11.668-11.664z" fill-rule="evenodd"/><path d="m349.8 11.668c-77.164 0-139.8 62.637-139.8 139.8s62.637 139.8 139.8 139.8c77.164 0 139.8-62.637 139.8-139.8s-62.637-139.8-139.8-139.8zm0 23.332c64.285 0 116.47 52.184 116.47 116.47 0 64.281-52.184 116.47-116.47 116.47-64.281 0-116.47-52.188-116.47-116.47 0-64.285 52.188-116.47 116.47-116.47z" fill-rule="evenodd"/></g></svg>'
|
||||
}
|
||||
/** Add new icon under this line to be sure that it will be added on preview */
|
||||
|
|
Loading…
Reference in New Issue