Skip to content

Commit

Permalink
fix: LEAP-580: Display non-string values in Text (#5326)
Browse files Browse the repository at this point in the history
* [submodules] Copy src HumanSignal/label-studio-frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7615343784

* ci: Build frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7615364630

* [submodules] Copy src HumanSignal/label-studio-frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7619698450

* ci: Build frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7619716795

* [submodules] Copy src HumanSignal/label-studio-frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7625862773

* ci: Build frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7625886659

* [submodules] Copy src HumanSignal/label-studio-frontend

Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/7628113831

---------

Co-authored-by: hlomzik <[email protected]>
Co-authored-by: robot-ci-heartex <[email protected]>
Co-authored-by: hlomzik <[email protected]>
  • Loading branch information
4 people authored Jan 23, 2024
1 parent f1a63be commit 9a618a4
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion web/dist/apps/labelstudio/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/apps/labelstudio/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/datamanager/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/datamanager/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/editor/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/editor/main.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/libs/editor/src/tags/object/RichText/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const Model = types
// nodes count better be the same, so replace them with stubs
// we should not sanitize text tasks because we already have htmlEscape in view.js
if (isFF(FF_SAFE_TEXT) && self.type === 'text') {
self._value = val;
self._value = String(val);
} else {
self._value = sanitizeHtml(String(val));
}
Expand Down
4 changes: 2 additions & 2 deletions web/libs/editor/src/utils/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ export const parseValue = (value, task) => {

// value can refer to structures, not only texts, so just replace wouldn't be enough
if (value.match(reVar)?.[0] === value) {
return get(task, value.substr(1)) ?? '';
return get(task, value.slice(1)) ?? '';
}

return value.replace(reVar, (v) => get(task, v.substr(1) ?? ''));
return value.replace(reVar, (v) => get(task, v.slice(1) ?? ''));
};

/**
Expand Down

0 comments on commit 9a618a4

Please sign in to comment.