Skip to content

Commit

Permalink
manager: smoother dashboard headers (fixes #8243) (#8245)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
jessewashburn and dogi authored Feb 18, 2025
1 parent 030234b commit 450464f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "planet",
"license": "AGPL-3.0",
"version": "0.17.20",
"version": "0.17.21",
"myplanet": {
"latest": "v0.23.14",
"min": "v0.22.14"
Expand Down
8 changes: 5 additions & 3 deletions src/app/manager-dashboard/manager-dashboard.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ <h3 i18n *ngIf="showParentList">{{ planetType === 'community' ? 'Nation' : 'Cent
</ng-template>
</p>
</div>
<mat-grid-list cols="4" rowHeight="2rem">
<mat-grid-tile i18n>Last Upgrade</mat-grid-tile><mat-grid-tile i18n>Last Sync</mat-grid-tile>
<mat-grid-tile i18n>Resource Views Last 30 Days</mat-grid-tile><mat-grid-tile i18n>Total Ratings Last 30 Days</mat-grid-tile>
<mat-grid-list cols="4" [rowHeight]="gridRowHeight">
<mat-grid-tile i18n><b>Last Upgrade</b></mat-grid-tile>
<mat-grid-tile i18n><b>Last Sync</b></mat-grid-tile>
<mat-grid-tile i18n><b>Resource Views Last 30 Days</b></mat-grid-tile>
<mat-grid-tile i18n><b>Total Ratings Last 30 Days</b></mat-grid-tile>
<mat-grid-tile>{{activityLogs?.lastUpgrade?.max.time | date: 'medium'}}</mat-grid-tile>
<mat-grid-tile>{{activityLogs?.lastSync?.max.time | date: 'medium'}}</mat-grid-tile>
<mat-grid-tile>{{activityLogs?.resourceVisits}}</mat-grid-tile>
Expand Down
14 changes: 12 additions & 2 deletions src/app/manager-dashboard/manager-dashboard.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit, isDevMode, OnDestroy } from '@angular/core';
import { Component, OnInit, isDevMode, OnDestroy, HostListener } from '@angular/core';
import { UserService } from '../shared/user.service';
import { CouchService } from '../shared/couchdb.service';
import { findDocuments } from '../shared/mangoQueries';
Expand All @@ -16,6 +16,7 @@ import { CoursesService } from '../courses/courses.service';
import { ConfigurationService } from '../configuration/configuration.service';
import { ManagerService } from './manager.service';
import { StateService } from '../shared/state.service';
import { DeviceInfoService, DeviceType } from '../shared/device-info.service';

@Component({
templateUrl: './manager-dashboard.component.html',
Expand Down Expand Up @@ -71,6 +72,8 @@ export class ManagerDashboardComponent implements OnInit, OnDestroy {
isHub = false;
streaming: boolean;
overlayOpen = false;
isMobile: boolean;
gridRowHeight: string = '2rem';

constructor(
private userService: UserService,
Expand All @@ -82,7 +85,8 @@ export class ManagerDashboardComponent implements OnInit, OnDestroy {
private dialog: MatDialog,
private configurationService: ConfigurationService,
private stateService: StateService,
private managerService: ManagerService
private managerService: ManagerService,
private deviceInfoService: DeviceInfoService
) {}

ngOnInit() {
Expand Down Expand Up @@ -317,4 +321,10 @@ export class ManagerDashboardComponent implements OnInit, OnDestroy {
);
}

@HostListener('window:resize')
onResize() {
this.isMobile = this.deviceInfoService.getDeviceType() === DeviceType.MOBILE;
this.gridRowHeight = this.isMobile ? '3.6rem' : '2rem';
}

}

0 comments on commit 450464f

Please sign in to comment.