diff --git a/pkg/webui/console/components/events/previews/application-downlink.js b/pkg/webui/console/components/events/previews/application-downlink.js index aca336e5b4..dba5a611f5 100644 --- a/pkg/webui/console/components/events/previews/application-downlink.js +++ b/pkg/webui/console/components/events/previews/application-downlink.js @@ -29,7 +29,6 @@ const ApplicationDownlinkPreview = React.memo(({ event }) => { return ( - {'decoded_payload' in data ? ( diff --git a/pkg/webui/console/components/events/previews/application-uplink-normalized.js b/pkg/webui/console/components/events/previews/application-uplink-normalized.js index 8150e4b399..b9f4074443 100644 --- a/pkg/webui/console/components/events/previews/application-uplink-normalized.js +++ b/pkg/webui/console/components/events/previews/application-uplink-normalized.js @@ -29,7 +29,6 @@ const ApplicationUplinkNormalizedPreview = React.memo(({ event }) => { return ( - {data.normalized_payload.soil && ( diff --git a/pkg/webui/console/components/events/previews/application-uplink.js b/pkg/webui/console/components/events/previews/application-uplink.js index d5371c6e0d..7ab240081b 100644 --- a/pkg/webui/console/components/events/previews/application-uplink.js +++ b/pkg/webui/console/components/events/previews/application-uplink.js @@ -20,6 +20,7 @@ import PropTypes from '@ttn-lw/lib/prop-types' import sharedMessages from '@ttn-lw/lib/shared-messages' import getDataRate from '@console/lib/data-rate-utils' +import { activationEvent } from '@console/lib/regexp' import messages from '../messages' @@ -27,7 +28,7 @@ import DescriptionList from './shared/description-list' import JSONPayload from './shared/json-payload' const ApplicationUplinkPreview = React.memo(({ event }) => { - const { data, identifiers } = event + const { data, identifiers, name } = event const deviceIds = identifiers[0].device_ids const { snr, rssi } = getSignalInformation(data) const dataRate = getDataRate(data) @@ -35,7 +36,12 @@ const ApplicationUplinkPreview = React.memo(({ event }) => { return ( - + {activationEvent.test(name) && ( + <> + + + + )} {'decoded_payload' in data ? ( diff --git a/pkg/webui/console/components/events/previews/default.js b/pkg/webui/console/components/events/previews/default.js index d9a9381a1f..29dc903d6b 100644 --- a/pkg/webui/console/components/events/previews/default.js +++ b/pkg/webui/console/components/events/previews/default.js @@ -17,25 +17,31 @@ import React from 'react' import PropTypes from '@ttn-lw/lib/prop-types' import sharedMessages from '@ttn-lw/lib/shared-messages' +import { activationEvent } from '@console/lib/regexp' + import messages from '../messages' import DescriptionList from './shared/description-list' const DefaultPreview = React.memo(({ event }) => { - const { identifiers } = event + const { identifiers, name } = event if (identifiers && 'device_ids' in identifiers[0]) { return ( - - + {activationEvent.test(name) && ( + <> + + + + )} ) } diff --git a/pkg/webui/console/components/events/previews/downlink-message.js b/pkg/webui/console/components/events/previews/downlink-message.js index b9bd1963c8..7ae9e176d1 100644 --- a/pkg/webui/console/components/events/previews/downlink-message.js +++ b/pkg/webui/console/components/events/previews/downlink-message.js @@ -20,7 +20,6 @@ import { getDataRate } from '@console/components/events/utils' import PropTypes from '@ttn-lw/lib/prop-types' import getByPath from '@ttn-lw/lib/get-by-path' -import sharedMessages from '@ttn-lw/lib/shared-messages' import messages from '../messages' @@ -62,8 +61,6 @@ const DownLinkMessagePreview = React.memo(({ event }) => { ) } const devAddr = event.identifiers[0].device_ids.dev_addr - const joinEui = event.identifiers[0].device_ids.join_eui - const devEui = event.identifiers[0].device_ids.dev_eui const frmPayload = getByPath(data, 'payload.mac_payload.frm_payload') const rx1Delay = getByPath(data, 'request.rx1_delay') const fPort = getByPath(data, 'payload.mac_payload.f_port') @@ -72,8 +69,6 @@ const DownLinkMessagePreview = React.memo(({ event }) => { return ( - - {isConfirmed && ( diff --git a/pkg/webui/console/components/events/previews/gateway-uplink-message.js b/pkg/webui/console/components/events/previews/gateway-uplink-message.js index 1e023d6014..a7008d3305 100644 --- a/pkg/webui/console/components/events/previews/gateway-uplink-message.js +++ b/pkg/webui/console/components/events/previews/gateway-uplink-message.js @@ -55,8 +55,6 @@ const GatewayUplinkMessagePreview = React.memo(({ event }) => { return ( - - {isConfirmed && ( diff --git a/pkg/webui/console/lib/regexp.js b/pkg/webui/console/lib/regexp.js index 8dd96fc857..e0ecfe0204 100644 --- a/pkg/webui/console/lib/regexp.js +++ b/pkg/webui/console/lib/regexp.js @@ -32,3 +32,4 @@ export const emptyDuration = /^[a-zA-z]+$/ export const delay = new RegExp('^[0-9]{1,}[.]?([0-9]{1,})?[a-zA-Z]{1,2}$') export const apiKeyPath = /([A-Z0-9]{39})/ export const duration = /^[0-9]+([a-z])$/ +export const activationEvent = /.*\.join\..*/