Skip to main content

Markers Hook

Related links:

Markers can be used to add slides which need to be reviewed by the user. This will be triggered on appointment creation, appointment save and any time the context changes.

Installing​

In your hooks folder, create the file markers.js: (usually src/js/hooks/)

export default {
onUpdate({ sections, data, context, previousContext, feeds, markers }) {
return markers;
},
};

In your hooks file, add to your interface: (usually src/js/hooks.js)

import Markers from "./hooks/markers.js";

export default {
markers: Markers,
};

Events​

onUpdate​

The return value should be the list of markers passed in, with whatever modifications you made.

Each event is passed an object of values that can be used to determine slides you wish to mark for review by the user.

export default {
onUpdate({ sections, data, context, previousContext, feeds, markers }) {
return markers;
},
};

Parameters:​

sections​

Contains the current state of sections, slides and subslides in the presentation.

context​

Contains the context at the point of the event.

previousContext​

Contains the context previous to the event.

feeds​

Contains the feeds at the point of the event. Each feed is supplied as a separate entry within the feeds object. You can understand the outputs here by viewing the feeds tab when working on hooks.

data​

Contains useful general data from the appointment creation/editing process that you may need for your markers selection logic: data from the server, user information, preso data, etc.

data.appointment​

{
"adjunctSections": [],
"adjunctSlides": [],
"adjunctSubSlides": [],
"appointmentssection_set": [],
"appointmentsslide_set": [],
"attendees": "",
"begin": "2017-07-11T06:05:29.000000Z",
"bookmarks": [],
"contact_set": [
{
"customer": "https://demo-server.salespreso.com/api/customers/1/",
"email": "john.smith@testcustomer.com",
"fullName": "John Smith",
"id": 1,
"name_first": "John",
"name_last": "Smith",
"notes": "Skinny latte with one sugar",
"opportunity_set": [],
"phone": "0400 000 000",
"photo_128": null,
"photo_256": null,
"photo_512": null,
"position": "CEO",
"url": "https://demo-server.salespreso.com/api/contacts/1/",
"user": null
}
],
"created_by_support": false,
"created_date": "2017-07-11T06:06:40.000000Z",
"creation_status": "ready",
"deckversion_set": [],
"display_contacts": "John Smith",
"display_title": "Test customer",
"end": "2017-07-11T07:05:29.000000Z",
"id": 1,
"latest_snapshot": {
"id": 1,
"url": "https://demo-server.salespreso.com/api/snapshots/1/"
},
"latest_tele": {
"url": "https://demo-server.salespreso.com/api/hostedpresos/"
},
"modified_date": "2017-07-11T06:06:40.000000Z",
"opportunity_set": [
{
"appointment_set": [],
"contact_set": [],
"customer": "https://demo-server.salespreso.com/api/customers/1/",
"id": 1,
"is_default": false,
"name": "Happiness opportunity",
"profile": {
"cost": 1200,
"product": "premium"
},
"soft_deleted": false,
"stage_name": "Proposal accepted",
"url": "https://demo-server.salespreso.com/api/opportunities/1/"
}
],
"preset": null,
"sort_date": "2017-07-11T06:06:40.000000Z",
"support_mode": false,
"url": "https://demo-server.salespreso.com/api/appointments/1/",
"user": {
"actions": [],
"email": "jane.doe@example.com",
"first_name": "Jane",
"fullName": "Jane Doe",
"groups": [],
"id": 1,
"is_support": false,
"last_name": "Doe",
"permissions": {
"appointments": {
"canUploadCustomSlides": false,
"isContentAdmin": false,
"livePresenter": false,
"telePresenter": false
},
"presets": {
"canCreateCompanyPresets": false
},
"tempslides": {
"canModifyTemporarySlides": false
}
},
"preferences": {
"app_prefs": {},
"email_signature": "",
"notification_sender": "default",
"timezone": ""
},
"url": "https://demo-server.salespreso.com/api/users/1/",
"username": "jane.doe"
},
"viewtype": "live"
}

data.appointment.preset​

If a preset is selected at preso creation, the relevant preset URL will be available - otherwise, data.appointment.preset will be null.

"https://server.livepreso.com/api/presets/2/"
note

Preset data is fetched in the fieldsets hook, giving you detailed information on the selected slides, if the preset is a company or personal preset etc. If you require this information for your markers logic, we recommend saving it to the context using fieldsets.

data.customers​

A list of the customers associated with the preso.

[
{
"contact_set": [
"https://demo-server.salespreso.com/api/contacts/1/",
"https://demo-server.salespreso.com/api/contacts/2/"
],
"default_location": null,
"default_opportunity": "https://demo-server.salespreso.com/api/opportunities/0/",
"id": 1,
"logo": "file:///Users/user/Desktop/awesome_logo.jpg",
"logo_128": "file:///Users/user/Desktop/awesome_logo.jpg",
"logo_256": "file:///Users/user/Desktop/awesome_logo.jpg",
"logo_512": "file:///Users/user/Desktop/awesome_logo.jpg",
"logo_original": "file:///Users/user/Desktop/awesome_logo.jpg",
"notes": "Really awesome customer",
"opportunity_set": [
{
"appointment_set": [],
"contact_set": [],
"customer": null,
"id": 0,
"is_default": true,
"name": "__default__",
"profile": null,
"soft_deleted": false,
"stage_name": "",
"url": "https://demo-server.salespreso.com/api/opportunities/0/"
},
{
"appointment_set": [],
"contact_set": [],
"customer": null,
"id": 1,
"is_default": false,
"name": "Happiness opportunity",
"profile": {
"cost": 1200,
"product": "premium"
},
"soft_deleted": false,
"stage_name": "Proposal accepted",
"url": "https://demo-server.salespreso.com/api/opportunities/1/"
},
{
"appointment_set": [],
"contact_set": [],
"customer": null,
"id": 2,
"is_default": false,
"name": "Mediocre opportunity",
"profile": {
"cost": 800,
"product": "entry level"
},
"soft_deleted": false,
"stage_name": "Proposal pending",
"url": "https://demo-server.salespreso.com/api/opportunities/2/"
}
],
"primaryColour": "#0098ff",
"primary_colour": "#0098ff",
"profile": {
"awesomeness": 100,
"product_level": "premium"
},
"soft_deleted": false,
"title": "Test customer",
"url": "https://demo-server.salespreso.com/api/customers/1/"
}
]

data.contacts​

[
{
"customer": "https://demo-server.salespreso.com/api/customers/1/",
"email": "john.smith@testcustomer.com",
"fullName": "John Smith",
"id": 1,
"name_first": "John",
"name_last": "Smith",
"notes": "Skinny latte with one sugar",
"opportunity_set": [],
"phone": "0400 000 000",
"photo_128": null,
"photo_256": null,
"photo_512": null,
"position": "CEO",
"url": "https://demo-server.salespreso.com/api/contacts/1/",
"user": null
}
]

data.headers​

Contains headers (token and api version) required when interacting with LivePreso API.

data.isNewAppointment​

Boolean that is true if the appointment is new.

data.user​

Details about the owner of the preso.

{
"actions": [],
"email": "jane.doe@example.com",
"first_name": "Jane",
"fullName": "Jane Doe",
"groups": [],
"id": 1,
"is_support": false,
"last_name": "Doe",
"permissions": {
"appointments": {
"canUploadCustomSlides": false,
"isContentAdmin": false,
"livePresenter": false,
"telePresenter": false
},
"presets": {
"canCreateCompanyPresets": false
},
"tempslides": {
"canModifyTemporarySlides": false
}
},
"preferences": {
"app_prefs": {},
"email_signature": "",
"notification_sender": "default",
"timezone": ""
},
"url": "https://demo-server.salespreso.com/api/users/1/",
"username": "jane.doe"
}

Return values:​

markers​

Modified state of markers to be shown in the application.

Uses section and slide immediate keys to locate them within the deck.

[
{ key: "introduction", complete: false },
{ key: "super_stats", complete: true },
{ key: "fancy_infographic", complete: false },
];