Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

182089941 log events #1378

Merged
merged 13 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
137 changes: 121 additions & 16 deletions v3/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@
"wait-on": "^7.2.0",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4"
"webpack-dev-server": "^5.0.4",
"xhr-mock": "^2.5.1"
},
"dependencies": {
"@chakra-ui/react": "^2.8.2",
Expand Down
4 changes: 3 additions & 1 deletion v3/src/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { kCodapAppElementId } from "./constants"
import { importV2Document } from "../v2/import-v2-document"
import { MenuBar, kMenuBarElementId } from "./menu-bar/menu-bar"
import { useCloudFileManager } from "../lib/use-cloud-file-manager"
import { Logger } from "../lib/logger"
import { appState } from "../models/app-state"
import { addDefaultComponents } from "../models/codap/add-default-content"
import {gDataBroker} from "../models/data/data-broker"
Expand Down Expand Up @@ -45,7 +46,7 @@ export const App = observer(function App() {
appState.document.content?.applyModelChange(() => {
sharedData = appState.document.content?.importDataSet(data, options)
}, {
notifications: dataContextCountChangedNotification,
notify: dataContextCountChangedNotification,
undoStringKey: "V3.Undo.import.data",
redoStringKey: "V3.Redo.import.data"
})
Expand Down Expand Up @@ -100,6 +101,7 @@ export const App = observer(function App() {
}
}
appState.enableUndoRedoMonitoring()
Logger.initializeLogger(appState.document)
}

initialize()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const CaseTableCardTitleBar =
data?.applyModelChange(() => {
data.setTitle(newTitle)
}, {
notifications: () => updateDataContextNotification(data),
notify: () => updateDataContextNotification(data),
undoStringKey: "DG.Undo.component.componentTitleChange",
redoStringKey: "DG.Redo.component.componentTitleChange"
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const AttributeMenuListComp = forwardRef<HTMLDivElement, IProps>(
caseMetadata?.applyModelChange(
() => caseMetadata?.setIsHidden(column.key, true),
{
notifications: hideAttributeNotification([column.key], data),
notify: hideAttributeNotification([column.key], data),
undoStringKey: "DG.Undo.caseTable.hideAttribute",
redoStringKey: "DG.Redo.caseTable.hideAttribute"
}
Expand All @@ -73,7 +73,7 @@ const AttributeMenuListComp = forwardRef<HTMLDivElement, IProps>(
data.applyModelChange(() => {
result = data.removeAttribute(attrId)
}, {
notifications: () => {
notify: () => {
const notifications = [removeAttributesNotification([attrId], data)]
if (result?.removedCollectionId) notifications.unshift(deleteCollectionNotification(data))
return notifications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const EditAttributePropertiesModal = ({ attributeId, isOpen, onClose }: I
attribute.setEditable(editable === "yes")
}
}, {
notifications: updateAttributesNotification([attribute], data),
notify: updateAttributesNotification([attribute], data),
undoStringKey: "DG.Undo.caseTable.editAttribute",
redoStringKey: "DG.Redo.caseTable.editAttribute"
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const EditFormulaModal = observer(function EditFormulaModal({ attributeId
attribute.setDisplayExpression(formula)
}, {
// TODO Should also broadcast notify component edit formula notification
notifications: [
notify: [
updateCasesNotification(dataSet),
updateAttributesNotification([attribute], dataSet)
],
Expand Down
4 changes: 2 additions & 2 deletions v3/src/components/case-table/case-table-tool-shelf-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const CaseTableToolShelfMenuList = observer(function CaseTableToolShelfMe
getFormulaManager(document)?.addDataSet(ds)
createTableOrCardForDataset(sharedData, caseMetadata, kCaseTableTileType, options)
}, {
notifications: dataContextCountChangedNotification,
notify: dataContextCountChangedNotification,
undoStringKey: "V3.Undo.caseTable.create",
redoStringKey: "V3.Redo.caseTable.create"
})
Expand Down Expand Up @@ -129,7 +129,7 @@ export const DeleteDataSetModal = ({dataSetId, isOpen, onClose, setModalOpen}: I
manager?.removeSharedModel(dataSetId)
getFormulaManager(document)?.removeDataSet(dataSetId)
}, {
notifications: [dataContextCountChangedNotification, dataContextDeletedNotification(data)],
notify: [dataContextCountChangedNotification, dataContextDeletedNotification(data)],
undoStringKey: "V3.Undo.caseTable.delete",
redoStringKey: "V3.Redo.caseTable.delete"
})
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/case-table/case-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const CaseTable = observer(function CaseTable({ setNodeRef }: IProps) {
}
removedOldCollection = !!(oldCollectionId && !dataSet.getCollection(oldCollectionId))
}, {
notifications: () => {
notify: () => {
const notifications: INotification[] = []
if (removedOldCollection) notifications.push(deleteCollectionNotification(dataSet))
if (collection) notifications.push(createCollectionNotification(collection, dataSet))
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/case-table/collection-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const CollectionTable = observer(function CollectionTable(props: IProps)
collectionTableModel?.setAttrIdToEdit(attribute.id)
}
}, {
notifications: () => createAttributesNotification(attribute ? [attribute] : [], data),
notify: () => createAttributesNotification(attribute ? [attribute] : [], data),
undoStringKey: "DG.Undo.caseTable.createAttribute",
redoStringKey: "DG.Redo.caseTable.createAttribute"
})
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/case-table/collection-title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const CollectionTitle = observer(function CollectionTitle({onAddNewAttrib
data?.applyModelChange(() => {
collection?.setName(newName)
}, {
notifications: collection?.name !== newName ? () => updateCollectionNotification(collection, data) : undefined,
notify: collection?.name !== newName ? () => updateCollectionNotification(collection, data) : undefined,
undoStringKey: "DG.Undo.caseTable.collectionNameChange",
redoStringKey: "DG.Redo.caseTable.collectionNameChange"
})
Expand Down
2 changes: 1 addition & 1 deletion v3/src/components/case-table/column-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const _ColumnHeader = observer(function _ColumnHeader({ column }: TRenderHeaderC
(aName: string) => (aName === column.name) || !data.attributes.find(attr => aName === attr.name)
))
}, {
notifications: () => {
notify: () => {
if (editingAttribute && editingAttribute?.name !== oldName) {
return updateAttributesNotification([editingAttribute], data)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const DatasetInfoModal = ({showInfoModal, setShowInfoModal}: IProps) => {
data.setDescription(description)
setShowInfoModal(false)
}, {
notifications: () => updateDataContextNotification(data)
notify: () => updateDataContextNotification(data)
})
}

Expand Down
Loading
Loading