You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 24 Next »

When creating a widget, define its form, fields, and their behaviour by using the template elements to specify the widget view and the way it displays with HTML and Widget Attributes. The widget template also allows end-users to input data and interact with it. Apply HTML tags and React components to add and control elements such as buttons and various types of fields. 



<activityfeed>

description goes here

Example
<activityfeed table_name="itsm_incident" 
sys_id="157322330317307618"></activityfeed>



<authfull> 

An Authorisation widget component that contains full functionality of the user authorization including form of registration. It also supports configurable validation in strings containing user login and password. 

The following attributes are applicable:

AttributeTypeDefault valueDescription
isRegistrationBooleanFalseThis attribute is responsible for specifying whether this is a new user registration or not. To register a new user, make this attribute equal to "true".
isSwitchLangBooleanTrueThis attribute is responsible for ability of user locale switching on authorization page. If this attribute is equal to 'false', then the user will not be able to change the interface language, and will use the default system language.
isRememberMeBooleanFalseThis attribute is responsible for specifying whether should user credentials be saved on this computer or not. To save the credentials, make this attribute equal to "true".
logoString''

Absolute path to the logo displayed on authorization page. For example:

https://example.com/logo.png
isResetPasswordBooleanFalseThis attribute is responsible for specifying whether this request is to reset user password, To request resetting, make this attribute equal to "true".


Example
<authfull redirectTo="/portal" isRegistration="true" isSwitchLang="true" isRememberMe="false" isResetPassword="true"></authfull>



<authheader>

A part of a header that displays a user's name and avatar, or prompts them to log in if they haven't already. The following attributes are applicable:

  • profileURL - specify the path to the portal section containing the personal pages. 
    • If specified, then the Profile item is available in the User Menu at the top right
    • If not specified, then this item is not available, and user won't be able to watch his profile.
Example
<authheader profileURL="/portal/cabinet">



<breadcrumbs>

A Breadcrumbs widget component that displays a navigation chain trailing user activity.

This widget uses the object received from the server script to build the breadcrumbs chain with the format below:

{sys_id, title, url}.

Example
there was text here. it's gone now.



<card>

* img - Иконка (svg) не ссылка, а код svg
* url - Ссылка на которую перейдем при клике на карточку
* name - Заголовок
* short_description - Описание
* button_name - Текст на кнопке
Example
<getlist table_name="sys_service_portal">
<card></card>
</getlist>



<dropdown_widget>

Creates a dropdown menu with menu elements on any nesting level.

The following attributes are applicable:

  • size - (может быть low = __ px ? / medium = __ px ? / large = __ px ?).

  • event -
  • event_to_display -
Example
<dropdown_widget model="data.menu"></dropdown_widget>
dropdown_widget model example
; (() => {
    data.menu = {
        "menu": {
    "size": "low",
    "event_to_display": [
        "click"
    ],
    "sections": [
        {
            "order": "1",
            "elements": [
                {
                    "title": "Text",
                    "order": "1",
                    "event_to_display": ["click"],
                    "events": {
                        "click": "runScript()"
                    },
                    "child_elements": [
                        {
                            "title": "Text22",
                            "event_to_display": ["click"],
                            "events": {
                                "click": "runScript()"
                            },
                            "child_elements": [
                            {
                            "title": "Text2",
                            "event_to_display": ["click"],
                            "events": {
                                "click": "runScript()"
                            },
                            "child_elements": []
                        }
                            ]
                        }
                    ]
                },
                {
                    "title": "Title",
                    "order": "2",
                    "event_to_display": ["click"],
                    "events": {
                        "click": "runScript()"
                    },
                    "child_elements": [
                        {
                            "title": "Text2",
                            "event_to_display": ["click"],
                            "events": {
                                "click": "runScript()"
                            },
                            "child_elements": []
                        }
                    ]
                }
            ]
        },
        {
            "order": "2",
            "elements": [
                {
                    "title": "Text",
                    "order": "1",
                    "event_to_display": ["click"],
                    "events": {
                        "click": "runScript()"
                    },
                    "child_elements": []
                }
            ]
        }
    ]
}
    }
})();



<form>

The dynamic form creating component. It requires the following arguments received from the server script:

  1. table - specifies a name of the table, e.g. "sys_cmdb_ci".
  2. view - defines a name of the table template view, e.g. "record", "list", etc.
  3. (optional) sys_id - an ID of the form.
  4. (optional) buttons - form UI actions including buttons and other graphical elements.

    Specify the way UI actions displayed on the form with the options below:

    • header - on the top of the form;
    • bottom - on the bottom of the form;
    • link - as a link.

    Specify these options separating them with the coma.

Example
<form table="name_table" view="name_view" 
sys_id="sys_number" buttons="header, bottom, link">
</form>



<getlist>

Виджет для получения списка из АПИ и прокидывания результатов в дочерний виджет.
Example
there was text here. it's gone now. 



<listitems>

This widget allows displaying table items as a list view. The following attributes are applicable:

  • tableName- specify a table containing output elements to display. This attribute is mandatory.
  • listView - specify a list view to use (this view need to be created first in the UI list (sys_ui_list) dictionary). This attribute is mandatory.
  • view - this attribute allows us to specify the view adjustability. Available attribute options:
    • adjustable - in this case, you can adjust the widget size to be able to use more than one widget on the page.
    • full - when this option is specified, the widget uses all the valuable page space.  
  • condition - specify a condition applied to the list. This attribute should contain data of the Conditions type.
  • choiceConditionName - this attribute is to specify columns containing data of the Choice type if you need to specify choice options in your condition.
  • dateConditionName - this attribute is to specify columns containing data of the Date or Date/Time type if you need to specify date ranges in your condition. 
  • perPage - specify the number of page items. If not specified, then equal to '5'by default. 
  • displayColumnNumber - specify a column number to open a record by clicking on it. If not specified, then equal to '1' by default.
Example
<listitems tableName="itsm_incident" condition="" listView="Widget" choiceConditionName="state" dateConditionName="sys_created_at" perPage="25" displayColumnNumber="2"></listitems>



<news>

Displays a newsfeed or an announcement list that is generated by the data object received from the server script.

The following attributes are applicable:

  • sys_id - an ID of the form.
  • subject - an announcement message text.
  • announcement_type - a category of an announcement.
  • sys_created_at  - the date an announcement was created.
Example
<news model="[{ "sys_id": "159038766612804355", "subject": "test subject", "announcement_type": "1", "sys_created_at": "2020-03-04 00:00:00" },
{ "sys_id": "148038977612804360", "subject": "test subject 2", "announcement_type": "2", "sys_created_at": "2020-01-20 00:00:00" }]"></news>



<previewlistwidget>


The following attributes are applicable

Example
<PreviewListWidget tableName="itsm_incident" view="Widget" elementCount="2" subjectColumn="subject" dateColumn="sys_created_at" stateColumn="state" wrap="true"><ListHeader><div>Привет</div></ListHeader></PreviewListWidget>


<search>

A Search widget component responsible for search functionality.

The following attributes are applicable:

  • search_url - a URL suffix.
  • show_title - a boolean-type attribute with possible true or false values. It is responsible for title displaying.
  • size - specifies the title size with the lg (large) or sm (small) values.
  • greeting - a message shown to a user.
  • placeholder - text inside the search field.
Example
<search search_url=‘/search’ show_title=true size=‘lg’ greeting=‘hello’ placeholder=‘Enter text here’/>



<sidemenu>

This element adds a side-menu.

Example
there was text here. it's gone now. 

  • No labels