Skip to content

Commit

Permalink
Story/vgnwb 257 (#137)
Browse files Browse the repository at this point in the history
* started annotations list

* added checboxes to appellation list items

* fixed button not disappearing when swithcing out of submitallappellation

* add and remove from appellations in appellation list

 Changes to be committed:
	modified:   annotations/static/annotations/js/annotators/appellationlist.js
fixed git author

* added select menu

* added template rest view, serializer, removed empty graphys.py file, and added select to appellation list template

* retrieve single part templates using rest_views, added select for templates, added serializer, removed dotenv files

* fixed missing quote

* added vuex, added vue dev build, concept picker now shows when clicking select concepts button. moved getCreatorName and getFormattedDate out of utils and into appellationlist and relationlist components.

* started refactoring prepare method

* started create from text view

* added create from text method to create relations from a text to current appellations

* added mass assignment field to relation template

* changed vue to production

* added select all, deselect all buttons. fixed adding of duplicate annotations list, fixed select concept button not hiding. added error message if upload fails. Fixed css on buttons

* removed png.icloud images

* removed xml.icloud files

* added semicolons, comment, and changed vue to production

* added migration file

* fixed static part_id, user id, occursIn id and project Id. also removed vue.js file

* [story/VGNWB-257] added moment js.

* [story/VGNWB-257] refactored moment js, fixed wonky formatting, refactored layout to reduce clutter on smaller screens.

* [story/VGNWB-257] added new css break point called xl, refactored layout to work on both larger screens and medium dpi screens

* updated setAppellation to use slice to clone array to get ride of reference

* Fixed validation errors. error is raised when nothing is selected and submit is clicked. Errors messages are removed once the error has been corrected. Once a concept is selected for a text, it will automatically populate the concept field.

* added check/uncheck functionality through root event
  • Loading branch information
tjquinn1 authored and jdamerow committed Apr 8, 2019
1 parent 2a0989e commit 38b35c9
Show file tree
Hide file tree
Showing 35 changed files with 15,917 additions and 967 deletions.
2 changes: 0 additions & 2 deletions .env

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ target/
*.rdb

node_modules
.DS_STORE
.env
.vscode
1 change: 0 additions & 1 deletion annotations/fixtures/embryo_fixture.json

This file was deleted.

Empty file removed annotations/graphs.py
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2019-03-13 20:19
from __future__ import unicode_literals

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('annotations', '0032_auto_20170523_1753'),
]

operations = [
migrations.AddField(
model_name='relationtemplate',
name='use_in_mass_assignment',
field=models.BooleanField(default=False),
),
]
4 changes: 4 additions & 0 deletions annotations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,10 @@ class RelationTemplate(models.Model):
"""Pattern for representing the relation in normal language."""

_terminal_nodes = models.TextField(blank=True, null=True)
use_in_mass_assignment = models.BooleanField(default=False)

def __str__(self):
return self.name

def _get_terminal_nodes(self):
return self._terminal_nodes
Expand Down
2 changes: 0 additions & 2 deletions annotations/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,6 @@ def generate_expression(template, relations):
expression_keys = [k[1].replace('_', '') for k in Formatter().parse(template.expression)
if k[1] is not None]
expression_data = {}
print expression_keys
print relations
for key in expression_keys:
try:
relation = relations[int(key[0])]
Expand Down
42 changes: 27 additions & 15 deletions annotations/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,21 @@ class Meta:
class TextSerializer(serializers.ModelSerializer):
class Meta:
model = Text
fields = ('id', 'uri', 'title', 'created', 'added',
'addedBy', 'source', 'annotators', 'annotation_count')
fields = ('id', 'uri', 'title', 'created', 'added', 'addedBy',
'source', 'annotators', 'annotation_count')

def create(self, validated_data):
repository = Repository.objects.get(pk=validated_data['source'])
# TODO: Make retrieval/tokenization/other processing asynchronous.
tokenizedContent = tokenize(retrieve(repository, validated_data['uri']))

text = Text(uri=validated_data['uri'],
title=validated_data['title'],
source=repository,
addedBy=self.context['request'].user,
tokenizedContent=tokenizedContent)
tokenizedContent = tokenize(
retrieve(repository, validated_data['uri']))

text = Text(
uri=validated_data['uri'],
title=validated_data['title'],
source=repository,
addedBy=self.context['request'].user,
tokenizedContent=tokenizedContent)
text.save()
return HttpResponse(text.id)

Expand All @@ -92,7 +94,6 @@ class Meta:
'startPos', 'stringRep', 'tokenIds', 'interpretation_label',
'interpretation_type_label', 'position', 'project')


class AppellationPOSTSerializer(serializers.ModelSerializer):
position = DocumentPositionSerializer(required=False)
tokenIds = serializers.CharField(required=False)
Expand All @@ -105,14 +106,12 @@ class Meta:
'startPos', 'stringRep', 'tokenIds', 'interpretation_label',
'interpretation_type_label', 'position', 'project')


class TypeSerializer(serializers.ModelSerializer):
class Meta:
model = Type
fields = ('id', 'url', 'uri', 'label', 'authority', 'typed',
'description')


class RelationSetSerializer(serializers.ModelSerializer):
appellations = AppellationSerializer(many=True)
date_appellations = DateAppellationSerializer(many=True)
Expand All @@ -121,8 +120,9 @@ class RelationSetSerializer(serializers.ModelSerializer):

class Meta:
model = RelationSet
fields = ('id', 'label', 'created', 'template', 'createdBy', 'occursIn',
'appellations', 'concepts', 'project', 'representation', 'date_appellations' ) #
fields = ('id', 'label', 'created', 'template', 'createdBy',
'occursIn', 'appellations', 'concepts', 'project',
'representation', 'date_appellations') #


class TemporalBoundsSerializer(serializers.ModelSerializer):
Expand All @@ -131,8 +131,20 @@ class Meta:
fields = '__all__'



class TextCollectionSerializer(serializers.ModelSerializer):
class Meta:
model = TextCollection
fields = '__all__'


class TemplatePartSerializer(serializers.ModelSerializer):
class Meta:
model = RelationTemplate
fields = ('id', 'name', 'description')


class TemplateSerializer(serializers.ModelSerializer):
class Meta:
model = RelationTemplate
fields = ('id', 'name', 'description', 'template_parts')
depth = 1
Loading

0 comments on commit 38b35c9

Please sign in to comment.