diff --git a/docs/releases/v2.1.3.md b/docs/releases/v2.1.3.md new file mode 100644 index 0000000000000000000000000000000000000000..b1434e34db16eeec7f106491fffe9f0065ddbd67 --- /dev/null +++ b/docs/releases/v2.1.3.md @@ -0,0 +1,8 @@ +# v2.1.3 + +28 April 2020 + +## Bugfixes + +- Fixed a bug preventing users from scrolling the fetched dataset containers (#508) +- Fixed a bug - change template from region menu was showing irrelevant regions (#507) diff --git a/e2e/src/layout/scrollDatasetContainer.prod.e2e-spec.js b/e2e/src/layout/scrollDatasetContainer.prod.e2e-spec.js new file mode 100644 index 0000000000000000000000000000000000000000..7d80e04fcb7edce754ba20e99afcd28c562c2b19 --- /dev/null +++ b/e2e/src/layout/scrollDatasetContainer.prod.e2e-spec.js @@ -0,0 +1,43 @@ +const { AtlasPage } = require('../util') + +describe('> scroll dataset container', () => { + let iavPage + + beforeEach(async () => { + iavPage = new AtlasPage() + await iavPage.init() + }) + + it('> can scroll to the end', async () => { + await iavPage.goto() + await iavPage.selectTitleCard('ICBM 2009c Nonlinear Asymmetric') + await iavPage.wait(1000) + await iavPage.waitForAsync() + + const btnCssSelector = `[aria-label="Toggle explore panel"]` + // const btnCssSelector = `button[mat-stroked-button].m-1.flex-grow-1.overflow-hidden` + + // TODO use .clickByCss method in future + // TODO import aria label from common/constant.js in future + await iavPage._browser + .findElement( By.css(btnCssSelector) ) + .click() + + await iavPage.clearAlerts() + + const scrollContainerCssSelector = '[aria-label="List of datasets"]' + // const scrollContainerCssSelector = 'cdk-virtual-scroll-viewport' + + let countdown = 100 + do { + await iavPage.scrollElementBy(scrollContainerCssSelector, { + delta: [0, 100] + }) + await iavPage.wait(100) + countdown -- + }while(countdown > 0) + + const val = await iavPage.getScrollStatus(scrollContainerCssSelector) + expect(val).toBeGreaterThanOrEqual(10000) + }) +}) \ No newline at end of file diff --git a/e2e/src/util.js b/e2e/src/util.js index a2c5e5653a045124acbfb5f92daaad2155f984eb..452ade043817a5e42805a28f88b7ad0b604ee2e4 100644 --- a/e2e/src/util.js +++ b/e2e/src/util.js @@ -104,6 +104,23 @@ class WdBase{ .perform() } + async scrollElementBy(cssSelector, options) { + const { delta } = options + await this._browser.executeScript(() => { + const { delta } = arguments[1] + const el = document.querySelector(arguments[0]) + el.scrollBy(...delta) + }, cssSelector, { delta }) + } + + async getScrollStatus(cssSelector) { + const val = await this._browser.executeScript(() => { + const el = document.querySelector(arguments[0]) + return el.scrollTop + }, cssSelector) + return val + } + async cursorMoveToAndClick({ position }) { const { x, y } = verifyPosition(position) return this._driver.actions() diff --git a/mkdocs.yml b/mkdocs.yml index e4224574edb095887ebf54101f62811f3cd45f36..15b7b28d9767ccfc45bdaf6e19014bacc0ec79d1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -29,6 +29,7 @@ pages: - Fetching datasets: 'advanced/datasets.md' - Display non-atlas volumes: 'advanced/otherVolumes.md' - Release notes: + - v2.1.3: 'releases/v2.1.3.md' - v2.1.2: 'releases/v2.1.2.md' - v2.1.1: 'releases/v2.1.1.md' - v2.1.0: 'releases/v2.1.0.md' diff --git a/src/ui/databrowserModule/databrowser/databrowser.template.html b/src/ui/databrowserModule/databrowser/databrowser.template.html index 9e0c3bd02a2db9bc6217186a3beb0092dd366c74..4f489df1bbf7c701b4e4fa988e345c1a2137eecb 100644 --- a/src/ui/databrowserModule/databrowser/databrowser.template.html +++ b/src/ui/databrowserModule/databrowser/databrowser.template.html @@ -68,12 +68,14 @@ <ng-container *ngIf="dataentries | filterDataEntriesByMethods : visibleCountedDataM as filteredDataEntry"> <mat-card-content class="dataset-container w-100 overflow-hidden"> + <!-- TODO export aria labels to common/constants --> <cdk-virtual-scroll-viewport + [attr.aria-label]="'List of datasets'" class="h-100" minBufferPx="200" maxBufferPx="400" itemSize="50"> - <div class="virtual-scroll-element overflow-hidden" *cdkVirtualFor="let dataset of filteredDataEntry; trackBy: trackByFn; templateCacheSize: 0; let index = index"> + <div class="virtual-scroll-element overflow-hidden" *cdkVirtualFor="let dataset of filteredDataEntry; trackBy: trackByFn; templateCacheSize: 20; let index = index"> <!-- divider, show if not first --> <mat-divider *ngIf="index !== 0"></mat-divider> diff --git a/src/ui/databrowserModule/singleDataset/singleDataset.base.ts b/src/ui/databrowserModule/singleDataset/singleDataset.base.ts index dfb7f94a34a6bb746d7049611aae6bdd31c67e92..6d6a530337d3c8caf0c6d77a9eaa554980b349b8 100644 --- a/src/ui/databrowserModule/singleDataset/singleDataset.base.ts +++ b/src/ui/databrowserModule/singleDataset/singleDataset.base.ts @@ -120,6 +120,10 @@ export class SingleDatasetBase implements OnInit, OnChanges { } } + // TODO this is not perfect logic for singledataset + // singledataset.base.ts should be tidied up in general + // fullId, kgId, dataset... too many different entries + public ngOnChanges(){ if (!this.kgId) { const fullId = this.fullId || this.dataset?.fullId diff --git a/src/ui/searchSideNav/searchSideNav.template.html b/src/ui/searchSideNav/searchSideNav.template.html index 765869826cba77a7218f5404a6656d6a4c3ae56f..33fb69be3b7c417bd95570eb6c1174912a3bb38e 100644 --- a/src/ui/searchSideNav/searchSideNav.template.html +++ b/src/ui/searchSideNav/searchSideNav.template.html @@ -12,7 +12,9 @@ <!-- footer content --> <div class="d-flex flex-row justify-content-center" card-footer> + <!-- TODO export all aria labels to common/constants.js in future patch --> <button mat-stroked-button + aria-label="Toggle explore panel" *ngIf="!(sidePanelExploreCurrentViewIsOpen$ | async)" (click)="expandSidePanelCurrentView()" [disabled]="!(viewerStateController.parcellationSelected$ | async)" diff --git a/src/ui/signinBanner/signinBanner.components.ts b/src/ui/signinBanner/signinBanner.components.ts index 0e9c9cc975dc52743682910823bee131cd6d5af7..56ec363fe859f8856d44ae9cce700f90f96f420f 100644 --- a/src/ui/signinBanner/signinBanner.components.ts +++ b/src/ui/signinBanner/signinBanner.components.ts @@ -73,6 +73,12 @@ export class SigninBanner { } } + resetScreenshotTaking() { + this.takingScreenshot = true + //ToDo find out better way to detect changes + setTimeout(() => this.changeDetectionRef.detectChanges()) + } + disableScreenshotTaking() { this.takingScreenshot = false this.changeDetectionRef.detectChanges() diff --git a/src/ui/signinBanner/signinBanner.template.html b/src/ui/signinBanner/signinBanner.template.html index 9b50940756bb29f1a7d11beb6fef30e85124022d..455b172e9299a35b150dfd73fef37fc2aacb7c5b 100644 --- a/src/ui/signinBanner/signinBanner.template.html +++ b/src/ui/signinBanner/signinBanner.template.html @@ -42,7 +42,7 @@ <ng-template [ngIf]="user$ | async" [ngIfElse]="notLoggedInTmpl" let-user="ngIf"> {{ (user && user.name || 'Unnamed User').slice(0,1) }} </ng-template> - + <ng-template #notLoggedInTmpl> <i class="fas fa-user"></i> </ng-template> @@ -166,7 +166,7 @@ [ripple]="true"> </single-dataset-list-view> - + </mat-list-item> </mat-list> </ng-template> @@ -176,5 +176,5 @@ *ngIf="takingScreenshot" class="position-fixed fixed-top" (screenshotTaking)="disableScreenshotTaking()" - (resetScreenshot)="$event? takingScreenshot = true : disableScreenshotTaking()"> + (resetScreenshot)="$event? resetScreenshotTaking() : disableScreenshotTaking()"> </take-screenshot>