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
Aurélien Vermylen
erp5
Commits
f6f865af
Commit
f6f865af
authored
Oct 03, 2014
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Desactivate submit icon on header in case of error.
Change the icon to an exclamation mark in case of error.
parent
5402bd2b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
6 deletions
+40
-6
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
...emplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
+19
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_js.xml
...i/PathTemplateItem/web_page_module/rjs_gadget_erp5_js.xml
+21
-3
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_header_js.xml
View file @
f6f865af
...
@@ -147,6 +147,7 @@
...
@@ -147,6 +147,7 @@
loaded: false,\n
loaded: false,\n
modified: false,\n
modified: false,\n
submitted: true,\n
submitted: true,\n
error: false,\n
options: {}\n
options: {}\n
};\n
};\n
})\n
})\n
...
@@ -174,6 +175,16 @@
...
@@ -174,6 +175,16 @@
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
.declareMethod(\'notifyError\', function () {\n
this.stats.loaded = true;\n
this.stats.submitted = true;\n
this.stats.error = true;\n
var gadget = this;\n
return this.render(this.stats.options)\n
.push(function () {\n
gadget.stats.error = false;\n
});\n
})\n
.declareMethod(\'notifyLoading\', function () {\n
.declareMethod(\'notifyLoading\', function () {\n
if (this.stats.loaded) {\n
if (this.stats.loaded) {\n
this.stats.loaded = false;\n
this.stats.loaded = false;\n
...
@@ -280,7 +291,9 @@
...
@@ -280,7 +291,9 @@
}\n
}\n
\n
\n
//
Handle
right
link\n
//
Handle
right
link\n
if
(!gadget.stats.loaded)
{\n
if
(gadget.stats.error)
{\n
default_right_icon =
"exclamation"
;\n
}
else
if
(!gadget.stats.loaded)
{\n
default_right_icon =
"spinner"
;\n
default_right_icon =
"spinner"
;\n
//
Show
default
loading
information\n
//
Show
default
loading
information\n
right_link =
{\n
right_link =
{\n
...
@@ -315,6 +328,9 @@
...
@@ -315,6 +328,9 @@
title:
possible_right_button_list[i][1],\n
title:
possible_right_button_list[i][1],\n
icon:
default_right_icon
||
possible_right_button_list[i][2]\n
icon:
default_right_icon
||
possible_right_button_list[i][2]\n
};\n
};\n
if
(gadget.stats.error)
{\n
right_button.class =
"ui-disabled"
;\n
}\n
}\n
}\n
}\n
}\n
if
(right_button
!==
undefined)
{\n
if
(right_button
!==
undefined)
{\n
...
@@ -509,7 +525,7 @@
...
@@ -509,7 +525,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
93
7.64299.47970.64017
</string>
</value>
<value>
<string>
93
8.142.63057.34594
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -527,7 +543,7 @@
...
@@ -527,7 +543,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1412
256721.3
3
</float>
<float>
1412
343494.4
3
</float>
<string>
GMT
</string>
<string>
GMT
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_js.xml
View file @
f6f865af
...
@@ -150,7 +150,7 @@
...
@@ -150,7 +150,7 @@
});\n
});\n
}\n
}\n
\n
\n
function displayError(gadget, error) {\n
function displayError
Content
(gadget, error) {\n
// Do not break the application in case of errors.\n
// Do not break the application in case of errors.\n
// Display it to the user for now, and allow user to go back to the frontpage\n
// Display it to the user for now, and allow user to go back to the frontpage\n
var error_text = "";\n
var error_text = "";\n
...
@@ -178,6 +178,24 @@
...
@@ -178,6 +178,24 @@
// XXX Improve error rendering\n
// XXX Improve error rendering\n
gadget.props.article.textContent = "Error: " + error_text;\n
gadget.props.article.textContent = "Error: " + error_text;\n
}\n
}\n
\n
function displayError(gadget, error) {\n
return gadget.getDeclaredGadget("header")\n
.push(function (g) {\n
return g.notifyError();\n
})\n
.push(function () {\n
return displayErrorContent(gadget, error);\n
})\n
.push(function () {\n
return gadget.dropGadget("pg")\n
.push(undefined, function () {\n
// Do not crash the app if the pg gadget in not defined\n
// ie, keep the original error on screen\n
return;\n
});\n
});\n
}\n
\n
\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
// Gadget behaviour\n
// Gadget behaviour\n
...
@@ -532,7 +550,7 @@
...
@@ -532,7 +550,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
93
7.64000.63491.17493
</string>
</value>
<value>
<string>
93
8.273.44627.4590
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -550,7 +568,7 @@
...
@@ -550,7 +568,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1412
256764.71
</float>
<float>
1412
347942.24
</float>
<string>
GMT
</string>
<string>
GMT
</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