GrafanaUI: mark all Log components deprecated (#55404)

This commit is contained in:
Sven Grossmann 2022-09-20 08:48:32 +02:00 committed by GitHub
parent caba98590d
commit 95ddfe8ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 26 additions and 7 deletions

View File

@ -22,8 +22,7 @@ import { LogDetailsRow } from './LogDetailsRow';
import { getLogRowStyles } from './getLogRowStyles'; import { getLogRowStyles } from './getLogRowStyles';
import { getAllFields } from './logParser'; import { getAllFields } from './logParser';
//Components /** @deprecated will be removed in the next major version */
export interface Props extends Themeable2 { export interface Props extends Themeable2 {
row: LogRowModel; row: LogRowModel;
showDuplicates: boolean; showDuplicates: boolean;
@ -176,5 +175,6 @@ class UnThemedLogDetails extends PureComponent<Props> {
} }
} }
/** @deprecated will be removed in the next major version */
export const LogDetails = withTheme2(UnThemedLogDetails); export const LogDetails = withTheme2(UnThemedLogDetails);
LogDetails.displayName = 'LogDetails'; LogDetails.displayName = 'LogDetails';

View File

@ -12,8 +12,7 @@ import { IconButton } from '../IconButton/IconButton';
import { LogLabelStats } from './LogLabelStats'; import { LogLabelStats } from './LogLabelStats';
import { getLogRowStyles } from './getLogRowStyles'; import { getLogRowStyles } from './getLogRowStyles';
//Components /** @deprecated will be removed in the next major version */
export interface Props extends Themeable2 { export interface Props extends Themeable2 {
parsedValue: string; parsedValue: string;
parsedKey: string; parsedKey: string;
@ -220,5 +219,6 @@ class UnThemedLogDetailsRow extends PureComponent<Props, State> {
} }
} }
/** @deprecated will be removed in the next major version */
export const LogDetailsRow = withTheme2(UnThemedLogDetailsRow); export const LogDetailsRow = withTheme2(UnThemedLogDetailsRow);
LogDetailsRow.displayName = 'LogDetailsRow'; LogDetailsRow.displayName = 'LogDetailsRow';

View File

@ -96,5 +96,6 @@ class UnThemedLogLabelStats extends PureComponent<Props> {
} }
} }
/** @deprecated will be removed in the next major version */
export const LogLabelStats = withTheme2(UnThemedLogLabelStats); export const LogLabelStats = withTheme2(UnThemedLogLabelStats);
LogLabelStats.displayName = 'LogLabelStats'; LogLabelStats.displayName = 'LogLabelStats';

View File

@ -51,6 +51,7 @@ const getStyles = (theme: GrafanaTheme2) => ({
`, `,
}); });
/** @deprecated will be removed in the next major version */
export interface Props { export interface Props {
active?: boolean; active?: boolean;
count: number; count: number;
@ -58,6 +59,7 @@ export interface Props {
value?: string; value?: string;
} }
/** @deprecated will be removed in the next major version */
export const LogLabelStatsRow: FunctionComponent<Props> = ({ active, count, proportion, value }) => { export const LogLabelStatsRow: FunctionComponent<Props> = ({ active, count, proportion, value }) => {
const style = useStyles2(getStyles); const style = useStyles2(getStyles);
const percent = `${Math.round(proportion * 100)}%`; const percent = `${Math.round(proportion * 100)}%`;

View File

@ -49,6 +49,7 @@ interface State {
prevValue: string; prevValue: string;
} }
/** @deprecated will be removed in the next major version */
export class UnThemedLogMessageAnsi extends PureComponent<Props, State> { export class UnThemedLogMessageAnsi extends PureComponent<Props, State> {
state: State = { state: State = {
chunks: [], chunks: [],

View File

@ -256,5 +256,6 @@ class UnThemedLogRow extends PureComponent<Props, State> {
} }
} }
/** @deprecated will be removed in the next major version */
export const LogRow = withTheme2(UnThemedLogRow); export const LogRow = withTheme2(UnThemedLogRow);
LogRow.displayName = 'LogRow'; LogRow.displayName = 'LogRow';

View File

@ -123,6 +123,7 @@ const LogRowContextGroupHeader: React.FunctionComponent<LogRowContextGroupHeader
); );
}; };
/** @deprecated will be removed in the next major version */
export const LogRowContextGroup: React.FunctionComponent<LogRowContextGroupProps> = ({ export const LogRowContextGroup: React.FunctionComponent<LogRowContextGroupProps> = ({
row, row,
rows, rows,
@ -184,6 +185,7 @@ export const LogRowContextGroup: React.FunctionComponent<LogRowContextGroupProps
); );
}; };
/** @deprecated will be removed in the next major version */
export const LogRowContext: React.FunctionComponent<LogRowContextProps> = ({ export const LogRowContext: React.FunctionComponent<LogRowContextProps> = ({
row, row,
context, context,

View File

@ -11,20 +11,25 @@ import {
DataQueryError, DataQueryError,
} from '@grafana/data'; } from '@grafana/data';
/** @deprecated will be removed in the next major version */
export interface RowContextOptions { export interface RowContextOptions {
direction?: 'BACKWARD' | 'FORWARD'; direction?: 'BACKWARD' | 'FORWARD';
limit?: number; limit?: number;
} }
/** @deprecated will be removed in the next major version */
export interface LogRowContextRows { export interface LogRowContextRows {
before?: string[]; before?: string[];
after?: string[]; after?: string[];
} }
/** @deprecated will be removed in the next major version */
export interface LogRowContextQueryErrors { export interface LogRowContextQueryErrors {
before?: string; before?: string;
after?: string; after?: string;
} }
/** @deprecated will be removed in the next major version */
export interface HasMoreContextRows { export interface HasMoreContextRows {
before: boolean; before: boolean;
after: boolean; after: boolean;
@ -48,6 +53,7 @@ interface LogRowContextProviderProps {
}) => JSX.Element; }) => JSX.Element;
} }
/** @deprecated will be removed in the next major version */
export const getRowContexts = async ( export const getRowContexts = async (
getRowContext: (row: LogRowModel, options?: RowContextOptions) => Promise<DataQueryResponse>, getRowContext: (row: LogRowModel, options?: RowContextOptions) => Promise<DataQueryResponse>,
row: LogRowModel, row: LogRowModel,
@ -130,6 +136,7 @@ export const getRowContexts = async (
}; };
}; };
/** @deprecated will be removed in the next major version */
export const LogRowContextProvider: React.FunctionComponent<LogRowContextProviderProps> = ({ export const LogRowContextProvider: React.FunctionComponent<LogRowContextProviderProps> = ({
getRowContext, getRowContext,
row, row,

View File

@ -16,8 +16,7 @@ import { LogRowContext } from './LogRowContext';
import { LogRowContextQueryErrors, HasMoreContextRows, LogRowContextRows } from './LogRowContextProvider'; import { LogRowContextQueryErrors, HasMoreContextRows, LogRowContextRows } from './LogRowContextProvider';
import { getLogRowStyles } from './getLogRowStyles'; import { getLogRowStyles } from './getLogRowStyles';
//Components /** @deprecated will be removed in the next major version */
export const MAX_CHARACTERS = 100000; export const MAX_CHARACTERS = 100000;
interface Props extends Themeable2 { interface Props extends Themeable2 {
@ -187,5 +186,6 @@ class UnThemedLogRowMessage extends PureComponent<Props> {
} }
} }
/** @deprecated will be removed in the next major version */
export const LogRowMessage = withTheme2(UnThemedLogRowMessage); export const LogRowMessage = withTheme2(UnThemedLogRowMessage);
LogRowMessage.displayName = 'LogRowMessage'; LogRowMessage.displayName = 'LogRowMessage';

View File

@ -8,6 +8,7 @@ import { Themeable2 } from '../../types/theme';
import { getAllFields } from './logParser'; import { getAllFields } from './logParser';
/** @deprecated will be removed in the next major version */
export interface Props extends Themeable2 { export interface Props extends Themeable2 {
row: LogRowModel; row: LogRowModel;
showDetectedFields: string[]; showDetectedFields: string[];
@ -45,5 +46,6 @@ class UnThemedLogRowMessageDetectedFields extends PureComponent<Props> {
} }
} }
/** @deprecated will be removed in the next major version */
export const LogRowMessageDetectedFields = withTheme2(UnThemedLogRowMessageDetectedFields); export const LogRowMessageDetectedFields = withTheme2(UnThemedLogRowMessageDetectedFields);
LogRowMessageDetectedFields.displayName = 'LogRowMessageDetectedFields'; LogRowMessageDetectedFields.displayName = 'LogRowMessageDetectedFields';

View File

@ -6,13 +6,14 @@ import { TimeZone, LogsDedupStrategy, LogRowModel, Field, LinkModel, LogsSortOrd
import { withTheme2 } from '../../themes/index'; import { withTheme2 } from '../../themes/index';
import { Themeable2 } from '../../types/theme'; import { Themeable2 } from '../../types/theme';
//Components
import { LogRow } from './LogRow'; import { LogRow } from './LogRow';
import { RowContextOptions } from './LogRowContextProvider'; import { RowContextOptions } from './LogRowContextProvider';
import { getLogRowStyles } from './getLogRowStyles'; import { getLogRowStyles } from './getLogRowStyles';
/** @deprecated will be removed in the next major version */
export const PREVIEW_LIMIT = 100; export const PREVIEW_LIMIT = 100;
/** @deprecated will be removed in the next major version */
export interface Props extends Themeable2 { export interface Props extends Themeable2 {
logRows?: LogRowModel[]; logRows?: LogRowModel[];
deduplicatedRows?: LogRowModel[]; deduplicatedRows?: LogRowModel[];

View File

@ -16,6 +16,8 @@ type FieldDef = {
/** /**
* Returns all fields for log row which consists of fields we parse from the message itself and additional fields * Returns all fields for log row which consists of fields we parse from the message itself and additional fields
* found in the dataframe (they may contain links). * found in the dataframe (they may contain links).
*
* @deprecated will be removed in the next major version
*/ */
export const getAllFields = memoizeOne( export const getAllFields = memoizeOne(
(row: LogRowModel, getFieldLinks?: (field: Field, rowIndex: number) => Array<LinkModel<Field>>) => { (row: LogRowModel, getFieldLinks?: (field: Field, rowIndex: number) => Array<LinkModel<Field>>) => {