Skip to content

Commit 8041e83

Browse files
authored
fix: make the autorefresh wording context specific (#4167)
1 parent d919638 commit 8041e83

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

src/dashboards/components/AutoRefreshOverlay.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import './AutoRefresh.scss'
3737

3838
// Metrics
3939
import {event} from 'src/cloud/utils/reporting'
40+
import {PROJECT_NAME} from 'src/flows'
4041

4142
enum TIMEOUT_CATEGORY {
4243
Minutes = 'Minutes',
@@ -206,8 +207,16 @@ const AutoRefreshOverlay: FC = () => {
206207
refreshMilliseconds,
207208
])
208209

210+
let refreshContext = 'Dashboards'
211+
212+
if (params.id.toLowerCase().includes(PROJECT_NAME.toLowerCase())) {
213+
refreshContext = PROJECT_NAME
214+
}
215+
209216
const handleCancel = () => {
210-
event('dashboards.autorefresh.autorefreshoverlay.cancelcustom')
217+
event(
218+
`${refreshContext.toLowerCase()}.autorefresh.autorefreshoverlay.cancelcustom`
219+
)
211220
onClose()
212221
}
213222

@@ -231,7 +240,7 @@ const AutoRefreshOverlay: FC = () => {
231240
>
232241
<FlexBox.Child>
233242
<div className="refresh-form-container-title">
234-
Refresh Dashboard Until
243+
Refresh {refreshContext} Until
235244
</div>
236245
<SelectGroup shape={ButtonShape.StretchToFit}>
237246
{refreshOptions.map(option => (
@@ -270,7 +279,7 @@ const AutoRefreshOverlay: FC = () => {
270279
<FlexBox.Child className="refresh-form-container">
271280
<div className="refresh-form-container-title">Refresh Interval</div>
272281
<div className="refresh-form-container-description">
273-
How often your dashboard will refresh
282+
How often your {refreshContext.toLowerCase()} will refresh
274283
</div>
275284
<AutoRefreshInput
276285
handleRefreshMilliseconds={handleRefreshMilliseconds}
@@ -280,7 +289,7 @@ const AutoRefreshOverlay: FC = () => {
280289
<FlexBox.Child className="refresh-form-container">
281290
<div className="refresh-form-container-title">Inactivity Timeout</div>
282291
<div className="refresh-form-container-description">
283-
When your dashboard refresh will timeout
292+
When your {refreshContext.toLowerCase()} refresh will timeout
284293
</div>
285294
<div className="refresh-inactivity-timeout-container">
286295
<div className="refresh-inactivity-timeout-num">

src/variables/components/VariablesTab.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ jest.mock('src/flows/components/ShareOverlay', () => {
99
return () => <></>
1010
})
1111

12+
jest.mock('src/flows', () => {
13+
return () => <></>
14+
})
15+
1216
jest.mock('src/client/generatedRoutes.ts', () => ({
1317
...jest.requireActual('src/client/generatedRoutes.ts'),
1418
postVariable: jest.fn(() => {

0 commit comments

Comments
 (0)