diff --git a/src/app/features/preprints/components/stepper/file-step/file-step.component.html b/src/app/features/preprints/components/stepper/file-step/file-step.component.html index 719d6b9ba..612c9f15d 100644 --- a/src/app/features/preprints/components/stepper/file-step/file-step.component.html +++ b/src/app/features/preprints/components/stepper/file-step/file-step.component.html @@ -87,6 +87,9 @@

{{ 'preprints.preprintStepper.file.title' | translate }}

@if (selectedProjectId()) { (null); versionFileMode = signal(false); diff --git a/src/app/features/preprints/preprints.routes.ts b/src/app/features/preprints/preprints.routes.ts index 0e8295325..ab5bcffe9 100644 --- a/src/app/features/preprints/preprints.routes.ts +++ b/src/app/features/preprints/preprints.routes.ts @@ -8,8 +8,8 @@ import { PreprintStepperState } from '@osf/features/preprints/store/preprint-ste import { PreprintsDiscoverState } from '@osf/features/preprints/store/preprints-discover'; import { PreprintsResourcesFiltersState } from '@osf/features/preprints/store/preprints-resources-filters'; import { PreprintsResourcesFiltersOptionsState } from '@osf/features/preprints/store/preprints-resources-filters-options'; -import { ConfirmLeavingGuard } from '@shared/guards'; import { ResourceType } from '@shared/enums'; +import { ConfirmLeavingGuard } from '@shared/guards'; import { ContributorsState, SubjectsState } from '@shared/stores'; import { ModeratorsState } from '../moderation/store/moderation'; diff --git a/src/app/features/project/files/pages/project-files/project-files.component.html b/src/app/features/project/files/pages/project-files/project-files.component.html index afd79db36..3c7974b9b 100644 --- a/src/app/features/project/files/pages/project-files/project-files.component.html +++ b/src/app/features/project/files/pages/project-files/project-files.component.html @@ -8,7 +8,7 @@ { - const currentFolder = this.currentFolder(); - - if (currentFolder) { - this.actions.getFiles(currentFolder.relationships.filesLink); - } - }); - - effect(() => { - if (!this.isFilesLoading() && !this.isConfiguredStorageAddonsLoading() && !this.isRootFoldersLoading()) { + if (!this.isConfiguredStorageAddonsLoading() && !this.isRootFoldersLoading()) { this.dataLoaded.set(true); } }); diff --git a/src/app/features/project/files/store/project-files.actions.ts b/src/app/features/project/files/store/project-files.actions.ts index 10a1f5a0b..7d7b1441a 100644 --- a/src/app/features/project/files/store/project-files.actions.ts +++ b/src/app/features/project/files/store/project-files.actions.ts @@ -37,12 +37,6 @@ export class GetFileProjectMetadata { constructor(public projectId: string) {} } -export class GetMoveFileRootFiles { - static readonly type = '[Project Files] Get Move File Root Files'; - - constructor(public projectId: string) {} -} - export class GetMoveFileFiles { static readonly type = '[Project Files] Get Move File Files'; diff --git a/src/app/features/project/files/store/project-files.state.ts b/src/app/features/project/files/store/project-files.state.ts index a4587b1df..60450a8f4 100644 --- a/src/app/features/project/files/store/project-files.state.ts +++ b/src/app/features/project/files/store/project-files.state.ts @@ -80,6 +80,7 @@ export class ProjectFilesState { error: null, }, }); + console.log('files is patched'); }, }), catchError((error) => this.handleError(ctx, 'files', error)) @@ -95,6 +96,7 @@ export class ProjectFilesState { @Action(SetCurrentFolder) setSelectedFolder(ctx: StateContext, action: SetCurrentFolder) { ctx.patchState({ currentFolder: action.folder }); + console.log('set currennt folder'); } @Action(SetMoveFileCurrentFolder) diff --git a/src/app/features/registry/pages/registry-files/registry-files.component.html b/src/app/features/registry/pages/registry-files/registry-files.component.html index d30f028b5..531f597e8 100644 --- a/src/app/features/registry/pages/registry-files/registry-files.component.html +++ b/src/app/features/registry/pages/registry-files/registry-files.component.html @@ -34,6 +34,9 @@ { + // const currentFolder = this.currentFolder(); + // + // if (currentFolder) { + // this.actions.getFiles(currentFolder.relationships.filesLink); + // } + // }); + this.searchControl.valueChanges .pipe(skip(1), takeUntilDestroyed(this.destroyRef), debounceTime(500)) .subscribe((searchText) => { diff --git a/src/app/shared/components/files-tree/files-tree.component.html b/src/app/shared/components/files-tree/files-tree.component.html index 5eab5f92d..73bb96766 100644 --- a/src/app/shared/components/files-tree/files-tree.component.html +++ b/src/app/shared/components/files-tree/files-tree.component.html @@ -1,11 +1,13 @@ -
- @if (isDragOver()) { -
- -

{{ 'project.files.dropText' | translate }}

-
- } -
+@if (!viewOnly()) { +
+ @if (isDragOver()) { +
+ +

{{ 'project.files.dropText' | translate }}

+
+ } +
+} @if (isLoading()) {
diff --git a/src/app/shared/components/files-tree/files-tree.component.ts b/src/app/shared/components/files-tree/files-tree.component.ts index 83c2d2f90..5ce87dfb2 100644 --- a/src/app/shared/components/files-tree/files-tree.component.ts +++ b/src/app/shared/components/files-tree/files-tree.component.ts @@ -27,11 +27,9 @@ import { MoveFileDialogComponent, RenameFileDialogComponent } from '@osf/feature import { embedDynamicJs, embedStaticHtml, FilesTreeActions } from '@osf/features/project/files/models'; import { FileMenuType } from '@osf/shared/enums'; import { FileMenuComponent, LoadingSpinnerComponent } from '@shared/components'; -import { filesTreeSelectorsFactory } from '@shared/factories'; import { FileMenuAction, OsfFile } from '@shared/models'; import { FileSizePipe } from '@shared/pipes'; import { CustomConfirmationService, FilesService, ToastService } from '@shared/services'; -import { FILES_TREE_SELECTORS } from '@shared/tokens'; @Component({ selector: 'osf-files-tree', @@ -39,13 +37,6 @@ import { FILES_TREE_SELECTORS } from '@shared/tokens'; templateUrl: './files-tree.component.html', styleUrl: './files-tree.component.scss', changeDetection: ChangeDetectionStrategy.OnPush, - providers: [ - { - provide: FILES_TREE_SELECTORS, - useFactory: filesTreeSelectorsFactory, - deps: [ActivatedRoute], - }, - ], }) export class FilesTreeComponent implements OnInit, OnDestroy { @HostBinding('class') classes = 'relative'; @@ -57,11 +48,9 @@ export class FilesTreeComponent implements OnInit, OnDestroy { readonly dialogService = inject(DialogService); readonly translateService = inject(TranslateService); - private readonly selectors = inject(FILES_TREE_SELECTORS); - protected readonly files = this.selectors.getFiles(); - protected readonly isLoading = this.selectors.isFilesLoading(); - protected readonly currentFolder = this.selectors.getCurrentFolder(); - + files = input.required(); + isLoading = input(); + currentFolder = input.required(); resourceId = input.required(); actions = input.required(); viewOnly = input(true); @@ -133,6 +122,12 @@ export class FilesTreeComponent implements OnInit, OnDestroy { this.updateFilesList().subscribe(() => this.folderIsOpening.emit(false)); } }); + + effect(() => { + const isLoading = this.isLoading(); + + console.log(isLoading); + }); } openEntry(file: OsfFile) { diff --git a/src/app/shared/components/registration-card/registration-card.component.ts b/src/app/shared/components/registration-card/registration-card.component.ts index cef9a114c..50215f611 100644 --- a/src/app/shared/components/registration-card/registration-card.component.ts +++ b/src/app/shared/components/registration-card/registration-card.component.ts @@ -2,7 +2,6 @@ import { TranslatePipe } from '@ngx-translate/core'; import { Button } from 'primeng/button'; import { Card } from 'primeng/card'; -import { Tag } from 'primeng/tag'; import { DatePipe } from '@angular/common'; import { ChangeDetectionStrategy, Component, input, output } from '@angular/core'; @@ -13,7 +12,7 @@ import { RegistrationCard } from '@osf/shared/models'; @Component({ selector: 'osf-registration-card', - imports: [Card, Button, Tag, TranslatePipe, DatePipe, RouterLink], + imports: [Card, Button, TranslatePipe, DatePipe, RouterLink], templateUrl: './registration-card.component.html', styleUrl: './registration-card.component.scss', changeDetection: ChangeDetectionStrategy.OnPush,