diff --git a/src/plugins/charts/common/static/components/collections.ts b/src/plugins/charts/common/static/components/collections.ts index 1f138ab9f7b0e..acb11c647fead 100644 --- a/src/plugins/charts/common/static/components/collections.ts +++ b/src/plugins/charts/common/static/components/collections.ts @@ -20,6 +20,7 @@ export const LabelRotation = Object.freeze({ Horizontal: 0, Vertical: 90, Angled: 75, + VerticalRotation: 270, }); export type LabelRotation = $Values; diff --git a/src/plugins/expressions/common/execution/execution.ts b/src/plugins/expressions/common/execution/execution.ts index 1e010be4e9557..246109499bd5c 100644 --- a/src/plugins/expressions/common/execution/execution.ts +++ b/src/plugins/expressions/common/execution/execution.ts @@ -420,21 +420,20 @@ export class Execution< : of(resolvedArgs); return args$.pipe( - // @ts-expect-error upgrade to ts v4.7.4 - tap((args) => this.execution.params.debug && Object.assign(head.debug, { args })), + tap((args) => this.execution.params.debug && Object.assign(head.debug ?? {}, { args })), switchMap((args) => this.invokeFunction(fn, input, args)), this.execution.params.partial ? identity : last(), switchMap((output) => (getType(output) === 'error' ? throwError(output) : of(output))), - // @ts-expect-error upgrade to ts v4.7.4 - tap((output) => this.execution.params.debug && Object.assign(head.debug, { output })), + tap( + (output) => this.execution.params.debug && Object.assign(head.debug ?? {}, { output }) + ), switchMap((output) => this.invokeChain(tail, output)), catchError((rawError) => { const error = createError(rawError); error.error.message = `[${fnName}] > ${error.error.message}`; if (this.execution.params.debug) { - // @ts-expect-error upgrade to ts v4.7.4 - Object.assign(head.debug, { error, rawError, success: false }); + Object.assign(head.debug ?? {}, { error, rawError, success: false }); } return of(error); diff --git a/src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx b/src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx index 59e4a20c8aac1..0b16e538fb481 100644 --- a/src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx +++ b/src/plugins/vis_types/heatmap/public/editor/components/labels_panel.tsx @@ -25,7 +25,6 @@ interface LabelsPanelProps { } function LabelsPanel({ valueAxis, setValue, isNewLibrary }: LabelsPanelProps) { - // @ts-expect-error ts upgrade v4.7.4 const rotateLabels = valueAxis.labels.rotate === VERTICAL_ROTATION; const setValueAxisLabels = useCallback( @@ -44,7 +43,6 @@ function LabelsPanel({ valueAxis, setValue, isNewLibrary }: LabelsPanelProps) { const setRotateLabels = useCallback( (paramName: 'rotate', value: boolean) => - // @ts-expect-error ts upgrade v4.7.4 setValueAxisLabels(paramName, value ? VERTICAL_ROTATION : 0), [setValueAxisLabels] ); diff --git a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx index fa5d9547e8157..3310df7259df6 100644 --- a/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx +++ b/src/plugins/vis_types/xy/public/editor/components/options/metrics_axes/label_options.tsx @@ -13,7 +13,7 @@ import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { SelectOption, SwitchOption } from '@kbn/vis-default-editor-plugin/public'; -import { Labels } from '@kbn/charts-plugin/public'; +import type { LabelRotation, Labels } from '@kbn/charts-plugin/public'; import { TruncateLabelsOption } from '../../common'; import { getRotateOptions } from '../../../collections'; @@ -34,8 +34,8 @@ function LabelOptions({ }: LabelOptionsProps) { const setAxisLabelRotate = useCallback( (paramName: 'rotate', value: Labels['rotate']) => { - // @ts-expect-error ts upgrade v4.7.4 - setAxisLabel(paramName, Number(value)); + const rotation = Number(value) as LabelRotation; + setAxisLabel(paramName, rotation); }, [setAxisLabel] );