Skip to content

Commit 0432182

Browse files
authored
fix: region issues (#3995)
1 parent fe01636 commit 0432182

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

src/flows/components/AddButtons.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ interface Props {
2525
}
2626

2727
const SUPPORTED_FAMILIES = [
28+
{
29+
name: 'Query Context',
30+
family: 'context',
31+
},
2832
{
2933
name: 'Data Source',
3034
family: 'inputs',

src/flows/context/flow.query.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,24 +146,21 @@ export const FlowQueryProvider: FC = ({children}) => {
146146
}
147147

148148
if (typeof PIPE_DEFINITIONS[panel.type].scope === 'function') {
149-
meta.scope = PIPE_DEFINITIONS[panel.type].scope(
150-
panel,
151-
acc[acc.length - 1]?.scope || {}
152-
)
149+
meta.scope = PIPE_DEFINITIONS[panel.type].scope(panel, last.scope)
153150
}
154151

155152
if (typeof PIPE_DEFINITIONS[panel.type].source === 'function') {
156153
meta.source = PIPE_DEFINITIONS[panel.type].source(
157154
panel,
158-
'' + (acc[acc.length - 1]?.source || ''),
155+
'' + last.source,
159156
meta.scope
160157
)
161158
}
162159

163160
if (typeof PIPE_DEFINITIONS[panel.type].visual === 'function') {
164161
meta.visual = PIPE_DEFINITIONS[panel.type].visual(
165162
panel,
166-
'' + (acc[acc.length - 1]?.source || ''),
163+
'' + last.source,
167164
meta.scope
168165
)
169166
}

src/flows/pipes/Region/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import ReadOnly from './readOnly'
44
export default register => {
55
register({
66
type: 'region',
7-
family: 'inputs',
7+
family: 'context',
88
component: View,
99
featureFlag: 'flow-panel--remote',
1010
button: 'Remote Database',

src/flows/pipes/Time/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import View from './view'
33
export default register => {
44
register({
55
type: 'time',
6-
family: 'inputs',
6+
family: 'context',
77
featureFlag: 'flow-panel--time',
88
button: 'Time Range',
99
component: View,

src/types/flows.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ export interface QueryScope {
151151
export interface TypeRegistration {
152152
type: string // a unique string that identifies a pipe
153153
family:
154+
| 'context'
154155
| 'inputs'
155156
| 'passThrough'
156157
| 'test'

0 commit comments

Comments
 (0)