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

Refactor old components #6724

Merged
merged 21 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f0d3f0e
console: Removed and refactored withFeatureRequirement HOC
PavelJankoski Nov 27, 2023
35919ef
console: Removed and refactored withConnectionReactor HOC
PavelJankoski Nov 27, 2023
fb8b90e
console: Refactor connect in owners select
PavelJankoski Nov 27, 2023
645b13e
console: Refactor connect in organization events and device title sec…
PavelJankoski Nov 27, 2023
49fb55c
console: Refactor connect in application events
PavelJankoski Nov 27, 2023
f2d6bee
console: Refactor connect in uplink form
PavelJankoski Nov 28, 2023
22a31f7
console: Refactor connect in fw version select
PavelJankoski Nov 28, 2023
baae71b
console: Refactor connect in hw version select
PavelJankoski Nov 28, 2023
1055729
console: Change useParams with props
PavelJankoski Nov 28, 2023
6659f18
console: Refactor connect in device card
PavelJankoski Nov 28, 2023
171219c
console: Refactor connect in downlink form
PavelJankoski Nov 28, 2023
9ddc38a
console: Refactor connect in model select
PavelJankoski Nov 28, 2023
6c1a051
console: Refactor connect in brand select
PavelJankoski Nov 28, 2023
ba481b6
console: Refactor connect in gateway connection form
PavelJankoski Nov 28, 2023
c5632ce
console: Refactor connect in full view error
PavelJankoski Nov 28, 2023
2df18cc
console: Refactor connect in gateway connection reactor
PavelJankoski Nov 28, 2023
0c1acb1
console: Refactor connect in gateway events
PavelJankoski Nov 28, 2023
8badbf2
console: Refactor connect in device events
PavelJankoski Nov 28, 2023
07556e7
console: Refactor connect in collaborators table
PavelJankoski Nov 28, 2023
21fad62
console: Fix locale issues
PavelJankoski Nov 28, 2023
22127c9
console: Removed commented code
PavelJankoski Nov 29, 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
3 changes: 1 addition & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ To decide whether a component is a container component, ask yourself:
- Is this component more concerned with how things work, rather than how things look?
- Does this component connect to the store?
- Does this component fetch or send data?
- Is the component generated by higher order components (e.g. `withFeatureRequirement`)?
- Is the component generated by higher order components?
- Does this component render simple nodes, like a single presentational component?

If you can answer more than 2 questions with yes, then you likely have a container component.
Expand All @@ -692,7 +692,6 @@ View components always represent a single view of the application, represented b
- Fetching necessary data (via `withRequest` HOC), if not done by a container
- Unavailable "catch-all"-routes are caught by `<NotFoundRoute />` component, including subviews
- Errors should be caught by the `<ErrorView />` error boundary component
- `withFeatureRequirement` HOC is used to prevent access to routes that the user has no rights for
- Ensured responsiveness and usage of the grid system

#### Utility components
Expand Down
81 changes: 81 additions & 0 deletions cypress/e2e/console/integrations/pub-subs/create.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2020 The Things Network Foundation, The Things Industries B.V.

Check warning on line 1 in cypress/e2e/console/integrations/pub-subs/create.spec.js

View workflow job for this annotation

GitHub Actions / Check Mergeability

cypress/e2e/console/integrations/pub-subs/create.spec.js has a conflict when merging TheThingsIndustries/lorawan-stack:v3.28.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -323,4 +323,85 @@
})
})
})

describe('Disabled Providers', () => {
const description = 'Changing the Pub/Sub provider has been disabled by an administrator'

describe('NATS disabled', () => {
const response = {
configuration: {
pubsub: {
providers: {
nats: 'DISABLED',
},
},
},
}

beforeEach(() => {
cy.loginConsole({ user_id: userId, password: user.password })
cy.visit(
`${Cypress.config('consoleRootPath')}/applications/${appId}/integrations/pubsubs/add`,
)

cy.intercept('GET', `/api/v3/as/configuration`, response)
})
it('succeeds setting MQTT as default provider', () => {
cy.findByLabelText('NATS').should('be.disabled')
cy.findByText(description).should('be.visible')
})
})

describe('MQTT disabled', () => {
const description = 'Changing the Pub/Sub provider has been disabled by an administrator'
const response = {
configuration: {
pubsub: {
providers: {
mqtt: 'DISABLED',
},
},
},
}

beforeEach(() => {
cy.loginConsole({ user_id: userId, password: user.password })
cy.visit(
`${Cypress.config('consoleRootPath')}/applications/${appId}/integrations/pubsubs/add`,
)
cy.intercept('GET', `/api/v3/as/configuration`, response)
})

it('succeeds setting NATS as default provider', () => {
cy.findByLabelText('MQTT').should('be.disabled')
cy.findByText(description).should('be.visible')
})
})

describe('MQTT and NATS disabled', () => {
const response = {
configuration: {
pubsub: {
providers: {
mqtt: 'DISABLED',
nats: 'DISABLED',
},
},
},
}

beforeEach(() => {
cy.loginConsole({ user_id: userId, password: user.password })
cy.on('uncaught:exception', () => false)
cy.visit(
`${Cypress.config('consoleRootPath')}/applications/${appId}/integrations/pubsubs/add`,
)
cy.intercept('GET', `/api/v3/as/configuration`, response)
})

it('succeeds showing not found page', () => {
cy.findByRole('heading', { name: /Not found/ }).should('be.visible')
})
})
})
})
40 changes: 0 additions & 40 deletions pkg/webui/console/components/downlink-form/connect.js

This file was deleted.

210 changes: 0 additions & 210 deletions pkg/webui/console/components/downlink-form/downlink-form.js

This file was deleted.

Loading
Loading