Skip to content

Commit 416d8c8

Browse files
refactor: remove unncessary code
1 parent bea158b commit 416d8c8

File tree

4 files changed

+36
-377
lines changed

4 files changed

+36
-377
lines changed

apps/OpenSign/src/json/FormJson.js

Lines changed: 21 additions & 364 deletions
Original file line numberDiff line numberDiff line change
@@ -1,369 +1,26 @@
11
import { documentCls, templateCls } from "../constant/const";
2-
export const formJson = (id) => {
3-
let formData;
2+
export const formJson = {
43
//json form for signYourself
5-
if (id === "sHAnZphf69") {
6-
formData = {
7-
title: "Sign Yourself",
8-
redirectRoute: "signaturePdf",
9-
msgVar: "Document",
10-
Cls: documentCls
11-
};
12-
return formData;
13-
}
4+
sHAnZphf69: {
5+
title: "Sign Yourself",
6+
redirectRoute: "signaturePdf",
7+
msgVar: "Document",
8+
Cls: documentCls
9+
},
10+
1411
//json form for request signature
15-
else if (id === "8mZzFxbG1z") {
16-
formData = {
17-
title: "Request Signature",
18-
msgVar: "Document",
19-
redirectRoute: "placeHolderSign",
20-
Cls: documentCls,
21-
signers: true
22-
};
23-
return formData;
24-
} //json form for template
25-
else if (id === "template") {
26-
formData = {
27-
title: "New Template",
28-
redirectRoute: "template",
29-
msgVar: "Template",
30-
Cls: templateCls
31-
};
32-
return formData;
33-
}
34-
//json form for create new folder
35-
else if (id === "YjIB7W7Xs6") {
36-
formData = {
37-
jsonSchema: {
38-
title: "New Folder",
39-
description: "",
40-
type: "object",
41-
required: ["Name"],
42-
properties: {
43-
Name: {
44-
type: "string",
45-
title: "Name",
46-
maxLength: 50
47-
},
48-
Type: {
49-
type: "string",
50-
data: {
51-
valueKey: "Type",
52-
isPointer: false
53-
},
54-
default: "Folder"
55-
},
56-
Folder: {
57-
title: "Parent Folder",
58-
data: {
59-
class: "contracts_Document",
60-
displayKey: "Name",
61-
valueKey: "objectId",
62-
query: 'where={"Type":"Folder"}&keys=Name',
63-
isPointer: true,
64-
savePointerClass: "",
65-
helpbody: "",
66-
helplink: ""
67-
}
68-
}
69-
}
70-
},
71-
uiSchema: {
72-
Type: {
73-
"ui:field": "HiddenField"
74-
},
75-
Folder: {
76-
"ui:field": "Level1Dropdown"
77-
}
78-
},
79-
userSchema: {},
80-
rules: null,
81-
noValidate: false,
82-
liveValidate: false,
83-
isRegisterForm: false,
84-
help: { htmlbody: "" },
85-
description: "",
86-
class: "contracts_Document",
87-
buttons: {
88-
add: {
89-
resetText: "Reset",
90-
submitText: "Submit"
91-
},
92-
edit: { submitText: "Update", cancelText: "Cancel" }
93-
},
94-
formACL: {
95-
"#currentUser#": { read: true, write: true },
96-
"*": { read: true, write: true }
97-
},
98-
redirect_id: "",
99-
success_message: "Success!",
100-
success_redirect: "",
101-
validFunction:
102-
"ZnVuY3Rpb24gdmFsaWRhdGUoZm9ybURhdGEsIGVycm9ycykgeyBpZiAoZm9ybURhdGEucGFzczEgIT09IGZvcm1EYXRhLnBhc3MyKSB7IGVycm9ycy5wYXNzMi5hZGRFcnJvcignUGFzc3dvcmRzIGRvbid0IG1hdGNoJyk7IH0gcmV0dXJuIGVycm9yczsgfQ=="
103-
};
104-
return formData;
105-
}
106-
//json form for add signers
107-
else if (id === "fICciRuUcB") {
108-
formData = {
109-
jsonSchema: {
110-
title: "Add Signer",
111-
description: "",
112-
type: "object",
113-
required: ["Name", "Email", "Phone", "Company"],
114-
properties: {
115-
Name: {
116-
type: "string",
117-
title: "Name",
118-
maxLength: 50
119-
},
120-
Email: {
121-
type: "string",
122-
title: "Email",
123-
maxLength: 50
124-
},
125-
Phone: {
126-
type: "string",
127-
title: "Phone",
128-
maxLength: 50
129-
},
130-
Company: {
131-
type: "string",
132-
title: "Company",
133-
maxLength: 50
134-
},
135-
JobTitle: {
136-
type: "string",
137-
title: "JobTitle",
138-
maxLength: 50
139-
},
140-
IsContactEntry: {
141-
type: "boolean",
142-
data: {
143-
valueKey: "IsContactEntry",
144-
isPointer: false
145-
},
146-
default: true
147-
}
148-
}
149-
},
150-
uiSchema: {
151-
Email: {
152-
"ui:widget": "email"
153-
},
154-
IsContactEntry: {
155-
"ui:field": "HiddenField"
156-
}
157-
},
158-
userSchema: {
159-
email: "$Email",
160-
name: "$Name",
161-
password: "$Phone",
162-
phone: "$Phone",
163-
role: "contracts_User",
164-
username: "$Email"
165-
},
166-
rules: null,
167-
noValidate: false,
168-
liveValidate: false,
169-
isRegisterForm: true,
170-
help: {},
171-
description: "",
172-
class: "contracts_Users",
173-
buttons: {
174-
add: {
175-
resetText: "Reset",
176-
submitText: "Submit"
177-
},
178-
edit: { submitText: "Update", cancelText: "Cancel" }
179-
},
180-
formACL: {
181-
"#currentUser#": { read: true, write: true },
182-
"*": { read: true, write: true }
183-
},
184-
redirect_id: "",
185-
success_message: "Success!",
186-
success_redirect: "",
187-
validFunction:
188-
"ZnVuY3Rpb24gdmFsaWRhdGUoZm9ybURhdGEsIGVycm9ycykgeyBpZiAoZm9ybURhdGEucGFzczEgIT09IGZvcm1EYXRhLnBhc3MyKSB7IGVycm9ycy5wYXNzMi5hZGRFcnJvcignUGFzc3dvcmRzIGRvbid0IG1hdGNoJyk7IH0gcmV0dXJuIGVycm9yczsgfQ=="
189-
};
190-
return formData;
191-
}
192-
//json form for add users
193-
else if (id === "lM0xRnM3iE") {
194-
formData = {
195-
jsonSchema: {
196-
title: "Add User",
197-
description: "",
198-
type: "object",
199-
required: ["Name", "Email", "Phone", "JobTitle"],
200-
properties: {
201-
Name: {
202-
type: "string",
203-
title: "Name",
204-
maxLength: 50
205-
},
206-
Email: {
207-
type: "string",
208-
title: "Email",
209-
maxLength: 50
210-
},
211-
Phone: {
212-
type: "string",
213-
title: "Phone",
214-
maxLength: 50
215-
},
216-
JobTitle: {
217-
type: "string",
218-
title: "Job Title",
219-
maxLength: 50
220-
},
221-
Company: {
222-
type: "string",
223-
title: "Company",
224-
maxLength: 50
225-
}
226-
}
227-
},
228-
uiSchema: {
229-
Email: {
230-
"ui:widget": "email"
231-
},
232-
Phone: {
233-
"ui:options": {
234-
inputType: "tel"
235-
}
236-
}
237-
},
238-
userSchema: {
239-
email: "$Email",
240-
name: "$Name",
241-
password: "$Phone",
242-
phone: "$Phone",
243-
role: "contracts_User",
244-
username: "$Email"
245-
},
246-
rules: null,
247-
noValidate: false,
248-
liveValidate: false,
249-
isRegisterForm: true,
250-
help: {},
251-
description: "",
252-
class: "contracts_Users",
253-
buttons: {
254-
add: {
255-
resetText: "Reset",
256-
submitText: "Submit"
257-
},
258-
edit: { submitText: "Update", cancelText: "Cancel" }
259-
},
260-
formACL: {
261-
"#currentUser#": { read: true, write: true },
262-
"*": { read: true, write: true }
263-
},
264-
redirect_id: "",
265-
success_message: "Success!",
266-
success_redirect: "",
267-
validFunction:
268-
"ZnVuY3Rpb24gdmFsaWRhdGUoZm9ybURhdGEsIGVycm9ycykgeyBpZiAoZm9ybURhdGEucGFzczEgIT09IGZvcm1EYXRhLnBhc3MyKSB7IGVycm9ycy5wYXNzMi5hZGRFcnJvcignUGFzc3dvcmRzIGRvbid0IG1hdGNoJyk7IH0gcmV0dXJuIGVycm9yczsgfQ=="
269-
};
270-
return formData;
271-
} else if (id === "qUGywSWd8e") {
272-
formData = {
273-
jsonSchema: {
274-
title: "Add Contact",
275-
description: "",
276-
type: "object",
277-
required: ["Name", "Email", "Phone"],
278-
properties: {
279-
Name: {
280-
type: "string",
281-
title: "Name",
282-
maxLength: 50
283-
},
284-
Email: {
285-
type: "string",
286-
title: "Email",
287-
maxLength: 50
288-
},
289-
Phone: {
290-
type: "string",
291-
title: "Phone",
292-
maxLength: 50
293-
}
294-
}
295-
},
296-
uiSchema: {
297-
Email: {
298-
"ui:widget": "email"
299-
},
300-
Phone: {
301-
"ui:options": {
302-
inputType: "tel"
303-
}
304-
}
305-
},
306-
userSchema: {
307-
name: "$Name",
308-
username: "$Email",
309-
email: "$Email",
310-
password: "$Phone",
311-
phone: "$Phone",
312-
role: "contracts_Guest"
313-
},
314-
restrict_form_entry: {
315-
enable_captcha: false,
316-
allow_one_entry_per_ip_address: false,
317-
allow_one_entry_per_user: false,
318-
enable_geo_fence: false
319-
},
320-
restrict_form_access: {
321-
entryCount: ""
322-
},
323-
help: {},
324-
email_template: {
325-
from: "",
326-
to: "",
327-
subject: "",
328-
message: ""
329-
},
330-
buttons: {
331-
add: {
332-
submitText: "Submit",
333-
resetText: "Reset"
334-
},
335-
edit: {
336-
submitText: "Update",
337-
cancelText: "Cancel"
338-
}
339-
},
340-
appId: {
341-
__type: "Pointer",
342-
className: "w_appinfo",
343-
objectId: "aIPmIvMzGM"
344-
},
345-
formACL: {
346-
"*": {
347-
read: true,
348-
write: true
349-
},
350-
"#currentUser#": {
351-
read: true,
352-
write: true
353-
}
354-
},
355-
class: "contracts_Contactbook",
356-
description: "",
357-
success_message: "Success!",
358-
form_permission: "private",
359-
success_redirect: "",
360-
redirect_id: "",
361-
isRegisterForm: true,
362-
liveValidate: false,
363-
noValidate: false,
364-
validFunction:
365-
"ZnVuY3Rpb24gdmFsaWRhdGUoZm9ybURhdGEsIGVycm9ycykgeyBpZiAoZm9ybURhdGEucGFzczEgIT09IGZvcm1EYXRhLnBhc3MyKSB7IGVycm9ycy5wYXNzMi5hZGRFcnJvcignUGFzc3dvcmRzIGRvbid0IG1hdGNoJyk7IH0gcmV0dXJuIGVycm9yczsgfQ=="
366-
};
367-
return formData;
12+
"8mZzFxbG1z": {
13+
title: "Request Signature",
14+
msgVar: "Document",
15+
redirectRoute: "placeHolderSign",
16+
Cls: documentCls,
17+
signers: true
18+
},
19+
//json form for template
20+
template: {
21+
title: "New Template",
22+
redirectRoute: "template",
23+
msgVar: "Template",
24+
Cls: templateCls
36825
}
36926
};

0 commit comments

Comments
 (0)