Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 9ca2895

Browse files
committed
new columns adapated to changes
1 parent a62040f commit 9ca2895

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

dist/main.js

Lines changed: 7 additions & 6 deletions
Large diffs are not rendered by default.

src/components/Table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export function Table(initialState: TableDataType){
259259
key={`Draggable-${column.id}`}
260260
draggableId={`${column.id}`}
261261
index={index}
262-
isDragDisabled={!(column as any).accessor}
262+
isDragDisabled={(column as any).isMetadata}
263263
>
264264
{(provided, snapshot) => {
265265
return (

src/components/reducers/DatabaseDispatch.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,17 @@ export function databaseReducer(state:TableDataType, action:ActionType) {
207207
const leftIndex = state.columns.findIndex(
208208
(column) => column.id === action.columnId
209209
);
210-
const leftId = `${state.columns.length+1-state.metadataColumns.length}`;
210+
const leftId = state.columns.length+1-state.metadataColumns.length;
211211

212212
const newLeftColumn:DatabaseColumn={
213213
input: DataTypes.TEXT,
214-
accessor: leftId,
214+
accessor: `newColumn${leftId}`,
215215
key: `newColumn${leftId}`,
216-
label: `new Column ${leftId}`
216+
label: `new Column ${leftId}`,
217+
position: leftId
217218
};
218219
// Update configuration on disk
219-
state.diskConfig.addColumn(leftId, newLeftColumn);
220+
state.diskConfig.addColumn(`newColumn${leftId}`, newLeftColumn);
220221

221222
Promise.all(state.data.map(async (row:TableRow) => {
222223
updateRowFile(

styles.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,5 @@ html {
295295
max-width: 1000;
296296
margin-left: auto;
297297
margin-right: auto;
298-
overflow: auto;
299298
display: flex;
300299
}

0 commit comments

Comments
 (0)