@@ -167,7 +167,7 @@ function generate_oval_tree(self, div_id_with_oval_graph_data) { // eslint-disab
167167}
168168
169169function get_CPE_AL_tree_node ( root ) {
170- if ( root . node_type == 'frac -ref' ) {
170+ if ( root . node_type == 'fact -ref' ) {
171171 return undefined ;
172172 }
173173
@@ -178,8 +178,8 @@ function get_CPE_AL_tree_node(root) {
178178 ul . setAttribute ( 'role' , "group" ) ;
179179 const fragment = document . createDocumentFragment ( ) ;
180180 for ( const child of root . children ) {
181- if ( child . node_type == "frac -ref" ) {
182- fragment . appendChild ( render_CPE_frac_ref ( child ) ) ;
181+ if ( child . node_type == "fact -ref" ) {
182+ fragment . appendChild ( render_CPE_fact_ref ( child ) ) ;
183183 } else {
184184 fragment . appendChild ( get_CPE_AL_tree_node ( child ) ) ;
185185 }
@@ -201,24 +201,15 @@ function get_colors_and_icons(node_data) {
201201 color = 'pf-m-red' ;
202202 icon = 'fa-times' ;
203203 }
204-
205- let negate_color = '' ;
206- let negate_icon = icon ;
207- if ( node_data . negation ) {
208- negate_color = COLOR_TRANSLATION [ NEGATION_COLOR [ color ] ] ;
209- negate_icon = NEGATION_ICON [ icon ] ;
210- } else {
211- negate_color = COLOR_TRANSLATION [ color ] ;
212- }
213- return { color, icon, negate_color, negate_icon } ;
204+ return { color, icon } ;
214205}
215206
216207
217208function base_operator_node ( node_data , node_text ) {
218- const { color, icon, negate_color , negate_icon } = get_colors_and_icons ( node_data ) ;
219- const node = get_node ( negate_color ) ;
209+ const { color, icon } = get_colors_and_icons ( node_data ) ;
210+ const node = get_node ( COLOR_TRANSLATION [ color ] ) ;
220211 node_text . appendChild ( node ) ;
221- const html_icon = get_icon_as_html ( negate_icon ) ;
212+ const html_icon = get_icon_as_html ( icon ) ;
222213 node . appendChild ( html_icon ) ;
223214 if ( node_data . negation ) {
224215 node . appendChild ( get_operator_label_with_tooltip ( "NOT" , OVAL_OPERATOR_EXPLANATION ) ) ;
@@ -241,12 +232,12 @@ function get_CPE_AL_operator_node(node_data) {
241232}
242233
243234
244- function render_CPE_frac_ref ( node_data ) {
235+ function render_CPE_fact_ref ( node_data ) {
245236 const { operator_node, node_text } = get_operator_node ( ) ;
246237 const { node, color, icon } = base_operator_node ( node_data . oval_tree , node_text ) ;
247238
248239 node . appendChild ( get_bold_text ( ` Reference to OVAL definition ` ) ) ;
249- node_text . appendChild ( get_label ( color , "frac -ref" , undefined , "cpe-label" , " cpe-label__content" ) ) ;
240+ node_text . appendChild ( get_label ( color , "fact -ref" , undefined , "cpe-label" , " cpe-label__content" ) ) ;
250241 const span_space = SPAN . cloneNode ( ) ;
251242 span_space . innerText = "\u00A0" ;
252243 node_text . appendChild ( span_space ) ;
@@ -321,11 +312,11 @@ function get_test_node() {
321312
322313function render_OVAL_test ( node_data ) {
323314 const { test_node, node_content, node_text } = get_test_node ( ) ;
324- const { color, icon, negate_color , negate_icon } = get_colors_and_icons ( node_data ) ;
315+ const { color, icon } = get_colors_and_icons ( node_data ) ;
325316
326- const node = get_node ( negate_color ) ;
317+ const node = get_node ( COLOR_TRANSLATION [ color ] ) ;
327318 node_text . appendChild ( node ) ;
328- const html_icon = get_icon_as_html ( negate_icon ) ;
319+ const html_icon = get_icon_as_html ( icon ) ;
329320 node . appendChild ( html_icon ) ;
330321 if ( node_data . negation ) {
331322 node . appendChild ( get_operator_label_with_tooltip ( "NOT" , OVAL_OPERATOR_EXPLANATION ) ) ;
0 commit comments