diff --git a/lib/core/viewer/components/viewer.component.html b/lib/core/viewer/components/viewer.component.html index 378008bab9..019b091725 100644 --- a/lib/core/viewer/components/viewer.component.html +++ b/lib/core/viewer/components/viewer.component.html @@ -3,7 +3,7 @@ [class.adf-viewer-overlay-container]="overlayMode" [class.adf-viewer-inline-container]="!overlayMode"> -
+
@@ -93,7 +93,7 @@ -
+

{{ 'ADF_VIEWER.LOADING' | translate }}

@@ -101,61 +101,51 @@
-
+
- -
- - - - -
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
diff --git a/lib/core/viewer/components/viewer.component.scss b/lib/core/viewer/components/viewer.component.scss index cb11d12633..c1646fc4f9 100644 --- a/lib/core/viewer/components/viewer.component.scss +++ b/lib/core/viewer/components/viewer.component.scss @@ -89,11 +89,13 @@ &__sidebar { width: 350px; + height: 100%; display: block; padding: 0; background-color: #fafafa; - box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.27); + box-shadow: 0 2px 4px 0 mat-color($foreground, text, 0.27); border-left: 1px solid mat-color($foreground, text, 0.07); + overflow: auto; } } } diff --git a/lib/core/viewer/components/viewer.component.spec.ts b/lib/core/viewer/components/viewer.component.spec.ts index 826619695d..3822c4a44c 100644 --- a/lib/core/viewer/components/viewer.component.spec.ts +++ b/lib/core/viewer/components/viewer.component.spec.ts @@ -17,7 +17,7 @@ import { Location } from '@angular/common'; import { SpyLocation } from '@angular/common/testing'; -import { Component, DebugElement } from '@angular/core'; +import { Component } from '@angular/core'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { AlfrescoApiService, RenditionsService } from '../../services'; @@ -37,6 +37,7 @@ import { ViewerOpenWithComponent } from './viewer-open-with.component'; import { ViewerSidebarComponent } from './viewer-sidebar.component'; import { ViewerToolbarComponent } from './viewer-toolbar.component'; import { ViewerComponent } from './viewer.component'; +import { FlexLayoutModule } from '@angular/flex-layout'; declare let jasmine: any; @@ -114,7 +115,6 @@ describe('ViewerComponent', () => { let component: ViewerComponent; let fixture: ComponentFixture; - let debug: DebugElement; let alfrescoApiService: AlfrescoApiService; let element: HTMLElement; @@ -122,7 +122,8 @@ describe('ViewerComponent', () => { TestBed.configureTestingModule({ imports: [ ToolbarModule, - MaterialModule + MaterialModule, + FlexLayoutModule ], declarations: [ ViewerComponent, @@ -156,7 +157,6 @@ describe('ViewerComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(ViewerComponent); - debug = fixture.debugElement; element = fixture.nativeElement; component = fixture.componentInstance; @@ -207,22 +207,28 @@ describe('ViewerComponent', () => { expect(customElement.querySelector('.adf-viewer-container-more-actions')).toBeDefined(); }); - it('should display left sidebar', () => { + it('should display sidebar on the left side', () => { + component.showSidebar = true; component.sidebarPosition = 'left'; fixture.detectChanges(); - expect(element.querySelector('.adf-viewer__sidebar-left')).toBeDefined(); + let sidebar = element.querySelector('.adf-viewer__sidebar'); + expect(getComputedStyle(sidebar).order).toEqual('1'); }); - it('should display right sidebar', () => { + it('should display sidebar on the right side', () => { + component.showSidebar = true; component.sidebarPosition = 'right'; fixture.detectChanges(); - expect(element.querySelector('.adf-viewer__sidebar-right')).toBeDefined(); + let sidebar = element.querySelector('.adf-viewer__sidebar'); + expect(getComputedStyle(sidebar).order).toEqual('2'); }); - it('should display right sidebar as fallback', () => { + it('should display sidebar on the right side as fallback', () => { + component.showSidebar = true; component.sidebarPosition = 'unknown-value'; fixture.detectChanges(); - expect(element.querySelector('.adf-viewer__sidebar-right')).toBeDefined(); + let sidebar = element.querySelector('.adf-viewer__sidebar'); + expect(getComputedStyle(sidebar).order).toEqual('2'); }); describe('Toolbar', () => { diff --git a/lib/core/viewer/viewer.module.ts b/lib/core/viewer/viewer.module.ts index 983fd525af..bc07e0dfbd 100644 --- a/lib/core/viewer/viewer.module.ts +++ b/lib/core/viewer/viewer.module.ts @@ -33,6 +33,7 @@ import { ViewerSidebarComponent } from './components/viewer-sidebar.component'; import { ViewerToolbarComponent } from './components/viewer-toolbar.component'; import { ViewerComponent } from './components/viewer.component'; import { ViewerExtensionDirective } from './directives/viewer-extension.directive'; +import { FlexLayoutModule } from '@angular/flex-layout'; @NgModule({ imports: [ @@ -40,7 +41,8 @@ import { ViewerExtensionDirective } from './directives/viewer-extension.directiv MaterialModule, TranslateModule, ToolbarModule, - PipeModule + PipeModule, + FlexLayoutModule ], declarations: [ ViewerComponent,