Skip to content

Commit

Permalink
Merge branch 'release/v0.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
musicEnfanthen committed Feb 10, 2020
2 parents 153143c + c6684e7 commit ddb0a46
Show file tree
Hide file tree
Showing 97 changed files with 22,771 additions and 347 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.7.1](https://github.com/webern-unibas-ch/awg-app/compare/v0.7.0...v0.7.1) (2020-02-10)

### Features

- **core:** add RouterEventsService to store previous route ([23e3656](https://github.com/webern-unibas-ch/awg-app/commit/23e365690b35b6ec9f7169401f1d9fbe35883db9))
- **core:** add StorageService ([bde1f1e](https://github.com/webern-unibas-ch/awg-app/commit/bde1f1eff3b49341d1ebf621cc5f535b4e9ec1e4)), closes [#5](https://github.com/webern-unibas-ch/awg-app/issues/5)
- **core:** expose GND via postMessage to communicate with inseri ([80648c5](https://github.com/webern-unibas-ch/awg-app/commit/80648c5204a7bc0a46455491bff5de23497978f1)), relates to [nie-ine/inseri#388](https://github.com/nie-ine/inseri/issues/388)
- **edition:** add almost complete TkA for op25 (Sk4 incomplete) ([3dabd8a](https://github.com/webern-unibas-ch/awg-app/commit/3dabd8af6b438088b7a87c65b2134b9e39f58dbe))
- **edition:** make tka list toggleable per sketch ([01ec0fd](https://github.com/webern-unibas-ch/awg-app/commit/01ec0fd45db4f92e6e01e8364045c6a6df4bacce))
- **edition:** prepare embedding of op25 sheets ([1f25f63](https://github.com/webern-unibas-ch/awg-app/commit/1f25f63148e61f00461496d25081a448a6310091))

### Bug Fixes

- **app:** move GND exposition to PropsComp and GndService ([e44b332](https://github.com/webern-unibas-ch/awg-app/commit/e44b3324d092d2b799242c9a7b0d0a3cfce371a6), [98bd896](https://github.com/webern-unibas-ch/awg-app/commit/98bd896d6151c09d806fef1c82734e899a55d43d))
- **core:** add removeItem method to StorageService ([19a6f8d](https://github.com/webern-unibas-ch/awg-app/commit/19a6f8d85548782397e836cd8fd802fb1d840628))
- **core:** fix check for detecting Storage ([b5c4c08](https://github.com/webern-unibas-ch/awg-app/commit/b5c4c08bf370e9bb6048fa9775ab30ea8690ce45))
- **core:** use StorageService to expose GND ([e591885](https://github.com/webern-unibas-ch/awg-app/commit/e591885d64977ae9ef87ab6bdc58193f323adefd))
- **edition:** add missing content description of op. 25 ([29d1c34](https://github.com/webern-unibas-ch/awg-app/commit/29d1c34b7e31b0135982a9061085e75b1d781b90))
- **edition:** add svg's with path information ([50d23ba](https://github.com/webern-unibas-ch/awg-app/commit/50d23ba0e6413f89f7f759ef8f023ea1296cbc94))
- **edition:** adjust modal hint for op25 ([d6b4909](https://github.com/webern-unibas-ch/awg-app/commit/d6b4909428450716f320c568763feb7f19cdf4f9))
- **edition:** get selectability of convolute item from data ([9fcb2dd](https://github.com/webern-unibas-ch/awg-app/commit/9fcb2ddff22f49a019c41c71fcf2d488dcd3fd75))
- **edition:** handle placeholder for op. 12 Aa:SkI/1 ([ecbb32b](https://github.com/webern-unibas-ch/awg-app/commit/ecbb32b228438a19768ba8b83ef85ad07d7c90d0))
- **edition:** improve folio handling and rendering ([8c871cc](https://github.com/webern-unibas-ch/awg-app/commit/8c871cc7f435910daea3789a0c2b111982904a29))
- **edition:** move convolute logic to parent component (edition detail) ([7a9c5ed](https://github.com/webern-unibas-ch/awg-app/commit/7a9c5edaca439fe54a887de7afd75a42496e4dc6), [fb77f72](https://github.com/webern-unibas-ch/awg-app/commit/fb77f72aa9c817c8e0d09e2e9d204dfbf8508683))
- **home:** adjust title of op. 25 ([9f1c9fc](https://github.com/webern-unibas-ch/awg-app/commit/9f1c9fc07960335d2e4c5c8bec0f7ace44054a9f))

## [0.7.0](https://github.com/webern-unibas-ch/awg-app/compare/v0.6.1...v0.7.0) (2020-02-05)

### ⚠ BREAKING CHANGES
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "awg-app",
"version": "0.7.0",
"version": "0.7.1",
"license": "MIT",
"author": {
"name": "Stefan Münnich",
Expand All @@ -27,14 +27,16 @@
"start": "ng serve",
"e2e": "ng e2e",
"test": "ng test",
"test:cov": "ng test awg-app --code-coverage",
"test:cov": "ng test --code-coverage true",
"serve:test:cov": "npx http-server -c-1 -o -p 9875 ./coverage",
"test:ci": "yarn test:cov --watch=false --browsers=ChromeHeadlessNoSandbox",
"lint": "ng lint awg-app",
"tslint-check": "tslint-config-prettier-check ./tslint.json",
"format:check": "prettier --check \"src/**/*.ts\"",
"format:fix": "pretty-quick --staged",
"serve:doc": "yarn compodoc -p tsconfig.app.json --theme Readthedocs -d dist/compodoc -s -w",
"build:doc": "yarn compodoc -p tsconfig.app.json --theme Readthedocs -d dist/compodoc",
"doc": "yarn compodoc -p tsconfig.app.json --theme Readthedocs -d dist/compodoc",
"serve:doc": "yarn doc -s -w",
"build:doc": "yarn doc",
"build": "ng build",
"build:prod": "yarn build --prod --aot=false",
"postbuild:prod": "run-s gzip:dist build:doc",
Expand Down
17 changes: 15 additions & 2 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ import { NavigationEnd, Router } from '@angular/router';

import { of as observableOf } from 'rxjs';

import Spy = jasmine.Spy;

import { getAndExpectDebugElementByDirective } from '@testing/expect-helper';

import { RouterEventsService } from '@awg-core/services';
import { AppComponent } from './app.component';

// analytics global
Expand All @@ -22,7 +25,7 @@ class ViewContainerStubComponent {}
@Component({ selector: 'awg-footer', template: '' })
class FooterStubComponent {}

class MockServices {
class MockRouter {
// Router
events = observableOf(new NavigationEnd(0, 'testUrl', 'testUrl'), [0, 0], 'testString');
}
Expand All @@ -35,10 +38,20 @@ describe('AppComponent (DONE)', () => {

let router: Router;

let getPreviousRouteSpy: Spy;

beforeEach(async(() => {
// create a fake RouterEventsService object with a `getPreviousRoute` spy
const mockRouterEventsService = jasmine.createSpyObj('RouterEventsService', ['getPreviousRoute']);
// make the spies return a synchronous Observable with the test data
getPreviousRouteSpy = mockRouterEventsService.getPreviousRoute.and.returnValue(observableOf(''));

TestBed.configureTestingModule({
declarations: [AppComponent, FooterStubComponent, NavbarStubComponent, ViewContainerStubComponent],
providers: [{ provide: Router, useClass: MockServices }]
providers: [
{ provide: Router, useClass: MockRouter },
{ provide: RouterEventsService, useValue: mockRouterEventsService }
]
}).compileComponents();
}));

Expand Down
10 changes: 7 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Component } from '@angular/core';
import { NavigationEnd, Router } from '@angular/router';

import { RouterEventsService } from '@awg-core/services';

/**
* The main component of the AWG App.
*
Expand All @@ -15,14 +17,16 @@ export class AppComponent {
/**
* Constructor of the AppComponent.
*
* It declares a private router instance to catch GoogleAnalytics pageview events,
* see {@link https://codeburst.io/using-google-analytics-with-angular-25c93bffaa18}.
* It declares private instances of the Angular router and the RouterEventsService.
*
* @param {Router} router Instance of the Angular router.
* @param {RouterEventsService} routerEventsService Instance of the RouterEventsService.
*/
constructor(private readonly router: Router) {
constructor(private readonly router: Router, private routerEventsService: RouterEventsService) {
this.router.events.subscribe(event => {
if (event instanceof NavigationEnd) {
// catch GoogleAnalytics pageview events,
// cf. https://codeburst.io/using-google-analytics-with-angular-25c93bffaa18
(window as any).ga('set', 'page', event.urlAfterRedirects);
(window as any).ga('send', 'pageview');
}
Expand Down
9 changes: 9 additions & 0 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ export class AppConfig {
return root + api;
}

/**
* Getter for the AWG route storage key.
*
* @returns {string}
*/
public static get AWG_APP_ROUTE_STORAGE_KEY(): string {
return 'awg-app-route';
}

/**
* Getter for the url of the AWG edition website (awg-app).
*
Expand Down
6 changes: 3 additions & 3 deletions src/app/app.globals.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// THIS IS AN AUTO-GENERATED FILE. DO NOT CHANGE IT MANUALLY!
// Generated last time on Wed Feb 5 14:49:11 CET 2020
// Generated last time on Mon Feb 10 12:21:25 2020

/**
* The latest version of the AWG App
*/
export const appVersion = '0.7.0';
export const appVersion = '0.7.1';

/**
* The release date of the latest version of the AWG App
*/
export const appVersionReleaseDate = '05. Februar 2020';
export const appVersionReleaseDate = '10. Februar 2020';

/**
* The URL of the AWG App
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/services/api-service/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class ApiService {
/**
* Constructor of the ApiService.
*
* It declares a private {@link HttpClient} instance
* It declares a public {@link HttpClient} instance
* to handle http requests.
*
* @param {HttpClient} http Instance of the HttpClient.
Expand Down
48 changes: 15 additions & 33 deletions src/app/core/services/conversion-service/conversion.service.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { Observable } from 'rxjs';

import { NgxGalleryImage } from '@kolkov/ngx-gallery';

import { ApiService } from '@awg-core/services/api-service';

import { GeoNames } from '@awg-core/core-models';
import {
ContextJson,
Expand All @@ -21,7 +23,6 @@ import {
SelectionJson,
SubjectItemJson
} from '@awg-shared/api-objects';
import { PropertyJsonValue } from '@awg-shared/api-objects/resource-response-formats/src/property-json';
import {
IResourceDataResponse,
ResourceDetail,
Expand Down Expand Up @@ -69,6 +70,19 @@ export class ConversionService extends ApiService {
*/
filteredOut: number;

/**
* Constructor of the ConversionService.
*
* It declares a public {@link HttpClient} instance
* with a super reference to base class (ApiService)
* and a private {@link StorageService} instance.
*
* @param {HttpClient} http Instance of the HttpClient.
*/
constructor(public http: HttpClient) {
super(http);
}

/**
* Public method: convertFullTextSearchResults.
*
Expand Down Expand Up @@ -494,10 +508,6 @@ export class ConversionService extends ApiService {

case '14': // RICHTEXT: salsah standoff needs to be converted
for (let i = 0; i < prop.values.length; i++) {
// if we have a gnd (prop.pid=856), write it to localstorage
if (prop.pid === '856' && prop.values[i]) {
this.writeGndToLocalStorage(prop.values[i]);
}
// convert richtext standoff
prop.toHtml[i] = this.convertRichtextValue(prop.values[i].utf8str, prop.values[i].textattr);
}
Expand Down Expand Up @@ -950,32 +960,4 @@ export class ConversionService extends ApiService {
links: incomingLinks.filter(incomingLink => incomingLink.restype.label === label)
}));
}

/**
* Private method: writeGndToLocalStorage.
*
* It writes the GND number to the localStorage
* for further processing.
*
* @param {} value The given incoming property value.
*
* @returns {void} Writes the GND number to the localStorage.
*/
private writeGndToLocalStorage(value: PropertyJsonValue): void {
const dnbReg = 'http://d-nb.info/gnd/';
const gndKey = 'gnd';
let gndItem: string;

const valueHasGnd = (checkValue: PropertyJsonValue) => {
return !(!checkValue || !checkValue.utf8str || !checkValue.utf8str.includes(dnbReg));
};

if (valueHasGnd(value)) {
// split utf8str with gnd value into array and take last argument (pop)
gndItem = value.utf8str.split(dnbReg).pop();
localStorage.setItem(gndKey, gndItem);
} else {
localStorage.removeItem(gndKey);
}
}
}
2 changes: 1 addition & 1 deletion src/app/core/services/core-service/core.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('CoreService (DONE)', () => {
TestBed.configureTestingModule({
providers: [CoreService]
});
// inject services and http client handler
// inject service
coreService = TestBed.get(CoreService);

// test data
Expand Down
Loading

0 comments on commit ddb0a46

Please sign in to comment.