Skip to content

Commit

Permalink
#231 - got rid of system name
Browse files Browse the repository at this point in the history
  • Loading branch information
bracyw committed Nov 21, 2024
1 parent 6cb2df2 commit 62db09b
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 19 deletions.
31 changes: 23 additions & 8 deletions angular-client/src/components/carousel/carousel.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,39 @@
<div class="run-card">
<mat-grid-list cols="2" rowHeight="40px">
<mat-grid-tile>
<typography class="left" variant="subheader" [content]="'Run #' + run.id" />
<typography
class="left"
variant="subheader"
[content]="'Run #' + run.id"
/>
</mat-grid-tile>
<mat-grid-tile>
<typography class="right" variant="subheader" [content]="run.driverName" />
<typography
class="right"
variant="subheader"
[content]="run.driverName"
/>
</mat-grid-tile>
<mat-grid-tile>
<typography class="left" variant="subheader" [content]="datePipe(run.time)" />
</mat-grid-tile>
<mat-grid-tile>
<typography class="right" variant="subheader" [content]="run.systemName" />
<typography
class="left"
variant="subheader"
[content]="datePipe(run.time)"
/>
</mat-grid-tile>
<mat-grid-tile colspan="2">
<typography variant="subheader" class="right" [content]="run.locationName" />
<typography
variant="subheader"
class="right"
[content]="run.locationName"
/>
</mat-grid-tile>
</mat-grid-list>
</div>
<div class="select-button-container">
<p-button class="run-select-button" (onClick)="selectRun(run)">Select this Run</p-button>
<p-button class="run-select-button" (onClick)="selectRun(run)"
>Select this Run</p-button
>
</div>
</ng-template>
</p-carousel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
@if (dataTypeName) {
<div>
<div>
<typography variant="large-header" [content]="dataTypeName" additionalStyles="margin: 12px 0px" />
<typography
variant="large-header"
[content]="dataTypeName"
additionalStyles="margin: 12px 0px"
/>
<typography
variant="large-secondary-header"
[content]="value + ' ' + dataTypeUnit"
Expand All @@ -13,16 +17,25 @@
</div>
</div>
} @else {
<typography variant="large-header" content="No Data Selected" additionalStyles="margin: 12px 0px" />
<typography
variant="large-header"
content="No Data Selected"
additionalStyles="margin: 12px 0px"
/>
}
</div>
<div class="right-info">
<div class="driver-info">
<typography variant="header" [content]="run?.driverName ?? 'No Driver Selected'" />
<typography
variant="header"
[content]="run?.driverName ?? 'No Driver Selected'"
/>
</div>
<div class="system-info">
<typography variant="subheader" [content]="run?.systemName ?? 'No System Selected'" />
<typography variant="subheader" [content]="run?.locationName ?? 'No Location Selected'" />
<typography
variant="subheader"
[content]="run?.locationName ?? 'No Location Selected'"
/>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions angular-client/src/utils/types.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export interface NodeWithVisibilityToggle extends Node {
dataTypesAreVisible: boolean;
}

export interface NodeWithVisibilityToggleObservable extends NodeWithVisibilityToggle {
export interface NodeWithVisibilityToggleObservable
extends NodeWithVisibilityToggle {
dataTypesObservable: Observable<DataType[]>;
}

Expand All @@ -34,7 +35,6 @@ export type Run = {
id: number;
locationName: string;
driverName: string;
systemName: string;
time: Date;
};

Expand Down
6 changes: 5 additions & 1 deletion scylla-server/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ diesel::table! {
diesel::joinable!(data -> dataType (dataTypeName));
diesel::joinable!(data -> run (runId));

diesel::allow_tables_to_appear_in_same_query!(data, dataType, run,);
diesel::allow_tables_to_appear_in_same_query!(
data,
dataType,
run,
);
3 changes: 0 additions & 3 deletions scylla-server/src/transformers/run_transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ pub struct PublicRun {
pub location_name: String,
#[serde(rename = "driverName")]
pub driver_name: String,
#[serde(rename = "systemName")]
pub system_name: String,
#[serde(rename = "time")]
pub time_ms: i64,
}
Expand All @@ -20,7 +18,6 @@ impl From<crate::models::Run> for PublicRun {
id: value.id,
location_name: value.locationName.unwrap_or_default(),
driver_name: value.driverName.clone().unwrap_or_default(),
system_name: value.driverName.unwrap_or_default(), // TODO no system name
time_ms: value.time.timestamp_millis(),
}
}
Expand Down

0 comments on commit 62db09b

Please sign in to comment.