Skip to content

Commit

Permalink
EPMRPP-89534 || Migrate service API dates from ms to microseconds UI …
Browse files Browse the repository at this point in the history
…issues
  • Loading branch information
BlazarQSO committed May 21, 2024
1 parent 0dfd0c3 commit c43f85f
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const calculateTooltipParams = (data, color, customProps) => {

return {
itemName: `${name} #${number}`,
startTime: Number(startTime),
startTime: new Date(startTime).getTime(),
itemCases: `${value} ${formatMessage(messages.cases)}`,
color: color(id),
issueStatNameProps: { itemName: formatMessage(statusLocalization[FAILED]) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const calculateTooltipParams = (data, color, customProps) => {

return {
itemName: isTimeline ? date : `${name} #${number}`,
startTime: isTimeline ? null : Number(startTime),
startTime: isTimeline ? null : new Date(startTime).getTime(),
itemCases: `${Number(value).toFixed(2)}%`,
color: color(id),
issueStatNameProps: { itemName: messages[id] ? formatMessage(messages[id]) : id },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const calculateTooltipParams = (data, color, customProps) => {

return {
itemName: isTimeline ? date : `${name} #${number}`,
startTime: isTimeline ? null : Number(startTime),
startTime: isTimeline ? null : new Date(startTime).getTime(),
itemCases: `${value} ${formatMessage(messages.cases)}`,
color: color(id),
issueStatNameProps: { itemName: id, defectTypes, formatMessage },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const calculateTooltipParams = (data, color, customProps) => {

return {
itemName: `${name} #${number}`,
startTime: Number(startTime),
startTime: new Date(startTime).getTime(),
itemCases: `${value}%`,
color: color(id),
issueStatNameProps: { itemName: id, defectTypes, noTotal: true, formatMessage },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const calculateTooltipParams = (data, color, customProps) => {

return {
itemName: `${name} #${number}`,
startTime: Number(startTime),
startTime: new Date(startTime).getTime(),
itemCases: `${Number(value).toFixed(2)}%`,
color: color(id),
issueStatNameProps: { itemName: formatMessage(messages.failedSkippedTotal) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const calculateTooltipParams = (data, color, customProps) => {

return {
itemName: isTimeline ? date : `${name} #${number}`,
startTime: isTimeline ? '' : dateFormat(Number(startTime)),
startTime: isTimeline ? '' : dateFormat(new Date(startTime).getTime()),
growth,
growthClass,
total,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export class ProjectActivity extends Component {
{ActivityComponent}
<AbsRelTime
setStartTimeFormatAction={START_TIME_FORMAT_ABSOLUTE}
startTime={+activity.lastModified}
startTime={new Date(activity.lastModified).getTime()}
customClass={cx('time')}
/>
</div>
Expand Down
13 changes: 7 additions & 6 deletions app/src/pages/inside/common/itemInfo/itemInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ export class ItemInfo extends Component {
hideDescription,
} = this.props;

const startTime = new Date(value.startTime).getTime();
const endTime = new Date(value.endTime).getTime();

const autoAnalysisLabel = value.analysing?.find(
(item) => item === ANALYZER_TYPES.AUTO_ANALYZER || item === ANALYZER_TYPES.CLUSTER_ANALYSER,
);
Expand Down Expand Up @@ -213,23 +216,21 @@ export class ItemInfo extends Component {
withPreloader
/>
))}
{value.startTime && (
{startTime && (
<span className={cx('duration-block')}>
<DurationBlock
type={value.type}
status={value.status}
itemNumber={value.number}
timing={{
start: value.startTime,
end: value.endTime,
start: startTime,
end: endTime,
approxTime: value.approximateDuration,
}}
/>
</span>
)}
{value.startTime && (
<div className={cx('mobile-start-time')}>{fromNowFormat(value.startTime)}</div>
)}
{startTime && <div className={cx('mobile-start-time')}>{fromNowFormat(startTime)}</div>}
{value.hasRetries && (
<div className={cx('retry-icon')} title={intl.formatMessage(messages.retryTooltip)}>
{Parser(RetryIcon)}
Expand Down

0 comments on commit c43f85f

Please sign in to comment.