-
Notifications
You must be signed in to change notification settings - Fork 1
Drill down metrics #200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drill down metrics #200
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -58,7 +58,7 @@ export const TimeRangeContent = (props: Props) => { | |||
onApply: onApplyFromProps, | ||||
isReversed, | ||||
fiscalYearStartMonth, | ||||
onError, | ||||
// onError, | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Remove commented code or provide justification for temporary disabling. You commented out the onError prop destructuring, but the onError callback is still used in the commented onPaste function. This creates confusion about the intended behavior. If this functionality is being permanently removed, clean up all related code: - // onError, If it's temporary, add a comment explaining why and when it will be restored. 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||
weekStart, | ||||
} = props; | ||||
const [fromValue, toValue] = valueToState(value.raw.from, value.raw.to, timeZone); | ||||
|
@@ -112,28 +112,28 @@ export const TimeRangeContent = (props: Props) => { | |||
} | ||||
}; | ||||
|
||||
const onCopy = () => { | ||||
const raw: RawTimeRange = { from: from.value, to: to.value }; | ||||
navigator.clipboard.writeText(JSON.stringify(raw)); | ||||
}; | ||||
|
||||
const onPaste = async () => { | ||||
const raw = await navigator.clipboard.readText(); | ||||
let range; | ||||
|
||||
try { | ||||
range = JSON.parse(raw); | ||||
} catch (error) { | ||||
if (onError) { | ||||
onError(raw); | ||||
} | ||||
return; | ||||
} | ||||
|
||||
const [fromValue, toValue] = valueToState(range.from, range.to, timeZone); | ||||
setFrom(fromValue); | ||||
setTo(toValue); | ||||
}; | ||||
// const onCopy = () => { | ||||
// const raw: RawTimeRange = { from: from.value, to: to.value }; | ||||
// navigator.clipboard.writeText(JSON.stringify(raw)); | ||||
// }; | ||||
|
||||
// const onPaste = async () => { | ||||
// const raw = await navigator.clipboard.readText(); | ||||
// let range; | ||||
|
||||
// try { | ||||
// range = JSON.parse(raw); | ||||
// } catch (error) { | ||||
// if (onError) { | ||||
// onError(raw); | ||||
// } | ||||
// return; | ||||
// } | ||||
|
||||
// const [fromValue, toValue] = valueToState(range.from, range.to, timeZone); | ||||
// setFrom(fromValue); | ||||
// setTo(toValue); | ||||
// }; | ||||
GurinderRawala marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
|
||||
const fiscalYear = rangeUtil.convertRawToRange({ from: 'now/fy', to: 'now/fy' }, timeZone, fiscalYearStartMonth); | ||||
const fiscalYearMessage = t('time-picker.range-content.fiscal-year', 'Fiscal year'); | ||||
|
@@ -197,7 +197,7 @@ export const TimeRangeContent = (props: Props) => { | |||
</div> | ||||
|
||||
<div className={style.buttonsContainer}> | ||||
<Button | ||||
{/* <Button | ||||
data-testid={selectors.components.TimePicker.copyTimeRange} | ||||
icon="copy" | ||||
variant="secondary" | ||||
|
@@ -212,13 +212,13 @@ export const TimeRangeContent = (props: Props) => { | |||
tooltip={t('time-picker.copy-paste.tooltip-paste', 'Paste time range')} | ||||
type="button" | ||||
onClick={onPaste} | ||||
/> | ||||
/> */} | ||||
<Button | ||||
data-testid={selectors.components.TimePicker.applyTimeRange} | ||||
type="button" | ||||
onClick={onApply} | ||||
style={{ | ||||
width: 193, | ||||
width: 205, | ||||
textAlign: 'center', | ||||
paddingLeft: 45, | ||||
}} | ||||
|
Uh oh!
There was an error while loading. Please reload this page.