Skip to content

Commit e39ab02

Browse files
authored
Merge pull request #998
* refactor(29945): update openAPI specs * refactor(29945): fix mocks * feat(29945): add filtering hook for functions * refactor(29945): Add the DataHub.transform function to the list * chore(29945): fix translations * test(29945): fix tests * chore(29945): revert fix * fix(24800): fix the format of the topic property * fix(24800): fix the widget for the topic property * test(24800): fix tests * fix(24800): fix rebase
1 parent 5d908db commit e39ab02

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

hivemq-edge-frontend/src/extensions/datahub/api/hooks/DataHubFunctionsService/__handlers__/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export const MOCK_DATAHUB_FUNCTIONS_DELIVERY_REDIRECT: FunctionSpecs = {
5959
type: 'string',
6060
title: 'Topic',
6161
description: 'The destination MQTT topic according to the MQTT specification.',
62-
format: 'interpolation',
62+
format: 'mqtt-topic',
6363
},
6464
applyPolicies: {
6565
type: 'boolean',

hivemq-edge-frontend/src/extensions/datahub/designer/operation/OperationData.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/* istanbul ignore file -- @preserve */
2+
import { CustomFormat } from '@/api/types/json-schema.ts'
3+
import { registerEntitySelectWidget } from '@/components/rjsf/Widgets/EntitySelectWidget.tsx'
24
import type { PanelSpecs } from '@/extensions/datahub/types.ts'
35
import type { RJSFSchema } from '@rjsf/utils'
46

@@ -22,6 +24,12 @@ export const MOCK_OPERATION_SCHEMA: PanelSpecs = {
2224
message: {
2325
'ui:widget': 'datahub:message-interpolation',
2426
},
27+
topic: {
28+
'ui:widget': registerEntitySelectWidget(CustomFormat.MQTT_TOPIC),
29+
'ui:options': {
30+
create: true,
31+
},
32+
},
2533
incrementBy: {
2634
'ui:widget': 'updown',
2735
},

hivemq-edge-frontend/src/extensions/datahub/designer/operation/OperationPanel.spec.cy.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('OperationPanel', () => {
9595
cy.get('[role="group"]:has(> label#root_id-label) + [role="list"]').as('id_Errors')
9696
cy.get('@id_Errors').should('contain.text', "must have required property 'id'")
9797

98-
cy.get('[role="group"]:has(> label#root_formData_topic-label) + [role="list"]').as('topic_Errors')
98+
cy.get('[role="group"]:has(> label[for=root_formData_topic]) + [role="list"]').as('topic_Errors')
9999
cy.get('@topic_Errors').should('contain.text', "must have required property 'Topic'")
100100

101101
cy.get('[role="alert"][data-status="error"]').should('be.visible')
@@ -170,13 +170,14 @@ describe('OperationPanel', () => {
170170
},
171171
}
172172

173-
it('should render the form', () => {
173+
it.only('should render the form', () => {
174174
cy.mountWithProviders(<OperationPanel selectedNode="my-node" />, {
175175
wrapper: getWrapperWith([node]),
176176
})
177177
cy.get('h2').should('contain.text', 'Delivery.redirectTo')
178-
cy.get('label#root_formData_topic-label').should('contain.text', 'Topic')
179-
cy.get('label#root_formData_topic-label + input').should('contain.value', 'a/simple/topic')
178+
cy.get('label[for=root_formData_topic]').should('contain.text', 'Topic')
179+
cy.get('label[for=root_formData_topic] + div').should('contain.text', 'a/simple/topic')
180+
180181
cy.get('label:has(> input#root_formData_applyPolicies) ')
181182
.should('contain.text', 'Apply Policies')
182183
.should('have.attr', 'data-checked')

0 commit comments

Comments
 (0)