Skip to content

Commit

Permalink
fix(entities-routes): invisible expressions editor sometimes (#1814)
Browse files Browse the repository at this point in the history
* fix(entities-routes): invisible expressions editor sometimes

* fix: use watch instead of the implicit reactivity
  • Loading branch information
sumimakito authored Nov 26, 2024
1 parent 408f53c commit 89e091a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ const state = reactive<RouteState<BaseRouteStateFields>>({
tags: '',
service_id: '',
...{
...(!props.routeId && { paths: [''] }),
...(!props.routeId && { paths: [''] }), // We don't expect this prop to be updated throughout the lifecycle of the component
regex_priority: 0,
path_handling: 'v0',
} as TraditionalRouteStateFields,
Expand All @@ -673,6 +673,10 @@ const state = reactive<RouteState<BaseRouteStateFields>>({
errorMessage: '',
})
watch(() => props.routeFlavors, (routeFlavors) => {
state.routeFlavors = routeFlavors
})
const exprEditorProtocol = computed(() => state.fields.protocols.split(',')[0])
const customMethods = ref<string[]>([''])
Expand Down
2 changes: 1 addition & 1 deletion packages/entities/entities-routes/src/types/route-form.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { BaseFormConfig, KongManagerBaseFormConfig, KonnectBaseFormConfig } from '@kong-ui-public/entities-shared'
import type { RouteLocationRaw } from 'vue-router'
import type { Methods, Method } from './method-badge'
import type { Method, Methods } from './method-badge'

export enum RouteFlavor {
TRADITIONAL = 'traditional', // includes traditional_compatible
Expand Down

0 comments on commit 89e091a

Please sign in to comment.