forked from dbt-labs/dbt-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description Bring upstream features into the fork. This includes semantic models and column constraints. --------- Co-authored-by: Marco d'Amore <58502369+marcodamore@users.noreply.github.com> Co-authored-by: Jeremy Cohen <jeremy@dbtlabs.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Github Build Bot <buildbot@fishtownanalytics.com> Co-authored-by: Emily Rockman <emily.rockman@dbtlabs.com>
- Loading branch information
1 parent
f89c5c5
commit 53d17d7
Showing
22 changed files
with
321 additions
and
55 deletions.
There are no files selected for viewing
This file was deleted.
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
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">{{ semantic_model.name }}</span> | ||
<small>semantic_model</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.semantic_model({'#': 'details'})">Details</a></li> | ||
<li ui-sref-active='active'><a ui-sref="dbt.semantic_model({'#': 'description'})">Description</a></li> | ||
<li ui-sref-active='active' ng-show = "parentsLength != 0"><a ui-sref="dbt.semantic_model({'#': '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="semantic_model" 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="semantic_model.description" class="model-markdown" marked="semantic_model.description"></div> | ||
<div ng-if="!semantic_model.description">This {{ semantic_model.resource_type }} is not currently documented</div> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
|
||
<section class="section" ng-show = "semantic_model.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 semantic_model.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="semantic_model" /> | ||
</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('SemanticModelCtrl', ['$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.semantic_model = {}; | ||
projectService.ready(function(project) { | ||
let semantic_model = project.nodes[$scope.model_uid]; | ||
$scope.semantic_model = semantic_model; | ||
$scope.parents = dag_utils.getParents(project, semantic_model); | ||
$scope.parentsLength = $scope.parents.length; | ||
|
||
const semantic_model_type = $scope.semantic_model.type === 'expression' | ||
? 'Expression semantic_model' | ||
: 'Aggregate semantic_model'; | ||
|
||
$scope.extra_table_fields = [ | ||
{ | ||
name: "Semantic Model Type", | ||
value: semantic_model_type, | ||
}, | ||
{ | ||
name: "Semantic Model name", | ||
value: $scope.semantic_model.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
Oops, something went wrong.