Skip to content

Commit fae70f2

Browse files
committed
feat(ui): upload dataset from csv
1 parent 0892ed4 commit fae70f2

13 files changed

+1381
-104
lines changed

weave-js/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"@testing-library/jest-dom": "6.4.5",
6464
"@testing-library/react": "11.2.3",
6565
"@testing-library/user-event": "14.4.3",
66+
"@types/papaparse": "^5.3.15",
6667
"@types/query-string": "^6.3.0",
6768
"@types/react-hook-mousetrap": "^2.0.2",
6869
"@types/react-syntax-highlighter": "^15.5.7",
@@ -97,6 +98,7 @@
9798
"numeral": "^2.0.6",
9899
"onchange": "^7.1.0",
99100
"pako": "^2.1.0",
101+
"papaparse": "^5.5.2",
100102
"pca-js": "^1.0.2",
101103
"plotly.js": "^2.23.2",
102104
"plotly.js-dist-min": "^2.6.3",

weave-js/src/components/PagePanelComponents/Home/Browse3/datasets/CellRenderers.tsx

+9-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ interface CellViewingRendererProps {
4444
isNew?: boolean;
4545
isEditing?: boolean;
4646
serverValue?: any;
47+
disableNewRowHighlight?: boolean;
4748
}
4849

4950
export const CellViewingRenderer: React.FC<
@@ -58,6 +59,7 @@ export const CellViewingRenderer: React.FC<
5859
id,
5960
field,
6061
serverValue,
62+
disableNewRowHighlight = false,
6163
}) => {
6264
const [isHovered, setIsHovered] = useState(false);
6365
const {setEditedRows, setAddedRows, setFieldEdited} = useDatasetEditContext();
@@ -98,7 +100,7 @@ export const CellViewingRenderer: React.FC<
98100
if (isEdited) {
99101
return CELL_COLORS.EDITED;
100102
}
101-
if (isNew) {
103+
if (isNew && !disableNewRowHighlight) {
102104
return CELL_COLORS.NEW;
103105
}
104106
return CELL_COLORS.TRANSPARENT;
@@ -636,6 +638,7 @@ export interface ControlCellProps {
636638
isDeleted: boolean;
637639
isNew: boolean;
638640
hideRemoveForAddedRows?: boolean;
641+
disableNewRowHighlight?: boolean;
639642
}
640643

641644
export const ControlCell: React.FC<ControlCellProps> = ({
@@ -646,6 +649,7 @@ export const ControlCell: React.FC<ControlCellProps> = ({
646649
isDeleted,
647650
isNew,
648651
hideRemoveForAddedRows,
652+
disableNewRowHighlight = false,
649653
}) => {
650654
const rowId = params.id as string;
651655
const rowIndex = params.row.___weave?.index;
@@ -660,7 +664,9 @@ export const ControlCell: React.FC<ControlCellProps> = ({
660664
justifyContent: 'center',
661665
height: '100%',
662666
width: '100%',
663-
backgroundColor: CELL_COLORS.NEW,
667+
backgroundColor: disableNewRowHighlight
668+
? CELL_COLORS.TRANSPARENT
669+
: CELL_COLORS.NEW,
664670
}}
665671
/>
666672
);
@@ -676,7 +682,7 @@ export const ControlCell: React.FC<ControlCellProps> = ({
676682
width: '100%',
677683
backgroundColor: isDeleted
678684
? CELL_COLORS.DELETED
679-
: isNew
685+
: isNew && !disableNewRowHighlight
680686
? CELL_COLORS.NEW
681687
: CELL_COLORS.TRANSPARENT,
682688
opacity: isDeleted ? DELETED_CELL_STYLES.opacity : 1,

0 commit comments

Comments
 (0)