Skip to content

Commit

Permalink
Added info to Diff about only one dive
Browse files Browse the repository at this point in the history
  • Loading branch information
jirkapok committed Apr 5, 2024
1 parent 1f204ee commit 81940dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 5 additions & 1 deletion projects/planner/src/app/diff/diff.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<div class="mt-5">
<div class="row"><app-diff-tabs></app-diff-tabs></div>

<div class="alert alert-info fade show mt-4" role="alert" *ngIf="!diff.hasTwoProfiles">
<fa-icon [icon]="exclamation" class="me-2 fa-lg"></fa-icon>
<span>There is only one dive planned. If you want to compare dives, define at least two.</span>
<button type="button" class="btn btn-sm btn-primary ms-2" data-bs-dismiss="alert" (click)="goToDashboard()">Go to planner</button>
</div>
<div class="row">
<div class="col-12 col-xl-6 col-xxl-6 mt-4 h-100">
<app-diff-profilechart></app-diff-profilechart>
Expand Down
10 changes: 9 additions & 1 deletion projects/planner/src/app/diff/diff.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
import { Component } from '@angular/core';
import { Location } from '@angular/common';
import { ProfileComparatorService } from '../shared/diff/profileComparatorService';
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons';

@Component({
selector: 'app-diff',
templateUrl: './diff.component.html',
styleUrls: ['./diff.component.scss']
})
export class DiffComponent {
constructor(public profileComparatorService: ProfileComparatorService) {
public readonly exclamation = faExclamationCircle;

constructor(public diff: ProfileComparatorService, private location: Location) {
}

public goToDashboard(): void {
this.location.go('/');
}
}

0 comments on commit 81940dd

Please sign in to comment.