getavalon / core

The safe post-production pipeline - https://getavalon.github.io/2.0
MIT License
214 stars 48 forks source link

Fix#289: Validate subset name for database #448

Closed davidlatwe closed 4 years ago

davidlatwe commented 4 years ago

This PR resolve #289, Creator will ensure the subset name is valid for MongoDB.

What's changed?

davidlatwe commented 4 years ago

Demo

creator

tokejepsen commented 4 years ago

Maybe this is helping the users too much, but maybe the "Invalid subset name..." message could tell the users which characters are invalid?

davidlatwe commented 4 years ago

Yeah, I thought about that, too. But seems complex to implement :worried:

tokejepsen commented 4 years ago

Hmm since the "Create" button gets invalidated, it might not be a must have. Great work!

davidlatwe commented 4 years ago

Haha, turns out it's not that hard :P Implemented in commit 79ed093, and here's the demo (Note that the space char will be quoted)

creator

What do you think ?

tokejepsen commented 4 years ago

Amazing!

davidlatwe commented 4 years ago

Wait, it seems that QLineEdit already has a feature to validate the input text, QLineEdit.setValidator. Well try this when I get back from 2 days vacation.

davidlatwe commented 4 years ago

I have change to use QValidator to block invalid inputs, also add a tool tip. Here the result :

creator

Note that the invalid characters will not be accepted at all, so I add a border color transition animation for better feedback.

Please let me know what you think about this change :)

tokejepsen commented 4 years ago

Looks great!

mottosso commented 4 years ago

I love it!

davidlatwe commented 4 years ago

Well merge this tomorrow !