Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit ae8bf35

Browse files
gfauchartgautier fauchart
and
gautier fauchart
authored
Repeater tag for dynamic labelling (#209)
* repeater tag * fix import * add repeater default annotation * clean repeater tag * useMemo to prevent double renders * Delete Repeater tag, repeat in .treeToModel() * removed unsed text in config.xml * add repeater tag * trigger CI * typo recursive * use lodasg.get instead of jsonpath * fix unit test * delete .en * reset tsconfig.json to master version Co-authored-by: gautier fauchart <[email protected]>
1 parent 2a1f84b commit ae8bf35

File tree

12 files changed

+1888
-21135
lines changed

12 files changed

+1888
-21135
lines changed

examples/repeater/annotations/1.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"annotations": [
3+
{
4+
"id": "1001",
5+
"result": [
6+
{
7+
"value": {
8+
"choices": [
9+
"New Intent"
10+
]
11+
},
12+
"id": "tH8nXMb0T_",
13+
"from_name": "utterance_action_0",
14+
"to_name": "user_0",
15+
"type": "choices"
16+
},
17+
{
18+
"value": {
19+
"choices": [
20+
"Training"
21+
]
22+
},
23+
"id": "Ebt-uQHhwa",
24+
"from_name": "utterance_action_1",
25+
"to_name": "user_1",
26+
"type": "choices"
27+
}
28+
]
29+
}
30+
],
31+
"data": {
32+
},
33+
"id": 1,
34+
"task_path": "../examples/repeater/tasks.json"
35+
}

examples/repeater/config.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<View>
2+
<Repeater on="$utterances" indexFlag="{{idx}}">
3+
<View>
4+
<Text name="user_{{idx}}" value="$utterances[{{idx}}].text" />
5+
</View>
6+
<View>
7+
<header value="Utterance Review"></header>
8+
<Choices name="utterance_action_{{idx}}" showInline="true" toName="user_{{idx}}">
9+
<Choice value="No Action" selected="true" />
10+
<Choice value="Training" />
11+
<Choice value="New Intent" />
12+
</Choices>
13+
</View>
14+
</Repeater>
15+
</View>

examples/repeater/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import config from "./config.xml";
2+
import tasks from "./tasks.json";
3+
import annotation from "./annotations/1.json";
4+
5+
export const Repeater = { config, tasks, annotation };

examples/repeater/tasks.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"data": {
4+
"utterances": [
5+
{"text": "hello, when do i receive the product I ordered?"},
6+
{"text": "nevermind. I just receveid it"}
7+
]
8+
}
9+
}
10+
]

0 commit comments

Comments
 (0)