Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
58f2060
fix(metadata-step): Made Publication DOI field optional
rrromchIk Sep 8, 2025
c5fdf2e
fix(preprints-landing): Contact Us button titlecased, Show example bu…
rrromchIk Sep 8, 2025
a78ae94
fix(create-new-version): Handled back button
rrromchIk Sep 8, 2025
841f490
fix(preprint-moderation): Fixed sorting for submissions
rrromchIk Sep 8, 2025
a9d43ff
fix(license-component): Clearing all fields on cancel button click
rrromchIk Sep 8, 2025
73d231f
Merge branch 'main' into fix/preprints-bugs
rrromchIk Sep 8, 2025
30d7c69
Merge branch 'main' into fix/preprints-bugs
rrromchIk Sep 9, 2025
aceedbb
fix(preprint-stepper): Fixed add-project-form
rrromchIk Sep 9, 2025
684a183
Merge branch 'refs/heads/main' into fix/preprints-bugs
rrromchIk Sep 11, 2025
3a57685
fix(preprint-title): Increased title maxLength to 512 chars
rrromchIk Sep 11, 2025
08d3e3c
fix(preprint-details): Fixed date format for download prev version dr…
rrromchIk Sep 11, 2025
1428375
fix(preprint-details): Fixed created and last edited dates value
rrromchIk Sep 11, 2025
6fc3e45
fix(preprint-links): Made institution and license help guide links op…
rrromchIk Sep 11, 2025
e9cdbc2
fix(affiliated-institutions): Added tooltip containing institution name
rrromchIk Sep 11, 2025
a66b7c7
fix(file-step): Fixed label
rrromchIk Sep 11, 2025
5a18d6b
fix(affiliated-institution-select): Fixed description links
rrromchIk Sep 11, 2025
b1dcbd3
fix(preprint-contributors): Fixed contributors links
rrromchIk Sep 11, 2025
2503643
Merge branch 'main' into fix/preprints-bugs
rrromchIk Sep 11, 2025
af24348
fix(preprint-user-permissions): Only admin contributor can edit autho…
rrromchIk Sep 11, 2025
fff5a86
fix(contributors-list): Implemented permissions for managing contribu…
rrromchIk Sep 11, 2025
8c12f47
Merge branch 'main' into fix/preprints-bugs
rrromchIk Sep 12, 2025
4045d77
fix(search): Fixed small bug regarding search
rrromchIk Sep 12, 2025
3c4ebd8
Merge branch 'main' into fix/preprints-bugs
rrromchIk Sep 12, 2025
fd3815e
fix(contributors): Fixed PR comments
rrromchIk Sep 12, 2025
4b6f299
fix(preprint-file-section): Fixed version number for file
rrromchIk Sep 12, 2025
b6a9578
fix(preprint-file-section): Added cancel button to reset file source …
rrromchIk Sep 12, 2025
186d6a7
fix(preprint-file-section): Added file section for edit and resubmit …
rrromchIk Sep 12, 2025
3d682f4
fix(preprint-moderation): Improved sorting order
rrromchIk Sep 12, 2025
044eb5a
Merge branch 'refs/heads/main' into fix/preprints-bugs
rrromchIk Sep 12, 2025
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 @@ -17,7 +17,6 @@ <h2>{{ 'adminInstitutions.common.filterBy' | translate }}</h2>
class="px-4"
[filterValues]="filterValues()"
[filters]="filters()"
[filterOptionsCache]="filterOptionsCache()"
(filterRemoved)="onFilterChipRemoved($event)"
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export class FiltersSectionComponent {
filters = select(GlobalSearchSelectors.getFilters);
filterValues = select(GlobalSearchSelectors.getFilterValues);
filterSearchCache = select(GlobalSearchSelectors.getFilterSearchCache);
filterOptionsCache = select(GlobalSearchSelectors.getFilterOptionsCache);
areResourcesLoading = select(GlobalSearchSelectors.getResourcesLoading);

onFilterChanged(event: { filterType: string; value: StringOrNull }): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export const PREPRINT_SORT_OPTIONS: CustomOption<string>[] = [
},
{
value: PreprintSubmissionsSort.Newest,
label: 'moderation.sortOption.oldest',
label: 'moderation.sortOption.newest',
},
{
value: PreprintSubmissionsSort.Oldest,
label: 'moderation.sortOption.newest',
label: 'moderation.sortOption.oldest',
},
];
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export enum PreprintSubmissionsSort {
TitleAZ = 'title',
TitleZA = '-title',
Oldest = '-date_last_transitioned',
Newest = 'date_last_transitioned',
Oldest = 'date_last_transitioned',
Newest = '-date_last_transitioned',
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,18 @@ <h3>{{ 'preprints.preprintStepper.review.sections.metadata.authors' | translate
<div class="flex flex-column gap-1 line-height-2 md:flex-row">
@for (contributor of bibliographicContributors(); track contributor.id) {
<div>
<a class="font-bold"> {{ contributor.fullName }}</a>
@if (contributor.isUnregisteredContributor) {
<span>{{ contributor.fullName }}</span>
} @else {
<a
class="font-bold"
[href]="`${webUrl}/${contributor.userId}`"
target="_blank"
rel="noopener noreferrer"
>
{{ contributor.fullName }}
</a>
}
<span>{{ $last ? '' : ',' }}</span>
</div>
}
Expand All @@ -38,7 +49,6 @@ <h3>{{ 'preprints.preprintStepper.review.sections.metadata.authors' | translate
</div>
</section>

<!-- [RNi] TODO: Extract to separate component -->
@if (preprintProvider()?.assertionsEnabled) {
<section class="flex flex-column gap-2">
<h3>{{ 'preprints.preprintStepper.review.sections.authorAssertions.conflictOfInterest' | translate }}</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class GeneralInformationComponent implements OnDestroy {
fetchPreprintById: FetchPreprintById,
fetchResourceInstitutions: FetchResourceInstitutions,
});
readonly environment = environment;
readonly webUrl = environment.webUrl;

preprintProvider = input.required<PreprintProviderDetails | undefined>();
preprintVersionSelected = output<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
}

@if (file()) {
@let fileValue = file()!;
@let preprintValue = preprint()!;

<div class="flex flex-column gap-1 justify-content-start md:flex-row">
<span>{{ dateLabel() | translate }}: {{ fileValue.dateCreated | date: 'longDate' }}</span>
<span>{{ dateLabel() | translate }}: {{ preprintValue.dateCreated | date: 'longDate' }}</span>
@if (isMedium() || isLarge()) {
<span>|</span>
}
<span>
{{ 'preprints.details.file.lastEdited' | translate }} : {{ fileValue.dateModified | date: 'longDate' }}
{{ 'preprints.details.file.lastEdited' | translate }} : {{ preprintValue.dateModified | date: 'longDate' }}
</span>
</div>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class PreprintFileSectionComponent {
isMedium = toSignal(inject(IS_MEDIUM));
isLarge = toSignal(inject(IS_LARGE));

preprint = select(PreprintSelectors.getPreprint);
file = select(PreprintSelectors.getPreprintFile);
preprint$ = toObservable(select(PreprintSelectors.getPreprint));
isFileLoading = select(PreprintSelectors.isPreprintFileLoading);
Expand All @@ -58,10 +59,10 @@ export class PreprintFileSectionComponent {
const fileVersions = this.fileVersions();
if (!fileVersions.length) return [];

return fileVersions.map((version, index) => ({
return fileVersions.map((version) => ({
label: this.translateService.instant('preprints.details.file.downloadVersion', {
version: ++index,
date: this.datePipe.transform(version.dateCreated, 'mm/dd/yyyy hh:mm:ss'),
version: version.id,
date: this.datePipe.transform(version.dateCreated, 'MM/dd/yyyy hh:mm:ss'),
}),
url: version.downloadLink,
command: () => this.logDownload(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ <h3>{{ 'preprints.preprintStepper.common.labels.abstract' | translate }}</h3>
<section class="license flex flex-column gap-2">
<h3>{{ 'preprints.preprintStepper.review.sections.metadata.license' | translate }}</h3>

<!-- [RNi] TODO: Extract to separate component -->
<p-accordion>
<p-accordion-panel value="0">
<p-accordion-header class="p-0 justify-content-start gap-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,43 @@ <h2>{{ 'preprints.preprintStepper.file.title' | translate }}</h2>
<p class="line-height-3">{{ 'preprints.preprintStepper.file.note' | translate }}</p>
</section>

<section class="mt-4 w-full flex flex-column gap-2 md:flex-row">
<p-button
[ngClass]="{
active: selectedFileSource() === PreprintFileSource.Computer,
}"
class="file-source-button w-full"
[styleClass]="selectedFileSource() ? 'w-full cursor-not-allowed' : 'w-full'"
[label]="'preprints.preprintStepper.file.uploadFromComputer' | translate | titlecase"
severity="secondary"
[disabled]="isFileSourceSelected()"
[pTooltip]="'preprints.preprintStepper.file.tooltips.computerDisabled' | translate"
tooltipPosition="top"
(onClick)="selectFileSource(PreprintFileSource.Computer)"
/>
<p-button
[ngClass]="{
active: selectedFileSource() === PreprintFileSource.Project,
}"
class="file-source-button w-full"
[styleClass]="isFileSourceSelected() ? 'w-full cursor-not-allowed' : 'w-full'"
[label]="'preprints.preprintStepper.file.selectFromProject' | translate | titlecase"
severity="secondary"
[disabled]="isFileSourceSelected() || versionFileMode()"
[pTooltip]="'preprints.preprintStepper.file.tooltips.projectDisabled' | translate"
tooltipPosition="top"
(onClick)="selectFileSource(PreprintFileSource.Project)"
/>
</section>
@if (!preprintHasPrimaryFile() || versionFileMode()) {
<section class="mt-4 w-full flex flex-column gap-2 md:flex-row">
<p-button
[ngClass]="{
active: selectedFileSource() === PreprintFileSource.Computer,
}"
class="file-source-button w-full"
[styleClass]="selectedFileSource() ? 'w-full cursor-not-allowed' : 'w-full'"
[label]="'preprints.preprintStepper.file.uploadFromComputer' | translate | titlecase"
severity="secondary"
[disabled]="isFileSourceSelected()"
[pTooltip]="'preprints.preprintStepper.file.tooltips.computerDisabled' | translate"
tooltipPosition="top"
(onClick)="selectFileSource(PreprintFileSource.Computer)"
/>
<p-button
data-test-select-button
[ngClass]="{
active: selectedFileSource() === PreprintFileSource.Project,
}"
class="file-source-button w-full"
[styleClass]="isFileSourceSelected() ? 'w-full cursor-not-allowed' : 'w-full'"
[label]="'preprints.preprintStepper.file.selectFromProject' | translate"
severity="secondary"
[disabled]="isFileSourceSelected() || versionFileMode()"
[pTooltip]="'preprints.preprintStepper.file.tooltips.projectDisabled' | translate"
tooltipPosition="top"
(onClick)="selectFileSource(PreprintFileSource.Project)"
/>
</section>
}

@if (selectedFileSource() === PreprintFileSource.Computer) {
<section class="mt-6">
@if (!fileUploadLink()) {
<p-skeleton width="5rem" height="2rem" />
} @else if ((!preprintFiles().length && !arePreprintFilesLoading()) || versionFileMode()) {
} @else if ((!preprintFile() && !isPreprintFileLoading()) || versionFileMode()) {
<p-button
outlined
raised
Expand All @@ -58,7 +61,7 @@ <h2>{{ 'preprints.preprintStepper.file.title' | translate }}</h2>
</section>
}

@if (selectedFileSource() === PreprintFileSource.Project && !preprintFiles().length && !arePreprintFilesLoading()) {
@if (selectedFileSource() === PreprintFileSource.Project && !preprintFile() && !isPreprintFileLoading()) {
<p-card styleClass="mt-6" class="card">
<div>
<p class="line-height-3">{{ 'preprints.preprintStepper.file.projectSelection.description' | translate }}</p>
Expand Down Expand Up @@ -99,28 +102,39 @@ <h2>{{ 'preprints.preprintStepper.file.title' | translate }}</h2>
}
</section>
}

@if (cancelSourceOptionButtonVisible()) {
<div class="mt-3 flex flex-row justify-content-end">
<p-button
class="md:w-6rem"
styleClass="w-full"
[label]="'common.buttons.cancel' | translate"
severity="info"
(onClick)="cancelButtonClicked()"
/>
</div>
}

@if (!versionFileMode()) {
<section class="mt-6">
@if (arePreprintFilesLoading()) {
@if (isPreprintFileLoading()) {
<p-skeleton height="2rem" class="w-full" />
} @else {
@for (file of preprintFiles(); track file.id) {
<section class="file-row">
<div class="flex flex-row gap-2">
<osf-icon [iconClass]="'fas fa-file'" />
<p>{{ file.name }}</p>
</div>
} @else if (preprintFile()) {
<section class="file-row">
<div class="flex flex-row gap-2">
<osf-icon [iconClass]="'fas fa-file'" />
<p data-test-file-name>{{ preprintFile()!.name }}</p>
</div>

<p-button
class="danger-icon-btn"
icon="fas fa-trash"
severity="danger"
text
[ariaLabel]="'common.buttons.delete' | translate"
(onClick)="versionFile()"
/>
</section>
}
<p-button
class="danger-icon-btn"
icon="fas fa-trash"
severity="danger"
text
[ariaLabel]="'common.buttons.delete' | translate"
(onClick)="versionFile()"
/>
</section>
}
</section>
}
Expand All @@ -137,9 +151,9 @@ <h2>{{ 'preprints.preprintStepper.file.title' | translate }}</h2>
class="w-6 md:w-9rem"
styleClass="w-full"
[label]="'common.buttons.next' | translate"
[disabled]="!preprint()?.primaryFileId || versionFileMode()"
[disabled]="!preprintFile() || versionFileMode()"
[pTooltip]="
!preprint()?.primaryFileId || versionFileMode()
!preprintFile() || versionFileMode()
? ('preprints.preprintStepper.common.validation.fillRequiredFields' | translate)
: ''
"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
CopyFileFromProject,
FetchAvailableProjects,
FetchPreprintFilesLinks,
FetchPreprintPrimaryFile,
FetchProjectFiles,
FetchProjectFilesByLink,
PreprintStepperSelectors,
Expand Down Expand Up @@ -73,6 +74,7 @@ export class FileStepComponent implements OnInit {
getPreprintFilesLinks: FetchPreprintFilesLinks,
uploadFile: UploadFile,
reuploadFile: ReuploadFile,
fetchPreprintFile: FetchPreprintPrimaryFile,
getAvailableProjects: FetchAvailableProjects,
getFilesForSelectedProject: FetchProjectFiles,
getProjectFilesByLink: FetchProjectFilesByLink,
Expand All @@ -88,17 +90,31 @@ export class FileStepComponent implements OnInit {
providerId = select(PreprintStepperSelectors.getSelectedProviderId);
selectedFileSource = select(PreprintStepperSelectors.getSelectedFileSource);
fileUploadLink = select(PreprintStepperSelectors.getUploadLink);
preprintFiles = select(PreprintStepperSelectors.getPreprintFiles);
arePreprintFilesLoading = select(PreprintStepperSelectors.arePreprintFilesLoading);

preprintFile = select(PreprintStepperSelectors.getPreprintFile);
isPreprintFileLoading = select(PreprintStepperSelectors.isPreprintFilesLoading);

availableProjects = select(PreprintStepperSelectors.getAvailableProjects);
areAvailableProjectsLoading = select(PreprintStepperSelectors.areAvailableProjectsLoading);

projectFiles = select(PreprintStepperSelectors.getProjectFiles);
areProjectFilesLoading = select(PreprintStepperSelectors.areProjectFilesLoading);

currentFolder = select(PreprintStepperSelectors.getCurrentFolder);
selectedProjectId = signal<StringOrNull>(null);

versionFileMode = signal<boolean>(false);

preprintHasPrimaryFile = computed(() => {
return !!this.preprint()?.primaryFileId;
});

cancelSourceOptionButtonVisible = computed(() => {
return (
!this.preprintFile() && this.selectedFileSource() !== PreprintFileSource.None && !this.isPreprintFileLoading()
);
});

projectNameControl = new FormControl<StringOrNull>(null);

filesTreeActions: FilesTreeActions = {
Expand All @@ -119,7 +135,9 @@ export class FileStepComponent implements OnInit {

ngOnInit() {
this.actions.getPreprintFilesLinks();

if (this.preprintHasPrimaryFile() && !this.preprintFile()) {
this.actions.fetchPreprintFile();
}
this.projectNameControl.valueChanges
.pipe(debounceTime(500), distinctUntilChanged(), takeUntilDestroyed(this.destroyRef))
.subscribe((projectNameOrId) => {
Expand Down Expand Up @@ -159,9 +177,17 @@ export class FileStepComponent implements OnInit {

if (this.versionFileMode()) {
this.versionFileMode.set(false);
this.actions.reuploadFile(file);
this.actions.reuploadFile(file).subscribe({
next: () => {
this.actions.fetchPreprintFile();
},
});
} else {
this.actions.uploadFile(file);
this.actions.uploadFile(file).subscribe({
next: () => {
this.actions.fetchPreprintFile();
},
});
}
}

Expand All @@ -175,7 +201,11 @@ export class FileStepComponent implements OnInit {
}

selectProjectFile(file: OsfFile) {
this.actions.copyFileFromProject(file);
this.actions.copyFileFromProject(file).subscribe({
next: () => {
this.actions.fetchPreprintFile();
},
});
}

versionFile() {
Expand All @@ -189,4 +219,12 @@ export class FileStepComponent implements OnInit {
onReject: () => null,
});
}

cancelButtonClicked() {
if (this.preprintFile()) {
return;
}

this.actions.setSelectedFileSource(PreprintFileSource.None);
}
}
Loading
Loading