Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
</div>
} @else {
<div class="w-full">
@if (summaryMetrics()?.reportYearmonth) {
<div class="flex align-items-center gap-2 text-sm text-color-secondary mb-3 pt-3">
<span class="font-semibold">{{ 'adminInstitutions.summary.lastUpdated' | translate }}:</span>
<span class="text-color font-medium">{{ summaryMetrics()!.reportYearmonth + '-01' | date: 'MMMM d, y' }}</span>
</div>
}

<div class="flex flex-wrap mt-4 gap-3 md:gap-4">
@for (item of statisticsData; track $index) {
<osf-statistic-card class="width-25" [label]="item.label | translate" [value]="item.value" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createDispatchMap, select } from '@ngxs/store';

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

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

Expand All @@ -23,7 +24,14 @@ import {

@Component({
selector: 'osf-institutions-summary',
imports: [StatisticCardComponent, LoadingSpinnerComponent, DoughnutChartComponent, BarChartComponent, TranslatePipe],
imports: [
StatisticCardComponent,
LoadingSpinnerComponent,
DoughnutChartComponent,
BarChartComponent,
TranslatePipe,
DatePipe,
],
templateUrl: './institutions-summary.component.html',
styleUrl: './institutions-summary.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,14 @@ export class PreprintStepperState {

ctx.setState(patch({ preprintFile: patch({ isLoading: true }) }));

return this.fileService
.updateFileContent(action.file, uploadedFile.links.upload)
.pipe(switchMap(() => this.fileService.renameEntry(uploadedFile.links.upload, action.file.name, 'replace')));
return this.fileService.updateFileContent(action.file, uploadedFile.links.upload).pipe(
switchMap(() => {
if (uploadedFile.name !== action.file.name) {
return this.fileService.renameEntry(uploadedFile.links.upload, action.file.name, 'replace');
}
return EMPTY;
})
);
}

@Action(FetchPreprintPrimaryFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ describe('ProjectOverviewToolbarComponent', () => {
expect(component.ResourceType).toBe(ResourceType);
});

it('should have resourceType set to Registration', () => {
expect(component.resourceType).toBe(ResourceType.Registration);
it('should have resourceType set to Project', () => {
expect(component.resourceType).toBe(ResourceType.Project);
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class ProjectOverviewToolbarComponent {

isPublic = signal(false);
isBookmarked = signal(false);
resourceType = ResourceType.Registration;
resourceType = ResourceType.Project;

bookmarksCollectionId = select(BookmarksSelectors.getBookmarksCollectionId);
bookmarks = select(BookmarksSelectors.getBookmarks);
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2836,6 +2836,7 @@
},
"summary": {
"title": "Summary",
"lastUpdated": "Last Updated",
"totalUsersByDepartment": "Total Users by Department",
"publicPrivateProjects": "Public vs Private Projects",
"publicEmbargoedRegistrations": "Public vs Embargoed Registrations",
Expand Down