New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(project): proof of new project workflow concept (DEV-985) #760
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
077232b
feat(workflow): new project concept
kilchenmann 8ba866d
feat(workflow): new project concept
kilchenmann a3cefa0
feat(workflow): new project concept
kilchenmann 4a53d7a
Merge branch 'main' into wip/new-project-concept
kilchenmann fcdce62
feat(workflow): new project concept
kilchenmann 5c35d61
Merge branch 'main' into wip/new-project-concept
kilchenmann ddc89e7
feat(workflow): new project concept
kilchenmann 362bb9e
feat(workflow): new project concept
kilchenmann 8288e62
test: start to fix unit tests
kilchenmann 8148b30
Merge branch 'main' into wip/new-project-concept
kilchenmann 9b522bf
test(list): refactor tests and list route
kilchenmann 33ad46e
test: refactor and resolve unit tests
kilchenmann e6232bb
chore(beta): avoid 404 when old route is active
kilchenmann 190f1f2
refactor: clean up code
kilchenmann File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be done a bit nicer so that only the class name is used in the sentence instead of the entire class id string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing. This will be done in the next iteration. Because I have only the IRI here and I have to make an API request first etc.