diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index e66d321f2..b33808b45 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -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, diff --git a/src/app/features/files/components/confirm-move-file-dialog/confirm-move-file-dialog.component.ts b/src/app/features/files/components/confirm-move-file-dialog/confirm-move-file-dialog.component.ts index 82667ec46..a57e288d9 100644 --- a/src/app/features/files/components/confirm-move-file-dialog/confirm-move-file-dialog.component.ts +++ b/src/app/features/files/components/confirm-move-file-dialog/confirm-move-file-dialog.component.ts @@ -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', diff --git a/src/app/features/files/components/move-file-dialog/move-file-dialog.component.ts b/src/app/features/files/components/move-file-dialog/move-file-dialog.component.ts index 4374dade2..b9d5863bb 100644 --- a/src/app/features/files/components/move-file-dialog/move-file-dialog.component.ts +++ b/src/app/features/files/components/move-file-dialog/move-file-dialog.component.ts @@ -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'; @@ -80,7 +80,7 @@ export class MoveFileDialogComponent { readonly actions = createDispatchMap({ getMoveDialogFiles: GetMoveDialogFiles, setMoveDialogCurrentFolder: SetMoveDialogCurrentFolder, - setCurrentFolder: SetCurrentFolder, + setCurrentFolder: SetFilesCurrentFolder, getResourceDetails: GetResourceDetails, getComponentsTree: GetResourceWithChildren, }); diff --git a/src/app/features/files/pages/files/files.component.ts b/src/app/features/files/pages/files/files.component.ts index 3653caa67..728831377 100644 --- a/src/app/features/files/pages/files/files.component.ts +++ b/src/app/features/files/pages/files/files.component.ts @@ -46,9 +46,9 @@ import { GetRootFolders, GetStorageSupportedFeatures, RenameEntry, - ResetState, - SetCurrentFolder, + ResetFilesState, SetCurrentProvider, + SetFilesCurrentFolder, SetMoveDialogCurrentFolder, SetSearch, SetSort, @@ -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, }); diff --git a/src/app/features/files/store/files.actions.ts b/src/app/features/files/store/files.actions.ts index effb868b5..999863b71 100644 --- a/src/app/features/files/store/files.actions.ts +++ b/src/app/features/files/store/files.actions.ts @@ -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) {} } @@ -161,6 +161,6 @@ export class GetStorageSupportedFeatures { ) {} } -export class ResetState { +export class ResetFilesState { static readonly type = '[Files] Reset State'; } diff --git a/src/app/features/files/store/files.state.ts b/src/app/features/files/store/files.state.ts index 306c69598..52e6e31a8 100644 --- a/src/app/features/files/store/files.state.ts +++ b/src/app/features/files/store/files.state.ts @@ -27,10 +27,10 @@ import { GetRootFolders, GetStorageSupportedFeatures, RenameEntry, - ResetState, - SetCurrentFolder, + ResetFilesState, SetCurrentProvider, SetFileMetadata, + SetFilesCurrentFolder, SetMoveDialogCurrentFolder, SetSearch, SetSort, @@ -94,8 +94,8 @@ export class FilesState { ); } - @Action(SetCurrentFolder) - setSelectedFolder(ctx: StateContext, action: SetCurrentFolder) { + @Action(SetFilesCurrentFolder) + setSelectedFolder(ctx: StateContext, action: SetFilesCurrentFolder) { ctx.patchState({ currentFolder: action.folder }); } @@ -360,7 +360,7 @@ export class FilesState { ); } - @Action(ResetState) + @Action(ResetFilesState) resetState(ctx: StateContext) { ctx.patchState(FILES_STATE_DEFAULTS); } diff --git a/src/app/features/preprints/components/index.ts b/src/app/features/preprints/components/index.ts index 9d0394975..17ba1617f 100644 --- a/src/app/features/preprints/components/index.ts +++ b/src/app/features/preprints/components/index.ts @@ -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'; diff --git a/src/app/features/preprints/components/preprint-details/general-information/general-information.component.ts b/src/app/features/preprints/components/preprint-details/general-information/general-information.component.ts index 608628a48..29eb2571b 100644 --- a/src/app/features/preprints/components/preprint-details/general-information/general-information.component.ts +++ b/src/app/features/preprints/components/preprint-details/general-information/general-information.component.ts @@ -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'; @@ -55,7 +55,7 @@ export class GeneralInformationComponent implements OnDestroy { private actions = createDispatchMap({ getBibliographicContributors: GetBibliographicContributors, resetContributorsState: ResetContributorsState, - fetchPreprintById: FetchPreprintById, + fetchPreprintById: FetchPreprintDetails, fetchResourceInstitutions: FetchResourceInstitutions, loadMoreBibliographicContributors: LoadMoreBibliographicContributors, }); diff --git a/src/app/features/preprints/components/preprint-details/preprint-tombstone/preprint-tombstone.component.ts b/src/app/features/preprints/components/preprint-details/preprint-tombstone/preprint-tombstone.component.ts index 341290d97..2023c666e 100644 --- a/src/app/features/preprints/components/preprint-details/preprint-tombstone/preprint-tombstone.component.ts +++ b/src/app/features/preprints/components/preprint-details/preprint-tombstone/preprint-tombstone.component.ts @@ -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'; @@ -51,7 +51,7 @@ export class PreprintTombstoneComponent implements OnDestroy { private actions = createDispatchMap({ getBibliographicContributors: GetBibliographicContributors, resetContributorsState: ResetContributorsState, - fetchPreprintById: FetchPreprintById, + fetchPreprintById: FetchPreprintDetails, fetchSubjects: FetchSelectedSubjects, loadMoreBibliographicContributors: LoadMoreBibliographicContributors, }); diff --git a/src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.html b/src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.html similarity index 100% rename from src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.html rename to src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.html diff --git a/src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.scss b/src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.scss similarity index 100% rename from src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.scss rename to src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.scss diff --git a/src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.spec.ts b/src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.spec.ts similarity index 89% rename from src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.spec.ts rename to src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.spec.ts index bfd79e403..315c445c2 100644 --- a/src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.spec.ts +++ b/src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.spec.ts @@ -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; +describe('PreprintWithdrawDialogComponent', () => { + let component: PreprintWithdrawDialogComponent; + let fixture: ComponentFixture; let dialogRefMock: any; let dialogConfigMock: any; @@ -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), @@ -44,7 +44,7 @@ describe('WithdrawDialogComponent', () => { ], }).compileComponents(); - fixture = TestBed.createComponent(WithdrawDialogComponent); + fixture = TestBed.createComponent(PreprintWithdrawDialogComponent); component = fixture.componentInstance; fixture.detectChanges(); }); @@ -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(); @@ -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(); @@ -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(); diff --git a/src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.ts b/src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.ts similarity index 93% rename from src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.ts rename to src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.ts index 1ade9c91a..9b6cfe6c3 100644 --- a/src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.ts +++ b/src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.ts @@ -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); @@ -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; diff --git a/src/app/features/preprints/components/stepper/file-step/file-step.component.ts b/src/app/features/preprints/components/stepper/file-step/file-step.component.ts index ed7803353..99b5601fd 100644 --- a/src/app/features/preprints/components/stepper/file-step/file-step.component.ts +++ b/src/app/features/preprints/components/stepper/file-step/file-step.component.ts @@ -35,7 +35,7 @@ import { FetchProjectFilesByLink, PreprintStepperSelectors, ReuploadFile, - SetCurrentFolder, + SetPreprintStepperCurrentFolder, SetProjectRootFolder, SetSelectedPreprintFileSource, UploadFile, @@ -80,7 +80,7 @@ export class FileStepComponent implements OnInit { setProjectRootFolder: SetProjectRootFolder, getProjectFilesByLink: FetchProjectFilesByLink, copyFileFromProject: CopyFileFromProject, - setCurrentFolder: SetCurrentFolder, + setCurrentFolder: SetPreprintStepperCurrentFolder, }); private destroyRef = inject(DestroyRef); diff --git a/src/app/features/preprints/pages/create-new-version/create-new-version.component.ts b/src/app/features/preprints/pages/create-new-version/create-new-version.component.ts index d59bfa609..c3d69bbde 100644 --- a/src/app/features/preprints/pages/create-new-version/create-new-version.component.ts +++ b/src/app/features/preprints/pages/create-new-version/create-new-version.component.ts @@ -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'; @@ -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', @@ -55,7 +58,7 @@ export class CreateNewVersionComponent implements OnInit, OnDestroy, CanDeactiva private actions = createDispatchMap({ getPreprintProviderById: GetPreprintProviderById, setSelectedPreprintProviderId: SetSelectedPreprintProviderId, - resetState: ResetState, + resetState: ResetPreprintStepperState, fetchPreprint: FetchPreprintById, }); diff --git a/src/app/features/preprints/pages/preprint-details/preprint-details.component.ts b/src/app/features/preprints/pages/preprint-details/preprint-details.component.ts index 31d8ecb41..908179745 100644 --- a/src/app/features/preprints/pages/preprint-details/preprint-details.component.ts +++ b/src/app/features/preprints/pages/preprint-details/preprint-details.component.ts @@ -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'; @@ -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'; @@ -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, @@ -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, }), diff --git a/src/app/features/preprints/pages/select-preprint-service/select-preprint-service.component.html b/src/app/features/preprints/pages/select-preprint-service/select-preprint-service.component.html index 3bc727057..7db2cdfb8 100644 --- a/src/app/features/preprints/pages/select-preprint-service/select-preprint-service.component.html +++ b/src/app/features/preprints/pages/select-preprint-service/select-preprint-service.component.html @@ -41,7 +41,7 @@

{{ 'preprints.selectService.sectionTitle' | translate }}

[alt]="'preprints.selectService.providerLogoImageAlt' | translate" /> -

{{ provider.name }}

+

{{ provider.name }}