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

range in a cell #491

Open
igbanam opened this issue Apr 14, 2023 · 0 comments
Open

range in a cell #491

igbanam opened this issue Apr 14, 2023 · 0 comments

Comments

@igbanam
Copy link

igbanam commented Apr 14, 2023

Is it possible to have a range in a cell?

I have something like this

    {{/* Components */ -}}
    {{- if .fields.components -}}
      {{- range .fields.components -}}
        {{- cell .name -}}
      {{end}}
    {{- else -}}
      {{- cell "<none>" -}}
    {{- end -}}

But when there is more than one component, the table breaks. If the table should have 5 columns, the ticket with more than one component has a row with 5 + C - 1 rows; where C is the number of components.

Ideally, I'd want the multiple components to be joined in the same cell block. Any ideas on this?

The closest I've come to trying to get this working is

    {{/* Components */ -}}
    {{- if .fields.components -}}
      {{- cell (join ', ' .fields.components) -}}
    {{- else -}}
      {{- cell "<none>" -}}
    {{- end -}}

But this throws an error since join expects an array and is getting a more complex object. — and there's no map to reduce the object into an array

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