Skip to content

Commit

Permalink
Merge branch 'develop' into bug/ARPA-955-put-back-role-condition-in-d…
Browse files Browse the repository at this point in the history
…ashboard-mupro-create-hint
  • Loading branch information
wolfgangroese authored Dec 10, 2023
2 parents 8c57497 + c0d30b4 commit dc3b7b5
Show file tree
Hide file tree
Showing 75 changed files with 15,213 additions and 613 deletions.
14,563 changes: 14,451 additions & 112 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions src/@arpa/layout/layout-default/layout-default.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class LayoutDefaultComponent implements OnDestroy {
label: 'Meine Daten',
icon: 'pi pi-user-edit',
roles: ['performer', 'staff', 'admin'],
routerLink: '/arpa/profile/user',
routerLink: '/arpa/profile/my-data',
translationToken: 'MY_DATA',
},
{
Expand All @@ -139,16 +139,23 @@ export class LayoutDefaultComponent implements OnDestroy {
label: 'Meine Termine',
icon: 'pi pi-calendar',
roles: ['performer', 'staff'],
routerLink: '/arpa/profile/appointments',
routerLink: '/arpa/profile/my-appointments',
translationToken: 'MY_APPOINTMENTS',
},
{
label: 'Meine Profile',
icon: 'pi pi-user-edit',
roles: ['performer'],
routerLink: '/arpa/profile/musician',
routerLink: '/arpa/profile/musicianprofile',
translationToken: 'MY_PROFILES',
},
{
label: 'Hilfe',
icon: 'pi pi-send',
roles: ['performer'],
translationToken: 'SUPPORT',
command: () => this.sendEmail(),
},
],
},
]);
Expand All @@ -163,4 +170,7 @@ export class LayoutDefaultComponent implements OnDestroy {
ngOnDestroy(): void {
this.routerEventSubscription.unsubscribe();
}
sendEmail() {
window.location.href = 'mailto:[email protected]';
}
}
9 changes: 0 additions & 9 deletions src/@arpa/layout/topbar/topbar.component.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
<span>{{ pageTitle | translate }}</span>
<div #nav class="nav">
<p-button
styleClass="p-button-rounded p-button-text"
(click)="sendEmail()"
[label]="'SUPPORT' | translate"
size="small"
icon="pi pi-send"
></p-button>
</div>
<div #nav class="nav">
<ng-container *ngIf="userToken | async as token">
<div *ngIf="(isHandset | async) !== true" class="user">
Expand Down
3 changes: 0 additions & 3 deletions src/@arpa/layout/topbar/topbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,4 @@ export class TopbarComponent {
getRoleNames(token: IToken): string {
return token.roles.map((role) => role.charAt(0).toUpperCase() + role.slice(1)).join(', ');
}
sendEmail() {
window.location.href = 'mailto:[email protected]';
}
}
8 changes: 3 additions & 5 deletions src/@arpa/layout/topbar/topbar.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
import { RouteTitleService } from '@arpa/services';
import { LanguageService } from '@arpa/services';
import { LanguageService, RouteTitleService } from '@arpa/services';
import { MenuItemArpa, MenuService } from '../../components/menu/menu.service';

@Injectable({
Expand Down Expand Up @@ -31,9 +30,9 @@ export class TopbarService {
* @private
*/
private initialiseUserMenu(): Array<MenuItemArpa> {
const userProfileItems: Array<MenuItemArpa> = [
return [
{ label: 'LOGOUT', icon: 'pi pi-sign-out', routerLink: ['/logout'] },
{ label: 'MY_DATA', icon: 'pi pi-user-edit', routerLink: ['/arpa/profile/user'] },
{ label: 'MY_DATA', icon: 'pi pi-user-edit', routerLink: ['/arpa/profile/my-data'] },
{ separator: true },
...this.languageService.getLangs().map((lang) => ({
label: this.languageService.getLanguageName(lang),
Expand All @@ -42,6 +41,5 @@ export class TopbarService {
{ separator: true },
{ label: 'THEME_SWITCHER', icon: 'pi pi-desktop', command: () => this.menuService.toggleDarkMode() },
];
return userProfileItems;
}
}
14 changes: 14 additions & 0 deletions src/@arpa/services/me.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import {
MyProjectParticipationModifyBodyDto,
MyAppointmentDto,
MyMusicianProfileDto,
AddressCreateBodyDto,
AddressModifyBodyDto,
AddressDto,
} from '@arpa/models';
import { Injectable } from '@angular/core';
import { Observable, of } from 'rxjs';
Expand Down Expand Up @@ -133,4 +136,15 @@ export class MeService {
deleteBankAccount(id: string, personId: any): Observable<any> {
return this.apiService.delete(`/persons/${personId}/bankaccounts/${id}`).pipe(shareReplay());
}

addAddress(personId: any, dto: AddressCreateBodyDto): Observable<AddressDto> {
return this.apiService.post<AddressDto>(`/persons/${personId}/addresses`, dto).pipe(shareReplay());
}
updateAddress(id: string, personId: any, dto: AddressModifyBodyDto): Observable<any> {
return this.apiService.put(`/persons/${personId}/addresses/${id}`, dto).pipe(shareReplay());
}

deleteAddress(id: string | undefined, personId: any): Observable<any> {
return this.apiService.delete(`/persons/${personId}/addresses/${id}`).pipe(shareReplay());
}
}
4 changes: 2 additions & 2 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,15 @@ const routes: Routes = [
},
},
{
path: 'my-data',
path: 'profile/my-data',
loadChildren: () => import('./features/profile/profile.module').then((mod) => mod.ProfileModule),
data: {
roles: ['performer', 'staff', 'admin'],
title: 'MY_DATA',
menu: {
name: 'feature',
label: 'MY_DATA',
icon: 'pi pi-user',
icon: 'pi pi-user-edit',
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Title } from '@angular/platform-browser';
import { filter, map, shareReplay } from 'rxjs/operators';
import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout';
import { fromEvent, merge, Observable, of, Subscription } from 'rxjs';
import { AuthEvents, AuthService } from '../@arpa/services/auth.service';
import { AuthEvents, AuthService } from '@arpa/services';
import { MeService, LoadingService, ConfigService, RouteTitleService } from '@arpa/services';

@Component({
Expand Down Expand Up @@ -71,7 +71,7 @@ export class AppComponent implements OnInit, OnDestroy {
// Remove sensible data on logout.
this.meService.cleanStorage();
} else if (event === AuthEvents.LOGIN) {
// Make sure an applicable user has a ready to use QRCode.
// Make sure an applicable user-layout has a ready to use QRCode.
// This observable is completed by default. No need to unsubscribe.
this.meService.getMyQrCode().subscribe();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SelectItem } from 'primeng/api';
import { Router } from '@angular/router';

@Component({
selector: 'arpa-appointments-widget',
selector: 'arpa-my-appointments-widget',
templateUrl: './appointments-widget.component.html',
styleUrls: ['./appointments-widget.component.scss'],
})
Expand Down Expand Up @@ -69,6 +69,6 @@ export class AppointmentsWidgetComponent {
return 'primary';
}
onRowClick(event: any): void {
this.router.navigate(['/arpa/profile/appointments']);
this.router.navigate(['/arpa/profile/my-appointments']);
}
}
10 changes: 5 additions & 5 deletions src/app/features/mupro/profiles/profiles.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@ <h2 class="p-pr-3">{{ musicianProfile.instrument?.name }}</h2>
<p-badge *ngIf="musicianProfile.isMainProfile" [value]="'MAIN_PROFILE' | translate"></p-badge>
</header>
<div class="p-d-inline-flex">
<label>{{ 'musician-profile-dialog.LEVEL_ASSESSMENT_INNER' | translate }}</label>
<label>{{ 'musicianprofile-dialog.LEVEL_ASSESSMENT_INNER' | translate }}</label>
<p-rating
[(ngModel)]="musicianProfile.levelAssessmentInner"
[cancel]="false"
[disabled]="true"
pTooltip="{{ 'musician-profile-dialog.LEVEL_ASSESSMENT_PERFORMER' | translate }}"
pTooltip="{{ 'musicianprofile-dialog.LEVEL_ASSESSMENT_PERFORMER' | translate }}"
class="p-pl-3"
></p-rating>
</div>
<div class="p-d-inline-flex">
<label>{{ 'musician-profile-dialog.LEVEL_ASSESSMENT_TEAM' | translate }}</label>
<label>{{ 'musicianprofile-dialog.LEVEL_ASSESSMENT_TEAM' | translate }}</label>
<p-rating
[(ngModel)]="musicianProfile.levelAssessmentTeam"
[cancel]="false"
[disabled]="true"
pTooltip="{{ 'musician-profile-dialog.LEVEL_ASSESSMENT_TEAM' | translate }}"
pTooltip="{{ 'musicianprofile-dialog.LEVEL_ASSESSMENT_TEAM' | translate }}"
class="p-pl-3"
></p-rating>
</div>
Expand All @@ -65,7 +65,7 @@ <h2 class="p-pr-3">{{ musicianProfile.instrument?.name }}</h2>
<p-badge
*ngIf="musicianProfile.deactivation"
severity="danger"
value="{{ 'musician-profile-dialog.DEACTIVATED' | translate }}"
value="{{ 'musicianprofile-dialog.DEACTIVATED' | translate }}"
></p-badge>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
<form (submit)='$event.preventDefault()' [formGroup]='form'>
<div class='p-fluid p-formgrid p-grid'>
<div class='p-col'>
<arpa-form-field label='musician-profile-dialog.DEACTIVATION_DATE'>
<form (submit)="$event.preventDefault()" [formGroup]="form">
<div class="p-fluid p-formgrid p-grid">
<div class="p-col">
<arpa-form-field label="musicianprofile-dialog.DEACTIVATION_DATE">
<p-calendar
[minDate]='minDate'
[showWeek]='true'
dateFormat='dd MM yy'
formControlName='deactivationStart'
id='deactivationStart'
[showIcon]='true'
[showOnFocus]='false'
[minDate]="minDate"
[showWeek]="true"
dateFormat="dd MM yy"
formControlName="deactivationStart"
id="deactivationStart"
[showIcon]="true"
[showOnFocus]="false"
appendTo="body"
></p-calendar>
</arpa-form-field>
</div>
</div>
<div class='p-fluid p-formgrid p-grid'>
<div class='p-col'>
<arpa-form-field label='musician-profile-dialog.PURPOSE'>
<textarea formControlName='purpose' id='purpose' pInputText type='text'></textarea>
<div class="p-fluid p-formgrid p-grid">
<div class="p-col">
<arpa-form-field label="musicianprofile-dialog.PURPOSE">
<textarea formControlName="purpose" id="purpose" pInputText type="text"></textarea>
</arpa-form-field>
</div>
</div>
<div class='p-d-flex p-jc-center'>
<div class='p-d-flex p-jc-centerl'>
<div class="p-d-flex p-jc-center">
<div class="p-d-flex p-jc-centerl">
<button
(click)='activate()'
*ngIf='profile.deactivation'
[label]="'musician-profile-dialog.ACTIVATE' | translate"
icon='pi pi-check'
iconPos='left'
(click)="activate()"
*ngIf="profile.deactivation"
[label]="'musicianprofile-dialog.ACTIVATE' | translate"
icon="pi pi-check"
iconPos="left"
pButton
type='button'
type="button"
></button>
</div>
<div class='p-d-flex p-jc-center'>
<div class="p-d-flex p-jc-center">
<button
(click)='deactivate()'
[disabled]='form.pristine || form.invalid'
[label]="'musician-profile-dialog.DEACTIVATE' | translate"
class='p-button-danger'
icon='pi pi-times'
iconPos='left'
(click)="deactivate()"
[disabled]="form.pristine || form.invalid"
[label]="'musicianprofile-dialog.DEACTIVATE' | translate"
class="p-button-danger"
icon="pi pi-times"
iconPos="left"
pButton
type='button'
type="button"
></button>
</div>
</div>
<div>
<div class="p-d-flex p-jc-center">
<p>{{ 'musicianprofile-dialog.NO_DEACTIVATION_POSSIBLE' | translate }}</p>
</div>
<div>
<div class='p-d-flex p-jc-center'>
<p>{{ 'musician-profile-dialog.NO_DEACTIVATION_POSSIBLE' | translate }}</p>
</div>
</div>
</div>
</form>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { MusicianService } from '../services/musician.service';
import { NotificationsService } from '@arpa/services';

@Component({
selector: 'arpa-musician-deactivation',
selector: 'arpa-musicianprofile-deactivation',
templateUrl: './musician-deactivation.component.html',
styleUrls: ['./musician-deactivation.component.scss'],
})
Expand Down Expand Up @@ -51,7 +51,7 @@ export class MusicianDeactivationComponent implements OnInit {
.activateProfile(this.profile.id)
.pipe(first())
.subscribe(() => {
this.notificationsService.success('ACTIVATED', 'musician-profile-dialog');
this.notificationsService.success('ACTIVATED', 'musicianprofile-dialog');
this.ref.close();
});
}
Expand All @@ -64,7 +64,7 @@ export class MusicianDeactivationComponent implements OnInit {
.deactivateProfile(this.profile.id, { ...this.form.value })
.pipe(first())
.subscribe((result) => {
this.notificationsService.success('DEACTIVATED', 'musician-profile-dialog');
this.notificationsService.success('DEACTIVATED', 'musicianprofile-dialog');
this.ref.close();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BehaviorSubject, combineLatest, of } from 'rxjs';
import { MusicianService } from '../services/musician.service';

@Component({
selector: 'arpa-musician-dialog-entry',
selector: 'arpa-musicianprofile-dialog-entry',
template: '',
})
export class MusicianDialogEntryComponent {
Expand Down
Loading

0 comments on commit dc3b7b5

Please sign in to comment.