Skip to content

Commit e821f86

Browse files
joachimnielandtfxprunayre
authored andcommitted
Add sortLabel as override when applicable
1 parent 167d91e commit e821f86

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

schemas/config-editor.xsd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,6 +2331,11 @@ This can allow to build dynamic snippet based on the current record.
23312331
<xs:documentation>Snippet label.</xs:documentation>
23322332
</xs:annotation>
23332333
</xs:attribute>
2334+
<xs:attribute name="sortLabel" type="xs:string" use="optional">
2335+
<xs:annotation>
2336+
<xs:documentation>When defined, @sortLabel should be used instead of @label for sorting purposes. Handy for putting values at the start of end of a list, for example.</xs:documentation>
2337+
</xs:annotation>
2338+
</xs:attribute>
23342339
</xs:complexType>
23352340
</xs:element>
23362341
<xs:element name="batchEditing">

web/src/main/webapp/xslt/ui-metadata/form-builder.xsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,10 @@
602602
</xsl:if>
603603
</button>
604604
<xsl:if test="$hasMultipleChoice">
605-
<!-- A combo with the list of snippet available -->
605+
<!-- A combo with the list of snippets available -->
606606
<ul class="dropdown-menu">
607607
<xsl:for-each select="$snippets">
608+
<xsl:sort select="if(current()/@sortLabel != '') then current()/@sortLabel else (if ($strings/*[name() = current()/@label] != '') then $strings/*[name() = current()/@label] else current()/@label)"/>
608609
<xsl:variable name="label" select="@label"/>
609610
<li><a id="{concat($id, $label)}">
610611
<xsl:value-of select="if ($strings/*[name() = $label] != '') then $strings/*[name() = $label] else $label"/>

0 commit comments

Comments
 (0)