Menu

Colors on enum values - parse error

Nico
2024-03-01
2024-03-04
  • Nico

    Nico - 2024-03-01

    Hi,
    in my iTop 3.1.1 develeopment environment I am testing setting colours based on custom enum values.
    I added a new state (status) to class UserRequest and defined a color:

        <class id="UserRequest" _delta="must_exist">
          <fields>
            <field id="status">
              <values>
                <value id="pending_supplier" _delta="define">
                  <code>pending_supplier</code>
                  <style>
                    <main_color>#d8e096</main_color>
                    <complementary_color>#d8e096</complementary_color>
                    <decoration_classes>fas fa-hourglass-half</decoration_classes>
                  </style>
                </value>
    

    If I update the iTop code using the toolkit I get this error:

    parse error: failed at $ibo-dm-enum--UserRequest-status-pending_supplier#d8e096#d8e096fas_fa_hourglass_half--main-color: #d8e096 !default; /tmp/itop-4Zelgb//branding/themes/datamodel-compiled-scss-rules.scss on line 531, at column 1

    As described in the documentation (https://www.itophub.io/wiki/page?id=3_1_0:customization:enum-colors) it should work like this.
    What am I doing wrong?
    Thanks,
    Nico

     
  • Guillaume Lajarige

    Hello Nico,

    Check that you set the XML version to 3.0 at the top of your XML file.

    Hope it helps,
    Guillaume

     
    • Nico

      Nico - 2024-03-04

      Hi Guillaume,
      thanks for the hint. I changed it to

      <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0">
      

      And now it works.
      Thanks again,
      Greetings,
      Nico

       
  • Guillaume Lajarige

    Glad to see you fixed your issue!

    Take care,
    Guillaume

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.