Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat(workflow): new project concept * feat(workflow): new project concept * feat(workflow): new project concept * feat(workflow): new project concept * feat(workflow): new project concept * feat(workflow): new project concept * test: start to fix unit tests * test(list): refactor tests and list route * test: refactor and resolve unit tests * chore(beta): avoid 404 when old route is active * refactor: clean up code
- Loading branch information
1 parent
5884f51
commit 2391f2a
Showing
45 changed files
with
1,246 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
:host { | ||
padding: 16px; | ||
display: block; | ||
} | ||
|
||
a { | ||
margin: 16px auto; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...ject/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!-- display all resource instances if instance id does not exist --> | ||
<!-- In case if results present --> | ||
<div class="multiple-instances" *ngIf="searchParams"> | ||
<as-split direction="horizontal" (dragEnd)="splitSizeChanged = $event"> | ||
<as-split-area [size]="40"> | ||
<app-list-view [search]="searchParams" [displayViewSwitch]="true" [withMultipleSelection]="true" | ||
(selectedResources)="openSelectedResources($event)"> | ||
</app-list-view> | ||
</as-split-area> | ||
<as-split-area [size]="60" *ngIf="selectedResources?.count > 0" cdkScrollable> | ||
<div [ngSwitch]="viewMode"> | ||
<!-- single resource view --> | ||
<app-resource *ngSwitchCase="'single'" [resourceIri]="selectedResources.resInfo[0].id" [splitSizeChanged]="splitSizeChanged"></app-resource> | ||
|
||
<!-- intermediate view --> | ||
<app-intermediate *ngSwitchCase="'intermediate'" [resources]="selectedResources" (action)="viewMode=$event"></app-intermediate> | ||
|
||
<!-- multiple resources view / comparison viewer --> | ||
<app-comparison *ngSwitchCase="'compare'" [noOfResources]="selectedResources.count" | ||
[resources]="selectedResources.resInfo" [splitSizeChanged]="splitSizeChanged"> | ||
</app-comparison> | ||
</div> | ||
</as-split-area> | ||
</as-split> | ||
</div> | ||
|
||
|
||
<!-- add new resource instance if instance id is called "add" --> | ||
<div class="single-instance-form" *ngIf="instanceId && instanceId === 'add'"> | ||
<h3>Create new {{classId}} instance</h3> | ||
<app-resource-instance-form | ||
[selectedResourceClassIri]="classId" | ||
[selectedProject]="projectId"> | ||
</app-resource-instance-form> | ||
</div> | ||
|
||
<!-- display single resource instance if instance id exists and is not called "add" --> |
12 changes: 12 additions & 0 deletions
12
...ject/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@import "../../../../../assets/style/config"; | ||
|
||
.multiple-instances { | ||
height: calc(100vh - #{$header-height}); | ||
} | ||
|
||
|
||
.single-instance-form { | ||
max-width: 720px; | ||
display: block; | ||
padding: 16px; | ||
} |
74 changes: 74 additions & 0 deletions
74
...t/beta/ontology-classes/ontology-class-instance/ontology-class-instance.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { MatDialogModule } from '@angular/material/dialog'; | ||
import { MatSnackBarModule } from '@angular/material/snack-bar'; | ||
import { ActivatedRoute } from '@angular/router'; | ||
import { RouterTestingModule } from '@angular/router/testing'; | ||
import { KnoraApiConnection } from '@dasch-swiss/dsp-js'; | ||
import { of } from 'rxjs'; | ||
import { AppInitService } from 'src/app/app-init.service'; | ||
import { DspApiConfigToken, DspApiConnectionToken } from 'src/app/main/declarations/dsp-api-tokens'; | ||
import { TestConfig } from 'test.config'; | ||
import { OntologyClassInstanceComponent } from './ontology-class-instance.component'; | ||
|
||
|
||
describe('OntologyClassInstanceComponent', () => { | ||
let component: OntologyClassInstanceComponent; | ||
let fixture: ComponentFixture<OntologyClassInstanceComponent>; | ||
|
||
const appInitSpy = { | ||
dspAppConfig: { | ||
iriBase: 'http://rdfh.ch' | ||
} | ||
}; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [OntologyClassInstanceComponent], | ||
imports: [ | ||
MatSnackBarModule, | ||
MatDialogModule, | ||
RouterTestingModule | ||
], | ||
providers: [ | ||
{ | ||
provide: AppInitService, | ||
useValue: appInitSpy | ||
}, | ||
{ | ||
provide: DspApiConfigToken, | ||
useValue: TestConfig.ApiConfig | ||
}, | ||
{ | ||
provide: DspApiConnectionToken, | ||
useValue: new KnoraApiConnection(TestConfig.ApiConfig) | ||
}, | ||
{ | ||
provide: ActivatedRoute, | ||
useValue: { | ||
params: of({ | ||
onto: 'anything', | ||
class: 'BlueThing', | ||
}), | ||
parent: { | ||
snapshot: { | ||
params: { shortcode: '0001' } | ||
} | ||
} | ||
} | ||
} | ||
|
||
] | ||
}) | ||
.compileComponents(); | ||
}); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(OntologyClassInstanceComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.