Skip to content

Commit bc13bae

Browse files
committed
form UE fix
1 parent 5da785a commit bc13bae

File tree

5 files changed

+53
-20
lines changed

5 files changed

+53
-20
lines changed

.husky/pre-commit.mjs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ const run = (cmd) => new Promise((resolve, reject) => exec(
44
cmd,
55
(error, stdout, stderr) => {
66
if (error) reject(error);
7-
if (stderr) reject(new Error(stderr));
8-
resolve(stdout);
7+
else resolve(stdout);
98
},
109
));
1110

component-definition.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,17 +168,23 @@
168168
"model": "form",
169169
"plugins": {
170170
"da": {
171-
"name": "form",
172-
"rows": 2,
173-
"columns": 1,
171+
"unsafeHTML": "<div class=\"form\"><div><div><p><a href=\"\"></a></p></div></div><div><div><p><a href=\"\"></a></p></div></div></div>",
174172
"fields": [
175173
{
176-
"name": "source",
177-
"selector": "div:nth-child(1)>div>a[href]"
174+
"name": "url",
175+
"selector": "div:nth-child(1)>div>p>a[href]"
176+
},
177+
{
178+
"name": "urlText",
179+
"selector": "div:nth-child(1)>div>p>a"
178180
},
179181
{
180182
"name": "actionUrl",
181-
"selector": "div:nth-child(2)>div>a[href]"
183+
"selector": "div:nth-child(2)>div>p>a[href]"
184+
},
185+
{
186+
"name": "actionUrlText",
187+
"selector": "div:nth-child(2)>div>p>a"
182188
}
183189
]
184190
}

component-models.json

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,28 @@
257257
"id": "form",
258258
"fields": [
259259
{
260-
"component": "reference",
261-
"name": "source",
260+
"component": "text",
261+
"name": "urlText",
262+
"label": "Form Source URL Text",
263+
"valueType": "string",
264+
"required": true,
265+
"description": "Text to display for the Form Source URL"
266+
},
267+
{
268+
"component": "text",
269+
"name": "url",
262270
"label": "Form Source URL",
263271
"valueType": "string",
264-
"multi": false,
265272
"required": true,
266273
"description": "URL to the JSON form definition"
267274
},
275+
{
276+
"component": "text",
277+
"name": "actionUrlText",
278+
"label": "Submit Endpoint Text",
279+
"valueType": "string",
280+
"description": "Text to display for the Submit Endpoint"
281+
},
268282
{
269283
"component": "text",
270284
"name": "actionUrl",

ue/models/blocks/form.json

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
"model": "form",
77
"plugins": {
88
"da": {
9-
"name": "form",
10-
"rows": 2,
11-
"columns": 1,
9+
"unsafeHTML": "<div class=\"form\"><div><div><p><a href=\"\"></a></p></div></div><div><div><p><a href=\"\"></a></p></div></div></div>",
1210
"fields": [
13-
{ "name": "source", "selector": "div:nth-child(1)>div>a[href]" },
14-
{ "name": "actionUrl", "selector": "div:nth-child(2)>div>a[href]" }
11+
{ "name": "url", "selector": "div:nth-child(1)>div>p>a[href]"},
12+
{ "name": "urlText", "selector": "div:nth-child(1)>div>p>a"},
13+
{ "name": "actionUrl", "selector": "div:nth-child(2)>div>p>a[href]"},
14+
{ "name": "actionUrlText", "selector": "div:nth-child(2)>div>p>a"}
1515
]
1616
}
1717
}
@@ -22,14 +22,28 @@
2222
"id": "form",
2323
"fields": [
2424
{
25-
"component": "reference",
26-
"name": "source",
25+
"component": "text",
26+
"name": "urlText",
27+
"label": "Form Source URL Text",
28+
"valueType": "string",
29+
"required": true,
30+
"description": "Text to display for the Form Source URL"
31+
},
32+
{
33+
"component": "text",
34+
"name": "url",
2735
"label": "Form Source URL",
2836
"valueType": "string",
29-
"multi": false,
3037
"required": true,
3138
"description": "URL to the JSON form definition"
3239
},
40+
{
41+
"component": "text",
42+
"name": "actionUrlText",
43+
"label": "Submit Endpoint Text",
44+
"valueType": "string",
45+
"description": "Text to display for the Submit Endpoint"
46+
},
3347
{
3448
"component": "text",
3549
"name": "actionUrl",

ue/scripts/ue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,4 +116,4 @@ const setupUEEventHandlers = () => {
116116
export default () => {
117117
setupObservers();
118118
setupUEEventHandlers();
119-
};
119+
};

0 commit comments

Comments
 (0)