Updated to disable view-all link if tablePath can't be found (e.g., because user can't view table)

This commit is contained in:
2023-01-11 16:44:42 -06:00
parent 23e9abeb74
commit c07a77d4a6

View File

@ -187,7 +187,7 @@ public class ChildRecordListRenderer extends AbstractWidgetRenderer
QTableMetaData table = input.getInstance().getTable(join.getRightTable()); QTableMetaData table = input.getInstance().getTable(join.getRightTable());
String tablePath = input.getInstance().getTablePath(input, table.getName()); String tablePath = input.getInstance().getTablePath(input, table.getName());
String viewAllLink = tablePath + "?filter=" + URLEncoder.encode(JsonUtils.toJson(filter), Charset.defaultCharset()); String viewAllLink = tablePath == null ? null : (tablePath + "?filter=" + URLEncoder.encode(JsonUtils.toJson(filter), Charset.defaultCharset()));
ChildRecordListData widgetData = new ChildRecordListData(widgetLabel, queryOutput, table, tablePath, viewAllLink); ChildRecordListData widgetData = new ChildRecordListData(widgetLabel, queryOutput, table, tablePath, viewAllLink);