Skip to content

Commit

Permalink
add view options to join dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
EDsCODE committed Mar 15, 2024
1 parent 5209274 commit befd30f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions frontend/src/scenes/data-warehouse/viewLinkLogic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,9 @@ export const viewLinkLogic = kea<viewLinkLogicType>([
},
],
selectedSourceTable: [
(s) => [s.selectedSourceTableName, s.tables],
(selectedSourceTableName, tables) => tables.find((row) => row.name === selectedSourceTableName),
(s) => [s.selectedSourceTableName, s.tables, s.savedQueries],
(selectedSourceTableName, tables, savedQueries) =>
[...tables, ...savedQueries].find((row) => row.name === selectedSourceTableName),
],
selectedJoiningTable: [
(s) => [s.selectedJoiningTableName, s.tables],
Expand All @@ -234,12 +235,17 @@ export const viewLinkLogic = kea<viewLinkLogicType>([
},
],
tableOptions: [
(s) => [s.tables],
(tables) =>
tables.map((table) => ({
(s) => [s.tables, s.savedQueries],
(tables, savedQueries) => [
...tables.map((table) => ({
value: table.name,
label: table.name,
})),
...savedQueries.map((query) => ({
value: query.name,
label: query.name,
})),
],
],
sourceTableKeys: [
(s) => [s.selectedSourceTable],
Expand Down

0 comments on commit befd30f

Please sign in to comment.