Commit 20b5404d authored by Alicia.DeDiosFuente's avatar Alicia.DeDiosFuente Committed by Alicia.DeDiosFuente
Browse files

feat:add link to person in contributors page

parent 5f01fa9f
......@@ -8,6 +8,20 @@
[formControlName]="formDefinition.lastName"
[required]="isRequired(formDefinition.lastName)"
>
<button solidifyShortCuts
matSuffix
mat-button
mat-icon-button
type="button"
aria-label="Navigate to"
class="navigate-to"
[matTooltip]="'preservationSpace.contributor.form.person.navigateLinkPlaceholder' | translate"
(click)="navigateTo($event)"
>
<mat-icon class="navigate-icon"
>open_in_new
</mat-icon>
</button>
</mat-form-field>
<mat-form-field>
......@@ -16,6 +30,20 @@
[formControlName]="formDefinition.firstName"
[required]="isRequired(formDefinition.firstName)"
>
<button solidifyShortCuts
matSuffix
mat-button
mat-icon-button
type="button"
aria-label="Navigate to"
class="navigate-to"
[matTooltip]="'preservationSpace.contributor.form.person.navigateLinkPlaceholder' | translate"
(click)="navigateTo($event)"
>
<mat-icon class="navigate-icon"
>open_in_new
</mat-icon>
</button>
</mat-form-field>
<mat-form-field>
......
......@@ -7,6 +7,18 @@
flex-wrap: wrap;
justify-content: center;
.navigate-to {
width: 25px;
height: 25px;
line-height: 25px;
margin: 0 2px;
.navigate-icon {
font-size: 16px;
line-height: 23px;
}
}
> * {
padding: 0 10px;
......@@ -25,4 +37,4 @@
}
}
}
}
\ No newline at end of file
}
......@@ -3,6 +3,7 @@ import {
ChangeDetectorRef,
Component,
ElementRef,
Output
} from "@angular/core";
import {FormBuilder} from "@angular/forms";
import {Contributor} from "@app/generated-api/model/contributor.partial.model";
......@@ -10,6 +11,9 @@ import {SharedAbstractFormPresentational} from "@shared/components/presentationa
import {BaseFormDefinition} from "@shared/models/base-form-definition.model";
import {BreakpointService} from "@shared/services/breakpoint.service";
import {PropertyName} from "solidify-frontend";
import {isNullOrUndefined} from "solidify-frontend";
import {BehaviorSubject, Observable} from "rxjs/index";
import {ObservableUtil} from "solidify-frontend";
@Component({
selector: "dlcm-contributor-form",
......@@ -20,6 +24,10 @@ import {PropertyName} from "solidify-frontend";
export class ContributorFormPresentational extends SharedAbstractFormPresentational<Contributor> {
formDefinition: FormComponentFormDefinition = new FormComponentFormDefinition();
protected readonly _navigatePersonBS: BehaviorSubject<void | undefined> = new BehaviorSubject<void | undefined>(undefined);
@Output("navigatePerson")
readonly navigatePersonObs: Observable<void | undefined> = ObservableUtil.asObservable(this._navigatePersonBS);
constructor(protected readonly _changeDetectorRef: ChangeDetectorRef,
protected readonly _elementRef: ElementRef,
private readonly _fb: FormBuilder,
......@@ -47,6 +55,12 @@ export class ContributorFormPresentational extends SharedAbstractFormPresentatio
return undefined;
}
navigateTo($event?: MouseEvent): void {
this._navigatePersonBS.next();
if (!isNullOrUndefined($event)) {
$event.stopPropagation();
}
}
}
class FormComponentFormDefinition extends BaseFormDefinition {
......
......@@ -22,7 +22,7 @@
(submitChange)="update($event)"
(checkAvailableChange)="checkAvailable($event)"
(dirtyChange)="updateCanDeactivate($event)"
(navigate)="navigate($event)"
(navigatePerson)="navigateToPerson()"
(editChange)="edit()"
>
</dlcm-contributor-form>
......
......@@ -137,4 +137,9 @@ export class ContributorDetailEditRoutable extends SharedAbstractDetailEditCommo
goToDeposit(deposit: Deposit): void {
this._store.dispatch(new Navigate([RoutesEnum.deposit, deposit.organizationalUnitId, DepositRoutesEnum.detail, deposit.resId]));
}
navigateToPerson(): void {
this.navigate([RoutesEnum.adminPersonDetail, this._resId]);
}
}
......@@ -2453,6 +2453,11 @@
"button": {
"refresh": "Refresh"
},
"form": {
"person": {
"navigateLinkPlaceholder": "See person detail"
}
},
"deposit": {
"title": "Associated deposits"
}
......@@ -2644,4 +2649,4 @@
}
}
}
}
\ No newline at end of file
}
......@@ -2453,6 +2453,11 @@
"button": {
"refresh": "Refresh"
},
"form": {
"person": {
"navigateLinkPlaceholder": "See person detail"
}
},
"deposit": {
"title": "Associated deposits"
}
......@@ -2644,4 +2649,4 @@
}
}
}
}
\ No newline at end of file
}
......@@ -2453,6 +2453,11 @@
"button": {
"refresh": "Rafraichir"
},
"form": {
"person": {
"navigateLinkPlaceholder": "Voir le détail de la personne"
}
},
"deposit": {
"title": "Dépôts associés"
}
......@@ -2644,4 +2649,4 @@
}
}
}
}
\ No newline at end of file
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment