Skip to content

Commit

Permalink
remove updatedTime prop
Browse files Browse the repository at this point in the history
  • Loading branch information
krkshitij committed Aug 2, 2023
1 parent 26e7853 commit 5fa18bf
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ export class CartesianChartBase extends React.Component<IModifiedCartesianChartP
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private _multiValueCallout = (calloutProps: any) => {
const yValueHoverSubCountsExists: boolean = this._yValueHoverSubCountsExists(calloutProps.YValueHover);
const { updatedTime } = this.props;

return (
<div className={this._classNames.calloutContentRoot}>
Expand Down Expand Up @@ -547,11 +546,12 @@ export class CartesianChartBase extends React.Component<IModifiedCartesianChartP
);
})}
</div>
{(!!calloutProps.descriptionMessage || !!updatedTime) && <div className={this._classNames.divider} />}
{!!calloutProps.descriptionMessage && (
<div className={this._classNames.descriptionMessage}>{calloutProps.descriptionMessage}</div>
<>
<div className={this._classNames.divider} />
<div className={this._classNames.descriptionMessage}>{calloutProps.descriptionMessage}</div>
</>
)}
{!!updatedTime && <div className={this._classNames.updatedTime}>Updated {updatedTime.toLocaleString()}</div>}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,5 @@ export const getStyles = (props: ICartesianChartStyleProps): ICartesianChartStyl
descriptionMessage: {
fontSize: FontSizes.small,
},

updatedTime: {
marginTop: '8px',
fontSize: FontSizes.small,
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,6 @@ export interface ICartesianChartStyles {
* Styles for the group divider in callout
*/
divider?: IStyle;

/**
* Styles for the updated time text in callout
*/
updatedTime?: IStyle;
}

export interface ICartesianChartProps {
Expand Down Expand Up @@ -386,11 +381,6 @@ export interface ICartesianChartProps {
* @defaultvalue ChartHoverCardVariant.ShortLegend
*/
calloutVariant?: ChartHoverCardVariant;

/**
* Time at which the chart data was last updated
*/
updatedTime?: Date;
}

export interface IYValueHover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ export class GaugeChartBase extends React.Component<IGaugeChartProps, IGaugeChar
// eslint-disable-next-line @typescript-eslint/no-explicit-any
private _multiValueCallout = (calloutProps: any) => {
const yValueHoverSubCountsExists: boolean = this._yValueHoverSubCountsExists(calloutProps.YValueHover);
const { updatedTime } = this.props;

return (
<div className={this._classNames.calloutContentRoot}>
Expand Down Expand Up @@ -556,11 +555,12 @@ export class GaugeChartBase extends React.Component<IGaugeChartProps, IGaugeChar
);
})}
</div>
{(!!calloutProps.descriptionMessage || !!updatedTime) && <div className={this._classNames.divider} />}
{!!calloutProps.descriptionMessage && (
<div className={this._classNames.descriptionMessage}>{calloutProps.descriptionMessage}</div>
<>
<div className={this._classNames.divider} />
<div className={this._classNames.descriptionMessage}>{calloutProps.descriptionMessage}</div>
</>
)}
{!!updatedTime && <div className={this._classNames.updatedTime}>Updated {updatedTime.toLocaleString()}</div>}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,5 @@ export const getStyles = (props: IGaugeChartStyleProps): IGaugeChartStyles => {
descriptionMessage: {
fontSize: FontSizes.small,
},

updatedTime: {
marginTop: '8px',
fontSize: FontSizes.small,
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,6 @@ export interface IGaugeChartProps {
* @defaultvalue ChartHoverCardVariant.ShortLegend
*/
calloutVariant?: ChartHoverCardVariant;

/**
* Time at which the chart data was last updated
*/
updatedTime?: Date;
}

export interface IGaugeChartStyleProps {
Expand Down Expand Up @@ -262,9 +257,4 @@ export interface IGaugeChartStyles {
* Styles for the group divider in callout
*/
divider?: IStyle;

/**
* Styles for the updated time text in callout
*/
updatedTime?: IStyle;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export class ChartHoverCardBase extends React.Component<IChartHoverCardProps, {}
private _classNames: IProcessedStyleSet<IChartHoverCardStyles>;

public render(): React.ReactNode {
const { color, Legend, XValue, YValue, styles, theme, ratio, descriptionMessage, culture, variant, updatedTime } =
this.props;
const { color, Legend, XValue, YValue, styles, theme, ratio, descriptionMessage, culture, variant } = this.props;

this._classNames = getClassNames(styles!, {
theme: theme!,
Expand Down Expand Up @@ -53,9 +52,12 @@ export class ChartHoverCardBase extends React.Component<IChartHoverCardProps, {}
)}
</div>
</div>
{(!!descriptionMessage || !!updatedTime) && <div className={this._classNames.divider} />}
{!!descriptionMessage && <div className={this._classNames.descriptionMessage}>{descriptionMessage}</div>}
{!!updatedTime && <div className={this._classNames.updatedTime}>Updated {updatedTime.toLocaleString()}</div>}
{!!descriptionMessage && (
<>
<div className={this._classNames.divider} />
<div className={this._classNames.descriptionMessage}>{descriptionMessage}</div>
</>
)}
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,5 @@ export const getChartHoverCardStyles = (props: IChartHoverCardStyleProps): IChar
marginTop: '8px',
marginBottom: '8px',
},

updatedTime: {
marginTop: '8px',
fontSize: FontSizes.small,
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ export interface IChartHoverCardProps {
* @defaultvalue ChartHoverCardVariant.ShortLegend
*/
variant?: ChartHoverCardVariant;

/**
* Time at which the chart data was last updated
*/
updatedTime?: Date;
}

export interface IChartHoverCardStyles {
Expand Down Expand Up @@ -121,11 +116,6 @@ export interface IChartHoverCardStyles {
* styles for the group divider
*/
divider?: IStyle;

/**
* styles for the updated time text
*/
updatedTime?: IStyle;
}

export interface IChartHoverCardStyleProps {
Expand Down

0 comments on commit 5fa18bf

Please sign in to comment.