Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List Visual Block #9

Open
mmarcec007 opened this issue Dec 17, 2020 · 1 comment
Open

List Visual Block #9

mmarcec007 opened this issue Dec 17, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@mmarcec007
Copy link
Contributor

mmarcec007 commented Dec 17, 2020

List Block
Define a new block in convoworks with name List Block which will make it easier to work with lists on Amazon Alexa, Google Assistant, Facebook Messenger and Viber.

Block Properties itself:

  • list title -> displays the title of the list
  • list template -> offers selection between carousel view and list view if possible
  • items -> this is the object which contains the contents of the list items
  • offset ->
  • limit ->user defined limit which can be overridden by platform upper limit
  • list item name -> under which name to store list item name
  • list item title -> title of the item which is in the list
  • list item description -> description of the item which is in the list
  • list item image url -> link to the image of an item in the list
  • list item image text -> accessibility text of the image of an item in the list (Required if you want to display the image!)

Block Containers:

  • Read Phase -> display the list itself and support is added for other convoworks responses such as text response, set parameter, if and so on
  • On No Screen Supported -> will be executed instead if the device has no support for a screen
  • On List Item Selected -> will be executed when an item of the list was selected
  • Additional Processors -> will be executed of another things of other processors are matched

Additional specifications:

  • Define new request interfaces IConvoListRequest which will make it easier to get values from those requests from each platform and implement them in each PlatformRequest
  • Define new response interfaces IConvoListResponse which will make it easier to define the final response for each platform and implement them in each PlatformResponse

Please also refer to the Dummy representation of the List Block.

Dummy representation of the List Block:
list_block_image

@mmarcec007 mmarcec007 added the enhancement New feature or request label Dec 17, 2020
@mmarcec007 mmarcec007 self-assigned this Dec 17, 2020
@mmarcec007
Copy link
Contributor Author

Here is an quick overview of the interface infrastructure for the List Visual Element.

IConvoListRequest makes it easier to detect any selected list item after a list response was sent.

interface IConvoListRequest extends IConvoRequest
{
    /**
     * @return int
     */
    public function getSelectedItemIndex() : int;
}

IConvoListResponse makes it easier to declare an list response.

interface IConvoListResponse extends IConvoResponse
{
    public function getListResponse(IVisualList $listDefinition) : array;
}

IVisualList is used in IConvoListResponse ->getListResponse(IVisualList $listDefinition) list response. This definition makes it clearer how the ListResponse should be formed.

interface IVisualList {
    public function getListTitle() : string;
    public function getListType() : string;
    public function getListItems() : array;
}

IVisualItem is part of ListItems in IVisualList.

interface IVisualItem
{
    public function getTitle() : string;
    public function getSubtitle() : string;
    public function getDescription() : string;
    public function getImageURL() : string;
    public function getImageText() : string;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant