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) {
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 {
profileNode := &dtos.NavLink{
Text: c.SignedInUser.Name,
......
......@@ -8,9 +8,8 @@ export class FolderDashboardsCtrl {
constructor(private backendSrv, navModelSrv, private $routeParams) {
if (this.$routeParams.folderId && this.$routeParams.type && this.$routeParams.slug) {
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";
export class FolderPageLoader {
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 => {
const folderTitle = result.dashboard.title;
navModel.main.text = '';
navModel.main.breadcrumbs = [
ctrl.navModel.main.text = '';
ctrl.navModel.main.breadcrumbs = [
{ title: 'Dashboards', uri: '/dashboards' },
{ title: folderTitle }
];
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;
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';
});
}
......
......@@ -8,9 +8,8 @@ export class FolderPermissionsCtrl {
constructor(private backendSrv, navModelSrv, private $routeParams) {
if (this.$routeParams.folderId && this.$routeParams.type && this.$routeParams.slug) {
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;
align-items: center;
text-align: left;
position: relative;
font-size: $font-size-sm;
&--offset-1 {
margin-left: $spacer;
......@@ -71,7 +70,6 @@ $input-border: 1px solid $input-border-color;
background-color: $input-label-bg;
display: block;
font-size: $font-size-sm;
border: $input-btn-border-width solid $input-label-border-color;
@include border-radius($label-border-radius-sm);
......@@ -90,7 +88,6 @@ $input-border: 1px solid $input-border-color;
.gf-form-pre {
display: block;
flex-grow: 1;
font-size: $font-size-sm;
margin: 0;
margin-right: $gf-form-margin;
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