diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/collections/CollectionNoteTakingView.tsx | 23 | ||||
-rw-r--r-- | src/client/views/collections/CollectionNoteTakingViewColumn.tsx | 1 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/client/views/collections/CollectionNoteTakingView.tsx b/src/client/views/collections/CollectionNoteTakingView.tsx index 5c8b10ae1..96db23142 100644 --- a/src/client/views/collections/CollectionNoteTakingView.tsx +++ b/src/client/views/collections/CollectionNoteTakingView.tsx @@ -110,7 +110,6 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti super(props); if (this.columnHeaders === undefined) { this.dataDoc.columnHeaders = new List<SchemaHeaderField>([new SchemaHeaderField('New Column')]); - // add all of the docs that have not been added to a column to this new column } } @@ -502,6 +501,27 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti return true; } + // Used in CollectionNoteTakingView to delete a column when the user clicks the delete button + // @action + // @undoBatch + // deleteColumn = (headingObject: SchemaHeaderField | undefined, docList: Doc[]) => { + // if (!this.columnHeaders) { + // return + // } + // if (headingObject) { + // const index = this.columnHeaders.indexOf(headingObject); + // const newIndex = index == 0 ? 1 : index - 1 + // const newHeader = this.columnHeaders[newIndex]; + // docList.forEach(d => d[this.pivotField] = newHeader.heading.toString()) + // // this.props.columnHeaders.splice(index, 1); + // const newHeaders = this.columnHeaders; + // newHeaders.splice(index, 1); + // const test = this.layoutDoc._columnHeaders; + // this.columnHeaders = newHeaders; + // this.resizeColumns(newHeaders.length) + // } + // } + // when dropping outside of the current noteTaking context (like a new tab, freeform view, etc...) onExternalDrop = async (e: React.DragEvent): Promise<void> => { const targInd = this.docsDraggedRowCol?.[0] || 0; @@ -589,6 +609,7 @@ export class CollectionNoteTakingView extends CollectionSubView<Partial<collecti // called when adding a new columnHeader @undoBatch @action + @undoBatch addGroup = (value: string) => { const columnHeaders = Cast(this.props.Document.columnHeaders, listSpec(SchemaHeaderField), null); return value && columnHeaders?.push(new SchemaHeaderField(value)) ? true : false; diff --git a/src/client/views/collections/CollectionNoteTakingViewColumn.tsx b/src/client/views/collections/CollectionNoteTakingViewColumn.tsx index 624beca96..4286da2e2 100644 --- a/src/client/views/collections/CollectionNoteTakingViewColumn.tsx +++ b/src/client/views/collections/CollectionNoteTakingViewColumn.tsx @@ -148,6 +148,7 @@ export class CollectionNoteTakingViewColumn extends React.Component<CSVFieldColu @undoBatch @action + @undoBatch deleteColumn = () => { const columnHeaders = Cast(this.props.Document.columnHeaders, listSpec(SchemaHeaderField), null); if (columnHeaders && this.props.headingObject) { |