Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several improvements #306

Merged
merged 1 commit into from
Nov 4, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<a href="mailto:[email protected]"
>[email protected]</a
>
<br /><em>Please note that this is just my side project so I may be slow to reply.</em>
</li>
<li>
Or start an issue/discussion on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
</mat-list-item>
</mat-list>

<mat-checkbox [(ngModel)]="departure.isCancelled" (ngModelChange)="changedData()">Mark as Cancelled</mat-checkbox><br />

<button mat-flat-button color="primary" (click)="openStopDialog(index)">Add Stop</button><br /><br />

<button mat-flat-button color="warn" type="button" (click)="removeDeparture(index)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h5 class="inline-row led">{{DepartureTime | date: 'HH:mm'}}</h5>
</table>
<div class="board-row bottom">
<div
[ngClass]="{ 'ontime': Status=='On Time', 'late': Status?.includes('Exp'), 'arrived': Status=='Arrived', 'cancelled': Status=='Cancelled'}"
[ngClass]="{ 'ontime': Status=='On Time', 'late': (Status?.includes('Exp') || Status === 'Late'), 'arrived': Status=='Arrived', 'cancelled': Status=='Cancelled'}"
>
{{Status}}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ export class Board {
this.Length = data.length;
this.information = this.Operator;

if (data.isCancelled === true) {
data.status = ServiceStatus.CANCELLED;
}

if (!data.status || data.status < 0) {
data.status = this.calculateStatus(data);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ <h1 id="home-title" class="slider-title led-font" style="font-size: 3.3em">
"
class="led"
>
Example: Euston
Euston
</h4>
<div class="board-example">
<div></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,10 @@ export class SingleBoard implements OnDestroy, OnInit {
this.subscriptions.push(this.customDepartureSequence.subscribe(startIndex => {
// Calculates the Departure Status's
validDepartures.map(d => {
if (d.expectedDeparture) {
if (d.isCancelled) {
d.status = ServiceStatus.CANCELLED;
}
else if (d.expectedDeparture) {
d.status = new Date(d.expectedDeparture) > new Date(d.aimedDeparture)
? ServiceStatus.LATE
: ServiceStatus.ONTIME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface Departure {
length: number;
stops: StationStop[];
extraDetails: Dictionary<object>;
isCancelled?: boolean | undefined;
}

export interface StationStop {
Expand Down
Loading