Skip to content

Conversation

@Patrykb0802
Copy link
Contributor

@Patrykb0802 Patrykb0802 commented Sep 9, 2025

Now pop up window with confirmation looks like this:

image

Summary by CodeRabbit

  • Bug Fixes
    • Data source deletion confirmations now display the specific data source name and unique identifier. This provides users with clearer context before confirming deletion and helps prevent accidental removal of unintended resources. Improved across all supported languages.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Java Script Mocha Unit Test Results

268 tests  ±0   268 ✅ ±0   3s ⏱️ ±0s
 70 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit c60b2bd. ± Comparison against base commit de92ac5.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Java JUnit Test Results

3 220 tests  ±0   3 220 ✅ ±0   48s ⏱️ -1s
  128 suites ±0       0 💤 ±0 
  128 files   ±0       0 ❌ ±0 

Results for commit c60b2bd. ± Comparison against base commit de92ac5.

♻️ This comment has been updated with latest results.

@Limraj Limraj added this to the 2.9.0 milestone Jan 5, 2026
@Patrykb0802
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link

coderabbitai bot commented Jan 12, 2026

📝 Walkthrough

Walkthrough

The changes implement dynamic data source deletion confirmation messages by updating the delete function to accept an element reference and constructing templated confirmation text that includes the data source name and XID. Supporting infrastructure includes new custom tag attributes and translated message keys across 11 language files.

Changes

Cohort / File(s) Summary
UI and Template Updates
WebContent/WEB-INF/jsp/dataSourceList.jsp, WebContent/WEB-INF/tags/img.tag
Updated deleteDataSource() function signature to accept element reference; added dataName and dataXid data attributes to delete icon; replaced static confirmation message with dynamic templated message using data attributes. Added dataName and dataXid custom tag attributes to img.tag for attribute rendering.
Internationalization
webapp-resources/messages_*.properties (de, en, es, fi, fr, lu, nl, pl, pt, ru, zh)
Added new translation key dsList.dsDeleteConfirmNamed across 11 language files with localized confirmation message templates using {0} (name) and {1} (XID) placeholders.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A delete button speaks with care,
With name and XID laid bare,
No silent goodbye, just polite cheer—
"Confirm this source you hold so dear!"
Translated in tongues, eleven strong,
A gentle farewell, dignified song. 🗑️

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and directly summarizes the main change: adding the data source name to the deletion confirmation message, which aligns with all file modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
webapp-resources/messages_fr.properties (1)

3456-3456: Character encoding corruption detected.

The French text at line 3455 contains corrupted characters (� symbols) replacing accented characters. The text should be:

êtes-vous sûr de vouloir supprimer la source de données {0} (XID : {1}) ?

Please correct the file encoding and restore the accented characters.

Suggested fix
-dsList.dsDeleteConfirmNamed=�tes-vous s�r de vouloir supprimer la source de donn�es {0} (XID : {1}) ?
+dsList.dsDeleteConfirmNamed=êtes-vous sûr de vouloir supprimer la source de données {0} (XID : {1}) ?
🤖 Fix all issues with AI agents
In @webapp-resources/messages_fi.properties:
- Line 3586: The resource value for key dsList.dsDeleteConfirmNamed contains a
corrupted character ("tietol�hteen"); update the properties entry for
dsList.dsDeleteConfirmNamed to use the correct Finnish character encoding by
replacing the corrupted sequence with the proper escaped Unicode or character
(e.g., "tietol\u00e4hteen" or "tietolähteen") so the string becomes Haluatko
varmasti poistaa tietol\u00e4hteen {0} (XID: {1})?.

In @webapp-resources/messages_pl.properties:
- Line 3597: The property validate.unsupportedDataType currently contains
English text; replace "Data type {0} is not supported" with an accurate Polish
translation (keeping the placeholder {0} intact) so the
validate.unsupportedDataType entry in messages_pl.properties is in Polish.
- Line 3598: The property value for dsList.dsDeleteConfirmNamed contains
corrupted Polish characters; replace the garbled text with proper Unicode
escapes so the value reads "Czy na pewno chcesz usunąć źródło danych {0} (XID:
{1})?" — specifically use \u0105 for 'ą', \u0107 for 'ć', \u017A for 'ź', \u00F3
for 'ó' and \u0142 for 'ł' when updating the dsList.dsDeleteConfirmNamed entry.
🧹 Nitpick comments (3)
webapp-resources/messages_fr.properties (1)

3455-3455: English text in French properties file.

This key contains English text in a French translation file. Based on learnings, French is not actively maintained in SCADA-LTS, so English fallback text is acceptable. However, note that this key appears unrelated to the PR's stated objective of adding data source names to deletion confirmations.

Based on learnings, SCADA-LTS maintains only Polish and English translations; other locales may contain English text and are not blocking.

webapp-resources/messages_en.properties (1)

3461-3461: LGTM! The new deletion confirmation message improves user experience.

The message template correctly uses placeholders for the data source name {0} and XID {1}, providing clearer context to users before deletion. The grammar and formatting are appropriate.

Optional: Consider improved organization

For better maintainability, consider placing this key near the other dsList.* keys (around lines 1241-1251) rather than at the end of the file. While the current placement is functional, grouping related keys makes the properties file easier to navigate and maintain.

+# Place near line 1244 after dsList.dsDeleteConfirm instead of at the end
WebContent/WEB-INF/jsp/dataSourceList.jsp (1)

65-82: Implementation looks correct.

The approach of passing the element reference and extracting data-name/data-xid attributes to build a dynamic confirmation message works well. The fallback to empty string (|| "") handles missing attributes gracefully.

Minor observation: There's inconsistent indentation between the variable declarations (lines 66-69, indented 6 spaces) and the if block (lines 70-81, indented 8 spaces). Consider aligning for consistency.

🔧 Optional: Consistent indentation
     function deleteDataSource(el, dataSourceId) {
-      var name = el.getAttribute("data-name") || "";
-      var xid  = el.getAttribute("data-xid")  || "";
-      var template = "<spring:message code='dsList.dsDeleteConfirmNamed'/>";
-      var msg = template.replace("{0}", name).replace("{1}", xid);
-        if (confirm(msg)) {
+        var name = el.getAttribute("data-name") || "";
+        var xid  = el.getAttribute("data-xid")  || "";
+        var template = "<spring:message code='dsList.dsDeleteConfirmNamed'/>";
+        var msg = template.replace("{0}", name).replace("{1}", xid);
+        if (confirm(msg)) {
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de92ac5 and c60b2bd.

📒 Files selected for processing (13)
  • WebContent/WEB-INF/jsp/dataSourceList.jsp
  • WebContent/WEB-INF/tags/img.tag
  • webapp-resources/messages_de.properties
  • webapp-resources/messages_en.properties
  • webapp-resources/messages_es.properties
  • webapp-resources/messages_fi.properties
  • webapp-resources/messages_fr.properties
  • webapp-resources/messages_lu.properties
  • webapp-resources/messages_nl.properties
  • webapp-resources/messages_pl.properties
  • webapp-resources/messages_pt.properties
  • webapp-resources/messages_ru.properties
  • webapp-resources/messages_zh.properties
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-05T14:39:51.606Z
Learnt from: Limraj
Repo: SCADA-LTS/Scada-LTS PR: 3239
File: webapp-resources/messages_fi.properties:3565-3565
Timestamp: 2026-01-05T14:39:51.606Z
Learning: SCADA-LTS maintains translations only for Polish and English. Do not invest in or expect active maintenance for other languages (e.g., messages_fi.properties, messages_de.properties). If a messages_*.properties file contains English text and is not maintained, it can be left as-is for now. AI translation may be used in the future. During reviews, prioritize Polish and English keys/text; non-maintained locales should not block changes.

Applied to files:

  • webapp-resources/messages_fi.properties
  • webapp-resources/messages_fr.properties
  • webapp-resources/messages_de.properties
  • webapp-resources/messages_pt.properties
  • webapp-resources/messages_pl.properties
  • webapp-resources/messages_nl.properties
  • webapp-resources/messages_es.properties
  • webapp-resources/messages_zh.properties
  • webapp-resources/messages_lu.properties
  • webapp-resources/messages_en.properties
  • webapp-resources/messages_ru.properties
🔇 Additional comments (10)
webapp-resources/messages_nl.properties (1)

3576-3576: LGTM! Translation key added correctly.

The new dsList.dsDeleteConfirmNamed key is properly formatted with placeholders {0} (data source name) and {1} (XID), consistent with the pattern used in other locales. The Dutch translation appears grammatically correct and aligns with the existing confirmation message at Line 375.

Note: Based on learnings, Dutch (messages_nl.properties) is not actively maintained—only Polish and English translations are prioritized. This addition is acceptable and should not block the PR.

webapp-resources/messages_zh.properties (1)

3561-3561: English text in Chinese translation file (acceptable per project policy)

The new key dsList.dsDeleteConfirmNamed contains English text instead of Chinese translation. While this is inconsistent with the file's purpose, it's acceptable according to the project's translation policy.

Based on learnings, SCADA-LTS actively maintains only Polish and English translations. Other language files like messages_zh.properties are not maintained and can contain English text as placeholders. AI translation may be used in the future to provide proper Chinese translations.

The key format and placeholders {0} (name) and {1} (XID) are correct and align with the PR objectives to include the data source name in the deletion confirmation message.

webapp-resources/messages_pt.properties (1)

3613-3613: LGTM! Translation looks correct.

The new deletion confirmation message key dsList.dsDeleteConfirmNamed has been added with proper Portuguese translation and correctly formatted placeholders {0} and {1} for the data source name and XID respectively.

Based on learnings, Portuguese is not an actively maintained locale in SCADA-LTS (only Polish and English are prioritized), but the translation appears grammatically correct and aligns with the PR objectives.

webapp-resources/messages_de.properties (1)

3457-3458: LGTM! Changes correctly implement the dynamic deletion confirmation message.

The additions implement the feature as expected:

  • Line 3457 adds a validation message key (in English, which is acceptable for this non-maintained locale)
  • Line 3458 adds the new dsList.dsDeleteConfirmNamed key with German translation using correct placeholders {0} for data source name and {1} for XID

Based on learnings, SCADA-LTS maintains translations only for Polish and English. The German locale is not actively maintained and should not block this change.

webapp-resources/messages_ru.properties (1)

3608-3609: All verification checks passed—no blocking issues found.

  • validate.unsupportedDataType is not duplicated in the file; appears only once at line 3608.
  • dsList.dsDeleteConfirmNamed placeholders are correct—the JSP caller (dataSourceList.jsp) supplies both {0} (data source name) and {1} (XID) before passing the message to confirm().
  • ✓ English text in messages_ru.properties aligns with project practice for non-maintained locales (consistent with messages_zh.properties).
webapp-resources/messages_lu.properties (1)

3474-3474: Character encoding issue is a known pattern in non-maintained translation files.

Line 3474 contains corrupted special characters (e.g., s�cher, d�i, l�schen, w�llt instead of proper Luxembourgish characters like sécher, déi, läschen, wëllt). However, this is consistent with a systemic encoding issue affecting multiple non-maintained language files (German, Finnish, French, Spanish, Polish—all showing similar corruption patterns), while properly maintained languages like Portuguese and Dutch display characters correctly.

Per project guidelines, SCADA-LTS actively maintains only Polish and English translations. Other language files are not actively maintained and may be regenerated using AI translation in the future. This encoding issue is expected in those files and does not require changes in this PR.

webapp-resources/messages_es.properties (2)

3500-3500: English text in Spanish translation file (acceptable per project policy).

The key validate.unsupportedDataType contains English text instead of Spanish. However, this is acceptable since Spanish translations are not actively maintained in this project.

Based on learnings, SCADA-LTS maintains translations only for Polish and English. Non-maintained locales like Spanish can be left as-is until AI translation is implemented in the future.


3501-3501: LGTM! Proper Spanish translation for the new deletion confirmation.

The new translation key dsList.dsDeleteConfirmNamed is correctly translated to Spanish with proper grammar and placeholder usage. The question format follows Spanish conventions with the opening ¿ character, and the placeholders {0} and {1} are appropriately positioned for the data source name and XID.

WebContent/WEB-INF/tags/img.tag (1)

28-29: LGTM!

The new dataName and dataXid attributes are correctly declared and rendered. Good use of <c:out> for XSS protection when outputting attribute values.

Also applies to: 38-39

WebContent/WEB-INF/jsp/dataSourceList.jsp (1)

159-164: LGTM!

The tag:img correctly supplies dataName and dataXid attributes, and the onclick handler properly passes this to provide the element reference. This cleanly integrates with the updated deleteDataSource function.

systemSettings.scadaConfCheck=Check configuration
validate.unsupportedDataType=Data type {0} is not supported No newline at end of file
validate.unsupportedDataType=Data type {0} is not supported
dsList.dsDeleteConfirmNamed=Haluatko varmasti poistaa tietol�hteen {0} (XID: {1})?
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Character encoding issue in Finnish translation.

The text tietol�hteen appears to have a corrupted character. This should likely be tietolähteen (with the proper Finnish 'ä' character encoded as \u00e4):

dsList.dsDeleteConfirmNamed=Haluatko varmasti poistaa tietol\u00e4hteen {0} (XID: {1})?

Based on learnings, Finnish is not actively maintained (only Polish and English are), so this is non-blocking.

🤖 Prompt for AI Agents
In @webapp-resources/messages_fi.properties at line 3586, The resource value for
key dsList.dsDeleteConfirmNamed contains a corrupted character ("tietol�hteen");
update the properties entry for dsList.dsDeleteConfirmNamed to use the correct
Finnish character encoding by replacing the corrupted sequence with the proper
escaped Unicode or character (e.g., "tietol\u00e4hteen" or "tietolähteen") so
the string becomes Haluatko varmasti poistaa tietol\u00e4hteen {0} (XID: {1})?.

systemSettings.scadaConfTitle=Scada-LTS environment settings
systemSettings.scadaConfCheck=Check configuration
validate.unsupportedDataType=Data type {0} is not supported No newline at end of file
validate.unsupportedDataType=Data type {0} is not supported
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

English text in Polish translation file.

This message is in English but placed in the Polish translation file. It should be translated to Polish for consistency.

Suggested Polish translation
-validate.unsupportedDataType=Data type {0} is not supported
+validate.unsupportedDataType=Typ danych {0} nie jest obs\u0142ugiwany
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
validate.unsupportedDataType=Data type {0} is not supported
validate.unsupportedDataType=Typ danych {0} nie jest obs\u0142ugiwany
🤖 Prompt for AI Agents
In @webapp-resources/messages_pl.properties at line 3597, The property
validate.unsupportedDataType currently contains English text; replace "Data type
{0} is not supported" with an accurate Polish translation (keeping the
placeholder {0} intact) so the validate.unsupportedDataType entry in
messages_pl.properties is in Polish.

systemSettings.scadaConfCheck=Check configuration
validate.unsupportedDataType=Data type {0} is not supported No newline at end of file
validate.unsupportedDataType=Data type {0} is not supported
dsList.dsDeleteConfirmNamed=Czy na pewno chcesz usun?? ?r�d?o danych {0} (XID: {1})?
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Character encoding corruption in Polish text.

The Polish characters are corrupted: usun?? should be usunąć and ?r�d?o should be źródło. Use proper Unicode escapes as seen elsewhere in this file (e.g., line 359 uses \u0179r\u00f3d\u0142o for "źródło").

Suggested fix with proper Unicode escapes
-dsList.dsDeleteConfirmNamed=Czy na pewno chcesz usun?? ?r�d?o danych {0} (XID: {1})?
+dsList.dsDeleteConfirmNamed=Czy na pewno chcesz usun\u0105\u0107 \u017ar\u00f3d\u0142o danych {0} (XID: {1})?
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
dsList.dsDeleteConfirmNamed=Czy na pewno chcesz usun?? ?r�d?o danych {0} (XID: {1})?
dsList.dsDeleteConfirmNamed=Czy na pewno chcesz usun\u0105\u0107 \u017ar\u00f3d\u0142o danych {0} (XID: {1})?
🤖 Prompt for AI Agents
In @webapp-resources/messages_pl.properties at line 3598, The property value for
dsList.dsDeleteConfirmNamed contains corrupted Polish characters; replace the
garbled text with proper Unicode escapes so the value reads "Czy na pewno chcesz
usunąć źródło danych {0} (XID: {1})?" — specifically use \u0105 for 'ą', \u0107
for 'ć', \u017A for 'ź', \u00F3 for 'ó' and \u0142 for 'ł' when updating the
dsList.dsDeleteConfirmNamed entry.

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.

3 participants