Skip to content

Commit

Permalink
Merge pull request #705 from luechtdiode/custom-wettkampf-mode
Browse files Browse the repository at this point in the history
v2r3b0 candidate
  • Loading branch information
luechtdiode authored Jun 17, 2023
2 parents a161544 + ba05ab4 commit d0055e7
Show file tree
Hide file tree
Showing 100 changed files with 6,241 additions and 3,279 deletions.
4 changes: 2 additions & 2 deletions .client/kutuapp.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
app {
fullversion = dev.client.test
majorversion = dev.client
fullversion = dev3.client.test
majorversion = dev3.client
builddate = today
remote {
schema = "http"
Expand Down
4 changes: 3 additions & 1 deletion dockercompose/pg-init.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
CREATE SCHEMA IF NOT EXISTS kutu;
CREATE USER kutuadmin;
CREATE ROLE kutu_admin WITH SUPERUSER USER kutuadmin;
CREATE SCHEMA IF NOT EXISTS kutu AUTHORIZATION kutu_admin;
SET search_path TO kutu;
22 changes: 11 additions & 11 deletions docs/HowToSetupTestInstallation.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ wieder eingestellt werden muss, oder bei der andere Server-Adressen hinterlegt s
Entwicklungs-Server verbunden werden soll, kann mit folgender Anleitung eine Test-Instanz konfiguriert werden.

Die Versionsbezeichnungen können im Laufe geändert haben und müssen ggf. in den Scripts angepasst werden.
Aktuell wird -v2r2 verwendet.
Aktuell wird -v2r3 verwendet.

Mac OS (Terminal):
------------------
Copy & Paste folgendes Script im Terminal, ev. mit `sudo` notwendig:
```
rm -rf ~/Applications/Test-KutuApp.app
cp -r /Applications/TurnerWettkampf-App-v2r2.app/ ~/Applications/Test-KutuApp.app
cp -r /Applications/TurnerWettkampf-App-v2r3.app/ ~/Applications/Test-KutuApp.app
echo 'app {
majorversion = "latest-testversion"
Expand Down Expand Up @@ -56,14 +56,14 @@ function set-shortcut {
}
$rmjob = Start-Job -ScriptBlock { rm $Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r2 -Recurse }
$rmjob = Start-Job -ScriptBlock { rm $Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r3 -Recurse }
Wait-Job $rmjob
Receive-Job $rmjob
$cpjob = Start-Job -ScriptBlock { cp $Env:LOCALAPPDATA\TurnerWettkampf-App-v2r2 $Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r2 -Recurse }
$cpjob = Start-Job -ScriptBlock { cp $Env:LOCALAPPDATA\TurnerWettkampf-App-v2r3 $Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r3 -Recurse }
Wait-Job $cpjob
Receive-Job $cpjob
Set-Content $Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r2\app\kutuapp.conf -Value 'app {
Set-Content $Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r3\app\kutuapp.conf -Value 'app {
majorversion = "latest-testversion"
remote {
schema = "https"
Expand All @@ -72,32 +72,32 @@ Set-Content $Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r2\app\kutuapp.conf -Va
}'
$DesktopPath = [Environment]::GetFolderPath("Desktop")
set-shortcut "$DesktopPath\Test-TurnerWettkampf-App-v2r2.lnk" "$Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r2\TurnerWettkampf-App-v2r2.exe"
set-shortcut "$DesktopPath\Test-TurnerWettkampf-App-v2r3.lnk" "$Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r3\TurnerWettkampf-App-v2r3.exe"
```
Dann starten via Desktop-Verknüpfung oder via PowerShell mit
```
$Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r2\TurnerWettkampf-App-v2r2.exe
$Env:LOCALAPPDATA\Test-TurnerWettkampf-App-v2r3\TurnerWettkampf-App-v2r3.exe
```

Linux (Terminal):
-----------------

```
rm -rf ./TurnerWettkampf-App-v2r2
rm -rf ./TurnerWettkampf-App-v2r3
cp -r /opt/TurnerWettkampf-App-v2r2 ./
cp -r /opt/TurnerWettkampf-App-v2r3 ./
echo 'app {
majorversion = "latest-testversion"
remote {
schema = "https"
hostname = "test-kutuapp.sharevic.net"
}
}' > TurnerWettkampf-App-v2r2/app/kutuapp.conf
}' > TurnerWettkampf-App-v2r3/app/kutuapp.conf
```

Dann starten mit:
```~/TurnerWettkampf-App-v2r2/TurnerWettkampf-App-v2r2```
```~/TurnerWettkampf-App-v2r3/TurnerWettkampf-App-v2r3```


Verifikation, dass die Testversion korrekt funktioniert:
Expand Down
3 changes: 2 additions & 1 deletion newclient/resultcatcher/src/app/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@

ion-icon {
//background-color: var(--ion-item-background-color);
color: var(--ion-color-step-500);
//color: var(--ion-color-step-500);
color: var(--ion-item-color, var(--ion-text-color, #000));
}
ion-toolbar {
--background: var(--ion-toolbar-background-color);
Expand Down
12 changes: 9 additions & 3 deletions newclient/resultcatcher/src/app/backend-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ export interface ProgrammRaw {
id: number;
name: string;
aggregate: number;
parent: number;
parentId: number;
ord: number;
vonAlter: number;
bisAlter: number;
alterVon: number;
alterBis: number;
uuid: string;
riegenmode: number;
}

export interface Verein {
Expand Down Expand Up @@ -142,6 +144,10 @@ export interface Wettkampf {
auszeichnungendnote: number;
uuid: string;
notificationEMail?: string;
altersklassen?: string;
jahrgangsklassen?: string;
punktegleichstandsregel?: string;
rotation?: string;
}

export interface ScoreRow {
Expand Down
5 changes: 3 additions & 2 deletions newclient/resultcatcher/src/app/component/component.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ import { ResultDisplayComponent } from './result-display/result-display.componen
import { RiegeListComponent } from './riege-list/riege-list.component';
import { StartlistItemComponent } from './startlist-item/startlist-item.component';
import { ScorelistItemComponent } from './scorelist-item/scorelist-item.component';
import { WertungAvgCalcComponent } from './wertung-avg-calc/wertung-avg-calc.component';
import { FormsModule } from '@angular/forms';
import { IonicModule } from '@ionic/angular';

@NgModule({
declarations: [ResultDisplayComponent, RiegeListComponent, StartlistItemComponent, ScorelistItemComponent],
exports: [ResultDisplayComponent, RiegeListComponent, StartlistItemComponent, ScorelistItemComponent],
declarations: [ResultDisplayComponent, RiegeListComponent, StartlistItemComponent, ScorelistItemComponent, WertungAvgCalcComponent],
exports: [ResultDisplayComponent, RiegeListComponent, StartlistItemComponent, ScorelistItemComponent, WertungAvgCalcComponent],
imports: [
CommonModule,
FormsModule,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<ion-item [hidden]="hidden">
<ion-label *ngIf="singleValues.length < 2">{{title}}</ion-label>
<ion-input #noteInput *ngIf="singleValues.length < 2" autofocus placeholder="Notenwert im Format ##.## (2-3 Nachkommastellen mit Dezimalpunkt)"
name="noteInput" type="number" [disabled]="waiting || disabled"
[(ngModel)]='singleValueContainer'
step="0.05" min="0.00" max="100.00" required></ion-input>
<ion-button *ngIf="singleValues.length < 2" [disabled]="waiting || disabled" slot="end" expand="block" color="secondary" (click)='add()'>
<ion-icon name="add-circle-outline"></ion-icon></ion-button>
<ion-grid *ngIf="singleValues.length > 1" class="table" no-padding>
<ion-row >
<ion-col class="table-header">{{title}} ø {{avgValue}}</ion-col>
<ion-col class="table-action"><ion-button [disabled]="waiting || disabled || fixed <= 0" color="secondary" (click)='removeKomma()'>
<ion-icon name="remove-outline"></ion-icon></ion-button></ion-col>
<ion-col class="decimals" no-padding><div>Kommastellen</div><ion-input
[(ngModel)]="fixed"
type="number" name=decimals
step="1" min="0" max="3"
required
[disabled]="waiting || disabled"
></ion-input></ion-col>
<ion-col class="table-action"><ion-button [disabled]="waiting || disabled || fixed >= 3" color="secondary" (click)='addKomma()'>
<ion-icon name="add-outline"></ion-icon></ion-button></ion-col>
</ion-row>
<ion-row *ngFor="let item of singleValues; let i = index">
<ion-col class="number">{{i+1}}. Wertung</ion-col>
<ion-col id="input-group" no-padding>
<div id="validity"></div>
<ion-input #noteInput *ngIf="i === 0" placeholder="Notenwert im Format ##.## (2-3 Nachkommastellen mit Dezimalpunkt)"
type="number" name={{valueTitle}}{{i}}
step="0.05" min="0.00" max="100.00"
required
[disabled]="waiting || disabled"
[ngModel]="item.value"
(ionChange)="onItemChange($event, item)"
(ionBlur)="onBlur($event, item)">
</ion-input>
<ion-input *ngIf="i>0" placeholder="Notenwert im Format ##.## (2-3 Nachkommastellen mit Dezimalpunkt)"
type="number" name={{valueTitle}}{{i}}
step="0.05" min="0.00" max="100.00"
required
[disabled]="waiting || disabled"
[ngModel]="item.value"
(ionChange)="onItemChange($event, item)"
(ionBlur)="onBlur($event, item)">
</ion-input>
</ion-col>
<ion-col class="table-action"><ion-button [disabled]="waiting || disabled" color="danger" (click)='remove(i)'>
<ion-icon name="trash-outline"></ion-icon></ion-button></ion-col>
</ion-row>
<ion-row *ngIf="!disabled" class="table-header">
<ion-col><ion-button [disabled]="waiting || disabled" expand="block" color="secondary" (click)='add()'>
<ion-icon name="add-circle-outline"></ion-icon>Weitere Wertung hinzufügen</ion-button></ion-col>
</ion-row>
</ion-grid>
</ion-item>
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
.table {
background-color: var(--ion-background-color);
//font-size: 0.8rem;
height: 100%;
overflow: hidden;
overflow-y: auto;
.table-header,
.table-subject {
color: var(--ion-color-primary);
font-weight: bold;
}
ion-row {
//margin: 5px;
display: flex;
justify-content: center;
align-items: center;
flex-wrap: nowrap;
ion-col {
//flex-basis: 20%;
&.decimals {
flex: 0 0 6em;
position:relative; top: -0.6em;
ion-input {
height: 100%;
outline: none;
text-align: right;
border: 1px solid #a9a9a9;
}
}
&.table-action {
flex: 0 0 1.5em;
}
&.number {
flex: 0 0 6em;
letter-spacing: 0.5px;
}
}
}
}

@media all and (min-height: 720px) {
.table {
ion-row {
margin: 10px;
}
}
}

#decimals-group {
height: 70%;
overflow: hidden;
ion-input {
height: 100%;
outline: none;
text-align: right;
border: 1px solid #a9a9a9;
}
}

#input-group {
height: 70%;
overflow: hidden;
#validity {
width: 0;
height: 0;
position: absolute;
top: 0%;
right: 0%;
border-left: 15px solid transparent;
border-top: 15px solid transparent;
}
ion-input {
height: 100%;
width: 100%;
outline: none;
text-align: right;
border: 1px solid #a9a9a9;
}
&.valid {
#validity {
border-left: 15px solid transparent;
border-top: 15px solid var(--ion-color-success);
}
ion-input {
border: 1px solid var(--ion-color-success);
}
}
&.invalid {
#validity {
border-left: 15px solid transparent;
border-top: 15px solid var(--ion-color-danger)
}
ion-input {
border: 1px solid var(--ion-color-danger);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { IonicModule } from '@ionic/angular';

import { WertungAvgCalcComponent } from './wertung-avg-calc.component';

describe('WertungAvgCalcComponent', () => {
let component: WertungAvgCalcComponent;
let fixture: ComponentFixture<WertungAvgCalcComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [ WertungAvgCalcComponent ],
imports: [IonicModule.forRoot()]
}).compileComponents();

fixture = TestBed.createComponent(WertungAvgCalcComponent);
component = fixture.componentInstance;
fixture.detectChanges();
}));

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading

0 comments on commit d0055e7

Please sign in to comment.