Skip to content

Commit

Permalink
refactor(sensors): Smaller widths charts adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipLeitner committed Jun 10, 2024
1 parent cd316f2 commit 22fd160
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ <h4 class="modal-title">
<button type="button" class="btn-close" (click)="close()" data-dismiss="modal"
[attr.aria-label]="'COMMON.close' | translateHs "></button>
</div>
<div class="modal-body" style="max-height: 300px; overflow-y: auto">
<div class="modal-body py-0" style="max-height: 300px; overflow-y: auto">
<div class="container-fluid">
<div class="row">
<div class="col-12 position-relative">
@if(hsSensorsUnitDialogService.loading | async ){
<div style="z-index: 10;background: white;font-size: 1.5rem;"
<div style="z-index: 10;background: white;font-size: 1.5rem; width:calc(100% - 1rem)"
class="fadein align-items-center d-flex flex-column-reverse h-100 justify-content-center position-absolute w-100">
<span class="ms-2 hs-loader hs-loader-dark"></span>
</div>
}
<div class="hs-chartplace" style="min-width: 400px; min-height: 50px; max-width: 65vw;">
<div class="hs-chartplace" style="min-height: 50px; max-width: 65vw;">
</div>
</div>
</div>
Expand Down Expand Up @@ -50,7 +50,7 @@ <h4 class="modal-title">
<div class="m-1 d-flex align-items-center">
<div class="btn-group" role="group">
<!-- TODO: Remove function call from template -->
<button type="button" class="btn btn-"
<button type="button" class="btn btn-sm"
[ngClass]="{'btn-primary': getCurrentInterval() === interval}"
(click)="timeButtonClicked(interval)" *ngFor="let interval of getIntervals()"
[attr.aria-label]="'SENSORS.oneHour' | translateHs ">
Expand All @@ -65,7 +65,7 @@ <h4 class="modal-title">
<input type="text" style="width: 6em;" ngbDatepicker
[placeholder]="'COMMON.from' | translateHs" #d="ngbDatepicker"
[(ngModel)]="customInterval.fromTime" (dateSelect)="customIntervalChanged()" />
<button class="btn btn-outline-secondary" (click)="d.toggle()" type="button"><i
<button class="btn btn-sm btn-outline-secondary" (click)="d.toggle()" type="button"><i
class="icon-calendarthree"></i></button>
</div>
</div>
Expand All @@ -74,7 +74,7 @@ <h4 class="modal-title">
<input type="text" style="width: 6em;" ngbDatepicker
[placeholder]="'COMMON.until' | translateHs" #d2="ngbDatepicker"
[(ngModel)]="customInterval.toTime" (dateSelect)="customIntervalChanged()" />
<button class="btn btn-outline-secondary" (click)="d2.toggle()" type="button"><i
<button class="btn btn-sm btn-outline-secondary" (click)="d2.toggle()" type="button"><i
class="icon-calendarthree"></i></button>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {HsUtilsService} from 'hslayers-ng/services/utils';

import {Aggregate} from './types/aggregate.type';
import {CustomInterval, Interval} from './types/interval.type';
import {HsLayoutService} from 'hslayers-ng/services/layout';
import {HsSensorUnit} from './sensor-unit.class';
import {SensLogEndpoint} from './types/senslog-endpoint.type';
import {SenslogSensor} from './types/senslog-sensor.type';
Expand Down Expand Up @@ -70,6 +71,7 @@ export class HsSensorsUnitDialogService {
private hsUtilsService: HsUtilsService,
private hsLogService: HsLogService,
private hsLanguageService: HsLanguageService,
private hsLayoutService: HsLayoutService,
) {
this.currentInterval = this.intervals[2];
this.useTimeZone.subscribe((value) => {
Expand Down Expand Up @@ -351,6 +353,12 @@ export class HsSensorsUnitDialogService {
? sensorDesc[0]?.unit_description
: this.hsLanguageService.getTranslation('SENSORS.sensors'),
'labelExpr': "split(datum.value, '_')[0]",
'orient': this.hsLayoutService.layoutElement.classList.contains(
'hs-mobile-view',
)
? 'bottom'
: 'right',
'direction': 'vertical',
},
'type': 'nominal',
'sort': 'sensor_id',
Expand Down

0 comments on commit 22fd160

Please sign in to comment.