Ignore:
Timestamp:
2023-12-19T17:09:19+01:00 (2 years ago)
Author:
taylor.smock
Message:

Fix #23290: Validate the regions a tag is expected to be in (patch by Sarabjeet108, modified)

Modifications are as follows:

  • Allow the use of the new region attributes for keys inside a preset
  • Basic tests

regions comes from Vespucci's extensions: https://vespucci.io/tutorials/presets/#extensions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/resources/data/tagging-preset.xsd

    r18812 r18918  
    107107            <extension base="tns:group-parent">
    108108                <attributeGroup ref="tns:attributes.name" />
     109                <attributeGroup ref="tns:attributes.regions"/>
    109110            </extension>
    110111        </complexContent>
     
    122123        <annotation>
    123124            <documentation>
    124                 Every item is one annotation set to select from. name is required, type and preset_name_label are recommended, icon and name_template are optional attributes.
     125                Every item is one annotation set to select from. name is required, type and preset_name_label are recommended and icon, name_template, regions and exclude_regions are optional attributes.
    125126            </documentation>
    126127        </annotation>
     
    135136        <attributeGroup ref="tns:attributes.name" />
    136137        <attributeGroup ref="tns:attributes.icon" />
     138        <attributeGroup ref="tns:attributes.regions"/>
    137139        <attribute name="type" type="string">
    138140            <annotation>
     
    365367        <annotation>
    366368            <documentation><![CDATA[
    367                 Used in <combo/> and <multiselect/>. More information see short_descriptions below. The attributes are value, display_value, short_description, icon and icon_size.
     369                Used in <combo/> and <multiselect/>. More information see short_descriptions below. The attributes are value, display_value, short_description, icon, icon_size, regions, and exclude_regions.
    368370            ]]></documentation>
    369371        </annotation>
     
    379381        </attribute>
    380382        <attributeGroup ref="tns:attributes.icon" />
     383        <attributeGroup ref="tns:attributes.regions"/>
    381384        <anyAttribute processContents="skip" />
    382385    </complexType>
     
    490493        <attribute name="match" type="tns:match" />
    491494        <attributeGroup ref="tns:attributes.icon" />
     495        <attributeGroup ref="tns:attributes.regions"/>
    492496
    493497        <attribute name="name" use="prohibited" />
     
    559563        <annotation>
    560564            <documentation>
    561                 To specify possible roles of members in relations. The key attribute is required, text, requisite, count, type and member_expression are optional.
     565                To specify possible roles of members in relations. The key attribute is required, text, requisite, count, type, member_expression, regions, and exclude_regions are optional.
    562566            </documentation>
    563567        </annotation>
     
    575579        <attribute name="member_expression" type="string" />
    576580        <attribute name="regexp" type="boolean" />
     581        <attributeGroup ref="tns:attributes.regions"/>
    577582        <anyAttribute processContents="skip" />
    578583    </complexType>
     
    730735    </attributeGroup>
    731736
     737    <attributeGroup name="attributes.regions">
     738        <attribute name="regions" type="string">
     739            <annotation>
     740                <documentation>
     741                    Comma separated list of countries this preset group or item is applicable for. If not specified, the preset is applicable for all countries.
     742                </documentation>
     743            </annotation>
     744        </attribute>
     745        <attribute name="exclude_regions" type="boolean">
     746            <annotation>
     747                <documentation>
     748                    If true, invert the meaning of regions.
     749                </documentation>
     750            </annotation>
     751        </attribute>
     752    </attributeGroup>
     753
    732754</schema>
Note: See TracChangeset for help on using the changeset viewer.