Skip to content

Commit 0adf7a4

Browse files
Merge pull request #747 from bruin-data/fix/reset-date-button
Fix/reset date button
2 parents 14b1240 + f3b1905 commit 0adf7a4

6 files changed

Lines changed: 32 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Changelog
2+
## [0.79.7] - [2026-04-02]
3+
- Fixed reset date button for continuous pipelines: now resets to today's date range (start of day to now) instead of throwing an error.
4+
- Improved reset date button tooltip to clarify behavior based on pipeline schedule.
5+
26
## [0.79.6] - [2026-03-31]
37
- Fixed "Fill from Query" command failing due to unsupported `--environment` flag being passed to `fill-asset-dependencies`.
48

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ Bruin is a unified analytics platform that enables data professionals to work en
7070
## Release Notes
7171

7272
### Recent Update
73+
- **0.79.7**: Fixed reset date button for continuous pipelines; improved tooltip to clarify behavior.
7374
- **0.79.6**: Fixed "Fill from Query" command failing due to unsupported `--environment` flag.
7475
- **0.79.5**: Added interval modifiers preview tooltip on the checkbox.
7576
- **0.79.4**: Fixed "Fill from DB" to use selected environment; fixed start date input on full refresh.
7677
- **0.79.3**: Added ability to select and run SQL text directly in Query Preview.
77-
- **0.79.2**: Added cancel button for export query operations, allowing users to stop long-running exports.
7878

7979
For a full changelog, see Bruin Extension [Changelog](https://github.com/bruin-data/bruin-vscode/blob/main/CHANGELOG.md).

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "bruin",
33
"displayName": "Bruin",
44
"description": "Manage your Bruin data assets from within VS Code.",
5-
"version": "0.79.6",
5+
"version": "0.79.7",
66
"engines": {
77
"vscode": "^1.87.0"
88
},

webview-ui/src/components/asset/AssetGeneral.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<DateInput label="Start Date" v-model="startDate" />
1515
<DateInput label="End Date" v-model="endDate" />
1616
<div class="flex items-center gap-1 self-start xs:self-end">
17-
<button type="button" @click="resetDatesOnSchedule" :title="`Reset Start and End Date`"
17+
<button type="button" @click="resetDatesOnSchedule" :title="props.schedule === 'continuous' ? 'Reset dates to today (start of day to now)' : `Reset dates to the previous ${props.schedule || 'scheduled'} run interval`"
1818
class="rounded-sm bg-editor-button-bg p-1 text-editor-button-fg hover:bg-editor-button-hover-bg disabled:opacity-50 disabled:cursor-not-allowed">
1919
<ArrowPathRoundedSquareIcon class="h-3 w-3" aria-hidden="true" />
2020
</button>

webview-ui/src/test/webview.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,14 @@ suite("testing webview", () => {
395395
assert.strictEqual(endDateExclusive, "2023-07-10T19:59:59.999999999Z");
396396
});
397397

398+
test('test reset Start End Date for "continuous" schedule', () => {
399+
schedule = "continuous";
400+
resetStartEndDate(schedule, today, startDate, endDate);
401+
// For continuous: start = start of today (00:00 UTC), end = now
402+
assert.strictEqual(startDate.value, "2024-07-08T00:00:00.000Z");
403+
assert.strictEqual(endDate.value, "2024-07-08T05:23:00.000Z");
404+
});
405+
398406
test("test get previous run for invalid schedule", () => {
399407
schedule = "invalid";
400408
try {

webview-ui/src/utilities/helper.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,29 @@ export const getPreviousRun = (schedule: string, timestamp: number) => {
216216
return { startTime, endTime };
217217
};
218218

219-
export const resetStartEndDate = (schedule: string, today: number, startDate: { value: string }, endDate: { value: string }) => {
219+
export const resetStartEndDate = (schedule: string, today: number | Date, startDate: { value: string }, endDate: { value: string }) => {
220+
// Convert Date to timestamp if needed
221+
const timestamp = typeof today === "number" ? today : today.getTime();
222+
223+
// For continuous schedules, use sensible defaults: start of today to now
224+
if (schedule === "continuous") {
225+
const now = DateTime.fromMillis(timestamp).toUTC();
226+
const startOfDay = now.startOf("day");
227+
228+
startDate.value = startOfDay.toISO({ includeMillis: false });
229+
endDate.value = now.toISO({ includeMillis: false });
230+
231+
console.log("Continuous schedule - start:", startDate.value, "end:", endDate.value);
232+
return;
233+
}
234+
220235
const { startTime, endTime } = getPreviousRun(schedule, today);
221236
console.log("start date:", startDate.value, "end date:", endDate.value);
222237
console.log("today", today, "start time:", startTime, "end time:", endTime);
223238

224239
startDate.value = DateTime.fromMillis(startTime).toUTC().toISO({ includeMillis: false });
225240
endDate.value = DateTime.fromMillis(endTime).toUTC().toISO({ includeMillis: false });
226-
241+
227242
console.log("start:", startDate.value, "end:", endDate.value);
228243
};
229244

0 commit comments

Comments
 (0)