diff --git a/pkg/webui/console/containers/gateway-onboarding-form/gateway-provisioning-form/gateway-claim-form-section/index.js b/pkg/webui/console/containers/gateway-onboarding-form/gateway-provisioning-form/gateway-claim-form-section/index.js index d74b312b67..bc1723e9c9 100644 --- a/pkg/webui/console/containers/gateway-onboarding-form/gateway-provisioning-form/gateway-claim-form-section/index.js +++ b/pkg/webui/console/containers/gateway-onboarding-form/gateway-provisioning-form/gateway-claim-form-section/index.js @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import React, { useCallback, useEffect } from 'react' +import React, { useEffect } from 'react' import { defineMessages } from 'react-intl' import { useFormikContext } from 'formik' @@ -24,10 +24,6 @@ import Notification from '@ttn-lw/components/notification' import SubmitBar from '@ttn-lw/components/submit-bar' import FormSubmit from '@ttn-lw/components/form/submit' import SubmitButton from '@ttn-lw/components/submit-button' -import Link from '@ttn-lw/components/link' -import Tabs from '@ttn-lw/components/tabs' - -import Message from '@ttn-lw/lib/components/message' import { GsFrequencyPlansSelect as FrequencyPlansSelect } from '@console/containers/freq-plans-select' @@ -37,12 +33,10 @@ import tooltipIds from '@ttn-lw/lib/constants/tooltip-ids' import getHostFromUrl from '@ttn-lw/lib/host-from-url' const { enabled: gsEnabled, base_url: gsBaseURL } = selectGsConfig() -const smUrl = 'https://accounts.thethingsindustries.com' const m = defineMessages({ claimWarning: - 'We detected a Managed gateway. To claim this gateway with a subscription, use the owner token printed on the gateway, or add it to your Gateway Fleet using your fleet owner token.', - fleet: 'Fleet', + 'We detected that your gateway is a Managed Gateway. To claim this gateway, please use the owner token printed on the inside of the mounting lid or scan the QR code to claim instantly.', }) const initialValues = { @@ -55,38 +49,10 @@ const initialValues = { target_gateway_server_address: gsEnabled ? getHostFromUrl(gsBaseURL) : '', } -const ownerTokenTypes = [ - { name: 'gateway', title: sharedMessages.gateway }, - { name: 'fleet', title: m.fleet }, -] - const GatewayClaimFormSection = () => { - const { values, addToFieldRegistry, removeFromFieldRegistry, setValues } = useFormikContext() + const { values, addToFieldRegistry, removeFromFieldRegistry } = useFormikContext() const isManaged = values._inputMethod === 'managed' - const isFleet = values._isFleet - - const [activeOwnerTokenType, setActiveOwnerTokenType] = React.useState( - isFleet ? 'fleet' : 'gateway', - ) - - const onOwnerTokenTypeChange = useCallback( - value => { - setActiveOwnerTokenType(value) - setValues(values => ({ - ...values, - authenticated_identifiers: { - ...values.authenticated_identifiers, - authentication_code: - value === 'fleet' && values._fleet_owner_token - ? btoa(values._fleet_owner_token) - : value === 'gateway' && values._gtw_owner_token - ? btoa(values._gtw_owner_token) - : '', - }, - })) - }, - [setValues], - ) + const withQRdata = values._withQRdata // Register hidden fields so they don't get cleaned. useEffect(() => { @@ -98,76 +64,28 @@ const GatewayClaimFormSection = () => { return ( <> {isManaged && ( - <> -
{lorawanVersion} does not support the {freqPlan} frequency plan. Please choose a different MAC version or frequency plan.',
diff --git a/pkg/webui/locales/en.json b/pkg/webui/locales/en.json
index 9d6ee65f21..1ef665ddf9 100644
--- a/pkg/webui/locales/en.json
+++ b/pkg/webui/locales/en.json
@@ -614,21 +614,16 @@
"console.containers.gateway-managed-gateway.wifi-profiles.overview.deleteSuccess": "WiFi profile deleted",
"console.containers.gateway-managed-gateway.wifi-profiles.overview.deleteFail": "There was an error and the WiFi profile could not be deleted",
"console.containers.gateway-managed-gateway.wifi-profiles.overview.deleteModalMessage": "The profile will not be applicable to gateways anymore and gateways using this profile might lose connectivity. Please make sure to update the gateway settings before deleting this profile.",
- "console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-claim-form-section.index.claimWarning": "We detected a Managed gateway. To claim this gateway with a subscription, use the owner token printed on the gateway, or add it to your Gateway Fleet using your fleet owner token.",
- "console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-claim-form-section.index.fleet": "Fleet",
+ "console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-claim-form-section.index.claimWarning": "We detected that your gateway is a Managed Gateway. To claim this gateway, please use the owner token printed on the inside of the mounting lid or scan the QR code to claim instantly.",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-registration-form-section.index.requireAuthenticatedConnectionDescription": "Select which information can be seen by other network participants, including {packetBrokerURL}",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-registration-form-section.index.shareGatewayInfoDescription": "Choose this option eg. if your gateway is powered by {loraBasicStationURL}",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-registration-form-section.validation-schema.validateEntry": "There must be at least one selected frequency plan ID.",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.index.continue": "To continue, please confirm the Gateway EUI so we can determine onboarding options",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.index.emtyEui": "Continue without EUI",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.index.noEui": "No gateway EUI",
- "console.containers.gateway-onboarding-form.qr-scan-section.fleets-scan.addFleet": "Add to Fleet",
- "console.containers.gateway-onboarding-form.qr-scan-section.fleets-scan.fleetToken": "Fleet owner token",
- "console.containers.gateway-onboarding-form.qr-scan-section.fleets-scan.addToFleetTooltip": "You are registering a Managed gateway. If you want to add it to an existing fleet, click here.",
"console.containers.gateway-onboarding-form.qr-scan-section.index.hasGatewayQR": "Does your gateway have a LoRaWAN® Gateway Identification QR Code? Scan it to speed up onboarding.",
"console.containers.gateway-onboarding-form.qr-scan-section.index.gatewayGuide": "Gateway registration help",
"console.containers.gateway-onboarding-form.qr-scan-section.index.invalidQRCode": "Invalid QR code data. Please note that only TTIGPRO1 Gateway Identification QR Code can be scanned. Some gateways have unrelated QR codes printed on them that cannot be used.",
- "console.containers.gateway-onboarding-form.qr-scan-section.index.gatewayOwnerToken": "Gateway owner token",
"console.containers.gateway-overview-header.index.addBookmarkFail": "There was an error and the gateway could not be bookmarked",
"console.containers.gateway-overview-header.index.duplicateGateway": "Duplicate gateway",
"console.containers.gateway-overview-header.index.removeBookmarkFail": "There was an error and the gateway could not be removed from bookmarks",
@@ -1088,12 +1083,12 @@
"lib.errors.status-code-messages.503": "Service unavailable",
"lib.errors.status-code-messages.504": "Gateway timeout",
"lib.errors.utils.notFound": "Gateway doesn't exist. Please confirm that the gateway EUI is correct.",
- "lib.errors.utils.subscriptionDetached": "The gateway billing is detached. Scan the QR code on the gateway to open the Gateway Status page.",
- "lib.errors.utils.subscriptionSuspended": "Your gateway billing is suspended. Scan the QR code on the gateway to open the Gateway Status page.",
- "lib.errors.utils.subscriptionUnknown": "The gateway billing is not set up yet. Scan the QR code on the gateway to open the Gateway Status page.",
- "lib.errors.utils.noSlotsAvailable": "There are no available Gateway Licenses for this gateway. Scan the QR code on the gateway to open the Gateway Status page.",
+ "lib.errors.utils.subscriptionDetached": "The gateway billing is detached. Scan the QR code on the gateway to open the Gateway Status page.",
+ "lib.errors.utils.subscriptionSuspended": "Your gateway billing is suspended. Scan the QR code on the gateway to open the Gateway Status page.",
+ "lib.errors.utils.subscriptionUnknown": "The gateway billing is not set up yet. Scan the QR code on the gateway to open the Gateway Status page.",
+ "lib.errors.utils.noSlotsAvailable": "There are no available Gateway Licenses for this gateway. Scan the QR code on the gateway to open the Gateway Status page.",
"lib.errors.utils.permissionDenied": "The owner token is invalid.",
- "lib.errors.utils.fleetIdMismatch": "The gateway EUI matches a Gateway License, but the fleet ID does not match. Scan the QR code on the gateway to open the Gateway Status page.",
+ "lib.errors.utils.fleetIdMismatch": "The gateway EUI matches a Gateway License, but the fleet ID does not match. Scan the QR code on the gateway to open the Gateway Status page.",
"lib.field-description-messages.idLocation": "Enter a value using lowercase letters, numbers, and dashes. You can choose this freely.",
"lib.field-description-messages.freqPlanDescription": "A frequency plan defines data rates that your end device or gateway is setup to use. It is important that gateways and end devices within reach use the same frequency plan to be able to communicate.",
"lib.field-description-messages.freqPlanLocation": "Your end device or gateway manufacturer should provide information about the applicable frequency plan for a particular device. In some cases they are printed on the device itself but they should always be in the hardware manual or data sheet.",
@@ -1446,8 +1441,6 @@
"lib.shared-messages.fCnt": "FCnt",
"lib.shared-messages.fetching": "Fetching data…",
"lib.shared-messages.firmwareVersion": "Firmware version",
- "lib.shared-messages.fleetInfo": "Adding a gateway to a Fleet will claim the gateway using an available Slot. Read docs.",
- "lib.shared-messages.fleetTokenInfo": "Log in to your billing account. Select the fleet and copy the token.",
"lib.shared-messages.format": "Format",
"lib.shared-messages.fpNotFoundError": "The LoRaWAN version {lorawanVersion} does not support the {freqPlan} frequency plan. Please choose a different MAC version or frequency plan.",
"lib.shared-messages.fPort": "FPort",
diff --git a/pkg/webui/locales/ja.json b/pkg/webui/locales/ja.json
index 90881a1b69..b33adc90d3 100644
--- a/pkg/webui/locales/ja.json
+++ b/pkg/webui/locales/ja.json
@@ -615,20 +615,15 @@
"console.containers.gateway-managed-gateway.wifi-profiles.overview.deleteFail": "",
"console.containers.gateway-managed-gateway.wifi-profiles.overview.deleteModalMessage": "",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-claim-form-section.index.claimWarning": "",
- "console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-claim-form-section.index.fleet": "",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-registration-form-section.index.requireAuthenticatedConnectionDescription": "",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-registration-form-section.index.shareGatewayInfoDescription": "",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.gateway-registration-form-section.validation-schema.validateEntry": "",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.index.continue": "",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.index.emtyEui": "",
"console.containers.gateway-onboarding-form.gateway-provisioning-form.index.noEui": "",
- "console.containers.gateway-onboarding-form.qr-scan-section.fleets-scan.addFleet": "",
- "console.containers.gateway-onboarding-form.qr-scan-section.fleets-scan.fleetToken": "",
- "console.containers.gateway-onboarding-form.qr-scan-section.fleets-scan.addToFleetTooltip": "",
"console.containers.gateway-onboarding-form.qr-scan-section.index.hasGatewayQR": "",
"console.containers.gateway-onboarding-form.qr-scan-section.index.gatewayGuide": "",
"console.containers.gateway-onboarding-form.qr-scan-section.index.invalidQRCode": "",
- "console.containers.gateway-onboarding-form.qr-scan-section.index.gatewayOwnerToken": "",
"console.containers.gateway-overview-header.index.addBookmarkFail": "",
"console.containers.gateway-overview-header.index.duplicateGateway": "",
"console.containers.gateway-overview-header.index.removeBookmarkFail": "",
@@ -1446,8 +1441,6 @@
"lib.shared-messages.fCnt": "",
"lib.shared-messages.fetching": "データの取得...",
"lib.shared-messages.firmwareVersion": "ファームウェアバージョン",
- "lib.shared-messages.fleetInfo": "",
- "lib.shared-messages.fleetTokenInfo": "",
"lib.shared-messages.format": "フォーマット",
"lib.shared-messages.fpNotFoundError": "指定された周波数プランは見つかりませんでした",
"lib.shared-messages.fPort": "",