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
|
@Autowired
|
||||||
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
||||||
|
|
||||||
|
private Boolean isFilterEvent = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the filter layout.
|
* Initialize the filter layout.
|
||||||
@@ -105,7 +107,19 @@ public class SoftwareModuleTable extends AbstractTable {
|
|||||||
if (filterEvent == SMFilterEvent.FILTER_BY_TYPE || filterEvent == SMFilterEvent.FILTER_BY_TEXT
|
if (filterEvent == SMFilterEvent.FILTER_BY_TYPE || filterEvent == SMFilterEvent.FILTER_BY_TEXT
|
||||||
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TYPE
|
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TYPE
|
||||||
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TEXT) {
|
|| 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
|
@Override
|
||||||
protected Container createContainer() {
|
protected Container createContainer() {
|
||||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||||
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 BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<BaseSwModuleBeanQuery>(
|
final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<BaseSwModuleBeanQuery>(
|
||||||
BaseSwModuleBeanQuery.class);
|
BaseSwModuleBeanQuery.class);
|
||||||
@@ -142,6 +151,19 @@ public class SoftwareModuleTable extends AbstractTable {
|
|||||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||||
return container;
|
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
|
@Override
|
||||||
protected void addContainerProperties(final Container container) {
|
protected void addContainerProperties(final Container container) {
|
||||||
|
|||||||
@@ -114,6 +114,8 @@ public class DistributionSetTable extends AbstractTable {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private transient TargetManagement targetManagement;
|
private transient TargetManagement targetManagement;
|
||||||
|
|
||||||
|
private Boolean isFilterEvent = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the component.
|
* Initialize the component.
|
||||||
@@ -157,15 +159,8 @@ public class DistributionSetTable extends AbstractTable {
|
|||||||
@Override
|
@Override
|
||||||
protected Container createContainer() {
|
protected Container createContainer() {
|
||||||
|
|
||||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||||
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 BeanQueryFactory<ManageDistBeanQuery> distributionQF = new BeanQueryFactory<ManageDistBeanQuery>(
|
final BeanQueryFactory<ManageDistBeanQuery> distributionQF = new BeanQueryFactory<ManageDistBeanQuery>(
|
||||||
ManageDistBeanQuery.class);
|
ManageDistBeanQuery.class);
|
||||||
distributionQF.setQueryConfiguration(queryConfiguration);
|
distributionQF.setQueryConfiguration(queryConfiguration);
|
||||||
@@ -175,6 +170,20 @@ public class DistributionSetTable extends AbstractTable {
|
|||||||
|
|
||||||
return distContainer;
|
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)
|
* (non-Javadoc)
|
||||||
@@ -612,7 +621,19 @@ public class DistributionSetTable extends AbstractTable {
|
|||||||
if (event == DistributionTableFilterEvent.FILTER_BY_TEXT
|
if (event == DistributionTableFilterEvent.FILTER_BY_TEXT
|
||||||
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
||||||
|| event == DistributionTableFilterEvent.FILTER_BY_TAG) {
|
|| 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
|
@Autowired
|
||||||
private ArtifactDetailsLayout artifactDetailsLayout;
|
private ArtifactDetailsLayout artifactDetailsLayout;
|
||||||
|
|
||||||
|
private Boolean isFilterEvent = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the filter layout.
|
* Initialize the filter layout.
|
||||||
@@ -124,9 +126,23 @@ public class SwModuleTable extends AbstractTable {
|
|||||||
if (filterEvent == SMFilterEvent.FILTER_BY_TYPE || filterEvent == SMFilterEvent.FILTER_BY_TEXT
|
if (filterEvent == SMFilterEvent.FILTER_BY_TYPE || filterEvent == SMFilterEvent.FILTER_BY_TEXT
|
||||||
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TYPE
|
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TYPE
|
||||||
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TEXT) {
|
|| filterEvent == SMFilterEvent.REMOVER_FILTER_BY_TEXT) {
|
||||||
refreshFilter();
|
if(prepareQueryConfigFilters().size()<2 && isFilterEvent==false){
|
||||||
styleTableOnDistSelection();
|
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
|
@Override
|
||||||
protected Container createContainer() {
|
protected Container createContainer() {
|
||||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||||
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 BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<SwModuleBeanQuery>(
|
final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<SwModuleBeanQuery>(
|
||||||
SwModuleBeanQuery.class);
|
SwModuleBeanQuery.class);
|
||||||
@@ -195,6 +203,20 @@ public class SwModuleTable extends AbstractTable {
|
|||||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||||
return container;
|
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)
|
* (non-Javadoc)
|
||||||
|
|||||||
@@ -112,6 +112,8 @@ public class DistributionTable extends AbstractTable {
|
|||||||
private Boolean isDistPinned = false;
|
private Boolean isDistPinned = false;
|
||||||
|
|
||||||
private Button distributinPinnedBtn;
|
private Button distributinPinnedBtn;
|
||||||
|
|
||||||
|
private Boolean isFilterEvent = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the distribution table.
|
* Initialize the distribution table.
|
||||||
@@ -140,7 +142,24 @@ public class DistributionTable extends AbstractTable {
|
|||||||
if (event == DistributionTableFilterEvent.FILTER_BY_TEXT
|
if (event == DistributionTableFilterEvent.FILTER_BY_TEXT
|
||||||
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
|| event == DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT
|
||||||
|| event == DistributionTableFilterEvent.FILTER_BY_TAG) {
|
|| 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
|
@Override
|
||||||
protected Container createContainer() {
|
protected Container createContainer() {
|
||||||
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
final Map<String, Object> queryConfiguration = prepareQueryConfigFilters();
|
||||||
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 BeanQueryFactory<DistributionBeanQuery> distributionQF = new BeanQueryFactory<DistributionBeanQuery>(
|
final BeanQueryFactory<DistributionBeanQuery> distributionQF = new BeanQueryFactory<DistributionBeanQuery>(
|
||||||
DistributionBeanQuery.class);
|
DistributionBeanQuery.class);
|
||||||
distributionQF.setQueryConfiguration(queryConfiguration);
|
distributionQF.setQueryConfiguration(queryConfiguration);
|
||||||
@@ -239,6 +248,22 @@ public class DistributionTable extends AbstractTable {
|
|||||||
distributionQF);
|
distributionQF);
|
||||||
return distributionContainer;
|
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)
|
* (non-Javadoc)
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import java.util.HashMap;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@@ -138,6 +139,9 @@ public class TargetTable extends AbstractTable implements Handler {
|
|||||||
private Boolean isTargetPinned = Boolean.FALSE;
|
private Boolean isTargetPinned = Boolean.FALSE;
|
||||||
private ShortcutAction actionSelectAll;
|
private ShortcutAction actionSelectAll;
|
||||||
private ShortcutAction actionUnSelectAll;
|
private ShortcutAction actionUnSelectAll;
|
||||||
|
|
||||||
|
private Boolean isFilterEvent = Boolean.FALSE;;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
@@ -207,7 +211,20 @@ public class TargetTable extends AbstractTable implements Handler {
|
|||||||
void onEvent(final TargetFilterEvent filterEvent) {
|
void onEvent(final TargetFilterEvent filterEvent) {
|
||||||
UI.getCurrent().access(() -> {
|
UI.getCurrent().access(() -> {
|
||||||
if (checkFilterEvent(filterEvent)) {
|
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);
|
eventBus.publish(this, ManagementUIEvent.TARGET_TABLE_FILTER);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user