clearing the search field should keep the focus.
Signed-off-by: venu1278 <venugopal.boodidadinne@in.bosch.com>
This commit is contained in:
@@ -78,6 +78,8 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
|
||||
@Autowired
|
||||
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
||||
|
||||
private Boolean isFilterEvent = false;
|
||||
|
||||
/**
|
||||
* Initialize the filter layout.
|
||||
@@ -105,7 +107,19 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
if (filterEvent == SMFilterEvent.FILTER_BY_TYPE || filterEvent == SMFilterEvent.FILTER_BY_TEXT
|
||||
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TYPE
|
||||
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TEXT) {
|
||||
refreshFilter();
|
||||
|
||||
if(prepareQueryConfigFilters().size()<1 && isFilterEvent==false){
|
||||
UI.getCurrent().access(() -> ((LazyQueryContainer) getContainerDataSource()).refresh());
|
||||
|
||||
}else {
|
||||
refreshFilter();
|
||||
if(prepareQueryConfigFilters().size()<1){
|
||||
isFilterEvent = false;
|
||||
}else{
|
||||
isFilterEvent = true;
|
||||
}
|
||||
}
|
||||
//refreshFilter();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -127,12 +141,7 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
*/
|
||||
@Override
|
||||
protected Container createContainer() {
|
||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||
artifactUploadState.getSoftwareModuleFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
|
||||
.ifPresent(type -> queryConfiguration.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
|
||||
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||
|
||||
final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<BaseSwModuleBeanQuery>(
|
||||
BaseSwModuleBeanQuery.class);
|
||||
@@ -142,6 +151,19 @@ public class SoftwareModuleTable extends AbstractTable {
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||
return container;
|
||||
}
|
||||
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
artifactUploadState.getSoftwareModuleFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
|
||||
.ifPresent(type -> queryConfig.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
|
||||
|
||||
return queryConfig;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void addContainerProperties(final Container container) {
|
||||
|
||||
@@ -114,6 +114,8 @@ public class DistributionSetTable extends AbstractTable {
|
||||
|
||||
@Autowired
|
||||
private transient TargetManagement targetManagement;
|
||||
|
||||
private Boolean isFilterEvent = false;
|
||||
|
||||
/**
|
||||
* Initialize the component.
|
||||
@@ -157,15 +159,8 @@ public class DistributionSetTable extends AbstractTable {
|
||||
@Override
|
||||
protected Container createContainer() {
|
||||
|
||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||
manageDistUIState.getManageDistFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
if (null != manageDistUIState.getManageDistFilters().getClickedDistSetType()) {
|
||||
queryConfiguration.put(SPUIDefinitions.FILTER_BY_DISTRIBUTION_SET_TYPE,
|
||||
manageDistUIState.getManageDistFilters().getClickedDistSetType());
|
||||
}
|
||||
|
||||
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||
|
||||
final BeanQueryFactory<ManageDistBeanQuery> distributionQF = new BeanQueryFactory<ManageDistBeanQuery>(
|
||||
ManageDistBeanQuery.class);
|
||||
distributionQF.setQueryConfiguration(queryConfiguration);
|
||||
@@ -175,6 +170,20 @@ public class DistributionSetTable extends AbstractTable {
|
||||
|
||||
return distContainer;
|
||||
}
|
||||
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
manageDistUIState.getManageDistFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
if (null != manageDistUIState.getManageDistFilters().getClickedDistSetType()) {
|
||||
queryConfig.put(SPUIDefinitions.FILTER_BY_DISTRIBUTION_SET_TYPE,
|
||||
manageDistUIState.getManageDistFilters().getClickedDistSetType());
|
||||
}
|
||||
|
||||
return queryConfig;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
@@ -612,7 +621,19 @@ public class DistributionSetTable extends AbstractTable {
|
||||
if (event == DistributionTableFilterEvent.FILTER_BY_TEXT
|
||||
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
||||
|| event == DistributionTableFilterEvent.FILTER_BY_TAG) {
|
||||
UI.getCurrent().access(() -> refreshFilter());
|
||||
if(prepareQueryConfigFilters().size()<1 && isFilterEvent==false){
|
||||
UI.getCurrent().access(() -> ((LazyQueryContainer) getContainerDataSource()).refresh());
|
||||
|
||||
}else {
|
||||
UI.getCurrent().access(() -> refreshFilter());
|
||||
if(prepareQueryConfigFilters().size()<1){
|
||||
isFilterEvent = false;
|
||||
}else{
|
||||
isFilterEvent = true;
|
||||
}
|
||||
}
|
||||
|
||||
// UI.getCurrent().access(() -> refreshFilter());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,8 @@ public class SwModuleTable extends AbstractTable {
|
||||
|
||||
@Autowired
|
||||
private ArtifactDetailsLayout artifactDetailsLayout;
|
||||
|
||||
private Boolean isFilterEvent = false;
|
||||
|
||||
/**
|
||||
* Initialize the filter layout.
|
||||
@@ -124,9 +126,23 @@ public class SwModuleTable extends AbstractTable {
|
||||
if (filterEvent == SMFilterEvent.FILTER_BY_TYPE || filterEvent == SMFilterEvent.FILTER_BY_TEXT
|
||||
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TYPE
|
||||
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TEXT) {
|
||||
refreshFilter();
|
||||
styleTableOnDistSelection();
|
||||
}
|
||||
if(prepareQueryConfigFilters().size()<2 && isFilterEvent==false){
|
||||
UI.getCurrent().access(() -> ((LazyQueryContainer) getContainerDataSource()).refresh());
|
||||
|
||||
}else {
|
||||
UI.getCurrent().access(() ->{ refreshFilter();
|
||||
styleTableOnDistSelection();
|
||||
});
|
||||
if(prepareQueryConfigFilters().size()<2){
|
||||
isFilterEvent = false;
|
||||
}else{
|
||||
isFilterEvent = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* refreshFilter();
|
||||
styleTableOnDistSelection();*/
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -177,15 +193,7 @@ public class SwModuleTable extends AbstractTable {
|
||||
*/
|
||||
@Override
|
||||
protected Container createContainer() {
|
||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||
manageDistUIState.getSoftwareModuleFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType()
|
||||
.ifPresent(type -> queryConfiguration.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
|
||||
|
||||
manageDistUIState.getLastSelectedDistribution().ifPresent(
|
||||
distIdName -> queryConfiguration.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId()));
|
||||
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||
|
||||
final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<SwModuleBeanQuery>(
|
||||
SwModuleBeanQuery.class);
|
||||
@@ -195,6 +203,20 @@ public class SwModuleTable extends AbstractTable {
|
||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||
return container;
|
||||
}
|
||||
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
manageDistUIState.getSoftwareModuleFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
|
||||
manageDistUIState.getSoftwareModuleFilters().getSoftwareModuleType()
|
||||
.ifPresent(type -> queryConfig.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
|
||||
|
||||
manageDistUIState.getLastSelectedDistribution().ifPresent(
|
||||
distIdName -> queryConfig.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId()));
|
||||
|
||||
return queryConfig;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -112,6 +112,8 @@ public class DistributionTable extends AbstractTable {
|
||||
private Boolean isDistPinned = false;
|
||||
|
||||
private Button distributinPinnedBtn;
|
||||
|
||||
private Boolean isFilterEvent = false;
|
||||
|
||||
/**
|
||||
* Initialize the distribution table.
|
||||
@@ -140,7 +142,24 @@ public class DistributionTable extends AbstractTable {
|
||||
if (event == DistributionTableFilterEvent.FILTER_BY_TEXT
|
||||
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
||||
|| event == DistributionTableFilterEvent.FILTER_BY_TAG) {
|
||||
UI.getCurrent().access(() -> refreshFilter());
|
||||
if(((boolean)prepareQueryConfigFilters().get(SPUIDefinitions.FILTER_BY_NO_TAG)==false)
|
||||
&& ((List)prepareQueryConfigFilters().get(SPUIDefinitions.FILTER_BY_TAG)).isEmpty()
|
||||
&& prepareQueryConfigFilters().size()<3
|
||||
&& isFilterEvent==false){
|
||||
UI.getCurrent().access(() -> ((LazyQueryContainer) getContainerDataSource()).refresh());
|
||||
|
||||
}else {
|
||||
UI.getCurrent().access(() -> refreshFilter());
|
||||
if(((boolean)prepareQueryConfigFilters().get(SPUIDefinitions.FILTER_BY_NO_TAG)==false)
|
||||
&& ((List)prepareQueryConfigFilters().get(SPUIDefinitions.FILTER_BY_TAG)).isEmpty()
|
||||
&& prepareQueryConfigFilters().size()<3){
|
||||
isFilterEvent = false;
|
||||
}else{
|
||||
isFilterEvent = true;
|
||||
}
|
||||
}
|
||||
|
||||
// UI.getCurrent().access(() -> refreshFilter());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,18 +238,8 @@ public class DistributionTable extends AbstractTable {
|
||||
*/
|
||||
@Override
|
||||
protected Container createContainer() {
|
||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||
managementUIState.getDistributionTableFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
managementUIState.getDistributionTableFilters().getPinnedTargetId()
|
||||
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.ORDER_BY_PINNED_TARGET, value));
|
||||
final List<String> list = new ArrayList<String>();
|
||||
queryConfiguration.put(SPUIDefinitions.FILTER_BY_NO_TAG,
|
||||
managementUIState.getDistributionTableFilters().isNoTagSelected());
|
||||
if (!managementUIState.getDistributionTableFilters().getDistSetTags().isEmpty()) {
|
||||
list.addAll(managementUIState.getDistributionTableFilters().getDistSetTags());
|
||||
}
|
||||
queryConfiguration.put(SPUIDefinitions.FILTER_BY_TAG, list);
|
||||
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||
|
||||
final BeanQueryFactory<DistributionBeanQuery> distributionQF = new BeanQueryFactory<DistributionBeanQuery>(
|
||||
DistributionBeanQuery.class);
|
||||
distributionQF.setQueryConfiguration(queryConfiguration);
|
||||
@@ -239,6 +248,22 @@ public class DistributionTable extends AbstractTable {
|
||||
distributionQF);
|
||||
return distributionContainer;
|
||||
}
|
||||
|
||||
private Map<String, Object> prepareQueryConfigFilters() {
|
||||
final Map<String, Object> queryConfig = new HashMap<String, Object>();
|
||||
managementUIState.getDistributionTableFilters().getSearchText()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||
managementUIState.getDistributionTableFilters().getPinnedTargetId()
|
||||
.ifPresent(value -> queryConfig.put(SPUIDefinitions.ORDER_BY_PINNED_TARGET, value));
|
||||
final List<String> list = new ArrayList<String>();
|
||||
queryConfig.put(SPUIDefinitions.FILTER_BY_NO_TAG,
|
||||
managementUIState.getDistributionTableFilters().isNoTagSelected());
|
||||
if (!managementUIState.getDistributionTableFilters().getDistSetTags().isEmpty()) {
|
||||
list.addAll(managementUIState.getDistributionTableFilters().getDistSetTags());
|
||||
}
|
||||
queryConfig.put(SPUIDefinitions.FILTER_BY_TAG, list);
|
||||
return queryConfig;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -138,6 +139,9 @@ public class TargetTable extends AbstractTable implements Handler {
|
||||
private Boolean isTargetPinned = Boolean.FALSE;
|
||||
private ShortcutAction actionSelectAll;
|
||||
private ShortcutAction actionUnSelectAll;
|
||||
|
||||
private Boolean isFilterEvent = Boolean.FALSE;;
|
||||
|
||||
|
||||
@Override
|
||||
@PostConstruct
|
||||
@@ -207,7 +211,20 @@ public class TargetTable extends AbstractTable implements Handler {
|
||||
void onEvent(final TargetFilterEvent filterEvent) {
|
||||
UI.getCurrent().access(() -> {
|
||||
if (checkFilterEvent(filterEvent)) {
|
||||
refreshFilter();
|
||||
if(((boolean)prepareQueryConfigFilters().get(SPUIDefinitions.FILTER_BY_NO_TAG)==false)
|
||||
&& prepareQueryConfigFilters().size()<2
|
||||
&& isFilterEvent==Boolean.FALSE){
|
||||
((LazyQueryContainer) getContainerDataSource()).refresh();
|
||||
|
||||
}else {
|
||||
refreshFilter();
|
||||
if(prepareQueryConfigFilters().size()<2){
|
||||
isFilterEvent = Boolean.FALSE;
|
||||
}else{
|
||||
isFilterEvent = Boolean.TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
eventBus.publish(this, ManagementUIEvent.TARGET_TABLE_FILTER);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user