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

Make Templates Readable #473

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

igbanam
Copy link

@igbanam igbanam commented Nov 10, 2022

The templates in jiracli/templates.go have logic in them. Currently, it's difficult to grok what's going on in these templates because of the way they're written.

This change does not introduce new functionality; it just sweeps through this template file ensuring that the templates are readable.

With this change, it would be easier — in future — to update these template, or introduce new functionality to these templates.

Templates

  • AttachList
  • Comment
  • ComponentAdd
  • Components
  • Create
  • Debug
  • Edit
  • EpicCreate
  • Issuetypes
  • List
  • Subtask
  • Table
  • Transition
  • Transitions
  • View
  • Worklog
  • Worklogs

Copy link
Collaborator

@georgettica georgettica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems OK to me and not functionality looks to be broken (only refactoring the template)

@m-fonseca
Copy link

FYI: This makes the template much easier to read, but unfortunately it has the side effect of making the fields have uneven formatting. E.g.:

image
(Note: I've augmented parts of the template, but they are base on the same formatting)

Copy link
Contributor

@voiski voiski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use {{- or -}} to avoid the extra blank lines on all places you are expanding the template for better reading. Also, check for the sprig functions. I'm not sure if we have it, but we can also add it.

jiracli/templates.go Outdated Show resolved Hide resolved
jiracli/templates.go Outdated Show resolved Hide resolved
jiracli/templates.go Outdated Show resolved Hide resolved
jiracli/templates.go Outdated Show resolved Hide resolved
igbanam and others added 4 commits December 30, 2022 09:24
Co-authored-by: Alan Voiski <alannunesv@gmail.com>
Co-authored-by: Alan Voiski <alannunesv@gmail.com>
Co-authored-by: Alan Voiski <alannunesv@gmail.com>
Co-authored-by: Alan Voiski <alannunesv@gmail.com>
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

Successfully merging this pull request may close these issues.

4 participants