Skip to content

Commit 6c4e8d1

Browse files
committed
console: Rename file and merge tti parts
1 parent fdc3682 commit 6c4e8d1

3 files changed

Lines changed: 3 additions & 21 deletions

File tree

pkg/webui/console/containers/gateway-onboarding-form/gateway-provisioning-form/gateway-claim-form-section/index.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ import Message from '@ttn-lw/lib/components/message'
3131

3232
import { GsFrequencyPlansSelect as FrequencyPlansSelect } from '@console/containers/freq-plans-select'
3333

34-
import { selectGsConfig, selectPluginTTSCloud } from '@ttn-lw/lib/selectors/env'
34+
import { selectGsConfig } from '@ttn-lw/lib/selectors/env'
3535
import sharedMessages from '@ttn-lw/lib/shared-messages'
3636
import tooltipIds from '@ttn-lw/lib/constants/tooltip-ids'
3737
import getHostFromUrl from '@ttn-lw/lib/host-from-url'
3838

3939
const { enabled: gsEnabled, base_url: gsBaseURL } = selectGsConfig()
40-
// TTI only.
41-
const smUrl = selectPluginTTSCloud().subscription_management_url
42-
// End TTI.
40+
const smUrl = 'https://accounts.thethingsindustries.com'
4341

4442
const m = defineMessages({
4543
claimWarning:
@@ -57,17 +55,14 @@ const initialValues = {
5755
target_gateway_server_address: gsEnabled ? getHostFromUrl(gsBaseURL) : '',
5856
}
5957

60-
// TTI only.
6158
const ownerTokenTypes = [
6259
{ name: 'gateway', title: sharedMessages.gateway },
6360
{ name: 'fleet', title: m.fleet },
6461
]
65-
// End TTI.
6662

6763
const GatewayClaimFormSection = () => {
6864
const { values, addToFieldRegistry, removeFromFieldRegistry, setValues } = useFormikContext()
6965
const isManaged = values._inputMethod === 'managed'
70-
// TTI only.
7166
const isFleet = values._isFleet
7267

7368
const [activeOwnerTokenType, setActiveOwnerTokenType] = React.useState(
@@ -92,7 +87,6 @@ const GatewayClaimFormSection = () => {
9287
},
9388
[setValues],
9489
)
95-
// End TTI.
9690

9791
// Register hidden fields so they don't get cleaned.
9892
useEffect(() => {
@@ -116,7 +110,6 @@ const GatewayClaimFormSection = () => {
116110
className="mb-0"
117111
/>
118112
</Form.InfoField>
119-
{/** TTI only. */}
120113
<Message content={sharedMessages.ownerToken} className="fw-bold" />
121114
<Tabs
122115
active={activeOwnerTokenType}
@@ -133,19 +126,15 @@ const GatewayClaimFormSection = () => {
133126
component="div"
134127
/>
135128
)}
136-
{/** End TTI. */}
137129
</>
138130
)}
139131
<Form.Field
140132
required
141133
title={sharedMessages.ownerToken}
142-
// TTI only.
143134
showTitle={!isManaged}
144-
// End TTI.
145135
name="authenticated_identifiers.authentication_code"
146136
tooltipId={tooltipIds.CLAIM_AUTH_CODE}
147137
component={Input}
148-
// TTI only.
149138
description={activeOwnerTokenType === 'fleet' ? sharedMessages.fleetTokenInfo : undefined}
150139
descriptionValues={{
151140
Link: val => (
@@ -154,7 +143,6 @@ const GatewayClaimFormSection = () => {
154143
</Link.Anchor>
155144
),
156145
}}
157-
// End TTI.
158146
encode={btoa}
159147
decode={atob}
160148
sensitive

pkg/webui/console/containers/gateway-onboarding-form/qr-scan-section/fleets-scan.tti.js renamed to pkg/webui/console/containers/gateway-onboarding-form/qr-scan-section/fleets-scan.js

File renamed without changes.

pkg/webui/console/containers/gateway-onboarding-form/qr-scan-section/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import sharedMessages from '@ttn-lw/lib/shared-messages'
3131
import { parseGatewayQRCode } from '@console/store/actions/qr-code-generator'
3232
import { getGatewayClaimInfoByEui } from '@console/store/actions/gateways'
3333

34-
import FleetsScan from './fleets-scan.tti'
34+
import FleetsScan from './fleets-scan'
3535

3636
const m = defineMessages({
3737
hasGatewayQR:
@@ -70,7 +70,6 @@ const GatewayQRScanSection = () => {
7070
},
7171
authenticated_identifiers: {
7272
gateway_eui: gateway.gateway_eui,
73-
// TTI only.
7473
authentication_code: gateway._fleet_owner_token
7574
? btoa(gateway._fleet_owner_token)
7675
: gateway.owner_token
@@ -80,7 +79,6 @@ const GatewayQRScanSection = () => {
8079
_gtw_owner_token: gateway.owner_token ?? '',
8180
_fleet_owner_token: gateway._fleet_owner_token ?? '',
8281
_isFleet: Boolean(gateway._fleet_owner_token),
83-
// End TTI.
8482
}))
8583

8684
setQrData({ ...qrData, approved: true })
@@ -96,10 +94,8 @@ const GatewayQRScanSection = () => {
9694
// Get gateway from QR code
9795
const gateway = await dispatch(attachPromise(parseGatewayQRCode(qrCode)))
9896
const gatewayEui = gateway.gateway_eui
99-
// TTI only.
10097
const { is_managed } = await dispatch(attachPromise(getGatewayClaimInfoByEui(gatewayEui)))
10198
gateway.is_managed = is_managed
102-
// End TTI.
10399

104100
const sheetData = [
105101
{
@@ -170,9 +166,7 @@ const GatewayQRScanSection = () => {
170166
onCancel={handleQRCodeCancel}
171167
onRead={handleQRCodeRead}
172168
qrData={qrData}
173-
// TTI only.
174169
modalDataChildren={<FleetsScan qrData={qrData} setQrData={setQrData} />}
175-
// End TTI.
176170
/>
177171
)}
178172
</ButtonGroup>

0 commit comments

Comments
 (0)