Skip to content

fix: drop unused getEditButtonText; add ja text#3188

Merged
sfeilmeier merged 2 commits intoOpenEMS:developfrom
girasolenergy:bugfix/use-getEditButtonText
Aug 26, 2025
Merged

fix: drop unused getEditButtonText; add ja text#3188
sfeilmeier merged 2 commits intoOpenEMS:developfrom
girasolenergy:bugfix/use-getEditButtonText

Conversation

@miettal
Copy link
Copy Markdown
Contributor

@miettal miettal commented Jun 16, 2025

This pull request introduces a small but meaningful improvement to the user interface by refactoring the logic for determining the edit button text and adding missing translations for Japanese localization.

UI Improvements:

  • ui/src/app/user/user.component.html: Replaced inline conditional logic for the edit button label with a call to the new getEditButtonText() method, improving readability and maintainability.

Localization Enhancements:

  • ui/src/assets/i18n/ja.json: Added missing Japanese translations for "EDIT" ("編集") and "RESET" ("リセット") to ensure proper localization.

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #3188   +/-   ##
==========================================
  Coverage           ?   59.53%           
  Complexity         ?      113           
==========================================
  Files              ?     2765           
  Lines              ?   119513           
  Branches           ?     8892           
==========================================
  Hits               ?    71142           
  Misses             ?    45697           
  Partials           ?     2674           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@miettal miettal force-pushed the bugfix/use-getEditButtonText branch from 775644b to 0bd1cf5 Compare August 4, 2025 04:26
@miettal
Copy link
Copy Markdown
Contributor Author

miettal commented Aug 4, 2025

rebased

[disabled]="!isEditModeDisabled && !this.form?.formGroup?.dirty">
<ion-label>{{isEditModeDisabled ? ('General.EDIT' | translate) :('General.RESET' |
translate)}}</ion-label>
<ion-label>{{ getEditButtonText() | translate }}</ion-label>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Calling functions from an Angular HTML template should be avoided for performance reasons. Instead the getEditButtonText() method seems to be left over and should be deleted.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see! I removed this function.

// Thank you information. This is very pratical experience for me.

getEditButtonText() is not used and this function obsoluted because
performance issue of template rendering.
@miettal miettal changed the title fix: fix use getEditButtonText; add ja text fix: drop unused getEditButtonText; add ja text Aug 26, 2025
Copy link
Copy Markdown
Contributor

@sfeilmeier sfeilmeier left a comment

Choose a reason for hiding this comment

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

Thanks! 👍

@sfeilmeier sfeilmeier merged commit 6c493cf into OpenEMS:develop Aug 26, 2025
7 checks passed
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.

2 participants