-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make saved query work in docs (#510)
- Loading branch information
1 parent
b453820
commit b204005
Showing
17 changed files
with
287 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<style> | ||
/* TODO */ | ||
.section-target { | ||
top: -8em; | ||
} | ||
|
||
.noflex { | ||
flex: 0 0 160px !important; | ||
} | ||
|
||
.highlight { | ||
color: #24292e; | ||
background-color: white; | ||
} | ||
|
||
</style> | ||
|
||
<div class='app-scroll'> | ||
<div class="app-links app-sticky"> | ||
<div class="app-title"> | ||
<div class="app-frame app-pad app-flush-bottom"> | ||
|
||
<h1> | ||
<span class="break">{{ saved_query.name }}</span> | ||
<small>saved_query</small> | ||
|
||
<div class='clearfix'></div> | ||
</h1> | ||
|
||
</div> | ||
</div> | ||
<div class="app-frame app-pad-h"> | ||
<ul class="nav nav-tabs"> | ||
<li ui-sref-active='active'><a ui-sref="dbt.saved_query({'#': 'details'})">Details</a></li> | ||
<li ui-sref-active='active'><a ui-sref="dbt.saved_query({'#': 'description'})">Description</a></li> | ||
<li ui-sref-active='active' ng-show = "parentsLength != 0"><a ui-sref="dbt.saved_query({'#': 'depends_on'})">Depends On</a></li> | ||
</ul> | ||
</div> | ||
</div> | ||
<div class="app-details"> | ||
<div class="app-frame app-pad"> | ||
|
||
<section class="section"> | ||
<div class="section-target" id="details"></div> | ||
<table-details model="saved_query" extras="extra_table_fields" /> | ||
</section> | ||
|
||
<section class="section"> | ||
<div class="section-target" id="description"></div> | ||
<div class="section-content"> | ||
<h6>Description</h6> | ||
<div class="panel"> | ||
<div class="panel-body"> | ||
<div ng-if="saved_query.description" class="model-markdown" marked="saved_query.description"></div> | ||
<div ng-if="!saved_query.description">This {{ saved_query.resource_type }} is not currently documented</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section class="section" ng-show = "saved_query.entities.length != 0"> | ||
<div class="section-target" id="entities"></div> | ||
<div class="section-content"> | ||
<h6>Entities</h6> | ||
|
||
<div class="panel"> | ||
<div class="detail-group" style="padding-bottom: 0"> | ||
<div class="detail-body" style="padding-left: 0"> | ||
<dl class="detail" ng-style="{'padding-left': $index == 0 ? 0 : 'auto'}" | ||
ng-repeat="entity in saved_query.entities"> | ||
<dt class="detail-label">Name</dt> | ||
<dd class="detail-value" ng-if="entity.name">{{ entity.name }}</dd> | ||
<dd class="detail-value" ng-if="!entity.name">None</dd> | ||
<dt class="detail-label">Type</dt> | ||
<dd class="detail-value" ng-if="entity.type">{{ entity.type }}</dd> | ||
<dd class="detail-value" ng-if="!entity.type">None</dd> | ||
<dt class="detail-label">Expression</dt> | ||
<dd class="detail-value" ng-if="entity.expr">{{ entity.expr }}</dd> | ||
<dd class="detail-value" ng-if="!entity.expr">None</dd> | ||
</dl> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section class="section" ng-show = "parentsLength != 0"> | ||
<div class="section-target" id="depends_on"></div> | ||
<div class="section-content"> | ||
<h6>Depends On</h6> | ||
<reference-list references="parents" node="saved_query" /> | ||
</div> | ||
</section> | ||
|
||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
'use strict'; | ||
|
||
const angular = require('angular'); | ||
const dag_utils = require('./dag_utils') | ||
require("./styles.css"); | ||
|
||
angular | ||
.module('dbt') | ||
.controller('SavedQueryCtrl', ['$scope', '$state', 'project', 'code', '$anchorScroll', '$location', | ||
function($scope, $state, projectService, codeService, $anchorScroll, $location) { | ||
|
||
$scope.model_uid = $state.params.unique_id; | ||
$scope.project = projectService; | ||
|
||
$scope.codeService = codeService; | ||
$scope.extra_table_fields = []; | ||
$scope.versions = {}; | ||
|
||
$scope.saved_query = {}; | ||
projectService.ready(function(project) { | ||
let saved_query = project.nodes[$scope.model_uid]; | ||
$scope.saved_query = saved_query; | ||
$scope.parents = dag_utils.getParents(project, saved_query); | ||
$scope.parentsLength = $scope.parents.length; | ||
|
||
const saved_query_type = $scope.saved_query.type === 'expression' | ||
? 'Expression saved_query' | ||
: 'Aggregate saved_query'; | ||
|
||
$scope.extra_table_fields = [ | ||
{ | ||
name: "Saved Query Type", | ||
value: saved_query_type, | ||
}, | ||
{ | ||
name: "Saved Query name", | ||
value: $scope.saved_query.name | ||
} | ||
] | ||
|
||
}) | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.