-
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.
[DOP-17517] add HDFS Connection Show Transfer (#24)
- Loading branch information
1 parent
a716422
commit 9e17c4c
Showing
13 changed files
with
261 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { PasswordInput, required, TextInput } from "react-admin"; | ||
|
||
const HDFSCreateForm = () => { | ||
return ( | ||
<> | ||
<TextInput | ||
name={"connection_data.cluster"} | ||
source="connection_data.cluster" | ||
label={"Cluster"} | ||
validate={required()} | ||
/> | ||
<TextInput | ||
name={"auth_data.user"} | ||
source="auth_data.user" | ||
label={"User"} | ||
validate={required()} | ||
/> | ||
<PasswordInput | ||
name={"auth_data.password"} | ||
source="auth_data.password" | ||
label={"Password"} | ||
validate={required()} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default HDFSCreateForm; |
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,25 @@ | ||
import { PasswordInput, TextInput } from "react-admin"; | ||
|
||
const HDFSEditForm = () => { | ||
return ( | ||
<> | ||
<TextInput | ||
name={"connection_data.cluster"} | ||
source="connection_data.cluster" | ||
label={"Cluster"} | ||
/> | ||
<TextInput | ||
source="auth_data.user" | ||
label={"User"} | ||
name={"auth_data.user"} | ||
/> | ||
<PasswordInput | ||
source="auth_data.password" | ||
name={"auth_data.password"} | ||
label={"Password"} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default HDFSEditForm; |
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,29 @@ | ||
import BaseConnectionShow from "@entities/connection/show/baseShow"; | ||
|
||
import { ConnectionData } from "@widgets/connection/types"; | ||
|
||
const HDFSConnectionShow = ({ | ||
data, | ||
editable = true, | ||
showTitle = true, | ||
}: { | ||
data: ConnectionData; | ||
editable?: boolean; | ||
showTitle?: boolean; | ||
}) => { | ||
return ( | ||
<BaseConnectionShow | ||
data={data} | ||
connectionColumns={[ | ||
{ | ||
source: "connection_data.cluster", | ||
label: "Cluster", | ||
}, | ||
]} | ||
editable={editable} | ||
showTitle={showTitle} | ||
/> | ||
); | ||
}; | ||
|
||
export default HDFSConnectionShow; |
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,53 @@ | ||
import { Card } from "@mui/material"; | ||
import { | ||
RecordContextProvider, | ||
SimpleShowLayout, | ||
TextField, | ||
} from "react-admin"; | ||
|
||
const FileSourceParamsShow = ({ | ||
data, | ||
}: { | ||
data: { | ||
source_params: { | ||
directory_path: string; | ||
file_format: object; | ||
df_schema: string; | ||
}; | ||
}; | ||
}) => { | ||
const processedData = { | ||
...data.source_params, | ||
source_params: { | ||
file_format: JSON.stringify(data.source_params.file_format), | ||
}, | ||
}; | ||
return ( | ||
<RecordContextProvider value={processedData}> | ||
<div style={{ paddingTop: "1em" }}> | ||
<SimpleShowLayout> | ||
<Card> | ||
<TextField | ||
source={"source_params.directory_path"} | ||
label={"Directory path"} | ||
name={"source_params.directory_path"} | ||
/> | ||
{/* TODO: the field with file_format is complex - there must be a type (drop-down list, like connection types), plus child fields (delimiter, quote, header, etc.) */} | ||
<TextField | ||
source={"source_params.file_format"} | ||
label={"File format"} | ||
name={"source_params.file_format"} | ||
/> | ||
<TextField | ||
source={"source_params.df_schema"} | ||
label={"DF Schema"} | ||
name={"source_params.df_schema"} | ||
/> | ||
</Card> | ||
</SimpleShowLayout> | ||
</div> | ||
</RecordContextProvider> | ||
); | ||
}; | ||
|
||
export default FileSourceParamsShow; |
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,53 @@ | ||
import { Card } from "@mui/material"; | ||
import { | ||
RecordContextProvider, | ||
SimpleShowLayout, | ||
TextField, | ||
} from "react-admin"; | ||
|
||
const FileTargetParamsShow = ({ | ||
data, | ||
}: { | ||
data: { | ||
target_params: { | ||
directory_path: string; | ||
file_format: object; | ||
df_schema: string; | ||
}; | ||
}; | ||
}) => { | ||
const processedData = { | ||
...data.target_params, | ||
target_params: { | ||
file_format: JSON.stringify(data.target_params.file_format), | ||
}, | ||
}; | ||
return ( | ||
<RecordContextProvider value={processedData}> | ||
<div style={{ paddingTop: "1em" }}> | ||
<SimpleShowLayout> | ||
<Card> | ||
<TextField | ||
source={"target_params.directory_path"} | ||
label={"Directory path"} | ||
name={"target_params.directory_path"} | ||
/> | ||
{/* TODO: the field with file_format is complex - there must be a type (drop-down list, like connection types), plus child fields (delimiter, quote, header, etc.) */} | ||
<TextField | ||
source={"target_params.file_format"} | ||
label={"File format"} | ||
name={"target_params.file_format"} | ||
/> | ||
<TextField | ||
source={"target_params.df_schema"} | ||
label={"DF Schema"} | ||
name={"target_params.df_schema"} | ||
/> | ||
</Card> | ||
</SimpleShowLayout> | ||
</div> | ||
</RecordContextProvider> | ||
); | ||
}; | ||
|
||
export default FileTargetParamsShow; |
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
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