From e3dd280519795dfdf9127e70cb51119c63785eeb Mon Sep 17 00:00:00 2001 From: DaSCH Bot <50987250+daschbot@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:16:18 +0200 Subject: [PATCH 1/4] chore(main): release 11.15.0 (#1686) --- CHANGELOG.md | 20 ++++++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ecbfe76a6..b421fa4564 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [11.15.0](https://github.com/dasch-swiss/dsp-das/compare/v11.14.0...v11.15.0) (2024-07-12) + + +### Enhancements + +* resource image format settings (DEV-3834) ([#1687](https://github.com/dasch-swiss/dsp-das/issues/1687)) ([2a4175d](https://github.com/dasch-swiss/dsp-das/commit/2a4175db7a122e9d145624c9032dcd1f342eae07)) + + +### Bug Fixes + +* does not preserve image format on resource change (DEV-3834) ([#1692](https://github.com/dasch-swiss/dsp-das/issues/1692)) ([ff35be7](https://github.com/dasch-swiss/dsp-das/commit/ff35be7ff25b191d79adc271d5364d5315ea8ad5)) +* opening Salsah links (DEV-3830) ([#1689](https://github.com/dasch-swiss/dsp-das/issues/1689)) ([c54a249](https://github.com/dasch-swiss/dsp-das/commit/c54a2496f6cbd5eb0691959dc2c88fb8b354dcfc)) +* remove link value that is marked as deleted ([#1685](https://github.com/dasch-swiss/dsp-das/issues/1685)) ([8b74f0a](https://github.com/dasch-swiss/dsp-das/commit/8b74f0a56463e3557687a3fd5f64a2b0045ccb69)) +* Url encode ingest upload url in order to support special characters in filenames (DEV-3865) ([#1691](https://github.com/dasch-swiss/dsp-das/issues/1691)) ([b6c1f4c](https://github.com/dasch-swiss/dsp-das/commit/b6c1f4cc37eaba6fe01a4dfafb957863fff66d3a)) + + +### Maintenance + +* **test:** Use docker compose in justfile instead of deprecated docker-compose ([#1690](https://github.com/dasch-swiss/dsp-das/issues/1690)) ([0536a23](https://github.com/dasch-swiss/dsp-das/commit/0536a23287c7bbc2e2b4ee6e441fd9ed47f31845)) + ## [11.14.0](https://github.com/dasch-swiss/dsp-das/compare/v11.13.0...v11.14.0) (2024-07-08) diff --git a/package-lock.json b/package-lock.json index 3a5fae4d27..8e0ee398a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dsp-app", - "version": "11.14.0", + "version": "11.15.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dsp-app", - "version": "11.14.0", + "version": "11.15.0", "dependencies": { "@angular/animations": "^16.2.12", "@angular/cdk": "^16.2.12", diff --git a/package.json b/package.json index 6319a1094b..491d979898 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsp-app", - "version": "11.14.0", + "version": "11.15.0", "repository": { "type": "git", "url": "https://github.com/dasch-swiss/dsp-app.git" From 427cb0342275391a04d8074ca0c0dae0f40841d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Kleinb=C3=B6lting?= Date: Wed, 17 Jul 2024 16:18:47 +0200 Subject: [PATCH 2/4] test: Migrate tests to k6/browser which left experimental stage, run cloud test in dedicated project (#1694) --- k6/Dockerfile.influxdb | 6 ------ k6/docker-compose.yml | 11 ++++++++--- k6/justfile | 4 ++-- k6/options/options.js | 1 + k6/pages/resource-page.js | 2 +- k6/pages/single-resource-page.js | 9 +++++++++ k6/tests/first-page-load.js | 14 +++++++++----- k6/tests/load-resource.js | 14 +++++++++----- k6/tests/load-single-resource.js | 30 ++++++++++++++++++++++++++++++ 9 files changed, 69 insertions(+), 22 deletions(-) delete mode 100644 k6/Dockerfile.influxdb create mode 100644 k6/pages/single-resource-page.js create mode 100644 k6/tests/load-single-resource.js diff --git a/k6/Dockerfile.influxdb b/k6/Dockerfile.influxdb deleted file mode 100644 index c336fc3b73..0000000000 --- a/k6/Dockerfile.influxdb +++ /dev/null @@ -1,6 +0,0 @@ -FROM influxdb:2.7.6-alpine - -# Create a k6 db -RUN /bin/bash -c "influxd run & sleep 5 && influx -execute 'CREATE DATABASE k6' && kill %1 && sleep 5" - -CMD ["influxd"] diff --git a/k6/docker-compose.yml b/k6/docker-compose.yml index 1a33ae4128..47f2ca6d1a 100644 --- a/k6/docker-compose.yml +++ b/k6/docker-compose.yml @@ -1,10 +1,15 @@ services: influxdb: - build: - context: . - dockerfile: Dockerfile.influxdb + image: influxdb:1.8-alpine + platform: linux/amd64 ports: - '8086:8086' + environment: + - DOCKER_INFLUXDB_INIT_MODE=setup + - DOCKER_INFLUXDB_INIT_USERNAME=admin + - DOCKER_INFLUXDB_INIT_PASSWORD=admin + - DOCKER_INFLUXDB_INIT_ORG=dasch + - DOCKER_INFLUXDB_INIT_BUCKET=k6 grafana: build: context: . diff --git a/k6/justfile b/k6/justfile index b72bd427fb..9e753a7b2b 100644 --- a/k6/justfile +++ b/k6/justfile @@ -19,7 +19,7 @@ run testToRun=testToRun: # Run the test in k6 cloud run-cloud testToRun=testToRun: - APP_URL={{appUrl}} k6 cloud tests/{{testToRun}}.js + k6 cloud tests/{{testToRun}}.js # Start grafana grafana-up: @@ -29,7 +29,7 @@ grafana-up: # Stop grafana grafana-down: - docker-compose down + docker compose down # Run the test and export to local grafana run-grafana testToRun=testToRun: diff --git a/k6/options/options.js b/k6/options/options.js index 46253bca2a..57de244f75 100644 --- a/k6/options/options.js +++ b/k6/options/options.js @@ -37,6 +37,7 @@ export const defaultScenario = { export const defaultOptions = { cloud: { + projectID: 3704846, distribution: { distributionLabel1: { loadZone: 'amazon:de:frankfurt', percent: 100 }, }, diff --git a/k6/pages/resource-page.js b/k6/pages/resource-page.js index e3f0fc9d2a..7911faa19c 100644 --- a/k6/pages/resource-page.js +++ b/k6/pages/resource-page.js @@ -1,7 +1,7 @@ export class ResourcePage { constructor(page) { this.page = page; - this.rsourcelabel = page.locator('.resource-header > .resource-label > h4'); + this.resourcelabel = page.locator('.resource-header > .resource-label > h4'); } async goto() { await this.page.goto(__ENV.APP_URL + '/project/yTerZGyxjZVqFMNNKXCDPF/ontology/beol/basicLetter'); diff --git a/k6/pages/single-resource-page.js b/k6/pages/single-resource-page.js new file mode 100644 index 0000000000..d876fda901 --- /dev/null +++ b/k6/pages/single-resource-page.js @@ -0,0 +1,9 @@ +export class SingleResourcePage { + constructor(page) { + this.page = page; + this.resourcelabel = page.locator('.resource-header > .resource-label > h4'); + } + async goto() { + await this.page.goto(__ENV.APP_URL + '/project/yTerZGyxjZVqFMNNKXCDPF/ontology/beol/basicLetter'); + } +} diff --git a/k6/tests/first-page-load.js b/k6/tests/first-page-load.js index c55a531194..ea832bb6f7 100644 --- a/k6/tests/first-page-load.js +++ b/k6/tests/first-page-load.js @@ -1,4 +1,4 @@ -import { browser } from 'k6/experimental/browser'; +import { browser } from 'k6/browser'; import { check } from 'k6'; import { HomePage } from '../pages/home-page.js'; import { defaultOptions } from '../options/options.js'; @@ -9,20 +9,24 @@ const errorCounter = new Counter('errors'); export const options = defaultOptions; export default async function () { - const page = browser.newPage(); + const context = await browser.newContext(); + const page = await context.newPage(); const homepage = new HomePage(page); try { await homepage.goto(); - page.screenshot({ path: 'screenshots/homepage.png' }); + + await page.waitForNavigation(); + const title = await page.title.textContent(); let success = check(homepage, { - title: p => p.title.textContent() == 'Projects Overview', + title: title => title == 'Projects Overview', }); if (!success) { errorCounter.add(1); } + await page.screenshot({ path: 'screenshots/homepage.png' }); } finally { - page.close(); + await page.close(); } } diff --git a/k6/tests/load-resource.js b/k6/tests/load-resource.js index 61c6db1f08..c356a53028 100644 --- a/k6/tests/load-resource.js +++ b/k6/tests/load-resource.js @@ -1,4 +1,4 @@ -import { browser } from 'k6/experimental/browser'; +import { browser } from 'k6/browser'; import { check } from 'k6'; import { ResourcePage } from '../pages/resource-page.js'; import { defaultOptions } from '../options/options.js'; @@ -8,19 +8,23 @@ export const options = defaultOptions; export const errorCounter = new Counter('errors'); export default async function () { - const page = browser.newPage(); + const context = await browser.newContext(); + const page = await context.newPage(); const homepage = new ResourcePage(page); try { await homepage.goto(); + + await page.waitForNavigation(); + const resourceLabel = await page.resourcelabel.textContent(); const success = check(homepage, { - resourcelabel: p => p.rsourcelabel.textContent() == '1723-02-06_Scheuchzer_Johann_Jakob-Bernoulli_Johann_I', + resourceLabel: resourceLabel => resourceLabel == '1723-02-06_Scheuchzer_Johann_Jakob-Bernoulli_Johann_I', }); if (!success) { errorCounter.add(1); } - page.screenshot({ path: 'screenshots/resource-page.png' }); + await page.screenshot({ path: 'screenshots/resource-page.png' }); } finally { - page.close(); + await page.close(); } } diff --git a/k6/tests/load-single-resource.js b/k6/tests/load-single-resource.js new file mode 100644 index 0000000000..06e45c4fee --- /dev/null +++ b/k6/tests/load-single-resource.js @@ -0,0 +1,30 @@ +import { browser } from 'k6/browser'; +import { check } from 'k6'; +import { defaultOptions } from '../options/options.js'; +import { Counter } from 'k6/metrics'; +import { SingleResourcePage } from '../pages/single-resource-page.js'; + +export const options = defaultOptions; +export const errorCounter = new Counter('errors'); + +export default async function () { + const context = await browser.newContext(); + const page = await context.newPage(); + const homepage = new SingleResourcePage(page); + + try { + await homepage.goto(); + + await page.waitForNavigation(); + const resourceLabel = await page.resourcelabel.textContent(); + const success = check(homepage, { + resourceLabel: resourceLabel => resourceLabel == 'transcription of M087-10-TN', + }); + if (!success) { + errorCounter.add(1); + } + await page.screenshot({ path: 'screenshots/single-resource-page.png' }); + } finally { + await page.close(); + } +} From 6ca419ca5615d7fc4a9411bf44daddfda1d7cd1d Mon Sep 17 00:00:00 2001 From: Irmantas Kaukas Date: Wed, 17 Jul 2024 17:25:45 +0200 Subject: [PATCH 3/4] fix: projectRestrictedViewSettings selector (DEV-3888) (#1696) --- .../shared/app-state/src/lib/projects/projects.selectors.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/vre/shared/app-state/src/lib/projects/projects.selectors.ts b/libs/vre/shared/app-state/src/lib/projects/projects.selectors.ts index b49678a297..4e1662193c 100644 --- a/libs/vre/shared/app-state/src/lib/projects/projects.selectors.ts +++ b/libs/vre/shared/app-state/src/lib/projects/projects.selectors.ts @@ -166,10 +166,10 @@ export class ProjectsSelectors { dspApiConfig: DspAppConfig, params: Params ): ProjectRestrictedViewSettings | RestrictedViewResponse | undefined { - const projectIri = ProjectsSelectors.getProjectIri(params, dspApiConfig, resource); - return !projectIri || !state.projectRestrictedViewSettings[projectIri] + const projectUuid = params[`${RouteConstants.uuidParameter}`]; + return !projectUuid || !state.projectRestrictedViewSettings[projectUuid] ? undefined - : state.projectRestrictedViewSettings[projectIri].value; + : state.projectRestrictedViewSettings[projectUuid].value; } private static getProjectIri(params: Params, dspApiConfig: DspAppConfig, resource: DspResource) { From 868054281cf952ab9c37e9b3b8d9c061ee37d8a9 Mon Sep 17 00:00:00 2001 From: Julien Schneider Date: Thu, 18 Jul 2024 12:35:29 +0200 Subject: [PATCH 4/4] fix: compound object page reset when loading a new resource (#1698) --- .../src/lib/resource.component.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/vre/shared/app-resource-page/src/lib/resource.component.ts b/libs/vre/shared/app-resource-page/src/lib/resource.component.ts index da355fb054..7e8b95f976 100644 --- a/libs/vre/shared/app-resource-page/src/lib/resource.component.ts +++ b/libs/vre/shared/app-resource-page/src/lib/resource.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnChanges } from '@angular/core'; +import { Component, Input, OnChanges, SimpleChanges } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { Router } from '@angular/router'; import { Constants, CountQueryResponse, ReadFileValue } from '@dasch-swiss/dsp-js'; @@ -71,16 +71,16 @@ export class ResourceComponent implements OnChanges { }); } - ngOnChanges() { + ngOnChanges(changes: SimpleChanges) { this.showRestrictedMessage = true; this.resourceIsObjectWithoutRepresentation = getFileValue(this.resource) === null; - this.onInit(this.resource); + this.onInit(this.resource, changes['resource']?.currentValue.res.id !== changes['resource']?.previousValue?.res.id); } - onInit(resource: DspResource) { + onInit(resource: DspResource, isDifferentResource: boolean) { if (this._isObjectWithoutRepresentation(resource)) { - this._checkForCompoundNavigation(resource); + this._checkForCompoundNavigation(resource, isDifferentResource); return; } @@ -107,7 +107,7 @@ export class ResourceComponent implements OnChanges { return getFileValue(resource) === null; } - private _checkForCompoundNavigation(resource: DspResource) { + private _checkForCompoundNavigation(resource: DspResource, isDifferentResource: boolean) { this._incomingService .getStillImageRepresentationsForCompoundResource(resource.res.id, 0, true) .pipe(take(1)) @@ -117,7 +117,7 @@ export class ResourceComponent implements OnChanges { if (countQuery_.numberOfResults > 0) { this.isCompoundNavigation = true; this._compoundService.onInit( - this._compoundService.exists + this._compoundService.exists && !isDifferentResource ? this._compoundService.compoundPosition : new DspCompoundPosition(countQuery_.numberOfResults), this.resource