Skip to content
Open
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
5 changes: 4 additions & 1 deletion src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ export const routes: Routes = [
{
path: 'my-registrations',
canActivate: [authGuard],
loadComponent: () => import('@osf/features/registries/pages').then((c) => c.MyRegistrationsComponent),
loadComponent: () =>
import('@osf/features/registries/pages/my-registrations/my-registrations.component').then(
(c) => c.MyRegistrationsComponent
),
providers: [
provideStates([RegistriesState]),
ProvidersHandlers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { FileMenuType } from '@shared/enums/file-menu-type.enum';
import { FileModel } from '@shared/models/files/file.model';

@Component({
selector: 'osf-move-file-dialog',
selector: 'osf-confirm-move-file-dialog',
imports: [Button, TranslatePipe],
templateUrl: './confirm-move-file-dialog.component.html',
styleUrl: './confirm-move-file-dialog.component.scss',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import {
FilesSelectors,
GetMoveDialogFiles,
SetCurrentFolder,
SetFilesCurrentFolder,
SetMoveDialogCurrentFolder,
} from '@osf/features/files/store';
import { FileSelectDestinationComponent } from '@osf/shared/components/file-select-destination/file-select-destination.component';
Expand Down Expand Up @@ -80,7 +80,7 @@ export class MoveFileDialogComponent {
readonly actions = createDispatchMap({
getMoveDialogFiles: GetMoveDialogFiles,
setMoveDialogCurrentFolder: SetMoveDialogCurrentFolder,
setCurrentFolder: SetCurrentFolder,
setCurrentFolder: SetFilesCurrentFolder,
getResourceDetails: GetResourceDetails,
getComponentsTree: GetResourceWithChildren,
});
Expand Down
8 changes: 4 additions & 4 deletions src/app/features/files/pages/files/files.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ import {
GetRootFolders,
GetStorageSupportedFeatures,
RenameEntry,
ResetState,
SetCurrentFolder,
ResetFilesState,
SetCurrentProvider,
SetFilesCurrentFolder,
SetMoveDialogCurrentFolder,
SetSearch,
SetSort,
Expand Down Expand Up @@ -138,14 +138,14 @@ export class FilesComponent {
getFiles: GetFiles,
deleteEntry: DeleteEntry,
renameEntry: RenameEntry,
setCurrentFolder: SetCurrentFolder,
setCurrentFolder: SetFilesCurrentFolder,
setMoveDialogCurrentFolder: SetMoveDialogCurrentFolder,
setSearch: SetSearch,
setSort: SetSort,
getRootFolders: GetRootFolders,
getConfiguredStorageAddons: GetConfiguredStorageAddons,
setCurrentProvider: SetCurrentProvider,
resetState: ResetState,
resetState: ResetFilesState,
getResourceDetails: GetResourceDetails,
getStorageSupportedFeatures: GetStorageSupportedFeatures,
});
Expand Down
6 changes: 3 additions & 3 deletions src/app/features/files/store/files.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export class SetSort {
constructor(public sort: string) {}
}

export class SetCurrentFolder {
static readonly type = '[Files] Set Current Folder';
export class SetFilesCurrentFolder {
static readonly type = '[Files] Set Files Current Folder';

constructor(public folder: FileFolderModel | null) {}
}
Expand Down Expand Up @@ -161,6 +161,6 @@ export class GetStorageSupportedFeatures {
) {}
}

export class ResetState {
export class ResetFilesState {
static readonly type = '[Files] Reset State';
}
10 changes: 5 additions & 5 deletions src/app/features/files/store/files.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ import {
GetRootFolders,
GetStorageSupportedFeatures,
RenameEntry,
ResetState,
SetCurrentFolder,
ResetFilesState,
SetCurrentProvider,
SetFileMetadata,
SetFilesCurrentFolder,
SetMoveDialogCurrentFolder,
SetSearch,
SetSort,
Expand Down Expand Up @@ -94,8 +94,8 @@ export class FilesState {
);
}

@Action(SetCurrentFolder)
setSelectedFolder(ctx: StateContext<FilesStateModel>, action: SetCurrentFolder) {
@Action(SetFilesCurrentFolder)
setSelectedFolder(ctx: StateContext<FilesStateModel>, action: SetFilesCurrentFolder) {
ctx.patchState({ currentFolder: action.folder });
}

Expand Down Expand Up @@ -360,7 +360,7 @@ export class FilesState {
);
}

@Action(ResetState)
@Action(ResetFilesState)
resetState(ctx: StateContext<FilesStateModel>) {
ctx.patchState(FILES_STATE_DEFAULTS);
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/preprints/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export { PreprintMakeDecisionComponent } from './preprint-details/preprint-make-
export { PreprintMetricsInfoComponent } from './preprint-details/preprint-metrics-info/preprint-metrics-info.component';
export { PreprintTombstoneComponent } from './preprint-details/preprint-tombstone/preprint-tombstone.component';
export { PreprintWarningBannerComponent } from './preprint-details/preprint-warning-banner/preprint-warning-banner.component';
export { PreprintWithdrawDialogComponent } from './preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component';
export { ShareAndDownloadComponent } from './preprint-details/share-and-download/share-and-download.component';
export { StatusBannerComponent } from './preprint-details/status-banner/status-banner.component';
export { WithdrawDialogComponent } from './preprint-details/withdraw-dialog/withdraw-dialog.component';
export { PreprintProviderFooterComponent } from './preprint-provider-footer/preprint-provider-footer.component';
export { PreprintProviderHeroComponent } from './preprint-provider-hero/preprint-provider-hero.component';
export { PreprintServicesComponent } from './preprint-services/preprint-services.component';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { FormsModule } from '@angular/forms';
import { ENVIRONMENT } from '@core/provider/environment.provider';
import { ApplicabilityStatus, PreregLinkInfo } from '@osf/features/preprints/enums';
import { PreprintProviderDetails } from '@osf/features/preprints/models';
import { FetchPreprintById, PreprintSelectors } from '@osf/features/preprints/store/preprint';
import { FetchPreprintDetails, PreprintSelectors } from '@osf/features/preprints/store/preprint';
import { AffiliatedInstitutionsViewComponent } from '@osf/shared/components/affiliated-institutions-view/affiliated-institutions-view.component';
import { ContributorsListComponent } from '@osf/shared/components/contributors-list/contributors-list.component';
import { IconComponent } from '@osf/shared/components/icon/icon.component';
Expand Down Expand Up @@ -55,7 +55,7 @@ export class GeneralInformationComponent implements OnDestroy {
private actions = createDispatchMap({
getBibliographicContributors: GetBibliographicContributors,
resetContributorsState: ResetContributorsState,
fetchPreprintById: FetchPreprintById,
fetchPreprintById: FetchPreprintDetails,
fetchResourceInstitutions: FetchResourceInstitutions,
loadMoreBibliographicContributors: LoadMoreBibliographicContributors,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Router } from '@angular/router';

import { ApplicabilityStatus, PreregLinkInfo } from '@osf/features/preprints/enums';
import { PreprintProviderDetails } from '@osf/features/preprints/models';
import { FetchPreprintById, PreprintSelectors } from '@osf/features/preprints/store/preprint';
import { FetchPreprintDetails, PreprintSelectors } from '@osf/features/preprints/store/preprint';
import { ContributorsListComponent } from '@osf/shared/components/contributors-list/contributors-list.component';
import { LicenseDisplayComponent } from '@osf/shared/components/license-display/license-display.component';
import { TruncatedTextComponent } from '@osf/shared/components/truncated-text/truncated-text.component';
Expand Down Expand Up @@ -51,7 +51,7 @@ export class PreprintTombstoneComponent implements OnDestroy {
private actions = createDispatchMap({
getBibliographicContributors: GetBibliographicContributors,
resetContributorsState: ResetContributorsState,
fetchPreprintById: FetchPreprintById,
fetchPreprintById: FetchPreprintDetails,
fetchSubjects: FetchSelectedSubjects,
loadMoreBibliographicContributors: LoadMoreBibliographicContributors,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import { formInputLimits } from '@osf/features/preprints/constants';
import { ProviderReviewsWorkflow, ReviewsState } from '@osf/features/preprints/enums';
import { PreprintModel, PreprintProviderDetails } from '@osf/features/preprints/models';

import { WithdrawDialogComponent } from './withdraw-dialog.component';
import { PreprintWithdrawDialogComponent } from './preprint-withdraw-dialog.component';

import { PREPRINT_MOCK } from '@testing/mocks/preprint.mock';
import { PREPRINT_PROVIDER_DETAILS_MOCK } from '@testing/mocks/preprint-provider-details';
import { OSFTestingModule } from '@testing/osf.testing.module';
import { provideMockStore } from '@testing/providers/store-provider.mock';

describe('WithdrawDialogComponent', () => {
let component: WithdrawDialogComponent;
let fixture: ComponentFixture<WithdrawDialogComponent>;
describe('PreprintWithdrawDialogComponent', () => {
let component: PreprintWithdrawDialogComponent;
let fixture: ComponentFixture<PreprintWithdrawDialogComponent>;
let dialogRefMock: any;
let dialogConfigMock: any;

Expand All @@ -34,7 +34,7 @@ describe('WithdrawDialogComponent', () => {
};

await TestBed.configureTestingModule({
imports: [WithdrawDialogComponent, OSFTestingModule, MockPipe(TitleCasePipe)],
imports: [PreprintWithdrawDialogComponent, OSFTestingModule, MockPipe(TitleCasePipe)],
providers: [
MockProvider(DynamicDialogRef, dialogRefMock),
MockProvider(DynamicDialogConfig, dialogConfigMock),
Expand All @@ -44,7 +44,7 @@ describe('WithdrawDialogComponent', () => {
],
}).compileComponents();

fixture = TestBed.createComponent(WithdrawDialogComponent);
fixture = TestBed.createComponent(PreprintWithdrawDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
Expand Down Expand Up @@ -103,7 +103,7 @@ describe('WithdrawDialogComponent', () => {
dialogConfigMock.data = { provider: providerWithPreMod, preprint: preprintWithPending };

expect(() => {
fixture = TestBed.createComponent(WithdrawDialogComponent);
fixture = TestBed.createComponent(PreprintWithdrawDialogComponent);
component = fixture.componentInstance;
component.ngOnInit();
}).not.toThrow();
Expand All @@ -116,7 +116,7 @@ describe('WithdrawDialogComponent', () => {
dialogConfigMock.data = { provider: providerWithPreMod, preprint: preprintWithAccepted };

expect(() => {
fixture = TestBed.createComponent(WithdrawDialogComponent);
fixture = TestBed.createComponent(PreprintWithdrawDialogComponent);
component = fixture.componentInstance;
component.ngOnInit();
}).not.toThrow();
Expand All @@ -128,7 +128,7 @@ describe('WithdrawDialogComponent', () => {
dialogConfigMock.data = { provider: providerWithPostMod, preprint: mockPreprint };

expect(() => {
fixture = TestBed.createComponent(WithdrawDialogComponent);
fixture = TestBed.createComponent(PreprintWithdrawDialogComponent);
component = fixture.componentInstance;
component.ngOnInit();
}).not.toThrow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import { INPUT_VALIDATION_MESSAGES } from '@osf/shared/constants/input-validatio
import { CustomValidators } from '@osf/shared/helpers/custom-form-validators.helper';

@Component({
selector: 'osf-withdraw-dialog',
selector: 'osf-preprint-withdraw-dialog',
imports: [Textarea, ReactiveFormsModule, Message, TranslatePipe, Button, TitleCasePipe],
templateUrl: './withdraw-dialog.component.html',
styleUrl: './withdraw-dialog.component.scss',
templateUrl: './preprint-withdraw-dialog.component.html',
styleUrl: './preprint-withdraw-dialog.component.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class WithdrawDialogComponent implements OnInit {
export class PreprintWithdrawDialogComponent implements OnInit {
private readonly config = inject(DynamicDialogConfig);
private readonly translateService = inject(TranslateService);
private readonly environment = inject(ENVIRONMENT);
Expand All @@ -39,9 +39,7 @@ export class WithdrawDialogComponent implements OnInit {
private provider!: PreprintProviderDetails;
private preprint!: PreprintModel;

private actions = createDispatchMap({
withdrawPreprint: WithdrawPreprint,
});
private actions = createDispatchMap({ withdrawPreprint: WithdrawPreprint });

inputLimits = formInputLimits;
readonly INPUT_VALIDATION_MESSAGES = INPUT_VALIDATION_MESSAGES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
FetchProjectFilesByLink,
PreprintStepperSelectors,
ReuploadFile,
SetCurrentFolder,
SetPreprintStepperCurrentFolder,
SetProjectRootFolder,
SetSelectedPreprintFileSource,
UploadFile,
Expand Down Expand Up @@ -80,7 +80,7 @@ export class FileStepComponent implements OnInit {
setProjectRootFolder: SetProjectRootFolder,
getProjectFilesByLink: FetchProjectFilesByLink,
copyFileFromProject: CopyFileFromProject,
setCurrentFolder: SetCurrentFolder,
setCurrentFolder: SetPreprintStepperCurrentFolder,
});
private destroyRef = inject(DestroyRef);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
import { toSignal } from '@angular/core/rxjs-interop';
import { ActivatedRoute, Router } from '@angular/router';

import { ResetState } from '@osf/features/files/store';
import { StepperComponent } from '@osf/shared/components/stepper/stepper.component';
import { IS_WEB } from '@osf/shared/helpers/breakpoints.tokens';
import { BrowserTabHelper } from '@osf/shared/helpers/browser-tab.helper';
Expand All @@ -32,9 +31,13 @@ import { BrandService } from '@osf/shared/services/brand.service';
import { FileStepComponent, ReviewStepComponent } from '../../components';
import { createNewVersionStepsConst } from '../../constants';
import { PreprintSteps } from '../../enums';
import { FetchPreprintById } from '../../store/preprint';
import { GetPreprintProviderById, PreprintProvidersSelectors } from '../../store/preprint-providers';
import { PreprintStepperSelectors, SetSelectedPreprintProviderId } from '../../store/preprint-stepper';
import {
FetchPreprintById,
PreprintStepperSelectors,
ResetPreprintStepperState,
SetSelectedPreprintProviderId,
} from '../../store/preprint-stepper';

@Component({
selector: 'osf-create-new-version',
Expand All @@ -55,7 +58,7 @@ export class CreateNewVersionComponent implements OnInit, OnDestroy, CanDeactiva
private actions = createDispatchMap({
getPreprintProviderById: GetPreprintProviderById,
setSelectedPreprintProviderId: SetSelectedPreprintProviderId,
resetState: ResetState,
resetState: ResetPreprintStepperState,
fetchPreprint: FetchPreprintById,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { HelpScoutService } from '@core/services/help-scout.service';
import { PrerenderReadyService } from '@core/services/prerender-ready.service';
import { ClearCurrentProvider } from '@core/store/provider';
import { UserSelectors } from '@core/store/user';
import { ResetState } from '@osf/features/files/store';
import { ReviewPermissions } from '@osf/shared/enums/review-permissions.enum';
import { pathJoin } from '@osf/shared/helpers/path-join.helper';
import { FixSpecialCharPipe } from '@osf/shared/pipes/fix-special-char.pipe';
Expand All @@ -48,17 +47,18 @@ import {
PreprintMetricsInfoComponent,
PreprintTombstoneComponent,
PreprintWarningBannerComponent,
PreprintWithdrawDialogComponent,
ShareAndDownloadComponent,
StatusBannerComponent,
WithdrawDialogComponent,
} from '../../components';
import { PreprintRequestMachineState, ProviderReviewsWorkflow, ReviewsState } from '../../enums';
import {
FetchPreprintById,
FetchPreprintDetails,
FetchPreprintRequestActions,
FetchPreprintRequests,
FetchPreprintReviewActions,
PreprintSelectors,
ResetPreprintState,
} from '../../store/preprint';
import { GetPreprintProviderById, PreprintProvidersSelectors } from '../../store/preprint-providers';
import { CreateNewVersion, PreprintStepperSelectors } from '../../store/preprint-stepper';
Expand Down Expand Up @@ -110,8 +110,8 @@ export class PreprintDetailsComponent implements OnInit, OnDestroy {

private actions = createDispatchMap({
getPreprintProviderById: GetPreprintProviderById,
resetState: ResetState,
fetchPreprintById: FetchPreprintById,
resetState: ResetPreprintState,
fetchPreprintById: FetchPreprintDetails,
createNewVersion: CreateNewVersion,
fetchPreprintRequests: FetchPreprintRequests,
fetchPreprintReviewActions: FetchPreprintReviewActions,
Expand Down Expand Up @@ -314,7 +314,7 @@ export class PreprintDetailsComponent implements OnInit, OnDestroy {

handleWithdrawClicked() {
this.customDialogService
.open(WithdrawDialogComponent, {
.open(PreprintWithdrawDialogComponent, {
header: this.translateService.instant('preprints.details.withdrawDialog.title', {
preprintWord: this.preprintProvider()!.preprintWord,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h2>{{ 'preprints.selectService.sectionTitle' | translate }}</h2>
[alt]="'preprints.selectService.providerLogoImageAlt' | translate"
/>

<h4 class="mt-3">{{ provider.name }}</h4>
<h4 class="text-center mt-3">{{ provider.name }}</h4>
<p-button
class="mt-4"
[label]="
Expand Down
Loading