mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
IconName: Move to grafana/data and use type on NavModelItem (#55013)
* IconName: Allow strings * Moving to grafana/data and adding type to NavModelItem * Removed any type * ts fix
This commit is contained in:
@@ -3,7 +3,7 @@ import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction, FolderDTO } from 'app/types';
|
||||
|
||||
export function buildNavModel(folder: FolderDTO): NavModelItem {
|
||||
const model = {
|
||||
const model: NavModelItem = {
|
||||
icon: 'folder',
|
||||
id: 'manage-folder',
|
||||
subTitle: 'Manage folder dashboards and permissions',
|
||||
@@ -21,7 +21,7 @@ export function buildNavModel(folder: FolderDTO): NavModelItem {
|
||||
],
|
||||
};
|
||||
|
||||
model.children.push({
|
||||
model.children!.push({
|
||||
active: false,
|
||||
icon: 'library-panel',
|
||||
id: `folder-library-panels-${folder.uid}`,
|
||||
@@ -30,7 +30,7 @@ export function buildNavModel(folder: FolderDTO): NavModelItem {
|
||||
});
|
||||
|
||||
if (contextSrv.hasPermission(AccessControlAction.AlertingRuleRead)) {
|
||||
model.children.push({
|
||||
model.children!.push({
|
||||
active: false,
|
||||
icon: 'bell',
|
||||
id: `folder-alerting-${folder.uid}`,
|
||||
@@ -40,7 +40,7 @@ export function buildNavModel(folder: FolderDTO): NavModelItem {
|
||||
}
|
||||
|
||||
if (folder.canAdmin) {
|
||||
model.children.push({
|
||||
model.children!.push({
|
||||
active: false,
|
||||
icon: 'lock',
|
||||
id: `folder-permissions-${folder.uid}`,
|
||||
@@ -50,7 +50,7 @@ export function buildNavModel(folder: FolderDTO): NavModelItem {
|
||||
}
|
||||
|
||||
if (folder.canSave) {
|
||||
model.children.push({
|
||||
model.children!.push({
|
||||
active: false,
|
||||
icon: 'cog',
|
||||
id: `folder-settings-${folder.uid}`,
|
||||
|
||||
Reference in New Issue
Block a user