Skip to content

Commit

Permalink
Merge branch 'main' into refactor-header
Browse files Browse the repository at this point in the history
  • Loading branch information
mattseddon authored Aug 3, 2023
2 parents c9ca557 + 108f11b commit 0793303
Show file tree
Hide file tree
Showing 7 changed files with 421 additions and 387 deletions.
14 changes: 7 additions & 7 deletions extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1728,18 +1728,18 @@
"@types/vega": "3.2.0",
"@types/vscode": "1.64.0",
"@vscode/test-electron": "2.3.3",
"@vscode/vsce": "2.19.0",
"@wdio/cli": "8.13.12",
"@wdio/local-runner": "8.13.12",
"@wdio/mocha-framework": "8.12.1",
"@vscode/vsce": "2.20.0",
"@wdio/cli": "8.13.13",
"@wdio/local-runner": "8.13.13",
"@wdio/mocha-framework": "8.13.13",
"@wdio/spec-reporter": "8.12.2",
"chai": "4.3.7",
"chai-as-promised": "7.1.1",
"clean-webpack-plugin": "4.0.0",
"copy-webpack-plugin": "11.0.0",
"fork-ts-checker-webpack-plugin": "8.0.0",
"jest": "29.6.1",
"jest-environment-node": "29.6.1",
"jest": "29.6.2",
"jest-environment-node": "29.6.2",
"lint-staged": "13.2.3",
"mocha": "10.2.0",
"mock-require": "3.0.3",
Expand All @@ -1749,7 +1749,7 @@
"ts-loader": "9.4.4",
"vscode-uri": "3.0.7",
"wdio-vscode-service": "5.2.1",
"webdriverio": "8.13.12",
"webdriverio": "8.13.13",
"webpack": "5.88.2",
"webpack-cli": "5.1.4"
},
Expand Down
69 changes: 44 additions & 25 deletions extension/src/plots/paths/collect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,10 @@ const collectType = (plots: Plot[]) => {
? type.add(PathType.TEMPLATE_MULTI)
: type.add(PathType.TEMPLATE_SINGLE)
}

return type
}

const getType = (
data: PlotsData,
hasChildren: boolean,
path: string
): Set<PathType> | undefined => {
if (hasChildren) {
return
}

const getType = (data: PlotsData, path: string): Set<PathType> | undefined => {
const plots = data[path]
if (!definedAndNonEmpty(plots)) {
return
Expand Down Expand Up @@ -118,6 +109,46 @@ const collectPathRevisions = (data: PlotsData, path: string): Set<string> => {
return revisions
}

const collectPlotPathType = (
plotPath: PlotPath,
data: PlotsData,
hasChildren: boolean,
path: string
) => {
if (hasChildren) {
return
}

const type = getType(data, path)

if (type) {
plotPath.type = type
}
}

const updateExistingPlotPath = (
acc: PlotPath[],
data: PlotsData,
hasChildren: boolean,
revisions: Set<string>,
path: string
) =>
acc.map(existing => {
const plotPath = { ...existing }

if (existing.path !== path) {
return plotPath
}

plotPath.revisions = new Set([...existing.revisions, ...revisions])

if (!plotPath.type) {
collectPlotPathType(plotPath, data, hasChildren, path)
}

return plotPath
})

const collectOrderedPath = (
acc: PlotPath[],
data: PlotsData,
Expand All @@ -126,31 +157,20 @@ const collectOrderedPath = (
idx: number
): PlotPath[] => {
const path = getPath(pathArray, idx)
const hasChildren = idx !== pathArray.length

if (acc.some(({ path: existingPath }) => existingPath === path)) {
return acc.map(existing =>
existing.path === path
? {
...existing,
revisions: new Set([...existing.revisions, ...revisions])
}
: existing
)
return updateExistingPlotPath(acc, data, hasChildren, revisions, path)
}

const hasChildren = idx !== pathArray.length

const plotPath: PlotPath = {
hasChildren,
parentPath: getParent(pathArray, idx),
path,
revisions
}

const type = getType(data, hasChildren, path)
if (type) {
plotPath.type = type
}
collectPlotPathType(plotPath, data, hasChildren, path)

acc.push(plotPath)
return acc
Expand Down Expand Up @@ -228,7 +248,6 @@ export const collectPaths = (
if (errors?.length) {
acc = collectErrorPaths(acc, data, errors)
}

return acc
}

Expand Down
4 changes: 2 additions & 2 deletions languageServer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
"fork-ts-checker-webpack-plugin": "8.0.0",
"ts-loader": "9.4.4",
"lint-staged": "13.2.3",
"jest": "29.6.1",
"jest": "29.6.2",
"webpack": "5.88.2",
"webpack-cli": "5.1.4",
"jest-environment-node": "29.6.1"
"jest-environment-node": "29.6.2"
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@typescript-eslint/parser": "6.2.0",
"@vscode/codicons": "0.0.33",
"eslint": "8.45.0",
"eslint-config-prettier": "8.8.0",
"eslint-config-prettier": "8.9.0",
"eslint-config-prettier-standard": "4.0.1",
"eslint-config-standard": "17.1.0",
"eslint-plugin-check-file": "2.5.0",
Expand All @@ -57,7 +57,7 @@
"eslint-plugin-testing-library": "5.11.0",
"eslint-plugin-unicorn": "48.0.1",
"husky": "8.0.3",
"jest": "29.6.1",
"jest": "29.6.2",
"lint-staged": "13.2.3",
"npm-run-all": "4.1.5",
"nyc": "15.1.0",
Expand Down
4 changes: 2 additions & 2 deletions webview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@
"file-loader": "6.2.0",
"fork-ts-checker-webpack-plugin": "8.0.0",
"identity-obj-proxy": "3.0.0",
"jest": "29.6.1",
"jest": "29.6.2",
"jest-canvas-mock": "2.5.2",
"jest-environment-jsdom": "29.6.1",
"jest-environment-jsdom": "29.6.2",
"lint-staged": "13.2.3",
"raw-loader": "4.0.2",
"sass": "1.64.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ import {
DragFunction
} from '../../../../shared/components/dragDrop/Draggable'
import { IconMenu } from '../../../../shared/components/iconMenu/IconMenu'
import {
ArrowDown,
ListFilter,
ArrowUp
} from '../../../../shared/components/icons'
import { ArrowDown, ArrowUp, Filter } from '../../../../shared/components/icons'

const getIconMenuItems = (
sortEnabled: boolean,
Expand All @@ -28,7 +24,7 @@ const getIconMenuItems = (
},
{
hidden: !hasFilter,
icon: ListFilter,
icon: Filter,
tooltip: 'Table Filtered By'
}
]
Expand Down
Loading

0 comments on commit 0793303

Please sign in to comment.