From bcb114919158d5597aea1a4319ed4b5ff3857fa5 Mon Sep 17 00:00:00 2001 From: Lars Saalbach Date: Sun, 1 Sep 2024 23:33:05 +0200 Subject: [PATCH] #785 - Make it possible to slide cards to show graph --- src/app/app.scss | 27 +- .../brew-information.component.html | 407 +++++++++--------- .../brew-information.component.scss | 10 + .../brew-information.component.ts | 38 ++ .../graph-display-card.component.ts | 6 +- .../photo-add/photo-add.component.html | 2 +- .../photo-view/photo-view.component.html | 2 +- .../photo-popover.component.html | 2 +- .../update-popover.component.html | 2 +- .../welcome-popover.component.html | 2 +- 10 files changed, 283 insertions(+), 215 deletions(-) diff --git a/src/app/app.scss b/src/app/app.scss index a2c6f01c5..e760198ff 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -944,24 +944,27 @@ swiper-container { --swiper-scrollbar-drag-bg-color: rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.5); } -swiper-slide { - display: flex; - position: relative; +swiper-container.swiper { + swiper-slide { + display: flex; + position: relative; - flex-direction: column; - flex-shrink: 0; - align-items: center; - justify-content: center; + flex-direction: column; + flex-shrink: 0; + align-items: center; + justify-content: center; - width: 100%; - height: 100%; + width: 100%; + height: 100%; - font-size: 18px; + font-size: 18px; - text-align: center; - box-sizing: border-box; + text-align: center; + box-sizing: border-box; + } } + swiper-slide img { width: auto; max-width: 100%; diff --git a/src/components/brew-information/brew-information.component.html b/src/components/brew-information/brew-information.component.html index 7d174be66..f4869a3e1 100644 --- a/src/components/brew-information/brew-information.component.html +++ b/src/components/brew-information/brew-information.component.html @@ -1,247 +1,260 @@ -
- - - - - - - - -
- -
-
- -
- -
-
- - - - - - - - - {{ brew.config.unix_timestamp | formatDate:[settings?.date_format] }}{{ brew.config.unix_timestamp | formatDate:["HH:mm"] }} - - - - - - - - - -
- - () - - {{ bean?.name }} ({{ bean?.roaster }}) -
-
- + + + + + + + + + + +
+ +
+
+ +
+ +
+
+ + + + + + + + + {{ brew.config.unix_timestamp | formatDate:[settings?.date_format] }}{{ brew.config.unix_timestamp | formatDate:["HH:mm"] }} + + + + + + + + + +
+ + () + + {{ bean?.name }} ({{ bean?.roaster }}) +
+
+ - - - - + + + + - {{ this.uiHelper.toFixedIfNecessary(brew.rating, 2) }} - -
-
-
-
-
- - -
-
-
-
- - - + {{ this.uiHelper.toFixedIfNecessary(brew.rating, 2) }} + + + +
+
+
+ + +
+
+
+
+ + + - {{ "BREW_DATA_PREPARATION_METHOD" | translate }} -
- {{ preparation?.name }} -
- {{ "BREW_DATA_PREPARATION_METHOD" | translate }} +
+ {{ preparation?.name }} +
+ - {{ "BREW_DATA_MILL" |translate }} -
- {{ mill?.name }} -
- - {{ "BREW_DATA_IN_OUT_BR" | translate }} -
- - {{ brew?.grind_weight | number : '.0-2' }}gr - / {{ brew.brew_quantity | number : '.0-2' }}{{ brewQuantityEnum[brew?.brew_quantity_type] }} ({{ brew?.getBrewRatio() }} - ) - - - {{ brew?.grind_weight | number : '.0-2' }}gr - / {{ brew.brew_beverage_quantity | number : '.0-2' }}{{ brewQuantityEnum[brew?.brew_beverage_quantity_type] }} ({{ brew?.getBrewRatio() }} - ) - -
- {{ "BREW_DATA_MILL" |translate }} +
+ {{ mill?.name }} +
+ + {{ "BREW_DATA_IN_OUT_BR" | translate }} +
+ + {{ brew?.grind_weight | number : '.0-2' }}gr + / {{ brew.brew_quantity | number : '.0-2' }}{{ brewQuantityEnum[brew?.brew_quantity_type] }} ({{ brew?.getBrewRatio() }} + ) + + + {{ brew?.grind_weight | number : '.0-2' }}gr + / {{ brew.brew_beverage_quantity | number : '.0-2' }}{{ brewQuantityEnum[brew?.brew_beverage_quantity_type] }} ({{ brew?.getBrewRatio() }} + ) + +
+ - {{ 'BREW_DATA_TIME' | translate }} -
- {{ brew?.getFormattedTotalCoffeeBrewTime() }} -
- 0 && uiBrewHelper.fieldVisible(settings.visible_list_view_parameters.mill_speed, preparation?.visible_list_view_parameters.mill_speed, preparation?.use_custom_parameters))" size='6'> - {{ 'BREW_DATA_GRIND_SIZE' | translate }} -
- {{ brew?.grind_size }} @ {{ brew?.mill_speed }} -
- - {{ 'BREW_DATA_TDS_EY' | translate }} -
- {{ brew?.tds }}, %{{ brew?.getExtractionYield() }} -
- 0 && brew?.brew_beverage_quantity>0' size='6'> + {{ 'BREW_DATA_TDS_EY' | translate }} +
+ {{ brew?.tds }}, %{{ brew?.getExtractionYield() }} +
+ - {{ 'BREW_DATA_BREW_TEMPERATURE' | translate }} -
- {{ brew?.brew_temperature }} -
- - {{ 'BREW_DATA_PRESSURE_PROFILE' | translate }} -
- {{ brew?.pressure_profile }} -
- {{ 'BREW_DATA_PRESSURE_PROFILE' | translate }} +
+ {{ brew?.pressure_profile }} +
+ - {{ "BREW_DATA_BEAN_WEIGHT_IN" | translate }} -
- {{ brew?.bean_weight_in }} -
- {{ "BREW_DATA_BEAN_WEIGHT_IN" | translate }} +
+ {{ brew?.bean_weight_in }} +
+ - {{ "BREW_DATA_MILL_TIMER" | translate }} -
- {{ brew?.mill_timer }} -
- +
+ {{ brew?.mill_timer }} +
+ - {{ "BREW_DATA_VESSEL_NAME_WEIGHT" | translate }} -
- {{ brew?.vessel_name }} / {{ brew?.vessel_weight }} -
- {{ "BREW_DATA_VESSEL_NAME_WEIGHT" | translate }} +
+ {{ brew?.vessel_name }} / {{ brew?.vessel_weight }} +
+ - {{ "BREW_DATA_TEMPERATURE_TIME" | translate }} -
- {{ brew?.getFormattedTotalCoffeeTemperatureTime() }} -
- {{ "BREW_DATA_TEMPERATURE_TIME" | translate }} +
+ {{ brew?.getFormattedTotalCoffeeTemperatureTime() }} +
+ - {{ "BREW_DATA_COFFEE_BLOOMING_TIME" | translate }} -
- {{ brew?.getFormattedTotalCoffeeBloomingTime() }} -
- {{ "BREW_DATA_COFFEE_BLOOMING_TIME" | translate }} +
+ {{ brew?.getFormattedTotalCoffeeBloomingTime() }} +
+ - {{ "BREW_DATA_COFFEE_FIRST_DRIP_TIME" | translate }} -
- {{ brew?.getFormattedTotalCoffeeFirstDripTime() }} -
- +
+ {{ brew?.getFormattedTotalCoffeeFirstDripTime() }} +
+ - {{ "BREW_DATA_WATER" | translate }} -
- {{ brew?.getWater().name }} -
- +
+ {{ brew?.getWater().name }} +
+ - {{ "BREW_DATA_COFFEE_TYPE" | translate }} -
- {{ brew?.coffee_type }} -
- +
+ {{ brew?.coffee_type }} +
+ - {{ "BREW_DATA_COFFEE_CONCENTRATION" | translate }} -
- {{ brew?.coffee_concentration }} -
- {{ "BREW_DATA_COFFEE_CONCENTRATION" | translate }} +
+ {{ brew?.coffee_concentration }} +
+ - {{ "BREW_INFORMATION_BEAN_AGE" | translate }} -
- {{ brew?.getCalculatedBeanAge() }} -
- {{ "BREW_INFORMATION_BEAN_AGE" | translate }} +
+ {{ brew?.getCalculatedBeanAge() }} +
+ - {{ "BREW_DATA_PREPARATION_METHOD_TOOL" | translate }} -
- {{ brew?.getPreparationToolName(uuid) }} - -
-
- - {{ 'BREW_DATA_FLAVOR' | translate }} -
- {{ getCuppedBrewFlavors() }} -
- +
+ {{ brew?.getPreparationToolName(uuid) }} + +
+
+ + {{ 'BREW_DATA_FLAVOR' | translate }} +
+ {{ getCuppedBrewFlavors() }} +
+ - {{ "BREW_DATA_NOTES" | translate }} -
- -
{{ brew?.note }}
-
-
+ {{ "BREW_DATA_NOTES" | translate }} +
+ +
{{ brew?.note }}
+
+
+ +
+
+
+
+ + + + + + + + + + - - - -
{ event.stopPropagation(); event.stopImmediatePropagation(); diff --git a/src/components/graph-display-card/graph-display-card.component.ts b/src/components/graph-display-card/graph-display-card.component.ts index 4fd0b40e8..4334b6239 100644 --- a/src/components/graph-display-card/graph-display-card.component.ts +++ b/src/components/graph-display-card/graph-display-card.component.ts @@ -31,6 +31,7 @@ export class GraphDisplayCardComponent implements OnInit { @Input() public meticulousHistoryData: HistoryListingEntry; @Input() public chartWidth: number; + @Input() public chartHeight: number; public flow_profile_raw: BrewFlow = new BrewFlow(); @@ -97,7 +98,10 @@ export class GraphDisplayCardComponent implements OnInit { chartWidth = this.chartWidth; } - const chartHeight: number = 150; + let chartHeight: number = 150; + if (this.chartHeight) { + chartHeight = this.chartHeight; + } let tickFormat = '%S'; diff --git a/src/components/photo-add/photo-add.component.html b/src/components/photo-add/photo-add.component.html index c2975a83e..099304c2e 100644 --- a/src/components/photo-add/photo-add.component.html +++ b/src/components/photo-add/photo-add.component.html @@ -2,7 +2,7 @@  {{"ADD_PHOTO" | translate}}
- + diff --git a/src/components/photo-view/photo-view.component.html b/src/components/photo-view/photo-view.component.html index eec878722..9b25041d7 100644 --- a/src/components/photo-view/photo-view.component.html +++ b/src/components/photo-view/photo-view.component.html @@ -1,5 +1,5 @@
- + diff --git a/src/popover/photo-popover/photo-popover.component.html b/src/popover/photo-popover/photo-popover.component.html index ecb0bc64c..feb076c2d 100644 --- a/src/popover/photo-popover/photo-popover.component.html +++ b/src/popover/photo-popover/photo-popover.component.html @@ -10,7 +10,7 @@
- + diff --git a/src/popover/update-popover/update-popover.component.html b/src/popover/update-popover/update-popover.component.html index 5cb174de2..376a1bb6f 100644 --- a/src/popover/update-popover/update-popover.component.html +++ b/src/popover/update-popover/update-popover.component.html @@ -1,6 +1,6 @@ - +
diff --git a/src/popover/welcome-popover/welcome-popover.component.html b/src/popover/welcome-popover/welcome-popover.component.html index 97da5ca43..4098a24a4 100644 --- a/src/popover/welcome-popover/welcome-popover.component.html +++ b/src/popover/welcome-popover/welcome-popover.component.html @@ -30,7 +30,7 @@ - +