Manual Reference Source Test
public class | source

AppMenu

Expression Extends:

class AppMenu extends aggregate(AppMenuModel, Helper)

Helper class representing app menu. A app menu redirects the user to different screens and sections of the application.

Test:

Static Member Summary

Static Public Members
public static get

Constructor Summary

Public Constructor
public

constructor(response: Object)

Helper class representing an single app menu.

Member Summary

Public Members
public set
public get
public get
public get
public set
public get
public

image: C6Image

public get
public set
public get
public set
public get
public set
Private Members
private

_badge: *

private

_children: *[]

private

Method Summary

Public Methods
public

async connectChildren(appMenus: *)

public

async delete(cascade: boolean): Promise

Saves a appMenu (insert if id doesn't exist, update if it does)

public

Process the defaults for the app menu to have correct information.

public

async save(): Promise<AppMenu>

Saves a appMenu (insert if id doesn't exist, update if it does)

Static Public Members

public static get type: String source

Public Constructors

public constructor(response: Object) source

Helper class representing an single app menu.

Params:

NameTypeAttributeDescription
response Object
  • optional
  • nullable: false

JSON formatted response of a single menu

response.id Number

The id of the app menu

response.title String

The title of the app menu

response.action String

The action that the devices need to execute when the app menu is tapped. Options are:

                                       - about_us
                                       - alerts
                                       - appointments
                                       - ar
                                       - arts
                                       - badges
                                       - brands
                                       - breath_assessment
                                       - calendar
                                       - captured_value_groups
                                       - care_circle
                                       - companion
                                       - companions
                                       - comply_scan
                                       - contact
                                       - container
                                       - cost_calculator
                                       - data_collection
                                       - diamond_club
                                       - dynamic_contents
                                       - ediary
                                       - email
                                       - event_report
                                       - events
                                       - external_url
                                       - faq
                                       - favorites
                                       - flow_process
                                       - galleries
                                       - give_points
                                       - glossary
                                       - health_measurements
                                       - home
                                       - information
                                       - key_terms
                                       - logout
                                       - map
                                       - menu
                                       - my_trial
                                       - news
                                       - no_action
                                       - offers
                                       - outage_map
                                       - pain_assessment
                                       - payment_locator
                                       - personal_center
                                       - places
                                       - privacy_policy
                                       - profile
                                       - push_notification
                                       - reminders
                                       - report_an_outage
                                       - rewards
                                       - scavenger
                                       - send_message
                                       - settings
                                       - share
                                       - social
                                       - static_screen
                                       - subcategory
                                       - tagged_contents
                                       - technical_support
                                       - terms
                                       - tou
                                       - tracker
                                       - trial
                                       - unknown
                                       - url
                                       - video
                                       - video_consult
                                       - videos
response.image Object

The icon of the app menu

Public Members

public set actionDetail: Any source

public get actionDetail: Any source

public get badge: String source

public get children: AppMenu[] source

public set flowContainer: FlowContainer source

public get flowContainer: FlowContainer source

public image: C6Image source

public get parent: AppMenu source

public set parent: AppMenu source

public get predefinedScreen: PredefinedScreen source

public set predefinedScreen: PredefinedScreen source

public get updateBadge: Promise<String> source

public set updateBadge: Promise<String> source

Private Members

private _badge: * source

private _children: *[] source

private _updateBadge: Promise<String> source

Public Methods

public async connectChildren(appMenus: *) source

Params:

NameTypeAttributeDescription
appMenus *
  • optional
  • default: undefined

public async delete(cascade: boolean): Promise source

Saves a appMenu (insert if id doesn't exist, update if it does)

Params:

NameTypeAttributeDescription
cascade boolean
  • optional
  • default: false

Return:

Promise

Returns a promise via ajax call.

Example:

import { AppMenu, Client } from 'clinical6';

// Removes appMenu from server and local storage
const appMenu = new AppMenu({
  "id": 1,
  "type": "appMenus",
  "attributes": {
    "udid": "this-is-a-udid-string",
    "technology": "ios",
    "access_token": "cd68fa04e458d6d1a9d29faec6a329d3",
    "push_id": null,
    "created_at": "2017-05-19T17:21:26.311Z",
    "updated_at": "2017-05-19T17:21:26.311Z",
    "app_version": null
  }
});
appMenu.delete();

// No longer in storage
Client.instance.storageUtility.has('appMenus', { id: 1 });
// if cascade parameter pass is true, check that all submenus are also deleted recursively

Test:

public processDefaults() source

Process the defaults for the app menu to have correct information. This will call and store the appropriate values for various modules, such as 'alerts'.

public async save(): Promise<AppMenu> source

Saves a appMenu (insert if id doesn't exist, update if it does)

Return:

Promise<AppMenu>

Returns a promise via ajax call.

Example:

import { AppMenu, appMenuService } from 'clinical6';

// Inserts when id does not exist
const appMenu = new AppMenu({
  "title": "You are a winner"
});
appMenu.save();

// Updates existing appMenu when id exists
appMenuService.get().then(appMenus => appMenus[0].save());

Test: