From b204005b8e3845f1999598aa3b5af93dea85936f Mon Sep 17 00:00:00 2001 From: Chenyu Li Date: Tue, 21 May 2024 15:01:53 -0700 Subject: [PATCH] Make saved query work in docs (#510) --- .changes/unreleased/Docs-20240516-223036.yaml | 6 ++ package-lock.json | 1 + src/app/components/graph/graph-launcher.js | 4 + src/app/components/model_tree/model_tree.html | 12 +++ src/app/components/references/index.js | 2 + src/app/components/search/search.js | 2 + src/app/docs/index.js | 1 + src/app/docs/saved_query.html | 97 +++++++++++++++++++ src/app/docs/saved_query.js | 42 ++++++++ src/app/graph/index.js | 2 + src/app/index.routes.js | 9 ++ src/app/main/index.js | 1 + src/app/services/graph.service.js | 11 ++- src/app/services/node_selection_service.js | 9 +- src/app/services/project_service.js | 56 ++++++++++- src/app/services/selector_matcher.js | 26 ++++- src/app/services/selector_methods.test.js | 15 +++ 17 files changed, 287 insertions(+), 9 deletions(-) create mode 100644 .changes/unreleased/Docs-20240516-223036.yaml create mode 100644 src/app/docs/saved_query.html create mode 100644 src/app/docs/saved_query.js diff --git a/.changes/unreleased/Docs-20240516-223036.yaml b/.changes/unreleased/Docs-20240516-223036.yaml new file mode 100644 index 000000000..1eb760396 --- /dev/null +++ b/.changes/unreleased/Docs-20240516-223036.yaml @@ -0,0 +1,6 @@ +kind: Docs +body: Add support for Saved Query node +time: 2024-05-16T22:30:36.206492-07:00 +custom: + Author: ChenyuLInx + Issue: "486" diff --git a/package-lock.json b/package-lock.json index d08a16bc9..47b57c19f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18017,6 +18017,7 @@ }, "cytoscape": { "version": "git+ssh://git@github.com/dbt-labs/cytoscape.js.git#b8a1192c270de70296a0381bd0bfe26a5ddeada3", + "integrity": "sha512-CJDw3nomL5E4OgviTrBhkfLCVaA5bDS5BTuLKY0Qk+/AK75Quue/e5z68RCpwe2G7XMoPjosP0xOrAje2dn6HQ==", "dev": true, "from": "cytoscape@https://github.com/dbt-labs/cytoscape.js.git#feature/cubic-bezier-edges", "requires": { diff --git a/src/app/components/graph/graph-launcher.js b/src/app/components/graph/graph-launcher.js index 8545f7dd3..1cf65a7ca 100644 --- a/src/app/components/graph/graph-launcher.js +++ b/src/app/components/graph/graph-launcher.js @@ -157,6 +157,8 @@ angular var nodes = graph.showFullGraph('metric:' + node.name); } else if (node && node.resource_type == 'semantic_model') { var nodes = graph.showFullGraph('semantic_model:' + node.name); + } else if (node && node.resource_type == 'saved_query') { + var nodes = graph.showFullGraph('saved_query:' + node.name); } else { var nodes = graph.showFullGraph(node_name); } @@ -174,6 +176,8 @@ angular var nodes = graph.showVerticalGraph('metric:' + node.name, true); } else if (node && node.resource_type == 'semantic_model') { var nodes = graph.showVerticalGraph('semantic_model:' + node.name, true); + } else if (node && node.resource_type == 'saved_query') { + var nodes = graph.showVerticalGraph('saved_query:' + node.name, true); } else { var nodes = graph.showVerticalGraph(node.name, true); } diff --git a/src/app/components/model_tree/model_tree.html b/src/app/components/model_tree/model_tree.html index db7f31e16..53b188cf6 100644 --- a/src/app/components/model_tree/model_tree.html +++ b/src/app/components/model_tree/model_tree.html @@ -90,6 +90,18 @@
+ +
+ Saved Queries + +
+
+ Projects