Skip to content
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

Fix/iris #919

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 22 additions & 16 deletions app/scripts/controlled-term/class-list.directive.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@
<div class="class-list-container">
<div class="class-list-table">
<table class="table table-hover table-striped ">
<!-- Will need te below commented out parts of the table after schema will be extended to store ontology name,
so these fields can be queried and displayed -->
<thead>
<tr>
<th>Name</th>
<th width="250px">Description</th>
<th>Source</th>
<th>Identifier</th>
<th colspan=5 >IRI</th>
<!-- <th>Name</th>-->
<!-- <th width="250px">Description</th>-->
<!-- <th>Source</th>-->
<!-- <th>Identifier</th>-->
<th><button class="close" style="left:0;color:#000" type="button" ng-click="dialogOpen = false"
tooltip-append-to-body="true"
uib-tooltip="{{'GENERIC.Close' | translate}}"
Expand All @@ -20,18 +23,21 @@
</thead>
<tbody>
<tr ng-if="addedFieldKeys.length > 0" ng-repeat="key in addedFieldKeys">
<td>
{{getPrefLabel(key)}}
</td>
<td style="font-size:0.9em">
{{getShortText(getClassDescription(key), 120, '...', '-')}}
</td>
<td>
{{parseOntologyName(key)}}
</td>
<td uib-tooltip="{{getShortId(getClassId(key))}}" tooltip-append-to-body="true">
{{getShortId(getClassId(key), 16)}}
</td>
<td colspan="5">
{{key}}
</td>
<!-- <td>-->
<!-- {{getPrefLabel(key)}}-->
<!-- </td>-->
<!-- <td style="font-size:0.9em">-->
<!-- {{getShortText(getClassDescription(key), 120, '...', '-')}}-->
<!-- </td>-->
<!-- <td>-->
<!-- {{parseOntologyName(key)}}-->
<!-- </td>-->
<!-- <td uib-tooltip="{{getShortId(getClassId(key))}}" tooltip-append-to-body="true">-->
<!-- {{getShortId(getClassId(key), 16)}}-->
<!-- </td>-->
<td>
<div class="class-delete" ng-click="deleteFieldAddedItem(key);$event.stopPropagation();"
tooltip-append-to-body="true"
Expand Down
14 changes: 8 additions & 6 deletions app/scripts/controlled-term/class-list.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ define([
}, myMap);


// Marc 2023: Started to write correct IRI to schema which doesn't have the ontology name.
// Following can not be queried until schema is extended to store the ontology

// get any missing responses
myMap.forEach(function (value, key) {
if (myMap.get(key) == "") {
setResponse(key, DataManipulationService.parseOntologyName(key),
DataManipulationService.parseClassLabel(key));
}
}, myMap);
// myMap.forEach(function (value, key) {
// if (myMap.get(key) == "") {
// setResponse(key, DataManipulationService.parseOntologyName(key), key);
// }
// }, myMap);


// fill up the key array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,4 +649,4 @@ define([

}
}
);
);
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ define([
* Add ontology type to JSON.
*/
var properties = $rootScope.propertiesOf(vm.field);
var selfUrl = controlledTermService.getSelfUrl(selection);
//var selfUrl = selection['@id'];
// var selfUrl = controlledTermService.getSelfUrl(selection);
var selfUrl = selection['@id'];
if (angular.isArray(properties['@type'].oneOf[0].enum)) {
properties['@type'].oneOf[0].enum.push(selfUrl);
properties['@type'].oneOf[1].items.enum.push(selfUrl);
Expand All @@ -197,7 +197,6 @@ define([

var id = DataManipulationService.getId(vm.field);
$rootScope.$broadcast('field:controlledTermAdded', ['', id, '', '']);

}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/service/data-manipulation.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -1889,7 +1889,7 @@ define([

// parse the ontology code from the selfUrl
service.parseOntologyName = function (itemData) {
var re = new RegExp('\/ontologies\/(.+)\/classes\/');
var re = new RegExp('\/ontology\/(.+)\/');
var m;
var result;
if ((m = re.exec(itemData)) !== null) {
Expand Down