Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all webui dependencies and refactor breaking changes #6327

Merged
merged 24 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7f0b153
dev: Upgrade dependencies
kschiffer May 15, 2023
f30f223
console: Refactor application views
kschiffer Jun 6, 2023
705f411
console: Refactor gateway views
kschiffer Jun 13, 2023
c5b4c2e
console: Refactor organization views
kschiffer Jun 13, 2023
6a53937
console: Refactor device views
kschiffer Jun 13, 2023
109652f
console: Refactor remaining views
kschiffer Jun 13, 2023
77934fe
console,account: Refactor libs
kschiffer Jun 13, 2023
d9f9d0c
console: Refactor console containers
kschiffer Jun 13, 2023
92da5d6
console: Refactor global components
kschiffer Jun 13, 2023
d6d796b
console: Refactor console components
kschiffer Jun 13, 2023
4192288
console: Refactor console libs
kschiffer Jun 13, 2023
f596e77
console: Refactor console store
kschiffer Jun 13, 2023
de95973
console: Refactor global containers
kschiffer Jun 13, 2023
3ba9b33
account: Refactor account app
kschiffer Jun 13, 2023
59343ec
console,account: Update locales
kschiffer Jun 14, 2023
751ca38
dev: Remove cypress code coverage
kschiffer Jun 14, 2023
14ba5e9
dev: Fix sdk eslint config
kschiffer Jun 14, 2023
c8fb770
dev: Update cypress after update
kschiffer Jun 18, 2023
a711b5b
dev: Fix cypress specs after update
kschiffer Jun 27, 2023
88da227
console,account: Apply various fixes to make cypress pass
kschiffer Jun 27, 2023
7748aab
dev: Fix jest tests
kschiffer Jun 29, 2023
80288e0
console: Refactor admin panel
kschiffer Jun 29, 2023
3706f7e
console,account: Update locales
kschiffer Jun 30, 2023
3fb25c1
account: Fix login error logic
kschiffer Jul 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
console: Refactor device views
  • Loading branch information
kschiffer committed Jul 3, 2023
commit 6a539371815162e7a00f860813e88685010d547f
51 changes: 0 additions & 51 deletions pkg/webui/console/views/device-add/connect.js

This file was deleted.

49 changes: 0 additions & 49 deletions pkg/webui/console/views/device-add/device-add.js

This file was deleted.

49 changes: 44 additions & 5 deletions pkg/webui/console/views/device-add/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2022 The Things Network Foundation, The Things Industries B.V.
// Copyright © 2023 The Things Network Foundation, The Things Industries B.V.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,9 +12,48 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import connect from './connect'
import DeviceAdd from './device-add'
import React, { useCallback } from 'react'
import { Container, Col, Row } from 'react-grid-system'
import { useParams } from 'react-router-dom'

const ConnectedDeviceAdd = connect(DeviceAdd)
import PageTitle from '@ttn-lw/components/page-title'

export { ConnectedDeviceAdd as default, DeviceAdd }
import RequireRequest from '@ttn-lw/lib/components/require-request'

import DeviceOnboardingForm from '@console/containers/device-onboarding-form'

import sharedMessages from '@ttn-lw/lib/shared-messages'
import { selectJsConfig } from '@ttn-lw/lib/selectors/env'
import attachPromise from '@ttn-lw/lib/store/actions/attach-promise'

import { listBrands } from '@console/store/actions/device-repository'
import { getJoinEUIPrefixes } from '@console/store/actions/join-server'

const DeviceAdd = () => {
const { appId } = useParams()
const { enabled: jsEnabled } = selectJsConfig()
const requestAction = useCallback(
async dispatch => {
if (jsEnabled) {
await dispatch(attachPromise(getJoinEUIPrefixes()))
}
await dispatch(attachPromise(listBrands(appId, {}, ['name', 'lora_alliance_vendor_id'])))
},
[appId, jsEnabled],
)

return (
<RequireRequest requestAction={requestAction}>
<Container>
<Row>
<Col>
<PageTitle tall title={sharedMessages.registerEndDevice} className="mb-cs-m" />
<DeviceOnboardingForm />
</Col>
</Row>
</Container>
</RequireRequest>
)
}

export default DeviceAdd
65 changes: 29 additions & 36 deletions pkg/webui/console/views/device-data/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2019 The Things Network Foundation, The Things Industries B.V.
// Copyright © 2023 The Things Network Foundation, The Things Industries B.V.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -13,61 +13,54 @@
// limitations under the License.

import React from 'react'
import { connect } from 'react-redux'
import { useSelector } from 'react-redux'
import { useParams } from 'react-router-dom'

import Breadcrumb from '@ttn-lw/components/breadcrumbs/breadcrumb'
import { withBreadcrumb } from '@ttn-lw/components/breadcrumbs/context'
import { useBreadcrumbs } from '@ttn-lw/components/breadcrumbs/context'

import WithRootClass from '@ttn-lw/lib/components/with-root-class'
import GenericNotFound from '@ttn-lw/lib/components/full-view-error/not-found'
import IntlHelmet from '@ttn-lw/lib/components/intl-helmet'
import WithRootClass from '@ttn-lw/lib/components/with-root-class'

import DeviceEvents from '@console/containers/device-events'

import appStyle from '@console/views/app/app.styl'

import sharedMessages from '@ttn-lw/lib/shared-messages'
import PropTypes from '@ttn-lw/lib/prop-types'

import { selectSelectedDevice, selectSelectedDeviceId } from '@console/store/selectors/devices'

import style from './device-data.styl'

@connect(state => {
const device = selectSelectedDevice(state)
return {
device,
devId: selectSelectedDeviceId(state),
devIds: device && device.ids,
}
})
@withBreadcrumb('device.single.data', props => {
const { devId } = props
const { appId } = props.match.params
return (
const Data = () => {
const { appId } = useParams()

const device = useSelector(selectSelectedDevice)
const devId = useSelector(selectSelectedDeviceId)

useBreadcrumbs(
'device.single.data',
<Breadcrumb
path={`/applications/${appId}/devices/${devId}/data`}
content={sharedMessages.liveData}
/>
/>,
)
})
export default class Data extends React.Component {
static propTypes = {
device: PropTypes.device.isRequired,
match: PropTypes.match.isRequired,

if (!device) {
return <GenericNotFound />
}

render() {
const {
device: { ids },
} = this.props
const { ids } = device

return (
<WithRootClass className={appStyle.stageFlex} id="stage">
<div className={style.overflowContainer}>
<IntlHelmet hideHeading title={sharedMessages.liveData} />
<DeviceEvents devIds={ids} />
</div>
</WithRootClass>
)
}
return (
<WithRootClass className={appStyle.stageFlex} id="stage">
<div className={style.overflowContainer}>
<IntlHelmet hideHeading title={sharedMessages.liveData} />
<DeviceEvents devIds={ids} />
</div>
</WithRootClass>
)
}

export default Data
86 changes: 0 additions & 86 deletions pkg/webui/console/views/device-general-settings/connect.js

This file was deleted.

Loading