Skip to content

Commit

Permalink
[DOP-17517] add HDFS Connection Show Transfer (#27)
Browse files Browse the repository at this point in the history
* [DOP-17517] add HDFS Connection Show Transfer
  • Loading branch information
dmitry-pedchenko authored Jun 25, 2024
1 parent 2c3e8d7 commit 334149d
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 64 deletions.
65 changes: 33 additions & 32 deletions src/entities/transfer/ui/show/fileSourceParamsShow.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { Card } from "@mui/material";
import {
RecordContextProvider,
SimpleShowLayout,
TextField,
} from "react-admin";
import TextField from "@mui/material/TextField";

const FileSourceParamsShow = ({
data,
Expand All @@ -17,34 +12,40 @@ const FileSourceParamsShow = ({
};
}) => {
const processedData = {
...data.source_params,
file_format: JSON.stringify(data.source_params.file_format),
...data,
source_params: {
...data.source_params,
file_format: JSON.stringify(data.source_params.file_format),
},
};
return (
<RecordContextProvider value={processedData}>
<div style={{ paddingTop: "1em" }}>
<SimpleShowLayout>
<Card>
<TextField
source={"directory_path"}
label={"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={"file_format"}
label={"File format"}
name={"file_format"}
/>
<TextField
source={"df_schema"}
label={"DF Schema"}
name={"df_schema"}
/>
</Card>
</SimpleShowLayout>
</div>
</RecordContextProvider>
<div style={{ display: "flex", flexDirection: "column" }}>
<TextField
InputProps={{ readOnly: true, disableUnderline: true }}
variant="standard"
style={{ width: "max-content" }}
label={"Directory path"}
name={"directory_path"}
value={processedData.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
InputProps={{ readOnly: true, disableUnderline: true }}
variant="standard"
style={{ width: "max-content" }}
label={"File format"}
name={"file_format"}
value={processedData.source_params.file_format}
/>
<TextField
InputProps={{ readOnly: true, disableUnderline: true }}
variant="standard"
style={{ width: "max-content" }}
label={"DF Schema"}
name={"df_schema"}
value={processedData.source_params.df_schema}
/>
</div>
);
};

Expand Down
65 changes: 33 additions & 32 deletions src/entities/transfer/ui/show/fileTargetParamsShow.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import { Card } from "@mui/material";
import {
RecordContextProvider,
SimpleShowLayout,
TextField,
} from "react-admin";
import TextField from "@mui/material/TextField";

const FileTargetParamsShow = ({
data,
Expand All @@ -17,34 +12,40 @@ const FileTargetParamsShow = ({
};
}) => {
const processedData = {
...data.target_params,
file_format: JSON.stringify(data.target_params.file_format),
...data,
target_params: {
...data.target_params,
file_format: JSON.stringify(data.target_params.file_format),
},
};
return (
<RecordContextProvider value={processedData}>
<div style={{ paddingTop: "1em" }}>
<SimpleShowLayout>
<Card>
<TextField
source={"directory_path"}
label={"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={"file_format"}
label={"File format"}
name={"file_format"}
/>
<TextField
source={"df_schema"}
label={"DF Schema"}
name={"df_schema"}
/>
</Card>
</SimpleShowLayout>
</div>
</RecordContextProvider>
<div style={{ display: "flex", flexDirection: "column" }}>
<TextField
InputProps={{ readOnly: true, disableUnderline: true }}
variant="standard"
style={{ width: "max-content" }}
label={"Directory path"}
name={"directory_path"}
value={processedData.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
InputProps={{ readOnly: true, disableUnderline: true }}
variant="standard"
style={{ width: "max-content" }}
label={"File format"}
name={"file_format"}
value={processedData.target_params.file_format}
/>
<TextField
InputProps={{ readOnly: true, disableUnderline: true }}
variant="standard"
style={{ width: "max-content" }}
label={"DF Schema"}
name={"df_schema"}
value={processedData.target_params.df_schema}
/>
</div>
);
};

Expand Down

0 comments on commit 334149d

Please sign in to comment.