Skip to content

Commit 06fbda7

Browse files
Adding column modal to importer
Variable changing in scss file
1 parent 8c522a8 commit 06fbda7

File tree

6 files changed

+131
-9
lines changed

6 files changed

+131
-9
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Licensed to Cloudera, Inc. under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. Cloudera, Inc. licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
@use 'variables' as vars;
18+
19+
.antd.cuix {
20+
.hue-importer-columnmodal {
21+
padding: vars.$fluidx-spacing-s;
22+
}
23+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Licensed to Cloudera, Inc. under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. Cloudera, Inc. licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
import React, { useState } from 'react';
18+
import { i18nReact } from '../../../../utils/i18nReact';
19+
import ConfigureIcon from '@cloudera/cuix-core/icons/react/ConfigureIcon';
20+
import ColumnModalTable from './ColumnModalTable';
21+
import '../SourceConfiguration/SourceConfiguration.scss';
22+
23+
const ColumnModal = (): JSX.Element => {
24+
const { t } = i18nReact.useTranslation();
25+
const [isOpen, setIsOpen] = useState(false);
26+
27+
const handleClose = () => {
28+
setIsOpen(false);
29+
};
30+
31+
return (
32+
<div className="hue-importer-columnmodal">
33+
<summary className="hue-importer-columnmodal__button" onClick={() => setIsOpen(true)}>
34+
<ConfigureIcon />
35+
{t('Edit Columns')}
36+
</summary>
37+
<ColumnModalTable isOpen={isOpen} closeModal={handleClose} />
38+
</div>
39+
);
40+
};
41+
42+
export default ColumnModal;
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Licensed to Cloudera, Inc. under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. Cloudera, Inc. licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing, software
12+
// distributed under the License is distributed on an "AS IS" BASIS,
13+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
// See the License for the specific language governing permissions and
15+
// limitations under the License.
16+
17+
import React from 'react';
18+
import { i18nReact } from '../../../../utils/i18nReact';
19+
import Button from 'cuix/dist/components/Button';
20+
import Modal from 'cuix/dist/components/Modal';
21+
import './ColumnModal.scss';
22+
23+
interface ColumnModalTableProps {
24+
isOpen: boolean;
25+
closeModal: () => void;
26+
}
27+
28+
const ColumnModalTable = ({ isOpen, closeModal }: ColumnModalTableProps): JSX.Element => {
29+
const { t } = i18nReact.useTranslation();
30+
31+
return (
32+
<Modal
33+
title={t('Edit Column')}
34+
open={isOpen}
35+
onCancel={closeModal}
36+
footer={[
37+
<Button key="back" onClick={closeModal}>
38+
{t('Cancel')}
39+
</Button>,
40+
<Button key="submit" onClick={closeModal}>
41+
{t('Done')}
42+
</Button>
43+
]}
44+
></Modal>
45+
);
46+
};
47+
48+
export default ColumnModalTable;

desktop/core/src/desktop/js/apps/newimporter/ImporterFilePreview/ImporterFilePreview.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,10 @@
6161
flex: 1;
6262
background-color: white;
6363
}
64+
65+
&__header-section {
66+
display: flex;
67+
justify-content: space-between;
68+
}
6469
}
6570
}

desktop/core/src/desktop/js/apps/newimporter/ImporterFilePreview/ImporterFilePreview.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { GUESS_FORMAT_URL, GUESS_FIELD_TYPES_URL } from '../api';
3030
import SourceConfiguration from './SourceConfiguration/SourceConfiguration';
3131

3232
import './ImporterFilePreview.scss';
33+
import ColumnModal from './ColumnModal/ColumnModal';
3334

3435
interface ImporterFilePreviewProps {
3536
fileMetaData: FileMetaData;
@@ -98,7 +99,10 @@ const ImporterFilePreview = ({ fileMetaData }: ImporterFilePreviewProps): JSX.El
9899
</div>
99100
<div className="hue-importer-preview-page__metadata">{t('DESTINATION')}</div>
100101
<div className="hue-importer-preview-page__main-section">
101-
<SourceConfiguration fileFormat={fileFormat} setFileFormat={setFileFormat} />
102+
<div className="hue-importer-preview-page__header-section">
103+
<SourceConfiguration fileFormat={fileFormat} setFileFormat={setFileFormat} />
104+
<ColumnModal />
105+
</div>
102106
<PaginatedTable<ImporterTableData>
103107
loading={guessingFormat || guessingFields}
104108
data={tableData}

desktop/core/src/desktop/js/apps/newimporter/ImporterFilePreview/SourceConfiguration/SourceConfiguration.scss

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020
.hue-importer-configuration {
2121
padding: 16px;
2222

23-
&__summary {
23+
&__dropdown {
24+
border: 1px solid vars.$fluidx-gray-600;
25+
border-radius: vars.$border-radius-base;
26+
width: 100%;
27+
}
28+
}
29+
30+
.hue-importer-configuration__summary, .hue-importer-columnmodal__button {
2431
display: flex;
2532
gap: 8px;
2633
width: max-content;
@@ -29,13 +36,6 @@
2936
cursor: pointer;
3037
}
3138

32-
&__dropdown {
33-
border: 1px solid vars.$fluidx-gray-600;
34-
border-radius: vars.$border-radius-base;
35-
width: 100%;
36-
}
37-
}
38-
3939
.hue-importer-configuration-options {
4040
padding-top: 16px;
4141
display: grid;

0 commit comments

Comments
 (0)