Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into update_material
Browse files Browse the repository at this point in the history
  • Loading branch information
jmuharsky committed Mar 8, 2016
2 parents 489b822 + 394f481 commit 3f4291c
Show file tree
Hide file tree
Showing 39 changed files with 177 additions and 220 deletions.
1 change: 0 additions & 1 deletion client/components/config/config-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ goog.scope(function() {
explorer.components.config.ConfigDirective = function() {
return {
restrict: 'E',
replace: true,
transclude: true,
scope: {
'ngModel': '='
Expand Down
1 change: 0 additions & 1 deletion client/components/container/container-config-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const explorer = p3rf.perfkit.explorer;
explorer.components.container.ContainerConfigDirective = function() {
return {
restrict: 'E',
replace: true,
transclude: true,
scope: {
'ngModel': '='
Expand Down
1 change: 0 additions & 1 deletion client/components/container/container-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const explorer = p3rf.perfkit.explorer;
explorer.components.container.ContainerDirective = function() {
return {
restrict: 'E',
replace: true,
transclude: true,
scope: {
ngModel: '='
Expand Down
1 change: 0 additions & 1 deletion client/components/container/container-toolbar-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ goog.scope(function() {
arrayUtilService, containerService, dashboardService) {
return {
restrict: 'E',
replace: true,
scope: {},
transclude: false,
templateUrl: '/static/components/container/container-toolbar-directive.html',
Expand Down
1 change: 0 additions & 1 deletion client/components/dashboard/dashboard-config-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const BigqueryConfigService = explorer.ext.bigquery.BigqueryConfigService;
explorer.components.dashboard.DashboardConfigDirective = function(configService) {
return {
restrict: 'E',
replace: true,
transclude: true,
scope: {
'ngModel': '='
Expand Down
9 changes: 8 additions & 1 deletion client/components/dashboard/dashboard-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const ChartType = explorer.models.ChartType;
explorer.components.dashboard.DashboardDirective = function() {
return {
restrict: 'E',
replace: true,
transclude: true,
scope: {
'ngModel': '='
Expand Down Expand Up @@ -132,6 +131,14 @@ explorer.components.dashboard.DashboardDirective = function() {
return false;
}
}

/** @export {number} */
$scope.getWidgetFlexWidth = function(widget, container) {
let widgetSpan = widget.model.layout.columnspan;
let totalSpan = container.model.container.columns;

return Math.floor(widgetSpan / totalSpan * 100);
}
}]
};
};
Expand Down
1 change: 0 additions & 1 deletion client/components/dashboard/dashboard-toolbar-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ goog.scope(function() {
dashboardService, errorService, explorerService, sidebarTabService) {
return {
restrict: 'E',
replace: true,
scope: {
ngModel: '='
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ explorer.components.dashboard_admin_page.DashboardAdminPageDirective = function(
resizeService, explorerService) {
return {
restrict: 'E',
replace: true,
transclude: true,
templateUrl: '/static/components/dashboard_admin_page/dashboard-admin-page-directive.html',
controllerAs: 'pageCtrl',
Expand Down
14 changes: 6 additions & 8 deletions client/components/explorer/explorer-header-directive.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<div class="pk-header">
<div class="pk-header" flex layout="row">

<div class="page-title" flex>
<span ng-bind="ctrl.dashboardSvc.replaceTokens(
ctrl.dashboardSvc.current.model.title)"></span>
</div>

<div class="pk-header-toolbar">
<span class="pk-header-status" ng-show="!ctrl.workQueueSvc.isEmpty()">
Expand Down Expand Up @@ -43,13 +48,6 @@
</li>
</ul>
</div>

</div>

<div class="page-title">
<span ng-bind="ctrl.dashboardSvc.replaceTokens(
ctrl.dashboardSvc.current.model.title)"></span>

</div>

</div>
1 change: 0 additions & 1 deletion client/components/explorer/explorer-header-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ const CodeEditorMode = explorer.components.code_editor.CodeEditorMode;
explorer.components.explorer.ExplorerHeaderDirective = function() {
return {
restrict: 'E',
replace: true,
transclude: true,
templateUrl: '/static/components/explorer/explorer-header-directive.html',
controllerAs: 'ctrl',
Expand Down
2 changes: 1 addition & 1 deletion client/components/explorer/explorer-page-directive.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ div:focus {
outline: none;
}

.pk-page-canvas {
explorer-page {
height: 100%;
width: 100%;
}
Expand Down
50 changes: 24 additions & 26 deletions client/components/explorer/explorer-page-directive.html
Original file line number Diff line number Diff line change
@@ -1,43 +1,41 @@
<div class="pk-page-canvas" layout="column" flex>
<explorer-header></explorer-header>
<explorer-header layout="column"></explorer-header>

<div class="pk-page-body" ng-controller="DashboardCtrl as dashboardCtrl"
layout="row" flex>
<div class="pk-page-body" ng-controller="DashboardCtrl as dashboardCtrl"
layout="row" flex>

<sidebar-tabs></sidebar-tabs>
<sidebar-tabs class="pk-sidebar-tabs" layout="column"></sidebar-tabs>

<div class="pk-page-leftwell" id="pk-page-leftwell" layout="column"
ng-show="dashboardCtrl.tabSvc.selectedTab">
<div class="pk-page-leftwell" id="pk-page-leftwell" layout="column"
ng-show="dashboardCtrl.tabSvc.selectedTab">

<sidebar></sidebar>
<sidebar ng-show="explorerCtrl.sidebarTabService.selectedTab" layout="column" flex></sidebar>

</div>

<div resize="right" resize-element-id="pk-page-leftwell"
ng-show="explorerCtrl.sidebarTabService.selectedTab">&nbsp;</div>
</div>

<div layout="column" flex>
<div resize="right" resize-element-id="pk-page-leftwell"
ng-show="explorerCtrl.sidebarTabService.selectedTab">&nbsp;</div>

<explorer-toolbar></explorer-toolbar>
<div layout="column" flex>

<div class="pk-page-content pk-background" layout="column" flex
ng-click="dashboardSvc.onDashboardClick($event)">
<dashboard ng-model="dashboardCtrl.dashboard.current.model"></dashboard>
</div>
<explorer-toolbar></explorer-toolbar>

<div class="pk-page-content pk-background" layout="column" flex
ng-click="dashboardSvc.onDashboardClick($event)">
<dashboard ng-model="dashboardCtrl.dashboard.current.model"></dashboard>
</div>

</div>

<div
resize="top" resize-element-id="pk-page-footer"
ng-show="explorerCtrl.explorer.model.code_editor.isOpen">&nbsp;</div>
</div>

<div
class="pk-page-footer" id="pk-page-footer" layout="column"
ng-show="explorerCtrl.explorer.model.code_editor.isOpen">
<div
resize="top" resize-element-id="pk-page-footer"
ng-show="explorerCtrl.explorer.model.code_editor.isOpen">&nbsp;</div>

<widget-editor layout="column" flex></widget-editor>
<div
class="pk-page-footer" id="pk-page-footer" layout="column"
ng-show="explorerCtrl.explorer.model.code_editor.isOpen">

<widget-editor class="pk-footer-open" layout="column" flex></widget-editor>

</div>
</div>
1 change: 0 additions & 1 deletion client/components/explorer/explorer-page-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ explorer.components.explorer.ExplorerPageDirective = function(
resizeService, explorerService) {
return {
restrict: 'E',
replace: true,
transclude: true,
templateUrl: '/static/components/explorer/explorer-page-directive.html',
controllerAs: 'pageCtrl',
Expand Down
1 change: 0 additions & 1 deletion client/components/explorer/explorer-toolbar-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ goog.scope(function() {
dashboardService, sidebarTabService) {
return {
restrict: 'E',
replace: true,
transclude: false,
scope: {},
templateUrl: '/static/components/explorer/explorer-toolbar-directive.html',
Expand Down
2 changes: 1 addition & 1 deletion client/components/explorer/sidebar/sidebar-directive.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.pk-sidebar-panel {
sidebar {
overflow: hidden;
}

Expand Down
119 changes: 55 additions & 64 deletions client/components/explorer/sidebar/sidebar-directive.html
Original file line number Diff line number Diff line change
@@ -1,81 +1,72 @@
<div class="pk-sidebar-panel" layout="column" flex
ng-show="tabSvc.selectedTab">

<div class="pk-sidebar-panel-header
{{ tabSvc.selectedTab.panelTitleClass }}">
<div style="float: right">
<md-button ng-click="tabSvc.toggleTab(tabSvc.selectedTab)"
aria-label="close panel">
<i class="fa fa-times"></i>
</md-button>
</div>
<div class="pk-sidebar-panel-header-text">
{{ tabSvc.selectedTab.title }}</div>
<div class="pk-sidebar-panel-header" ng-class="tabSvc.selectedTab.panelTitleClass">
<div style="float: right">
<md-button ng-click="tabSvc.toggleTab(tabSvc.selectedTab)"
aria-label="close panel">
<i class="fa fa-times"></i>
</md-button>
</div>
<div class="pk-sidebar-panel-header-text">
{{ tabSvc.selectedTab.title }}</div>
</div>

<div class="pk-sidebar-panel-content
{{ tabSvc.selectedTab.panelClass }}" flex>

<!-- TODO(joemu): Replace this switch with a data-driven approach. -->
<div ng-switch="tabSvc.selectedTab.id">
<div class="pk-sidebar-panel-content" ng-class="tabSvc.selectedTab.panelClass"
flex layout="column">

<div ng-switch-when="dashboard">
<dashboard-config ng-model="dashboardSvc.current.model" />
</div>
<!-- TODO(joemu): Replace this switch with a data-driven approach. -->
<div ng-switch="tabSvc.selectedTab.id" flex layout="column">

<div ng-switch-when="container">
<container-config ng-model="dashboardSvc.selectedContainer.model.container" />
</div>
<div ng-switch-when="dashboard">
<dashboard-config ng-model="dashboardSvc.current.model" />
</div>

<div ng-switch-when="widget.data">
<query-builder-datasource-config ng-model="dashboardSvc.selectedWidget.model" />
</div>
<div ng-switch-when="container">
<container-config ng-model="dashboardSvc.selectedContainer.model.container" />
</div>

<div ng-switch-when="widget.data.filter">
<query-builder-filter-config
ng-model="dashboardSvc.selectedWidget.model" />
</div>
<div ng-switch-when="widget.data">
<query-builder-datasource-config ng-model="dashboardSvc.selectedWidget.model" />
</div>

<div ng-switch-when="widget.data.result">
<!-- TODO(joemu): Refactor into a single directive for the panel. -->
<query-builder-column-config
ng-model="dashboardSvc.selectedWidget.model">
</query-builder-column-config>
<div class="pk-sidebar-group-title">Result Shape</div>
<query-result-config ng-model="dashboardSvc.selectedWidget.model" />
</div>
<div ng-switch-when="widget.data.filter">
<query-builder-filter-config
ng-model="dashboardSvc.selectedWidget.model" />
</div>

<div ng-switch-when="widget.config">
<!-- TODO(joemu): Refactor into a single directive for the panel. -->
<div class="pk-sidebar-group">
<widget-config ng-model="dashboardSvc.selectedWidget.model" />
</div>
<div ng-show="dashboardSvc.selectedWidget.model.type === dashboardSvc.widgetFactorySvc.widgetTypes.CHART">
<div class="pk-sidebar-group-title">Datasource</div>
<query-builder-datasource-config ng-model="dashboardSvc.selectedWidget.model" />
</div>
</div>
<div ng-switch-when="widget.data.result">
<!-- TODO(joemu): Refactor into a single directive for the panel. -->
<query-builder-column-config
ng-model="dashboardSvc.selectedWidget.model">
</query-builder-column-config>
<div class="pk-sidebar-group-title">Result Shape</div>
<query-result-config ng-model="dashboardSvc.selectedWidget.model" />
</div>

<div ng-switch-when="widget.chart">
<chart-config ng-model="dashboardSvc.selectedWidget.model" />
<div ng-switch-when="widget.config">
<!-- TODO(joemu): Refactor into a single directive for the panel. -->
<div class="pk-sidebar-group">
<widget-config ng-model="dashboardSvc.selectedWidget.model" />
</div>
<div class="pk-sidebar-group-title">Datasource</div>
<query-builder-datasource-config ng-model="dashboardSvc.selectedWidget.model" />
</div>

<div ng-switch-when="widget.columns">
<column-style-config ng-model="dashboardSvc.selectedWidget" />
</div>
<div ng-switch-when="widget.chart">
<chart-config ng-model="dashboardSvc.selectedWidget.model" />
</div>

<div ng-switch-default>UNSUPPORTED TYPE: {{ tabSvc.selectedTab.id }}</div>
<div ng-switch-when="widget.columns">
<column-style-config ng-model="dashboardSvc.selectedWidget" />
</div>
</div>

<div class="pk-sidebar-panel-footer
{{ tabSvc.selectedTab.panelTitleClass}}">
<md-button style="float: left" aria-label="previous tab"
ng-click="tabSvc.selectedTab = tabSvc.getPreviousTab(tabSvc.selectedTab)">
previous</md-button>
<md-button style="float: right" aria-label="next tab"
ng-click="tabSvc.selectedTab = tabSvc.getNextTab(tabSvc.selectedTab)">
next</md-button>
<div ng-switch-default>UNSUPPORTED TYPE: {{ tabSvc.selectedTab.id }}</div>
</div>
</div>

<div class="pk-sidebar-panel-footer" ng-class="tabSvc.selectedTab.panelTitleClass">
<md-button style="float: left" aria-label="previous tab"
ng-click="tabSvc.selectedTab = tabSvc.getPreviousTab(tabSvc.selectedTab)">
previous</md-button>
<md-button style="float: right" aria-label="next tab"
ng-click="tabSvc.selectedTab = tabSvc.getNextTab(tabSvc.selectedTab)">
next</md-button>
</div>
1 change: 0 additions & 1 deletion client/components/explorer/sidebar/sidebar-directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ explorer.components.explorer.sidebar.SidebarDirective = function(
dashboardService, sidebarTabService) {
return {
restrict: 'E',
replace: true,
transclude: true,
templateUrl: '/static/components/explorer/sidebar/sidebar-directive.html',
controller: ['$scope', function($scope) {
Expand Down
30 changes: 14 additions & 16 deletions client/components/explorer/sidebar/sidebar-tabs-directive.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
<div class="pk-sidebar-tabs" layout="column">
<div
class="pk-sidebar-tab {{ tab.tabClass }}"
ng-repeat="tab in ctrl.tabSvc.tabs"
ng-click="ctrl.tabClicked(tab)"
ng-show="ctrl.tabSvc.isTabVisible(tab)"
ng-class="{'pk-sidebar-tab-selected': ctrl.tabSvc.selectedTab == tab}"
ng-attr-selected="ctrl.tabSvc.selectedTab == tab">
<md-tooltip
md-delay="0" md-direction="right" md-visible="tab.tooltipVisible"
md-autohide>
{{ tab.hint }}</md-tooltip>
<i class="pk-sidebar-tab-icon {{ tab.iconClass }}"></i>
<div class="pk-sidebar-tab-label"
ng-hide="ctrl.tabSvc.selectedTab">{{ tab.title }}</div>
</div>
<div
class="pk-sidebar-tab {{ tab.tabClass }}"
ng-repeat="tab in ctrl.tabSvc.tabs"
ng-click="ctrl.tabClicked(tab)"
ng-show="ctrl.tabSvc.isTabVisible(tab)"
ng-class="{'pk-sidebar-tab-selected': ctrl.tabSvc.selectedTab == tab}"
ng-attr-selected="ctrl.tabSvc.selectedTab == tab">
<md-tooltip
md-delay="0" md-direction="right" md-visible="tab.tooltipVisible"
md-autohide>
{{ tab.hint }}</md-tooltip>
<i class="pk-sidebar-tab-icon {{ tab.iconClass }}"></i>
<div class="pk-sidebar-tab-label"
ng-hide="ctrl.tabSvc.selectedTab">{{ tab.title }}</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const SidebarTabModel = explorer.components.explorer.sidebar.SidebarTabModel;
explorer.components.explorer.sidebar.SidebarTabsDirective = function() {
return {
restrict: 'E',
replace: true,
transclude: false,
templateUrl: '/static/components/explorer/sidebar/sidebar-tabs-directive.html',
controller: [
Expand Down
Loading

0 comments on commit 3f4291c

Please sign in to comment.