mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-09-12 04:37:39 +02:00
Merge pull request #1401 from OpenSignLabs/validation
fix: drattemplate ui changes, signers not visible in list, alert message
This commit is contained in:
@@ -127,9 +127,12 @@ export const updateMailCount = async (extUserId, plan, monthchange) => {
|
||||
};
|
||||
|
||||
export function formatWidgetOptions(type, options) {
|
||||
const colorsArr = ['red', 'black', 'blue', 'yellow'];
|
||||
const status = options?.required === true ? 'required' : 'optional' || 'required';
|
||||
const defaultValue = options?.default || '';
|
||||
const values = options?.values || [];
|
||||
const color = options?.color ? options.color : 'black';
|
||||
const fontColor = colorsArr.includes(color) ? color : 'black';
|
||||
switch (type) {
|
||||
case 'signature':
|
||||
return { name: 'signature', status: 'required' };
|
||||
@@ -140,13 +143,18 @@ export function formatWidgetOptions(type, options) {
|
||||
case 'image':
|
||||
return { status: status, name: options.name || 'image' };
|
||||
case 'email':
|
||||
return { status: status, name: options.name || 'email', validation: { type: 'email' } };
|
||||
return {
|
||||
status: status,
|
||||
name: options.name || 'email',
|
||||
validation: { type: 'email' },
|
||||
fontColor: fontColor,
|
||||
};
|
||||
case 'name':
|
||||
return { status: status, name: options.name || 'name' };
|
||||
return { status: status, name: options.name || 'name', fontColor: fontColor };
|
||||
case 'job title':
|
||||
return { status: status, name: options.name || 'job title' };
|
||||
return { status: status, name: options.name || 'job title', fontColor: fontColor };
|
||||
case 'company':
|
||||
return { status: status, name: options.name || 'company' };
|
||||
return { status: status, name: options.name || 'company', fontColor: fontColor };
|
||||
case 'date': {
|
||||
let today = new Date();
|
||||
let dd = String(today.getDate()).padStart(2, '0');
|
||||
@@ -160,6 +168,7 @@ export function formatWidgetOptions(type, options) {
|
||||
name: options.name || 'date',
|
||||
response: defaultValue || today,
|
||||
validation: { format: dateFormat || 'dd-MM-yyyy', type: 'date-format' },
|
||||
fontColor: fontColor,
|
||||
};
|
||||
}
|
||||
case 'textbox':
|
||||
@@ -169,6 +178,7 @@ export function formatWidgetOptions(type, options) {
|
||||
defaultValue: defaultValue,
|
||||
hint: options.hint,
|
||||
validation: { type: 'regex', pattern: options?.regularexpression || '/^[a-zA-Z0-9s]+$/' },
|
||||
fontColor: fontColor,
|
||||
};
|
||||
case 'checkbox': {
|
||||
const arr = options?.values;
|
||||
@@ -188,6 +198,7 @@ export function formatWidgetOptions(type, options) {
|
||||
maxRequiredCount: options?.validation?.maxselections || 0,
|
||||
},
|
||||
defaultValue: selectedvalues || [],
|
||||
fontColor: fontColor,
|
||||
};
|
||||
}
|
||||
case 'radio button': {
|
||||
@@ -198,6 +209,7 @@ export function formatWidgetOptions(type, options) {
|
||||
isReadOnly: options?.readonly || false,
|
||||
isHideLabel: options?.hidelabel || false,
|
||||
defaultValue: defaultValue,
|
||||
fontColor: fontColor,
|
||||
};
|
||||
}
|
||||
case 'dropdown':
|
||||
@@ -206,6 +218,7 @@ export function formatWidgetOptions(type, options) {
|
||||
name: options.name || 'dropdown',
|
||||
values: values,
|
||||
defaultValue: defaultValue,
|
||||
fontColor: fontColor,
|
||||
};
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -13,14 +13,13 @@ export default async function getSigners(request) {
|
||||
className: '_User',
|
||||
objectId: request?.user?.id,
|
||||
});
|
||||
|
||||
if (search) {
|
||||
contactbook.matches('Name', new RegExp(search, 'i'));
|
||||
} else if (searchEmail) {
|
||||
contactbook.matches('Email', new RegExp(searchEmail, 'i'));
|
||||
}
|
||||
contactbook.notEqualTo('IsDeleted', true);
|
||||
const contactRes = await contactbook.find();
|
||||
const contactRes = await contactbook.find({ sessionToken: request.user.getSessionToken() });
|
||||
const _contactRes = JSON.parse(JSON.stringify(contactRes));
|
||||
return _contactRes;
|
||||
} else if (jwttoken) {
|
||||
|
||||
Reference in New Issue
Block a user