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

[ENH] Refactor Tab Strip Panel If-Else Statement #4784

Open
thabaum opened this issue Oct 24, 2024 · 0 comments · May be fixed by #4785
Open

[ENH] Refactor Tab Strip Panel If-Else Statement #4784

thabaum opened this issue Oct 24, 2024 · 0 comments · May be fixed by #4785

Comments

@thabaum
Copy link
Contributor

thabaum commented Oct 24, 2024

Oqtane Info

Version - 6.0.0
Render Mode - Static
Interactivity - Server
Database - SQL Server

Describe the enhancement

The current implementation of the tab strip panel includes an if-else statement that determines how the heading is set. This can be simplified to improve readability and maintainability.

Current Implementation:

if (string.IsNullOrEmpty(Heading))
{
    Heading = Localize(nameof(Name), Name);
}
else
{
    Heading = Localize(nameof(Heading), Heading);
}

Proposed Change
Heading = string.IsNullOrEmpty(Heading) ? Localize(nameof(Name), Name) : Localize(nameof(Heading), Heading);

Benefits:

  • Enhances code readability.
  • Reduces the lines of code while maintaining the same functionality
  • Aligns with the refactoring approach used in public string DisplayHeading() method.
  • Makes it easier for future developers to understand the logic at a glance and is similar to the .
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 a pull request may close this issue.

1 participant