Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Turnierplan.App/Client/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"prefix": "tp",
"schematics": {
"@schematics/angular:component": {
"style": "scss"
Expand Down
3 changes: 2 additions & 1 deletion src/Turnierplan.App/Client/src/app/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ export const de = {
SelectTournament: 'Wählen Sie einen Turnier, welches ein Dokument beinhaltet.'
},
EditMatchDialog: {
Title: 'Spielergebnis melden',
Title: 'Spielergebnis eintragen',
Index: 'Nr.',
Kickoff: 'Anstoß',
Type: 'Spieltyp',
Expand Down Expand Up @@ -1033,6 +1033,7 @@ export const de = {
TeamCount: 'Teams',
Contact: 'Kontaktperson',
ContactEmail: 'E-Mail',
CopyAllEmailAddresses: 'Alle E-Mailadressen auf dieser Seite in die Zwischenablage kopieren',
ContactTelephone: 'Telefon-Nr.',
Comment: 'Bemerkung',
CommentTooltip: 'Die Bemerkung wurde bei der Anmeldung mitgeschickt und kann nicht bearbeitet werden.',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
@if (copyToClipboardPressed) {
<i class="bi bi-check-lg text-success"></i>
} @else {
<i class="bi bi-copy tp-cursor-pointer" [ngbTooltip]="'Portal.General.CopyToClipboard' | translate" (click)="copyToClipboard()"></i>
<i
class="bi bi-copy tp-cursor-pointer"
[ngbTooltip]="tooltipOverwrite ?? 'Portal.General.CopyToClipboard' | translate"
(click)="copyToClipboard()"></i>
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ export class CopyToClipboardComponent {
@Input()
public value: string | number = '';

@Input()
public tooltipOverwrite?: string;

protected copyToClipboardPressed = false;

protected copyToClipboard(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
<th style="width: 1px" translate="Portal.ViewPlanningRealm.Applications.TableHeader.CreatedAt"></th>
<th style="width: 1px" translate="Portal.ViewPlanningRealm.Applications.TableHeader.TeamCount"></th>
<th style="width: 15%" translate="Portal.ViewPlanningRealm.Applications.TableHeader.Contact"></th>
<th style="width: 20%" translate="Portal.ViewPlanningRealm.Applications.TableHeader.ContactEmail"></th>
<th style="width: 20%">
<span class="me-2" translate="Portal.ViewPlanningRealm.Applications.TableHeader.ContactEmail"></span>
@if (combinedEmailAddresses && combinedEmailAddresses.length > 0) {
<tp-copy-to-clipboard
[tooltipOverwrite]="'Portal.ViewPlanningRealm.Applications.TableHeader.CopyAllEmailAddresses'"
[value]="combinedEmailAddresses" />
}
</th>
<th style="width: 15%" translate="Portal.ViewPlanningRealm.Applications.TableHeader.ContactTelephone"></th>
<th style="width: 20%">
<span translate="Portal.ViewPlanningRealm.Applications.TableHeader.Comment"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class ManageApplicationsComponent implements OnDestroy {
protected pageSize = 15;
protected isLoading = false;
protected result?: PaginationResultDtoOfApplicationDto;
protected combinedEmailAddresses?: string = undefined;
protected showTeamsApplicationId?: number;
protected updatingNotesOfApplicationId?: number;
protected updatingLabelsOfApplicationTeamId?: number;
Expand Down Expand Up @@ -117,6 +118,15 @@ export class ManageApplicationsComponent implements OnDestroy {
this.result = result;
this.isLoading = false;

if (result.items.length === 0) {
this.combinedEmailAddresses = undefined;
} else {
this.combinedEmailAddresses = result.items
.map((application) => application.contactEmail)
.filter((mail) => !!mail)
.join(' ');
}

if (result.items.length === 1) {
this.showTeamsApplicationId = result.items[0].id;
} else if (this.showTeamsApplicationId !== undefined && !result.items.some((x) => x.id === this.showTeamsApplicationId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,23 @@ export class ViewPlanningRealmComponent implements OnInit, OnDestroy, DiscardCha
.pipe(
tap(() => (this.loadingState = { isLoading: true })),
switchMap((request: CreateApplicationEndpointRequest) =>
this.turnierplanApi.invoke(createApplication, { planningRealmId: planningRealmId, body: request })
this.turnierplanApi.invoke(createApplication, { planningRealmId: planningRealmId, body: request }).pipe(map(() => request))
)
)
.subscribe({
next: () => {
next: (request: CreateApplicationEndpointRequest) => {
this.loadingState = { isLoading: false };

// Modify the planning realm stored in the client to account for the newly added teams. By doing this "hack" we can prevent
// a separate request for querying the entire planning realm when only the "numberOfTeams" property has changed.
if (this.planningRealm) {
for (const entry of request.entries) {
const tournamentClass = this.planningRealm.tournamentClasses?.find((x) => x.id === entry.tournamentClassId);
if (tournamentClass) {
tournamentClass.numberOfTeams += entry.numberOfTeams;
}
}
}
},
error: (error) => {
this.loadingState = { isLoading: false, error: error };
Expand Down
12 changes: 7 additions & 5 deletions src/Turnierplan.App/Pages/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@
<div class="bg-dark text-white">
<div class="container px-5 py-4 d-flex flex-wrap flex-row">
<div class="footer-section d-flex flex-column">
<span>turnierplan.NET</span>
<span class="fw-bold">turnierplan.NET</span>
<span class="small">v@(TurnierplanVersion.Version)</span>
<a class="mt-2 small text-white text-decoration-none d-flex flex-row align-items-center gap-2" target="_blank" href="https://github.com/turnierplan-NET/turnierplan.NET" rel="noopener">
<img src="./assets/github.svg" alt="GitHub-Logo"/>
<span>GitHub</span>
</a>
<span class="mt-2 small d-flex flex-row justify-content-start">
<a class="text-white text-decoration-none d-flex flex-row align-items-center gap-2" target="_blank" href="https://github.com/turnierplan-NET/turnierplan.NET" rel="noopener">
<img src="./assets/github.svg" alt="GitHub-Logo"/>
<span>GitHub</span>
</a>
</span>
</div>
<div class="footer-section footer-section-right d-flex flex-column">
@if (hasCustomInstanceName)
Expand Down
Loading