From 06656a996b9b299c014065779dc19f0b323fe5d5 Mon Sep 17 00:00:00 2001 From: Snehal Kumbhar Date: Mon, 12 Oct 2020 09:31:53 +0200 Subject: [PATCH 01/11] DSP-293 Update contact information on the landing page (#316) * fix (landing page): update contact information On landing page, update contact information for: - email address with default subject - post address - phone number Co-authored-by: Snehal Kumbhar --- src/app/main/footer/footer.component.html | 12 ++++++------ src/app/main/main.component.html | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/app/main/footer/footer.component.html b/src/app/main/footer/footer.component.html index b81bb3da0b..8522329257 100644 --- a/src/app/main/footer/footer.component.html +++ b/src/app/main/footer/footer.component.html @@ -20,14 +20,14 @@
From 942f619198abf3f61d51cf4d73cffcf0c3682602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Mon, 12 Oct 2020 17:42:30 +0200 Subject: [PATCH 02/11] Update js-lib and ui-lib (#317) * docs: Update README * docs: Update CHANGELOG * chore: Update packages * fix(ontology): Bug fix after breaking change from js-lib * chore(ontology): Disable ontology form * chore(ontolog): Disable "Add resource class" button --- CHANGELOG.md | 38 +++++++++++++++++-- README.md | 8 +++- package-lock.json | 28 +++++++------- package.json | 6 +-- .../project/ontology/ontology.component.html | 4 ++ .../resource-class-form.component.ts | 33 +++++++++++----- 6 files changed, 85 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4629b93dc7..46c4b8d457 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,35 @@ # Changelog +## v3.0.0-rc.2 (12/10/2020) + +## Enhancements + +- #303 DSP-329 Fix sort button +- #314 DSP-297 - Make the external links easy to spot +- #308 DSP-284 Display app version in header +- #310 DSP-339 - Add a link to the membership management page from the system project page + +## Styling + +- #309 DSP-689 Resource viewer fix style in properties toolbar +- #302 DSP-371 - Improve the visibility of expert and advanced search links + +## Bug fixes + +- #313 DSP-674 Replace search-panel with fulltext-search +- #306 DSP-700 Fix broken link to project +- #304 DSP-666 Fix issue with version number + +## Maintenance + +- #316 DSP-293 Update contact information on the landing page +- #315 Move services folder to main folder +- #312 DSP-766 Remove 'de' from list of available languages +- #307 DSP-368 - Redundancy with Cancel button and close button in dialog boxes +- #305 DSP-669 Add template for PRs + +--- + ## v3.0.0-rc.1 (22/09/2020) ## Enhancements @@ -14,15 +44,15 @@ - #296 Update README.md +## Dependencies + +- #300 DSP-673 Update dependency + ## Maintenance - #299 Fix tiny issues - #297 DSP-295 Open external link in new tab -## Dependencies - -- #300 DSP-673 Update dependency - --- ## v3.0.0-rc.0 (15/09/2020) diff --git a/README.md b/README.md index 20dae2db67..ea6cda8b73 100644 --- a/README.md +++ b/README.md @@ -45,9 +45,15 @@ We built the user guidelines and developer documentation with [MkDocs](https://w ## Publish a new version to DockerHub +Before publishing: + +- Update README and CHANGELOG if necessary and commit the changes (currently, the CHANGELOG has to be updated manually with [gren](https://github.com/github-tools/github-release-notes): `gren changelog --override`) + +- Be sure that all dependencies to DSP-UI-LIB, DSP-JS-LIB and DSP-API are set to the correct version. + A new version will be published with each Github release as it's part of Github actions' workflow. To make a new release, go to and update the draft called "Next release" by changing: -- the tag version and the release title (same name) with the version number, e.g. `v3.0.0` or `v3.0.0-rc.0` +- The tag version and the release title (same name) with the version number, e.g. `v3.0.0` or `v3.0.0-rc.0` - If this is a pre-release, check the box "This is a pre-release" New package will be available on . diff --git a/package-lock.json b/package-lock.json index b0abbad654..1f071264bd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "dsp-app", - "version": "0.0.0-PLACEHOLDER", + "version": "0.0.0-DEV", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1631,9 +1631,9 @@ } }, "@dasch-swiss/dsp-js": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-1.0.0-rc.12.tgz", - "integrity": "sha512-GCQGaYx10ucwmsuKnrLR30r7qdUJUK0j0fCZPSAaorIDhlvctrLf3zCJim2UUhEZ57YNgk2kEtgJ0j0EJlpuig==", + "version": "1.0.0-rc.13", + "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-1.0.0-rc.13.tgz", + "integrity": "sha512-7sjW7GeYSyyhAXcf0dYhaD8nMukuvQSeb4OwJXOhejHjT0bGZgeTOPKFlhIypUG7/A+jE18kR4Jm5IGB/HBIHA==", "requires": { "@types/jsonld": "^1.5.0", "json2typescript": "1.4.1", @@ -1641,9 +1641,9 @@ } }, "@dasch-swiss/dsp-ui": { - "version": "1.0.0-rc.8", - "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-ui/-/dsp-ui-1.0.0-rc.8.tgz", - "integrity": "sha512-nViHzxgUC016DqJuxAq1Zi1bA1oIIo4sIGgyP3UFmkf+iVE4T6kGhkcUArs9E7a4LgZIXDotB4wsXmt/FODiTQ==", + "version": "1.0.0-rc.9", + "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-ui/-/dsp-ui-1.0.0-rc.9.tgz", + "integrity": "sha512-tefaco7yFjynoUXAOl1x6z8FkRFedrFF6kqtnaJqmaA3WjmeETMdNbOuWItMFNWOvPpIJpXdye211lE/MLleBw==", "requires": { "tslib": "^1.10.0" } @@ -8930,9 +8930,9 @@ } }, "node-forge": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.2.tgz", - "integrity": "sha512-naKSScof4Wn+aoHU6HBsifh92Zeicm1GDQKd1vp3Y/kOi8ub0DozCa9KpvYNCXslFHYRmLNiqRopGdTGwNLpNw==" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" }, "node-libs-browser": { "version": "2.2.1", @@ -11290,11 +11290,11 @@ } }, "rdf-canonize": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/rdf-canonize/-/rdf-canonize-1.1.0.tgz", - "integrity": "sha512-DV06OnhVfl2zcZJQCt+YvU+hoZVgpyQpNFLeAmghq8RJybUxD3B4LRzlBquYS5k+LLd8/c3g5Gnhkqjw5qRMvg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/rdf-canonize/-/rdf-canonize-1.2.0.tgz", + "integrity": "sha512-MQdcRDz4+82nUrEb3hNQangBDpmep15uMmnWclGi/1KS0bNVc8oHpoNI0PFLHZsvwgwRzH31bO1JAScqUAstvw==", "requires": { - "node-forge": "^0.9.1", + "node-forge": "^0.10.0", "semver": "^6.3.0" } }, diff --git a/package.json b/package.json index cfd92840f5..30e61da130 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dsp-app", - "version": "0.0.0-PLACEHOLDER", + "version": "0.0.0-DEV", "repository": { "type": "git", "url": "https://github.com/dasch-swiss/dsp-app.git" @@ -31,8 +31,8 @@ "@angular/platform-browser": "~9.1.12", "@angular/platform-browser-dynamic": "~9.1.12", "@angular/router": "~9.1.12", - "@dasch-swiss/dsp-js": "1.0.0-rc.12", - "@dasch-swiss/dsp-ui": "1.0.0-rc.8", + "@dasch-swiss/dsp-js": "1.0.0-rc.13", + "@dasch-swiss/dsp-ui": "1.0.0-rc.9", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "^6.0.0", "core-js": "^3.6.5", diff --git a/src/app/project/ontology/ontology.component.html b/src/app/project/ontology/ontology.component.html index 81c1f331e8..384cdeb57a 100644 --- a/src/app/project/ontology/ontology.component.html +++ b/src/app/project/ontology/ontology.component.html @@ -43,10 +43,12 @@

+

@@ -86,6 +88,7 @@

{{ontology?.label}}

+
- + +

{{list.length | i18nPlural: itemPluralMapping['project']}}

@@ -28,7 +32,7 @@

{{list.length | i18nPlural: itemPluralMapping['project']}} -
diff --git a/src/app/system/projects/projects-list/projects-list.component.ts b/src/app/system/projects/projects-list/projects-list.component.ts index 10dda04383..9abaed6269 100644 --- a/src/app/system/projects/projects-list/projects-list.component.ts +++ b/src/app/system/projects/projects-list/projects-list.component.ts @@ -62,8 +62,8 @@ export class ProjectsListComponent implements OnInit { } ]; - // ... and sort by 'shortname' - sortBy: string = 'shortname'; + // ... and sort by 'longname' + sortBy: string = 'longname'; constructor( @Inject(DspApiConnectionToken) private _dspApiConnection: KnoraApiConnection, @@ -79,6 +79,13 @@ export class ProjectsListComponent implements OnInit { // is the logged-in user system admin? this.sysAdmin = this.session.user.sysAdmin; + + // sort list by defined key + if(localStorage.getItem('sortProjectsBy')) { + this.sortBy = localStorage.getItem('sortProjectsBy'); + } else { + localStorage.setItem('sortProjectsBy', this.sortBy); + } } /** @@ -144,6 +151,7 @@ export class ProjectsListComponent implements OnInit { sortList(key: any) { this.list = this._sortingService.keySortByAlphabetical(this.list, key); + localStorage.setItem('sortProjectsBy', key); } deleteProject(id: string) { diff --git a/src/app/system/users/users-list/users-list.component.html b/src/app/system/users/users-list/users-list.component.html index 6c98648527..4845408d93 100644 --- a/src/app/system/users/users-list/users-list.component.html +++ b/src/app/system/users/users-list/users-list.component.html @@ -14,8 +14,12 @@

- + +

{{list.length | i18nPlural: itemPluralMapping['member']}} @@ -30,7 +34,7 @@

- +
diff --git a/src/app/system/users/users-list/users-list.component.ts b/src/app/system/users/users-list/users-list.component.ts index efbda4d76b..40929aef76 100644 --- a/src/app/system/users/users-list/users-list.component.ts +++ b/src/app/system/users/users-list/users-list.component.ts @@ -76,8 +76,8 @@ export class UsersListComponent implements OnInit { } ]; - // ... and sort by 'email' - sortBy: string = 'email'; + // ... and sort by 'username' + sortBy: string = 'username'; constructor( @Inject(DspApiConnectionToken) private _dspApiConnection: KnoraApiConnection, @@ -122,6 +122,13 @@ export class UsersListComponent implements OnInit { } ); } + + // sort list by defined key + if(localStorage.getItem('sortUsersBy')) { + this.sortBy = localStorage.getItem('sortUsersBy'); + } else { + localStorage.setItem('sortUsersBy', this.sortBy); + } } /** @@ -407,5 +414,6 @@ export class UsersListComponent implements OnInit { sortList(key: any) { this.list = this._sortingService.keySortByAlphabetical(this.list, key); + localStorage.setItem('sortUsersBy', key); } } From f85e4a2a0c727c7b44f5659b05d11d139fb26236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Tue, 13 Oct 2020 08:50:46 +0200 Subject: [PATCH 04/11] fix(node_modules): Update dependencies (#318) --- package-lock.json | 22 ++++++++++++++++------ package.json | 4 ++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1f071264bd..9a8183b01b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8908,9 +8908,19 @@ "integrity": "sha512-h25UdUN/g8U7y29TzQtRm/GvGr70lK37yQPvPKXXuVfs7gCm82WipYFZcksQfeKumtOemAzBIcT7lzzyK/edLw==" }, "ngx-color-picker": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/ngx-color-picker/-/ngx-color-picker-9.1.0.tgz", - "integrity": "sha512-ViYBfXb4IL1UbM15LaZHYqHyHPYVEKg+rZB1GWSLqXVuDol3Cgt38D8XfOcivVAO60CziQ77k3ThDo31T6wC6A==" + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/ngx-color-picker/-/ngx-color-picker-10.1.0.tgz", + "integrity": "sha512-Q3BILkQP+l+dcX0joe7+xuHDKydhGnG09sUG1FmlLZFYIEX4+AQqHULh+hUAci8kZlLZuOG+mB2Uq54QYadItw==", + "requires": { + "tslib": "^2.0.0" + }, + "dependencies": { + "tslib": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz", + "integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==" + } + } }, "nice-try": { "version": "1.0.5", @@ -13293,9 +13303,9 @@ "dev": true }, "three": { - "version": "0.115.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.115.0.tgz", - "integrity": "sha512-mAV2Ky3RdcbdSbR9capI+tKLvRldWYxd4151PZTT/o7+U2jh9Is3a4KmnYwzyUAhB2ZA3pXSgCd2DOY4Tj5kow==" + "version": "0.118.3", + "resolved": "https://registry.npmjs.org/three/-/three-0.118.3.tgz", + "integrity": "sha512-ijECXrNzDkHieoeh2H69kgawTGH8DiamhR4uBN8jEM7VHSKvfTdEvOoHsA8Aq7dh7PHAxhlqBsN5arBI3KixSw==" }, "three-forcegraph": { "version": "1.36.1", diff --git a/package.json b/package.json index 30e61da130..103b8f6d1a 100644 --- a/package.json +++ b/package.json @@ -46,12 +46,12 @@ "json2typescript": "^1.0.6", "jsonld": "^1.1.0", "moment": "^2.27.0", - "ngx-color-picker": "^9.1.0", + "ngx-color-picker": "^10.0.1", "openseadragon": "^2.4.0", "rxjs": "~6.5.3", "semver": "^6.1.1", "svg-overlay": "github:openseadragon/svg-overlay", - "three": "^0.115.0", + "three": "^0.118.3", "three-spritetext": "^1.5.1", "ts-md5": "^1.2.4", "tslib": "^1.10.0", From 5e4890d55f1b2e8d9cff030ea2481344ac004e6f Mon Sep 17 00:00:00 2001 From: Flavie L Date: Wed, 14 Oct 2020 17:00:27 +0200 Subject: [PATCH 05/11] feat(header+dialog): create button in the header + dialog box (#320) Co-authored-by: flaurens --- src/app/main/dialog/dialog.component.html | 17 ++++++++++++++- src/app/main/header/header.component.html | 4 ++++ src/app/main/header/header.component.ts | 26 ++++++++++++++++++++++- src/assets/i18n/en.json | 16 ++++++++++++++ src/assets/style/_elements.scss | 9 ++++++++ 5 files changed, 70 insertions(+), 2 deletions(-) diff --git a/src/app/main/dialog/dialog.component.html b/src/app/main/dialog/dialog.component.html index 01a90a5e27..1cc9bd5b18 100644 --- a/src/app/main/dialog/dialog.component.html +++ b/src/app/main/dialog/dialog.component.html @@ -230,11 +230,26 @@ + + +
+ + + The component {{data.mode}} is not implemented yet. + + + + +
+
- The component{{data.mode}} is not implemented yet. + The component {{data.mode}} is not implemented yet.
diff --git a/src/app/main/header/header.component.html b/src/app/main/header/header.component.html index 798c4224b4..87ee899571 100644 --- a/src/app/main/header/header.component.html +++ b/src/app/main/header/header.component.html @@ -34,6 +34,10 @@

DSP

+ + diff --git a/src/app/main/header/header.component.ts b/src/app/main/header/header.component.ts index f26903a5ee..cdb5dba6fb 100644 --- a/src/app/main/header/header.component.ts +++ b/src/app/main/header/header.component.ts @@ -1,10 +1,12 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; +import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; import { MatIconRegistry } from '@angular/material/icon'; import { DomSanitizer } from '@angular/platform-browser'; import { NavigationStart, Router } from '@angular/router'; import { DspMessageData, SearchParams, SessionService } from '@dasch-swiss/dsp-ui'; -import { ComponentCommunicationEventService, Events } from 'src/app/main/services/component-communication-event.service'; import { Subscription } from 'rxjs'; +import { DialogComponent } from 'src/app/main/dialog/dialog.component'; +import { ComponentCommunicationEventService, Events } from 'src/app/main/services/component-communication-event.service'; const { version: appVersion } = require('../../../../package.json'); @@ -34,6 +36,7 @@ export class HeaderComponent implements OnInit, OnDestroy{ private _session: SessionService, private _domSanitizer: DomSanitizer, private _matIconRegistry: MatIconRegistry, + private _dialog: MatDialog, private _router: Router, private _componentCommsService: ComponentCommunicationEventService) { @@ -117,6 +120,27 @@ export class HeaderComponent implements OnInit, OnDestroy{ } + openDialog(mode: string, name?: string, iri?: string): void { + const dialogConfig: MatDialogConfig = { + width: '640px', + position: { + top: '112px' + }, + data: { mode: mode, title: name, id: iri } + }; + + const dialogRef = this._dialog.open( + DialogComponent, + dialogConfig + ); + + dialogRef.afterClosed().subscribe(() => { + + // do something + + }); + } + } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index aeba23adf9..aa4e39ecb2 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -153,6 +153,22 @@ "title": { "delete": "Delete list" } + }, + "resource": { + "title": { + "new": "Create new", + "edit": "Update resource", + "profile": "Resource", + "editSuccess": "You have successfully updated this resource.", + "delete": "Delete this resource", + "deleteHint": "You're sure to delete this resource?", + "deleteButton": "Delete resource now", + "formWizard": { + "step_1": "Select your resource", + "step_2": "Add properties", + "step_3": "Confirm" + } + } } } } diff --git a/src/assets/style/_elements.scss b/src/assets/style/_elements.scss index 6a15117e08..b72101f8d7 100644 --- a/src/assets/style/_elements.scss +++ b/src/assets/style/_elements.scss @@ -99,6 +99,15 @@ a, } } +.new-resource { + width: 64px !important ; + align-content: center; + + &:hover { + background-color: #EBEBEB; + } +} + // -------------------------------------- // From 579104c08647f57bd31833140701f30f4da0a5f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Thu, 15 Oct 2020 09:45:42 +0200 Subject: [PATCH 06/11] DSP-859 Create ontology (#319) * feat(ontology): Create ontology * refactor(ontology): Clean up commented code --- .../ontology-form/ontology-form.component.ts | 22 ---- .../project/ontology/ontology.component.html | 6 +- .../project/ontology/ontology.component.ts | 122 +++++------------- 3 files changed, 35 insertions(+), 115 deletions(-) diff --git a/src/app/project/ontology/ontology-form/ontology-form.component.ts b/src/app/project/ontology/ontology-form/ontology-form.component.ts index 790024f5f0..c619770f4a 100644 --- a/src/app/project/ontology/ontology-form/ontology-form.component.ts +++ b/src/app/project/ontology/ontology-form/ontology-form.component.ts @@ -182,28 +182,6 @@ export class OntologyFormComponent implements OnInit { console.error(error); } ); - /* NOT YET IMPLEMENTED!!! use the new ontology endpoint from dsp-js - this._ontologyService.createOntology(ontologyData).subscribe( - (ontology: any) => { - - // set cache for the new ontology - this._cache.get('currentOntology', this._ontologyService.getAllEntityDefinitionsForOntologies(ontology['@id'])); - - // this.updateParent.emit(ontology['@id']); - - // open new ontology after closing dialog - this.closeDialog.emit(ontology['@id']); - - }, - (error: any) => { - - this.formErrors['name'] += this.validationMessages['name']['existingName'] + ' '; - this.loading = false; - - console.error(error); - } - ); - */ } /** diff --git a/src/app/project/ontology/ontology.component.html b/src/app/project/ontology/ontology.component.html index 384cdeb57a..d62447ce53 100644 --- a/src/app/project/ontology/ontology.component.html +++ b/src/app/project/ontology/ontology.component.html @@ -1,5 +1,5 @@
- + @@ -14,7 +14,7 @@

Project has {{ontologies.length | i18nPlural: itemPluralMapping['ontology']}} - + It seems there's no data model defined yet

@@ -43,12 +43,10 @@

-

diff --git a/src/app/project/ontology/ontology.component.ts b/src/app/project/ontology/ontology.component.ts index f20451a440..bf35bb22fa 100644 --- a/src/app/project/ontology/ontology.component.ts +++ b/src/app/project/ontology/ontology.component.ts @@ -3,11 +3,24 @@ import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; import { Title } from '@angular/platform-browser'; import { ActivatedRoute, Params, Router } from '@angular/router'; -import { ApiResponseData, ApiResponseError, ClassDefinition, DeleteOntologyResponse, KnoraApiConnection, OntologiesMetadata, OntologyMetadata, ProjectResponse, ReadOntology, ReadProject, UpdateOntology } from '@dasch-swiss/dsp-js'; +import { + ApiResponseData, + ApiResponseError, + ClassDefinition, + DeleteOntologyResponse, + KnoraApiConnection, + OntologiesMetadata, + OntologyMetadata, + ProjectResponse, + ReadOntology, + ReadProject, + UpdateOntology +} from '@dasch-swiss/dsp-js'; import { DspApiConnectionToken, Session, SessionService } from '@dasch-swiss/dsp-ui'; import { CacheService } from 'src/app/main/cache/cache.service'; import { DialogComponent } from 'src/app/main/dialog/dialog.component'; import { DefaultResourceClasses, ResourceClass } from './default-data/default-resource-classes'; +import { ResourceClassFormService } from './resource-class-form/resource-class-form.service'; export interface OntologyInfo { id: string; @@ -60,7 +73,6 @@ export class OntologyComponent implements OnInit { // i18n setup itemPluralMapping = { ontology: { - // '=0': '0 Ontologies', '=1': '1 data model', other: '# data models' } @@ -79,7 +91,7 @@ export class OntologyComponent implements OnInit { constructor( @Inject(DspApiConnectionToken) private _dspApiConnection: KnoraApiConnection, - // private _ontologyService: OntologyService, + private _resourceClassFormService: ResourceClassFormService, private _cache: CacheService, private _session: SessionService, private _dialog: MatDialog, @@ -163,100 +175,32 @@ export class OntologyComponent implements OnInit { this._dspApiConnection.v2.onto.getOntologiesByProjectIri(this.project.id).subscribe( (response: OntologiesMetadata) => { this.ontologies = response.ontologies; - this.loading = false; - }, - (error: ApiResponseError) => { - console.error(error); - } - ) - - // this.knoraApiConnection.v2.onto.getOntologiesByProjectIri(this.project.id).subscribe( - // (response: OntologiesMetadata) => { - // this.ontologies = response.ontologies; - // TODO: replace _ontologyService and ApiServiceError - /* this._ontologyService.getProjectOntologies(encodeURI(this.project.id)).subscribe( - (ontologies: ApiServiceResult) => { - - let name: string; - - if (ontologies.body['@graph'] && ontologies.body['@graph'].length > 0) { - // more than one ontology - this.ontologies = []; - for (const ontology of ontologies.body['@graph']) { - const info: OntologyInfo = { - id: ontology['@id'], - label: ontology['rdfs:label'] - }; - - console.log(this.ontologies); + // get list of already existing ontology names + // name has to be unique + for (const ontology of response.ontologies) { + let name = this._resourceClassFormService.getOntologyName(ontology.id); + this.existingOntologyNames.push(name); + } - // TODO: set forbidden onto names here + // in case project has only one ontology: open this ontology + // because there will be no form to select ontlogy + if(response.ontologies.length === 1) { + // open this ontology + this.openOntologyRoute(this.ontologies[0].id); + this.getOntology(this.ontologies[0].id); + } this.loading = false; - }, (error: ApiResponseError) => { + // temporary solution. There's a bug in js-lib in case of 0 ontologies + // s. youtrack issue DSP-863 + this.ontologies = []; + console.error(error); - this.loading = false; } - ); - - // this._ontologyService.getProjectOntologies(encodeURI(this.project.id)).subscribe( - // (ontologies: ApiServiceResult) => { - - // let name: string; - - // if (ontologies.body['@graph'] && ontologies.body['@graph'].length > 0) { - // // more than one ontology - // this.ontologies = []; - - // for (const ontology of ontologies.body['@graph']) { - // const info: OntologyInfo = { - // id: ontology['@id'], - // label: ontology['rdfs:label'] - // }; - - // this.ontologies.push(info); - - // // set list of existing names - // name = this._resourceClassFormService.getOntologyName(ontology['@id']); - // this.existingOntologyNames.push(name); - // } - - // this.loading = false; - - // } else if (ontologies.body['@id'] && ontologies.body['rdfs:label']) { - // // only one ontology - // this.ontologies = [ - // { - // id: ontologies.body['@id'], - // label: ontologies.body['rdfs:label'] - // } - // ]; - - // this.ontologyIri = ontologies.body['@id']; - // // set list of existing name - // name = this._resourceClassFormService.getOntologyName(this.ontologyIri); - // this.existingOntologyNames.push(name); - - // // open this ontology - // this.openOntologyRoute(this.ontologyIri); - // this.getOntology(this.ontologyIri); - - // this.loading = false; - // } else { - // // none ontology defined yet - // this.ontologies = []; - // this.loading = false; - // } - - // }, - // (error: ApiServiceError) => { - // console.error(error); - // } - // ); - */ + ) } // update view after selecting an ontology from dropdown From 396adb16158d806763e1e47a534240df75838535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Fri, 16 Oct 2020 16:36:56 +0200 Subject: [PATCH 07/11] DSP-860: Ontology editor: Create resource class (#322) * feat(ontology): Create resource class * fix(ontology): Close dialog * feat(ontology): Delete resource class * refactor(ontology): Clean up code * style(dialog): Add general todo note * fix(ontology): Project admin can edit ontology --- src/app/main/dialog/dialog.component.html | 14 ++-- src/app/main/dialog/dialog.component.scss | 6 ++ src/app/main/dialog/dialog.component.ts | 2 + .../default-data/default-resource-classes.ts | 26 +++----- .../project/ontology/ontology.component.html | 15 +---- .../project/ontology/ontology.component.ts | 66 ++++++------------- .../resource-class-form.component.ts | 49 ++++++++------ 7 files changed, 77 insertions(+), 101 deletions(-) diff --git a/src/app/main/dialog/dialog.component.html b/src/app/main/dialog/dialog.component.html index 1cc9bd5b18..2531335cd7 100644 --- a/src/app/main/dialog/dialog.component.html +++ b/src/app/main/dialog/dialog.component.html @@ -172,9 +172,9 @@
- + - The component{{data.mode}} is not implemented yet. +

@@ -192,7 +192,7 @@
- +
- The component{{data.mode}} is not implemented yet. +

- - Do you want to delete this resource type? + + Do you want to delete this resource class?
diff --git a/src/app/main/dialog/dialog.component.scss b/src/app/main/dialog/dialog.component.scss index e69de29bb2..66aa11bc54 100644 --- a/src/app/main/dialog/dialog.component.scss +++ b/src/app/main/dialog/dialog.component.scss @@ -0,0 +1,6 @@ +.todo { + background-color: bisque; + padding: 6px; + border-radius: 4px; + text-align: center; +} diff --git a/src/app/main/dialog/dialog.component.ts b/src/app/main/dialog/dialog.component.ts index 4f9fac1b86..eab129b652 100644 --- a/src/app/main/dialog/dialog.component.ts +++ b/src/app/main/dialog/dialog.component.ts @@ -19,6 +19,8 @@ export interface DialogData { }) export class DialogComponent implements OnInit { + notYetImplemented = `The component ${this.data.mode} is not implemented yet.`; + constructor( public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: DialogData diff --git a/src/app/project/ontology/default-data/default-resource-classes.ts b/src/app/project/ontology/default-data/default-resource-classes.ts index f7ca474e06..e41693cb21 100644 --- a/src/app/project/ontology/default-data/default-resource-classes.ts +++ b/src/app/project/ontology/default-data/default-resource-classes.ts @@ -1,48 +1,40 @@ import { Constants } from '@dasch-swiss/dsp-js'; -export interface ResourceClass { +export interface DefaultClass { iri: string; - name: string; - label?: string; + label: string; icons?: string[]; } export class DefaultResourceClasses { - public static data: ResourceClass[] = [ + public static data: DefaultClass[] = [ { iri: Constants.Resource, - name: 'knora-api:Resource', label: 'Object without file representation (metadata only)' }, { - iri: Constants.StillImageFileValue, - name: 'knora-api:StillImageRepresentation', + iri: Constants.KnoraApiV2 + Constants.Delimiter + "StillImageRepresentation", label: 'Still Image' }, { - iri: Constants.MovingImageFileValue, - name: 'knora-api:MovingImageRepresentation', + iri: Constants.KnoraApiV2 + Constants.Delimiter + "MovingImageRepresentation", label: 'Moving Image' }, { - iri: Constants.AudioFileValue, - name: 'knora-api:AudioRepresentation', + iri: Constants.KnoraApiV2 + Constants.Delimiter + "AudioRepresentation", label: 'Audio' }, { - iri: Constants.TextFileValue, - name: 'knora-api:TextRepresentation', + iri: Constants.KnoraApiV2 + Constants.Delimiter + "TextRepresentation", label: 'Text' }, { - iri: Constants.DocumentFileValue, - name: 'knora-api:DocumentRepresentation', + iri: Constants.KnoraApiV2 + Constants.Delimiter + "DocumentRepresentation", label: 'Document (Word, PDF, etc.)' }, { - iri: Constants.DDDFileValue, - name: 'knora-api:DDDRepresentation', + iri: Constants.KnoraApiV2 + Constants.Delimiter + "DDDRepresentation", label: 'RTI Image' } ]; diff --git a/src/app/project/ontology/ontology.component.html b/src/app/project/ontology/ontology.component.html index d62447ce53..62e23a6903 100644 --- a/src/app/project/ontology/ontology.component.html +++ b/src/app/project/ontology/ontology.component.html @@ -1,5 +1,4 @@
- @@ -72,7 +71,7 @@

{{ontology?.label}}

scatter_plot Graph   @@ -85,8 +84,7 @@

{{ontology?.label}}

-
-
- - - -
@@ -120,7 +111,7 @@

- diff --git a/src/app/project/ontology/ontology.component.ts b/src/app/project/ontology/ontology.component.ts index bf35bb22fa..cd37871e66 100644 --- a/src/app/project/ontology/ontology.component.ts +++ b/src/app/project/ontology/ontology.component.ts @@ -8,6 +8,7 @@ import { ApiResponseError, ClassDefinition, DeleteOntologyResponse, + DeleteResourceClass, KnoraApiConnection, OntologiesMetadata, OntologyMetadata, @@ -19,7 +20,7 @@ import { import { DspApiConnectionToken, Session, SessionService } from '@dasch-swiss/dsp-ui'; import { CacheService } from 'src/app/main/cache/cache.service'; import { DialogComponent } from 'src/app/main/dialog/dialog.component'; -import { DefaultResourceClasses, ResourceClass } from './default-data/default-resource-classes'; +import { DefaultResourceClasses, DefaultClass } from './default-data/default-resource-classes'; import { ResourceClassFormService } from './resource-class-form/resource-class-form.service'; export interface OntologyInfo { @@ -81,7 +82,7 @@ export class OntologyComponent implements OnInit { /** * list of all default resource classs (sub class of) */ - resourceClass: ResourceClass[] = DefaultResourceClasses.data; + resourceClass: DefaultClass[] = DefaultResourceClasses.data; @ViewChild('ontologyEditor', { read: ViewContainerRef }) ontologyEditor: ViewContainerRef; @@ -264,7 +265,12 @@ export class OntologyComponent implements OnInit { return (owlClass['@type'] === 'owl:class'); } - openOntologyForm(mode: string, name?: string, iri?: string): void { + /** + * Opens ontology form + * @param mode + * @param [iri] only in edit mode + */ + openOntologyForm(mode: 'createOntology' | 'editOntology', iri?: string): void { const dialogConfig: MatDialogConfig = { width: '640px', position: { @@ -292,9 +298,12 @@ export class OntologyComponent implements OnInit { }); } - - - openResourceClassForm(mode: string, type: ResourceClass): void { + /** + * Opens resource class form + * @param mode + * @param subClassOf + */ + openResourceClassForm(mode: 'createResourceClass' | 'editResourceClass', subClassOf: DefaultClass): void { // set ontology cache this._cache.set('currentOntology', this.ontology); @@ -305,7 +314,7 @@ export class OntologyComponent implements OnInit { position: { top: '112px' }, - data: { name: type.name, title: type.label, subtitle: 'Customize resource class', mode: mode, project: this.project.id } + data: { name: subClassOf.iri, title: subClassOf.label, subtitle: 'Customize resource class', mode: mode, project: this.project.id } }; const dialogRef = this._dialog.open(DialogComponent, dialogConfig); @@ -315,6 +324,7 @@ export class OntologyComponent implements OnInit { this.getOntology(this.ontologyIri); }); } + /** * Delete either ontology or sourcetype * @@ -368,12 +378,12 @@ export class OntologyComponent implements OnInit { case 'ResourceClass': // delete reresource class and refresh the view this.loadOntology = true; - const resClass = new UpdateOntology(); - resClass.id = this.resourceClass[0].iri; + const resClass: DeleteResourceClass = new DeleteResourceClass(); + resClass.id = id; resClass.lastModificationDate = this.ontology.lastModificationDate; - this._dspApiConnection.v2.onto.deleteResourceClass(ontology).subscribe( + this._dspApiConnection.v2.onto.deleteResourceClass(resClass).subscribe( (response: OntologyMetadata) => { this.loading = false; this.getOntology(this.ontologyIri); @@ -383,47 +393,13 @@ export class OntologyComponent implements OnInit { this.loading = false; } ); - - // TODO: replace by js-lib OntologiesEndpoint - // this._ontologyService.deleteResourceClass(id, this.ontology.lastModificationDate).subscribe( - // (response: ApiServiceResult) => { - // this.getOntology(this.ontologyIri); - // }, - // (error: ApiServiceError) => { - // console.error(error.errorInfo); - - // const dialogErrorConfig: MatDialogConfig = { - // width: '560px', - // position: { - // top: '112px' - // }, - // data: { mode: 'error', title: 'Error: Not able to delete' } - // }; - - // const dialogErrorRef = this._dialog.open( - // DialogComponent, - // dialogErrorConfig - // ); - - // dialogErrorRef.afterClosed().subscribe(result => { - // this.getOntology(this.ontologyIri); - // }); - // } - // ); - break; + break; } } }); } - disableDeleteButton(properties: any): boolean { - - console.log(properties); - return false; - - } - /** * * @param view 'grid' | ' graph' diff --git a/src/app/project/ontology/resource-class-form/resource-class-form.component.ts b/src/app/project/ontology/resource-class-form/resource-class-form.component.ts index 5eedc29fd4..b5001c7656 100644 --- a/src/app/project/ontology/resource-class-form/resource-class-form.component.ts +++ b/src/app/project/ontology/resource-class-form/resource-class-form.component.ts @@ -13,6 +13,7 @@ import { StringLiteral, UpdateOntology } from '@dasch-swiss/dsp-js'; +import { StringLiteralV2 } from '@dasch-swiss/dsp-js/src/models/v2/string-literal-v2'; import { DspApiConnectionToken } from '@dasch-swiss/dsp-ui'; import { Subscription } from 'rxjs'; import { CacheService } from 'src/app/main/cache/cache.service'; @@ -82,8 +83,8 @@ export class ResourceClassFormComponent implements OnInit, OnDestroy, AfterViewC resourceClassForm: FormGroup; // label and comment are stringLiterals - resourceClassLabels: StringLiteral[] = []; - resourceClassComments: StringLiteral[] = []; + resourceClassLabels: StringLiteralV2[] = []; + resourceClassComments: StringLiteralV2[] = []; // sub / second form of resource class: properties form resourceClassFormSub: Subscription; @@ -303,8 +304,24 @@ export class ResourceClassFormComponent implements OnInit, OnDestroy, AfterViewC submitData() { this.loading = true; - let lastModificationDate: string = this.ontology.lastModificationDate; + // set resource class name / id + const uniqueClassName: string = this._resourceClassFormService.setUniqueName(this.ontology.id); + + const onto = new UpdateOntology(); + + onto.id = this.ontology.id; + onto.lastModificationDate = this.ontology.lastModificationDate; + + const newResClass = new CreateResourceClass(); + + newResClass.name = uniqueClassName + newResClass.label = this.resourceClassLabels; + newResClass.comment = this.resourceClassComments; + newResClass.subClassOf = [this.subClassOf]; + onto.entity = newResClass; + + // knora-api:error: "org.knora.webapi.exceptions.BadRequestException: One or more specified base classes are invalid: http://www.knora.org/ontology/knora-base#StillImageFileValue" // fix variables: @@ -330,35 +347,27 @@ export class ResourceClassFormComponent implements OnInit, OnDestroy, AfterViewC // first step: get data from first form: resource class - if (!this.resourceClassComments.length) { - this.resourceClassComments = this.resourceClassLabels; - } + // TODO: if no comment, reuse the label as comment + // if (!this.resourceClassComments.length) { + // this.resourceClassComments = this.resourceClassLabels; + // } - // set resource class name / id - const uniqueClassName: string = this._resourceClassFormService.setUniqueName(this.ontology.id); - // set resource class data - const resourceClassData = new UpdateOntology(); - resourceClassData.id = this.ontology.id; - resourceClassData.lastModificationDate = this.ontology.lastModificationDate; - resourceClassData.entity = { - name: uniqueClassName, - label: this.resourceClassLabels, - type: Constants.IsResourceClass, - comment: this.resourceClassComments, - subClassOf: [this.subClassOf] - }; // submit resource class data to knora and create resource class incl. cardinality // console.log('submit resource class data:', resourceClassData); // let i: number = 0; - this._dspApiConnection.v2.onto.createResourceClass(resourceClassData).subscribe( + this._dspApiConnection.v2.onto.createResourceClass(onto).subscribe( (classResponse: ResourceClassDefinitionWithAllLanguages) => { console.log(classResponse); + // close the dialog box + this.loading = false; + this.closeDialog.emit(); + // prepare last modification date and properties data // lastModificationDate = classResponse. From 81223a3825da477ad1a90a1cb19cf18ff3d00b37 Mon Sep 17 00:00:00 2001 From: mdelez <60604010+mdelez@users.noreply.github.com> Date: Mon, 26 Oct 2020 12:05:13 +0100 Subject: [PATCH 08/11] DSP-908 - Project List Sorting Fix (#323) * fix (projects-list): sort list in onInit() * fix (project-list): make sure list is not undefined before trying to sort it in onInit() --- .../projects/projects-list/projects-list.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/system/projects/projects-list/projects-list.component.ts b/src/app/system/projects/projects-list/projects-list.component.ts index 9abaed6269..f185302653 100644 --- a/src/app/system/projects/projects-list/projects-list.component.ts +++ b/src/app/system/projects/projects-list/projects-list.component.ts @@ -81,11 +81,15 @@ export class ProjectsListComponent implements OnInit { this.sysAdmin = this.session.user.sysAdmin; // sort list by defined key - if(localStorage.getItem('sortProjectsBy')) { + if (localStorage.getItem('sortProjectsBy')) { this.sortBy = localStorage.getItem('sortProjectsBy'); } else { localStorage.setItem('sortProjectsBy', this.sortBy); } + + if (this.list) { + this.sortList(this.sortBy); + } } /** From bbd3e2cccf01100ac96c83819ed1ddc32d07b77a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Wed, 28 Oct 2020 08:41:42 +0100 Subject: [PATCH 09/11] DSP-920 Renaming default github branch to "main" (#325) * chore(CI): Update workflow * chore: Update PR template --- .github/pull_request_template.md | 2 +- .github/workflows/main.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 16e961378c..e6965cdd98 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1 +1 @@ -resolves [DSP-xy](https://dasch.myjetbrains.com/youtrack/issue/DSP-xy) +resolves DSP- diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 97b01c699d..37ab54d83a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,8 +33,8 @@ jobs: name: Update next release draft needs: build-test runs-on: ubuntu-latest - # Drafts your next Release notes as Pull Requests are merged into "master" - if: github.ref == 'refs/heads/master' + # Drafts your next Release notes as Pull Requests are merged into "main" branch + if: github.ref == 'refs/heads/main' steps: - uses: release-drafter/release-drafter@v5 env: @@ -53,7 +53,7 @@ jobs: fetch-depth: 50 - name: Get previous tag id: previoustag - uses: "WyriHaximus/github-action-get-previous-tag@master" + uses: "WyriHaximus/github-action-get-previous-tag@1.0.0" - name: Update version in package.json run: npm version ${{steps.previoustag.outputs.tag}} --git-tag-version=false --commit-hooks=false - name: Build and publish image From d358f70cb2fef21ce5e85b7b96b7aae59d6cb95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Mon, 2 Nov 2020 12:00:38 +0100 Subject: [PATCH 10/11] Update dsp dependencies (#326) * feat: Update DSP-JS and DSP-UI lib * chore: Update editorconf * refactor: Update title * feat(help): Implement new healthEndpoint from JS-Lib * breaking(search): Implement new search panel from UI-Lib * style(project): Fix style issue in lists * test: Fix failing test * refactor(search): Delete redundant code * test: Fix failing test * test: Fix failing test * refactor(header): Remove unecessary console.log * fix(app module): Better import of mat modules * fix(tests): Bug fix in tests (missing imports) * fix(tests): Fix warnings in tests (missing imports) --- .editorconfig | 8 +- package-lock.json | 12 +- package.json | 8 +- src/app/app-routing.module.ts | 12 +- src/app/app.component.ts | 2 +- src/app/app.module.ts | 4 - src/app/main/header/header.component.html | 26 ++-- src/app/main/header/header.component.scss | 106 ++++----------- src/app/main/header/header.component.spec.ts | 2 + src/app/main/header/header.component.ts | 1 + src/app/main/help/help.component.spec.ts | 6 +- src/app/main/help/help.component.ts | 66 +++------- src/app/main/main.component.ts | 2 +- src/app/material-module.ts | 122 +++++------------- .../list-info-form.component.spec.ts | 2 + .../ontology-visualizer.component.spec.ts | 8 ++ .../visualizer/visualizer.component.spec.ts | 10 +- .../workspace/results/results.component.ts | 2 +- .../advanced-search.component.html | 17 --- .../advanced-search.component.scss | 0 .../advanced-search.component.spec.ts | 54 -------- .../advanced-search.component.ts | 43 ------ .../expert-search.component.html | 17 --- .../expert-search.component.scss | 7 - .../expert-search.component.spec.ts | 62 --------- .../expert-search/expert-search.component.ts | 57 -------- src/assets/style/_elements.scss | 21 +-- src/assets/style/_responsive.scss | 33 +++-- src/index.html | 2 +- 29 files changed, 176 insertions(+), 536 deletions(-) delete mode 100644 src/app/workspace/search/advanced-search/advanced-search.component.html delete mode 100644 src/app/workspace/search/advanced-search/advanced-search.component.scss delete mode 100644 src/app/workspace/search/advanced-search/advanced-search.component.spec.ts delete mode 100644 src/app/workspace/search/advanced-search/advanced-search.component.ts delete mode 100644 src/app/workspace/search/expert-search/expert-search.component.html delete mode 100644 src/app/workspace/search/expert-search/expert-search.component.scss delete mode 100644 src/app/workspace/search/expert-search/expert-search.component.spec.ts delete mode 100644 src/app/workspace/search/expert-search/expert-search.component.ts diff --git a/.editorconfig b/.editorconfig index c3f6db9d87..4b305e6aa4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,10 +13,16 @@ indent_size = 2 max_line_length = off trim_trailing_whitespace = false -[*.json, *.scss, *.yml] +[*.json] +indent_size = 2 + +[*.scss] indent_size = 2 [*.ts] spaces_around_brackets = inside singleQuote = true indent_size = 4 + +[*.yml] +indent_size = 2 diff --git a/package-lock.json b/package-lock.json index 9a8183b01b..28ccfdb7d7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1631,9 +1631,9 @@ } }, "@dasch-swiss/dsp-js": { - "version": "1.0.0-rc.13", - "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-1.0.0-rc.13.tgz", - "integrity": "sha512-7sjW7GeYSyyhAXcf0dYhaD8nMukuvQSeb4OwJXOhejHjT0bGZgeTOPKFlhIypUG7/A+jE18kR4Jm5IGB/HBIHA==", + "version": "1.0.0-rc.14", + "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-1.0.0-rc.14.tgz", + "integrity": "sha512-Gli5mfMKVfM1fYyxhz8I6ZXlW7Xja4JvI3NohvgSxJbPN72DGu+VAOqcgaju3pksUErEg0/ZL3XiCXywoDMVLQ==", "requires": { "@types/jsonld": "^1.5.0", "json2typescript": "1.4.1", @@ -1641,9 +1641,9 @@ } }, "@dasch-swiss/dsp-ui": { - "version": "1.0.0-rc.9", - "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-ui/-/dsp-ui-1.0.0-rc.9.tgz", - "integrity": "sha512-tefaco7yFjynoUXAOl1x6z8FkRFedrFF6kqtnaJqmaA3WjmeETMdNbOuWItMFNWOvPpIJpXdye211lE/MLleBw==", + "version": "1.0.0-rc.10", + "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-ui/-/dsp-ui-1.0.0-rc.10.tgz", + "integrity": "sha512-FMD2CiCJnxXH9l2sYJXRaJjGbHCiHSirCpNJShgjRVrV2tqhDJ0h5KyiX+ldGglutItouKLPcXAxqKMgFOXb1Q==", "requires": { "tslib": "^1.10.0" } diff --git a/package.json b/package.json index 103b8f6d1a..d2a752d21a 100644 --- a/package.json +++ b/package.json @@ -31,13 +31,13 @@ "@angular/platform-browser": "~9.1.12", "@angular/platform-browser-dynamic": "~9.1.12", "@angular/router": "~9.1.12", - "@dasch-swiss/dsp-js": "1.0.0-rc.13", - "@dasch-swiss/dsp-ui": "1.0.0-rc.9", + "@ckeditor/ckeditor5-angular": "^1.2.3", + "@dasch-swiss/dsp-js": "1.0.0-rc.14", + "@dasch-swiss/dsp-ui": "1.0.0-rc.10", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "^6.0.0", - "core-js": "^3.6.5", - "@ckeditor/ckeditor5-angular": "^1.2.3", "ckeditor5-custom-build": "github:dasch-swiss/ckeditor_custom_build", + "core-js": "^3.6.5", "d3": "^5.15.1", "d3-force-3d": "^2.1.0", "dat.gui": "^0.7.7", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 52df0f1aa8..0a025fd5e2 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -20,9 +20,7 @@ import { ProjectComponent } from './project/project.component'; import { DashboardComponent } from './user/dashboard/dashboard.component'; import { UserComponent } from './user/user.component'; - -import { AdvancedSearchComponent } from './workspace/search/advanced-search/advanced-search.component'; -import { ExpertSearchComponent } from './workspace/search/expert-search/expert-search.component'; +// search results and resource viewer import { ResourceComponent } from './workspace/resource/resource.component'; import { ResultsComponent } from './workspace/results/results.component'; @@ -154,14 +152,6 @@ const routes: Routes = [ { path: 'search', children: [ - { - path: 'advanced', - component: AdvancedSearchComponent - }, - { - path: 'expert', - component: ExpertSearchComponent - }, { path: ':mode/:q/:project', component: ResultsComponent diff --git a/src/app/app.component.ts b/src/app/app.component.ts index d8155ba225..6ef7b80ec9 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -14,7 +14,7 @@ export class AppComponent implements OnInit { private _titleService: Title) { // set the page title - this._titleService.setTitle('DSP-APP | DaSCH\'s generic user interface'); + this._titleService.setTitle('DaSCH Service Platform'); } diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a0c5f3b391..805469f981 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -69,8 +69,6 @@ import { UserMenuComponent } from './user/user-menu/user-menu.component'; import { UserComponent } from './user/user.component'; import { ResourceComponent } from './workspace/resource/resource.component'; import { ResultsComponent } from './workspace/results/results.component'; -import { AdvancedSearchComponent } from './workspace/search/advanced-search/advanced-search.component'; -import { ExpertSearchComponent } from './workspace/search/expert-search/expert-search.component'; import { environment } from '../environments/environment'; import { ExternalLinksDirective } from './main/directive/external-links.directive'; @@ -106,8 +104,6 @@ export function HttpLoaderFactory(httpClient: HttpClient) { SelectGroupComponent, ResultsComponent, ResourceComponent, - ExpertSearchComponent, - AdvancedSearchComponent, DashboardComponent, DialogComponent, SystemComponent, diff --git a/src/app/main/header/header.component.html b/src/app/main/header/header.component.html index 87ee899571..179385a9ed 100644 --- a/src/app/main/header/header.component.html +++ b/src/app/main/header/header.component.html @@ -3,38 +3,42 @@ - + - - - + + + - + - + - diff --git a/src/app/main/header/header.component.scss b/src/app/main/header/header.component.scss index f89c4c44d6..3e4f520fe1 100644 --- a/src/app/main/header/header.component.scss +++ b/src/app/main/header/header.component.scss @@ -2,37 +2,26 @@ @import "../../../assets/style/responsive"; .toolbar-header { - height: $header-height; + height: $header-height; } .logo { - .mat-icon { - height: 40px; - margin: 0 6px 6px 0; - - &.small { - width: 40px; + .home-button { + display: inline-block; + .mat-icon { + height: 40px; + margin: 0 6px 6px 0; + + &.small { + width: 40px; + } + } + .mat-headline { + margin-left: 6px; + } + .app-version { + margin: -12px 0; } - } -} - -.app-version { - margin: -12px 0; -} - -.project-selector { - margin-right: 6px; - font-size: inherit; -} -.ps-btn { - font-size: inherit; -} - -.home-button { - display: inline-block; - - .mat-headline { - margin-left: 6px; } } @@ -40,66 +29,19 @@ margin: 0 16px; } -.other-search-link { - display: grid; - grid-template-columns: 2fr 1fr 1fr; - height: 20px; - width: calc(480px + 160px); - margin-top: 3px; - - .advanced-search-link, - .expert-search-link { - justify-self: end; - line-height: 18px !important; - font-size: 0.6em; - } - - .advanced-search-link { - grid-column: 7 / span 2; - } - - .expert-search-link { - grid-column: 9 / span 2; +@media (min-width: 1025px) { + .desktop-only { + display: contents; } -} - -// desktop devices -@media (min-width: map-get($grid-breakpoints, tablet)) { - -} - -// mobile device: tablet and smaller than a tablet -@media (max-width: map-get($grid-breakpoints, tablet)) { - .hide-search { - display: none; - } -} - -// tablet and desktop device -@media (min-width: map-get($grid-breakpoints, phone)) { - .searchbar-phone-screen { - display: none; - } -} - -// tablet and desktop device -@media (max-width: map-get($grid-breakpoints, desktop)) and (min-width: map-get($grid-breakpoints, phone)) { - .space-before { + .phone-tablet-only { display: none; } } - -// mobile device: phone -@media (max-width: map-get($grid-breakpoints, phone)) { - - .searchbar-large-screen { +@media (max-width: 1024px) { + .desktop-only { display: none; } - .search-link { - padding: 0; - min-width: 45px; - } - .action { - padding: 0; + .phone-tablet-only { + display: contents; } } diff --git a/src/app/main/header/header.component.spec.ts b/src/app/main/header/header.component.spec.ts index bbd6c93ea1..4b70a131da 100644 --- a/src/app/main/header/header.component.spec.ts +++ b/src/app/main/header/header.component.spec.ts @@ -22,6 +22,7 @@ import { TestConfig } from 'test.config'; import { SelectLanguageComponent } from '../select-language/select-language.component'; import { HeaderComponent } from './header.component'; import { ComponentCommunicationEventService, EmitEvent, Events } from 'src/app/main/services/component-communication-event.service'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('HeaderComponent', () => { let component: HeaderComponent; @@ -36,6 +37,7 @@ describe('HeaderComponent', () => { UserMenuComponent ], imports: [ + BrowserAnimationsModule, HttpClientModule, DspActionModule, DspCoreModule, diff --git a/src/app/main/header/header.component.ts b/src/app/main/header/header.component.ts index cdb5dba6fb..1ff80d42ea 100644 --- a/src/app/main/header/header.component.ts +++ b/src/app/main/header/header.component.ts @@ -100,6 +100,7 @@ export class HeaderComponent implements OnInit, OnDestroy{ } doSearch(search: SearchParams) { + // reset search params this.searchParams = undefined; diff --git a/src/app/main/help/help.component.spec.ts b/src/app/main/help/help.component.spec.ts index c8d91c8e0c..32dc632b52 100644 --- a/src/app/main/help/help.component.spec.ts +++ b/src/app/main/help/help.component.spec.ts @@ -1,7 +1,8 @@ -import { HttpClientTestingModule } from '@angular/common/http/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { KnoraApiConnection } from '@dasch-swiss/dsp-js'; import { AppInitService, DspApiConfigToken, DspApiConnectionToken } from '@dasch-swiss/dsp-ui'; @@ -18,9 +19,10 @@ describe('HelpComponent', () => { TestBed.configureTestingModule({ declarations: [HelpComponent, FooterComponent, GridComponent], imports: [ - HttpClientTestingModule, + BrowserAnimationsModule, MatButtonModule, MatIconModule, + MatSnackBarModule, RouterTestingModule ], providers: [ diff --git a/src/app/main/help/help.component.ts b/src/app/main/help/help.component.ts index 6ed93c4be5..337e2c891b 100644 --- a/src/app/main/help/help.component.ts +++ b/src/app/main/help/help.component.ts @@ -2,8 +2,8 @@ import { HttpClient, HttpResponse } from '@angular/common/http'; import { Component, Inject, OnInit } from '@angular/core'; import { MatIconRegistry } from '@angular/material/icon'; import { DomSanitizer } from '@angular/platform-browser'; -import { KnoraApiConfig } from '@dasch-swiss/dsp-js'; -import { DspApiConfigToken } from '@dasch-swiss/dsp-ui'; +import { ApiResponseData, ApiResponseError, HealthResponse, KnoraApiConfig, KnoraApiConnection } from '@dasch-swiss/dsp-js'; +import { DspApiConfigToken, DspApiConnectionToken, NotificationService } from '@dasch-swiss/dsp-ui'; import { GridItem } from '../grid/grid.component'; declare let require: any; @@ -20,14 +20,10 @@ export class HelpComponent implements OnInit { appVersion: string = appVersion; - appName: string = appName; - - apiVersion: string; - - apiStatus: boolean; - sipiVersion = 'v3.0.0-rc.5'; + apiStatus: HealthResponse; + docs: GridItem[] = [ { icon: 'assignment', @@ -95,10 +91,10 @@ export class HelpComponent implements OnInit { ]; constructor( - @Inject(DspApiConfigToken) private _dspApiConfig: KnoraApiConfig, + @Inject(DspApiConnectionToken) private _dspApiConnection: KnoraApiConnection, + private _notification: NotificationService, private _domSanitizer: DomSanitizer, - private _matIconRegistry: MatIconRegistry, - private _http: HttpClient) { + private _matIconRegistry: MatIconRegistry) { // create tool icons to use them in mat-icons this._matIconRegistry.addSvgIcon( @@ -114,48 +110,24 @@ export class HelpComponent implements OnInit { ngOnInit() { // set dsp-app version - this.tools[0].title = this.appName + ' v' + this.appVersion; + this.tools[0].title += ' v' + this.appVersion; this.tools[0].url += this.appVersion; // set dsp-sipi version this.tools[2].title += this.sipiVersion; this.tools[2].url += this.sipiVersion; - const apiUrl: string = this._dspApiConfig.apiUrl; - - this._http.get(apiUrl + '/admin/projects', { observe: 'response' }) - .subscribe( - (resp: HttpResponse) => { - - this.readVersion(resp.headers.get('Server')); - this.apiStatus = true; - - }, - (error: any) => { - this.readVersion(error.headers.get('Server')); - console.error(error); - this.apiStatus = false; - } - ); - } - - readVersion(v: string) { - - if (!v) { - return; - } - - // read and set version of dsp - const versions: string[] = v.split(' '); - const dspApi: string = versions[0].split('/')[1]; - - // keep whole version number incl. -rc.xy - this.apiVersion = dspApi; - - this.tools[1].title += this.apiVersion; - this.tools[1].url += this.apiVersion; - - this.loading = false; + this._dspApiConnection.system.healthEndpoint.getHealthStatus().subscribe( + (response: ApiResponseData) => { + this.apiStatus = response.body; + const apiVersion = this.apiStatus.webapiVersion; + this.tools[1].title += apiVersion; + this.tools[1].url += apiVersion; + }, + (error: ApiResponseError) => { + this._notification.openSnackBar(error); + } + ) } diff --git a/src/app/main/main.component.ts b/src/app/main/main.component.ts index 57584e2a18..4c9d2637f0 100644 --- a/src/app/main/main.component.ts +++ b/src/app/main/main.component.ts @@ -69,7 +69,7 @@ export class MainComponent implements OnInit { private _titleService: Title ) { // set the page title - this._titleService.setTitle('DSP-APP | DaSCH\'s generic research interface'); + this._titleService.setTitle('DaSCH Service Platform'); // check if a session is active diff --git a/src/app/material-module.ts b/src/app/material-module.ts index a656d767a5..d88daf006c 100644 --- a/src/app/material-module.ts +++ b/src/app/material-module.ts @@ -1,26 +1,3 @@ -/* -import { NgModule } from '@angular/core'; - -import * as MAT_MODULES from '@angular/material'; - -export function mapMatlModules() { - return Object.keys(MAT_MODULES).filter((k) => { - const asset = MAT_MODULES[k]; - return typeof asset === 'function' && asset.name.startsWith('Mat') && asset.name.includes('Module'); - }).map((k) => MAT_MODULES[k]); -} - -const modules = mapMatlModules(); - -@NgModule({ - imports: modules, - exports: modules -}) -export class MaterialModule { -} - -*/ - // cdk modules import { DragDropModule } from '@angular/cdk/drag-drop'; import { NgModule } from '@angular/core'; @@ -55,72 +32,43 @@ import { MatToolbarModule } from '@angular/material/toolbar'; import { MatTooltipModule } from '@angular/material/tooltip'; import { MatTreeModule } from '@angular/material/tree'; +const matModules = [ + DragDropModule, + MatAutocompleteModule, + MatButtonModule, + MatButtonToggleModule, + MatCardModule, + MatCheckboxModule, + MatChipsModule, + MatDatepickerModule, + MatDialogModule, + MatExpansionModule, + MatGridListModule, + MatIconModule, + MatInputModule, + MatListModule, + MatMenuModule, + MatPaginatorModule, + MatProgressBarModule, + MatProgressSpinnerModule, + MatRadioModule, + MatSelectModule, + MatSidenavModule, + MatSliderModule, + MatSlideToggleModule, + MatSnackBarModule, + MatSortModule, + MatTableModule, + MatTabsModule, + MatToolbarModule, + MatTooltipModule, + MatTreeModule +] + @NgModule({ - imports: [ - MatAutocompleteModule, - MatButtonModule, - MatButtonToggleModule, - MatCardModule, - MatCheckboxModule, - MatChipsModule, - MatTableModule, - MatDatepickerModule, - MatDialogModule, - MatExpansionModule, - MatGridListModule, - MatIconModule, - MatInputModule, - MatListModule, - MatMenuModule, - MatPaginatorModule, - MatProgressBarModule, - MatProgressSpinnerModule, - MatRadioModule, - MatSelectModule, - MatSidenavModule, - MatSlideToggleModule, - MatSliderModule, - MatSnackBarModule, - MatSortModule, - MatTabsModule, - MatToolbarModule, - MatTooltipModule, - MatTreeModule, - DragDropModule - ], + imports: [ matModules ], - exports: [ - MatAutocompleteModule, - MatButtonModule, - MatButtonToggleModule, - MatCardModule, - MatCheckboxModule, - MatChipsModule, - MatTableModule, - MatDatepickerModule, - MatDialogModule, - MatExpansionModule, - MatGridListModule, - MatIconModule, - MatInputModule, - MatListModule, - MatMenuModule, - MatPaginatorModule, - MatProgressBarModule, - MatProgressSpinnerModule, - MatRadioModule, - MatSelectModule, - MatSidenavModule, - MatSlideToggleModule, - MatSliderModule, - MatSnackBarModule, - MatSortModule, - MatTabsModule, - MatToolbarModule, - MatTooltipModule, - MatTreeModule, - DragDropModule - ] + exports: [ matModules ] }) export class MaterialModule { } diff --git a/src/app/project/list/list-info-form/list-info-form.component.spec.ts b/src/app/project/list/list-info-form/list-info-form.component.spec.ts index 2c56853f23..a044ee21b6 100644 --- a/src/app/project/list/list-info-form/list-info-form.component.spec.ts +++ b/src/app/project/list/list-info-form/list-info-form.component.spec.ts @@ -3,6 +3,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { MatIconModule } from '@angular/material/icon'; import { MatInputModule } from '@angular/material/input'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { KnoraApiConnection } from '@dasch-swiss/dsp-js'; import { @@ -30,6 +31,7 @@ describe('ListInfoFormComponent', () => { ListItemFormComponent ], imports: [ + BrowserAnimationsModule, HttpClientModule, DspActionModule, DspCoreModule, diff --git a/src/app/project/ontology/ontology-visualizer/ontology-visualizer.component.spec.ts b/src/app/project/ontology/ontology-visualizer/ontology-visualizer.component.spec.ts index fbff208bec..9bd377bcc2 100644 --- a/src/app/project/ontology/ontology-visualizer/ontology-visualizer.component.spec.ts +++ b/src/app/project/ontology/ontology-visualizer/ontology-visualizer.component.spec.ts @@ -1,5 +1,8 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatRadioModule } from '@angular/material/radio'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatSliderModule } from '@angular/material/slider'; import { RouterTestingModule } from '@angular/router/testing'; import { IHasProperty, @@ -18,6 +21,7 @@ import { import { ErrorComponent } from 'src/app/main/error/error.component'; import { TestConfig } from 'test.config'; import { OntologyVisualizerComponent } from './ontology-visualizer.component'; +import { VisualizerComponent } from './visualizer/visualizer.component'; describe('OntologyVisualizerComponent', () => { let testHostComponent: OntologyVisualizerComponent; @@ -66,12 +70,16 @@ describe('OntologyVisualizerComponent', () => { TestBed.configureTestingModule({ declarations: [ OntologyVisualizerComponent, + VisualizerComponent, ErrorComponent ], imports: [ HttpClientTestingModule, DspActionModule, DspCoreModule, + MatRadioModule, + MatSliderModule, + MatSlideToggleModule, RouterTestingModule ], providers: [ diff --git a/src/app/project/ontology/ontology-visualizer/visualizer/visualizer.component.spec.ts b/src/app/project/ontology/ontology-visualizer/visualizer/visualizer.component.spec.ts index 0dbb5c804e..0f92f31320 100644 --- a/src/app/project/ontology/ontology-visualizer/visualizer/visualizer.component.spec.ts +++ b/src/app/project/ontology/ontology-visualizer/visualizer/visualizer.component.spec.ts @@ -1,4 +1,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatRadioModule } from '@angular/material/radio'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatSliderModule } from '@angular/material/slider'; import { VisualizerComponent } from './visualizer.component'; @@ -8,7 +11,12 @@ describe('VisualizerComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - declarations: [ VisualizerComponent ] + declarations: [ VisualizerComponent ], + imports: [ + MatRadioModule, + MatSliderModule, + MatSlideToggleModule + ], }) .compileComponents(); })); diff --git a/src/app/workspace/results/results.component.ts b/src/app/workspace/results/results.component.ts index 4de0ff7ece..a149f03aa7 100644 --- a/src/app/workspace/results/results.component.ts +++ b/src/app/workspace/results/results.component.ts @@ -21,7 +21,7 @@ export class ResultsComponent implements OnInit { this._route.paramMap.subscribe((params: Params) => { this.searchParams = { query: decodeURIComponent(params.get('q')), - mode: 'fulltext' + mode: (decodeURIComponent(params.get('mode')) === 'fulltext' ? 'fulltext' : 'gravsearch') }; // get the project iri if exists if (params.get('project')) { diff --git a/src/app/workspace/search/advanced-search/advanced-search.component.html b/src/app/workspace/search/advanced-search/advanced-search.component.html deleted file mode 100644 index 0d3e1bd168..0000000000 --- a/src/app/workspace/search/advanced-search/advanced-search.component.html +++ /dev/null @@ -1,17 +0,0 @@ -
- - - - Advanced search - - - - - - - -
- -
- -
diff --git a/src/app/workspace/search/advanced-search/advanced-search.component.scss b/src/app/workspace/search/advanced-search/advanced-search.component.scss deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/app/workspace/search/advanced-search/advanced-search.component.spec.ts b/src/app/workspace/search/advanced-search/advanced-search.component.spec.ts deleted file mode 100644 index 587a6d23e2..0000000000 --- a/src/app/workspace/search/advanced-search/advanced-search.component.spec.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { HttpClientTestingModule } from '@angular/common/http/testing'; -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; -import { KnoraApiConnection } from '@dasch-swiss/dsp-js'; -import { - AppInitService, - DspApiConfigToken, - DspApiConnectionToken, - DspSearchModule, - DspViewerModule -} from '@dasch-swiss/dsp-ui'; -import { TestConfig } from 'test.config'; -import { AdvancedSearchComponent } from './advanced-search.component'; - -describe('AdvancedSearchComponent', () => { - let component: AdvancedSearchComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [AdvancedSearchComponent], - imports: [ - HttpClientTestingModule, - DspSearchModule, - DspViewerModule, - MatExpansionModule, - RouterTestingModule - ], - providers: [ - AppInitService, - { - provide: DspApiConfigToken, - useValue: TestConfig.ApiConfig - }, - { - provide: DspApiConnectionToken, - useValue: new KnoraApiConnection(TestConfig.ApiConfig) - } - ] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(AdvancedSearchComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/workspace/search/advanced-search/advanced-search.component.ts b/src/app/workspace/search/advanced-search/advanced-search.component.ts deleted file mode 100644 index 8beae6e260..0000000000 --- a/src/app/workspace/search/advanced-search/advanced-search.component.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Title } from '@angular/platform-browser'; -import { Router } from '@angular/router'; -import { SearchParams, AdvancedSearchParamsService, AdvancedSearchParams } from '@dasch-swiss/dsp-ui'; - - -@Component({ - selector: 'app-advanced-search', - templateUrl: './advanced-search.component.html', - styleUrls: ['./advanced-search.component.scss'] -}) -export class AdvancedSearchComponent implements OnInit { - - loading: boolean = true; - - gravsearchQuery: string; - - searchParams: SearchParams; - - constructor( - private _titleService: Title, - private _router: Router - ) { - this._titleService.setTitle('Advanced search'); - } - - ngOnInit() { - // TODO: if gravsearch query exists in the advanced-search cache (AdvancedSearchParamsService), get it and reload the results - // otherwise empty (throw message) - } - - doSearch(search: SearchParams) { - // reset search params - this.searchParams = undefined; - // we can do the routing here or send the search param - // to (resource) list view directly - this.searchParams = search; - } - - openResource(id: string) { - this._router.navigate(['/resource/' + encodeURIComponent(id)]); - } -} diff --git a/src/app/workspace/search/expert-search/expert-search.component.html b/src/app/workspace/search/expert-search/expert-search.component.html deleted file mode 100644 index 1e03d6d5ff..0000000000 --- a/src/app/workspace/search/expert-search/expert-search.component.html +++ /dev/null @@ -1,17 +0,0 @@ -
- - - - Expert search - - - - - - - -
- -
- -
diff --git a/src/app/workspace/search/expert-search/expert-search.component.scss b/src/app/workspace/search/expert-search/expert-search.component.scss deleted file mode 100644 index 27237687ac..0000000000 --- a/src/app/workspace/search/expert-search/expert-search.component.scss +++ /dev/null @@ -1,7 +0,0 @@ -.expert-search-container { - min-height: 100%; -} - -.mat-input-element { - font-family: 'Courier New', Courier, monospace -} diff --git a/src/app/workspace/search/expert-search/expert-search.component.spec.ts b/src/app/workspace/search/expert-search/expert-search.component.spec.ts deleted file mode 100644 index ebb2f17b16..0000000000 --- a/src/app/workspace/search/expert-search/expert-search.component.spec.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; -import { KnoraApiConnection } from '@dasch-swiss/dsp-js'; -import { - AppInitService, - DspApiConfigToken, - DspApiConnectionToken, - DspViewerModule, - DspSearchModule -} from '@dasch-swiss/dsp-ui'; -import { TranslateModule } from '@ngx-translate/core'; -import { TestConfig } from 'test.config'; -import { ExpertSearchComponent } from './expert-search.component'; - -describe('ExpertSearchComponent', () => { - let component: ExpertSearchComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ExpertSearchComponent], - imports: [ - DspSearchModule, - DspViewerModule, - MatButtonModule, - MatExpansionModule, - MatFormFieldModule, - MatInputModule, - ReactiveFormsModule, - RouterTestingModule, - TranslateModule.forRoot() - ], - providers: [ - AppInitService, - { - provide: DspApiConfigToken, - useValue: TestConfig.ApiConfig - }, - { - provide: DspApiConnectionToken, - useValue: new KnoraApiConnection(TestConfig.ApiConfig) - } - ] - }).compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(ExpertSearchComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/workspace/search/expert-search/expert-search.component.ts b/src/app/workspace/search/expert-search/expert-search.component.ts deleted file mode 100644 index b7ab47c2c4..0000000000 --- a/src/app/workspace/search/expert-search/expert-search.component.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { Title } from '@angular/platform-browser'; -import { Router } from '@angular/router'; -import { SearchParams } from '@dasch-swiss/dsp-ui'; -import { CacheService } from 'src/app/main/cache/cache.service'; - -@Component({ - selector: 'app-expert-search', - templateUrl: './expert-search.component.html', - styleUrls: ['./expert-search.component.scss'] -}) -export class ExpertSearchComponent implements OnInit { - - loading: boolean = true; - - gravsearchQuery: string; - - searchParams: SearchParams; - - constructor( - private _cache: CacheService, - private _titleService: Title, - private _router: Router - ) { - this._titleService.setTitle('Expert search'); - } - - ngOnInit() { - - // TODO: find another solution - /* if (this._cache.has('gravsearch')) { - - // reload the results - this._cache.get('gravsearch').subscribe( - (response: string) => { - this.searchParams = { query: response, mode: 'gravsearch' }; - }, - (error: any) => { - console.error(error); - } - ); - } */ - } - - doSearch(search: SearchParams) { - // reset search params - this.searchParams = undefined; - // we can do the routing here or send the search param - // to (resource) list view directly - this.searchParams = search; - } - - openResource(id: string) { - this._router.navigate(['/resource/' + encodeURIComponent(id)]); - } - -} diff --git a/src/assets/style/_elements.scss b/src/assets/style/_elements.scss index b72101f8d7..550b9d2f82 100644 --- a/src/assets/style/_elements.scss +++ b/src/assets/style/_elements.scss @@ -77,7 +77,7 @@ a { } .external-link { - color: $primary_400 !important; + color: $primary_400 !important; } a, @@ -97,15 +97,18 @@ a, height: $header-height; border-radius: 0; } -} - -.new-resource { - width: 64px !important ; - align-content: center; - &:hover { - background-color: #EBEBEB; - } + // override dsp-ui search panel style + .dsp-search-panel .mobile-only .dsp-fulltext-search-button { + height: $header-height; + border-radius: 0; + margin-top: 4px; + } + .dsp-fulltext-search-mobile-panel .dsp-fulltext-search-button { + height: auto !important; + border-radius: $border-radius !important; + margin-top: 0 !important; + } } // -------------------------------------- diff --git a/src/assets/style/_responsive.scss b/src/assets/style/_responsive.scss index 24d27ebfb3..7e29b841f5 100644 --- a/src/assets/style/_responsive.scss +++ b/src/assets/style/_responsive.scss @@ -5,7 +5,7 @@ $grid-breakpoints: ( phone: 576px, tablet: 768px, notebook: 992px, - desktop: 1200px + desktop: 1200px, ); // desktop devices @@ -13,11 +13,19 @@ $grid-breakpoints: ( .desktop-only { display: contents; } - .mobile-only { + .fill-remaining-space.desktop-only { + display: flex; + } + .content.large.middle.desktop-only { + display: block; + } + .mobile-only, + .nav-link-mobile { display: none; } } +// mobile device: tablet and phone @media (max-width: map-get($grid-breakpoints, tablet)) { .desktop-only { display: none; @@ -27,8 +35,20 @@ $grid-breakpoints: ( } } +// mobile device: bigger than phone +@media (min-width: map-get($grid-breakpoints, phone)) { + // override dsp-ui search panel style + .dsp-fulltext-search.desktop-only { + display: inline-flex !important; + } + .advanced-expert-buttons { + font-size: smaller !important; + margin-top: -6px !important; + } +} + // mobile device: tablet and smaller than a tablet -@media (max-width: 768px) and (min-width: 576px) { +@media (max-width: map-get($grid-breakpoints, tablet)) and (min-width: map-get($grid-breakpoints, phone)) { .content { &.small, &.medium, @@ -123,10 +143,3 @@ $grid-breakpoints: ( } } } - -// desktop screen size: bigger than a tablet -@media (min-width: map-get($grid-breakpoints, tablet)) { - .nav-link-mobile { - display: none; - } -} diff --git a/src/index.html b/src/index.html index 72bb9a23c7..465b505048 100644 --- a/src/index.html +++ b/src/index.html @@ -3,7 +3,7 @@ - DSP-APP User Interface | Research Layer + DaSCH Service Platform From 00e57eda7be6f89c68b8c78a68e9c35a986b7c72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Tue, 3 Nov 2020 13:43:41 +0100 Subject: [PATCH 11/11] Update dependencies (#327) * docs: Update CHANGELOG * chore(CI): Update CHANGELOG on release only and attach to assets * chore: New workflow to generate CHANGELOG * chore: Update dsp dependencies --- .github/workflows/main.yml | 13 ++ .gitignore | 1 + CHANGELOG.md | 274 ------------------------------------- README.md | 2 +- package-lock.json | 12 +- package.json | 4 +- 6 files changed, 23 insertions(+), 283 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 37ab54d83a..265bef09b1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,6 +56,19 @@ jobs: uses: "WyriHaximus/github-action-get-previous-tag@1.0.0" - name: Update version in package.json run: npm version ${{steps.previoustag.outputs.tag}} --git-tag-version=false --commit-hooks=false + - name: Update CHANGELOG + uses: lakto/gren-changelog-action@v0.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + with: + options: '--override' + - name: Attach CHANGELOG to release assets + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GH_TOKEN }} + file: CHANGELOG.md + tag: ${{ github.ref }} + overwrite: true - name: Build and publish image run: | echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin diff --git a/.gitignore b/.gitignore index 5e6970f6fc..2d48abd9d7 100644 --- a/.gitignore +++ b/.gitignore @@ -42,6 +42,7 @@ docs/.sass-cache docs/.jekyll-metadata docs/vendor docs/bin +CHANGELOG.md # System Files .DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 46c4b8d457..0000000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,274 +0,0 @@ -# Changelog - -## v3.0.0-rc.2 (12/10/2020) - -## Enhancements - -- #303 DSP-329 Fix sort button -- #314 DSP-297 - Make the external links easy to spot -- #308 DSP-284 Display app version in header -- #310 DSP-339 - Add a link to the membership management page from the system project page - -## Styling - -- #309 DSP-689 Resource viewer fix style in properties toolbar -- #302 DSP-371 - Improve the visibility of expert and advanced search links - -## Bug fixes - -- #313 DSP-674 Replace search-panel with fulltext-search -- #306 DSP-700 Fix broken link to project -- #304 DSP-666 Fix issue with version number - -## Maintenance - -- #316 DSP-293 Update contact information on the landing page -- #315 Move services folder to main folder -- #312 DSP-766 Remove 'de' from list of available languages -- #307 DSP-368 - Redundancy with Cancel button and close button in dialog boxes -- #305 DSP-669 Add template for PRs - ---- - -## v3.0.0-rc.1 (22/09/2020) - -## Enhancements - -- #295 Login Success Message - -## Styling - -- #298 DSP-298 Add app name to header - -## Documentation - -- #296 Update README.md - -## Dependencies - -- #300 DSP-673 Update dependency - -## Maintenance - -- #299 Fix tiny issues -- #297 DSP-295 Open external link in new tab - ---- - -## v3.0.0-rc.0 (15/09/2020) - -## Breaking changes - -- #283 Upgrade to Angular 9 - -## Enhancements - -- #286 Get dsp-api version from the api server info -- #285 Integrate OntoVis -- #229 Simple ontology creator -- #275 Refactor material icons -- #260 Same content style in each project tab -- #256 Add new unit tests to components in the main folder -- #255 Fix wording through Knora-app - -## Styling - -- #275 Refactor material icons -- #260 Same content style in each project tab - -## Bug fixes - -- #294 Fix: Update docker environment - -## Documentation - -- #292 docs: Update README - -## Dependencies - -- #293 Update js- and ui-lib version -- #283 Upgrade to Angular 9 - -## Maintenance - -- #291 DSP-617 Update release process -- #290 DSP-617 Use release-drafter instead gren -- #288 DSP-420 update release process -- #287 Replace the term source by resource -- #284 Replace reset buttons with cancel button -- #280 Using npm instead yarn -- #275 Refactor material icons -- #259 Delete dev folder - -## Testing - -- #281 Update CI test environment -- #256 Add new unit tests to components in the main folder -- #254 Add todo list in spec files - ---- - -## v2.0.1 (31/01/2020) - -#### Enhancements: - -- [#248](https://github.com/dasch-swiss/knora-app/issues/248) Upgrade knora-api-js-lib to v0.2.0 -- [#100](https://github.com/dasch-swiss/knora-app/issues/100) Project admin should be able to add existing users to its project - -#### Bug Fixes: - -- [#245](https://github.com/dasch-swiss/knora-app/issues/245) Broken link to Knora release notes page on GitHub -- [#220](https://github.com/dasch-swiss/knora-app/issues/220) Wrong redirection after removing myself as project admin in project collaboration - ---- - -## v2.0.0 (20/12/2019) - -#### Breaking changes: - -- [#225](https://github.com/dasch-swiss/knora-app/issues/225) Integrate the knora-api-js-lib - -#### Enhancements: - -- [#91](https://github.com/dasch-swiss/knora-app/issues/91) Display the name of the project or ontology in resource view - -#### Bug Fixes: - -- [#148](https://github.com/dasch-swiss/knora-app/issues/148) Homepage: broken link - ---- - -## v1.6.3 (29/11/2019) - -#### Enhancements: - -- [#60](https://github.com/dasch-swiss/knora-app/issues/60) Test web app to improve user guide - -#### Bug Fixes: - -- [#202](https://github.com/dasch-swiss/knora-app/issues/202) Wording: deactivating a user -- [#174](https://github.com/dasch-swiss/knora-app/issues/174) Wording: delete, deactivate or archive a user? -- [#167](https://github.com/dasch-swiss/knora-app/issues/167) Archived projects : wording not accurate -- [#166](https://github.com/dasch-swiss/knora-app/issues/166) Wording: Users - Members - ---- - -## v1.6.2 (01/10/2019) - -#### Bug fix: - -- #96 Remove providers with interceptor - ---- - -## v1.6.1 (01/10/2019) - -#### Other: - -- [#95](https://github.com/dasch-swiss/knora-app/issues/95) Update links and clean up code - ---- - -## v1.6.0 (30/09/2019) - -#### Breaking changes: - -- [#48](https://github.com/dasch-swiss/knora-app/issues/48) Update to Angular 8 - -#### Enhancements: - -- [#72](https://github.com/dasch-swiss/knora-app/issues/72) Change label of Zurück button -- [#69](https://github.com/dasch-swiss/knora-app/issues/69) Update jdnconvertiblecalendar and adapter modules to latest versions - -#### Bug Fixes: - -- [#88](https://github.com/dasch-swiss/knora-app/issues/88) Login failed in Safari -- [#85](https://github.com/dasch-swiss/knora-app/issues/85) Update angular packages / Incorrect peer dependency -- [#79](https://github.com/dasch-swiss/knora-app/issues/79) Refresh page after login / logout doesn't work correct -- [#78](https://github.com/dasch-swiss/knora-app/issues/78) Display the list info in the user selected language instead of German - ---- - -## v1.5.0 (30/08/2019) - -#### Enhancements: - -- [#35](https://github.com/dhlab-basel/Kuirl/pull/35) Upgrade to Angular version 8 -- [#68](https://github.com/dhlab-basel/Kuirl/pull/68) Update to Knora-UI v9.0.0 ---- - -## v1.4.0 (26/08/2019) - -#### Enhancements: - -- [#46](https://github.com/dhlab-basel/Kuirl/pull/46) feat: Better password form handling -- [#56](https://github.com/dhlab-basel/Kuirl/pull/56) feat: system view > manage user's project membership -- [#52](https://github.com/dhlab-basel/Kuirl/pull/52) feat(main): Improve landing page -- [#51](https://github.com/dhlab-basel/Kuirl/pull/51) feat(users list): Disable "remove as sys admin" on own profile -- [#45](https://github.com/dhlab-basel/Kuirl/pull/45) feat: Simple list creator -- [#38](https://github.com/dhlab-basel/Kuirl/pull/38) style: Redesign layout to make it phone responsive -- [#37](https://github.com/dhlab-basel/Kuirl/pull/37) style: Improve responsive design - -#### Bug Fixes: - -- [#54](https://github.com/dhlab-basel/Kuirl/pull/54) style: Fix position of mat-menu and box-shadow - ---- - -## v1.3.0 (25/06/2019) - -#### Enhancements: - -- [#32](https://github.com/dhlab-basel/Kuirl/pull/32) Refactor: Clean up code, bug fixes, style optimization -- [#28](https://github.com/dhlab-basel/Kuirl/pull/28) chore: Remove Google APIs and replaced by self-hosting fonts and icons - -#### Bug Fixes: - -- [#33](https://github.com/dhlab-basel/Kuirl/pull/33) fix(workspace): Reload search results - -#### Other - -- [#30](https://github.com/dhlab-basel/Kuirl/pull/30) refactor(expert-search): Add expert-search from knora-ui search module - ---- - -## v1.2.0 (20/06/2019) - -#### Enhancements: - -- [#29](https://github.com/dhlab-basel/Kuirl/pull/29) Refactor: Clean up code and bug fixes -- [#12](https://github.com/dhlab-basel/Kuirl/pull/12) feat: Get app version and display in header -- [#27](https://github.com/dhlab-basel/Kuirl/pull/27) Update to Knora v8.0.0 and Knora-ui v8.0.0 -- [#26](https://github.com/dhlab-basel/Kuirl/pull/26) fix(users): Update list of users in cache -- [#21](https://github.com/dhlab-basel/Kuirl/pull/21) Feat: Open project from landing-page -- [#19](https://github.com/dhlab-basel/Kuirl/pull/19) chore: upgrade knora-ui modules to v7.6.0 -- [#16](https://github.com/dhlab-basel/Kuirl/pull/16) feat(admin): Show and set system admin -- [#13](https://github.com/dhlab-basel/Kuirl/pull/13) feat(admin): Improvements in the admin interface - -#### Bug Fixes: - -- [#22](https://github.com/dhlab-basel/Kuirl/pull/22) fix(docs): fix image path -- [#18](https://github.com/dhlab-basel/Kuirl/pull/18) fix(yarn): fix vulnerability with js-yaml and handlebars - -#### Documentation: - -- [#15](https://github.com/dhlab-basel/Kuirl/pull/15) docs(user guide): User guidelines as github-page - -#### Other - -- [#24](https://github.com/dhlab-basel/Kuirl/pull/24) fix(codacy): Fix codacy issues - ---- - -## v1.1.0 (09/05/2019) -- [style(header): Change logo size](https://github.com/dhlab-basel/Kuirl/commit/1a664a9947e75bba37e74d11821ce657cc58f7a7) - @flavens -- [test(admin): Fix broken test](https://github.com/dhlab-basel/Kuirl/commit/9dcccb43b0f9244afcc45fea45ae4b0c1974d0ad) - @kilchenmann -- [style(error): New error images](https://github.com/dhlab-basel/Kuirl/commit/3f3b64f55f8f103c72002b0c673d8715d574e28c) - @kilchenmann -- [feat(admin): create new project and user if sys admin](https://github.com/dhlab-basel/Kuirl/commit/b940e2507b55706d2847d13099494041268e2294) - @kilchenmann -- [feat(admin): init system admin element in user form](https://github.com/dhlab-basel/Kuirl/commit/0a2fcaa9da0c3ac5c94bae602c5faeec6067dd6d) - @kilchenmann -- [feat: get app version and display in header](https://github.com/dhlab-basel/Kuirl/commit/e82993f4917c94587dd8f33ddc5237ffb45f7912) - @kilchenmann -- [style(search): Remove margin-top of advanced and expert search bars + clean up unnecessary console.log()](https://github.com/dhlab-basel/Kuirl/commit/3fadf91faac1604e13a95be91fb5a1b82f94b9ec) - @flavens - ---- - -## v1.0.0 (30/04/2019) diff --git a/README.md b/README.md index ea6cda8b73..3e766e8530 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ We built the user guidelines and developer documentation with [MkDocs](https://w Before publishing: -- Update README and CHANGELOG if necessary and commit the changes (currently, the CHANGELOG has to be updated manually with [gren](https://github.com/github-tools/github-release-notes): `gren changelog --override`) +- Update README if necessary and commit the changes. - Be sure that all dependencies to DSP-UI-LIB, DSP-JS-LIB and DSP-API are set to the correct version. diff --git a/package-lock.json b/package-lock.json index 28ccfdb7d7..1dd3f0108b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1631,9 +1631,9 @@ } }, "@dasch-swiss/dsp-js": { - "version": "1.0.0-rc.14", - "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-1.0.0-rc.14.tgz", - "integrity": "sha512-Gli5mfMKVfM1fYyxhz8I6ZXlW7Xja4JvI3NohvgSxJbPN72DGu+VAOqcgaju3pksUErEg0/ZL3XiCXywoDMVLQ==", + "version": "1.0.0-rc.15", + "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-js/-/dsp-js-1.0.0-rc.15.tgz", + "integrity": "sha512-rNonl53y8ycItXoTgj9c6lIhAZ0m2q0WSEf0lkXzHw+YaD4qqRs10sT6f/7XDPKRDwCCemgpNFZGqVnNc3cacw==", "requires": { "@types/jsonld": "^1.5.0", "json2typescript": "1.4.1", @@ -1641,9 +1641,9 @@ } }, "@dasch-swiss/dsp-ui": { - "version": "1.0.0-rc.10", - "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-ui/-/dsp-ui-1.0.0-rc.10.tgz", - "integrity": "sha512-FMD2CiCJnxXH9l2sYJXRaJjGbHCiHSirCpNJShgjRVrV2tqhDJ0h5KyiX+ldGglutItouKLPcXAxqKMgFOXb1Q==", + "version": "1.0.0-rc.11", + "resolved": "https://registry.npmjs.org/@dasch-swiss/dsp-ui/-/dsp-ui-1.0.0-rc.11.tgz", + "integrity": "sha512-AMSjhhHhYgBmS2IjUBHLRK5cv0jd+9UlNPfAA/e7yvAe5pNA4eEHbQP51D1F3eo8NT4x/mSZ+u0bFeugd7JGOw==", "requires": { "tslib": "^1.10.0" } diff --git a/package.json b/package.json index d2a752d21a..4d5baaf3cc 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ "@angular/platform-browser-dynamic": "~9.1.12", "@angular/router": "~9.1.12", "@ckeditor/ckeditor5-angular": "^1.2.3", - "@dasch-swiss/dsp-js": "1.0.0-rc.14", - "@dasch-swiss/dsp-ui": "1.0.0-rc.10", + "@dasch-swiss/dsp-js": "1.0.0-rc.15", + "@dasch-swiss/dsp-ui": "1.0.0-rc.11", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "^6.0.0", "ckeditor5-custom-build": "github:dasch-swiss/ckeditor_custom_build",