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

Handle the case of an empty rendered string in Plurr preview #467

Open
iafan opened this issue Apr 24, 2020 · 5 comments
Open

Handle the case of an empty rendered string in Plurr preview #467

iafan opened this issue Apr 24, 2020 · 5 comments
Assignees

Comments

@iafan
Copy link
Contributor

iafan commented Apr 24, 2020

When the rendered string is empty, let's provide a different message, e.g. "Empty string rendered", rather than saying "Please enter placeholder <...>" (see the screenshot)

@benjamimo1
Copy link

benjamimo1 commented Apr 27, 2020

@iafan By plurr we mean this: https://github.com/loctools/plurr ?

@iafan
Copy link
Contributor Author

iafan commented Apr 27, 2020

@benjamimo1 correct!

@iafan iafan changed the title Support '0' as a valid placeholder value in Plurr preview Handle the case of an empty rendered string in Plurr preview May 20, 2020
@benjamimo1 benjamimo1 self-assigned this May 20, 2020
benjamimo1 pushed a commit to benjamimo1/zing that referenced this issue May 20, 2020
@benjamimo1
Copy link

benjamimo1 commented May 20, 2020

If we input all necessary strings:
Screen Shot 2020-05-20 at 10 20 08

If we don't:
Screen Shot 2020-05-20 at 10 20 13

Is "Empty string rendered" a different case scenario as "Please enter placeholder"?
Are we aiming for two different message for each scenario? I don't understand how they are different.
Or should I just change the message altogether without a change in logic?
Or are we aiming for a partial rendering of the message using all inputs so far.
Do we consider the 0 value as an empty string? (Given the example you provided) or are we talking about #472

@iafan
Copy link
Contributor Author

iafan commented May 20, 2020

Yes, these are different cases. The first one is when you have missing (empty) placeholder values. The second one is an empty string as returned from Plurr formatting function.

In your screenshot above, you will never get an empty string in the output, regardless of the parameters. But there can be units which may produce an empty string as an output. See this example (try to change N to 0, 1, and 2)

@benjamimo1
Copy link

OK, will give it a look now, assuming two different cases.

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