Skip to main content
Version: 13.x (Current)

ck-availability-modal

The ck-availability-modal web component is a modal specialized in adding/modify availabilities for the two kind of availability in flexible or normal availability.

ck-availability-modal

Usage

The web component consists of a form inside a modal with dynamically generated fields based on a Availability.

The web-component also listens to the add-new event. Upon receiving a add-new event, the ck-availability-modal opens to create new availability Submitting the form will trigger the post of the availabilities.

The web-component also listens to the selected-data event. Upon receiving a select-data event, the ck-availability-modal opens in edit mode. For the modal to open correctly, the payload of the event must contain a valid _id of the availability that has to be edited. If the modal was opened in edit mode, the submitting of the form will trigger the patch of the selected appointment.

In order to open the ck-availability-modal in a Microfrontend Composer, a configuration is needed to configure a button to emit the custom event availability-modal. An example configuration follows:

{
"$ref": {},
"content": {
"attributes": {
"style": "height: calc(100vh - 64px);"
},
"type": "row",
"content": [
{
"type": "element",
"tag": "bk-button",
"properties": {
"type": "default",
"iconId": "PlusOutlined",
"content": {
"it": "Aggiungi piano",
"en": "Add plan"
},
"clickConfig": {
"type": "event",
"actionConfig": {
"label": "availability-modal",
"payload": {
slot:{}
}
}
}
}
},

{
"type": "element",
"tag": "ck-availability-modal",
"properties": {
"availabilityBasePath": "/v2/appointment-manager/appointments/",
"dataSchema": {
"type": "object",
"properties": {
"address": {
"type": "string",
"label": "Site"
},
"performance": {
"type": "string",
"format": "lookup",
"label": {
"it": "Prestazione",
"en": "Performance"
},
"lookupOptions": {
"lookupDataSource": "performances",
"lookupValue": "_id",
"lookupFields": ["name"]
},
"unique": false,
"formOptions": {
"readOnly": false
},
"visualizationOptions": {
"hidden": true
}
}
}
}
}
}
]
}
}

Properties & Attributes

propertytyperequireddefaultdescription
availabilityBasePathstringtrue/Base path to the Therapy and Monitoring Manager.
dataSchemaDataSchemafalse-Defines a dataSchema for additional fields
widthstringfalse800pxThe width of the modal. It must a valid CSS value.
heightstringfalse500pxThe minimum height of the modal. It must a valid CSS value.

Listens to

eventactionemitson error
availability-modalTriggers the opening or the closing of the modal.--
selected-dataTriggers the opening of the modal in edit modavailability-modal-
add-newListens to the add-new event to open modal--
LookupLiveFoundListens to the live lookup data--
LookupFoundListens to the lookup data--

Emits

eventdescription
availability-modalCustom event, triggers the opening or the closing of the modal.