1.2.4 • Published 7 months ago

@decoloop/planner v1.2.4

Weekly downloads
52
License
MIT
Repository
-
Last release
7 months ago

Releases

1.2.4

  • fix only hidden articles on validation

1.2.3

  • add custom translations for 'datepicker'
  • 'datepicker' validations
  • hide summaries in 'all steps'

1.2.2

  • add submit validation for 'all steps' modus
  • fix to change an address

1.2.1

  • Fix hidden articles

1.2.0

  • new flow to show all steps at once.
  • new option to apply selected quantity to all active articles (shared articles)
  • new option to show calendar (datepicker)
  • new way to visualize customer step (grid)
  • improved styling

Activity logging

Inline custom events like 'activity' are not supported in HTML. JavaScript event listeners are needed to handle the 'activity' event.

<decoloop-planner id="widget"/>

<script>
	document
        .getElementById("widget")
        .addEventListener("activity", e => { console.log(e.detail) });
</script>
button name="dlpButtonLoader" id="widget-button">[text]</button>

<script>
	document
        .getElementById("widget-button")
        .addEventListener("activity", e => { console.log(e.detail) });
</script>

Example logging object

{
    "details": {
        "skillCode": "OTHER.MEASURE.PIECES",
        "active": true
    },
    "hasErrors": false,
    "errors": [],
    "kind": 0,
    "action": "toggle"
}
ParameterTypeDescription
kindintWidget step
actionstringAction within the step
detailsobject or nullbased on action
hasErrorsbooleantrue when the errors list has values
errorsstring[]list of errors

Widget step: Articles

Kind = 0

Action: toggle

{
    "details": {
        "skillCode": "OTHER.MEASURE.PIECES",
        "active": true
    },
    "hasErrors": false,
    "errors": [],
    "kind": 0,
    "action": "toggle"
}
ParameterTypeDescription
skillCodestringselected article
activebooleanselected or deselected

Action: change

{
    "details": {
        "skillCode": "OTHER.MEASURE.PIECES",
        "quantity": "5"
    },
    "kind": 0,
    "hasErrors": false,
    "errors": [],
    "action": "change"
}
ParameterTypeDescription
skillCodestringselected article
quantityintselected quantity

Action: submit

{
    "details": {
        "articles": [
            {
                "code": "OTHER.MEASURE.PIECES",
                "quantity": 5
            }
        ]
    },
    "kind": 0,
    "hasErrors": false,
    "errors": [],
    "action": "submit"
}
ParameterTypeDescription
articlesobject[]list of selected articles
articles[].codestringcode
articles[].quantityintquantity

Possible errors that can occur:

  • error.session.session_expired
  • error.articles.articles_requires_at_least_1_item
  • error.articles.article_invalid
  • error.employees.no_valid_skills"

Widget step: Address

Kind = 1

Action: autocomplete

  • Works only on dutch addresses.
  • Non-blocking action, full address fields are visible in case of invalid address
{
    "details": {
        "request": {
            "streetNumber": "51",
            "zip": "8011CA"
        },
        "response": {
            "address": {
                "streetName": "Westerlaan",
                "streetNumber": "51",
                "addition": null,
                "zipCode": "8011CA",
                "cityName": "Zwolle",
                "country_ISO3166_1_2": "NL",
            },
            "isValid": true
        }
    },
    "kind": 1,
    "hasErrors": false,
    "errors": [],
    "action": "autocomplete"
}
ParameterTypeDescription
requestobjectinserted address info
request.streetNumberstringstreetNumber
request.zipstringzip
responseobject or nullreceived info
response.address.isValidbooleanif address can be found
response.addressobject or nulladdress info, null when isValid is false
response.address.streetNamestringstreet name
response.address.streetNumberstringstreet number
response.address.additionstringaddition
response.address.zipCodestringzip
response.address.cityNamestringcity
response.address.country_ISO3166_1_2stringcountry code

Possible errors that can occur:

  • error.session.session_expired
  • error.address.address_invalid

Action: branch

{
    "details": {
        "licenseeId": 999
    },
    "kind": 1,
    "hasErrors": false,
    "errors": [],
    "action": "branch"
}
ParameterTypeDescription
licenseeIdintbranch id

Action: submit

{
    "details": {
        "request": {
            "streetNumber": "51",
            "zip": "8011",
            "streetName": "Westerlaan",
            "city": "Zwolle",
            "licenseeId": null
        },
        "response": {
            "streetName": "Westerlaan",
            "streetNumber": "51",
            "addition": null,
            "zipCode": "8011 CA",
            "cityName": "Zwolle",
            "country_ISO3166_1_2": "nl"
        }
    },
    "kind": 1,
    "hasErrors": false,
    "errors": [],
    "action": "submit"
}
ParameterTypeDescription
requestobjectinserted address info
request.streetNumberstringstreet number
request.streetNamestringstreet name
request.zipstringzip
request.citystringcity
request.licenseeIdint or nullbranch id
responseobject or nullreceived info
response.streetNamestringstreet name
response.streetNumberstringstreet number
response.additionstringaddition
response.zipCodestringzip
response.cityNamestringcity
response.country_ISO3166_1_2stringcountry code

Possible errors that can occur:

  • error.session.session_expired
  • error.address.address_invalid
  • error.address.address_difference_detection
  • error.address.address_difference_detection.zip
  • error.address.address_difference_detection.street_name
  • error.address.address_difference_detection.street_number
  • error.address.address_difference_detection.city
  • error.worklocation.none_in_area
  • error.worklocation.none_in_max_distance

Widget step: Schedule

Kind = 3

Action: set_time

{
    "details": {
        "time": "2022-12-28T12:00:00Z"
    },
    "kind": 2,
    "hasErrors": false,
    "errors": [],
    "action": "set_time"
}
ParameterTypeDescription
timeDateTimeselected date and time

Action: next_range

{
    "details": null,
    "kind": 2,
    "hasErrors": false,
    "errors": [],
    "action": "next_range"
}

Action: previous_range

{
    "details": null,
    "kind": 2,
    "hasErrors": false,
    "errors": [],
    "action": "previous_range"
}

Action: submit

{
    "details": {
        "firstName": "John",
        "middleName": "",
        "lastName": "Doe",
        "emailAddress": "johndoe@decoloop.com",
        "phoneNumber": "0612345678",
        "mobilePhoneNumber": "",
        "languageAbbreviation": "nl",
        "remark": "Extra info"
    },
    "kind": 3,
    "hasErrors": false,
    "errors": [],
    "action": "submit"
}
ParameterTypeDescription
firstNamestring
middleNamestring
lastNamestring
emailAddressstring
phoneNumberstring
mobilePhoneNumberstring
languageAbbreviationstring
remarkstring

Widget step: Confirm

Kind = 4

Action: submit

{
    "details": {
        "reference": "1010.00125"
    },
    "kind": 4,
    "hasErrors": false,
    "errors": [],
    "action": "submit"
}
ParameterTypeDescription
referencestringreceived reference number

Possible errors that can occur:

  • error.session_expired
  • error.dateslot.invalid_timeslot
  • error.unknown.unknown

Generic action: previous

Available in each step

{
    "details": null,
    "kind": 1,
    "hasErrors": false,
    "errors": [],
    "action": "previous"
}
1.2.0

9 months ago

1.2.4

7 months ago

1.2.3

7 months ago

1.2.2

7 months ago

1.2.1

8 months ago

1.2.0-beta.3

9 months ago

1.2.0-beta.2

9 months ago

1.2.0-beta.1

11 months ago

1.2.0-beta.0

11 months ago

1.1.6

12 months ago

1.1.5

12 months ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.11

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago