mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACA-4471] - Added show preview action for files in search results (#2169)
* [ACA-4472] - added preview button on info drawer * [ACA-4472] - added preview button on info drawer * [ACA-4472] - added preview button on info drawer * [ACA-4472] - fixed lint * [ACA-4472] - fixed unit test * [ACA-4472] - fixed wrong import * [ACA-4472] - reverted app.config * [ACA-4472] - added some upgrades for styling * [ACA-4472] - added some upgrades for styling * [ACA-4472] - start fixing e2e * [ACA-4472] - wrong whitespace * [ACA-4471] - readded view button and fixed bug on closing * [ACA-4471] - readded action * [ACA-4238] - fix e2e #2 * [ACA-4471] - readded view button for e2e * [ACA-4471] - readded view button for e2e
This commit is contained in:
@@ -27,12 +27,11 @@ import { Component, HostListener, Input, OnChanges, OnDestroy, OnInit } from '@a
|
||||
import { MinimalNodeEntity, MinimalNodeEntryEntity, SiteEntry } from '@alfresco/js-api';
|
||||
import { ContentActionRef, SidebarTabRef } from '@alfresco/adf-extensions';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { getAppSelection, SetInfoDrawerStateAction, ToggleInfoDrawerAction } from '@alfresco/aca-shared/store';
|
||||
import { getAppSelection, SetInfoDrawerStateAction, ToggleInfoDrawerAction, infoDrawerPreview } from '@alfresco/aca-shared/store';
|
||||
import { AppExtensionService } from '../../services/app.extension.service';
|
||||
import { ContentApiService } from '../../services/content-api.service';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-info-drawer',
|
||||
templateUrl: './info-drawer.component.html'
|
||||
@@ -49,6 +48,7 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
tabs: Array<SidebarTabRef> = [];
|
||||
actions: Array<ContentActionRef> = [];
|
||||
onDestroy$ = new Subject<boolean>();
|
||||
preventFromClosing = false;
|
||||
|
||||
@HostListener('keydown.escape')
|
||||
onEscapeKeyboardEvent(): void {
|
||||
@@ -65,12 +65,21 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
.subscribe(() => {
|
||||
this.actions = this.extensions.getAllowedSidebarActions();
|
||||
});
|
||||
|
||||
this.store
|
||||
.select(infoDrawerPreview)
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe((isInfoDrawerPreviewOpened) => {
|
||||
this.preventFromClosing = isInfoDrawerPreviewOpened;
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.onDestroy$.next(true);
|
||||
this.onDestroy$.complete();
|
||||
this.store.dispatch(new SetInfoDrawerStateAction(false));
|
||||
if (!this.preventFromClosing) {
|
||||
this.store.dispatch(new SetInfoDrawerStateAction(false));
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges() {
|
||||
|
Reference in New Issue
Block a user