Hi All,
I am implementing a feature for Widget Configuration Panel of Carbon
Dashboard's designer view,
to allow users(dashboard designers)  to configure the properties of the
widgets such as the widget background color, widget title etc.

The Current situation is that he user(dashboard designer) can only add or
drop one of the sample widgets or create a new widget of his/her own. but
has no control over the widget there after except for the complete removal
of it from the dashboard.

The new feature will allow modification of certain properties of the widget
so that the user(dashboard designer) won't have to create a completely new
widget in order to make the changes in a existing widget.

Every widget has a JSON file named widgetConf.json containing it's
configurations,
for example: widgetConf.json of widget Overall Revenue Info

{
    "name": "Overall Revenue Info",
    "id": "OverallRevenueInfo",
    "thumbnailURL": "",
    "configs": {
        "pubsub": {
            "types": [
                "subscriber"
            ]
        }
    }
}

To implement the above feature the widgetConf.json needs to be changed as
follows

{

 "name": "Widget Name",

 "id": "WidgetID",

 "thumbnailURL": "",

 "configs": {

    "pubsub": {

     "types": [

       "subscriber"

     ]

    },

    "options" : [

       {

         "id": "sampleId1",

         "title": "sampleTitle1",

         "type" : "text",

         "defaultData" : "SamapleData"

       },

       {

         "id": "sampleId2",

         "title": "sampleTitle2",

         "type" : "boolean",

         "defaultData" : "true"

       },

       {

         "id": "sampleId3",

         "title": "sampleTitle3",

         "type" : "enum",

         "possibleValues" :
["SamapleEnumeratedData1","SamapleEnumeratedData2","SamapleEnumeratedData3"],

         "defaultData" : "SamapleEnumeratedData1"

       },

       {

         "id": "sampleId4",

         "title": "sampleTitle4",

         "type" : "text",

         "defaultData" : "SamapleData"

       }

     ]

    }

 }

}


  All the user changeable options should be included in the options array
of the widgetConf.json with one option object for each user changeable
property.

The Structure of each option object is as follows

   -

   id : this will be used to identify the corresponding property of the
   widget the option value is supposed to change.
   -

   title : this is the text displayed to the user(widget designer) at the
   widget configuration panel.
   -

   type : the type of option, it can be text, boolean or enum,
   -

      A text type option results in a text box.
      -

      A boolean type option results in a checkbox.
      -

      An enum type option would result in a drop down select.



The minimal  widget  configuration panel for a widget with no other user
changeable options would look like this.


[image: Inline image 1]


Please suggest any further changes required.


Thanks & regards,
Irindu

Software Engineer Intern, WSO2 Inc.
Mobile: +94712325238
_______________________________________________
Architecture mailing list
Architecture@wso2.org
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to