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:
Torkel Ödegaard
2022-09-12 20:09:33 +02:00
committed by GitHub
parent 64869e3d90
commit d59bb1e4c2
28 changed files with 262 additions and 261 deletions
@@ -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}`,