From c87a95f535c35ba73deb9208edbe4b82e9f307e1 Mon Sep 17 00:00:00 2001 From: Nicolas Van Labeke Date: Tue, 10 Dec 2024 13:49:59 +0000 Subject: [PATCH] refactor(28715): remove MessageHandlingOption from schemas --- .../useProtocolAdapters/__handlers__/index.ts | 23 +------------------ .../__handlers__/mapping.mocks.ts | 1 - .../src/api/schemas/northbound.json-schema.ts | 8 ------- .../src/api/schemas/northbound.ui-schema.ts | 7 ------ .../src/modules/Device/utils/tags.utils.ts | 1 - .../useNorthboundMappingManager.spec.tsx | 1 - 6 files changed, 1 insertion(+), 40 deletions(-) diff --git a/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/__handlers__/index.ts b/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/__handlers__/index.ts index 168fbd49bd..a84761f67c 100644 --- a/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/__handlers__/index.ts +++ b/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/__handlers__/index.ts @@ -41,15 +41,7 @@ export const mockUISchema: UiSchema = { simulationToMqttMappings: { 'ui:batchMode': true, items: { - 'ui:order': [ - 'mqttTopic', - 'mqttQos', - 'mqttUserProperties', - 'messageHandlingOptions', - 'includeTimestamp', - 'includeTagNames', - '*', - ], + 'ui:order': ['mqttTopic', 'mqttQos', 'mqttUserProperties', 'includeTimestamp', 'includeTagNames', '*'], 'ui:collapsable': { titleKey: 'mqttTopic', }, @@ -123,19 +115,6 @@ export const mockJSONSchema: JSONSchema7 = { description: 'Include the unix timestamp of the sample time in the resulting MQTT message', default: true, }, - messageHandlingOptions: { - type: 'string', - enum: ['MQTTMessagePerTag', 'MQTTMessagePerSubscription'], - title: 'Message Handling Options', - description: - 'This setting defines the format of the resulting MQTT message, either a message per changed tag or a message per subscription that may include multiple data points per sample', - default: 'MQTTMessagePerTag', - // @ts-ignore TODO[NVL] enumNames not officially supported - enumNames: [ - 'MQTT Message Per Device Tag', - 'MQTT Message Per Subscription (Potentially Multiple Data Points Per Sample)', - ], - }, mqttQos: { type: 'integer', title: 'MQTT QoS', diff --git a/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/__handlers__/mapping.mocks.ts b/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/__handlers__/mapping.mocks.ts index c129ba0f9a..e472ff7cad 100644 --- a/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/__handlers__/mapping.mocks.ts +++ b/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/__handlers__/mapping.mocks.ts @@ -22,7 +22,6 @@ export const MOCK_NORTHBOUND_MAPPING: NorthboundMapping = { includeTimestamp: true, maxQoS: MOCK_MAX_QOS, messageExpiryInterval: -1000, - messageHandlingOptions: NorthboundMapping.messageHandlingOptions.MQTTMESSAGE_PER_TAG, } export const mappingHandlers = [ diff --git a/hivemq-edge/src/frontend/src/api/schemas/northbound.json-schema.ts b/hivemq-edge/src/frontend/src/api/schemas/northbound.json-schema.ts index c9e2c24330..35cbbbad58 100644 --- a/hivemq-edge/src/frontend/src/api/schemas/northbound.json-schema.ts +++ b/hivemq-edge/src/frontend/src/api/schemas/northbound.json-schema.ts @@ -28,14 +28,6 @@ export const northboundMappingListSchema: JSONSchema7 = { description: 'Include the unix timestamp of the sample time in the resulting MQTT message', default: true, }, - messageHandlingOptions: { - type: 'string', - enum: ['MQTTMessagePerTag', 'MQTTMessagePerSubscription'], - title: 'Message Handling Options', - description: - 'This setting defines the format of the resulting MQTT message, either a message per changed tag or a message per subscription that may include multiple data points per sample', - default: 'MQTTMessagePerTag', - }, messageExpiryInterval: { type: 'number', description: `The message expiry interval.`, diff --git a/hivemq-edge/src/frontend/src/api/schemas/northbound.ui-schema.ts b/hivemq-edge/src/frontend/src/api/schemas/northbound.ui-schema.ts index b842ca8e9d..dadd317796 100644 --- a/hivemq-edge/src/frontend/src/api/schemas/northbound.ui-schema.ts +++ b/hivemq-edge/src/frontend/src/api/schemas/northbound.ui-schema.ts @@ -34,13 +34,6 @@ export const northboundMappingListUISchema: UiSchema = { maxQoS: { 'ui:enumNames': ['At most once (QoS 0)', 'At least once (QoS 1)', 'Exactly once (QoS 2)'], }, - - messageHandlingOptions: { - 'ui:enumNames': [ - 'MQTT Message Per Device Tag', - 'MQTT Message Per Subscription (Potentially Multiple Data Points Per Sample)', - ], - }, }, }, } diff --git a/hivemq-edge/src/frontend/src/modules/Device/utils/tags.utils.ts b/hivemq-edge/src/frontend/src/modules/Device/utils/tags.utils.ts index f4510656fe..473b6a4ee9 100644 --- a/hivemq-edge/src/frontend/src/modules/Device/utils/tags.utils.ts +++ b/hivemq-edge/src/frontend/src/modules/Device/utils/tags.utils.ts @@ -33,7 +33,6 @@ export const createSchema = (items: RJSFSchema) => { 'serverQueueSize', 'includeTagNames', 'includeTimestamp', - 'messageHandlingOptions', 'mqttUserProperties' ) if (!Object.keys(sourceProperties).length) throw new Error(i18n.t('device.errors.noFormSchema')) diff --git a/hivemq-edge/src/frontend/src/modules/Mappings/hooks/useNorthboundMappingManager.spec.tsx b/hivemq-edge/src/frontend/src/modules/Mappings/hooks/useNorthboundMappingManager.spec.tsx index b8a48a53ad..a513505e89 100644 --- a/hivemq-edge/src/frontend/src/modules/Mappings/hooks/useNorthboundMappingManager.spec.tsx +++ b/hivemq-edge/src/frontend/src/modules/Mappings/hooks/useNorthboundMappingManager.spec.tsx @@ -32,7 +32,6 @@ describe('useNorthboundMappingManager', () => { includeTimestamp: true, maxQoS: MOCK_MAX_QOS, messageExpiryInterval: -1000, - messageHandlingOptions: 'MQTTMessagePerTag', tagName: 'my/tag', topic: 'my/topic', }),