mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-20 06:35:54 +02:00
v2.12.0
feat: create duplicate template functionality feat: add support of csv and xlsx for bulk contacts import feat: add info text for forms and dashboard button feat: implement functionality to delete a PDF page while editing the document feat: show completed documents in which signers included but not owner in completed reports feat: add delete folder button in opensign drive feat: introduce Bcc email support for sending completed documents feat: allow merging multiple pdf while drafting document and template feat: add 'My Initials' tab for auto-signing in request-sign flow feat: add support for redirect URL to navigate after document completion feat: introduce privacy policy and digital signature terms before signing documents. feat: add feature to allow adding new pages to existing document feat: add save signature, initials, stamp functionality in sign pad for logged in user feat: add preferences menu feat: add save custom email template, notifyonsignature, set timezone, allow signature types in preferences feat: secure local url feat: implement Italian language translation feat: implement German language translation feat: update menu name from report to documents and shift contactbook in main menu feat: provide edit contact functionality fix: unable to delete folder when all its documents are deleted fix: fields.push is not function fix: document loading issue in opensign drive fix: adjust the guest signature flow to display the document in full screen, eliminating any blank space which is displayed below the place holder in mobile view fix: resolve issue of instance of pdfdict or pdfstream but got undefined build(deps): update dependencies refactor: change note text from add contact form
This commit is contained in:
@@ -5,51 +5,55 @@ const APPID = process.env.APP_ID;
|
||||
const masterKEY = process.env.MASTER_KEY;
|
||||
async function addTeamAndOrg(extUser) {
|
||||
try {
|
||||
const orgCls = new Parse.Object('contracts_Organizations');
|
||||
orgCls.set('Name', extUser.Company);
|
||||
orgCls.set('IsActive', true);
|
||||
orgCls.set('ExtUserId', {
|
||||
__type: 'Pointer',
|
||||
className: 'contracts_Users',
|
||||
objectId: extUser?.objectId,
|
||||
});
|
||||
orgCls.set('CreatedBy', {
|
||||
__type: 'Pointer',
|
||||
className: '_User',
|
||||
objectId: extUser?.UserId?.objectId,
|
||||
});
|
||||
orgCls.set('TenantId', {
|
||||
__type: 'Pointer',
|
||||
className: 'partners_Tenant',
|
||||
objectId: extUser?.TenantId?.objectId,
|
||||
});
|
||||
|
||||
const orgRes = await orgCls.save(null, { useMasterKey: true });
|
||||
const teamCls = new Parse.Object('contracts_Teams');
|
||||
teamCls.set('Name', 'All Users');
|
||||
teamCls.set('OrganizationId', {
|
||||
__type: 'Pointer',
|
||||
className: 'contracts_Organizations',
|
||||
objectId: orgRes.id,
|
||||
});
|
||||
teamCls.set('IsActive', true);
|
||||
const teamRes = await teamCls.save(null, { useMasterKey: true });
|
||||
const updateUser = new Parse.Object('contracts_Users');
|
||||
updateUser.id = extUser.objectId;
|
||||
updateUser.set('UserRole', 'contracts_Admin');
|
||||
updateUser.set('OrganizationId', {
|
||||
__type: 'Pointer',
|
||||
className: 'contracts_Organizations',
|
||||
objectId: orgRes.id,
|
||||
});
|
||||
updateUser.set('TeamIds', [
|
||||
{
|
||||
const extUserCls = new Parse.Query('contracts_Users');
|
||||
const updateUser = await extUserCls.get(extUser.objectId, { useMasterKey: true });
|
||||
if (updateUser && !updateUser?.get('OrganizationId')) {
|
||||
const orgCls = new Parse.Object('contracts_Organizations');
|
||||
orgCls.set('Name', extUser.Company);
|
||||
orgCls.set('IsActive', true);
|
||||
orgCls.set('ExtUserId', {
|
||||
__type: 'Pointer',
|
||||
className: 'contracts_Teams',
|
||||
objectId: teamRes.id,
|
||||
},
|
||||
]);
|
||||
const extUserRes = await updateUser.save(null, { useMasterKey: true });
|
||||
className: 'contracts_Users',
|
||||
objectId: extUser?.objectId,
|
||||
});
|
||||
orgCls.set('CreatedBy', {
|
||||
__type: 'Pointer',
|
||||
className: '_User',
|
||||
objectId: extUser?.UserId?.objectId,
|
||||
});
|
||||
orgCls.set('TenantId', {
|
||||
__type: 'Pointer',
|
||||
className: 'partners_Tenant',
|
||||
objectId: extUser?.TenantId?.objectId,
|
||||
});
|
||||
|
||||
const orgRes = await orgCls.save(null, { useMasterKey: true });
|
||||
const teamCls = new Parse.Object('contracts_Teams');
|
||||
teamCls.set('Name', 'All Users');
|
||||
teamCls.set('OrganizationId', {
|
||||
__type: 'Pointer',
|
||||
className: 'contracts_Organizations',
|
||||
objectId: orgRes.id,
|
||||
});
|
||||
teamCls.set('IsActive', true);
|
||||
const teamRes = await teamCls.save(null, { useMasterKey: true });
|
||||
// const updateUser = new Parse.Object('contracts_Users');
|
||||
// updateUser.id = extUser.objectId;
|
||||
updateUser.set('UserRole', 'contracts_Admin');
|
||||
updateUser.set('OrganizationId', {
|
||||
__type: 'Pointer',
|
||||
className: 'contracts_Organizations',
|
||||
objectId: orgRes.id,
|
||||
});
|
||||
updateUser.set('TeamIds', [
|
||||
{
|
||||
__type: 'Pointer',
|
||||
className: 'contracts_Teams',
|
||||
objectId: teamRes.id,
|
||||
},
|
||||
]);
|
||||
const extUserRes = await updateUser.save(null, { useMasterKey: true });
|
||||
}
|
||||
} catch (err) {
|
||||
console.log('err in add team, role, org', err);
|
||||
}
|
||||
@@ -94,7 +98,6 @@ async function saveUser(userDetails) {
|
||||
}
|
||||
export default async function AddAdmin(request) {
|
||||
const userDetails = request.params.userDetails;
|
||||
// const subscription = request.params.subscription;
|
||||
const user = await saveUser(userDetails);
|
||||
|
||||
try {
|
||||
@@ -167,8 +170,10 @@ export default async function AddAdmin(request) {
|
||||
if (userDetails && userDetails.jobTitle) {
|
||||
newObj.set('JobTitle', userDetails.jobTitle);
|
||||
}
|
||||
if (userDetails?.timezone) {
|
||||
newObj.set('Timezone', userDetails?.timezone);
|
||||
}
|
||||
const extRes = await newObj.save(null, { useMasterKey: true });
|
||||
// if (subscription) {
|
||||
const extUser = {
|
||||
objectId: extRes.id,
|
||||
Name: userDetails.name,
|
||||
@@ -181,8 +186,6 @@ export default async function AddAdmin(request) {
|
||||
JobTitle: userDetails.jobTitle,
|
||||
};
|
||||
await addTeamAndOrg(extUser);
|
||||
// await saveSubscription(extRes.id, user.id, tenantRes.id, subscription);
|
||||
// }
|
||||
return { message: 'User sign up', sessionToken: user.sessionToken };
|
||||
}
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user