-
Notifications
You must be signed in to change notification settings - Fork 2
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
JSON corpus interface #1584
Merged
Merged
JSON corpus interface #1584
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e41db24
add corpus definitions link
lukavdplas 74b1235
generate definitions overview component
lukavdplas 9540010
basic interface for definitions overview
lukavdplas cc9521b
add APICorpusDefinition interface
lukavdplas ce9206c
fetch definitions in overview
lukavdplas 9ac7a07
draft create-definition component
lukavdplas d2a9f3f
draft edit corpus component
lukavdplas 63ca156
add breadcrumbs
lukavdplas c9a6340
use router state in edit definition component
lukavdplas 9855b77
include search link in overview
lukavdplas d623079
update tests
lukavdplas 0f967cf
update API for corpus definitions
lukavdplas 55d6b6f
update frontend to new API
lukavdplas 7ee40ef
implement JSON download
lukavdplas c86c717
draft json upload
lukavdplas 23d052d
show current state in edit component
lukavdplas 3359a62
extract json upload component
lukavdplas a8a1517
draft CorpusDefinition model
lukavdplas 41d5fac
simplify update interface
lukavdplas 1a789cc
create definition form
lukavdplas ecd44d3
enable deleting corpora
lukavdplas 76669ad
basic feedback for saving data
lukavdplas 35fea96
update documentation
lukavdplas db611d2
clear corpus data in tests
lukavdplas 7f9555c
fix property reference
lukavdplas 968ac83
Merge branch 'develop' into feature/json-corpus-interface
JeltevanBoheemen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
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,10 +1,10 @@ | ||
from addcorpus.json_corpora.validate import validate | ||
|
||
|
||
def test_validate(json_corpus_data): | ||
validate(json_corpus_data) | ||
def test_validate(json_corpus_definition): | ||
validate(json_corpus_definition) | ||
|
||
|
||
def test_validate_subschema(json_corpus_data): | ||
source_data = json_corpus_data['source_data'] | ||
def test_validate_subschema(json_corpus_definition): | ||
source_data = json_corpus_definition['source_data'] | ||
validate(source_data, 'properties', 'source_data') |
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
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
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
26 changes: 26 additions & 0 deletions
26
frontend/src/app/corpus-definitions/corpus-definitions.module.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,26 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { DefinitionsOverviewComponent } from './definitions-overview/definitions-overview.component'; | ||
import { SharedModule } from '../shared/shared.module'; | ||
import { CreateDefinitionComponent } from './create-definition/create-definition.component'; | ||
import { EditDefinitionComponent } from './edit-definition/edit-definition.component'; | ||
import { DefinitionJsonUploadComponent } from './definition-json-upload/definition-json-upload.component'; | ||
|
||
|
||
|
||
@NgModule({ | ||
declarations: [ | ||
CreateDefinitionComponent, | ||
DefinitionsOverviewComponent, | ||
EditDefinitionComponent, | ||
DefinitionJsonUploadComponent, | ||
], | ||
exports: [ | ||
CreateDefinitionComponent, | ||
DefinitionsOverviewComponent, | ||
EditDefinitionComponent, | ||
], | ||
imports: [ | ||
SharedModule | ||
] | ||
}) | ||
export class CorpusDefinitionsModule { } |
42 changes: 42 additions & 0 deletions
42
frontend/src/app/corpus-definitions/create-definition/create-definition.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,42 @@ | ||
<section class="section"> | ||
<div class="container"> | ||
<nav aria-label="secondary navigation" class="breadcrumb"> | ||
<ul> | ||
<li><a [routerLink]="['/']">Corpora</a></li> | ||
<li><a [routerLink]="['..']">Definitions</a></li> | ||
<li class="is-active" aria-current="page"><a>New corpus</a></li> | ||
</ul> | ||
</nav> | ||
|
||
<h1 class="title">New corpus</h1> | ||
|
||
<p class="block"> | ||
Upload a JSON definition file to add it as a corpus. | ||
</p> | ||
|
||
<form> | ||
<div class="block"> | ||
<ia-definition-json-upload | ||
[reset]="reset$" (upload)="onJSONUpload($event)"> | ||
</ia-definition-json-upload> | ||
</div> | ||
|
||
<div class="block" *ngIf="corpus.isComplete()"> | ||
<button class="button is-primary" type="submit" (click)="submit()"> | ||
<span class="icon" aria-hidden="true"> | ||
<fa-icon [icon]="formIcons.confirm"></fa-icon> | ||
</span> | ||
<span> | ||
Save corpus | ||
</span> | ||
</button> | ||
</div> | ||
|
||
<div class="message is-danger" *ngIf="error"> | ||
<div class="message-body"> | ||
Could not save corpus: {{error.message}} | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</section> |
Empty file.
Oops, something went wrong.
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.
nice!