Skip to content

Commit 02ce835

Browse files
committed
[PER-10107] Open preview on one click
1 parent f3e57b1 commit 02ce835

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<div
22
class="file-list-item"
33
(click)="onItemClick($event)"
4-
(dblclick)="showUnlistedPreview($event)"
54
[ngClass]="{
65
'grid-view': inGridView,
76
selected: isSelected,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ describe('FileListItemComponent', () => {
204204
component.isUnlistedShare = true;
205205
component.item.isFolder = false;
206206
spyOn(component, 'goToItem');
207-
component.showUnlistedPreview();
207+
component.onItemClick({} as MouseEvent);
208208

209209
expect(component.goToItem).toHaveBeenCalled();
210210
});

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -491,18 +491,13 @@ export class FileListItemComponent
491491
}
492492
}
493493

494-
showUnlistedPreview() {
494+
onItemClick(event: MouseEvent) {
495495
if (this.isUnlistedShare) {
496496
//TO DO: make preview for folder --> story PER-10314
497497
if (this.item.isFolder) {
498498
return;
499499
}
500500
this.goToItem();
501-
}
502-
}
503-
504-
onItemClick(event: MouseEvent) {
505-
if (this.isUnlistedShare) {
506501
return;
507502
}
508503
if (this.device.isMobileWidth() || !this.canSelect) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class FileViewerComponent implements OnInit, OnDestroy {
139139

140140
if (this.isUnlistedShare) {
141141
const response = await this.api.record.get(
142-
[this.currentRecord.recordId],
142+
[this.currentRecord],
143143
this.shareLinksService.currentShareToken,
144144
);
145145
this.setRecordsToPreview(response.getRecordVO());

0 commit comments

Comments
 (0)