Merge pull request #184 from bsinno/fix_display_DSNameVersion_actionhistory_table
Fix display ds name version actionhistory table
This commit is contained in:
@@ -296,8 +296,8 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
|||||||
* add distribution name to the item which will be displayed in the
|
* add distribution name to the item which will be displayed in the
|
||||||
* table. The name should not exceed certain limit.
|
* table. The name should not exceed certain limit.
|
||||||
*/
|
*/
|
||||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST).setValue(HawkbitCommonUtil
|
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST).setValue(actionWithStatusCount.getDsName() + ":" +
|
||||||
.getFormattedText(actionWithStatusCount.getDsName() + ":" + actionWithStatusCount.getDsVersion()));
|
actionWithStatusCount.getDsVersion());
|
||||||
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_FORCED).setValue(action);
|
item.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_FORCED).setValue(action);
|
||||||
|
|
||||||
/* Default no child */
|
/* Default no child */
|
||||||
@@ -442,8 +442,8 @@ public class ActionHistoryTable extends TreeTable implements Handler {
|
|||||||
childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_ACTIVE_HIDDEN).setValue("");
|
childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_ACTIVE_HIDDEN).setValue("");
|
||||||
|
|
||||||
childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST)
|
childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DIST)
|
||||||
.setValue(HawkbitCommonUtil.getFormattedText(action.getDistributionSet().getName() + ":"
|
.setValue(action.getDistributionSet().getName() + ":"
|
||||||
+ action.getDistributionSet().getVersion()));
|
+ action.getDistributionSet().getVersion());
|
||||||
|
|
||||||
childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DATETIME)
|
childItem.getItemProperty(SPUIDefinitions.ACTION_HIS_TBL_DATETIME)
|
||||||
.setValue(SPDateTimeUtil.getFormattedDate(actionStatus.getCreatedAt()));
|
.setValue(SPDateTimeUtil.getFormattedDate(actionStatus.getCreatedAt()));
|
||||||
|
|||||||
@@ -431,27 +431,7 @@ public final class HawkbitCommonUtil {
|
|||||||
return trimAndNullIfEmpty(orgText) == null ? SPUIDefinitions.SPACE : orgText;
|
return trimAndNullIfEmpty(orgText) == null ? SPUIDefinitions.SPACE : orgText;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Format the lengthy text.
|
|
||||||
*
|
|
||||||
* @param orgText
|
|
||||||
* text to be formatted
|
|
||||||
* @return String formatted text
|
|
||||||
*/
|
|
||||||
public static String getFormattedText(final String orgText) {
|
|
||||||
if (orgText == null) {
|
|
||||||
return StringUtils.EMPTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
final int txtLengthAllowed = SPUIDefinitions.NAME_DESCRIPTION_LENGTH;
|
|
||||||
if (orgText.length() > txtLengthAllowed) {
|
|
||||||
return new StringBuilder(orgText.substring(0, txtLengthAllowed)).append("...").toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
return orgText;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Find extra height required to increase by all the components to utilize
|
* Find extra height required to increase by all the components to utilize
|
||||||
* the full height of browser for the responsive UI.
|
* the full height of browser for the responsive UI.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user