Skip to content

Commit

Permalink
Issue 28780 add hint support for relationship field (#30679)
Browse files Browse the repository at this point in the history
Added hint content type property in base structure of Relationship Field
and added logic to show the hint icon when present
  • Loading branch information
gortiz-dotcms authored Nov 19, 2024
1 parent ff200dd commit c686622
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,6 @@ public abstract static class Builder implements RelationshipFieldBuilder {
@JsonIgnore
public Collection<ContentTypeFieldProperties> getFieldContentTypeProperties(){
return list(ContentTypeFieldProperties.REQUIRED, ContentTypeFieldProperties.NAME,
ContentTypeFieldProperties.RELATIONSHIPS, ContentTypeFieldProperties.SEARCHABLE);
ContentTypeFieldProperties.RELATIONSHIPS, ContentTypeFieldProperties.HINT, ContentTypeFieldProperties.SEARCHABLE);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
<%@ page import="com.dotcms.contenttype.transform.field.FieldTransformer" %>
<%@ page import="com.dotmarketing.util.Logger" %>
<%@ page import="com.dotmarketing.util.ConfigUtils" %>
<%@ page import="java.util.Optional" %>
<!DOCTYPE html>
<script type='text/javascript' src='/dwr/interface/LanguageAjax.js'></script>

Expand Down Expand Up @@ -441,6 +442,17 @@
}%>

<div class="fieldName">
<%
String hint = Optional.ofNullable(f.getHint())
.filter(UtilMethods::isSet)
.orElse(null);
if (hint != null) {
%>
<a href="#" id="tip-<%=f.getVelocityVarName()%>"><span class="hintIcon"></span></a>
<span dojoType="dijit.Tooltip" connectId="tip-<%=f.getVelocityVarName()%>" position="above" style="width:100px;">
<span class="contentHint"><%=hint%></span>
</span>
<%}%>
<% if(f.isRequired()) {%>
<label class="required">
<%} else {%>
Expand Down

0 comments on commit c686622

Please sign in to comment.