Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { DataTransformerConfig } from '@grafana/data';
import { toDataFrame } from '../../dataframe/processDataFrame';
import { FieldType } from '../../types';
import { mockTransformationsRegistry } from '../../utils/tests/mockTransformationsRegistry';
import { ArrayVector } from '../../vector';
import { transformDataFrame } from '../transformDataFrame';

import { DataTransformerID } from './ids';
Expand Down Expand Up @@ -96,13 +95,13 @@ describe('SplitBy transformer', () => {
{
name: 'time',
type: FieldType.time,
values: new ArrayVector([3000]),
values: [3000],
config: {},
},
{
name: 'values',
type: FieldType.number,
values: new ArrayVector([1]),
values: [1],
config: { unit: 'm' },
},
],
Expand All @@ -114,13 +113,13 @@ describe('SplitBy transformer', () => {
{
name: 'time',
type: FieldType.time,
values: new ArrayVector([4000, 5000]),
values: [4000, 5000],
config: {},
},
{
name: 'values',
type: FieldType.number,
values: new ArrayVector([2, 2]),
values: [2, 2],
config: { unit: 'm' },
},
],
Expand All @@ -132,13 +131,13 @@ describe('SplitBy transformer', () => {
{
name: 'time',
type: FieldType.time,
values: new ArrayVector([6000, 7000, 8000]),
values: [6000, 7000, 8000],
config: {},
},
{
name: 'values',
type: FieldType.number,
values: new ArrayVector([3, 3, 3]),
values: [3, 3, 3],
config: { unit: 'm' },
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { map } from 'rxjs/operators';

import { DataFrame } from '../../types/dataFrame';
import { SynchronousDataTransformerInfo } from '../../types/transformations';
import { ArrayVector } from '../../vector/ArrayVector';
import { fieldMatchers } from '../matchers';
import { FieldMatcherID } from '../matchers/ids';

Expand All @@ -24,7 +23,7 @@ export const splitByTransformer: SynchronousDataTransformerInfo<SplitByTransform
field: '',
},

operator: (options, ctx) => (source) =>
operator: (options, ctx) => (source) =>
source.pipe(map((data) => splitByTransformer.transformer(options, ctx)(data))),

transformer: (options: SplitByTransformerOptions) => (data: DataFrame[]) => {
Expand Down Expand Up @@ -57,7 +56,7 @@ export const splitByTransformer: SynchronousDataTransformerInfo<SplitByTransform
name: field.name,
type: field.type,
config: { ...field.config },
values: new ArrayVector(groups[group].map(ix => field.values.get(ix)))
values: groups[group].map(ix => field.values[ix])
}))
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const EmptyState = ({
children,
image,
message,
hideImage = false,
hideImage = true,
variant,
role,
}: React.PropsWithChildren<Props>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function getQueryEditorStyles(theme: GrafanaTheme2) {
},
},
'.query-segment-operator': {
color: #009b65 !important,
color: 'rgb(0, 155, 101) !important',
},
'.tight-form-func': {
background: theme.colors.background.secondary,
Expand Down
14 changes: 7 additions & 7 deletions pkg/services/navtree/navtreeimpl/navtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@
hasAccess := ac.HasAccess(s.accessControl, c)
treeRoot := &navtree.NavTreeRoot{}

treeRoot.AddSection(s.getHomeNode(c, prefs))
//treeRoot.AddSection(s.getHomeNode(c, prefs))

if hasAccess(ac.EvalPermission(dashboards.ActionDashboardsRead)) {
if hasAccess(ac.EvalPermission(dashboards.ActionDashboardsRead)) && false {
starredItemsLinks, err := s.buildStarredItemsNavLinks(c)
if err != nil {
return nil, err
Expand Down Expand Up @@ -130,7 +130,7 @@
})
}

if hasAccess(ac.EvalPermission(ac.ActionDatasourcesExplore)) {
if hasAccess(ac.EvalPermission(ac.ActionDatasourcesExplore)) && false {
drilldownChildNavLinks := s.buildDrilldownNavLinks(c)
treeRoot.AddSection(&navtree.NavLink{
Text: "Drilldown",
Expand All @@ -144,12 +144,12 @@
})
}

if s.cfg.ProfileEnabled && c.IsSignedIn {
if s.cfg.ProfileEnabled && c.IsSignedIn && false {
treeRoot.AddSection(s.getProfileNode(c))
}

_, uaIsDisabledForOrg := s.cfg.UnifiedAlerting.DisabledOrgs[c.SignedInUser.GetOrgID()]
uaVisibleForOrg := s.cfg.UnifiedAlerting.IsEnabled() && !uaIsDisabledForOrg
uaVisibleForOrg := s.cfg.UnifiedAlerting.IsEnabled() && !uaIsDisabledForOrg && false

if uaVisibleForOrg {
if alertingSection := s.buildAlertNavLinks(c); alertingSection != nil {
Expand All @@ -163,7 +163,7 @@

orgAdminNode, err := s.getAdminNode(c)

if orgAdminNode != nil && len(orgAdminNode.Children) > 0 {
if orgAdminNode != nil && len(orgAdminNode.Children) > 0 && false {
treeRoot.AddSection(orgAdminNode)
} else if err != nil {
return nil, err
Expand All @@ -184,7 +184,7 @@
treeRoot.RemoveSectionByID(navtree.NavIDCfg)
}

if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagPinNavItems) && c.IsSignedIn {
if s.features.IsEnabled(c.Req.Context(), featuremgmt.FlagPinNavItems) && c.IsSignedIn && false {
treeRoot.AddSection(&navtree.NavLink{
Text: "Bookmarks",
Id: navtree.NavIDBookmarks,
Expand All @@ -199,7 +199,7 @@
return treeRoot, nil
}

func (s *ServiceImpl) getHomeNode(c *contextmodel.ReqContext, prefs *pref.Preference) *navtree.NavLink {

Check failure on line 202 in pkg/services/navtree/navtreeimpl/navtree.go

View workflow job for this annotation

GitHub Actions / lint-go

func `(*ServiceImpl).getHomeNode` is unused (unused)
homeUrl := s.cfg.AppSubURL + "/"
if !c.IsSignedIn && !s.cfg.Anonymous.Enabled {
homeUrl = s.cfg.AppSubURL + "/login"
Expand Down
2 changes: 1 addition & 1 deletion public/app/core/components/AppChrome/AppChrome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const getStyles = (theme: GrafanaTheme2, hasActions: boolean) => {
content: css({
display: 'flex',
flexDirection: 'column',
paddingTop: hasActions ? TOP_BAR_LEVEL_HEIGHT * 2 : TOP_BAR_LEVEL_HEIGHT,
paddingTop: hasActions ? TOP_BAR_LEVEL_HEIGHT : 0,
flexGrow: 1,
height: 'auto',
}),
Expand Down
4 changes: 2 additions & 2 deletions public/app/core/components/AppChrome/AppChromeService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ export class AppChromeService {
if (kioskMode || chromeless) {
return 0;
} else if (actions) {
return TOP_BAR_LEVEL_HEIGHT * 2;
} else {
return TOP_BAR_LEVEL_HEIGHT;
} else {
return 0;
}
})
)
Expand Down
4 changes: 2 additions & 2 deletions public/app/core/components/AppChrome/MegaMenu/MegaMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ export const MegaMenu = memo(
const [patchPreferences] = usePatchUserPreferencesMutation();
const pinnedItems = usePinnedItems();

// Remove profile + help from tree
// Remove profile + help from tree (NI fork additionally removes Explore and Connections)
const navItems = navTree
.filter((item) => item.id !== 'profile' && item.id !== 'help')
.filter((item) => item.id !== 'profile' && item.id !== 'help' && item.id !== 'explore' && item.id !== 'connections')
.map((item) => enrichWithInteractionTracking(item, state.megaMenuDocked));

if (config.featureToggles.pinNavItems) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { css } from '@emotion/css';

import { GrafanaTheme2 } from '@grafana/data';
import { IconButton, Stack, ToolbarButton, useTheme2 } from '@grafana/ui';
import { IconButton, Stack, useTheme2 } from '@grafana/ui';
import { useGrafana } from 'app/core/context/GrafanaContext';
import { t } from 'app/core/internationalization';

import { Branding } from '../../Branding/Branding';
import { OrganizationSwitcher } from '../OrganizationSwitcher/OrganizationSwitcher';
import { TOP_BAR_LEVEL_HEIGHT } from '../types';

export interface Props {
Expand All @@ -27,17 +25,26 @@ export function MegaMenuHeader({ handleMegaMenu, handleDockedMenu, onClose }: Pr
return (
<div className={styles.header}>
<Stack alignItems="center" minWidth={0} gap={0.25}>
<ToolbarButton
{ // begin NI fork changes
<IconButton
onClick={handleMegaMenu}
tooltip={t('navigation.megamenu.close', 'Close menu')}
name='arrow-from-right'
style={{ transform: 'rotate(180deg)' }}
>
</IconButton>
/* <ToolbarButton
narrow
id={MEGA_MENU_HEADER_TOGGLE_ID}
onClick={handleMegaMenu}
tooltip={t('navigation.megamenu.close', 'Close menu')}
>
>
<Branding.MenuLogo className={styles.img} />
</ToolbarButton>
<OrganizationSwitcher />
<OrganizationSwitcher /> */
}
</Stack>
<IconButton
{/* <IconButton
id={DOCK_MENU_BUTTON_ID}
className={styles.dockMenuButton}
tooltip={
Expand All @@ -56,7 +63,9 @@ export function MegaMenuHeader({ handleMegaMenu, handleDockedMenu, onClose }: Pr
onClick={onClose}
size="xl"
variant="secondary"
/>
/> */
// end NI fork changes
}
</div>
);
}
Expand Down
33 changes: 21 additions & 12 deletions public/app/core/components/AppChrome/TopBar/SingleTopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import { cloneDeep } from 'lodash';
import { memo } from 'react';

import { GrafanaTheme2, NavModelItem } from '@grafana/data';
import { Dropdown, Icon, Stack, ToolbarButton, useStyles2 } from '@grafana/ui';
import { Dropdown, IconButton, Stack, ToolbarButton, useStyles2 } from '@grafana/ui';
import { config } from 'app/core/config';
import { useGrafana } from 'app/core/context/GrafanaContext';
import { contextSrv } from 'app/core/core';
import { t } from 'app/core/internationalization';
import { HOME_NAV_ID } from 'app/core/reducers/navModel';
import { useSelector } from 'app/types';

import { Branding } from '../../Branding/Branding';
import { Breadcrumbs } from '../../Breadcrumbs/Breadcrumbs';
import { buildBreadcrumbs } from '../../Breadcrumbs/utils';
import { HistoryContainer } from '../History/HistoryContainer';
Expand Down Expand Up @@ -52,27 +51,37 @@ export const SingleTopBar = memo(function SingleTopBar({
const homeNav = useSelector((state) => state.navIndex)[HOME_NAV_ID];
const breadcrumbs = buildBreadcrumbs(sectionNav, pageNav, homeNav);
const unifiedHistoryEnabled = config.featureToggles.unifiedHistory;
const hideBarStyle: React.CSSProperties = breadcrumbs.length > 1 ? { display: 'none' } : {};

return (
<div className={styles.layout}>
<div className={styles.layout} style={hideBarStyle}>
<Stack minWidth={0} gap={0.5} alignItems="center">
{!menuDockedAndOpen && (
<ToolbarButton
narrow
// begin NI fork changes
<IconButton
id={MEGA_MENU_TOGGLE_ID}
onClick={onToggleMegaMenu}
tooltip={t('navigation.megamenu.open', 'Open menu')}
name='arrow-from-right'
>
<Stack gap={0} alignItems="center">
<Branding.MenuLogo className={styles.img} />
<Icon size="sm" name="angle-down" />
</Stack>
</ToolbarButton>
)}
</IconButton>
// <ToolbarButton
// narrow
// id={MEGA_MENU_TOGGLE_ID}
// onClick={onToggleMegaMenu}
// tooltip={t('navigation.megamenu.open', 'Open menu')}
// >
// <Stack gap={0} alignItems="center">
// <Branding.MenuLogo className={styles.img} />
// <Icon size="sm" name="angle-down" />
// </Stack>
// </ToolbarButton>
// end NI fork changes
)}
<Breadcrumbs breadcrumbs={breadcrumbs} className={styles.breadcrumbsWrapper} />
</Stack>

<Stack gap={0.5} alignItems="center">
<Stack gap={0.5} alignItems="center" style={{ display: 'none'}}>
<TopSearchBarCommandPaletteTrigger />
{unifiedHistoryEnabled && <HistoryContainer />}
<QuickAdd />
Expand Down
2 changes: 1 addition & 1 deletion public/app/core/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export interface Props {
hideEdition?: boolean;
}

export const Footer = React.memo(({ customLinks, hideEdition }: Props) => {
export const Footer = memo(({ customLinks, hideEdition }: Props) => {
const links = (customLinks || getFooterLinks());
const styles = useStyles2(getStyles);

Expand Down
2 changes: 2 additions & 0 deletions public/app/core/components/Page/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const getStyles = (theme: GrafanaTheme2) => {
pageInner: css({
label: 'page-inner',
padding: theme.spacing(2),
paddingTop: theme.spacing.x8, // NI fork changes
borderBottom: 'none',
background: theme.colors.background.primary,
display: 'flex',
Expand All @@ -119,6 +120,7 @@ const getStyles = (theme: GrafanaTheme2) => {

[theme.breakpoints.up('md')]: {
padding: theme.spacing(4),
paddingTop: theme.spacing.x8, // NI fork changes
},
}),
canvasContent: css({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ function getStyles(theme: GrafanaTheme2) {
justifySelf: 'left',
}),
operator: css({
color: theme.v1.palette.orange,
color: 'rgb(0, 155, 101)',
}),
};
}
Loading