diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index d0e5a3098c..a6ca548982 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -8,10 +8,13 @@ import { HelpComponent } from './main/help/help.component';
import { MainComponent } from './main/main.component';
import { StatusComponent } from './main/status/status.component';
import { OntologyClassInstanceComponent } from './project/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component';
+import { SettingsComponent } from './project/beta/settings/settings.component';
// project
import { BoardComponent } from './project/board/board.component';
import { CollaborationComponent } from './project/collaboration/collaboration.component';
+import { ListInfoFormComponent } from './project/list/list-info-form/list-info-form.component';
import { ListComponent } from './project/list/list.component';
+import { OntologyFormComponent } from './project/ontology/ontology-form/ontology-form.component';
import { OntologyComponent } from './project/ontology/ontology.component';
import { PermissionComponent } from './project/permission/permission.component';
import { ProjectComponent } from './project/project.component';
@@ -111,6 +114,11 @@ const routes: Routes = [
path: 'info', // old path setup to avoid 404 when typing beta in front of project
redirectTo: ''
},
+ {
+ path: 'add-ontology',
+ component: OntologyFormComponent,
+ canActivate: [AuthGuard]
+ },
{
path: 'ontology',
component: HintComponent,
@@ -135,6 +143,11 @@ const routes: Routes = [
path: 'ontology/:onto/:class/:instance',
component: OntologyClassInstanceComponent,
},
+ {
+ path: 'add-list',
+ component: ListInfoFormComponent,
+ canActivate: [AuthGuard]
+ },
{
path: 'list',
component: HintComponent,
@@ -147,19 +160,23 @@ const routes: Routes = [
},
{
path: 'settings',
- component: StatusComponent,
- data: { status: 501, comment: 'Here you will be able to configure the project: e.g. setup collaboration and permissions.' },
- canActivate: [AuthGuard]
- },
- {
- path: 'settings/collaboration',
- component: CollaborationComponent,
- canActivate: [AuthGuard]
- },
- {
- path: 'settings/permissions',
- component: PermissionComponent,
- canActivate: [AuthGuard]
+ component: SettingsComponent,
+ canActivate: [AuthGuard],
+ children: [
+ {
+ path: '',
+ pathMatch: 'full',
+ redirectTo: 'collaboration'
+ },
+ {
+ path: 'collaboration',
+ component: CollaborationComponent
+ },
+ {
+ path: 'permissions',
+ component: PermissionComponent
+ },
+ ]
},
{
path: '**',
diff --git a/src/app/app.module.ts b/src/app/app.module.ts
index 6d14d74683..e8f68883b9 100644
--- a/src/app/app.module.ts
+++ b/src/app/app.module.ts
@@ -164,6 +164,7 @@ import { TextComponent } from './workspace/resource/representation/text/text.com
import { OntologyClassesComponent } from './project/beta/ontology-classes/ontology-classes.component';
import { OntologyClassItemComponent } from './project/beta/ontology-classes/ontology-class-item/ontology-class-item.component';
import { OntologyClassInstanceComponent } from './project/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component';
+import { SettingsComponent } from './project/beta/settings/settings.component';
// translate: AoT requires an exported function for factories
export function httpLoaderFactory(httpClient: HttpClient) {
@@ -314,7 +315,8 @@ export function httpLoaderFactory(httpClient: HttpClient) {
TextComponent,
OntologyClassesComponent,
OntologyClassItemComponent,
- OntologyClassInstanceComponent
+ OntologyClassInstanceComponent,
+ SettingsComponent
],
imports: [
AngularSplitModule.forRoot(),
diff --git a/src/app/main/action/hint/hint.component.html b/src/app/main/action/hint/hint.component.html
index 0c90c07091..a186641a09 100644
--- a/src/app/main/action/hint/hint.component.html
+++ b/src/app/main/action/hint/hint.component.html
@@ -1,5 +1,5 @@
-
+
Read more in the user guidelaunch
diff --git a/src/app/main/dialog/dialog.component.html b/src/app/main/dialog/dialog.component.html
index d2682da841..01a77fc374 100644
--- a/src/app/main/dialog/dialog.component.html
+++ b/src/app/main/dialog/dialog.component.html
@@ -32,12 +32,12 @@
@@ -179,12 +179,12 @@
Do you want to delete this node?
@@ -208,12 +208,12 @@
Do you want to delete this list?
@@ -237,12 +237,12 @@
Do you want to delete this data model?
@@ -268,12 +268,12 @@
Do you want to delete this resource class?
@@ -308,12 +308,12 @@
Do you want to delete this property?
@@ -347,7 +347,7 @@
diff --git a/src/app/project/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.html b/src/app/project/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.html
index 88643b5630..1735a99a8c 100644
--- a/src/app/project/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.html
+++ b/src/app/project/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.html
@@ -27,7 +27,7 @@
-
Create new {{classId}} instance
+
Create new resource of type: {{resClass?.label}}
@@ -35,3 +35,6 @@
Create new {{classId}} instance
+
+
+
diff --git a/src/app/project/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.ts b/src/app/project/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.ts
index fe72f6059c..342e90d19f 100644
--- a/src/app/project/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.ts
+++ b/src/app/project/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.ts
@@ -1,6 +1,8 @@
-import { Component } from '@angular/core';
+import { Component, OnChanges } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
+import { ReadOntology, ResourceClassDefinition } from '@dasch-swiss/dsp-js';
import { AppInitService } from 'src/app/app-init.service';
+import { CacheService } from 'src/app/main/cache/cache.service';
import { OntologyService } from 'src/app/project/ontology/ontology.service';
import { FilteredResources, SearchParams } from 'src/app/workspace/results/list-view/list-view.component';
import { SplitSize } from 'src/app/workspace/results/results.component';
@@ -10,13 +12,21 @@ import { SplitSize } from 'src/app/workspace/results/results.component';
templateUrl: './ontology-class-instance.component.html',
styleUrls: ['./ontology-class-instance.component.scss']
})
-export class OntologyClassInstanceComponent {
+export class OntologyClassInstanceComponent implements OnChanges {
projectId: string;
+ ontoId: string;
+
+ // id (iri) of resource class
classId: string;
+ resClass: ResourceClassDefinition;
+
+ // uuid of resource instance
instanceId: string;
+ // id (iri) or resource instance
+ resourceIri: string;
searchParams: SearchParams;
@@ -30,6 +40,7 @@ export class OntologyClassInstanceComponent {
constructor(
private _ais: AppInitService,
+ private _cache: CacheService,
private _route: ActivatedRoute,
private _ontologyService: OntologyService
) {
@@ -46,16 +57,22 @@ export class OntologyClassInstanceComponent {
const className = params['class'];
// get the resource class id from route
- this.classId = `${iriBase}/ontology/${projectCode}/${ontologyName}/v2#${className}`;
+ this.ontoId = `${iriBase}/ontology/${projectCode}/${ontologyName}/v2`;
+ this.classId = `${this.ontoId}#${className}`;
this.instanceId = params['instance'];
if (this.instanceId) {
- // single instance
+ // single instance view
if (this.instanceId === 'add') {
// create new res class instance: display res instance form
+ this.ngOnChanges();
+ } else {
+ // get the single resource instance
+ this.resourceIri = `${this._ais.dspAppConfig.iriBase}/${projectCode}/${this.instanceId}`;
}
} else {
+ // display all resource instances of this resource class
this.searchParams = {
query: this._setGravsearch(this.classId),
mode: 'gravsearch'
@@ -64,6 +81,16 @@ export class OntologyClassInstanceComponent {
});
}
+ ngOnChanges() {
+ this._cache.get('currentProjectOntologies').subscribe(
+ (ontologies: ReadOntology[]) => {
+ // find ontology of current resource class to get the class label
+ const classes = ontologies[ontologies.findIndex(onto => onto.id === this.ontoId)].getAllClassDefinitions();
+ this.resClass = classes[classes.findIndex(res => res.id === this.classId)];
+ }
+ );
+ }
+
openSelectedResources(res: FilteredResources) {
this.selectedResources = res;
diff --git a/src/app/project/beta/ontology-classes/ontology-class-item/ontology-class-item.component.html b/src/app/project/beta/ontology-classes/ontology-class-item/ontology-class-item.component.html
index acb38ff276..bfbaf735ca 100644
--- a/src/app/project/beta/ontology-classes/ontology-class-item/ontology-class-item.component.html
+++ b/src/app/project/beta/ontology-classes/ontology-class-item/ontology-class-item.component.html
@@ -1,14 +1,15 @@