openModal
This function places a request to open a modal over the current hosting page
Syntax
import messageHandler from '@vcita/intandem-app-com';
// ...initialize the handler
messageHandler.openModal(MODAL_NAME, PAYLOAD?).then(result => {
console.log('The modal result was', result);
});Parameters
modalName(String): The name of the modal- *init object_8 (Object)_ : An object with params required to initialize the modal
Available modals
App Market
messageHandler.openModal('AppMarket')App market - specific app deeplink
messageHandler.openModal('AppMarket', [{appCodeName:"<APP_CODE_NAME>"}])Calendar Sync Dialog
const user = await messageHandler.getUser();
messageHandler.openModal('calendar-sync-dialog', [{staffUid: user.data.staffUid}])Import Clients
const user = await messageHandler.getUser();
messageHandler.openModal('ImportContacts', [{staffUid: user.data.staffUid}])Online Scheduling Wizard
const user = await messageHandler.getUser();
messageHandler.openModal('OnlineScheduling', [{staffUid: user.data.staffUid}])Client Picker
messageHandler.openModal('ClientPicker');New Appointment
messageHandler.openModal('NewAppointment');To pre-fill the dialog, pass an object to set fields by name. This form requires
client:
messageHandler.openModal('NewAppointment', {
client, // required for the object form
conversation_uid, // the matter the appointment belongs to
presetTimes, // { startTime, endTime }
staffUid,
notes,
service_uid,
});When you have a matter but no client object, pass an array instead and set the fields
positionally — [client, conversation_uid, presetTimes, staffUid, notes, service_uid]:
messageHandler.openModal('NewAppointment', [null, '<MATTER_UID>', null, null, null, '<SERVICE_UID>']);New Estimate
messageHandler.openModal('NewEstimate');As with New Appointment, the object form requires client:
messageHandler.openModal('NewEstimate', {
client, // required for the object form
conversation_id, // the matter the estimate belongs to
payment,
item,
service_name,
copy_uid,
});The array form sets the same fields positionally —
[client, conversation_id, payment, item, service_name, copy_uid]:
messageHandler.openModal('NewEstimate', [null, '<MATTER_UID>']);When no client is given the client picker opens first; the estimate is still attached to
the matter you passed.
Payment Wizard
messageHandler.openModal('PaymentWizard', { navigateTo: '<PATH>', source: 'campaign' });Both params are optional; source defaults to campaign.
Import Products
messageHandler.openModal('import-products-modal');Iframe
If title is not provided then the url will be the title of the modal
messageHandler.openModal('IframeModal', { url: 'https://some.web.site', title: 'Modal Title' });Updated 3 days ago
