Skip to content

Commit deb4209

Browse files
committed
Fix arrow nav
1 parent ea9bae7 commit deb4209

File tree

5 files changed

+23
-12
lines changed

5 files changed

+23
-12
lines changed

src/app/file-browser/components/file-list-item/file-list-item.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,13 +596,16 @@ export class FileListItemComponent
596596
this.router.navigate(['/shares/record', this.item.archiveNbr]);
597597
} else {
598598
if (this.item.archiveNumber) {
599+
console.log('here?');
599600
this.router.navigate(
600601
['record', 'v2', (this.item as RecordVO).recordId],
601602
{
602603
relativeTo: this.route,
603604
},
604605
);
605606
} else if (this.item.archiveNbr) {
607+
console.log('here?');
608+
606609
this.router.navigate(['record', this.item.archiveNbr], {
607610
relativeTo: this.route,
608611
});
@@ -1144,7 +1147,7 @@ export class FileListItemComponent
11441147

11451148
private showFolderIcon(): boolean {
11461149
return (
1147-
this.item.isFolder &&
1150+
(this.item.isFolder || this.item.folderId) &&
11481151
this.folderContentsType !== FolderContentsType.NORMAL
11491152
);
11501153
}

src/app/file-browser/components/file-list/file-list.component.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ export class FileListComponent
362362
}
363363

364364
ngOnDestroy() {
365-
// this.dataService.setCurrentFolder();
366365
unsubscribeAll(this.subscriptions);
367366
if (this.unlistenMouseMove) {
368367
this.unlistenMouseMove();
@@ -439,8 +438,6 @@ export class FileListComponent
439438
}
440439

441440
onItemClick(itemClick: ItemClickEvent) {
442-
// this.itemClicked.emit(itemClick);
443-
444441
if (!this.showSidebar || !itemClick.selectable) {
445442
return;
446443
}

src/app/file-browser/components/file-viewer-v2/file-viewer-v2.component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,8 @@ export class FileViewerV2Component implements OnInit, OnDestroy {
405405

406406
navigateToCurrentRecord(index = 0) {
407407
const record = this.records[index];
408-
this.router.navigate(['../', record.archiveNumber], {
408+
this.router.navigate(['../', record.recordId], {
409409
relativeTo: this.route,
410-
queryParamsHandling: 'preserve',
411410
});
412411
this.loadingRecord = false;
413412
}

src/app/models/record-vo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class RecordVO
5252
public uploadFileName;
5353
public downloadName;
5454
public uploadAccountId;
55+
public folderId;
5556
public size;
5657
public description;
5758
public displayDT;
@@ -207,6 +208,7 @@ export interface RecordVOData extends BaseVOData {
207208
thumbURL2000?: string;
208209
thumbnail256?: string;
209210
thumbnail256CloudPath?: string;
211+
folderId?: any;
210212
thumbDT?: any;
211213
fileStatus?: any;
212214
status?: any;

src/app/share-preview/components/share-preview/share-preview.component.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export class SharePreviewComponent implements OnInit, OnDestroy, AfterViewInit {
5656
account: AccountVO = this.accountService.getAccount();
5757
archive: ArchiveVO = this.accountService.getArchive();
5858

59+
private isPrivateLink = false;
60+
5961
sharePreviewVO =
6062
this.route.snapshot.data.sharePreviewVO ||
6163
this.route.snapshot.data.sharePreviewItem;
@@ -204,6 +206,12 @@ export class SharePreviewComponent implements OnInit, OnDestroy, AfterViewInit {
204206

205207
async ngOnInit() {
206208
this.checkAccess();
209+
if (
210+
!this.account &&
211+
this.sharePreviewVO.shareLinkResponse?.accessRestrictions === 'account'
212+
) {
213+
this.isPrivateLink = true;
214+
}
207215

208216
if (!this.hasAccess) {
209217
this.sendGaEvent('previewed');
@@ -260,8 +268,6 @@ export class SharePreviewComponent implements OnInit, OnDestroy, AfterViewInit {
260268
this.account = this.accountService.getAccount();
261269
this.shareArchive = this.sharePreviewVO.ArchiveVO;
262270

263-
this.shareAccount = this.sharePreviewVO.AccountVO;
264-
265271
if (this.isInvite) {
266272
this.hasAccess = this.sharePreviewVO.status.includes('accepted');
267273
}
@@ -689,10 +695,14 @@ export class SharePreviewComponent implements OnInit, OnDestroy, AfterViewInit {
689695

690696
this.fileListClickListener = componentReference.itemClicked.subscribe(
691697
(item) => {
692-
this.router.navigate(['record', 'v2', item.item.archiveNumber], {
693-
relativeTo: this.route,
694-
queryParamsHandling: 'preserve',
695-
});
698+
if (this.isPrivateLink) {
699+
this.showCreateAccountDialog();
700+
} else {
701+
this.router.navigate(['record', 'v2', item.item.archiveNumber], {
702+
relativeTo: this.route,
703+
queryParamsHandling: 'preserve',
704+
});
705+
}
696706
},
697707
);
698708
}

0 commit comments

Comments
 (0)