Skip to content

Commit

Permalink
Fix various semantic tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuelMoeri committed Oct 21, 2024
1 parent f8a49ee commit c8bae3e
Show file tree
Hide file tree
Showing 12 changed files with 125 additions and 129 deletions.
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0",
"start": "ng serve ",
"build": "ng build",
"build:staging": "ng build --configuration staging",
"watch": "ng build --watch --configuration development",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="d-flex flex-column gap-2 col-12">
<section class="d-flex flex-column gap-2 col-12">
<label for="actionlist" class="text-black">Action Plan (optional)</label>
<div
cdkDropList
Expand Down Expand Up @@ -42,7 +42,7 @@
</div>
</div>

<section class="add-action-button">
<div class="add-action-button">
<button
mat-button
color="primary"
Expand All @@ -60,5 +60,5 @@
Weitere Action hinzufügen
</span>
</button>
</section>
</div>
</div>
</section>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<div id="okrBanner" #okrBanner>
<!-- Possibly cleanup a few div's here? -->
<div class="d-flex flex-row">
<div [ngClass]="isMobileDevice() ? 'filters' : 'none'" class="w-100 h-100 m-0 d-flex filters" slot="content">
<section class="d-none d-md-flex">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ng-container
*ngIf="(checkInHistory$ | async)?.length! > 0 && (checkInHistory$ | async) as checkInHistory; else spinner"
>
<div
<section
*ngFor="let checkIn of checkInHistory; index as i"
class="d-flex flex-column dialog-form-fields p-2 check-in-box"
>
Expand Down Expand Up @@ -47,7 +47,7 @@
<span class="label-width"><i>Massnahmen: </i></span>
<span class="value-width linebreak">{{ checkIn.initiatives }}</span>
</div>
</div>
</section>
</ng-container>
</div>
<button class="close-button" mat-flat-button color="primary" mat-dialog-close>Schliessen</button>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<div class="input-style gap-2 col-12">
<div class="d-flex flex-row flex-wrap gap-between">
<div class="d-flex flex-wrap gap-between">
<div class="d-flex flex-column gap-2" id="new-value">
<label class="text-black" for="value">Neuer Wert</label>
<div class="d-flex flex-row align-items-center">
<form [formGroup]="dialogForm">
<input
class="value-field"
[attr.data-testId]="'check-in-metric-value'"
[ngClass]="formInputCheck(dialogForm, 'value')"
formControlName="value"
id="value"
/>
</form>
<form [formGroup]="dialogForm" class="d-flex align-items-center">
<input
class="value-field"
[attr.data-testId]="'check-in-metric-value'"
[ngClass]="formInputCheck(dialogForm, 'value')"
formControlName="value"
id="value"
/>
<span class="text-black unit-label">{{ generateUnitLabel() }}</span>
</div>
</form>
</div>

<div *ngIf="checkIn.value" class="d-flex flex-column gap-2" id="old-value">
<label class="text-black">Letzter Wert</label>
<div class="value-field disabled-field d-flex justify-content-start text-black">
<p class="value-field disabled-field d-flex justify-content-start text-black">
{{ checkIn.value }} {{ generateUnitLabel() }}
</div>
</p>
</div>
</div>

<mat-error *ngIf="hasFormFieldErrors(dialogForm, 'value')">
<span>{{ getErrorMessage("MUST_BE_NUMBER", "Neuer Wert") }}</span>
</mat-error>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,25 @@
<mat-radio-group formControlName="value" class="d-flex flex-column gap-2">
<mat-radio-button [attr.data-testId]="'fail-radio'" value="{{ Zone.FAIL }}" class="ordinal-zone">
<div class="radio-text-container d-flex align-items-center p-3 text-black">
<b>Fail:&nbsp;&nbsp; </b>Commit / Target / Stretch noch nicht erreicht
<strong>Fail:&nbsp;</strong> Commit / Target / Stretch noch nicht erreicht
</div>
</mat-radio-button>

<mat-radio-button [attr.data-testId]="'commit-radio'" value="{{ Zone.COMMIT }}" class="ordinal-zone">
<div class="radio-text-container d-flex p-3">
<p class="text-black"><b>Commit:&nbsp; </b> {{ keyResult.commitZone }}</p>
<span class="text-black"><strong>Commit:&nbsp;</strong>{{ keyResult.commitZone }}</span>
</div>
</mat-radio-button>

<mat-radio-button [attr.data-testId]="'target-radio'" value="{{ Zone.TARGET }}" class="ordinal-zone">
<div class="radio-text-container d-flex p-3 w-100">
<p class="text-black"><b>Target:&nbsp; </b>{{ keyResult.targetZone }}</p>
<span class="text-black"><strong>Target:&nbsp;</strong>{{ keyResult.targetZone }}</span>
</div>
</mat-radio-button>

<mat-radio-button [attr.data-testId]="'stretch-radio'" value="{{ Zone.STRETCH }}" class="ordinal-zone">
<div class="radio-text-container d-flex p-3">
<p class="text-black"><b>Stretch:&nbsp; </b>{{ keyResult.stretchZone }}</p>
<span class="text-black"><strong>Stretch:&nbsp;</strong>{{ keyResult.stretchZone }}</span>
</div>
</mat-radio-button>
</mat-radio-group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
</div>
<div *ngIf="getActions()?.length != 0" class="input-style gap-1">
<label class="text-black mb-1">Action Plan:</label>
<span *ngFor="let action of getActions(); let i = index" class="d-flex flex-row">
<div *ngFor="let action of getActions(); let i = index" class="d-flex flex-row">
<mat-checkbox #checkbox (change)="changeIsChecked($event, i)" [checked]="action.isChecked"></mat-checkbox>
<span
class="action-list-item w-100 break-word"
[ngStyle]="{ 'text-decoration': checkbox.checked ? 'line-through' : 'none' }"
>
{{ action.action }}
</span>
</span>
</div>
</div>

<div class="input-style gap-2 col-12">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
</div>

<div class="input-style gap-2 col-12">
<label class="text-black" for="owner">Owner</label>
<label class="text-black">Owner</label>
<input
(keydown.enter)="$event.preventDefault()"
[ngClass]="invalidOwner() ? 'dialog-form-field-error' : 'dialog-form-field'"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<section mat-dialog-title>
<div mat-dialog-title>
<app-dialog-header
[dialogTitle]="data.keyResult ? 'Key Result bearbeiten' : 'Key Result erfassen'"
></app-dialog-header>
</section>
</div>

<mat-dialog-content>
<div class="d-flex flex-column scroll-shadows" tabindex="-1">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,53 +32,51 @@
<form [formGroup]="keyResultForm" class="gap-1">
<div class="d-flex flex-column flex-wrap container p-0">
<div class="d-flex flex-row">
<div class="flex-fill">
<div class="input-alignments">
<div class="input-style gap-2">
<label class="text-black" for="unit">Einheit</label>
<select
class="unit-dropdown bg-white menu-option"
[ngClass]="formInputCheck(keyResultForm, 'unit')"
formControlName="unit"
id="unit"
[attr.data-testId]="'unit'"
>
<option *ngFor="let unit of Unit | keyvalue" value="{{ unit.value }}">
{{ "UNIT." + unit.value | translate }}
</option>
</select>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'unit')">
<span>{{ getErrorMessage("MUST_SELECT", "Einheit", null, null) }}</span>
</mat-error>
</div>
<div class="flex-fill input-alignments">
<div class="input-style gap-2">
<label class="text-black" for="unit">Einheit</label>
<select
class="unit-dropdown bg-white menu-option"
[ngClass]="formInputCheck(keyResultForm, 'unit')"
formControlName="unit"
id="unit"
[attr.data-testId]="'unit'"
>
<option *ngFor="let unit of Unit | keyvalue" value="{{ unit.value }}">
{{ "UNIT." + unit.value | translate }}
</option>
</select>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'unit')">
<span>{{ getErrorMessage("MUST_SELECT", "Einheit", null, null) }}</span>
</mat-error>
</div>

<div class="input-style gap-2">
<label class="text-black" for="baseline">Baseline</label>
<input
[attr.data-testId]="'baseline'"
class="metric-fields"
[ngClass]="formInputCheck(keyResultForm, 'baseline')"
formControlName="baseline"
id="baseline"
/>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'baseline')">
<span>{{ getErrorMessage("MUST_BE_NUMBER", "Baseline", null, null) }}</span>
</mat-error>
</div>
<div class="input-style gap-2">
<label class="text-black" for="baseline">Baseline</label>
<input
[attr.data-testId]="'baseline'"
class="metric-fields"
[ngClass]="formInputCheck(keyResultForm, 'baseline')"
formControlName="baseline"
id="baseline"
/>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'baseline')">
<span>{{ getErrorMessage("MUST_BE_NUMBER", "Baseline", null, null) }}</span>
</mat-error>
</div>

<div class="input-style gap-2">
<label class="text-black" for="stretchGoal">Stretch Goal</label>
<input
[attr.data-testId]="'stretchGoal'"
class="metric-fields"
[ngClass]="formInputCheck(keyResultForm, 'stretchGoal')"
formControlName="stretchGoal"
id="stretchGoal"
/>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'stretchGoal')">
<span>{{ getErrorMessage("MUST_BE_NUMBER", "Stretch Goal", null, null) }}</span>
</mat-error>
</div>
<div class="input-style gap-2">
<label class="text-black" for="stretchGoal">Stretch Goal</label>
<input
[attr.data-testId]="'stretchGoal'"
class="metric-fields"
[ngClass]="formInputCheck(keyResultForm, 'stretchGoal')"
formControlName="stretchGoal"
id="stretchGoal"
/>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'stretchGoal')">
<span>{{ getErrorMessage("MUST_BE_NUMBER", "Stretch Goal", null, null) }}</span>
</mat-error>
</div>
</div>
</div>
Expand All @@ -90,49 +88,47 @@
<form [formGroup]="keyResultForm" class="gap-1">
<div class="d-flex flex-column flex-wrap container p-0">
<div class="d-flex flex-row">
<div class="flex-fill">
<div class="input-alignments">
<div class="input-style gap-2">
<label class="text-black" for="commitZone">Commit Zone</label>
<textarea
class="ordinal-input-fields"
[ngClass]="formInputCheck(keyResultForm, 'commitZone')"
formControlName="commitZone"
id="commitZone"
[attr.data-testId]="'commitZone'"
></textarea>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'commitZone')">
<span>{{ getErrorMessage("SIZE_BETWEEN", "Commit Zone", 1, 400) }}</span>
</mat-error>
</div>
<div class="flex-fill input-alignments">
<div class="input-style gap-2">
<label class="text-black" for="commitZone">Commit Zone</label>
<textarea
class="ordinal-input-fields"
[ngClass]="formInputCheck(keyResultForm, 'commitZone')"
formControlName="commitZone"
id="commitZone"
[attr.data-testId]="'commitZone'"
></textarea>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'commitZone')">
<span>{{ getErrorMessage("SIZE_BETWEEN", "Commit Zone", 1, 400) }}</span>
</mat-error>
</div>

<div class="input-style gap-2">
<label class="text-black" for="targetZone">Target Zone</label>
<textarea
[attr.data-testId]="'targetZone'"
class="ordinal-input-fields"
[ngClass]="formInputCheck(keyResultForm, 'targetZone')"
formControlName="targetZone"
id="targetZone"
></textarea>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'targetZone')">
<span>{{ getErrorMessage("SIZE_BETWEEN", "Target Zone", 1, 400) }}</span>
</mat-error>
</div>
<div class="input-style gap-2">
<label class="text-black" for="targetZone">Target Zone</label>
<textarea
[attr.data-testId]="'targetZone'"
class="ordinal-input-fields"
[ngClass]="formInputCheck(keyResultForm, 'targetZone')"
formControlName="targetZone"
id="targetZone"
></textarea>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'targetZone')">
<span>{{ getErrorMessage("SIZE_BETWEEN", "Target Zone", 1, 400) }}</span>
</mat-error>
</div>

<div class="input-style gap-2">
<label class="text-black" for="stretchZone">Stretch Goal</label>
<textarea
[attr.data-testId]="'stretchZone'"
class="ordinal-input-fields"
[ngClass]="formInputCheck(keyResultForm, 'stretchZone')"
formControlName="stretchZone"
id="stretchZone"
></textarea>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'stretchZone')">
<span>{{ getErrorMessage("SIZE_BETWEEN", "Stretch Zone", 1, 400) }}</span>
</mat-error>
</div>
<div class="input-style gap-2">
<label class="text-black" for="stretchZone">Stretch Goal</label>
<textarea
[attr.data-testId]="'stretchZone'"
class="ordinal-input-fields"
[ngClass]="formInputCheck(keyResultForm, 'stretchZone')"
formControlName="stretchZone"
id="stretchZone"
></textarea>
<mat-error *ngIf="hasFormFieldErrors(keyResultForm, 'stretchZone')">
<span>{{ getErrorMessage("SIZE_BETWEEN", "Stretch Zone", 1, 400) }}</span>
</mat-error>
</div>
</div>
</div>
Expand Down
18 changes: 8 additions & 10 deletions frontend/src/app/components/keyresult/keyresult.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,16 @@
<h3 class="keyresult-title linebreak mb-2">{{ keyResult.title }}</h3>
<app-scoring [keyResult]="keyResult" [isDetail]="false" [attr.data-testId]="'scoring-component'"></app-scoring>
<div class="d-flex justify-content-between mt-1">
<div class="d-flex justify-content-center">
<span class="d-flex align-items-center flex-wrap keyResult-overview-attribute">
<span class="me-1 text-nowrap me-2">Letztes Check-in</span>
<span class="keyResult-attribute-show" *ngIf="keyResult.lastCheckIn != null">{{
keyResult!.lastCheckIn!.createdOn | date: DATE_FORMAT
}}</span>
<span class="keyResult-attribute-show" *ngIf="keyResult.lastCheckIn == null">Keines</span>
</span>
<div class="d-flex justify-content-center align-items-center flex-wrap keyResult-overview-attribute">
<span class="me-1 text-nowrap me-2">Letztes Check-in</span>
<span class="keyResult-attribute-show" *ngIf="keyResult.lastCheckIn != null">{{
keyResult!.lastCheckIn!.createdOn | date: DATE_FORMAT
}}</span>
<span class="keyResult-attribute-show" *ngIf="keyResult.lastCheckIn == null">Keines</span>
</div>

<div class="d-flex align-items-center flex-wrap justify-content-end">
<p class="keyResult-overview-attribute">Confidence</p>
<div class="d-flex align-items-center flex-wrap justify-content-end keyResult-overview-attribute">
<span>Confidence</span>
<app-confidence
[edit]="false"
[isDetail]="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>
<div class="row mx-1">
<section class="d-flex mb-3 mt-3 justify-content-between pe-0">
<section class="d-flex gap-2 align-items-start fit-content objective-title">
<div class="d-flex gap-2 align-items-start fit-content objective-title">
<img
(click)="$event.stopPropagation()"
[attr.data-testId]="'objective-state'"
Expand All @@ -19,7 +19,7 @@
matTooltipPosition="above"
/>
<h2 class="title fit-content">{{ objective.title }}</h2>
</section>
</div>
<button
#menuButton
*ngIf="isWritable"
Expand Down

0 comments on commit c8bae3e

Please sign in to comment.