Skip to content

Commit

Permalink
feat: add CodeMirror-based formula editor with auto-complete and synt…
Browse files Browse the repository at this point in the history
…ax highlighting
  • Loading branch information
kswenson committed Oct 1, 2024
1 parent 55f14e3 commit 77fd0d4
Show file tree
Hide file tree
Showing 17 changed files with 1,845 additions and 27 deletions.
2 changes: 1 addition & 1 deletion v3/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
]
},
ignorePatterns: [
"dist/", "node_modules/"
"dist/", "node_modules/", "src/models/formula/lezer"
],
extends: [
"eslint:recommended",
Expand Down
4 changes: 4 additions & 0 deletions v3/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
"ccrte",
"Chakra",
"clsx",
"codemirror",
"colord",
"instanbul",
"keymap",
"keymaps",
"lezer",
"papaparse",
"portaling",
"ulid"
Expand Down
6 changes: 3 additions & 3 deletions v3/cypress/support/elements/table-tile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,19 +387,19 @@ export const TableTileElements = {
},
addFormulaInModal(attributeName: string, formula: string) {
cy.get("[data-testid=attr-name-input]").invoke("attr", "value").should("eq", attributeName)
cy.get("[data-testid=attr-formula-input]").type(formula, {force:true})
cy.get("[data-testid=formula-editor-input]").type(formula, {force:true})
cy.get("[data-testid=Apply-button]").click()
cy.get("[data-testid=attr-name-input]").should("not.exist")
},
clearFormulaInModal(attributeName: string) {
cy.get("[data-testid=attr-name-input]").invoke("attr", "value").should("eq", attributeName)
cy.get("[data-testid=attr-formula-input]").type(`{selectAll}{del}`)
cy.get("[data-testid=formula-editor-input]").type(`{selectAll}{del}`)
cy.get("[data-testid=Apply-button]").click()
cy.get("[data-testid=attr-name-input]").should("not.exist")
},
checkFormulaInModal(attributeName: string, formula: string) {
cy.get("[data-testid=attr-name-input]").invoke("attr", "value").should("eq", attributeName)
cy.get("[data-testid=attr-formula-input]").should("have.text", formula)
cy.get("[data-testid=formula-editor-input]").should("have.text", formula)
cy.get("[data-testid=Cancel-button]").click()
cy.get("[data-testid=attr-name-input]").should("not.exist")
},
Expand Down
Loading

0 comments on commit 77fd0d4

Please sign in to comment.