-
Notifications
You must be signed in to change notification settings - Fork 19
Hearing Structure Renderer
Rubaiyat Rashid edited this page Jun 10, 2021
·
3 revisions
The hearing structure renderer is a Rails console add-on that generates and formats a quick overview of any hearing related model and data, inspired by and implemented from the architecture of Intake Renderer.
Same usage as IntakeRender
Two ways to call the Hearing Renderer
> # the one-liner method
> puts HearingRenderer.render(hearing)
>
> # monkey-patching makes multiple calls more convenient
> HearingRenderer.patch_hearing_classes
> puts appeal.render_hearing
> puts appeal.hearing.render_hearing
> puts appeal.hearing.virtual_hearing.render_hearing
By default, PII is omitted from the rendered output, but it can be included explicitly:
> puts HearingRenderer.render(hearing, show_pii: true)
> puts hearing.render_hearing(show_pii: true)
Hearing notes and task instructions can often contain PII so those behind show_pii flag as well.
Some sample output:
[put finalized examples here]
The breadcrumbs section at the end of the output provides broader context for the rendered object, and always leads back to a veteran.
Same core implementation as IntakeRender Pull Request
- We intentionally did not include any strings with
/
in them (URLs for example) because theTree
gem is implemented for printing directory structure and it interprets any strings with/
as folder or file paths. Underneath the hood,TTY::Tree::Node
is initialized with each given string and it usesPathname
to interpret the string as a file path and saves only the basename of the path as the node's name. Based on that, when the tree is printed, it prints only the basename. For example, if given the stringhearings/12/details
, it would only printdetails.
The following monkey patch would fix the issue but we decided not to pursue that:
module TTY
class Tree
class Node
def initialize(path, parent, prefix, level)
if path.is_a? String
# strip null bytes from the string to avoid throwing errors
path = path.delete("\0")
end
@path = Pathname.new(path)
@name = @path.to_s # <--- the only change; make node name the entire path
@parent = Pathname.new(parent)
@prefix = prefix
@level = level
end
end
end
end
- Home
- Acronyms and Glossary
- Caseflow products
- Caseflow Intake
- Caseflow Queue
- Appeals Consumer
- Caseflow Reader
- Caseflow eFolder
- Caseflow Hearings
- Caseflow Certification
- Caseflow APIs
- Appeal Status API
- Caseflow Dispatch
-
CSUM Roles
- System Admin
- VHA Team Management
- Active Record Queries Resource
- External Integrations
- Caseflow Demo
- Caseflow ProdTest
- Background
- Stuck Jobs
- VA Notify
- Caseflow-Team
- Frontend Best Practices
- Accessibility
- How-To
- Debugging Tips
- Adding a Feature Flag with FeatureToggle
- Editing AMA issues
- Editing a decision review
- Fixing task trees
- Investigating and diagnosing issues
- Data and Metric Request Workflow
- Exporting and Importing Appeals
- Explain page for Appeals
- Record associations and Foreign Keys
- Upgrading Ruby
- Stuck Appeals
- Testing Action Mailer Messages Locally
- Re-running Seed Files
- Rake Generator for Legacy Appeals
- Manually running Scheduled Jobs
- System Admin UI
- Caseflow Makefile
- Upgrading Postgresql from v11.7 to v14.8 Locally
- VACOLS VM Trigger Fix M1
- Using SlackService to Send a Job Alert
- Technical Talks