Skip to content
Draft
2 changes: 2 additions & 0 deletions frontend/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { provideI18nPrefix } from './shared/i18n-prefix.provider';
import { MemberDetailViewComponent } from './features/member/detail-view/member-detail-view.component';
import { tabResolver } from './features/member/detail-view/tab-resolver';
import { authGuard } from './core/auth/guard/auth.guard';
import { memberIdResolver } from './features/member/member-id-resolver';

export const routes: Routes = [{
path: '',
Expand Down Expand Up @@ -37,6 +38,7 @@ export const routes: Routes = [{
canActivate: [authGuard('user')],
resolve:
{ member: memberDataResolver,
memberId: memberIdResolver,
tabIndex: tabResolver }
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

<ng-container actions>
<app-modal-actions
[submitModes]="this.data.submitOptions"
[isValid]="formGroup.valid"
(cancelAction)="onCancel()"
(submitAction)="onSubmit($event)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { MemberModel } from '../../member/member.model';
import { DialogResult, StrictlyTypedDialog } from '../../../shared/modal/strictly-typed-dialog.helper';
import { InputFieldComponent } from '../../../shared/input-field/input-field.component';
import { ModalActionsComponent } from '../../../shared/modal/modal-actions.component';
import { PCTSDialogConfig } from '../../../shared/modal/pcts-modal.service';

@Component({
selector: 'app-add-certificate',
Expand Down Expand Up @@ -45,7 +46,7 @@ import { ModalActionsComponent } from '../../../shared/modal/modal-actions.compo
templateUrl: './add-certificate.component.html',
providers: [provideI18nPrefix('CERTIFICATE.FORM.ADD')]
})
export class AddCertificateComponent extends StrictlyTypedDialog<CertificateModel | undefined, DialogResult<CertificateModel>> implements OnInit {
export class AddCertificateComponent extends StrictlyTypedDialog<PCTSDialogConfig<CertificateModel>, DialogResult<CertificateModel>> implements OnInit {
private readonly fb = inject(FormBuilder);

protected readonly ModalSubmitMode = ModalSubmitMode;
Expand All @@ -70,7 +71,7 @@ export class AddCertificateComponent extends StrictlyTypedDialog<CertificateMode
super();
if (this.data) {
this.formGroup.patchValue({
...this.data
...this.data.model
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

<ng-container actions>
<app-modal-actions
[submitModes]="this.data.submitOptions"
[isValid]="formGroup.valid"
(cancelAction)="onCancel()"
(submitAction)="onSubmit($event)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { DegreeTypeService } from '../degree-type/degree-type.service';
import { MatCheckbox } from '@angular/material/checkbox';
import { provideI18nPrefix } from '../../../shared/i18n-prefix.provider';
import { ModalActionsComponent } from '../../../shared/modal/modal-actions.component';
import { PCTSDialogConfig } from '../../../shared/modal/pcts-modal.service';

@Component({
selector: 'app-add-degree',
Expand Down Expand Up @@ -48,7 +49,7 @@ import { ModalActionsComponent } from '../../../shared/modal/modal-actions.compo
templateUrl: './add-degree.component.html',
providers: [provideI18nPrefix('DEGREE.FORM.ADD')]
})
export class AddDegreeComponent extends StrictlyTypedDialog<DegreeModel | undefined, DialogResult<DegreeModel>> implements OnInit {
export class AddDegreeComponent extends StrictlyTypedDialog<PCTSDialogConfig<DegreeModel>, DialogResult<DegreeModel>> implements OnInit {
private readonly fb = inject(FormBuilder);

private readonly degreeTypeService = inject(DegreeTypeService);
Expand Down Expand Up @@ -77,7 +78,7 @@ export class AddDegreeComponent extends StrictlyTypedDialog<DegreeModel | undefi
super();
if (this.data) {
this.formGroup.patchValue({
...this.data
...this.data.model
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

<ng-container actions>
<app-modal-actions
[submitModes]="this.data.submitOptions"
[isValid]="formGroup.valid"
(cancelAction)="onCancel()"
(submitAction)="onSubmit($event)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { LeadershipExperienceTypeModel } from '../leadership-experiences-type/le
import { provideI18nPrefix } from '../../../shared/i18n-prefix.provider';
import { TranslatePipe } from '@ngx-translate/core';
import { ModalActionsComponent } from '../../../shared/modal/modal-actions.component';
import { PCTSDialogConfig } from '../../../shared/modal/pcts-modal.service';

@Component({
selector: 'app-add-leadership-experience.component',
Expand All @@ -35,7 +36,7 @@ import { ModalActionsComponent } from '../../../shared/modal/modal-actions.compo
templateUrl: './add-leadership-experience.component.html',
providers: [provideI18nPrefix('LEADERSHIP_EXPERIENCE.FORM.ADD')]
})
export class AddLeadershipExperienceComponent extends StrictlyTypedDialog<LeadershipExperienceModel | undefined, DialogResult<LeadershipExperienceModel>> implements OnInit {
export class AddLeadershipExperienceComponent extends StrictlyTypedDialog<PCTSDialogConfig<LeadershipExperienceModel>, DialogResult<LeadershipExperienceModel>> implements OnInit {
private readonly fb = inject(FormBuilder);

protected readonly ModalSubmitMode = ModalSubmitMode;
Expand All @@ -57,7 +58,7 @@ export class AddLeadershipExperienceComponent extends StrictlyTypedDialog<Leader
super();
if (this.data) {
this.formGroup.patchValue({
...this.data
...this.data.model
});
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Component, computed, inject, input } from '@angular/core';
import { GenericTableComponent } from '../../../../shared/generic-table/generic-table.component';
import { MemberService } from '../../member.service';
import { getCalculationTable } from '../cv/member-detail-cv-table-definition';
import { CrudButtonComponent } from '../../../../shared/crud-button/crud-button.component';
import { ScopedTranslationPipe } from '../../../../shared/pipes/scoped-translation-pipe';
import { rxResource } from '@angular/core/rxjs-interop';
import { getCalculationTable } from '../cv/member-detail-cv-table-definition';

@Component({
selector: 'app-member-calculation-table',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h3>{{ "MODEL_NAME" | scopedTranslation }}</h3>
<ng-content *appShowIfAdmin select="[crud-button]"/>
</div>
@if (table(); as ds) {
<app-generic-table [dataSource]="ds" [idAttr]="idAttr()" [crudBasePath]="crudBasePath()">
<app-generic-table [dataSource]="ds" [idAttr]="idAttr()" [crudBasePath]="crudBasePath()" (rowClicked)="setRowClicked($event)">
<ng-template [appTypedTemplate]="ds.data"/>

<ng-template
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, effect, input } from '@angular/core';
import { Component, effect, input, output } from '@angular/core';
import { GenericTableDataSource } from '../../../../shared/generic-table/generic-table-data-source';
import { GenericTableComponent } from '../../../../shared/generic-table/generic-table.component';
import { ScopedTranslationPipe } from '../../../../shared/pipes/scoped-translation-pipe';
Expand Down Expand Up @@ -30,6 +30,8 @@ export class GenericCvContentComponent<T extends object> {

crudBasePath = input<string>('');

rowClicked = output<T>();

constructor() {
effect(() => {
const tableValue = this.table();
Expand All @@ -40,4 +42,8 @@ export class GenericCvContentComponent<T extends object> {
}
});
}

setRowClicked(row: T) {
this.rowClicked.emit(row);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@if (member(); as m) {
@if (memberResource.value()?.member; as m) {
<div class="p-4">
<div class="w-50">

Expand Down Expand Up @@ -88,8 +88,9 @@ <h2>
[data]="degreeData()"
*appTranslationScope="'DEGREE'"
[table]="degreeTable"
(rowClicked)="editDegreeDialog($event)")
>
<app-crud-button crud-button mode="add" [customOnClick]="openDegreeDialog" data-testid="add-degree-button"/>
<app-crud-button crud-button mode="add" [customOnClick]="addDegreeDialog" data-testid="add-degree-button"/>
</app-generic-cv-content>

<app-generic-cv-content
Expand All @@ -108,8 +109,9 @@ <h2>
[data]="certificateData()"
*appTranslationScope="'CERTIFICATE'"
[table]="certificateTable"
(rowClicked)="editCertificateDialog($event)"
>
<app-crud-button crud-button mode="add" [customOnClick]="openCertificateDialog" data-testid="add-certificate-button"/>
<app-crud-button crud-button mode="add" [customOnClick]="addCertificateDialog" data-testid="add-certificate-button"/>
</app-generic-cv-content>

<app-generic-cv-content
Expand All @@ -119,8 +121,9 @@ <h2>
[data]="leadershipExperienceData()"
*appTranslationScope="'LEADERSHIP_EXPERIENCE'"
[table]="leadershipExperienceTable"
(rowClicked)="editLeadershipExperienceDialog($event)"
>
<app-crud-button crud-button mode="add" [customOnClick]="openLeadershipExperienceDialog" data-testid="add-leadership-experience-button"/>
<app-crud-button crud-button mode="add" [customOnClick]="addLeadershipExperienceDialog" data-testid="add-leadership-experience-button"/>
</app-generic-cv-content>
</mat-tab>
@for (rolePoints of rolePointList(); track rolePoints.role) {
Expand Down
Loading
Loading