ux(dashboard): minor fixes

This commit is contained in:
Torkel Ödegaard 2016-10-28 16:37:13 +02:00
parent 366650e1ae
commit 3fc6f6d730
4 changed files with 9 additions and 10 deletions

View File

@ -28,15 +28,15 @@ function (coreModule) {
coreModule.default.controller('NewDashboardCtrl', function($scope) { coreModule.default.controller('NewDashboardCtrl', function($scope) {
$scope.initDashboard({ $scope.initDashboard({
meta: { canStar: false, canShare: false }, meta: { canStar: false, canShare: false, isNew: true },
dashboard: { dashboard: {
title: "New dashboard", title: "New dashboard",
isNew: true,
rows: [ rows: [
{ {
title: 'Dashboard Row', title: 'Dashboard Row',
height: '250px', height: '250px',
panels:[], panels:[],
isNew: true,
} }
] ]
}, },

View File

@ -65,15 +65,14 @@ export class DashboardModel {
this.links = data.links || []; this.links = data.links || [];
this.gnetId = data.gnetId || null; this.gnetId = data.gnetId || null;
if (this.id === null) {
this.editMode = true;
}
this.updateSchema(data); this.updateSchema(data);
this.initMeta(meta); this.initMeta(meta);
this.editMode = this.meta.isNew;
} }
private initMeta(meta) { private initMeta(meta) {
console.log(meta);
meta = meta || {}; meta = meta || {};
meta.canShare = meta.canShare !== false; meta.canShare = meta.canShare !== false;

View File

@ -19,7 +19,7 @@ export class DashRowCtrl {
constructor(private $scope, private $rootScope, private $timeout, private uiSegmentSrv, private $q) { constructor(private $scope, private $rootScope, private $timeout, private uiSegmentSrv, private $q) {
this.row.title = this.row.title || 'Row title'; this.row.title = this.row.title || 'Row title';
if (this.row.isNew) { if (this.dashboard.meta.isNew) {
this.dropView = 1; this.dropView = 1;
delete this.row.isNew; delete this.row.isNew;
} }

View File

@ -353,9 +353,9 @@ div.flot-text {
.dash-row-add-panel { .dash-row-add-panel {
margin: 0; margin: 0;
padding: $panel-margin*2; padding: $panel-margin*2;
display: flex; // display: flex;
align-items: flex-start; // align-items: flex-start;
position: relative; // position: relative;
} }
.add-panel-panels-scroll { .add-panel-panels-scroll {