-
Notifications
You must be signed in to change notification settings - Fork 25
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
Main "open initiative" button should always open something (even if URL isn't configured) #415
Comments
but if this initiative doesn't have a website?
|
As I see it, that button doesn't mean "initiative website" as much as it means "main initiative link" |
It's not on the frontend level, maybe they can add warning sign next to initiative, that with hover, say that link.url is empty. but it should be done on validation level. link url is the exact purpose of been the main link.
|
@4tal I agree this is a workaround, which is why I stated the following in the issue (see the bottom line, below the image):
Yes, we could add validation for this specific field, but I think we might as well do an easy fallback on the frontend side until we have the proper schema validation at the PR validation level (which would validate all fields - not just |
Got It. Agree |
so what are the conclusions? |
Fallback by some order that makes sense like
|
For the main button try to assign url, if not url, website, than, whatsapp, facebook, instagram and the order of the rest is not that important just Or operator. |
For example: https://github.com/4tals/LinksForIsrael/blob/e56214883eab6b5e59c826de7ec779127cfd24c8/_data/links/GeneralAssistance/links.json#L6C15-L6C15
Since the url property is not defined, the main button doesn't do anything (you must click the WhatsApp icon):
We need to fall back to one of the links that do exist, at least until we enforce mandatory properties with #293
The text was updated successfully, but these errors were encountered: