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

Fix Default gateway visibility not updating in Packet Broker view #6719

Merged
merged 3 commits into from
Nov 23, 2023
Merged
Changes from 1 commit
Commits
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: Make request in admin-packet-broker.js
ryaplots committed Nov 23, 2023
commit 58833317b1773249505441b8748910ddedd5cadc
30 changes: 20 additions & 10 deletions pkg/webui/console/views/admin-packet-broker/admin-packet-broker.js
Original file line number Diff line number Diff line change
@@ -30,12 +30,17 @@ import Notification from '@ttn-lw/components/notification'

import Message from '@ttn-lw/lib/components/message'
import GenericNotFound from '@ttn-lw/lib/components/full-view-error/not-found'
import RequireRequest from '@ttn-lw/lib/components/require-request'

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

import { isNotEnabledError } from '@console/lib/packet-broker/utils'

import { registerPacketBroker, deregisterPacketBroker } from '@console/store/actions/packet-broker'
import {
registerPacketBroker,
deregisterPacketBroker,
getHomeNetworkDefaultGatewayVisibility,
} from '@console/store/actions/packet-broker'

import {
selectRegistered,
@@ -219,15 +224,20 @@ const PacketBroker = () => {
/>
</PortalledModal>
</Col>
<Col md={12} style={{ position: 'relative' }} className="mt-cs-xxl">
<Tabs tabs={tabs} active={activeTab} onTabChange={setActiveTab} divider />
<Routes>
<Route path="routing-configuration/*" Component={RoutingConfigurationView} />
<Route path="default-gateway-visibility" Component={DefaultGatewayVisibilityView} />
<Route path="/" element={<Navigate to="routing-configuration" />} />
<Route path="*" component={GenericNotFound} />
</Routes>
</Col>
<RequireRequest requestAction={getHomeNetworkDefaultGatewayVisibility()}>
<Col md={12} style={{ position: 'relative' }} className="mt-cs-xxl">
<Tabs tabs={tabs} active={activeTab} onTabChange={setActiveTab} divider />
<Routes>
<Route path="routing-configuration/*" Component={RoutingConfigurationView} />
<Route
path="default-gateway-visibility"
Component={DefaultGatewayVisibilityView}
/>
<Route path="/" element={<Navigate to="routing-configuration" />} />
<Route path="*" component={GenericNotFound} />
</Routes>
</Col>
</RequireRequest>
</>
)}
</Row>
Original file line number Diff line number Diff line change
@@ -19,16 +19,12 @@ import { useSelector, useDispatch } from 'react-redux'
import toast from '@ttn-lw/components/toast'

import Message from '@ttn-lw/lib/components/message'
import RequireRequest from '@ttn-lw/lib/components/require-request'

import GatewayVisibilityForm from '@console/components/gateway-visibility-form'

import attachPromise from '@ttn-lw/lib/store/actions/attach-promise'

import {
getHomeNetworkDefaultGatewayVisibility,
setHomeNetworkDefaultGatewayVisibility,
} from '@console/store/actions/packet-broker'
import { setHomeNetworkDefaultGatewayVisibility } from '@console/store/actions/packet-broker'

import { selectHomeNetworkDefaultGatewayVisibility } from '@console/store/selectors/packet-broker'

@@ -59,20 +55,18 @@ const DefaultGatewayVisibilityView = () => {
)

return (
<RequireRequest requestAction={getHomeNetworkDefaultGatewayVisibility()}>
<Col md={12}>
<Message
content={m.gatewayVisibilityInformation}
component="p"
className={style.routingPolicyInformation}
/>
<GatewayVisibilityForm
onSubmit={handleDefaultGatewayVisibilitySubmit}
initialValues={initialValues}
error={formError}
/>
</Col>
</RequireRequest>
<Col md={12}>
<Message
content={m.gatewayVisibilityInformation}
component="p"
className={style.routingPolicyInformation}
/>
<GatewayVisibilityForm
onSubmit={handleDefaultGatewayVisibilitySubmit}
initialValues={initialValues}
error={formError}
/>
</Col>
)
}