Skip to content

Commit

Permalink
Bump cm-promql to v0.15.0 (#4054)
Browse files Browse the repository at this point in the history
* move @types deps to dev-deps

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* bump cm-promql to v0.15.0

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>

* use the metricsNames in PromQLExtension & update the import path

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
  • Loading branch information
Nexucis authored Apr 15, 2021
1 parent 98e369d commit eb05f79
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
22 changes: 11 additions & 11 deletions pkg/ui/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,8 @@
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@fortawesome/react-fontawesome": "^0.1.14",
"@reach/router": "^1.3.4",
"@types/jest": "^26.0.20",
"@types/jquery": "^3.5.5",
"@types/node": "^14.14.30",
"@types/reach__router": "^1.3.7",
"@types/react": "^17.0.2",
"@types/react-copy-to-clipboard": "^5.0.0",
"@types/react-dom": "^17.0.1",
"@types/react-resize-detector": "^4.0.2",
"@types/react-select": "^4.0.13",
"@types/sanitize-html": "^1.27.1",
"bootstrap": "^4.6.0",
"codemirror-promql": "^0.14.1",
"codemirror-promql": "^0.15.0",
"css.escape": "^1.5.1",
"downshift": "^6.1.0",
"enzyme-to-json": "^3.6.1",
Expand Down Expand Up @@ -84,8 +74,18 @@
"@types/enzyme": "^3.10.8",
"@types/enzyme-adapter-react-16": "^1.0.6",
"@types/flot": "^0.0.31",
"@types/jest": "^26.0.20",
"@types/jquery": "^3.5.5",
"@types/moment-timezone": "^0.5.30",
"@types/node": "^14.14.30",
"@types/reach__router": "^1.3.7",
"@types/reactstrap": "^8.7.2",
"@types/react": "^17.0.2",
"@types/react-copy-to-clipboard": "^5.0.0",
"@types/react-dom": "^17.0.1",
"@types/react-resize-detector": "^4.0.2",
"@types/react-select": "^4.0.13",
"@types/sanitize-html": "^1.27.1",
"@types/sinon": "^9.0.10",
"@typescript-eslint/eslint-plugin": "^4.15.1",
"@typescript-eslint/parser": "^4.15.1",
Expand Down
8 changes: 3 additions & 5 deletions pkg/ui/react-app/src/pages/graph/CMExpressionInput.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { FC, useEffect, useRef } from 'react';
import { Button, InputGroup, InputGroupAddon, InputGroupText } from 'reactstrap';

import { EditorView, highlightSpecialChars, keymap, ViewUpdate, placeholder } from '@codemirror/view';
import { EditorState, Prec, Compartment } from '@codemirror/state';
import { indentOnInput, syntaxTree } from '@codemirror/language';
Expand All @@ -11,13 +10,12 @@ import { closeBrackets, closeBracketsKeymap } from '@codemirror/closebrackets';
import { searchKeymap, highlightSelectionMatches } from '@codemirror/search';
import { commentKeymap } from '@codemirror/comment';
import { lintKeymap } from '@codemirror/lint';
import { PromQLExtension } from 'codemirror-promql';
import { PromQLExtension, CompleteStrategy } from 'codemirror-promql';
import { autocompletion, completionKeymap, CompletionContext, CompletionResult } from '@codemirror/autocomplete';
import { theme, promqlHighlighter } from './CMTheme';

import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSearch, faSpinner } from '@fortawesome/free-solid-svg-icons';
import { CompleteStrategy, newCompleteStrategy } from 'codemirror-promql/complete';
import { newCompleteStrategy } from 'codemirror-promql/cjs/complete';
import PathPrefixProps from '../../types/PathPrefixProps';

const promqlExtension = new PromQLExtension();
Expand Down Expand Up @@ -100,7 +98,7 @@ const CMExpressionInput: FC<PathPrefixProps & CMExpressionInputProps> = ({
.setComplete({
completeStrategy: new HistoryCompleteStrategy(
newCompleteStrategy({
remote: { url: pathPrefix ? pathPrefix : '' },
remote: { url: pathPrefix ? pathPrefix : '', cache: { initialMetricList: metricNames } },
}),
queryHistory
),
Expand Down
8 changes: 4 additions & 4 deletions pkg/ui/react-app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3575,10 +3575,10 @@ coa@^2.0.2:
chalk "^2.4.1"
q "^1.1.2"

codemirror-promql@^0.14.1:
version "0.14.1"
resolved "https://registry.yarnpkg.com/codemirror-promql/-/codemirror-promql-0.14.1.tgz#ea927f347effd7f28e4c1f87dcd8898d1681ea40"
integrity sha512-zAdvVrvehVToPBlwySVlTXCY3hzOMPgO1B0m7O6PBY5BUOYbNIDk+DSjrc7glUTwySUwkyWt/x7kDabGv4tXNg==
codemirror-promql@^0.15.0:
version "0.15.0"
resolved "https://registry.yarnpkg.com/codemirror-promql/-/codemirror-promql-0.15.0.tgz#dd6365ea5c2d18421d225cef12b74e64d8cab280"
integrity sha512-u5f6Narj8Kx79AHMPlr8vogGUhinZfsZVT00R7wStquDA3kRTvxfEBYK77UtWNNJshxC1B3EZnHzXN2K9RzVXw==
dependencies:
lezer-promql "^0.18.0"
lru-cache "^6.0.0"
Expand Down

0 comments on commit eb05f79

Please sign in to comment.