Commit 7a2e886e by Torkel Ödegaard

Merge branch 'develop' into develop-settings

parents 1b6be031 10a77b03
...@@ -118,21 +118,6 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) { ...@@ -118,21 +118,6 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
Children: dashboardChildNavs, Children: dashboardChildNavs,
}) })
dashboardFolderChildNavs := []*dtos.NavLink{
{Text: "Dashboards", Id: "manage-folder-dashboards", Url: setting.AppSubUrl + "/dashboards", Icon: "fa fa-fw fa-th-large"},
{Text: "Permissions", Id: "manage-folder-permissions", Url: setting.AppSubUrl + "/dashboards?1", Icon: "fa fa-fw fa-lock"},
}
data.NavTree = append(data.NavTree, &dtos.NavLink{
Text: "Dashboards",
Id: "manage-folder",
SubTitle: "Manage folder dashboards & permissions",
Icon: "fa fa-folder-open",
Url: setting.AppSubUrl + "/",
HideFromMenu: true,
Children: dashboardFolderChildNavs,
})
if c.IsSignedIn { if c.IsSignedIn {
profileNode := &dtos.NavLink{ profileNode := &dtos.NavLink{
Text: c.SignedInUser.Name, Text: c.SignedInUser.Name,
......
...@@ -8,9 +8,8 @@ export class FolderDashboardsCtrl { ...@@ -8,9 +8,8 @@ export class FolderDashboardsCtrl {
constructor(private backendSrv, navModelSrv, private $routeParams) { constructor(private backendSrv, navModelSrv, private $routeParams) {
if (this.$routeParams.folderId && this.$routeParams.type && this.$routeParams.slug) { if (this.$routeParams.folderId && this.$routeParams.type && this.$routeParams.slug) {
this.folderId = $routeParams.folderId; this.folderId = $routeParams.folderId;
this.navModel = navModelSrv.getNav('manage-folder', 'manage-folder-dashboards', 0);
new FolderPageLoader(this.backendSrv, this.$routeParams).load(this.navModel, this.folderId); new FolderPageLoader(this.backendSrv, this.$routeParams).load(this, this.folderId, 'manage-folder-dashboards');
} }
} }
} }
...@@ -3,18 +3,51 @@ import _ from "lodash"; ...@@ -3,18 +3,51 @@ import _ from "lodash";
export class FolderPageLoader { export class FolderPageLoader {
constructor(private backendSrv, private $routeParams) { } constructor(private backendSrv, private $routeParams) { }
load(navModel, folderId) { load(ctrl, folderId, activeChildId) {
ctrl.navModel = {
main: {
icon: 'fa fa-folder-open',
id: 'manage-folder',
subTitle: 'Manage folder dashboards & permissions',
url: '/fsdfds',
text: '',
breadcrumbs: [
{ title: 'Dashboards', uri: '/dashboards' },
{ title: ' ' },
],
children: [
{
active: activeChildId === 'manage-folder-dashboards',
icon: 'fa fa-fw fa-th-large',
id: 'manage-folder-dashboards',
text: 'Dashboards',
url: '/dashboards'
},
{
active: activeChildId === 'manage-folder-permissions',
icon: 'fa fa-fw fa-lock',
id: 'manage-folder-permissions',
text: 'Permissions',
url: '/dashboards/permissions'
}
]
}
};
this.backendSrv.getDashboard(this.$routeParams.type, this.$routeParams.slug).then(result => { this.backendSrv.getDashboard(this.$routeParams.type, this.$routeParams.slug).then(result => {
const folderTitle = result.dashboard.title; const folderTitle = result.dashboard.title;
navModel.main.text = ''; ctrl.navModel.main.text = '';
navModel.main.breadcrumbs = [ ctrl.navModel.main.breadcrumbs = [
{ title: 'Dashboards', uri: '/dashboards' }, { title: 'Dashboards', uri: '/dashboards' },
{ title: folderTitle } { title: folderTitle }
]; ];
const folderUrl = `/dashboards/folder/${folderId}/${result.meta.type}/${result.meta.slug}`; const folderUrl = `/dashboards/folder/${folderId}/${result.meta.type}/${result.meta.slug}`;
const dashTab = _.find(navModel.main.children, { id: 'manage-folder-dashboards' });
const dashTab = _.find(ctrl.navModel.main.children, { id: 'manage-folder-dashboards' });
dashTab.url = folderUrl; dashTab.url = folderUrl;
const permTab = _.find(navModel.main.children, { id: 'manage-folder-permissions' });
const permTab = _.find(ctrl.navModel.main.children, { id: 'manage-folder-permissions' });
permTab.url = folderUrl + '/permissions'; permTab.url = folderUrl + '/permissions';
}); });
} }
......
...@@ -8,9 +8,8 @@ export class FolderPermissionsCtrl { ...@@ -8,9 +8,8 @@ export class FolderPermissionsCtrl {
constructor(private backendSrv, navModelSrv, private $routeParams) { constructor(private backendSrv, navModelSrv, private $routeParams) {
if (this.$routeParams.folderId && this.$routeParams.type && this.$routeParams.slug) { if (this.$routeParams.folderId && this.$routeParams.type && this.$routeParams.slug) {
this.folderId = $routeParams.folderId; this.folderId = $routeParams.folderId;
this.navModel = navModelSrv.getNav('manage-folder', 'manage-folder-permissions', 0);
new FolderPageLoader(this.backendSrv, this.$routeParams).load(this.navModel, this.folderId); new FolderPageLoader(this.backendSrv, this.$routeParams).load(this, this.folderId, 'manage-folder-permissions');
} }
} }
} }
...@@ -8,7 +8,6 @@ $input-border: 1px solid $input-border-color; ...@@ -8,7 +8,6 @@ $input-border: 1px solid $input-border-color;
align-items: center; align-items: center;
text-align: left; text-align: left;
position: relative; position: relative;
font-size: $font-size-sm;
&--offset-1 { &--offset-1 {
margin-left: $spacer; margin-left: $spacer;
...@@ -71,7 +70,6 @@ $input-border: 1px solid $input-border-color; ...@@ -71,7 +70,6 @@ $input-border: 1px solid $input-border-color;
background-color: $input-label-bg; background-color: $input-label-bg;
display: block; display: block;
font-size: $font-size-sm;
border: $input-btn-border-width solid $input-label-border-color; border: $input-btn-border-width solid $input-label-border-color;
@include border-radius($label-border-radius-sm); @include border-radius($label-border-radius-sm);
...@@ -90,7 +88,6 @@ $input-border: 1px solid $input-border-color; ...@@ -90,7 +88,6 @@ $input-border: 1px solid $input-border-color;
.gf-form-pre { .gf-form-pre {
display: block; display: block;
flex-grow: 1; flex-grow: 1;
font-size: $font-size-sm;
margin: 0; margin: 0;
margin-right: $gf-form-margin; margin-right: $gf-form-margin;
border: $input-btn-border-width solid transparent; border: $input-btn-border-width solid transparent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment