@ts4nfdi/terminology-service-suite 5.0.0 → 5.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +24 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/api/OlsApi.d.ts +2 -2
- package/dist/esm/types/app/types.d.ts +3 -2
- package/dist/esm/types/components/widgets/MetadataWidget/TitleWidget/TitleWidgetStories.d.ts +1 -1
- package/dist/esm/types/components/widgets/TermDepictionWidget/TermDepictionWidget.stories.d.ts +1 -1
- package/dist/esm/types/components/widgets/TermDepictionWidget/TermDepictionWidgetHTML.stories.d.ts +1 -1
- package/dist/esm/types/model/ModelTypeCheck.d.ts +6 -6
- package/dist/esm/types/model/ols3-model/OLS3Thing.d.ts +1 -1
- package/dist/esm/types/model/ols4-model/OLS4Thing.d.ts +1 -1
- package/package.json +20 -21
- package/dist/esm/types/api/hierarchy_widget_deprecated.d.ts +0 -25
- package/dist/esm/types/app/styleWrapper.d.ts +0 -5
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidget/HierarchyWidgetHTML.stories.d.ts +0 -43
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidget/HierarchyWidgetOLS.d.ts +0 -7
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidget/HierarchyWidgetOLS.stories.d.ts +0 -112
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidget/HierarchyWidgetOLSHTML.stories.d.ts +0 -110
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidget/HierarchyWidgetOLSStories.d.ts +0 -105
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetDeprecated/HierarchyWidgetDeprecated.d.ts +0 -9
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetDeprecated/HierarchyWidgetDeprecated.stories.d.ts +0 -58
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetDeprecated/HierarchyWidgetDeprecatedHTML.stories.d.ts +0 -60
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetDeprecated/HierarchyWidgetDeprecatedStories.d.ts +0 -56
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetDeprecated/index.d.ts +0 -1
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetSemLookP/HierarchyWidget.d.ts +0 -13
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetSemLookP/HierarchyWidget.stories.d.ts +0 -162
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetSemLookP/HierarchyWidgetSemLookP.d.ts +0 -13
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetSemLookP/HierarchyWidgetSemLookP.stories.d.ts +0 -53
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetSemLookP/HierarchyWidgetSemLookPStories.d.ts +0 -127
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetSemLookP/HierarchyWidgetStories.d.ts +0 -246
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetSemLookP/HierarchyWidgetsHTML.stories.d.ts +0 -160
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetSemLookP/HierarchyWidgetsSemLookPHTML.stories.d.ts +0 -55
- package/dist/esm/types/components/widgets/MetadataWidget/TabWidget/HierarchyWidgetSemLookP/index.d.ts +0 -1
- package/dist/esm/types/components/widgets/SearchResultsListWidget/MetadataCompactPresentation.d.ts +0 -4
- package/dist/esm/types/style/global-styles.d.ts +0 -4
- package/dist/esm/types/style/tss-style.d.ts +0 -1
- package/dist/esm/types/style/tssEuiStyles.d.ts +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -791,7 +791,8 @@ class OLS4Thing {
|
|
|
791
791
|
}
|
|
792
792
|
getDepictionUrl() {
|
|
793
793
|
let depictionUri = "http://xmlns.com/foaf/0.1/depiction";
|
|
794
|
-
if (this.properties[depictionUri] &&
|
|
794
|
+
if (this.properties[depictionUri] &&
|
|
795
|
+
typeof this.properties[depictionUri] === "string") {
|
|
795
796
|
return [this.properties["http://xmlns.com/foaf/0.1/depiction"]];
|
|
796
797
|
}
|
|
797
798
|
else if (this.properties[depictionUri]) {
|
|
@@ -1879,11 +1880,10 @@ class OlsApi {
|
|
|
1879
1880
|
* 2) If a termIri is defined but no child in jsTreeParams, the hierarchy containing that term will be queried
|
|
1880
1881
|
* 3) If a termIri is defined and also a child in jsTreeParams, the subhierarchy of that child will be queried
|
|
1881
1882
|
*/
|
|
1882
|
-
getTermTree = async (contentParams, treeParams
|
|
1883
|
+
getTermTree = async (contentParams, treeParams) => {
|
|
1883
1884
|
let baseRequest = "ontologies/" + contentParams?.ontologyId + "/terms";
|
|
1884
1885
|
if (!contentParams.termIri)
|
|
1885
1886
|
return (await this.axiosInstance.get(baseRequest + "/roots")).data; //1)
|
|
1886
|
-
// @ts-ignore
|
|
1887
1887
|
baseRequest =
|
|
1888
1888
|
baseRequest +
|
|
1889
1889
|
"/" +
|
|
@@ -1896,11 +1896,10 @@ class OlsApi {
|
|
|
1896
1896
|
return (await this.axiosInstance.get(baseRequest, { params: treeParams }))
|
|
1897
1897
|
.data; //2)
|
|
1898
1898
|
};
|
|
1899
|
-
getTermRelations = async (contentParams
|
|
1899
|
+
getTermRelations = async (contentParams) => {
|
|
1900
1900
|
let baseRequest = "ontologies/" + contentParams?.ontologyId + "/terms";
|
|
1901
1901
|
if (!contentParams.termIri)
|
|
1902
1902
|
return (await this.axiosInstance.get(baseRequest + "/roots")).data; //1)
|
|
1903
|
-
// @ts-ignore
|
|
1904
1903
|
baseRequest =
|
|
1905
1904
|
baseRequest +
|
|
1906
1905
|
"/" +
|
|
@@ -2056,7 +2055,7 @@ class OlsApi {
|
|
|
2056
2055
|
}, useLegacy);
|
|
2057
2056
|
}
|
|
2058
2057
|
if (useLegacy) {
|
|
2059
|
-
|
|
2058
|
+
const listOfAncestorObj = [];
|
|
2060
2059
|
let extractKey = "";
|
|
2061
2060
|
switch (entityType) {
|
|
2062
2061
|
case "class":
|
|
@@ -2509,7 +2508,7 @@ function AutocompleteWidget(props) {
|
|
|
2509
2508
|
// if we have a custom term, just show the label
|
|
2510
2509
|
return label;
|
|
2511
2510
|
}
|
|
2512
|
-
|
|
2511
|
+
const prefix = value.type === "ontology"
|
|
2513
2512
|
? "Prefix: " + value.ontology_name
|
|
2514
2513
|
: "Prefix > Short form: " +
|
|
2515
2514
|
value.ontology_name +
|
|
@@ -4006,10 +4005,9 @@ class SkosApi {
|
|
|
4006
4005
|
entitiesData.set(childNodeData.iri, childNodeData);
|
|
4007
4006
|
}
|
|
4008
4007
|
else {
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
childNodeData.parents.push(...Reified.fromJson(node.uri));
|
|
4008
|
+
if (!childNodeData?.parents?.map((r) => r.value).includes(node.uri))
|
|
4009
|
+
if (childNodeData?.parents) {
|
|
4010
|
+
childNodeData?.parents?.push(...Reified.fromJson(node.uri));
|
|
4013
4011
|
}
|
|
4014
4012
|
}
|
|
4015
4013
|
children.push(childNodeData);
|
|
@@ -4402,7 +4400,7 @@ function GraphViewWidget(props) {
|
|
|
4402
4400
|
], async () => {
|
|
4403
4401
|
if (rootWalkIsSelected && firstLoad) {
|
|
4404
4402
|
// only use this call on load. Double ckicking on a node should call the normal getTermRelations function.
|
|
4405
|
-
return olsApi.getTermTree({ ontologyId: ontologyId, termIri: iri }, { viewMode: "All", siblings: false }
|
|
4403
|
+
return olsApi.getTermTree({ ontologyId: ontologyId, termIri: iri }, { viewMode: "All", siblings: false });
|
|
4406
4404
|
}
|
|
4407
4405
|
else if (firstLoad || dbclicked) {
|
|
4408
4406
|
return olsApi.getTermRelations({
|
|
@@ -4572,8 +4570,9 @@ function GraphViewWidget(props) {
|
|
|
4572
4570
|
}
|
|
4573
4571
|
useEffect(() => {
|
|
4574
4572
|
let graphData = { nodes: nodes.current, edges: edges.current };
|
|
4573
|
+
graphNetwork.current = new Network(
|
|
4575
4574
|
//@ts-ignore
|
|
4576
|
-
|
|
4575
|
+
container.current, graphData, graphNetworkConfig);
|
|
4577
4576
|
}, []);
|
|
4578
4577
|
useEffect(() => {
|
|
4579
4578
|
if (graphNetwork.current) {
|
|
@@ -4637,7 +4636,11 @@ function TermDepictionWidget(props) {
|
|
|
4637
4636
|
isLoading && React.createElement(EuiLoadingSpinner, { size: "s" }),
|
|
4638
4637
|
isSuccess && data && data.getDepictionUrl().length !== 0 && (React.createElement(React.Fragment, null, data.getDepictionUrl().map((url) => {
|
|
4639
4638
|
if (url.includes(".glb")) {
|
|
4640
|
-
return (React.createElement("model-viewer", { style: {
|
|
4639
|
+
return (React.createElement("model-viewer", { style: {
|
|
4640
|
+
width: "300px",
|
|
4641
|
+
height: "300px",
|
|
4642
|
+
display: "inline-block",
|
|
4643
|
+
}, src: url, "shadow-intensity": "1", "camera-controls": true, "touch-action": "pan-y" }));
|
|
4641
4644
|
}
|
|
4642
4645
|
return (React.createElement(React.Fragment, null,
|
|
4643
4646
|
React.createElement(EuiImage, { size: "m", hasShadow: true, allowFullScreen: true, alt: url, src: url }),
|
|
@@ -4850,7 +4853,7 @@ function TitleWidget(props) {
|
|
|
4850
4853
|
const { data, isLoading, isSuccess, isError, error } = useQuery(["titleData", api, parameter, thingType, iri, ontologyId, useLegacy], async () => {
|
|
4851
4854
|
return olsApi.getThingObject(iri, thingType, ontologyId, parameter, useLegacy);
|
|
4852
4855
|
});
|
|
4853
|
-
return (React.createElement(TitlePresentation, { title: data ? (isOntology(data) ? data.getName() : data.getLabel()) : null, titleText: titleText, defaultValue: defaultValue, className: className, isLoading: isLoading, error: isError ? error : null, iri: iri ? iri : data ? data.getIri() : null, onNavigateTo: onNavigateTo, ontologyId: ontologyId ? ontologyId : data ? data.getOntologyId() :
|
|
4856
|
+
return (React.createElement(TitlePresentation, { title: data ? (isOntology(data) ? data.getName() : data.getLabel()) : null, titleText: titleText, defaultValue: defaultValue, className: className, isLoading: isLoading, error: isError ? error : null, iri: iri ? iri : data ? data.getIri() : null, onNavigateTo: onNavigateTo, ontologyId: ontologyId ? ontologyId : data ? data.getOntologyId() : undefined, thingType: thingType ? thingType : data ? data.getType() : undefined, href: href }));
|
|
4854
4857
|
}
|
|
4855
4858
|
function createTitle(props, container, callback) {
|
|
4856
4859
|
ReactDOM.render(WrappedTitleWidget(props), container, callback);
|
|
@@ -5195,7 +5198,9 @@ function ResourcesWidget(props) {
|
|
|
5195
5198
|
let homepage = null;
|
|
5196
5199
|
let licenseUrl = "";
|
|
5197
5200
|
let licenseLabel = "";
|
|
5198
|
-
|
|
5201
|
+
if (resource.config.homepage) {
|
|
5202
|
+
homepage = resource.config.homepage;
|
|
5203
|
+
}
|
|
5199
5204
|
if (resource?.config?.annotations?.license) {
|
|
5200
5205
|
const license = resource.config.annotations.license;
|
|
5201
5206
|
if (useLegacy) {
|
|
@@ -5260,7 +5265,7 @@ function ResourcesWidget(props) {
|
|
|
5260
5265
|
React.createElement("strong", null, "Ontologies")),
|
|
5261
5266
|
React.createElement(EuiSpacer, { size: "s" }),
|
|
5262
5267
|
React.createElement(EuiHorizontalRule, { margin: "none", style: { height: 2 } }),
|
|
5263
|
-
React.createElement(EuiBasicTable, { columns: columnsWithExpandingRowToggle, items: pageOfItems, onChange: onTableChange, pagination: pagination, sorting: sorting, itemIdToExpandedRowMap: itemIdToExpandedRowMap,
|
|
5268
|
+
React.createElement(EuiBasicTable, { columns: columnsWithExpandingRowToggle, items: pageOfItems, onChange: onTableChange, pagination: pagination, sorting: sorting, itemIdToExpandedRowMap: itemIdToExpandedRowMap, itemId: "ontologyId", ...rest }))),
|
|
5264
5269
|
isLoading && (React.createElement(EuiBasicTable, { columns: columnsWithExpandingRowToggle, items: pageOfItems, onChange: onTableChange, pagination: pagination, sorting: sorting, loading: true, ...rest })),
|
|
5265
5270
|
isError && (React.createElement(EuiBasicTable, { columns: columns, items: pageOfItems, onChange: onTableChange, pagination: pagination, sorting: sorting, ...rest }))));
|
|
5266
5271
|
}
|
|
@@ -5335,7 +5340,7 @@ function SearchBarWidget(props) {
|
|
|
5335
5340
|
}));
|
|
5336
5341
|
}, [selectedOptions]);
|
|
5337
5342
|
return (React.createElement(React.Fragment, null,
|
|
5338
|
-
React.createElement(EuiComboBox, { id: "suggest", isClearable: true, "aria-label": "searchBar", fullWidth: true, async: true, placeholder: "Search",
|
|
5343
|
+
React.createElement(EuiComboBox, { id: "suggest", isClearable: true, "aria-label": "searchBar", fullWidth: true, async: true, placeholder: "Search", singleSelection: true, isLoading: isLoading, options: options, selectedOptions: selectedOptions, onChange: onChange, onCreateOption: onCreateOption, onSearchChange: (item) => {
|
|
5339
5344
|
setSearchValue(item);
|
|
5340
5345
|
} })));
|
|
5341
5346
|
}
|
|
@@ -5586,8 +5591,7 @@ function SearchResultsListWidget(props) {
|
|
|
5586
5591
|
});
|
|
5587
5592
|
}, {
|
|
5588
5593
|
keepPreviousData: true,
|
|
5589
|
-
}
|
|
5590
|
-
);
|
|
5594
|
+
});
|
|
5591
5595
|
function onChangeItemsPerPage(newItemsPerPage) {
|
|
5592
5596
|
setActivePage(Math.floor((activePage * itemsPerPage + 1) / newItemsPerPage));
|
|
5593
5597
|
setItemsPerPage(newItemsPerPage);
|