Skip to content

Commit d4bafbb

Browse files
committed
feat(ui): upload dataset from csv
1 parent 4bab296 commit d4bafbb

File tree

10 files changed

+1083
-108
lines changed

10 files changed

+1083
-108
lines changed

Diff for: weave-js/src/components/PagePanelComponents/Home/Browse3/datasets/AddToDatasetDrawer.tsx

-4
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ export const AddToDatasetDrawerInner: React.FC<AddToDatasetDrawerProps> = ({
8585
const objCreate = useObjCreate();
8686
const tableCreate = useTableCreate();
8787

88-
// Access edit context methods through the drawer context's editorContext property
8988
const {getRowsNoMeta, convertEditsToTableUpdateSpec, resetEditState} =
9089
editorContext;
9190

92-
// Fetch datasets on component mount
9391
const objectVersions = useRootObjectVersions(
9492
entity,
9593
project,
@@ -100,7 +98,6 @@ export const AddToDatasetDrawerInner: React.FC<AddToDatasetDrawerProps> = ({
10098
true
10199
);
102100

103-
// Update datasets when data is loaded
104101
useEffect(() => {
105102
if (objectVersions.result) {
106103
dispatch({
@@ -110,7 +107,6 @@ export const AddToDatasetDrawerInner: React.FC<AddToDatasetDrawerProps> = ({
110107
}
111108
}, [objectVersions.result, dispatch]);
112109

113-
// Extract source schema from selected calls
114110
useEffect(() => {
115111
if (selectedCalls.length > 0) {
116112
const extractedSchema = extractSourceSchema(selectedCalls);

Diff for: 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} = useDatasetEditContext();
@@ -94,7 +96,7 @@ export const CellViewingRenderer: React.FC<
9496
if (isEdited) {
9597
return CELL_COLORS.EDITED;
9698
}
97-
if (isNew) {
99+
if (isNew && !disableNewRowHighlight) {
98100
return CELL_COLORS.NEW;
99101
}
100102
return CELL_COLORS.TRANSPARENT;
@@ -597,6 +599,7 @@ export interface ControlCellProps {
597599
isDeleted: boolean;
598600
isNew: boolean;
599601
hideRemoveForAddedRows?: boolean;
602+
disableNewRowHighlight?: boolean;
600603
}
601604

602605
export const ControlCell: React.FC<ControlCellProps> = ({
@@ -607,6 +610,7 @@ export const ControlCell: React.FC<ControlCellProps> = ({
607610
isDeleted,
608611
isNew,
609612
hideRemoveForAddedRows,
613+
disableNewRowHighlight = false,
610614
}) => {
611615
const rowId = params.id as string;
612616
const rowIndex = params.row.___weave?.index;
@@ -621,7 +625,9 @@ export const ControlCell: React.FC<ControlCellProps> = ({
621625
justifyContent: 'center',
622626
height: '100%',
623627
width: '100%',
624-
backgroundColor: CELL_COLORS.NEW,
628+
backgroundColor: disableNewRowHighlight
629+
? CELL_COLORS.TRANSPARENT
630+
: CELL_COLORS.NEW,
625631
}}
626632
/>
627633
);
@@ -637,7 +643,7 @@ export const ControlCell: React.FC<ControlCellProps> = ({
637643
width: '100%',
638644
backgroundColor: isDeleted
639645
? CELL_COLORS.DELETED
640-
: isNew
646+
: isNew && !disableNewRowHighlight
641647
? CELL_COLORS.NEW
642648
: CELL_COLORS.TRANSPARENT,
643649
opacity: isDeleted ? DELETED_CELL_STYLES.opacity : 1,

0 commit comments

Comments
 (0)