Skip to content
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

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

jtuckerfubo
Copy link
Collaborator

No description provided.

jtuckerfubo and others added 2 commits October 8, 2024 09:56
Co-authored-by: Bronley Plumb <bronley@gmail.com>
autorun management functions in a dialog. Functions include adding,
copying, removing, and managing order of autoruns.
@jtuckerfubo jtuckerfubo marked this pull request as ready for review October 11, 2024 02:35
Comment on lines 8 to 13
let runTable;
let runNameInput;
let runNameDialog;
let runNameDialogValue;
let confirmDialog;
let showContent = false;
Copy link
Member

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.

Copy link
Collaborator Author

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 = () => {
Copy link
Member

@TwitchBronBron TwitchBronBron Nov 5, 2024

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() { 
    ....

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

}
};

const copyRun = (e) => {
Copy link
Member

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

Comment on lines 53 to 75
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();
})
Copy link
Member

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@chrisdp chrisdp linked an issue Nov 22, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple named automations
3 participants