From b3463ed6748fcf5c5ce7c4a50fa8f6757361fae1 Mon Sep 17 00:00:00 2001
From: fsdavid <daviti1@mail.com>
Date: Fri, 6 Sep 2019 15:28:23 +0200
Subject: [PATCH] corrections by PR comments

---
 deploy/app.js                                 |  1 -
 .../atlasViewer.apiService.service.ts         |  1 -
 src/res/css/extra_styles.css                  | 42 +-------------
 src/res/css/plugin_styles.css                 |  8 ---
 .../databrowser.useEffect.ts                  |  2 +-
 .../dedicated/dedicated.component.ts          |  6 --
 .../fileviewer/dedicated/dedicated.style.css  | 13 -----
 .../dedicated/dedicated.template.html         | 16 ++++--
 .../fileviewer/fileviewer.component.ts        |  8 +--
 .../fileviewer/fileviewer.style.css           |  5 --
 .../fileviewer/fileviewer.template.html       | 10 ++--
 .../fileviewer/line/line.chart.component.ts   |  9 +--
 .../modalityPicker.template.html              |  9 ---
 src/ui/layerbrowser/layerbrowser.style.css    |  4 --
 src/ui/menuicons/menuicons.component.ts       | 18 +-----
 .../previewFileDialog.component.ts            | 12 ----
 .../searchItemPreview.component.ts            | 56 ++++++++-----------
 .../searchItemPreview.style.css               |  4 --
 .../searchItemPreview.template.html           | 15 +++--
 src/ui/searchPanel/searchPanel.template.html  |  2 +-
 .../selectedRegions.template.html             |  6 +-
 src/ui/ui.module.ts                           |  3 -
 22 files changed, 63 insertions(+), 187 deletions(-)
 delete mode 100644 src/ui/searchItemPreview/previewFileDialog.component.ts

diff --git a/deploy/app.js b/deploy/app.js
index da0b46b5b..a879b9243 100644
--- a/deploy/app.js
+++ b/deploy/app.js
@@ -9,7 +9,6 @@ app.disable('x-powered-by')
 
 if (process.env.NODE_ENV !== 'production') {
   app.use(require('cors')())
-  console.log(process.env.HBP_CLIENTID)
 }
 
 const hash = string => crypto.createHash('sha256').update(string).digest('hex')
diff --git a/src/atlasViewer/atlasViewer.apiService.service.ts b/src/atlasViewer/atlasViewer.apiService.service.ts
index 78ff0b215..951cc03e5 100644
--- a/src/atlasViewer/atlasViewer.apiService.service.ts
+++ b/src/atlasViewer/atlasViewer.apiService.service.ts
@@ -159,7 +159,6 @@ export interface InteractiveViewerInterface{
     hideAllSegments : ()=>void
     segmentColourMap : Map<number,{red:number,green:number,blue:number}>
     applyColourMap : (newColourMap : Map<number,{red:number,green:number,blue:number}>)=>void
-    // applyLayersColorMap: (map: Map<string, Map<number, {red, green, blue}>>)
     loadLayer : (layerobj:NGLayerObj)=>NGLayerObj
     removeLayer : (condition:{name : string | RegExp})=>string[]
     setLayerVisibility : (condition:{name : string|RegExp},visible:boolean)=>void
diff --git a/src/res/css/extra_styles.css b/src/res/css/extra_styles.css
index 0cca15134..a3863e7db 100644
--- a/src/res/css/extra_styles.css
+++ b/src/res/css/extra_styles.css
@@ -454,47 +454,7 @@ bs-modal-backdrop.modal-backdrop
 
 
 .outline-none {
-    outline: none
-}
-
-.dialog-dark-background-color .mat-dialog-container{
-    padding: 0 0 10px 0;
-    background-color: rgba(0,0,0,0.8);
-    color: rgba(255,255,255,1);
-    border: 1px solid rgba(255,255,255,0.8);
-}
-.dialog-dark-background-color input {
-    caret-color:rgba(255,255,255,1);
-}
-
-.dialog-dark-background-color .mat-form-field-appearance-outline .mat-form-field-outline {
-    color: rgba(255,255,255,0.8);
-}
-
-.dialog-light-background-color .mat-dialog-container{
-    background-color: rgba(255,255,255,0.8);
-    color: rgba(0,0,0,1);
-    border: 1px solid rgba(0,0,0,0.8);
-}
-.dialog-light-background-color input {
-    caret-color: rgba(0, 0, 0, 1);
-}
-
-.dialog-light-background-color .mat-form-field-appearance-outline .mat-form-field-outline {
-    color: rgba(0,0,0,0.8);
-}
-
-@supports ((-webkit-backdrop-filter: blur(2em)) or (backdrop-filter: blur(2em))) {
-    .dialog-dark-background-color .mat-dialog-container {
-        background-color: rgba(0,0,0,0.6);
-        backdrop-filter: blur(11px);
-        -webkit-backdrop-filter: blur(11px);
-    }
-    .dialog-light-background-color .mat-dialog-container {
-        background-color: rgba(255,255,255,0.6);
-        backdrop-filter: blur(11px);
-        -webkit-backdrop-filter: blur(11px);
-    }
+    outline: none;
 }
 
 .cursorPointer {
diff --git a/src/res/css/plugin_styles.css b/src/res/css/plugin_styles.css
index 0d13a20d3..dea00063b 100644
--- a/src/res/css/plugin_styles.css
+++ b/src/res/css/plugin_styles.css
@@ -33,20 +33,12 @@
 [darktheme="true"] [plugincontainer] .btn,
 [darktheme="true"] [plugincontainer] input[type="text"],
 [darktheme="true"] [plugincontainer] input[type="number"],
-[darktheme="true"] [plugincontainer] .list-group-item-dark,
 [darktheme="true"] [plugincontainer] .panel
 {
   background-color:rgba(81,81,81,0.8);
   color:rgba(255,255,255,0.8);
 }
 
-[darktheme="true"] [plugincontainer] .selected-region-chip
-{
-  border-radius: 10px;
-  background-color:rgba(81,81,81,0.8);
-  color:rgba(255,255,255,0.8);
-}
-
 [darktheme="true"] [plugincontainer] .input-group-addon
 {
   background-color:rgba(60,60,60,0.2);
diff --git a/src/ui/databrowserModule/databrowser.useEffect.ts b/src/ui/databrowserModule/databrowser.useEffect.ts
index b5aca5675..01a594fe4 100644
--- a/src/ui/databrowserModule/databrowser.useEffect.ts
+++ b/src/ui/databrowserModule/databrowser.useEffect.ts
@@ -143,4 +143,4 @@ export class DataBrowserUseEffect implements OnDestroy{
 
 const LOCAL_STORAGE_CONST = {
   FAV_DATASET: 'fzj.xg.iv.FAV_DATASET'
-}
\ No newline at end of file
+}
diff --git a/src/ui/databrowserModule/fileviewer/dedicated/dedicated.component.ts b/src/ui/databrowserModule/fileviewer/dedicated/dedicated.component.ts
index f001ed081..218bb6d37 100644
--- a/src/ui/databrowserModule/fileviewer/dedicated/dedicated.component.ts
+++ b/src/ui/databrowserModule/fileviewer/dedicated/dedicated.component.ts
@@ -37,10 +37,4 @@ export class DedicatedViewer{
       ? this.removeDedicatedView()
       : this.showDedicatedView()
   }
-
-  get tooltipText(){
-    return this.isShowing
-      ? 'File is added to Atlas Viewer'
-      : 'Click to add file in Atlas Viewer'
-  }
 }
diff --git a/src/ui/databrowserModule/fileviewer/dedicated/dedicated.style.css b/src/ui/databrowserModule/fileviewer/dedicated/dedicated.style.css
index 428baaf94..c281f7438 100644
--- a/src/ui/databrowserModule/fileviewer/dedicated/dedicated.style.css
+++ b/src/ui/databrowserModule/fileviewer/dedicated/dedicated.style.css
@@ -3,16 +3,3 @@ a
   margin: 0 1em;
   transition: all 200ms ease;
 }
-
-.showingButton {
-
-}
-
-.showButton {
-  box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
-  transition: all 0.3s cubic-bezier(.25,.8,.25,1);
-}
-
-.showButton:hover {
-  box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
-}
diff --git a/src/ui/databrowserModule/fileviewer/dedicated/dedicated.template.html b/src/ui/databrowserModule/fileviewer/dedicated/dedicated.template.html
index 168f73c07..75343992e 100644
--- a/src/ui/databrowserModule/fileviewer/dedicated/dedicated.template.html
+++ b/src/ui/databrowserModule/fileviewer/dedicated/dedicated.template.html
@@ -5,14 +5,18 @@
 
 <div class="w-100 d-flex align-items-center flex-column">
 
-  <div class="d-flex align-items-center flex-column p-3" [ngClass]="!isShowing && 'showButton cursorPointer'" (click)="!isShowing && showDedicatedView()">
-    <i class="far fa-eye h3" [ngStyle]="isShowing && {'color' : '#04D924'}"></i>
-    <span class="ml-2">{{tooltipText}}</span>
-  </div>
+<div *ngIf="isShowing" class="d-flex flex-column align-items-center">
+  <i class="far fa-eye h3" [ngStyle]="isShowing && {'color' : '#04D924'}"></i>
+  <span>File is added</span>
+</div>
+
+  <button *ngIf="!isShowing" mat-button class="p-3 outline-none mat-raised-button" [disabled]="isShowing" color="primary" (click)="!isShowing && showDedicatedView()">
+    <span class="ml-2">Click to add file in Atlas Viewer</span>
+  </button>
 
-  <span *ngIf="isShowing" class="showButton cursorPointer p-3" (click)="removeDedicatedView()">
+  <button mat-button *ngIf="isShowing" class="mat-raised-button p-3 outline-none" color="primary" (click)="removeDedicatedView()">
     <i class="fas fa-eye-slash" style="color: #D93D04"></i>
     Remove file from <b>Atlas Viewer</b>
-  </span>
+  </button>
 
 </div>
diff --git a/src/ui/databrowserModule/fileviewer/fileviewer.component.ts b/src/ui/databrowserModule/fileviewer/fileviewer.component.ts
index 173a7b5a7..2f5cc8224 100644
--- a/src/ui/databrowserModule/fileviewer/fileviewer.component.ts
+++ b/src/ui/databrowserModule/fileviewer/fileviewer.component.ts
@@ -4,7 +4,6 @@ import { DomSanitizer } from '@angular/platform-browser';
 import { interval,from } from 'rxjs';
 import { switchMap,take,retry } from 'rxjs/operators'
 import { ViewerPreviewFile } from 'src/services/state/dataStore.store';
-import { LineChart }  from './line/line.chart.component';
 
 
 @Component({
@@ -87,10 +86,6 @@ export class FileViewer implements OnChanges,OnDestroy,OnInit{
     }
   }
 
-  downloadFile(url) {
-    window.location.href = url;
-  }
-
   get downloadName(){
     return this.previewFile.name
   }
@@ -103,6 +98,7 @@ export class FileViewer implements OnChanges,OnDestroy,OnInit{
 }
 
 interface ChartComponentInterface{
-  canvas : ElementRef
+  canvas : ElementRef,
+  shapedLineChartDatasets: any
 }
 
diff --git a/src/ui/databrowserModule/fileviewer/fileviewer.style.css b/src/ui/databrowserModule/fileviewer/fileviewer.style.css
index d320dd7a8..51438cd57 100644
--- a/src/ui/databrowserModule/fileviewer/fileviewer.style.css
+++ b/src/ui/databrowserModule/fileviewer/fileviewer.style.css
@@ -28,11 +28,6 @@ kg-entry-viewer
   display: block;
 }
 
-div[anchorContainer]
-{
-  padding:0.2em 1em;
-}
-
 div[mimetypeTextContainer]
 {
   margin:1em;
diff --git a/src/ui/databrowserModule/fileviewer/fileviewer.template.html b/src/ui/databrowserModule/fileviewer/fileviewer.template.html
index 0c051a6a9..8403b4c24 100644
--- a/src/ui/databrowserModule/fileviewer/fileviewer.template.html
+++ b/src/ui/databrowserModule/fileviewer/fileviewer.template.html
@@ -62,15 +62,15 @@
   </div>
 </div>
 
-<div anchorContainer class="mt-1 w-100 d-flex justify-content-end">
-  <a      href="JavaScript:void(0)"
-          (click)="childChart.click()"
-          class="outline-none mr-1 ml-1"
+<div class="mt-1 w-100 d-flex justify-content-end pl-1 pr-1 pt-2 pb-2">
+  <button
+          (click)="childChart.downloadChartAsPng()"
+          class="outline-none mr-1 ml-1 btn btn-link p-0"
           container="body"
           *ngIf="childChart && childChart.shapedLineChartDatasets"
           matTooltip="Download line graph as csv">
     <i class="fas fa-file-csv downloadButton"></i>
-  </a>
+  </button>
 
   <a      class="outline-none mr-1 ml-1"
           *ngIf="downloadUrl"
diff --git a/src/ui/databrowserModule/fileviewer/line/line.chart.component.ts b/src/ui/databrowserModule/fileviewer/line/line.chart.component.ts
index 106d205f6..add3df4af 100644
--- a/src/ui/databrowserModule/fileviewer/line/line.chart.component.ts
+++ b/src/ui/databrowserModule/fileviewer/line/line.chart.component.ts
@@ -16,8 +16,9 @@ export class LineChart implements OnChanges{
   @ViewChild('canvas') canvas : ElementRef
   @ViewChild('DownloadLineChartLink', {read: ElementRef}) downloadLineChartLink : ElementRef
 
-  public click() {
-    this.downloadLineChartLink.nativeElement.click()
+  public downloadChartAsPng() {
+    if (this.downloadLineChartLink && this.downloadLineChartLink.nativeElement && this.downloadLineChartLink.nativeElement.click())
+      this.downloadLineChartLink.nativeElement.click()
   }
 
   /**
@@ -113,8 +114,8 @@ export class LineChart implements OnChanges{
     
   }
 
-  async ngOnChanges(){
-    this.shapedLineChartDatasets = await this.lineDatasets.map(lineDataset=>({
+  ngOnChanges(){
+    this.shapedLineChartDatasets = this.lineDatasets.map(lineDataset=>({
       data : lineDataset.data.map((v,idx)=>({
         x : idx,
         y : v
diff --git a/src/ui/databrowserModule/modalityPicker/modalityPicker.template.html b/src/ui/databrowserModule/modalityPicker/modalityPicker.template.html
index b909322c1..35b537a72 100644
--- a/src/ui/databrowserModule/modalityPicker/modalityPicker.template.html
+++ b/src/ui/databrowserModule/modalityPicker/modalityPicker.template.html
@@ -5,15 +5,6 @@
     class="btn btn-sm btn-link ">
     clear all
   </div>
-<!--  <pill-component-->
-<!--    class="mw-60"-->
-<!--    [containerStyle]="{backgroundColor:'rgba(128,128,128,0.5)'}"-->
-<!--    [closeBtnStyle]="{backgroundColor:'rgba(128,128,128,0.8)'}"-->
-<!--    (closeClicked)="uncheckModality(dataM.name)"-->
-<!--    [title]="dataM.name"-->
-<!--    *ngFor="let dataM of checkedModality">-->
-
-<!--  </pill-component>-->
 </div>
 
 <div
diff --git a/src/ui/layerbrowser/layerbrowser.style.css b/src/ui/layerbrowser/layerbrowser.style.css
index 8f24b781f..b38ff0ea0 100644
--- a/src/ui/layerbrowser/layerbrowser.style.css
+++ b/src/ui/layerbrowser/layerbrowser.style.css
@@ -9,7 +9,3 @@
 {
   padding: 0.5em 1em;
 }
-
-.matListItem{
-  height: 30px !important;
-}
diff --git a/src/ui/menuicons/menuicons.component.ts b/src/ui/menuicons/menuicons.component.ts
index b74c6d905..8afb0b82f 100644
--- a/src/ui/menuicons/menuicons.component.ts
+++ b/src/ui/menuicons/menuicons.component.ts
@@ -64,7 +64,6 @@ export class MenuIconsBar{
   public selectedParcellation$: Observable<any>
   public selectedRegions$: Observable<any>
 
-  searchCollapsed = 0
   searchedItemsNumber = 0
   searchLoading = false
   searchMenuFrozen = false
@@ -203,25 +202,10 @@ export class MenuIconsBar{
       .catch(err => this.constantService.catchError(err))
   }
 
-  public searchIconClickHandler(wu: WidgetUnit) {
-      if (this.widgetServices.isMinimised(wu)) {
-          this.widgetServices.unminimise(wu)
-      } else {
-          this.widgetServices.minimise(wu)
-      }
-  }
-  collapseSearchBar() {
-    if (this.searchCollapsed === 2) {
-      this.searchCollapsed = 1
-      setTimeout(() => {this.searchCollapsed = 0}, 500)
-    } else {
-      this.searchCollapsed = 2
-    }
-  }
-
   closeFrozenMenu() {
     this.searchMenuFrozen = false
     this.filePreviewModalClosed = false
+    this.showSearchMenu = false
   }
 
   hideSearchMenu() {
diff --git a/src/ui/searchItemPreview/previewFileDialog.component.ts b/src/ui/searchItemPreview/previewFileDialog.component.ts
deleted file mode 100644
index 04bb82b01..000000000
--- a/src/ui/searchItemPreview/previewFileDialog.component.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-import {Component, Inject} from "@angular/core";
-import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material";
-
-@Component({
-    selector: 'preview-file-dialog-component',
-    template: '<file-viewer [previewFile]="data.previewFile"></file-viewer>',
-})
-export class PreviewFileDialogComponent {
-    constructor(public dialogRef: MatDialogRef<PreviewFileDialogComponent>,
-                @Inject(MAT_DIALOG_DATA) public data: any) {}
-
-}
diff --git a/src/ui/searchItemPreview/searchItemPreview.component.ts b/src/ui/searchItemPreview/searchItemPreview.component.ts
index 3972a1ca2..dc77dcec3 100644
--- a/src/ui/searchItemPreview/searchItemPreview.component.ts
+++ b/src/ui/searchItemPreview/searchItemPreview.component.ts
@@ -1,9 +1,8 @@
-import {Component, EventEmitter, Input, OnDestroy, OnInit, Output} from "@angular/core";
+import {Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild} from "@angular/core";
 import {ViewerPreviewFile} from "src/services/state/dataStore.store";
 import {DatabrowserService} from "src/ui/databrowserModule/databrowser.service";
 import {AtlasViewerConstantsServices} from "src/atlasViewer/atlasViewer.constantService.service";
 import {MatDialog} from "@angular/material";
-import {PreviewFileDialogComponent} from "src/ui/searchItemPreview/previewFileDialog.component";
 import {CHANGE_NAVIGATION} from "src/services/state/viewerState.store";
 import {Store} from "@ngrx/store";
 import {ToastService} from "src/services/toastService.service";
@@ -23,6 +22,9 @@ export class SearchItemPreviewComponent {
     @Output() filePreviewModalClosed: EventEmitter<boolean> = new EventEmitter()
     @Output() closeSearchMenu: EventEmitter<boolean> = new EventEmitter()
 
+    @ViewChild("previewFileModal") previewFileModal: TemplateRef<any>
+
+
     public previewFiles: ViewerPreviewFile[] = []
     public activeFile: ViewerPreviewFile
     private error: string
@@ -30,16 +32,12 @@ export class SearchItemPreviewComponent {
 
     constructor(
         private dbrService: DatabrowserService,
-        private constantsService: AtlasViewerConstantsServices,
+        public constantsService: AtlasViewerConstantsServices,
         private dbService: DatabrowserService,
         public dialog: MatDialog,
         private store: Store<any>,
         private toastService: ToastService,
-    ) {
-        this.renderNode = getRenderNodeFn()
-    }
-
-    public renderNode: (obj: any) => string
+    ) {}
 
     ngOnInit() {
         if (this.datasetName) {
@@ -48,7 +46,6 @@ export class SearchItemPreviewComponent {
                     this.previewFiles = json as ViewerPreviewFile[]
                     if (this.previewFiles.length > 0)
                         this.activeFile = this.previewFiles[0]
-                    this.renderNode = getRenderNodeFn(this.activeFile)
                 })
                 .catch(e => {
                     this.error = JSON.stringify(e)
@@ -60,10 +57,10 @@ export class SearchItemPreviewComponent {
         if (previewFile.mimetype !== 'application/nifti') {
             this.freezeFilesSubMenu.emit(true)
             this.filePreviewModalClosed.emit(false)
-            this.previewFileDialogRef = this.dialog.open(PreviewFileDialogComponent, {
+            this.previewFileDialogRef = this.dialog.open(this.previewFileModal, {
                 width: '400px',
-                data: {previewFile: previewFile},
-                panelClass: ['no-scrolls', this.constantsService.darktheme ? 'dialog-dark-background-color' : 'dialog-light-background-color'],
+                data: previewFile,
+                panelClass: ['no-scrolls'],
             })
             this.previewFileDialogRef.afterClosed().subscribe(result => {
                 this.filePreviewModalClosed.emit(true)
@@ -75,20 +72,21 @@ export class SearchItemPreviewComponent {
             else {
                 this.showDedicatedViewOnAtlasViewer(previewFile)
 
-                this.selectedRegions.forEach(sr => {
-                    if (sr.name.includes(' - left hemisphere')) {
-                        if (previewFile.filename.includes(sr.name.replace(' - left hemisphere', '')) && previewFile.filename.includes('left hemisphere')) {
-                            this.navigateToRegion(sr)
-                            this.closeSearchMenu.emit(true)
-                        }
-                    }
-                    if (sr.name.includes(' - right hemisphere')) {
-                        if (previewFile.filename.includes(sr.name.replace(' - right hemisphere', '')) && previewFile.filename.includes('right hemisphere')) {
-                            this.navigateToRegion(sr)
-                            this.closeSearchMenu.emit(true)
-                        }
-                    }
-                })
+                // this.selectedRegions.forEach(sr => {
+                //     if (sr.name.includes(' - left hemisphere')) {
+                //         if (previewFile.filename.includes(sr.name.replace(' - left hemisphere', '')) && previewFile.filename.includes('left hemisphere')) {
+                //             this.navigateToRegion(sr)
+                //             this.closeSearchMenu.emit(true)
+                //         }
+                //     }
+                //     if (sr.name.includes(' - right hemisphere')) {
+                //         if (previewFile.filename.includes(sr.name.replace(' - right hemisphere', '')) && previewFile.filename.includes('right hemisphere')) {
+                //             this.navigateToRegion(sr)
+                //             this.closeSearchMenu.emit(true)
+                //         }
+                //     }
+                // })
+                this.closeSearchMenu.emit(true)
             }
         }
     }
@@ -123,9 +121,3 @@ export class SearchItemPreviewComponent {
         }
     }
 }
-
-const getRenderNodeFn = ({name : activeFileName = ''} = {}) => ({name = '', path = 'unpathed'}) => name
-    ? activeFileName === name
-        ? `<span class="text-warning">${name}</span>`
-        : name
-    : path
diff --git a/src/ui/searchItemPreview/searchItemPreview.style.css b/src/ui/searchItemPreview/searchItemPreview.style.css
index dba25e0a1..49b2e1807 100644
--- a/src/ui/searchItemPreview/searchItemPreview.style.css
+++ b/src/ui/searchItemPreview/searchItemPreview.style.css
@@ -6,7 +6,3 @@
 .file-items {
     max-height: 300px;
 }
-
-.file-item:hover {
-    background-color: rgba(255, 255, 255, 0.1);
-}
diff --git a/src/ui/searchItemPreview/searchItemPreview.template.html b/src/ui/searchItemPreview/searchItemPreview.template.html
index 902f22bf1..5510c5e63 100644
--- a/src/ui/searchItemPreview/searchItemPreview.template.html
+++ b/src/ui/searchItemPreview/searchItemPreview.template.html
@@ -1,13 +1,14 @@
-<div class="preview-panel-container border" (click)="$event.stopPropagation()">
-    <div class="w-100 d-flex justify-content-center p-2" [ngStyle]="{'border-bottom': constantsService.darktheme && '1px solid #C6C6C6'}">
+<div class="preview-panel-container" (click)="$event.stopPropagation()">
+    <div class="w-100 d-flex justify-content-center p-2">
         Files
     </div>
+    <mat-divider></mat-divider>
+
     <div class="mr-2 ml-2">
         <mat-form-field class="w-100" (click)="$event.stopPropagation()">
             <input matInput
-                   placeholder="&nbsp;&nbsp; Click here to filter"
-                   #filterInput
-                   class="pl-2 pr-2">
+                   placeholder="Click here to filter"
+                   #filterInput>
             <button mat-button *ngIf="filterInput.value" matSuffix mat-icon-button aria-label="Clear"
                     (click)="filterInput.value=''">
                 <i class="fas fa-times"></i>
@@ -26,3 +27,7 @@
         </div>
     </div>
 </div>
+
+<ng-template #previewFileModal let-previewFile>
+    <file-viewer [previewFile]="previewFile"></file-viewer>
+</ng-template>
diff --git a/src/ui/searchPanel/searchPanel.template.html b/src/ui/searchPanel/searchPanel.template.html
index 3b1543868..d78eac28e 100644
--- a/src/ui/searchPanel/searchPanel.template.html
+++ b/src/ui/searchPanel/searchPanel.template.html
@@ -9,7 +9,7 @@
         <div class="d-flex align-items-start" (mouseenter)="filterHovering = true; filterVisible = true; showSelectedRegions = false; showPreview = null;">
             <i class="fas fa-filter"></i>
             <div [hidden]="!filterVisible" class="position-absolute ml-3 ">
-                <mat-card class="border">
+                <mat-card>
                     <modality-picker
                             (click)="$event.stopPropagation();"
                             class="mw-100"
diff --git a/src/ui/selectedRegions/selectedRegions.template.html b/src/ui/selectedRegions/selectedRegions.template.html
index fbda8e9aa..296597f3b 100644
--- a/src/ui/selectedRegions/selectedRegions.template.html
+++ b/src/ui/selectedRegions/selectedRegions.template.html
@@ -1,4 +1,4 @@
-<mat-card class="p-0 selected-regions-panel-container border"
+<mat-card class="p-0 selected-regions-panel-container"
      *ngIf="(selectedRegions$ | async) as sr">
     <div class="mr-2 ml-2">
         <mat-form-field class="w-100" (click)="$event.stopPropagation()">
@@ -13,8 +13,8 @@
         </mat-form-field>
     </div>
     <div class="d-flex align-items-end flex-column mr-2">
-        <span (click)="deselectAllDisplayedRegions(sr, filterInput, true)">Deselect all {{filterInput && 'filtered'}} regions</span>
-        <span *ngIf="filterInput" (click)="deselectAllDisplayedRegions(sr, filterInput, false)">Deselect all regions instead of selected ones</span>
+        <button mat-button (click)="deselectAllDisplayedRegions(sr, filterInput, true)">Deselect all {{filterInput && 'filtered'}} regions</button>
+        <button mat-button *ngIf="filterInput" (click)="deselectAllDisplayedRegions(sr, filterInput, false)">Select only filtered regions</button>
     </div>
     <div class="overflow-auto p-2 selectedRegionsList">
         <mat-chip-list>
diff --git a/src/ui/ui.module.ts b/src/ui/ui.module.ts
index 3f2b3f98f..f68005b4b 100644
--- a/src/ui/ui.module.ts
+++ b/src/ui/ui.module.ts
@@ -64,7 +64,6 @@ import { KgSearchBtnColorPipe } from "src/util/pipes/kgSearchBtnColor.pipe";
 import {SearchPanel} from "src/ui/searchPanel/searchPanel.component";
 import {ElementOutClickDirective} from "src/util/directives/elementOutClick.directive";
 import {SearchItemPreviewComponent} from "src/ui/searchItemPreview/searchItemPreview.component";
-import {PreviewFileDialogComponent} from "src/ui/searchItemPreview/previewFileDialog.component";
 import {SelectedRegionsComponent} from "src/ui/selectedRegions/selectedRegions.component";
 import {FilterWithStringPipe} from "src/util/pipes/filterWithString.pipe";
 
@@ -111,7 +110,6 @@ import {FilterWithStringPipe} from "src/util/pipes/filterWithString.pipe";
     RegionTextSearchAutocomplete,
     SearchPanel,
     SearchItemPreviewComponent,
-    PreviewFileDialogComponent,
     SelectedRegionsComponent,
 
     /* pipes */
@@ -150,7 +148,6 @@ import {FilterWithStringPipe} from "src/util/pipes/filterWithString.pipe";
     NehubaViewerUnit,
     LayerBrowser,
     PluginBannerUI,
-    PreviewFileDialogComponent
   ],
   exports : [
     SubjectViewer,
-- 
GitLab