Skip to content

Commit

Permalink
#2972 Fixed translation keys in 'other' system settings save window i…
Browse files Browse the repository at this point in the history
…n new UI:

- corrected names: viewForceFullScreenEnabled, viewHideShortcutDisableFullScreenEnabled;
- removed deprecated constructor in JsonSettingsMisc;
- fixed labels for: eventPendingCacheEnabled, eventPendingLimit, webResourceUploadsPathł
  • Loading branch information
Limraj committed Jul 31, 2024
1 parent ed58118 commit 8bdb346
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 63 deletions.
24 changes: 12 additions & 12 deletions scadalts-ui/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1048,20 +1048,20 @@
"systemsettings.misc.dataPointRuntimeValueSynchronized.partial": "Partial",
"systemsettings.misc.dataPointRuntimeValueSynchronized.none": "None",
"systemsettings.http.response.headers": "HTTP response headers",
"systemsettings.view.forceFullScreen": "Force full screen mode",
"systemsettings.view.hideShortcutDisableFullScreen": "Hide shortcut to disable full screen",
"systemsettings.misc.viewForceFullScreenEnabled": "Force full screen mode",
"systemsettings.misc.viewHideShortcutDisableFullScreenEnabled": "Hide shortcut to disable full screen",
"userDetails.view.forceAdminTitle": "The function is enforced by the Admin",
"userDetails.view.enableFullScreen": "Enable full screen mode",
"userDetails.view.hideShortcutDisableFullScreen": "Hide shortcut to disable full screen",
"script.runScript": "Run script",
"systemsettings.event.pendingLimit": "Event Pending Limit",
"systemsettings.event.pendingCacheEnabled": "Enabled Event Pending Cache",
"systemsettings.workitems.reporting.enabled": "Work items reporting enabled",
"systemsettings.workitems.reporting.itemspersecond.enabled": "Items per second reporting enabled",
"systemsettings.workitems.reporting.itemspersecond.limit": "Items per second reporting limit",
"systemsettings.threads.name.additional.length": "Thread name length",
"systemsettings.webresource.uploads.path": "Uploaded images save path",
"systemsettings.webresource.graphics.path": "Custom Graphics images path",
"systemsettings.webresource.uploads.path.wrong":"Uploaded images save path must end with 'uploads' or 'uploads{0}' ",
"systemsettings.webresource.graphics.path.wrong": "Custom Graphics images path must end with 'graphics' or 'graphics{0}' "
"systemsettings.misc.eventPendingCacheEnabled": "Event Pending Limit",
"systemsettings.misc.eventPendingLimit": "Enabled Event Pending Cache",
"systemsettings.misc.workItemsReportingEnabled": "Work items reporting enabled",
"systemsettings.misc.workItemsReportingItemsPerSecondEnabled": "Items per second reporting enabled",
"systemsettings.misc.workItemsReportingItemsPerSecondLimit": "Items per second reporting limit",
"systemsettings.misc.threadsNameAdditionalLength": "Thread name length",
"systemsettings.misc.webResourceUploadsPath": "Uploaded images save path",
"systemsettings.misc.webResourceGraphicsPath": "Graphics images path",
"systemsettings.misc.webResourceUploadsPath.wrong":"Uploaded images save path must end with 'uploads' or 'uploads{0}' ",
"systemsettings.misc.webResourceGraphicsPath.wrong": "Graphics images path must end with 'graphics' or 'graphics{0}' "
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,29 @@
</v-col>
<v-col cols="12">
<v-switch
v-model="miscSettings.enableFullScreen"
:label="$t('systemsettings.view.forceFullScreen')"
v-model="miscSettings.viewForceFullScreenEnabled"
:label="$t('systemsettings.misc.viewForceFullScreenEnabled')"
@change="watchDataChange()"
></v-switch>
</v-col>
<v-col cols="12">
<v-switch
v-model="miscSettings.hideShortcutDisableFullScreen"
:label="$t('systemsettings.view.hideShortcutDisableFullScreen')"
v-model="miscSettings.viewHideShortcutDisableFullScreenEnabled"
:label="$t('systemsettings.misc.viewHideShortcutDisableFullScreenEnabled')"
@change="watchDataChange()"
></v-switch>
</v-col>
<v-col cols="12">
<v-switch
v-model="miscSettings.eventPendingCacheEnabled"
:label="$t('systemsettings.event.pendingCacheEnabled')"
:label="$t('systemsettings.misc.eventPendingCacheEnabled')"
@change="watchDataChange()"
></v-switch>
</v-col>
<v-col cols="12">
<v-text-field
v-model="miscSettings.eventPendingLimit"
:label="$t('systemsettings.event.pendingLimit')"
:label="$t('systemsettings.misc.eventPendingLimit')"
@change="watchDataChange()"
type="number"
dense
Expand All @@ -64,21 +64,21 @@
<v-col cols="12">
<v-switch
v-model="miscSettings.workItemsReportingEnabled"
:label="$t('systemsettings.workitems.reporting.enabled')"
:label="$t('systemsettings.misc.workItemsReportingEnabled')"
@change="watchDataChange()"
></v-switch>
</v-col>
<v-col cols="12">
<v-switch
v-model="miscSettings.workItemsReportingItemsPerSecondEnabled"
:label="$t('systemsettings.workitems.reporting.itemspersecond.enabled')"
:label="$t('systemsettings.misc.workItemsReportingItemsPerSecondEnabled')"
@change="watchDataChange()"
></v-switch>
</v-col>
<v-col cols="12">
<v-text-field
v-model="miscSettings.workItemsReportingItemsPerSecondLimit"
:label="$t('systemsettings.workitems.reporting.itemspersecond.limit')"
:label="$t('systemsettings.misc.workItemsReportingItemsPerSecondLimit')"
@change="watchDataChange()"
type="number"
dense
Expand All @@ -87,7 +87,7 @@
<v-col cols="12">
<v-text-field
v-model="miscSettings.threadsNameAdditionalLength"
:label="$t('systemsettings.threads.name.additional.length')"
:label="$t('systemsettings.misc.threadsNameAdditionalLength')"
@change="watchDataChange()"
type="number"
dense
Expand All @@ -96,15 +96,15 @@
<v-col cols="12">
<v-text-field
v-model="miscSettings.webResourceGraphicsPath"
:label="$t('systemsettings.webresource.graphics.path')"
:label="$t('systemsettings.misc.webResourceGraphicsPath')"
@change="watchDataChange()"
:rules="[validateGraphicsPath]"
></v-text-field>
</v-col>
<v-col cols="12">
<v-text-field
v-model="miscSettings.webResourceUploadsPath"
:label="$t('systemsettings.webresource.uploads.path')"
:label="$t('systemsettings.misc.webResourceUploadsPath')"
@change="watchDataChange()"
:rules="[validateUploadsPath]"
></v-text-field>
Expand Down Expand Up @@ -254,7 +254,7 @@ export default {
return true;
} else {
this.validatedPaths.push({key: validGraphicsKey,value: false})
return this.$t("systemsettings.webresource.graphics.path.wrong", {0: path.sep});
return this.$t("systemsettings.misc.webResourceGraphicsPath.wrong", {0: path.sep});
}
},
validateUploadsPath(v) {
Expand All @@ -267,7 +267,7 @@ export default {
return true;
} else {
this.validatedPaths.push({key: validUploadsKey, value: false})
return this.$t("systemsettings.webresource.uploads.path.wrong", {0: path.sep});
return this.$t("systemsettings.misc.webResourceUploadsPath.wrong", {0: path.sep});
}
},
validateForm(paths) {
Expand Down
4 changes: 2 additions & 2 deletions src/com/serotonin/mango/web/dwr/SystemSettingsDwr.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ public Map<String, Object> getSettings() {
settings.put(SystemSettingsDAO.HTTP_RESPONSE_HEADERS, systemSettingsService.getHttpResponseHeaders());

settings.put(SystemSettingsDAO.VIEW_HIDE_SHORTCUT_DISABLE_FULL_SCREEN,
systemSettingsService.getMiscSettings().isHideShortcutDisableFullScreen());
systemSettingsService.getMiscSettings().isViewHideShortcutDisableFullScreenEnabled());
settings.put(SystemSettingsDAO.VIEW_FORCE_FULL_SCREEN_MODE,
systemSettingsService.getMiscSettings().isEnableFullScreen());
systemSettingsService.getMiscSettings().isViewForceFullScreenEnabled());
settings.put(SystemSettingsDAO.EVENT_PENDING_LIMIT,
systemSettingsService.getMiscSettings().getEventPendingLimit());
settings.put(SystemSettingsDAO.EVENT_PENDING_CACHE_ENABLED,
Expand Down
16 changes: 8 additions & 8 deletions src/com/serotonin/mango/web/dwr/UsersDwr.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ public Map<String, Object> getInitData() {
} else {
initData.put("user", user);
JsonSettingsMisc jsonSettingsMisc = new SystemSettingsService().getMiscSettings();
initData.put("forceFullScreenMode", jsonSettingsMisc.isEnableFullScreen());
initData.put("forceHideShortcutDisableFulLScreen", jsonSettingsMisc.isHideShortcutDisableFullScreen());
initData.put("forceFullScreenMode", jsonSettingsMisc.isViewForceFullScreenEnabled());
initData.put("forceHideShortcutDisableFulLScreen", jsonSettingsMisc.isViewHideShortcutDisableFullScreenEnabled());
}

return initData;
Expand All @@ -120,8 +120,8 @@ public DwrResponseI18n getUser(int id) {
DwrResponseI18n response = new DwrResponseI18n();
response.addData("user", user);
JsonSettingsMisc jsonSettingsMisc = new SystemSettingsService().getMiscSettings();
response.addData("forceFullScreenMode", jsonSettingsMisc.isEnableFullScreen());
response.addData("forceHideShortcutDisableFulLScreen", jsonSettingsMisc.isHideShortcutDisableFullScreen());
response.addData("forceFullScreenMode", jsonSettingsMisc.isViewForceFullScreenEnabled());
response.addData("forceHideShortcutDisableFulLScreen", jsonSettingsMisc.isViewHideShortcutDisableFullScreenEnabled());
return response;

}
Expand Down Expand Up @@ -178,9 +178,9 @@ public DwrResponseI18n saveUserAdmin(int id, String username,
user.setLang(SystemSettingsDAO.getValue(SystemSettingsDAO.LANGUAGE, "en"));
}
JsonSettingsMisc jsonSettingsMisc = new SystemSettingsService().getMiscSettings();
if(!jsonSettingsMisc.isEnableFullScreen())
if(!jsonSettingsMisc.isViewForceFullScreenEnabled())
user.setEnableFullScreen(enableFullScreen);
if(!jsonSettingsMisc.isHideShortcutDisableFullScreen())
if(!jsonSettingsMisc.isViewHideShortcutDisableFullScreenEnabled())
user.setHideShortcutDisableFullScreen(hideShortcutDisableFullScreen);


Expand Down Expand Up @@ -251,9 +251,9 @@ public DwrResponseI18n saveUser(int id, String firstName, String lastName,
updateUser.setUserProfileId(usersProfileId);
updateUser.setTheme(theme);
JsonSettingsMisc jsonSettingsMisc = new SystemSettingsService().getMiscSettings();
if(!jsonSettingsMisc.isEnableFullScreen())
if(!jsonSettingsMisc.isViewForceFullScreenEnabled())
updateUser.setEnableFullScreen(enableFullScreen);
if(!jsonSettingsMisc.isHideShortcutDisableFullScreen())
if(!jsonSettingsMisc.isViewHideShortcutDisableFullScreenEnabled())
updateUser.setHideShortcutDisableFullScreen(hideShortcutDisableFullScreen);

DwrResponseI18n response = new DwrResponseI18n();
Expand Down
8 changes: 4 additions & 4 deletions src/org/scada_lts/mango/service/SystemSettingsService.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ public JsonSettingsMisc getMiscSettings() {
JsonSettingsMisc json = new JsonSettingsMisc();
json.setUiPerformance(SystemSettingsDAO.getIntValue(SystemSettingsDAO.UI_PERFORMANCE));
json.setDataPointRuntimeValueSynchronized(SystemSettingsDAO.getValue(SystemSettingsDAO.DATAPOINT_RUNTIME_VALUE_SYNCHRONIZED));
json.setHideShortcutDisableFullScreen(SystemSettingsDAO.getBooleanValue(SystemSettingsDAO.VIEW_HIDE_SHORTCUT_DISABLE_FULL_SCREEN));
json.setEnableFullScreen(SystemSettingsDAO.getBooleanValue(SystemSettingsDAO.VIEW_FORCE_FULL_SCREEN_MODE));
json.setViewHideShortcutDisableFullScreenEnabled(SystemSettingsDAO.getBooleanValue(SystemSettingsDAO.VIEW_HIDE_SHORTCUT_DISABLE_FULL_SCREEN));
json.setViewForceFullScreenEnabled(SystemSettingsDAO.getBooleanValue(SystemSettingsDAO.VIEW_FORCE_FULL_SCREEN_MODE));
json.setEventPendingLimit(SystemSettingsDAO.getIntValue(SystemSettingsDAO.EVENT_PENDING_LIMIT));
json.setEventPendingCacheEnabled(SystemSettingsDAO.getBooleanValue(SystemSettingsDAO.EVENT_PENDING_CACHE_ENABLED));
json.setThreadsNameAdditionalLength(SystemSettingsDAO.getIntValue(SystemSettingsDAO.THREADS_NAME_ADDITIONAL_LENGTH));
Expand All @@ -148,8 +148,8 @@ public JsonSettingsMisc getMiscSettings() {
public void saveMiscSettings(JsonSettingsMisc json) {
systemSettingsDAO.setIntValue(SystemSettingsDAO.UI_PERFORMANCE, json.getUiPerformance());
systemSettingsDAO.setValue(SystemSettingsDAO.DATAPOINT_RUNTIME_VALUE_SYNCHRONIZED, DataPointSyncMode.getName(json.getDataPointRuntimeValueSynchronized()));
systemSettingsDAO.setBooleanValue(SystemSettingsDAO.VIEW_HIDE_SHORTCUT_DISABLE_FULL_SCREEN, json.isHideShortcutDisableFullScreen());
systemSettingsDAO.setBooleanValue(SystemSettingsDAO.VIEW_FORCE_FULL_SCREEN_MODE, json.isEnableFullScreen());
systemSettingsDAO.setBooleanValue(SystemSettingsDAO.VIEW_HIDE_SHORTCUT_DISABLE_FULL_SCREEN, json.isViewHideShortcutDisableFullScreenEnabled());
systemSettingsDAO.setBooleanValue(SystemSettingsDAO.VIEW_FORCE_FULL_SCREEN_MODE, json.isViewForceFullScreenEnabled());
systemSettingsDAO.setIntValue(SystemSettingsDAO.EVENT_PENDING_LIMIT, json.getEventPendingLimit());
systemSettingsDAO.setBooleanValue(SystemSettingsDAO.EVENT_PENDING_CACHE_ENABLED, json.isEventPendingCacheEnabled());
systemSettingsDAO.setIntValue(SystemSettingsDAO.THREADS_NAME_ADDITIONAL_LENGTH, json.getThreadsNameAdditionalLength());
Expand Down
2 changes: 1 addition & 1 deletion src/org/scada_lts/utils/ApiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static void setPassword(User userToSave, UserService userService) {

public static UserInfo toUserInfo(User user) {
JsonSettingsMisc jsonSettingsMisc = new SystemSettingsService().getMiscSettings();
return new UserInfo(user, jsonSettingsMisc.isEnableFullScreen(), jsonSettingsMisc.isHideShortcutDisableFullScreen());
return new UserInfo(user, jsonSettingsMisc.isViewForceFullScreenEnabled(), jsonSettingsMisc.isViewHideShortcutDisableFullScreenEnabled());
}

public static <T, R, S> Map<S, R> convertMap(Map<S, List<T>> map, Function<List<T>, R> converter) {
Expand Down
32 changes: 10 additions & 22 deletions src/org/scada_lts/web/mvc/api/json/JsonSettingsMisc.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ public class JsonSettingsMisc implements Serializable {

private int uiPerformance;
private String dataPointRuntimeValueSynchronized;
public boolean enableFullScreen;
public boolean hideShortcutDisableFullScreen;
public boolean viewForceFullScreenEnabled;
public boolean viewHideShortcutDisableFullScreenEnabled;
public int eventPendingLimit;
public boolean eventPendingCacheEnabled;
public boolean workItemsReportingEnabled;
Expand All @@ -19,18 +19,6 @@ public class JsonSettingsMisc implements Serializable {

public JsonSettingsMisc() {}

@Deprecated(since = "2.7.7.1")
public JsonSettingsMisc(int uiPerformance, String dataPointRuntimeValueSynchronized, boolean enableFullScreen, boolean hideShortcutDisableFullScreen, int eventPendingLimit, boolean eventPendingCacheEnabled, String webResourceGraphicsPath, String webResourceUploadsPath) {
this.uiPerformance = uiPerformance;
this.dataPointRuntimeValueSynchronized = dataPointRuntimeValueSynchronized;
this.enableFullScreen = enableFullScreen;
this.hideShortcutDisableFullScreen = hideShortcutDisableFullScreen;
this.eventPendingLimit = eventPendingLimit;
this.eventPendingCacheEnabled = eventPendingCacheEnabled;
this.webResourceGraphicsPath = webResourceGraphicsPath;
this.webResourceUploadsPath = webResourceUploadsPath;
}

public int getUiPerformance() {
return uiPerformance;
}
Expand All @@ -47,20 +35,20 @@ public void setDataPointRuntimeValueSynchronized(String dataPointRuntimeValueSyn
this.dataPointRuntimeValueSynchronized = dataPointRuntimeValueSynchronized;
}

public boolean isEnableFullScreen() {
return enableFullScreen;
public boolean isViewForceFullScreenEnabled() {
return viewForceFullScreenEnabled;
}

public void setEnableFullScreen(boolean enableFullScreen) {
this.enableFullScreen = enableFullScreen;
public void setViewForceFullScreenEnabled(boolean viewForceFullScreenEnabled) {
this.viewForceFullScreenEnabled = viewForceFullScreenEnabled;
}

public boolean isHideShortcutDisableFullScreen() {
return hideShortcutDisableFullScreen;
public boolean isViewHideShortcutDisableFullScreenEnabled() {
return viewHideShortcutDisableFullScreenEnabled;
}

public void setHideShortcutDisableFullScreen(boolean hideShortcutDisableFullScreen) {
this.hideShortcutDisableFullScreen = hideShortcutDisableFullScreen;
public void setViewHideShortcutDisableFullScreenEnabled(boolean viewHideShortcutDisableFullScreenEnabled) {
this.viewHideShortcutDisableFullScreenEnabled = viewHideShortcutDisableFullScreenEnabled;
}

public int getEventPendingLimit() {
Expand Down

0 comments on commit 8bdb346

Please sign in to comment.