• R/O
  • SSH

fcf: Commit

FCF - Full Stack Javascript Framework

OpenSource is a full stack development framework designed to simplify the development of WEB projects of various complexity levels.

It is based on unique technologies that open up new opportunities in development approaches with NODEJS.


Commit MetaInfo

Revisioneedfa948465e228551fa91cdb57a18ef9c0f7161 (tree)
Time2021-01-17 23:01:31
AuthorVladimir Markin <v.o.markin221@gmai...>
CommiterVladimir Markin

Log Message

the requireRecord property takes an array of property names

Change Summary

Incremental Difference

diff -r 384e452e7fae -r eedfa948465e NRender/NDetails/TemplateRender.js
--- a/NRender/NDetails/TemplateRender.js Sun Jan 17 17:00:05 2021 +0300
+++ b/NRender/NDetails/TemplateRender.js Sun Jan 17 17:01:31 2021 +0300
@@ -76,7 +76,15 @@
7676 a_options.args = {};
7777 a_options.args = fcf.append({}, a_options.args, { fcfCP: fcfCP, fcfParent: a_initializeOptions.args.fcfWrapper ? a_initializeOptions.args.fcfId : undefined});
7878
79- if (a_options.view.requireRecord){
79+ if (Array.isArray(a_options.view.requireRecord) && fcf.isArg(a_options.record) && a_options.record.type == "reference"){
80+ let recordPattern = "";
81+ fcf.each(a_options.view.requireRecord, (a_key, a_field)=>{
82+ let argRef = fcf.arg("reference", {id: a_options.record.object.id, arg: a_options.record.arg + `["${a_field}"]` });
83+ a_options.args[`@record@${a_field}`] = argRef;
84+ recordPattern += `"${a_field}": args["@record@${a_field}"],`
85+ })
86+ a_options.args.record = fcf.argVal("@{{ {" + recordPattern + "} }}@");
87+ } else if (a_options.view.requireRecord){
8088 a_options.args.record = a_options.record;
8189 }
8290
diff -r 384e452e7fae -r eedfa948465e packages/fcfManagement/templates/pages/translations/translations-tab.tmpl
--- a/packages/fcfManagement/templates/pages/translations/translations-tab.tmpl Sun Jan 17 17:00:05 2021 +0300
+++ b/packages/fcfManagement/templates/pages/translations/translations-tab.tmpl Sun Jan 17 17:01:31 2021 +0300
@@ -85,11 +85,11 @@
8585 type: "text",
8686 },
8787 {
88- alias: "action",
89- title: "!{{Actions}}!",
90- type: "text",
91- template: "@controls:button",
92- requireRecord: true,
88+ alias: "action",
89+ title: "!{{Actions}}!",
90+ type: "text",
91+ template: "@controls:button",
92+ requireRecord: ["path", "modify"],
9393 args: {
9494 title: "!{{Remove}}!",
9595 enable: fcf.argVal("@{{args.editableFile == args.record.path || args.record.modify}}@"),
diff -r 384e452e7fae -r eedfa948465e packages/fcfManagement/templates/pages/translations/translations-tab.wrapper.js
--- a/packages/fcfManagement/templates/pages/translations/translations-tab.wrapper.js Sun Jan 17 17:00:05 2021 +0300
+++ b/packages/fcfManagement/templates/pages/translations/translations-tab.wrapper.js Sun Jan 17 17:01:31 2021 +0300
@@ -35,12 +35,17 @@
3535 let t = a_value[address[0]][address[1]];
3636 if (!t)
3737 return;
38+
39+ let modifyData = t.modify !== true || t.path !== this._editableFiles[address[0]];
40+
3841 t.modify = true;
39- t.path = this._editableFiles[address[0]];
42+ t.path = this._editableFiles[address[0]];
4043 translationsModify[address[0]][t.phrase] = t;
4144 this.setArg("translationsModify", translationsModify);
42- this.setArg(`translations["${address[0]}"]["${address[1]}"].modify`, t.modify);
43- this.setArg(`translations["${address[0]}"]["${address[1]}"].path`, t.path);
45+ if (modifyData){
46+ this.setArg(`translations["${address[0]}"]["${address[1]}"].modify`, t.modify);
47+ this.setArg(`translations["${address[0]}"]["${address[1]}"].path`, t.path);
48+ }
4449 }
4550
4651 onAppendRecord() {
Show on old repository browser