Skip to content

Commit b2c83d2

Browse files
authored
Merge pull request #102 from ulitol97/master
0.2.12
2 parents 1ce8e5c + dae2616 commit b2c83d2

6 files changed

Lines changed: 31 additions & 21 deletions

File tree

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
REACT_APP_RDFSHAPE_HOST=https://api.rdfshape.weso.es
22
REACT_APP_RDFSHAPE_WS_HOST=wss://api.rdfshape.weso.es
3-
REACT_APP_VERSION=0.2.11
3+
REACT_APP_VERSION=0.2.12

.env.development

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
REACT_APP_RDFSHAPE_HOST=http://localhost:8080
22
REACT_APP_RDFSHAPE_WS_HOST=ws://localhost:8080
3-
REACT_APP_VERSION=0.2.11
3+
REACT_APP_VERSION=0.2.12

package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rdfshape-client",
3-
"version": "0.2.11",
3+
"version": "0.2.12",
44
"private": true,
55
"dependencies": {
66
"3dshex": "^0.5.2",

src/results/ResultValidateStream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function ResultValidateStream({
3434
[API.queryParameters.streaming.date]:
3535
result[API.queryParameters.streaming.date],
3636
};
37-
// Stream will to halt on invalid: invalidating result, the report is contained in itself and there's no date
37+
// Stream will halt on invalid: invalidating result, the report is contained in itself and there's no date
3838
else
3939
return {
4040
...result,

src/shex/ShexValidate.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,18 @@ function ShexValidate(props) {
153153
const { type, content } = messageData;
154154
switch (type) {
155155
case API.queryParameters.streaming.responseTypes.result:
156-
// Result received, update result list with it if not errored
157-
if (content.status != errored) setResults([content, ...results]);
156+
// We got a result with an embedded error message, set error
157+
if (!Array.isArray(content?.report?.shapeMap)) {
158+
setStreamValidationError(
159+
content?.report?.message ||
160+
API.texts.streamingTexts.unknownError
161+
);
162+
// Stream was not stopped, so we disconnect ourselves
163+
stopStreamingValidation();
164+
}
165+
// Result received, update result list with it after checking that it is not errored (and thus omitted)
166+
else if (content.status != errored)
167+
setResults([content, ...results]);
158168
break;
159169
case API.queryParameters.streaming.responseTypes.error:
160170
// Stream was stopped, show/handle errors, set state...
@@ -531,7 +541,7 @@ function ShexValidate(props) {
531541
</Button>
532542
</Form>
533543
</Col>
534-
{loading || results || permalink || error ? (
544+
{loading || results.length || permalink || error ? (
535545
<Col className={"half-col"}>
536546
{loading ? (
537547
<ProgressBar

0 commit comments

Comments
 (0)