influxdata / influxdata/ui

Notebooks/Tasks: Button not grayed out with an invalid time value in an offset field

Open
#3,786 0 comments 0 reactions 0 assignees View on GitHub
kind/bug severity/sev-4 team/automation team/ui team/unity
Dominant language
TypeScript
Stars
117
Forks
51
Avg merge
2d 15h
Merged PRs (30d)
4

Description

**Steps to reproduce:**
List the minimal actions needed to reproduce the behavior.

1. go to the Notebooks and create a new notebook
2. in the notebook, create a new task with an offset's [duration unit](https://docs.influxdata.com/flux/v0.x/spec/lexical-elements/#duration-literals) to be a week (w) or larger.

**Expected behavior:**
I expected the Export Tasks button to be grayed out as it is when you enter a day (d) as a duration unit for offset or an error to inform the user about a non-supported duration units.

**Actual behavior:**
The button isn't grayed out. Upon clicking it, an error pops up that says the duration unit is unknown, not informing the user that the unit is just not allowed in the offset field.

Similar behavior happens in the Tasks tab when the task is supposed to run after a certain interval passes. However, when you are using cron as a way to describe when the task should run, a different error pops up that says the largest supported duration unit for offset is an hour (h) which I believe was meant to pop up whenever the user used a duration unit in offset that is a day or larger.

**Visual Proof:**

Notebooks > When offset uses duration unit day (d), the Export Task button is grayed out

![notebooks_export_grayed_out](https://user-images.githubusercontent.com/97002262/152794603-ecbc4624-0f9d-4cf1-bf0f-d78ac803b210.png)

The button isn't grayed out when the offset duration unit is larger than a day. Once it's pressed, an error pops up that says the duration unit is unknown, which isn't true as I used the same duration unit for interval as well as offset and it only pops up the error for offset.

Intervals

![notebooks_tasks_every_error](https://user-images.githubusercontent.com/97002262/152795013-528899f2-3f14-435c-a0bf-867e5a468cda.png)

Cron

![notebooks_tasks_cron_error](https://user-images.githubusercontent.com/97002262/152795026-e66e0d28-5b5d-4151-900f-7848953e75cf.png)

Tasks > When offset uses duration unit day (d) or larger, and the task runs after a certain interval

![every_error](https://user-images.githubusercontent.com/97002262/152795324-b7082ba8-bf44-40a6-844a-b9dcc4e5c37b.png)

When offset uses duration unit day (d) or larger, and the task runs at the specific time using cron

![cron_error](https://user-images.githubusercontent.com/97002262/152795534-e3efc818-0cb6-4cdd-8f93-2db385ffd991.png)

The error on the last screenshot notifies the user about the set limitations to the offset field.
I believe this was meant to be the error to inform the user about said boundaries because units like a day (d), a week(w), a month (mo), and a year (y) exist; they are just not allowed in the offset field.

## About your environment

**Environment info:**
Testing K8S-IDPE Remocal

The latest commit in project UI
```
commit 65592aad01b9ddd369107e63c22227b075b9dd23 (HEAD -> master, origin/master, origin/HEAD)
Author: Chitlange Sahas
Date: Fri Feb 4 10:58:12 2022 -0700
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.