Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
db49641
feat(submit-preprint-state): Implemented state for submit preprint
rrromchIk Jun 13, 2025
14acced
feat(select-preprint-state): Implemented select service page with api…
rrromchIk Jun 13, 2025
6d65b1b
feat(select-preprint-service): Enhance UI with dynamic translations
rrromchIk Jun 13, 2025
4efc298
feat(select-preprint-service): Enhance UI with dynamic translations
rrromchIk Jun 13, 2025
c5d0ea5
Merge remote-tracking branch 'origin/feat/submit-preprint' into feat/…
rrromchIk Jun 16, 2025
5bb72fb
fix(preprint-provider-hero): Added skeleton for search input while pr…
rrromchIk Jun 16, 2025
0a358c7
fix(preprints-styles): Fixed styles due to merge conflicts
rrromchIk Jun 16, 2025
70046df
Merge branch 'main' into feat/submit-preprint
rrromchIk Jun 16, 2025
7a34b3c
feat(nav-menu): Added subroutes for preprints
rrromchIk Jun 16, 2025
3bfc768
fix(preprints-search-input): Changed placeholder
rrromchIk Jun 16, 2025
f90c8c7
fix(comments): Fixed comments
rrromchIk Jun 16, 2025
964f310
fix(preprints-help-dialog): Fixed url to help guide
rrromchIk Jun 16, 2025
8aef899
feat(preprints-favicon): Implemented updating browser tab favicon and…
rrromchIk Jun 16, 2025
e4281a9
Merge branch 'main' into feat/submit-preprint
rrromchIk Jun 16, 2025
dffc84c
fix(select): remove duplicate style
rrromchIk Jun 16, 2025
2c7a628
feat(stepper): Implemented shared component
rrromchIk Jun 17, 2025
3bc707a
feat(submit-preprint-stepper): Created parent component for submit co…
rrromchIk Jun 17, 2025
48caa83
feat(submit-preprint-first-step): Partly implemented first step
rrromchIk Jun 17, 2025
7c42589
feat(submit-preprint-first-step): Finished title and abstract step
rrromchIk Jun 18, 2025
e17faa7
feat(submit-preprint-file-step): Partly implemented layout
rrromchIk Jun 19, 2025
d8e9b78
Merge branch 'main' into feat/submit-preprint
rrromchIk Jun 19, 2025
13b4175
feat(submit-preprint-file-step): Implemented file upload from computer
rrromchIk Jun 19, 2025
3ca76de
feat(submit-preprint-file-step): Partly implemented select from osf p…
rrromchIk Jun 20, 2025
17a7b5e
Merge branch 'main' into feat/submit-preprint
rrromchIk Jun 20, 2025
53cca7e
refactor(files-tree): Made files-tree more reusable by passing curren…
rrromchIk Jun 20, 2025
68867da
feat(submit-preprint-file-step): Implemented project files viewing
rrromchIk Jun 20, 2025
e53edf5
Merge branch 'main' into feat/submit-preprint
rrromchIk Jun 20, 2025
7c18f45
refactor(submit-preprint-stepper): Fixed comments
rrromchIk Jun 23, 2025
077ba1c
Merge branch 'main' into feat/submit-preprint
rrromchIk Jun 26, 2025
8ef907a
feat(submit-preprint-file-step): Implemented selecting file from project
rrromchIk Jun 26, 2025
40ea22d
feat(submit-preprint-file-step): Implemented version file
rrromchIk Jun 27, 2025
6c7c09c
style(submit-preprint-stepper): Adjusted styles for responsive
rrromchIk Jun 27, 2025
5ebc169
fix(submit-preprint-stepper): Fixed fetching node's file, next/back l…
rrromchIk Jun 27, 2025
b568996
feat(submit-preprint-metadata-step): Implemented contributors section…
rrromchIk Jun 27, 2025
2bd0ca0
style(base): Removed existing file
rrromchIk Jun 27, 2025
08d1b42
Merge branch 'main' into feat/submit-preprint
rrromchIk Jun 27, 2025
9be74a6
feat(submit-preprint-metadata-step): Implemented doi, publication dat…
rrromchIk Jun 30, 2025
48160ca
Merge branch 'main' into feat/submit-preprint
rrromchIk Jun 30, 2025
cfcdc84
fix(title-and-abstract): Fixed PR comments
rrromchIk Jun 30, 2025
2409908
Merge branch 'refs/heads/main' into feat/submit-preprint
rrromchIk Jun 30, 2025
7d8852e
feat(licenses): Introduced shared component and models. Used in metad…
rrromchIk Jul 1, 2025
b75101f
feat(licenses): Updated save button label, disabling button after save
rrromchIk Jul 1, 2025
1523360
Merge branch 'main' into feat/submit-preprint
rrromchIk Jul 1, 2025
29c06bb
fix(comments): Fixed comments
rrromchIk Jul 1, 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
1 change: 0 additions & 1 deletion src/app/core/services/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { JsonApiService } from './json-api.service';
export { LicensesService } from './licenses.service';
export { RequestAccessService } from './request-access.service';
export { UserService } from './user.service';
20 changes: 0 additions & 20 deletions src/app/core/services/licenses.service.ts

This file was deleted.

4 changes: 3 additions & 1 deletion src/app/features/preprints/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export { BrowseBySubjectsComponent } from './browse-by-subjects/browse-by-subjects.component';
export { PreprintServicesComponent } from './preprint-services/preprint-services.component';
export { TitleAndAbstractStepComponent } from './submit-steps/title-and-abstract-step/title-and-abstract-step.component';
export { AdvisoryBoardComponent } from '@osf/features/preprints/components/advisory-board/advisory-board.component';
export { PreprintsCreatorsFilterComponent } from '@osf/features/preprints/components/filters/preprints-creators-filter/preprints-creators-filter.component';
export { PreprintsDateCreatedFilterComponent } from '@osf/features/preprints/components/filters/preprints-date-created-filter/preprints-date-created-filter.component';
Expand All @@ -11,3 +10,6 @@ export { PreprintsFilterChipsComponent } from '@osf/features/preprints/component
export { PreprintsHelpDialogComponent } from '@osf/features/preprints/components/preprints-help-dialog/preprints-help-dialog.component';
export { PreprintsResourcesComponent } from '@osf/features/preprints/components/preprints-resources/preprints-resources.component';
export { PreprintsResourcesFiltersComponent } from '@osf/features/preprints/components/preprints-resources-filters/preprints-resources-filters.component';
export { FileStepComponent } from '@osf/features/preprints/components/submit-steps/file-step/file-step.component';
export { MetadataComponent } from '@osf/features/preprints/components/submit-steps/metadata/metadata.component';
export { TitleAndAbstractStepComponent } from '@osf/features/preprints/components/submit-steps/title-and-abstract-step/title-and-abstract-step.component';
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ <h2>File</h2>
[styleClass]="isFileSourceSelected() ? 'w-full cursor-not-allowed' : 'w-full'"
[label]="'Select From existing OSF project' | titlecase"
severity="secondary"
[disabled]="isFileSourceSelected()"
[disabled]="isFileSourceSelected() || versionFileMode()"
[pTooltip]="isFileSourceSelected() ? 'Start a new preprint to attach a file from your project.' : ''"
tooltipPosition="top"
(click)="selectFileSource(PreprintFileSource.Project)"
/>
</section>

@if (isFileSourceSelected() && selectedFileSource() === PreprintFileSource.Computer) {
@if (selectedFileSource() === PreprintFileSource.Computer) {
<section class="m-t-48">
@if (!fileUploadLink()) {
<p-skeleton width="5rem" height="2rem" />
} @else if (!preprintFiles().length) {
} @else if ((!preprintFiles().length && !arePreprintFilesLoading()) || versionFileMode()) {
<p-button
outlined
raised
Expand All @@ -51,27 +51,10 @@ <h2>File</h2>
<input #fileInput type="file" class="hidden" (change)="onFileSelected($event)" />
}
</section>

<section>
@if (arePreprintFilesLoading()) {
<p-skeleton width="20rem" height="2rem" class="m-t-48" />
} @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>

<p-button class="danger-icon-btn" icon="fas fa-trash" severity="danger" text />
</section>
}
}
</section>
}

@if (isFileSourceSelected() && selectedFileSource() === PreprintFileSource.Project) {
<p-card styleClass="m-t-48">
@if (selectedFileSource() === PreprintFileSource.Project && !preprintFiles().length && !arePreprintFilesLoading()) {
<p-card styleClass="m-t-48" class="card">
<div>
<p class="line-height-3">This will make your project public, if it is not already</p>
<p class="line-height-3">The projects and components for which you have admin access are listed below.</p>
Expand All @@ -83,7 +66,7 @@ <h2>File</h2>
optionValue="id"
[formControl]="projectNameControl"
[placeholder]="'Project Title'"
class="w-6"
class="w-12 md:w-6"
[editable]="true"
styleClass="m-t-24"
appendTo="body"
Expand All @@ -107,8 +90,32 @@ <h2>File</h2>
}
</section>
}
@if (!versionFileMode()) {
<section class="m-t-48">
@if (arePreprintFilesLoading()) {
<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>

<p-button class="danger-icon-btn" icon="fas fa-trash" severity="danger" text (click)="versionFile()" />
</section>
}
}
</section>
}

<section class="m-t-48 flex flex-row justify-content-end align-items-center gap-2">
<p-button class="w-6rem" styleClass="w-full" label="Back" severity="info" (click)="backButtonClicked()" />
<p-button class="w-9rem" styleClass="w-full" label="Next" (click)="nextButtonClicked()" />
<p-button class="w-6 md:w-6rem" styleClass="w-full" label="Back" severity="info" (click)="backButtonClicked()" />
<p-button
class="w-6 md:w-9rem"
styleClass="w-full"
label="Next"
(click)="nextButtonClicked()"
[disabled]="!createdPreprint()?.primaryFileId || versionFileMode()"
/>
</section>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@use "assets/styles/mixins" as mix;
@use "assets/styles/variables" as var;

.file-source-button {
--p-button-secondary-border-color: var(--grey-2);
Expand All @@ -15,8 +16,13 @@

.file-row {
@include mix.flex-center-between;
margin-top: mix.rem(48px);
padding: mix.rem(6px) mix.rem(12px);
border-bottom: 1px solid var(--grey-2);
border-top: 1px solid var(--grey-2);
}

.card {
@media (max-width: var.$breakpoint-sm) {
--p-card-body-padding: 0.75rem;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { StringOrNull } from '@core/helpers';
import { PreprintFileSource } from '@osf/features/preprints/enums';
import {
CopyFileFromProject,
GetAvailableProjects,
GetPreprintFilesLinks,
GetProjectFiles,
GetProjectFilesByLink,
ReuploadFile,
SetSelectedPreprintFileSource,
SubmitPreprintSelectors,
UploadFile,
} from '@osf/features/preprints/store/submit-preprint';
import { FilesTreeActions } from '@osf/features/project/files/models';
import { FilesTreeComponent, IconComponent } from '@shared/components';
import { OsfFile } from '@shared/models';
import { CustomConfirmationService } from '@shared/services';

@Component({
selector: 'osf-file-step',
Expand All @@ -59,18 +62,22 @@ import { OsfFile } from '@shared/models';
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class FileStepComponent implements OnInit {
private customConfirmationService = inject(CustomConfirmationService);
private actions = createDispatchMap({
setSelectedFileSource: SetSelectedPreprintFileSource,
getPreprintFilesLinks: GetPreprintFilesLinks,
uploadFile: UploadFile,
reuploadFile: ReuploadFile,
getAvailableProjects: GetAvailableProjects,
getFilesForSelectedProject: GetProjectFiles,
getProjectFilesByLink: GetProjectFilesByLink,
copyFileFromProject: CopyFileFromProject,
});
private destroyRef = inject(DestroyRef);

readonly PreprintFileSource = PreprintFileSource;

createdPreprint = select(SubmitPreprintSelectors.getCreatedPreprint);
providerId = select(SubmitPreprintSelectors.getSelectedProviderId);
selectedFileSource = select(SubmitPreprintSelectors.getSelectedFileSource);
fileUploadLink = select(SubmitPreprintSelectors.getUploadLink);
Expand All @@ -83,6 +90,8 @@ export class FileStepComponent implements OnInit {
selectedProjectId = signal<StringOrNull>(null);
currentFolder = signal<OsfFile | null>(null);

versionFileMode = signal<boolean>(false);

projectNameControl = new FormControl<StringOrNull>(null);

filesTreeActions: FilesTreeActions = {
Expand All @@ -99,6 +108,7 @@ export class FileStepComponent implements OnInit {
};

nextClicked = output<void>();
backClicked = output<void>();

isFileSourceSelected = computed(() => {
return this.selectedFileSource() !== PreprintFileSource.None;
Expand All @@ -109,9 +119,12 @@ export class FileStepComponent implements OnInit {

this.projectNameControl.valueChanges
.pipe(debounceTime(500), distinctUntilChanged(), takeUntilDestroyed(this.destroyRef))
.subscribe((value) => {
this.selectedProjectId.set(value);
this.actions.getAvailableProjects(value);
.subscribe((projectNameOrId) => {
if (this.selectedProjectId() === projectNameOrId) {
return;
}

this.actions.getAvailableProjects(projectNameOrId);
});
}

Expand All @@ -124,10 +137,14 @@ export class FileStepComponent implements OnInit {
}

backButtonClicked() {
//[RNi] TODO: implement logic of going back to the previous step
this.backClicked.emit();
}

nextButtonClicked() {
if (!this.createdPreprint()?.primaryFileId) {
return;
}

this.nextClicked.emit();
}

Expand All @@ -136,7 +153,12 @@ export class FileStepComponent implements OnInit {
const file = input.files?.[0];
if (!file) return;

this.actions.uploadFile(file);
if (this.versionFileMode()) {
this.versionFileMode.set(false);
this.actions.reuploadFile(file);
} else {
this.actions.uploadFile(file);
}
}

@HostListener('window:beforeunload', ['$event'])
Expand All @@ -150,10 +172,24 @@ export class FileStepComponent implements OnInit {
return;
}

this.selectedProjectId.set(event.value);
this.actions.getFilesForSelectedProject(event.value);
}

selectProjectFile(file: OsfFile) {
//[RNi] TODO: implement logic of linking preprint to that file
this.actions.copyFileFromProject(file);
}

versionFile() {
this.customConfirmationService.confirmContinue({
headerKey: 'Add a new preprint file',
messageKey:
'This will allow a new version of the preprint file to be uploaded to the preprint. The existing file will be retained as a version of the preprint.',
onConfirm: () => {
this.versionFileMode.set(true);
this.actions.setSelectedFileSource(PreprintFileSource.None);
},
onReject: () => null,
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<p-card class="w-full">
<h2>{{ 'project.overview.metadata.contributors' | translate }}</h2>
<div class="warning-message m-t-24 m-b-12">
<p-message severity="error">
<i class="osf-icon-warning-sign mr-2"></i>
Warning: Changing your permissions will prevent you from editing your draft.
</p-message>
</div>
<osf-contributors-list
class="w-full"
[contributors]="contributors()"
[isLoading]="isContributorsLoading()"
(remove)="removeContributor($event)"
(showEducationHistory)="openEducationHistory($event)"
(showEmploymentHistory)="openEmploymentHistory($event)"
/>
<div class="flex justify-content-end mt-3">
@if (hasChanges) {
<div class="flex gap-2 mr-4">
<p-button (click)="cancel()" text severity="info" [label]="'common.buttons.cancel' | translate" />
<p-button (click)="save()" [label]="'common.buttons.save' | translate" />
</div>
}
<p-button
class="w-full md:w-auto"
styleClass="w-full"
label="Add Contributor By Search"
type="submit"
(click)="openAddContributorDialog()"
></p-button>
</div>
</p-card>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ContributorsComponent } from './contributors.component';

describe('ContributorsComponent', () => {
let component: ContributorsComponent;
let fixture: ComponentFixture<ContributorsComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ContributorsComponent],
}).compileComponents();

fixture = TestBed.createComponent(ContributorsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading