Skip to content

Commit aa3382c

Browse files
Vlad0n20claude
andcommitted
fix(admin-institutions): remove report-date pipe and use primeflex classes
- Replace custom ReportDatePipe with Angular's DatePipe - Remove custom SCSS styles in institutions-summary component - Use PrimeFlex utility classes for styling - Delete report-date.pipe.ts and its test file 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 0cab0b1 commit aa3382c

File tree

5 files changed

+13
-152
lines changed

5 files changed

+13
-152
lines changed

src/app/features/admin-institutions/pages/institutions-summary/institutions-summary.component.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
} @else {
66
<div class="w-full">
77
@if (summaryMetrics()?.reportYearmonth) {
8-
<div class="last-updated-section mb-3">
9-
<span class="last-updated-label">{{ 'adminInstitutions.summary.lastUpdated' | translate }}:</span>
10-
<span class="last-updated-date">{{ summaryMetrics()!.reportYearmonth | reportDate }}</span>
8+
<div class="flex align-items-center gap-2 text-sm text-color-secondary mb-3 pt-3">
9+
<span class="font-semibold">{{ 'adminInstitutions.summary.lastUpdated' | translate }}:</span>
10+
<span class="text-color font-medium">{{ summaryMetrics()!.reportYearmonth + '-01' | date: 'MMMM d, y' }}</span>
1111
</div>
1212
}
1313

1414
<div class="flex flex-wrap mt-4 gap-3 md:gap-4">
1515
@for (item of statisticsData; track $index) {
16-
<osf-statistic-card class="width-25" [label]="item.label | translate" [value]="item.value" />
16+
<osf-statistic-card class="w-full sm:w-6 lg:flex-1" [label]="item.label | translate" [value]="item.value" />
1717
}
1818
</div>
1919

2020
<div class="flex flex-wrap mt-4 gap-3 md:gap-4">
2121
@if (departmentLabels().length > 0) {
22-
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 width-33">
22+
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 w-full md:w-6 lg:flex-1">
2323
<osf-doughnut-chart
2424
[isLoading]="departmentsLoading()"
2525
[datasets]="departmentDataset()"
@@ -31,7 +31,7 @@
3131
}
3232

3333
@if (projectsLabels().length > 0) {
34-
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 width-33">
34+
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 w-full md:w-6 lg:flex-1">
3535
<osf-doughnut-chart
3636
[isLoading]="summaryMetricsLoading()"
3737
[datasets]="projectDataset()"
@@ -43,7 +43,7 @@
4343
}
4444

4545
@if (registrationsLabels().length > 0) {
46-
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 width-33">
46+
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 w-full md:w-6 lg:flex-1">
4747
<osf-doughnut-chart
4848
[isLoading]="summaryMetricsLoading()"
4949
[datasets]="registrationsDataset()"
@@ -55,7 +55,7 @@
5555
}
5656

5757
@if (osfProjectsLabels().length > 0) {
58-
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 width-33">
58+
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 w-full md:w-6 lg:flex-1">
5959
<osf-doughnut-chart
6060
[isLoading]="summaryMetricsLoading()"
6161
[datasets]="osfProjectsDataset()"
@@ -67,7 +67,7 @@
6767
}
6868

6969
@if (licenceLabels().length > 0) {
70-
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 width-33">
70+
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 w-full md:w-6 lg:flex-1">
7171
<osf-bar-chart
7272
[isLoading]="rightsLoading()"
7373
[datasets]="licenceDataset()"
@@ -81,7 +81,7 @@
8181
}
8282

8383
@if (addonLabels().length > 0) {
84-
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 width-33">
84+
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 w-full md:w-6 lg:flex-1">
8585
<osf-bar-chart
8686
[isLoading]="storageRegionSearchLoading()"
8787
[datasets]="addonDataset()"
@@ -95,7 +95,7 @@
9595
}
9696

9797
@if (storageLabels().length > 0) {
98-
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 width-33">
98+
<div class="grey-border-color border-round-lg border-1 p-3 md:p-4 w-full md:w-6 lg:flex-1">
9999
<osf-doughnut-chart
100100
[isLoading]="storageRegionSearchLoading()"
101101
[datasets]="storageDataset()"
Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,5 @@
1-
@use "styles/variables" as var;
2-
31
:host {
42
display: flex;
53
flex-direction: column;
64
flex: 1;
75
}
8-
9-
.width-25 {
10-
width: calc(25% - 1.5rem);
11-
12-
@media (max-width: var.$breakpoint-sm) {
13-
width: calc(50% - 0.5rem);
14-
}
15-
}
16-
17-
.width-33 {
18-
width: calc(33% - 1rem);
19-
20-
@media (max-width: var.$breakpoint-lg) {
21-
width: calc(50% - 1rem);
22-
}
23-
24-
@media (max-width: var.$breakpoint-sm) {
25-
width: 100%;
26-
}
27-
}
28-
29-
.last-updated-section {
30-
display: flex;
31-
align-items: center;
32-
gap: 0.5rem;
33-
font-size: 0.875rem; // 14px
34-
color: var(--text-color-secondary);
35-
padding: 0.75rem 0;
36-
37-
.last-updated-label {
38-
font-weight: 600;
39-
}
40-
41-
.last-updated-date {
42-
color: var(--text-color);
43-
font-weight: 500;
44-
}
45-
}

src/app/features/admin-institutions/pages/institutions-summary/institutions-summary.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createDispatchMap, select } from '@ngxs/store';
22

33
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
44

5+
import { DatePipe } from '@angular/common';
56
import { ChangeDetectionStrategy, Component, effect, inject, OnInit, signal } from '@angular/core';
67
import { ActivatedRoute } from '@angular/router';
78

@@ -10,7 +11,6 @@ import { LoadingSpinnerComponent } from '@osf/shared/components/loading-spinner/
1011
import { StatisticCardComponent } from '@osf/shared/components/statistic-card/statistic-card.component';
1112
import { DatasetInput } from '@osf/shared/models/charts/dataset-input';
1213
import { SelectOption } from '@osf/shared/models/select-option.model';
13-
import { ReportDatePipe } from '@osf/shared/pipes/report-date.pipe';
1414
import { DoughnutChartComponent } from '@shared/components/doughnut-chart/doughnut-chart.component';
1515

1616
import {
@@ -30,7 +30,7 @@ import {
3030
DoughnutChartComponent,
3131
BarChartComponent,
3232
TranslatePipe,
33-
ReportDatePipe,
33+
DatePipe,
3434
],
3535
templateUrl: './institutions-summary.component.html',
3636
styleUrl: './institutions-summary.component.scss',

src/app/shared/pipes/report-date.pipe.spec.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/app/shared/pipes/report-date.pipe.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)