-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add reference datatype #10572
Add reference datatype #10572
Conversation
0d918ec
to
3e66b54
Compare
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.
Thanks, Cyrus! I left some initial comments, and I'll look forward to giving this a functional test next week.
What do you think about taking the opportunity to write one sanity-check unit test in datatype_tests.py
?
arches/app/templates/views/components/widgets/reference-select.htm
Outdated
Show resolved
Hide resolved
arches/app/templates/views/components/widgets/reference-select.htm
Outdated
Show resolved
Hide resolved
f27434d
to
4203f3c
Compare
207e602
to
4e71fbd
Compare
f6e13d9
to
1872a49
Compare
This comment was marked as resolved.
This comment was marked as resolved.
a5ce96c
to
9410ad1
Compare
a80dc7d
to
554e63e
Compare
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.
Updates looks great! One last Q for this re: the valueAndSelectionDiffer()
, and then I'll merge. 👍
current_language = requested_language or get_language() | ||
for item in self.get_tile_data(tile)[str(node.nodeid)]: | ||
for label in item["labels"]: | ||
if label["language"] == current_language and label["valuetype"] == "prefLabel": |
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 is okay for now, but in the next iteration we could probably use rank_label()
so that we have good fallbacks. Right now it will fallback to nothing.
Nice catch - thanks for looking into that. I'm not sure why I decided I needed to call that method in the value subscription. I've removed it and made a couple minor changes to ensure the dirty state clears properly if a user choses the same options with which the tile loaded (as opposed to just clicking 'Cancel Edit'). |
"_" can be confused for gettext
1438197
to
d7daa7c
Compare
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.
Thanks, looking great!
Types of changes
Description of Change
Stubs out the reference data type with a basic widget and node config.
Issues Solved
#10552
For reviewer:
PYTHONPATH="../arches" python3 manage.py shell -c "from tests.views.controlled_lists_tests import ControlledListTests; ControlledListTests.setUpTestData()"
You could also use the following which has some pref labels in German for localization testing :
reference
datatypemultiple values
off. (The multiple values parameter controls whether the node will accept only one list item value or many. Iffalse
, the widget will display a concept dropdown for a single item. Iftrue
the widget will support multiple selections.multiple values
totrue
. Refresh your card in the resource editor. The widget should now support multiple values.de
and ensure the widget localizes the options and selected values.