Skip to content

Commit 39cb2b2

Browse files
committed
fix(files): fixed comments
1 parent c1ff4b0 commit 39cb2b2

6 files changed

Lines changed: 22 additions & 13 deletions

File tree

src/app/features/files/components/files-tree-explorer/files-tree-explorer.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class FilesTreeExplorerComponent {
7373
readonly storage = input.required<FileLabelModel | null>();
7474

7575
readonly totalCount = input<number>(0);
76-
readonly isLoading = input<boolean>();
76+
readonly isLoading = input<boolean>(false);
7777
readonly resourceId = input.required<string>();
7878
readonly resourceType = input<CurrentResourceType>(CurrentResourceType.Projects);
7979
readonly viewOnly = input<boolean>(true);

src/app/features/files/components/move-file-dialog/move-file-dialog.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,14 +184,14 @@ export class MoveFileDialogComponent {
184184
tap(() => this.completeMove()),
185185
finalize(() => {
186186
this.config.header = this.translateService.instant('files.dialogs.moveFile.title');
187+
this.isFilesUpdating.set(false);
187188
}),
188189
takeUntilDestroyed(this.destroyRef)
189190
)
190191
.subscribe();
191192
}
192193

193194
private completeMove(): void {
194-
this.isFilesUpdating.set(false);
195195
this.actions.setCurrentFolder(this.initialFolder);
196196
this.actions.setMoveDialogCurrentFolder(null);
197197
this.dialogRef.close(true);

src/app/features/files/pages/file-detail/file-detail.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class FileDetailComponent implements OnDestroy {
150150
selectedTab = FileDetailTab.Details;
151151

152152
fileGuid = '';
153-
fileVersion = '';
153+
fileVersion = signal('');
154154

155155
embedItems = [
156156
{
@@ -190,8 +190,8 @@ export class FileDetailComponent implements OnDestroy {
190190

191191
readonly headerTitle = computed(() => {
192192
const fileName = this.file()?.name ?? '';
193-
if (!this.fileVersion) return fileName;
194-
return `${fileName} (${this.translateService.instant('project.wiki.version.title')} ${this.fileVersion})`;
193+
if (!this.fileVersion()) return fileName;
194+
return `${fileName} (${this.translateService.instant('project.wiki.version.title')} ${this.fileVersion()})`;
195195
});
196196

197197
private readonly metaTagsData = computed(() => {
@@ -233,8 +233,8 @@ export class FileDetailComponent implements OnDestroy {
233233
}
234234

235235
onOpenRevision(version: string): void {
236-
if (this.fileVersion !== version) {
237-
this.fileVersion = version;
236+
if (this.fileVersion() !== version) {
237+
this.fileVersion.set(version);
238238
this.getIframeLink(version);
239239
this.isIframeLoading = true;
240240
}

src/app/features/files/pages/files/files.component.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
<p-select
1414
class="w-full"
1515
inputId="in_label"
16+
variant="filled"
1617
[options]="rootFoldersOptions()"
18+
[disabled]="isButtonDisabled()"
1719
[(ngModel)]="currentRootFolder"
1820
(onChange)="handleRootFolderChange($event.value)"
19-
variant="filled"
2021
/>
2122
}
2223
</div>

src/app/features/project/overview/components/files-widget/files-widget.component.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
PLATFORM_ID,
1919
signal,
2020
} from '@angular/core';
21+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
2122
import { Router } from '@angular/router';
2223

2324
import { FileProvider } from '@osf/features/files/constants';
@@ -170,11 +171,14 @@ export class FilesWidgetComponent {
170171
return;
171172
}
172173

173-
this.filesService.getFileGuid(file.id).subscribe((file) => {
174-
if (file.guid) {
175-
this.openFile(file.guid);
176-
}
177-
});
174+
this.filesService
175+
.getFileGuid(file.id)
176+
.pipe(takeUntilDestroyed(this.destroyRef))
177+
.subscribe((file) => {
178+
if (file.guid) {
179+
this.openFile(file.guid);
180+
}
181+
});
178182
}
179183

180184
onLoadFiles(event: FilePageLinkModel) {

src/styles/overrides/tree.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,9 @@
7272
}
7373
}
7474
}
75+
76+
.p-tree-loading-icon {
77+
color: var(--pr-blue-1);
78+
}
7579
}
7680
}

0 commit comments

Comments
 (0)