-
Notifications
You must be signed in to change notification settings - Fork 40
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
added controls to display, select, add, and remove automation configs #599
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: Bronley Plumb <bronley@gmail.com>
autorun management functions in a dialog. Functions include adding, copying, removing, and managing order of autoruns.
(includes a column of button actions), also no commit style semantics
also graceful exit when run execution fails (for example when rta is confused by disabled app/channel)
let runTable; | ||
let runNameInput; | ||
let runNameDialog; | ||
let runNameDialogValue; | ||
let confirmDialog; | ||
let showContent = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ensure that all variables in this file have a typescript type assigned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
let confirmDialog; | ||
let showContent = false; | ||
|
||
const toggleDropDown = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's convert all of these to normal named functions. I.e.
function toggleDropdown() {
....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
} | ||
}; | ||
|
||
const copyRun = (e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convert this to an async function that leverages await
instead of using promises. (code is cleaner that way)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
new Promise((resolve, reject) => { | ||
let confirmDialogCallback; | ||
confirmDialog.addEventListener( | ||
'click', | ||
(confirmDialogCallback = (e) => { | ||
const button = e?.target?.id; | ||
if (button === 'YES') { | ||
resolve(); | ||
} else if (button === 'NO') { | ||
reject(); | ||
} else { | ||
return; | ||
} | ||
e.stopPropagation(); | ||
confirmDialog.removeEventListener( | ||
'click', | ||
confirmDialogCallback | ||
); | ||
confirmDialog.close(); | ||
}) | ||
); | ||
confirmDialog.showModal(); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move most of this to native svelte actions on the confirm dialog itself. You can store the selected run for use in that separate function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
also added an alert dialog, shown when user input (for run name) is invalid
No description provided.