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

Forbid copying link to an invalid expression #5

Open
atifaziz opened this issue Aug 16, 2020 · 4 comments
Open

Forbid copying link to an invalid expression #5

atifaziz opened this issue Aug 16, 2020 · 4 comments

Comments

@atifaziz
Copy link
Contributor

The “Copy Link” button silently copies a link even if the entered expression is invalid. The “Copy Link” button should be disabled if the expression is invalid.

@Swimburger
Copy link
Owner

This may be a weird case, but wouldn't it be okay to share a broken CRON expression?
If in a project a colleague sends you a CRON expression, but it's not valid, you could send them the link with the invalid expression, and they'll see the error message.
I don't see harm in leaving it this way. What do you think?

@atifaziz
Copy link
Contributor Author

I agree with you, but didn't want to create more work for now. Disabling seemed like the simplest thing to do first so a person doesn't do it accidentally. A better option (that I was going to propose as a separate issue) would be to add a checkbox that the user must tick to enable the copying button. That way, it would be a conscious decision (which would be rare) to copy an invalid expression.

@Swimburger
Copy link
Owner

Yes, that would complicate things. The lazy developer in me says to maybe use window.confirm to warn them?

@atifaziz
Copy link
Contributor Author

The lazy developer in me says to maybe use window.confirm to warn them?

Definitely, could be a start, but terrible UX. 😉 Is it a lot of work though? We already have a separate div displayed when there is an error so why not just add the checkbox in there? May be I am oversimplifying it but can take a crack if you'd like to pass.

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

No branches or pull requests

2 participants