Skip to content

Commit 78e03e2

Browse files
fix: sources / upload data (CSV Data) refactor (#3557)
1 parent 1711fd1 commit 78e03e2

File tree

4 files changed

+17
-13
lines changed

4 files changed

+17
-13
lines changed

src/writeData/components/FileUploadSection.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const FileUploadSection = () => {
4141
weight={FontWeight.Regular}
4242
style={{marginBottom: '24px'}}
4343
>
44-
Upload line protocol or Annotated CSVs with the click of a button
44+
Upload line protocol or Annotated CSVs
4545
</Heading>
4646
<SquareGrid cardSize="170px" gutter={ComponentSize.Small}>
4747
{items.map(item => (

src/writeData/components/WriteDataItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const LazySVG = React.lazy(() => import('src/perf/components/LazySVG'))
99

1010
// Utils
1111
import {getOrg} from 'src/organizations/selectors'
12+
import {event} from 'src/cloud/utils/reporting'
1213

1314
// Graphics
1415
import placeholderLogo from 'src/writeData/graphics/placeholderLogo.svg'
@@ -44,6 +45,7 @@ const WriteDataItem: FC<Props> = ({
4445
const org = useSelector(getOrg)
4546

4647
const handleClick = (): void => {
48+
event(`sources.load_data.${name}.clicked`)
4749
history.push(`/${ORGS}/${org.id}/load-data/${url}`)
4850
}
4951

src/writeData/components/fileUploads/UploadDataDetailsView.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,13 @@ const UploadDataDetailsView: FC = () => {
8787
className="write-data--details-content markdown-format"
8888
data-testid="load-data-details-content"
8989
>
90-
<Panel backgroundColor={InfluxColors.Grey15}>
91-
<Panel.Body size={ComponentSize.ExtraSmall}>
92-
<WriteDataHelperBuckets />
93-
</Panel.Body>
94-
</Panel>
90+
{name !== 'csv' ?? (
91+
<Panel backgroundColor={InfluxColors.Grey15}>
92+
<Panel.Body size={ComponentSize.ExtraSmall}>
93+
<WriteDataHelperBuckets />
94+
</Panel.Body>
95+
</Panel>
96+
)}
9597
<div className="write-data--uploader-wrapper">
9698
{!isNonannotatedCSV &&
9799
(isLP ? <LineProtocolTabs /> : <CsvMethod />)}

src/writeData/constants/contentFileUploads.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ export const WRITE_DATA_FILE_UPLOADS: FileUpload[] = [
2222
image: CSVLogo,
2323
markdown: AnnotatedCSVMarkdown,
2424
},
25-
{
26-
id: 'csv',
27-
name: 'CSV Data',
28-
image: CSVLogo,
29-
markdown: CSVMarkdown,
30-
},
3125
{
3226
id: 'lp',
3327
name: 'Line Protocol',
3428
image: LPLogo,
3529
markdown: LPMarkdown,
3630
},
31+
{
32+
id: 'csv',
33+
name: 'CSV Data (CLI)',
34+
image: CSVLogo,
35+
markdown: CSVMarkdown,
36+
},
3737
]
3838

3939
export const search = (term: string): FileUpload[] =>
4040
WRITE_DATA_FILE_UPLOADS.filter(item =>
4141
item.name.toLowerCase().includes(term.toLowerCase())
42-
).sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()))
42+
)

0 commit comments

Comments
 (0)