Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
d1006d7b
Commit
d1006d7b
authored
Oct 25, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Set setting_id parameter on the gadget state
parent
bda7f4cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
...mplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
+12
-11
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
...plateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.js
View file @
d1006d7b
...
@@ -200,18 +200,19 @@
...
@@ -200,18 +200,19 @@
// Page rendering
// Page rendering
//////////////////////////////////////////
//////////////////////////////////////////
rJS
(
window
)
rJS
(
window
)
.
setState
({
setting_id
:
"
setting/
"
+
document
.
head
.
querySelector
(
'
script[data-renderjs-configuration="application_title"]
'
).
textContent
})
.
ready
(
function
()
{
.
ready
(
function
()
{
var
gadget
=
this
,
var
gadget
=
this
,
setting_gadget
,
setting_gadget
,
setting
;
setting
;
this
.
props
=
{
this
.
props
=
{
loading_counter
:
0
,
loading_counter
:
0
,
content_element
:
this
.
element
.
querySelector
(
'
.gadget-content
'
),
content_element
:
this
.
element
.
querySelector
(
'
.gadget-content
'
)
setting_id
:
"
setting/
"
+
document
.
head
.
querySelector
(
'
script[data-renderjs-configuration="application_title"]
'
).
textContent
};
};
// Configure setting storage
// Configure setting storage
return
gadget
.
getDeclaredGadget
(
"
setting_gadget
"
)
return
gadget
.
getDeclaredGadget
(
"
setting_gadget
"
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
...
@@ -223,7 +224,7 @@
...
@@ -223,7 +224,7 @@
})
})
.
push
(
function
()
{
.
push
(
function
()
{
return
setting_gadget
.
get
(
gadget
.
props
.
setting_id
)
return
setting_gadget
.
get
(
gadget
.
state
.
setting_id
)
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
if
(
error
.
status_code
===
404
)
{
if
(
error
.
status_code
===
404
)
{
return
{};
return
{};
...
@@ -266,7 +267,7 @@
...
@@ -266,7 +267,7 @@
}
}
}
}
return
setting_gadget
.
put
(
gadget
.
props
.
setting_id
,
setting
);
return
setting_gadget
.
put
(
gadget
.
state
.
setting_id
,
setting
);
})
})
.
push
(
function
()
{
.
push
(
function
()
{
// Configure jIO storage
// Configure jIO storage
...
@@ -296,7 +297,7 @@
...
@@ -296,7 +297,7 @@
.
allowPublicAcquisition
(
"
getSettingList
"
,
.
allowPublicAcquisition
(
"
getSettingList
"
,
function
getSettingList
(
argument_list
)
{
function
getSettingList
(
argument_list
)
{
var
key_list
=
argument_list
[
0
];
var
key_list
=
argument_list
[
0
];
return
route
(
this
,
'
setting_gadget
'
,
'
get
'
,
[
this
.
props
.
setting_id
])
return
route
(
this
,
'
setting_gadget
'
,
'
get
'
,
[
this
.
state
.
setting_id
])
.
push
(
function
(
doc
)
{
.
push
(
function
(
doc
)
{
var
i
,
var
i
,
result_list
=
[];
result_list
=
[];
...
@@ -315,7 +316,7 @@
...
@@ -315,7 +316,7 @@
var
gadget
=
this
,
var
gadget
=
this
,
key
=
argument_list
[
0
],
key
=
argument_list
[
0
],
default_value
=
argument_list
[
1
];
default_value
=
argument_list
[
1
];
return
route
(
gadget
,
'
setting_gadget
'
,
'
get
'
,
[
gadget
.
props
.
setting_id
])
return
route
(
gadget
,
'
setting_gadget
'
,
'
get
'
,
[
gadget
.
state
.
setting_id
])
.
push
(
function
(
doc
)
{
.
push
(
function
(
doc
)
{
return
doc
[
key
]
||
default_value
;
return
doc
[
key
]
||
default_value
;
},
function
(
error
)
{
},
function
(
error
)
{
...
@@ -333,7 +334,7 @@
...
@@ -333,7 +334,7 @@
return
gadget
.
getDeclaredGadget
(
"
setting_gadget
"
)
return
gadget
.
getDeclaredGadget
(
"
setting_gadget
"
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
jio_gadget
=
result
;
jio_gadget
=
result
;
return
jio_gadget
.
get
(
gadget
.
props
.
setting_id
);
return
jio_gadget
.
get
(
gadget
.
state
.
setting_id
);
})
})
.
push
(
undefined
,
function
(
error
)
{
.
push
(
undefined
,
function
(
error
)
{
if
(
error
.
status_code
===
404
)
{
if
(
error
.
status_code
===
404
)
{
...
@@ -343,7 +344,7 @@
...
@@ -343,7 +344,7 @@
})
})
.
push
(
function
(
doc
)
{
.
push
(
function
(
doc
)
{
doc
[
key
]
=
value
;
doc
[
key
]
=
value
;
return
jio_gadget
.
put
(
gadget
.
props
.
setting_id
,
doc
);
return
jio_gadget
.
put
(
gadget
.
state
.
setting_id
,
doc
);
});
});
})
})
.
allowPublicAcquisition
(
"
translateHtml
"
,
function
translateHtml
(
.
allowPublicAcquisition
(
"
translateHtml
"
,
function
translateHtml
(
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
View file @
d1006d7b
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
971.116
49.40314.9062
</string>
</value>
<value>
<string>
971.116
71.54203.21998
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
154045
8410.99
</float>
<float>
154045
9696.8
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment