PlatformMenu
Mixin Extends:
Helper class representing an platformMenu.
Example:
import { PlatformMenu, platformMenuService } from 'clinical6';
// Typically use PlatformMenuService.get()
platformMenuService.get().then(platformMenus => console.log(platformMenus));
const platformMenu = new PlatformMenu({
"data": {
"id": "319",
"type": "menus",
"attributes": {
"icon": "icon-star",
"title": "vitae",
"position": 1,
"enabled": true,
"url": "#",
"access_class": null,
},
"relationships": {
"parent": {
"data": null
},
"children": {
"data": []
},
"authorizable": {
"data": null
}
}
}
});
Constructor Summary
Public Constructor | ||
public |
constructor(json: Object) Constructor for helper class representing an PlatformMenu |
Member Summary
Public Members | ||
public get |
authorizable: Section | Flow | Content |
|
public set |
authorizable: Section | Flow | Content |
|
public get |
|
|
public set |
|
|
public get |
|
|
public set |
|
Method Summary
Public Methods | ||
public |
Saves a platformMenu (insert if id doesn't exist, update if it does) |
|
public |
save(): Promise<PlatformMenu> Saves a platformMenu (insert if id doesn't exist, update if it does) |
Inherited Summary
From class PlatformMenuModel | ||
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
|
public |
|
Public Constructors
public constructor(json: Object) source
Constructor for helper class representing an PlatformMenu
Override:
PlatformMenuModel#constructorParams:
Name | Type | Attribute | Description |
json | Object | json api response from server |
Public Members
public get authorizable: Section | Flow | Content source
public set authorizable: Section | Flow | Content source
public get children: PlatformMenu[] source
public set children: PlatformMenu[] source
public get parent: PlatformMenu source
public set parent: PlatformMenu source
Public Methods
public delete(): Promise source
Saves a platformMenu (insert if id doesn't exist, update if it does)
Example:
import { PlatformMenu, Client } from 'clinical6';
// Removes platformMenu from server and local storage
const platformMenu = new PlatformMenu({
"data": {
"id": "319",
"type": "menus",
"attributes": {
"icon": "icon-star",
"title": "vitae",
"position": 1,
"enabled": true,
"url": "#"
},
"relationships": {
"parent": {
"data": null
},
"children": {
"data": []
},
"authorizable": {
"data": null
}
}
}
});
platformMenu.delete();
// No longer in storage
Client.instance.storageUtility.has('platformMenus', { id: 1 });
public save(): Promise<PlatformMenu> source
Saves a platformMenu (insert if id doesn't exist, update if it does)
Example:
import { PlatformMenu, platformMenuService } from 'clinical6';
// Insert is different from other inserts. Uses mobile application key
const platformMenu = new PlatformMenu({
"title": "My Favorite Menu"
});
platformMenu.save();
// After you have the authtoken and then you've logged in
// Updates existing platformMenu (has existing id)
platformMenuService.get().then(platformMenus => platformMenus[0].save());