Info Box Messages Library

This module provides an API to the new admin layout pages info box.

Source:

Methods

(static) addMessage(message) → {Promise}

Saves a new message.

Parameters:
Name Type Description
message Object

The new message to save.

Source:
Returns:
Type
Promise
Example
jse.libs.info_box.addMessage({
  source: 'ajax',
  identifier: 'asdas',
  status: 'new',
  type: 'success',
  visibility: 'removable',
  customerId: 0,
  headline: 'My Headline',
  buttonLabel: 'asdas',
  buttonLink: 'http://google.com', // optional
	 buttonLink: 'customers.php', // optional
  message: 'Hallo!',
});

(static) addSuccessMessage(messageopt, skipRefreshopt)

Adds a success message to the admin info box.

Parameters:
Name Type Attributes Default Description
message String <optional>

Message to show.

skipRefresh Boolean <optional>
false

Refresh the admin info box to show the message?

Source:

(static) deleteById(id) → {Promise}

Deletes a message.

Parameters:
Name Type Description
id Number

Message ID.

Source:
Returns:
Type
Promise

(static) deleteByIdentifier(identifier) → {Promise}

Deletes a messages by the identifier.

Parameters:
Name Type Description
identifier String

Message identifier.

Source:
Returns:
Type
Promise

(static) deleteBySource(source) → {Promise}

Deletes a message by source.

Parameters:
Name Type Description
source String

Message source.

Source:
Returns:
Type
Promise

(static) getMessages() → {Promise}

Returns the messages from the server (visible only).

Source:
Returns:
Type
Promise

(static) Reactivates() → {Promise}

Reactivates the messages.

Source:
Returns:
Type
Promise

(static) setStatus(id, status) → {Promise}

Sets the status of a message.

Parameters:
Name Type Description
id Number

Message ID.

status String

Message status to set ('new', 'read', 'hidden', 'deleted').

Source:
Returns:
Type
Promise