Skip to content

Commit

Permalink
[DOP-17517] add HDFS Connection Show Transfer (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-pedchenko authored Jun 25, 2024
1 parent 9e17c4c commit 2c3e8d7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
16 changes: 7 additions & 9 deletions src/entities/transfer/ui/show/fileSourceParamsShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,28 @@ const FileSourceParamsShow = ({
}) => {
const processedData = {
...data.source_params,
source_params: {
file_format: JSON.stringify(data.source_params.file_format),
},
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"}
source={"directory_path"}
label={"Directory path"}
name={"source_params.directory_path"}
name={"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"}
source={"file_format"}
label={"File format"}
name={"source_params.file_format"}
name={"file_format"}
/>
<TextField
source={"source_params.df_schema"}
source={"df_schema"}
label={"DF Schema"}
name={"source_params.df_schema"}
name={"df_schema"}
/>
</Card>
</SimpleShowLayout>
Expand Down
16 changes: 7 additions & 9 deletions src/entities/transfer/ui/show/fileTargetParamsShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,28 @@ const FileTargetParamsShow = ({
}) => {
const processedData = {
...data.target_params,
target_params: {
file_format: JSON.stringify(data.target_params.file_format),
},
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"}
source={"directory_path"}
label={"Directory path"}
name={"target_params.directory_path"}
name={"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"}
source={"file_format"}
label={"File format"}
name={"target_params.file_format"}
name={"file_format"}
/>
<TextField
source={"target_params.df_schema"}
source={"df_schema"}
label={"DF Schema"}
name={"target_params.df_schema"}
name={"df_schema"}
/>
</Card>
</SimpleShowLayout>
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/transfer/ui/transferShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const TransferShow = () => {
label={"Target (schema.table)"}
/>
)}
{!dbTypes.includes(data.source_params.type) && (
{!dbTypes.includes(data.target_params.type) && (
<FileTargetParamsShow
// @ts-expect-error label is react-admin magic field
label={"Target params"}
Expand Down

0 comments on commit 2c3e8d7

Please sign in to comment.