Skip to content
This repository was archived by the owner on Sep 18, 2025. It is now read-only.

Create InsetText View, ViewComponent and Model#49

Merged
akdalin-hee merged 2 commits into
mainfrom
feature/TD-5207-Create-insetText-view-component
Apr 24, 2025
Merged

Create InsetText View, ViewComponent and Model#49
akdalin-hee merged 2 commits into
mainfrom
feature/TD-5207-Create-insetText-view-component

Conversation

@akdalin-hee
Copy link
Copy Markdown

Description

Create InsetText View, ViewComponent and Model

Screenshots

Paste screenshots for all views created or changed: mobile, tablet and desktop, wave analyser showing no errors.
image


Developer checks

(Leave tasks unticked if they haven't been appropriate for your ticket.)

I have:

  • Run the IDE auto formatter on all files I’ve worked on and made sure there are no IDE errors relating to them
  • Written or updated tests for the changes and made sure all tests are passing
  • Manually tested my work with and without JavaScript (adding notes where functionality requires JavaScript)
  • Tested with Wave Chrome plugin. Addressed any valid accessibility issues and documented any invalid errors
  • Scanned over my pull request in GitHub and addressed any warnings from the GitHub Build and Test checks in the GitHub PR ‘Files Changed’ tab
    Either:
  • Documented my work in Confluence, updating any business rules applied or modified. Updated GitHub readme/documentation for the repository if appropriate. List of documentation links added/changed:
  • Confirmed that none of the work that I have undertaken requires any updates to documentation
  • CHANGELOG entry

@akdalin-hee
Copy link
Copy Markdown
Author

akdalin-hee commented Mar 11, 2025

Different from the DLS version, I've added a default value for the cssClass variable as it would otherwise require at each initialisation.
Additionally, Model.Text is rendered as Raw.HTML so that it can render links (<a href>) as well.

Copy link
Copy Markdown

@kevwhitt-hee kevwhitt-hee left a comment

Choose a reason for hiding this comment

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

See inline code comments

{
public IViewComponentResult Invoke(
string text,
string cssClass = null
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why are we including this parameter? Do we ever alter the class of an inset text div?

public class InsetTextViewComponent : ViewComponent
{
public IViewComponentResult Invoke(
string text,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

would it be better to name this as contentHtml if we are rendering it as HTML below - @Html.Raw(Model.Text) ?

@akdalin-hee akdalin-hee merged commit ab4861e into main Apr 24, 2025
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants