Merge pull request #44 from bsinno/clearing_the_search_field_should_keep_the_focus
ok merging.
This commit is contained in:
@@ -78,7 +78,8 @@ public class SoftwareModuleTable extends AbstractTable {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
private UploadViewAcceptCriteria uploadViewAcceptCriteria;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the filter layout.
|
* Initialize the filter layout.
|
||||||
*/
|
*/
|
||||||
@@ -127,12 +128,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 +138,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) {
|
||||||
|
|||||||
@@ -219,8 +219,10 @@ public class SoftwareModuleTableHeader extends AbstractTableHeader {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void resetSearchText() {
|
protected void resetSearchText() {
|
||||||
artifactUploadState.getSoftwareModuleFilters().setSearchText(null);
|
if(artifactUploadState.getSoftwareModuleFilters().getSearchText().isPresent()){
|
||||||
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT);
|
artifactUploadState.getSoftwareModuleFilters().setSearchText(null);
|
||||||
|
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public class DistributionSetTable extends AbstractTable {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private transient TargetManagement targetManagement;
|
private transient TargetManagement targetManagement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the component.
|
* Initialize the component.
|
||||||
*/
|
*/
|
||||||
@@ -157,21 +157,28 @@ public class DistributionSetTable extends AbstractTable {
|
|||||||
@Override
|
@Override
|
||||||
protected Container createContainer() {
|
protected Container createContainer() {
|
||||||
|
|
||||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
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.class);
|
final BeanQueryFactory<ManageDistBeanQuery> distributionQF = new BeanQueryFactory<>(ManageDistBeanQuery.class);
|
||||||
|
|
||||||
distributionQF.setQueryConfiguration(queryConfiguration);
|
distributionQF.setQueryConfiguration(queryConfiguration);
|
||||||
return new LazyQueryContainer(
|
return new LazyQueryContainer(
|
||||||
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME),
|
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, SPUILabelDefinitions.VAR_DIST_ID_NAME),
|
||||||
distributionQF);
|
distributionQF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
|||||||
@@ -170,9 +170,10 @@ public class DistributionSetTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void resetSearchText() {
|
protected void resetSearchText() {
|
||||||
manageDistUIstate.getManageDistFilters().setSearchText(null);
|
if(manageDistUIstate.getManageDistFilters().getSearchText().isPresent()){
|
||||||
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT);
|
manageDistUIstate.getManageDistFilters().setSearchText(null);
|
||||||
|
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ public class SwModuleTable extends AbstractTable {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ArtifactDetailsLayout artifactDetailsLayout;
|
private ArtifactDetailsLayout artifactDetailsLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the filter layout.
|
* Initialize the filter layout.
|
||||||
*/
|
*/
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
@@ -177,15 +177,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 +187,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)
|
||||||
|
|||||||
@@ -203,8 +203,10 @@ public class SwModuleTableHeader extends AbstractTableHeader {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void resetSearchText() {
|
protected void resetSearchText() {
|
||||||
manageDistUIState.getSoftwareModuleFilters().setSearchText(null);
|
if(manageDistUIState.getSoftwareModuleFilters().getSearchText().isPresent()){
|
||||||
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT);
|
manageDistUIState.getSoftwareModuleFilters().setSearchText(null);
|
||||||
|
eventbus.publish(this, SMFilterEvent.REMOVER_FILTER_BY_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -112,7 +112,8 @@ public class DistributionTable extends AbstractTable {
|
|||||||
private Boolean isDistPinned = false;
|
private Boolean isDistPinned = false;
|
||||||
|
|
||||||
private Button distributinPinnedBtn;
|
private Button distributinPinnedBtn;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the distribution table.
|
* Initialize the distribution table.
|
||||||
*/
|
*/
|
||||||
@@ -141,7 +142,7 @@ public class DistributionTable extends AbstractTable {
|
|||||||
|| 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());
|
UI.getCurrent().access(() -> refreshFilter());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventBusListenerMethod(scope = EventScope.SESSION)
|
@EventBusListenerMethod(scope = EventScope.SESSION)
|
||||||
@@ -219,18 +220,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 +230,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)
|
||||||
|
|||||||
@@ -210,8 +210,10 @@ public class DistributionTableHeader extends AbstractTableHeader {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void resetSearchText() {
|
protected void resetSearchText() {
|
||||||
managementUIState.getDistributionTableFilters().setSearchText(null);
|
if( managementUIState.getDistributionTableFilters().getSearchText().isPresent()){
|
||||||
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT);
|
managementUIState.getDistributionTableFilters().setSearchText(null);
|
||||||
|
eventbus.publish(this, DistributionTableFilterEvent.REMOVE_FILTER_BY_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
@@ -140,6 +141,8 @@ 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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
|
|||||||
@@ -258,8 +258,10 @@ public class TargetTableHeader extends AbstractTableHeader {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void resetSearchText() {
|
protected void resetSearchText() {
|
||||||
managementUIState.getTargetTableFilters().setSearchText(null);
|
if(managementUIState.getTargetTableFilters().getSearchText().isPresent()){
|
||||||
eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_TEXT);
|
managementUIState.getTargetTableFilters().setSearchText(null);
|
||||||
|
eventBus.publish(this, TargetFilterEvent.REMOVE_FILTER_BY_TEXT);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSearchText() {
|
private String getSearchText() {
|
||||||
|
|||||||
Reference in New Issue
Block a user