Skip to content

Commit

Permalink
Moving messages to the localization files. Improve the checking of th…
Browse files Browse the repository at this point in the history
…e tasks
  • Loading branch information
yuriiNazarenkoTine committed Mar 14, 2024
1 parent 40d6e11 commit 0b408de
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SPK_NAME = rr-manager
SPK_VERS = 1.0
SPK_REV = 20
SPK_REV = 21
SPK_ICON = src/rr-manager.png

DSM_UI_DIR = app
Expand Down
18 changes: 9 additions & 9 deletions src/app/rr-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ Ext.define('SYNOCOMMUNITY.RRManager.AppWindow', {
notify_mail: "",
notify_if_error: false,
operation_type: "script",
operation: that['rrManagerConfig'][`${task_name}_TASK`] };
operation: that['rrManagerConfig'][`${task_name}_TASK`]
};

if (token != "") {
params.SynoConfirmPWToken = token
Expand Down Expand Up @@ -718,7 +719,7 @@ Ext.define('SYNOCOMMUNITY.RRManager.AppWindow', {
window.open();
},
updateFileRealPath: function () {
return `${this?.rrManagerConfig?.UPLOAD_DIR_PATH}/${this?.rrManagerConfig?.RR_TMP_DIR}/${this.opts.params.filename}`;
return `${this?.rrManagerConfig?.UPLOAD_DIR_PATH}${this?.rrManagerConfig?.RR_TMP_DIR}/${this.opts.params.filename}`;
},
onRunRrUpdateManuallyClick: function () {
that = this;
Expand Down Expand Up @@ -1118,14 +1119,12 @@ Ext.define('SYNOCOMMUNITY.RRManager.AppWindow', {
var sharesList = x.data.shares;
var downloadsShareMetadata = sharesList.find(x => x.path.toLowerCase() == shareName);
if (!downloadsShareMetadata) {
var msg = `❗❗❗Attention! The "${that['rrManagerConfig']['SHARE_NAME']}" share not found. Please create the share and restart the app.`;
var msg = formatString(_V('ui', 'share_notfound_msg'), that['rrManagerConfig']['SHARE_NAME']);
var tabs = Ext.getCmp('tabsControl');
tabs.getEl().mask(msg, "x-mask-loading");
this.showMsg('error', msg);
return;
}
//TODO: populate from the config.txt
that.downloadFolderRealPath = downloadsShareMetadata?.additional?.real_path;
if (callback) callback();
});
},
Expand All @@ -1148,8 +1147,9 @@ Ext.define('SYNOCOMMUNITY.RRManager.AppWindow', {
var tasksToCreate = requiredTasks.filter(task => !tasks.find(x => x.name === task.name));

if (tasksToCreate.length > 0) {
that?.getEl().mask(formatString(_V('ui', 'required_components_missing_spinner_msg'), tasksToCreate), "x-mask-loading");
let tasksNames = tasksToCreate.map(task => task.name).join(', ');
that.showPrompt(formatString(_V('ui', 'required_tasks_is_missing'), tasksNames), "Required components missing",
that.showPrompt(formatString(_V('ui', 'required_tasks_is_missing'), tasksNames), _V('ui', 'required_components_missing'),
async function (a) {
for (let task of tasksToCreate) {
if (task.createTaskCallback) {
Expand All @@ -1159,6 +1159,7 @@ Ext.define('SYNOCOMMUNITY.RRManager.AppWindow', {
}
// After all tasks have been created, you might want to notify the user.
that.showMsg('title', _V('ui', 'tasks_created_msg'));
that?.getEl()?.unmask();
});
}
} catch (error) {
Expand Down Expand Up @@ -1248,8 +1249,7 @@ Ext.define('SYNOCOMMUNITY.RRManager.AppWindow', {
uploadData: n,
success: (x) => {
that?.getEl()?.unmask();
this.showPrompt(`File has been successfully uploaded to the downloads folder.
Would you like to run update procedure?`, "Confirm update", x => this.onRunRrUpdateManuallyClick());
this.showPrompt(_V('ui', 'file_uploading_succesfull_msg'), _V('ui', 'update_confirm_title'), x => this.onRunRrUpdateManuallyClick());
},
failure: (x) => {
that?.getEl()?.unmask();
Expand All @@ -1263,7 +1263,7 @@ Ext.define('SYNOCOMMUNITY.RRManager.AppWindow', {
MAX_POST_FILESIZE: Ext.isWebKit ? -1 : window.console && window.console.firebug ? 20971521 : 4294963200,
onUploadFile: function (e, that) {
//create rr tmp folder
SYNO.API.currentManager.requestAPI("SYNO.FileStation.CreateFolder", "create", "2", {
SYNO.API.currentManager.requestAPI('SYNO.FileStation.CreateFolder', "create", "2", {
folder_path: `/${that['rrManagerConfig']['SHARE_NAME']}`,
name: that['rrManagerConfig']['RR_TMP_DIR'],
force_parent: false
Expand Down
9 changes: 7 additions & 2 deletions src/app/texts/enu/strings
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ update_rr_confirmation_title = "Confirm update"
confirm_system_clean_up_msg = "Would you like to run clean up sustem partition script?"
confirm_system_clean_up_title = "Confirm system cleanup"

unable_update_rr_msg= "Unable to update RR: {0}. Please upload the file and try againe."
unable_update_rr_msg = "Unable to update RR: {0}. Please upload the file and try againe."
upload_file_dialog_title = "Upload File"

select_file = "Select File"
loading_text = "Loading..."
system_info= "🖥️System Info:"
system_info = "🖥️System Info:"

rr_actions = "RR Loader Actions"
required_tasks_is_missing = "❗❗❗The following required tasks {0} are missing in the system. It will require entering your password. Do you want to create them?"
tasks_created_msg = "The tasks have been successfully created. Please restart the RR Manager app."
share_notfound_msg = "❗❗❗Attention! The {0} folder not found. Please create the share/folder and restart the app."
required_components_missing-title = "Required components missing"
required_components_missing_spinner_msg = "It seems like some of the tasks are missing in the system: {0}. Please complete the onboarding process before start using RR Manager."
file_uploading_succesfull_msg = "File has been successfully uploaded. Would you like to run update procedure?"
update_confirm_title = "Confirm update"

save_addons_changes = "Save addons changes"

0 comments on commit 0b408de

Please sign in to comment.