forked from mage-ai/mage-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[jk] Data loader templates UI (mage-ai#658)
* [jk] Add FlyoutMenuWrapper component * [jk] Add data source type * [jk] Add BlockRequestPayloadType * [jk] Add data loader based on type of data source * [jk] Add constants * [jk] Hide text under menu * [jk] Fix type error
- Loading branch information
1 parent
2920b4d
commit e663c29
Showing
9 changed files
with
140 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export enum DataSourceTypeEnum { | ||
BIGQUERY = 'bigquery', | ||
FILE = 'file', | ||
POSTGRES = 'postgres', | ||
REDSHIFT = 'redshift', | ||
S3 = 's3', | ||
SNOWFLAKE = 'snowflake', | ||
} | ||
|
||
export const DATA_SOURCE_TYPE_HUMAN_READABLE_NAME_MAPPING = { | ||
[DataSourceTypeEnum.BIGQUERY]: 'Google BigQuery', | ||
[DataSourceTypeEnum.FILE]: 'Local file', | ||
[DataSourceTypeEnum.POSTGRES]: 'PostgreSQL', | ||
[DataSourceTypeEnum.REDSHIFT]: 'Amazon Redshift', | ||
[DataSourceTypeEnum.S3]: 'Amazon S3', | ||
[DataSourceTypeEnum.SNOWFLAKE]: 'Snowflake', | ||
}; | ||
|
||
export const DATA_SOURCE_TYPES: DataSourceTypeEnum[] = [ | ||
DataSourceTypeEnum.FILE, | ||
DataSourceTypeEnum.BIGQUERY, | ||
DataSourceTypeEnum.POSTGRES, | ||
DataSourceTypeEnum.REDSHIFT, | ||
DataSourceTypeEnum.S3, | ||
DataSourceTypeEnum.SNOWFLAKE, | ||
]; | ||
|
||
export default DataSourceTypeEnum; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
mage_ai/frontend/oracle/components/FlyoutMenu/FlyoutMenuWrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import ClickOutside from '@oracle/components/ClickOutside'; | ||
import FlyoutMenu, { FlyoutMenuProps } from './index'; | ||
|
||
type FlyoutMenuWrapperProps = { | ||
children: JSX.Element; | ||
onClickOutside: () => void; | ||
} & FlyoutMenuProps; | ||
|
||
function FlyoutMenuWrapper({ | ||
children, | ||
items, | ||
open, | ||
onClickOutside, | ||
parentRef, | ||
uuid, | ||
}: FlyoutMenuWrapperProps) { | ||
return ( | ||
<ClickOutside | ||
onClickOutside={onClickOutside} | ||
open | ||
> | ||
<div style={{ position: 'relative' }}> | ||
<div ref={parentRef}> | ||
{children} | ||
</div> | ||
<FlyoutMenu | ||
items={items} | ||
onClickCallback={onClickOutside} | ||
open={open} | ||
parentRef={parentRef} | ||
uuid={uuid} | ||
/> | ||
</div> | ||
</ClickOutside> | ||
); | ||
} | ||
|
||
export default FlyoutMenuWrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters