Skip to content

Commit

Permalink
officejs: stop using unsafe web section in echarts gadget
Browse files Browse the repository at this point in the history
To work 100% this needs "style-src: unsafe-inline" in the CSP, without
this the popup on hover does not show the series color - which in our
case is better than using the CSP.

also drop obsolete appcache, browsers no longer use this.

reference ossie: apache/echarts#16610 on github
  • Loading branch information
perrinjerome committed Sep 8, 2023
1 parent 948998a commit 50f5cc7
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 64 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
html {
height: 300px;
}

body {
height: 100%;
margin: 0;
}

.graph-content {
height: 95%;
width: 95%;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Manifest" module="erp5.portal_type"/>
<global name="Web Style" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
Expand All @@ -23,7 +23,6 @@
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
Expand All @@ -42,8 +41,6 @@
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
Expand All @@ -61,14 +58,6 @@
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>contributor/person_module/1</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
Expand All @@ -77,11 +66,13 @@
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/plain</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_field_graph_echarts.appcache</string> </value>
<value> <string>gadget_field_graph_echarts.css</string> </value>
</item>
<item>
<key> <string>description</string> </key>
Expand All @@ -91,44 +82,21 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>gadget_field_graph_echarts_appcache</string> </value>
<value> <string>gadget_field_graph_echarts_css</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Manifest</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string>CACHE MANIFEST\n
# v1.1.1\n
CACHE:\n
gadget_field_graph_echarts.html/echarts-all.js\n
gadget_field_graph_echarts.html/gadget_global.js\n
gadget_field_graph_echarts.html/renderjs.js\n
gadget_field_graph_echarts.html/rsvp.js\n
gadget_field_graph_echarts.html/unsafe/gadget_field_graph_echarts.js\n
NETWORK:\n
*</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Officejs ECharts Cache</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
<value>
<none/>
</value>
<value> <string>Field Graph With Echarts CSS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
Expand Down Expand Up @@ -190,11 +158,11 @@ NETWORK:\n
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
<value> <string>publish</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>ERP5TypeTestCase</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
Expand All @@ -218,7 +186,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1506525352.34</float>
<float>1694150959.89</float>
<string>UTC</string>
</tuple>
</state>
Expand All @@ -227,7 +195,7 @@ NETWORK:\n
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
<value> <string>published</string> </value>
</item>
</dictionary>
</list>
Expand All @@ -253,7 +221,7 @@ NETWORK:\n
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>ERP5TypeTestCase</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
Expand All @@ -267,7 +235,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>962.25486.15124.29883</string> </value>
<value> <string>1010.64822.48938.57036</string> </value>
</item>
<item>
<key> <string>state</string> </key>
Expand All @@ -287,8 +255,8 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1538646068.83</float>
<string>GMT+9</string>
<float>1694152130.18</float>
<string>UTC</string>
</tuple>
</state>
</object>
Expand All @@ -314,11 +282,13 @@ NETWORK:\n
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>detect_converted_file</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>ERP5TypeTestCase</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
Expand All @@ -330,7 +300,7 @@ NETWORK:\n
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>converted</string> </value>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
Expand All @@ -350,7 +320,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1506524633.84</float>
<float>1694150865.83</float>
<string>UTC</string>
</tuple>
</state>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html manifest="gadget_field_graph_echarts.appcache" style="height: 300px">
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width" />
Expand All @@ -9,19 +9,20 @@
<link rel="http://www.renderjs.org/rel/interface" href="gadget_field_graph_interface.html">

<!-- renderjs -->
<script src="rsvp.js" type="text/javascript"></script>
<script src="renderjs.js" type="text/javascript"></script>
<script src="rsvp.js"></script>
<script src="renderjs.js"></script>

<!-- libraries needed for graphs -->
<script src="echarts-all.js" type="text/javascript"></script>
<script src="echarts-all.js"></script>

<!-- custom script -->
<script src="gadget_global.js" type="text/javascript"></script>
<script src="unsafe/gadget_field_graph_echarts.js" type="text/javascript"></script>
<script src="gadget_global.js"></script>
<script src="gadget_field_graph_echarts.js"></script>
<link rel="stylesheet" type="text/css" href="gadget_field_graph_echarts.css">

</head>
<body style="height: 100%; margin: 0">
<div class="graph-content" style="height: 95%; width: 95%" disabled>
<body>
<div class="graph-content" disabled>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>classification/collaborative/team</string>
</tuple>
<tuple/>
</value>
</item>
<item>
Expand Down Expand Up @@ -268,8 +266,8 @@
</tuple>
<state>
<tuple>
<float>1538645729.6</float>
<string>GMT+9</string>
<float>1694152073.26</float>
<string>UTC</string>
</tuple>
</state>
</object>
Expand Down

0 comments on commit 50f5cc7

Please sign in to comment.