-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add: New group display type of Dialog #1364
Conversation
As in, the new test you've added is randomly failing? |
Not only the new test, the control.spec.js was failing randomly for months |
I know that, but i mean is your new test now included in part of the randomly failings tests, or is your new test passing consistently? |
Yes, the new test is a part of the randomly failing tests |
@joepavitt I can remove the newly added test as they are randomly failing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Configuration
It doesn't feel logical that the type
row would live underneath the "Default State" options. I think it should be between the "Page" and "Size" rows.
Sidebar Icon
Not essential, but it'd be nice to use an alternative icon here in the sidebar configuration for "Dialog" type groups. Not sure what icon would make sense though. Maybe https://fontawesome.com/v4/icon/window-restore?
show-dialog
in UI Control
Functionally, this works great, but why does this need an entirely new event type? Why not drive this from the existing show
/hide
logic for a group? You can still rely on the showDialog
variable in the client-side, but the user-facing API (i.e. show
or hide
) should be ideally be consistent
@joepavitt I’ve addressed the above feedback and removed the recently added E2E tests as they were failing randomly.
Handled with this fix |
Functionally - all good Can you add documentation to the This flow will also be a useful example to include: Dialog Groups Example:[
{
"id": "0aa38a714b8a3d67",
"type": "ui-form",
"z": "9337c17e1a7f6875",
"name": "",
"group": "c7871ac53089d535",
"label": "New User",
"order": 1,
"width": 0,
"height": 0,
"options": [
{
"label": "Name",
"key": "name",
"type": "text",
"required": true,
"rows": null
},
{
"label": "Admin",
"key": "isAdmin",
"type": "switch",
"required": false,
"rows": null
}
],
"formValue": {
"name": "",
"isAdmin": false
},
"payload": "",
"submit": "Add",
"cancel": "clear",
"resetOnSubmit": true,
"topic": "topic",
"topicType": "msg",
"splitLayout": "",
"className": "",
"passthru": false,
"dropdownOptions": [],
"x": 220,
"y": 100,
"wires": [
[
"adbd76ecf97076a1"
]
]
},
{
"id": "fa4925a5253341ce",
"type": "ui-control",
"z": "9337c17e1a7f6875",
"name": "",
"ui": "c2e1aa56f50f03bd",
"events": "all",
"x": 580,
"y": 100,
"wires": [
[]
]
},
{
"id": "adbd76ecf97076a1",
"type": "change",
"z": "9337c17e1a7f6875",
"name": "Hide Dialog",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"groups\":{\"hide\":[\"Active Development:Dialog Group\"]}}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 390,
"y": 100,
"wires": [
[
"fa4925a5253341ce",
"b9d77a856b1be020"
]
]
},
{
"id": "294ac777d99f5789",
"type": "ui-button",
"z": "9337c17e1a7f6875",
"group": "497106faf38a5190",
"name": "",
"label": "Add User (Dialog)",
"order": 1,
"width": 0,
"height": 0,
"emulateClick": false,
"tooltip": "",
"color": "",
"bgcolor": "",
"className": "",
"icon": "",
"iconPosition": "left",
"payload": "{\"groups\":{\"show\":[\"Active Development:Dialog Group\"]}}",
"payloadType": "json",
"topic": "topic",
"topicType": "msg",
"buttonColor": "",
"textColor": "",
"iconColor": "",
"x": 370,
"y": 140,
"wires": [
[
"fa4925a5253341ce",
"b9d77a856b1be020"
]
]
},
{
"id": "b9d77a856b1be020",
"type": "debug",
"z": "9337c17e1a7f6875",
"name": "debug 2572",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 590,
"y": 140,
"wires": []
},
{
"id": "c7871ac53089d535",
"type": "ui-group",
"name": "Dialog Group",
"page": "22b5519aa675ad88",
"width": "6",
"height": "1",
"order": 1,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false",
"groupType": "dialog"
},
{
"id": "c2e1aa56f50f03bd",
"type": "ui-base",
"name": "Dashboard",
"path": "/dashboard",
"includeClientData": true,
"acceptsClientConfig": [
"ui-control",
"ui-notification"
],
"showPathInSidebar": false,
"showPageTitle": false,
"navigationStyle": "icon",
"titleBarStyle": "default"
},
{
"id": "497106faf38a5190",
"type": "ui-group",
"name": "Button Groups",
"page": "22b5519aa675ad88",
"width": "6",
"height": "1",
"order": 10,
"showTitle": true,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "22b5519aa675ad88",
"type": "ui-page",
"name": "Active Development",
"ui": "c2e1aa56f50f03bd",
"path": "/active-development",
"icon": "forum",
"layout": "grid",
"theme": "129e99574def90a3",
"order": 1,
"className": "",
"visible": "true",
"disabled": "false"
},
{
"id": "129e99574def90a3",
"type": "ui-theme",
"name": "Custom Theme",
"colors": {
"surface": "#000000",
"primary": "#ff4000",
"bgPage": "#f0f0f0",
"groupBg": "#ffffff",
"groupOutline": "#d9d9d9"
},
"sizes": {
"pagePadding": "24px",
"groupGap": "12px",
"groupBorderRadius": "9px",
"widgetGap": "6px",
"density": "default"
}
}
] With that documentation, also mention how you need to use a |
Sure, I will update |
The only thing we also need to look at is the Dialog width. You have a hardcoded Similar to how the grid layout works, still gives the user control. Although we need to consider the relevant breakpoints too, whereby it'd just render full-width anyway. |
Noted, I will update the code with that. |
No need for |
Yep, I agree with that approach |
I'm working on it |
@joepavitt Addressed feedback as below
|
Please checkout 72dc19f for how you can render a flow viewer inline in the documentation, no need for hardcoded inline I've pushed that for now, but just an FYI for future docs that you write. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subject to passing tests, this is good to go.
Thanks @joepavitt I will check this and note this for future docs writings |
Description
Note
Note that sometimes the E2E test of
control.spec.js
fails randomlyRelated Issue(s)
#1106
Checklist
flowforge.yml
?FlowFuse/helm
to update ConfigMap TemplateFlowFuse/CloudProject
to update values for Staging/ProductionLabels
area:migration
label