Skip to content

Commit

Permalink
feat(ui): upload dataset from csv
Browse files Browse the repository at this point in the history
  • Loading branch information
bcsherma committed Mar 4, 2025
1 parent 72ebfc6 commit 4682504
Show file tree
Hide file tree
Showing 13 changed files with 1,375 additions and 104 deletions.
2 changes: 2 additions & 0 deletions weave-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
"@testing-library/jest-dom": "6.4.5",
"@testing-library/react": "11.2.3",
"@testing-library/user-event": "14.4.3",
"@types/papaparse": "^5.3.15",
"@types/query-string": "^6.3.0",
"@types/react-hook-mousetrap": "^2.0.2",
"@types/react-syntax-highlighter": "^15.5.7",
Expand Down Expand Up @@ -97,6 +98,7 @@
"numeral": "^2.0.6",
"onchange": "^7.1.0",
"pako": "^2.1.0",
"papaparse": "^5.5.2",
"pca-js": "^1.0.2",
"plotly.js": "^2.23.2",
"plotly.js-dist-min": "^2.6.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ interface CellViewingRendererProps {
isNew?: boolean;
isEditing?: boolean;
serverValue?: any;
disableNewRowHighlight?: boolean;
}

export const CellViewingRenderer: React.FC<
Expand All @@ -58,6 +59,7 @@ export const CellViewingRenderer: React.FC<
id,
field,
serverValue,
disableNewRowHighlight = false,
}) => {
const [isHovered, setIsHovered] = useState(false);
const {setEditedRows, setAddedRows, setFieldEdited} = useDatasetEditContext();
Expand Down Expand Up @@ -98,7 +100,7 @@ export const CellViewingRenderer: React.FC<
if (isEdited) {
return CELL_COLORS.EDITED;
}
if (isNew) {
if (isNew && !disableNewRowHighlight) {
return CELL_COLORS.NEW;
}
return CELL_COLORS.TRANSPARENT;
Expand Down Expand Up @@ -636,6 +638,7 @@ export interface ControlCellProps {
isDeleted: boolean;
isNew: boolean;
hideRemoveForAddedRows?: boolean;
disableNewRowHighlight?: boolean;
}

export const ControlCell: React.FC<ControlCellProps> = ({
Expand All @@ -646,6 +649,7 @@ export const ControlCell: React.FC<ControlCellProps> = ({
isDeleted,
isNew,
hideRemoveForAddedRows,
disableNewRowHighlight = false,
}) => {
const rowId = params.id as string;
const rowIndex = params.row.___weave?.index;
Expand All @@ -660,7 +664,9 @@ export const ControlCell: React.FC<ControlCellProps> = ({
justifyContent: 'center',
height: '100%',
width: '100%',
backgroundColor: CELL_COLORS.NEW,
backgroundColor: disableNewRowHighlight
? CELL_COLORS.TRANSPARENT
: CELL_COLORS.NEW,
}}
/>
);
Expand All @@ -676,7 +682,7 @@ export const ControlCell: React.FC<ControlCellProps> = ({
width: '100%',
backgroundColor: isDeleted
? CELL_COLORS.DELETED
: isNew
: isNew && !disableNewRowHighlight
? CELL_COLORS.NEW
: CELL_COLORS.TRANSPARENT,
opacity: isDeleted ? DELETED_CELL_STYLES.opacity : 1,
Expand Down
Loading

0 comments on commit 4682504

Please sign in to comment.