bump cm-promql + light improvement when building the PromQL extension (#8700)

* bump cm-promql to v0.14.1

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

* enhancement a bit the way to build the codemirror PromQL extension

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
This commit is contained in:
Augustin Husson 2021-04-07 12:34:04 +02:00 committed by GitHub
parent 431ea75a11
commit f3505da306
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 15 deletions

View file

@ -29,7 +29,7 @@
"@types/react-resize-detector": "^5.0.0",
"@types/sanitize-html": "^1.20.2",
"bootstrap": "^4.2.1",
"codemirror-promql": "^0.14.0",
"codemirror-promql": "^0.14.1",
"css.escape": "^1.5.1",
"downshift": "^3.4.8",
"enzyme-to-json": "^3.4.3",

View file

@ -96,16 +96,17 @@ const CMExpressionInput: FC<CMExpressionInputProps> = ({
// (Re)initialize editor based on settings / setting changes.
useEffect(() => {
// Build the dynamic part of the config.
promqlExtension.activateCompletion(enableAutocomplete);
promqlExtension.activateLinter(enableLinter);
promqlExtension.setComplete({
completeStrategy: new HistoryCompleteStrategy(
newCompleteStrategy({
remote: { url: pathPrefix },
}),
queryHistory
),
});
promqlExtension
.activateCompletion(enableAutocomplete)
.activateLinter(enableLinter)
.setComplete({
completeStrategy: new HistoryCompleteStrategy(
newCompleteStrategy({
remote: { url: pathPrefix },
}),
queryHistory
),
});
const dynamicConfig = [enableHighlighting ? promqlHighlighter : [], promqlExtension.asExtension()];
// Create or reconfigure the editor.

View file

@ -3418,10 +3418,10 @@ coa@^2.0.2:
chalk "^2.4.1"
q "^1.1.2"
codemirror-promql@^0.14.0:
version "0.14.0"
resolved "https://registry.yarnpkg.com/codemirror-promql/-/codemirror-promql-0.14.0.tgz#a5ad500e68a379ba6bded40ec0f9ff2940015bcd"
integrity sha512-CqjfzVehB1ES5fbw8cRtRXG8Ykhshctqsqn8VtHXUg+QAilGBHu6+jlC7neLHdyfsTvKNhvvzwsZgRKhQVR5qA==
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==
dependencies:
lezer-promql "^0.18.0"
lru-cache "^6.0.0"