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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Papa Tamsir Kane
erp5
Commits
ba3646b8
Commit
ba3646b8
authored
Jun 14, 2017
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Launcher: reset the url state when displaying an error
parent
aa98bcae
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
14 deletions
+26
-14
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
+24
-12
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 @
ba3646b8
...
@@ -154,24 +154,19 @@
...
@@ -154,24 +154,19 @@
// Gadget has not yet been correctly initialized
// Gadget has not yet been correctly initialized
throw
error
;
throw
error
;
}
}
// XXX Improve error rendering
gadget
.
props
.
content_element
.
innerHTML
=
"
<br/><br/><br/><pre></pre>
"
;
return
gadget
.
changeState
({
gadget
.
props
.
content_element
.
querySelector
(
'
pre
'
).
textContent
=
error_text
:
error_text
,
"
Error:
"
+
error_text
;
url
:
undefined
// XXX Notify error
});
}
}
function
displayError
(
gadget
,
error
)
{
function
displayError
(
gadget
,
error
)
{
if
(
error
instanceof
RSVP
.
CancellationError
)
{
if
(
error
instanceof
RSVP
.
CancellationError
)
{
return
;
return
;
}
}
displayErrorContent
(
gadget
,
error
);
return
displayErrorContent
(
gadget
,
error
);
return
gadget
.
dropGadget
(
MAIN_SCOPE
)
.
push
(
undefined
,
function
()
{
// Do not crash the app if the pg gadget in not defined
// ie, keep the original error on screen
return
;
});
}
}
//////////////////////////////////////////
//////////////////////////////////////////
...
@@ -479,6 +474,23 @@
...
@@ -479,6 +474,23 @@
.
onStateChange
(
function
(
modification_dict
)
{
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
,
var
gadget
=
this
,
route_result
=
gadget
.
state
;
route_result
=
gadget
.
state
;
if
(
modification_dict
.
hasOwnProperty
(
'
error_text
'
))
{
return
gadget
.
dropGadget
(
MAIN_SCOPE
)
.
push
(
undefined
,
function
()
{
// Do not crash the app if the pg gadget in not defined
// ie, keep the original error on screen
return
;
})
.
push
(
function
()
{
// XXX Improve error rendering
gadget
.
props
.
content_element
.
innerHTML
=
"
<br/><br/><br/><pre></pre>
"
;
gadget
.
props
.
content_element
.
querySelector
(
'
pre
'
).
textContent
=
"
Error:
"
+
gadget
.
state
.
error_text
;
// XXX Notify error
});
}
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
return
new
RSVP
.
Queue
()
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
.
push
(
function
()
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_launcher_js.xml
View file @
ba3646b8
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
58.43029.38869.9284
</string>
</value>
<value>
<string>
9
60.2672.38593.36659
</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>
149
2087071.7
</float>
<float>
149
7443691.6
</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