Skip to content

Commit

Permalink
refactor(17040): apply changes to openAPI to codegen stubs
Browse files Browse the repository at this point in the history
- remove exclude from the subscription UI for remote
  • Loading branch information
vanch3d committed Oct 12, 2023
1 parent c5c960e commit 7bb30c4
Show file tree
Hide file tree
Showing 15 changed files with 148 additions and 58 deletions.
2 changes: 2 additions & 0 deletions hivemq-edge/src/frontend/src/api/__generated__/index.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const useGetAdaptersStatus = () => {
return useQuery(
[QUERY_KEYS.ADAPTERS, QUERY_KEYS.CONNECTION_STATUS],
async () => {
const item = await appClient.protocolAdapters.status1()
const item = await appClient.protocolAdapters.getAdaptersStatus()
return item
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const useGetBridgesStatus = () => {
return useQuery(
[QUERY_KEYS.BRIDGES, QUERY_KEYS.CONNECTION_STATUS],
async () => {
const item = await appClient.bridges.status()
const item = await appClient.bridges.getBridgesStatus()
return item
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const useGetBridgeConnectionStatus = (name: string | undefined) => {
return useQuery(
[QUERY_KEYS.BRIDGES, name, QUERY_KEYS.CONNECTION_STATUS],
async () => {
const item = await appClient.bridges.getStatus(name as string)
const item = await appClient.bridges.getBridgeStatus(name as string)
return item
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const useSetConnectionStatus = () => {
const queryClient = useQueryClient()

const setConnectionStatus = ({ name, requestBody }: SetConnectionStatusProps) => {
return appClient.bridges.changeStatus(name, requestBody)
return appClient.bridges.transitionBridgeStatus(name, requestBody)
}

return useMutation<StatusTransitionResult, ApiError, SetConnectionStatusProps>(setConnectionStatus, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const useSetConnectionStatus = () => {
const queryClient = useQueryClient()

const changeStatus = ({ adapterId, requestBody }: SetConnectionStatusProps) => {
return appClient.protocolAdapters.changeStatus1(adapterId, requestBody)
return appClient.protocolAdapters.transitionAdapterStatus(adapterId, requestBody)
}

return useMutation<StatusTransitionResult, ApiError, SetConnectionStatusProps>(changeStatus, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,34 +174,38 @@ const SubscriptionsPanel: FC<BridgeSubscriptionsProps> = ({ form, type }) => {
/>
</FormControl>

<FormControl>
<FormLabel htmlFor={`${type}.${index}.excludes`}>{t('bridge.subscription.excludes')}</FormLabel>
<Controller
name={`${type}.${index}.excludes`}
render={({ field }) => {
const { value, onChange, ...rest } = field
const formatValue = value?.map((e) => ({ value: e, label: e }))
return (
<CreatableSelect
{...rest}
value={formatValue}
onChange={(values) => onChange(values.map((item) => item.value))}
inputId={`${type}.${index}.excludes`}
// options={[{ value: 'ddfd', label: 'fgg' }]}
// menuIsOpen={false}
isClearable={true}
placeholder={'add topic'}
isMulti={true}
components={{
DropdownIndicator: null,
}}
/>
)
}}
control={form.control}
/>
<FormErrorMessage>{errors[type]?.[index]?.filters?.message}</FormErrorMessage>
</FormControl>
{type === 'localSubscriptions' && (
<FormControl>
<FormLabel htmlFor={`${type}.${index}.excludes`}>
{t('bridge.subscription.excludes')}
</FormLabel>
<Controller
name={`${type}.${index}.excludes`}
render={({ field }) => {
const { value, onChange, ...rest } = field
const formatValue = value?.map((e) => ({ value: e, label: e }))
return (
<CreatableSelect
{...rest}
value={formatValue}
onChange={(values) => onChange(values.map((item) => item.value))}
inputId={`${type}.${index}.excludes`}
// options={[{ value: 'ddfd', label: 'fgg' }]}
// menuIsOpen={false}
isClearable={true}
placeholder={'add topic'}
isMulti={true}
components={{
DropdownIndicator: null,
}}
/>
)
}}
control={form.control}
/>
<FormErrorMessage>{errors[type]?.[index]?.filters?.message}</FormErrorMessage>
</FormControl>
)}

<FormControl>
<FormLabel htmlFor={`${type}.${index}.preserveRetain`}>
Expand Down

0 comments on commit 7bb30c4

Please sign in to comment.