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

Decide how to display arrays of values #103

Open
reefdog opened this issue May 4, 2023 · 1 comment
Open

Decide how to display arrays of values #103

reefdog opened this issue May 4, 2023 · 1 comment

Comments

@reefdog
Copy link
Contributor

reefdog commented May 4, 2023

Proposal fields in the PDC are actually arrays of strings. This allows things like board_of_directors: ['Jane Doe', 'John Smith'].

None of our templates actually respect this, however. We just write them to screen as if they were strings, e.g. <span>{value}</span>. As far as we know, no fields actually contain more than one value at the moment. But if value in that example were an array like ['foo', 'bar'] then it would display as <span>foobar</span>.

We need to decide how we display or delimit arrays of data. Is there a universal answer that supports all our field types, or will we need different solutions for, say, budgets than mission statements?

@reefdog
Copy link
Contributor Author

reefdog commented May 4, 2023

  1. Join with a text delimiter. This is simple and can happen outside of the React/JSX context, such as in a utility method. However, whatever delimiter we choose will probably appear in real content, so it won't be clear whether we are looking at multiple values joined, or a single value that contains that delimiter.
  2. Compose a bulleted list. Simple and clear, but will have to happen in React/JSX rather than a simple utility method. Still possibly the best answer.
  3. Something else…

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

1 participant