Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/segment-support' into segment-su…
Browse files Browse the repository at this point in the history
…pport
  • Loading branch information
derschnee68 committed Jul 18, 2024
2 parents 52bfd79 + ef7bdd6 commit c0e2fe2
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 35 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)


Expand Down
6 changes: 0 additions & 6 deletions k6/Dockerfile.influxdb

This file was deleted.

11 changes: 8 additions & 3 deletions k6/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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: .
Expand Down
4 changes: 2 additions & 2 deletions k6/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions k6/options/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const defaultScenario = {

export const defaultOptions = {
cloud: {
projectID: 3704846,
distribution: {
distributionLabel1: { loadZone: 'amazon:de:frankfurt', percent: 100 },
},
Expand Down
2 changes: 1 addition & 1 deletion k6/pages/resource-page.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
9 changes: 9 additions & 0 deletions k6/pages/single-resource-page.js
Original file line number Diff line number Diff line change
@@ -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');
}
}
14 changes: 9 additions & 5 deletions k6/tests/first-page-load.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();
}
}
14 changes: 9 additions & 5 deletions k6/tests/load-resource.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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();
}
}
30 changes: 30 additions & 0 deletions k6/tests/load-single-resource.js
Original file line number Diff line number Diff line change
@@ -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();
}
}
14 changes: 7 additions & 7 deletions libs/vre/shared/app-resource-page/src/lib/resource.component.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -72,16 +72,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;
}

Expand All @@ -108,7 +108,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))
Expand All @@ -118,7 +118,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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit c0e2fe2

Please sign in to comment.