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

Main "open initiative" button should always open something (even if URL isn't configured) #415

Open
ohadschn opened this issue Nov 8, 2023 · 8 comments

Comments

@ohadschn
Copy link
Collaborator

ohadschn commented Nov 8, 2023

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):
image

We need to fall back to one of the links that do exist, at least until we enforce mandatory properties with #293

@omer-friedman
Copy link
Collaborator

but if this initiative doesn't have a website?
why don't we just remove this button if there is not initiative to open?
IMO mandatory fields should be:

  1. title
  2. informative description
  3. at least one of: whatsapp, linkedin, website, etc...

@ohadschn
Copy link
Collaborator Author

ohadschn commented Nov 8, 2023

but if this initiative doesn't have a website? why don't we just remove this button if there is not initiative to open? IMO mandatory fields should be:

  1. title
  2. informative description
  3. at least one of: whatsapp, linkedin, website, etc...

As I see it, that button doesn't mean "initiative website" as much as it means "main initiative link"
If the initiative is a WhatsApp group, that button should open the WhatsApp link

@4tal
Copy link
Collaborator

4tal commented Nov 9, 2023

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.

  1. Add to the PR validation check that link.url is not empty (I think there is).
  2. Add build check if exists link without URL.

@ohadschn
Copy link
Collaborator Author

ohadschn commented Nov 10, 2023

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.

  1. Add to the PR validation check that link.url is not empty (I think there is).
  2. Add build check if exists link without URL.

@4tal I agree this is a workaround, which is why I stated the following in the issue (see the bottom line, below the image):

We need to fall back to one of the links that do exist, at least until we enforce mandatory properties with #293

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 url).

@4tal
Copy link
Collaborator

4tal commented Nov 10, 2023

Got It. Agree

@omer-friedman
Copy link
Collaborator

so what are the conclusions?
fallback? to where?

@ohadschn
Copy link
Collaborator Author

ohadschn commented Nov 11, 2023

so what are the conclusions? fallback? to where?

Fallback by some order that makes sense like

  1. Website (IMO by far this is the most important - have this first, all the others below are open for debate and matter less)
  2. Facebook
  3. Instagram
  4. WhatsApp
  5. whatever...

@4tal
Copy link
Collaborator

4tal commented Nov 23, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready For Work
Development

No branches or pull requests

3 participants