Add TOOLTIP type adornment; also, update url-encoding in FileDownload adornment to .replace("+", "%20")

This commit is contained in:
2025-02-26 14:55:07 -06:00
parent 428832f4ec
commit 2703f06b23

View File

@ -46,6 +46,7 @@ public enum AdornmentType
REVEAL, REVEAL,
FILE_DOWNLOAD, FILE_DOWNLOAD,
FILE_UPLOAD, FILE_UPLOAD,
TOOLTIP,
ERROR; ERROR;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// keep these values in sync with AdornmentType.ts in qqq-frontend-core // // keep these values in sync with AdornmentType.ts in qqq-frontend-core //
@ -92,9 +93,9 @@ public enum AdornmentType
static String makeFieldDownloadUrl(String tableName, Serializable primaryKey, String fieldName, String fileName) static String makeFieldDownloadUrl(String tableName, Serializable primaryKey, String fieldName, String fileName)
{ {
return ("/data/" + tableName + "/" return ("/data/" + tableName + "/"
+ URLEncoder.encode(Objects.requireNonNullElse(ValueUtils.getValueAsString(primaryKey), ""), StandardCharsets.UTF_8) + "/" + URLEncoder.encode(Objects.requireNonNullElse(ValueUtils.getValueAsString(primaryKey), ""), StandardCharsets.UTF_8).replace("+", "%20") + "/"
+ fieldName + "/" + fieldName + "/"
+ URLEncoder.encode(Objects.requireNonNullElse(fileName, ""), StandardCharsets.UTF_8)); + URLEncoder.encode(Objects.requireNonNullElse(fileName, ""), StandardCharsets.UTF_8).replace("+", "%20"));
} }
} }
@ -246,4 +247,15 @@ public enum AdornmentType
} }
} }
/*******************************************************************************
**
*******************************************************************************/
public interface TooltipValues
{
String STATIC_TEXT = "staticText";
String TOOLTIP_DYNAMIC = "tooltipDynamic";
}
} }