import { BranchParameters } from '../types/branch-like';
import { Paging } from '../types/types';
-interface TimeMachineResponse {
+export interface TimeMachineResponse {
measures: {
metric: string;
history: Array<{ date: string; value?: string }>;
import { AppState } from '../../../types/appstate';
import { ExtensionStartMethod } from '../../../types/extension';
import { Dict, Extension as TypeExtension } from '../../../types/types';
-import { CurrentUser } from '../../../types/users';
+import { CurrentUser, HomePage } from '../../../types/users';
import * as theme from '../../theme';
import withAppStateContext from '../app-state/withAppStateContext';
import withCurrentUserContext from '../current-user/withCurrentUserContext';
location: Location;
options?: Dict<any>;
router: Router;
+ updateCurrentUserHomepage: (homepage: HomePage) => void;
}
interface State {
theme,
baseUrl: getBaseUrl(),
l10nBundle: getCurrentL10nBundle(),
+ // See SONAR-16207 and core-extension-governance/src/main/js/portfolios/components/Header.tsx
+ // for more information on why we're passing this as a prop to an extension.
+ updateCurrentUserHomepage: this.props.updateCurrentUserHomepage,
...this.props.options
});
intl={{} as IntlShape}
location={mockLocation()}
router={mockRouter()}
+ updateCurrentUserHomepage={jest.fn()}
{...props}
/>
);
"setRouteLeaveHook": [MockFunction],
}
}
+ updateCurrentUserHomepage={[MockFunction]}
>
<div>
<Helmet
"setRouteLeaveHook": [MockFunction],
}
}
+ updateCurrentUserHomepage={[MockFunction]}
>
<div>
<Helmet
import { arc as d3Arc, pie as d3Pie, PieArcDatum } from 'd3-shape';
import * as React from 'react';
-interface DataPoint {
+export interface DataPoint {
fill: string;
value: number;
}
});
}
-export function change(element: ShallowWrapper | ReactWrapper, value: string, event = {}): void {
+export function change(
+ element: ShallowWrapper | ReactWrapper,
+ value: string | object,
+ event = {}
+): void {
// `type()` returns a component constructor for a composite element and string for DOM nodes
if (typeof element.type() === 'function') {
element.prop<Function>('onChange')(value);
import { AppState } from './appstate';
import { L10nBundle } from './l10nBundle';
import { Component, Dict } from './types';
-import { CurrentUser } from './users';
+import { CurrentUser, HomePage } from './users';
export enum AdminPageExtension {
GovernanceConsole = 'governance/views_console'
};
baseUrl: string;
l10nBundle: L10nBundle;
+ // See SONAR-16207 and core-extension-governance/src/main/js/portfolios/components/Header.tsx
+ // for more information on why we're passing this as a prop to an extension.
+ updateCurrentUserHomepage: (homepage: HomePage) => void;
}
export type ExtensionStartMethodReturnType = React.ReactNode | Function | void | undefined | null;