Revert Clean Code Changes
Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
@@ -75,7 +75,7 @@ public class RedisConfiguration {
|
|||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
public RedisTemplate<String, Object> redisTemplate() {
|
public RedisTemplate<String, Object> redisTemplate() {
|
||||||
final RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
final RedisTemplate<String, Object> redisTemplate = new RedisTemplate<String, Object>();
|
||||||
redisTemplate.setConnectionFactory(jedisConnectionFactory());
|
redisTemplate.setConnectionFactory(jedisConnectionFactory());
|
||||||
redisTemplate.setKeySerializer(new JdkSerializationRedisSerializer());
|
redisTemplate.setKeySerializer(new JdkSerializationRedisSerializer());
|
||||||
redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer());
|
redisTemplate.setHashValueSerializer(new JdkSerializationRedisSerializer());
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class EventDistributor {
|
|||||||
* wants to subscribe
|
* wants to subscribe
|
||||||
*/
|
*/
|
||||||
public Collection<Topic> getTopics() {
|
public Collection<Topic> getTopics() {
|
||||||
final List<Topic> topics = new ArrayList<>();
|
final List<Topic> topics = new ArrayList<Topic>();
|
||||||
topics.add(new PatternTopic(SUB_DISTRIBUTION_CHANNEL));
|
topics.add(new PatternTopic(SUB_DISTRIBUTION_CHANNEL));
|
||||||
return topics;
|
return topics;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,11 +21,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class ListReportSeries extends AbstractReportSeries {
|
public class ListReportSeries extends AbstractReportSeries {
|
||||||
|
|
||||||
/**
|
private final List<Number> data = new ArrayList<Number>();
|
||||||
*
|
|
||||||
*/
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
private final List<Number> data = new ArrayList<>();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param name
|
* @param name
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ public class DeploymentManagement {
|
|||||||
// one we have been switched to canceling state because for targets
|
// one we have been switched to canceling state because for targets
|
||||||
// which we have changed to
|
// which we have changed to
|
||||||
// canceling we don't want to publish the new action update event.
|
// canceling we don't want to publish the new action update event.
|
||||||
final Set<Long> targetIdsCancellList = new HashSet<>();
|
final Set<Long> targetIdsCancellList = new HashSet<Long>();
|
||||||
targetIds.forEach(ids -> targetIdsCancellList.addAll(overrideObsoleteUpdateActions(ids)));
|
targetIds.forEach(ids -> targetIdsCancellList.addAll(overrideObsoleteUpdateActions(ids)));
|
||||||
|
|
||||||
// cancel all scheduled actions which are in-active, these actions were
|
// cancel all scheduled actions which are in-active, these actions were
|
||||||
@@ -430,7 +430,7 @@ public class DeploymentManagement {
|
|||||||
*/
|
*/
|
||||||
private Set<Long> overrideObsoleteUpdateActions(final List<Long> targetsIds) {
|
private Set<Long> overrideObsoleteUpdateActions(final List<Long> targetsIds) {
|
||||||
|
|
||||||
final Set<Long> cancelledTargetIds = new HashSet<>();
|
final Set<Long> cancelledTargetIds = new HashSet<Long>();
|
||||||
|
|
||||||
// Figure out if there are potential target/action combinations that
|
// Figure out if there are potential target/action combinations that
|
||||||
// need to be considered
|
// need to be considered
|
||||||
@@ -774,7 +774,8 @@ public class DeploymentManagement {
|
|||||||
multiselect.where(cb.equal(actionRoot.get(Action_.target), target));
|
multiselect.where(cb.equal(actionRoot.get(Action_.target), target));
|
||||||
multiselect.orderBy(cb.desc(actionRoot.get(Action_.id)));
|
multiselect.orderBy(cb.desc(actionRoot.get(Action_.id)));
|
||||||
multiselect.groupBy(actionRoot.get(Action_.id));
|
multiselect.groupBy(actionRoot.get(Action_.id));
|
||||||
return entityManager.createQuery(multiselect).getResultList();
|
final List<ActionWithStatusCount> resultList = entityManager.createQuery(multiselect).getResultList();
|
||||||
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ public class NoCountPagingRepository {
|
|||||||
*/
|
*/
|
||||||
public <T, I extends Serializable> Slice<T> findAll(final Specification<T> spec, final Pageable pageable,
|
public <T, I extends Serializable> Slice<T> findAll(final Specification<T> spec, final Pageable pageable,
|
||||||
final Class<T> domainClass) {
|
final Class<T> domainClass) {
|
||||||
final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<>(domainClass, em);
|
final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<T, I>(domainClass, em);
|
||||||
return noCountDao.findAll(spec, pageable);
|
return noCountDao.findAll(spec, pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ public class NoCountPagingRepository {
|
|||||||
* org.springframework.data.domain.Pageable)
|
* org.springframework.data.domain.Pageable)
|
||||||
*/
|
*/
|
||||||
public <T, I extends Serializable> Slice<T> findAll(final Pageable pageable, final Class<T> domainClass) {
|
public <T, I extends Serializable> Slice<T> findAll(final Pageable pageable, final Class<T> domainClass) {
|
||||||
final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<>(domainClass, em);
|
final SimpleJpaNoCountRepository<T, I> noCountDao = new SimpleJpaNoCountRepository<T, I>(domainClass, em);
|
||||||
return noCountDao.findAll(pageable);
|
return noCountDao.findAll(pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ public class NoCountPagingRepository {
|
|||||||
|
|
||||||
final List<T> content = query.getResultList();
|
final List<T> content = query.getResultList();
|
||||||
|
|
||||||
return new PageImpl<>(content, pageable, content.size());
|
return new PageImpl<T>(content, pageable, content.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ public class TagManagement {
|
|||||||
public void deleteTargetTag(@NotEmpty final String targetTagName) {
|
public void deleteTargetTag(@NotEmpty final String targetTagName) {
|
||||||
final TargetTag tag = targetTagRepository.findByNameEquals(targetTagName);
|
final TargetTag tag = targetTagRepository.findByNameEquals(targetTagName);
|
||||||
|
|
||||||
final List<Target> changed = new LinkedList<>();
|
final List<Target> changed = new LinkedList<Target>();
|
||||||
for (final Target target : targetRepository.findByTag(tag)) {
|
for (final Target target : targetRepository.findByTag(tag)) {
|
||||||
target.getTags().remove(tag);
|
target.getTags().remove(tag);
|
||||||
changed.add(target);
|
changed.add(target);
|
||||||
@@ -311,7 +311,7 @@ public class TagManagement {
|
|||||||
public void deleteDistributionSetTag(@NotEmpty final String tagName) {
|
public void deleteDistributionSetTag(@NotEmpty final String tagName) {
|
||||||
final DistributionSetTag tag = distributionSetTagRepository.findByNameEquals(tagName);
|
final DistributionSetTag tag = distributionSetTagRepository.findByNameEquals(tagName);
|
||||||
|
|
||||||
final List<DistributionSet> changed = new LinkedList<>();
|
final List<DistributionSet> changed = new LinkedList<DistributionSet>();
|
||||||
for (final DistributionSet set : distributionSetRepository.findByTag(tag)) {
|
for (final DistributionSet set : distributionSetRepository.findByTag(tag)) {
|
||||||
set.getTags().remove(tag);
|
set.getTags().remove(tag);
|
||||||
changed.add(set);
|
changed.add(set);
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class ActionStatus extends BaseEntity {
|
|||||||
@CollectionTable(name = "sp_action_status_messages", joinColumns = @JoinColumn(name = "action_status_id", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_stat_msg_act_stat") ) , indexes = {
|
@CollectionTable(name = "sp_action_status_messages", joinColumns = @JoinColumn(name = "action_status_id", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_stat_msg_act_stat") ) , indexes = {
|
||||||
@Index(name = "sp_idx_action_status_msgs_01", columnList = "action_status_id") })
|
@Index(name = "sp_idx_action_status_msgs_01", columnList = "action_status_id") })
|
||||||
@Column(name = "detail_message", length = 512)
|
@Column(name = "detail_message", length = 512)
|
||||||
private final List<String> messages = new ArrayList<>();
|
private final List<String> messages = new ArrayList<String>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new {@link ActionStatus} object.
|
* Creates a new {@link ActionStatus} object.
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class Target extends NamedEntity implements Persistable<Long> {
|
|||||||
@JoinTable(name = "sp_target_target_tag", joinColumns = {
|
@JoinTable(name = "sp_target_target_tag", joinColumns = {
|
||||||
@JoinColumn(name = "target", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_target") ) }, inverseJoinColumns = {
|
@JoinColumn(name = "target", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_target") ) }, inverseJoinColumns = {
|
||||||
@JoinColumn(name = "tag", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_tag") ) })
|
@JoinColumn(name = "tag", foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_targtag_tag") ) })
|
||||||
private Set<TargetTag> tags = new HashSet<>();
|
private Set<TargetTag> tags = new HashSet<TargetTag>();
|
||||||
|
|
||||||
@CascadeOnDelete
|
@CascadeOnDelete
|
||||||
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true, cascade = { CascadeType.REMOVE })
|
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true, cascade = { CascadeType.REMOVE })
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ final class DistributionSetTypeMapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static List<DistributionSetTypeRest> toListResponse(final List<DistributionSetType> types) {
|
static List<DistributionSetTypeRest> toListResponse(final List<DistributionSetType> types) {
|
||||||
final List<DistributionSetTypeRest> response = new ArrayList<>();
|
final List<DistributionSetTypeRest> response = new ArrayList<DistributionSetTypeRest>();
|
||||||
for (final DistributionSetType dsType : types) {
|
for (final DistributionSetType dsType : types) {
|
||||||
response.add(toResponse(dsType));
|
response.add(toResponse(dsType));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ final class SoftwareModuleTypeMapper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static List<SoftwareModuleTypeRest> toListResponse(final Collection<SoftwareModuleType> types) {
|
static List<SoftwareModuleTypeRest> toListResponse(final Collection<SoftwareModuleType> types) {
|
||||||
final List<SoftwareModuleTypeRest> response = new ArrayList<>();
|
final List<SoftwareModuleTypeRest> response = new ArrayList<SoftwareModuleTypeRest>();
|
||||||
for (final SoftwareModuleType softwareModule : types) {
|
for (final SoftwareModuleType softwareModule : types) {
|
||||||
response.add(toResponse(softwareModule));
|
response.add(toResponse(softwareModule));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,13 +208,14 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Container createArtifactLazyQueryContainer() {
|
private Container createArtifactLazyQueryContainer() {
|
||||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||||
return getArtifactLazyQueryContainer(queryConfiguration);
|
return getArtifactLazyQueryContainer(queryConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
private LazyQueryContainer getArtifactLazyQueryContainer(final Map<String, Object> queryConfig) {
|
private LazyQueryContainer getArtifactLazyQueryContainer(final Map<String, Object> queryConfig) {
|
||||||
|
|
||||||
final BeanQueryFactory<ArtifactBeanQuery> artifactQF = new BeanQueryFactory<>(ArtifactBeanQuery.class);
|
final BeanQueryFactory<ArtifactBeanQuery> artifactQF = new BeanQueryFactory<ArtifactBeanQuery>(
|
||||||
|
ArtifactBeanQuery.class);
|
||||||
artifactQF.setQueryConfiguration(queryConfig);
|
artifactQF.setQueryConfiguration(queryConfig);
|
||||||
final LazyQueryContainer artifactCont = new LazyQueryContainer(new LazyQueryDefinition(true, 10, "id"),
|
final LazyQueryContainer artifactCont = new LazyQueryContainer(new LazyQueryDefinition(true, 10, "id"),
|
||||||
artifactQF);
|
artifactQF);
|
||||||
@@ -430,7 +431,7 @@ public class ArtifactDetailsLayout extends VerticalLayout {
|
|||||||
titleOfArtifactDetails.setContentMode(ContentMode.HTML);
|
titleOfArtifactDetails.setContentMode(ContentMode.HTML);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||||
if (baseSwModuleId != null) {
|
if (baseSwModuleId != null) {
|
||||||
queryConfiguration.put(SPUIDefinitions.BY_BASE_SOFTWARE_MODULE, baseSwModuleId);
|
queryConfiguration.put(SPUIDefinitions.BY_BASE_SOFTWARE_MODULE, baseSwModuleId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Map<String, List<String>> createDropConfigurations() {
|
private static Map<String, List<String>> createDropConfigurations() {
|
||||||
final Map<String, List<String>> config = new HashMap<>();
|
final Map<String, List<String>> config = new HashMap<String, List<String>>();
|
||||||
// Delete drop area droppable components
|
// Delete drop area droppable components
|
||||||
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID, Arrays.asList(
|
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID, Arrays.asList(
|
||||||
SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX));
|
SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX));
|
||||||
@@ -135,7 +135,7 @@ public class UploadViewAcceptCriteria extends AbstractAcceptCriteria {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Map<String, Object> createDropHintConfigurations() {
|
private static Map<String, Object> createDropHintConfigurations() {
|
||||||
final Map<String, Object> config = new HashMap<>();
|
final Map<String, Object> config = new HashMap<String, Object>();
|
||||||
config.put(SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX, UploadArtifactUIEvent.SOFTWARE_TYPE_DRAG_START);
|
config.put(SPUIComponetIdProvider.UPLOAD_TYPE_BUTTON_PREFIX, UploadArtifactUIEvent.SOFTWARE_TYPE_DRAG_START);
|
||||||
config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, UploadArtifactUIEvent.SOFTWARE_DRAG_START);
|
config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, UploadArtifactUIEvent.SOFTWARE_DRAG_START);
|
||||||
return config;
|
return config;
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class BaseSwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSoftwareMo
|
|||||||
@Override
|
@Override
|
||||||
protected List<ProxyBaseSoftwareModuleItem> loadBeans(final int startIndex, final int count) {
|
protected List<ProxyBaseSoftwareModuleItem> loadBeans(final int startIndex, final int count) {
|
||||||
final Slice<SoftwareModule> swModuleBeans;
|
final Slice<SoftwareModule> swModuleBeans;
|
||||||
final List<ProxyBaseSoftwareModuleItem> proxyBeans = new ArrayList<>();
|
final List<ProxyBaseSoftwareModuleItem> proxyBeans = new ArrayList<ProxyBaseSoftwareModuleItem>();
|
||||||
|
|
||||||
if (type == null && Strings.isNullOrEmpty(searchText)) {
|
if (type == null && Strings.isNullOrEmpty(searchText)) {
|
||||||
swModuleBeans = getSoftwareManagementService()
|
swModuleBeans = getSoftwareManagementService()
|
||||||
|
|||||||
@@ -82,7 +82,6 @@ public class SoftwareModuleTable extends AbstractTable {
|
|||||||
/**
|
/**
|
||||||
* Initialize the filter layout.
|
* Initialize the filter layout.
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -128,17 +127,20 @@ public class SoftwareModuleTable extends AbstractTable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected Container createContainer() {
|
protected Container createContainer() {
|
||||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||||
artifactUploadState.getSoftwareModuleFilters().getSearchText()
|
artifactUploadState.getSoftwareModuleFilters().getSearchText()
|
||||||
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||||
|
|
||||||
artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
|
artifactUploadState.getSoftwareModuleFilters().getSoftwareModuleType()
|
||||||
.ifPresent(type -> queryConfiguration.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
|
.ifPresent(type -> queryConfiguration.put(SPUIDefinitions.BY_SOFTWARE_MODULE_TYPE, type));
|
||||||
|
|
||||||
final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<>(BaseSwModuleBeanQuery.class);
|
final BeanQueryFactory<BaseSwModuleBeanQuery> swQF = new BeanQueryFactory<BaseSwModuleBeanQuery>(
|
||||||
|
BaseSwModuleBeanQuery.class);
|
||||||
swQF.setQueryConfiguration(queryConfiguration);
|
swQF.setQueryConfiguration(queryConfiguration);
|
||||||
|
|
||||||
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
final LazyQueryContainer container = new LazyQueryContainer(
|
||||||
|
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||||
|
return container;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -272,7 +274,7 @@ public class SoftwareModuleTable extends AbstractTable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected List<TableColumn> getTableVisibleColumns() {
|
protected List<TableColumn> getTableVisibleColumns() {
|
||||||
final List<TableColumn> columnList = new ArrayList<>();
|
final List<TableColumn> columnList = new ArrayList<TableColumn>();
|
||||||
if (isMaximized()) {
|
if (isMaximized()) {
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F));
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), 0.1F));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), 0.1F));
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ public class CreateUpdateSoftwareTypeLayout extends CustomComponent implements C
|
|||||||
getPreviewButtonColor(DEFAULT_COLOR);
|
getPreviewButtonColor(DEFAULT_COLOR);
|
||||||
tagColorPreviewBtn.setStyleName(TAG_DYNAMIC_STYLE);
|
tagColorPreviewBtn.setStyleName(TAG_DYNAMIC_STYLE);
|
||||||
|
|
||||||
selectors = new HashSet<>();
|
selectors = new HashSet<ColorSelector>();
|
||||||
selectedColor = new Color(44, 151, 32);
|
selectedColor = new Color(44, 151, 32);
|
||||||
selPreview = new SpColorPickerPreview(selectedColor);
|
selPreview = new SpColorPickerPreview(selectedColor);
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class UploadConfirmationwindow implements Button.ClickListener {
|
|||||||
|
|
||||||
private IndexedContainer tabelContainer;
|
private IndexedContainer tabelContainer;
|
||||||
|
|
||||||
private final List<UploadStatus> uploadResultList = new ArrayList<>();
|
private final List<UploadStatus> uploadResultList = new ArrayList<UploadStatus>();
|
||||||
|
|
||||||
private VerticalLayout uploadArtifactDetails;
|
private VerticalLayout uploadArtifactDetails;
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class UploadLayout extends VerticalLayout {
|
|||||||
|
|
||||||
private final AtomicInteger numberOfFilesActuallyUpload = new AtomicInteger();
|
private final AtomicInteger numberOfFilesActuallyUpload = new AtomicInteger();
|
||||||
|
|
||||||
private final List<String> duplicateFileNamesList = new ArrayList<>();
|
private final List<String> duplicateFileNamesList = new ArrayList<String>();
|
||||||
|
|
||||||
private Button processBtn;
|
private Button processBtn;
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class UploadResultWindow implements Button.ClickListener {
|
|||||||
|
|
||||||
private static final long serialVersionUID = 5205927189362269027L;
|
private static final long serialVersionUID = 5205927189362269027L;
|
||||||
|
|
||||||
private List<UploadStatus> uploadResultList = new ArrayList<>();
|
private List<UploadStatus> uploadResultList = new ArrayList<UploadStatus>();
|
||||||
|
|
||||||
private Button closeBtn;
|
private Button closeBtn;
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public class DistributionSetTypeBeanQuery extends AbstractBeanQuery<Distribution
|
|||||||
@Override
|
@Override
|
||||||
protected List<DistributionSetType> loadBeans(final int startIndex, final int count) {
|
protected List<DistributionSetType> loadBeans(final int startIndex, final int count) {
|
||||||
Page<DistributionSetType> typeBeans;
|
Page<DistributionSetType> typeBeans;
|
||||||
final List<DistributionSetType> distSetTypeList = new ArrayList<>();
|
final List<DistributionSetType> distSetTypeList = new ArrayList<DistributionSetType>();
|
||||||
if (startIndex == 0 && firstPageDistSetType != null) {
|
if (startIndex == 0 && firstPageDistSetType != null) {
|
||||||
typeBeans = firstPageDistSetType;
|
typeBeans = firstPageDistSetType;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ public class DistributionTagToken extends AbstractTagToken {
|
|||||||
// To Be Done : have to set this value based on view???
|
// To Be Done : have to set this value based on view???
|
||||||
private static final Boolean NOTAGS_SELECTED = Boolean.FALSE;
|
private static final Boolean NOTAGS_SELECTED = Boolean.FALSE;
|
||||||
|
|
||||||
@Override
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -130,7 +129,7 @@ public class DistributionTagToken extends AbstractTagToken {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private DistributionSetTagAssigmentResult toggleAssignment(final String tagNameSelected) {
|
private DistributionSetTagAssigmentResult toggleAssignment(final String tagNameSelected) {
|
||||||
final Set<Long> distributionList = new HashSet<>();
|
final Set<Long> distributionList = new HashSet<Long>();
|
||||||
distributionList.add(selectedDS.getId());
|
distributionList.add(selectedDS.getId());
|
||||||
final DistributionSetTagAssigmentResult result = distributionSetManagement.toggleTagAssignment(distributionList,
|
final DistributionSetTagAssigmentResult result = distributionSetManagement.toggleTagAssignment(distributionList,
|
||||||
tagNameSelected);
|
tagNameSelected);
|
||||||
@@ -161,7 +160,7 @@ public class DistributionTagToken extends AbstractTagToken {
|
|||||||
|
|
||||||
/* To Be Done : this implementation will vary in views */
|
/* To Be Done : this implementation will vary in views */
|
||||||
private List<String> getClickedTagList() {
|
private List<String> getClickedTagList() {
|
||||||
return new ArrayList<>();
|
return new ArrayList<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public class TargetTagToken extends AbstractTargetTagToken {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private TargetTagAssigmentResult toggleAssignment(final String tagNameSelected) {
|
private TargetTagAssigmentResult toggleAssignment(final String tagNameSelected) {
|
||||||
final Set<String> targetList = new HashSet<>();
|
final Set<String> targetList = new HashSet<String>();
|
||||||
targetList.add(selectedTarget.getControllerId());
|
targetList.add(selectedTarget.getControllerId());
|
||||||
final TargetTagAssigmentResult result = targetManagement.toggleTagAssignment(targetList, tagNameSelected);
|
final TargetTagAssigmentResult result = targetManagement.toggleTagAssignment(targetList, tagNameSelected);
|
||||||
uinotification.displaySuccess(HawkbitCommonUtil.getTargetTagAssigmentMsg(tagNameSelected, result, i18n));
|
uinotification.displaySuccess(HawkbitCommonUtil.getTargetTagAssigmentMsg(tagNameSelected, result, i18n));
|
||||||
@@ -102,7 +102,7 @@ public class TargetTagToken extends AbstractTargetTagToken {
|
|||||||
|
|
||||||
/* To Be Done : this implementation will vary in views */
|
/* To Be Done : this implementation will vary in views */
|
||||||
private List<String> getClickedTagList() {
|
private List<String> getClickedTagList() {
|
||||||
return new ArrayList<>();
|
return new ArrayList<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
|||||||
|
|
||||||
getPreviewButtonColor(DEFAULT_COLOR);
|
getPreviewButtonColor(DEFAULT_COLOR);
|
||||||
|
|
||||||
selectors = new HashSet<>();
|
selectors = new HashSet<ColorSelector>();
|
||||||
selectedColor = new Color(44, 151, 32);
|
selectedColor = new Color(44, 151, 32);
|
||||||
selPreview = new SpColorPickerPreview(selectedColor);
|
selPreview = new SpColorPickerPreview(selectedColor);
|
||||||
|
|
||||||
@@ -457,7 +457,6 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
|||||||
sourceTable.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
|
sourceTable.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Override
|
|
||||||
public String generateDescription(final Component source, final Object itemId, final Object propertyId) {
|
public String generateDescription(final Component source, final Object itemId, final Object propertyId) {
|
||||||
final Item item = sourceTable.getItem(itemId);
|
final Item item = sourceTable.getItem(itemId);
|
||||||
final String description = (String) item.getItemProperty(DIST_TYPE_DESCRIPTION).getValue();
|
final String description = (String) item.getItemProperty(DIST_TYPE_DESCRIPTION).getValue();
|
||||||
@@ -476,15 +475,15 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
|||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
private void getSelectedTableItemData(final Long id) {
|
private void getSelectedTableItemData(final Long id) {
|
||||||
if (selectedTablecontainer == null) {
|
Item saveTblitem = null;
|
||||||
return;
|
if (null != selectedTablecontainer) {
|
||||||
|
saveTblitem = selectedTablecontainer.addItem(id);
|
||||||
|
saveTblitem.getItemProperty(DIST_TYPE_NAME).setValue(
|
||||||
|
sourceTable.getContainerDataSource().getItem(id).getItemProperty(DIST_TYPE_NAME).getValue());
|
||||||
|
saveTblitem.getItemProperty(DIST_TYPE_MANDATORY).setValue(new CheckBox());
|
||||||
|
saveTblitem.getItemProperty(DIST_TYPE_DESCRIPTION).setValue(
|
||||||
|
sourceTable.getContainerDataSource().getItem(id).getItemProperty(DIST_TYPE_DESCRIPTION).getValue());
|
||||||
}
|
}
|
||||||
final Item saveTblitem = selectedTablecontainer.addItem(id);
|
|
||||||
saveTblitem.getItemProperty(DIST_TYPE_NAME)
|
|
||||||
.setValue(sourceTable.getContainerDataSource().getItem(id).getItemProperty(DIST_TYPE_NAME).getValue());
|
|
||||||
saveTblitem.getItemProperty(DIST_TYPE_MANDATORY).setValue(new CheckBox());
|
|
||||||
saveTblitem.getItemProperty(DIST_TYPE_DESCRIPTION).setValue(
|
|
||||||
sourceTable.getContainerDataSource().getItem(id).getItemProperty(DIST_TYPE_DESCRIPTION).getValue());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@@ -658,10 +657,10 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
|||||||
DistributionSetType newDistType = new DistributionSetType(typeKeyValue, typeNameValue, typeDescValue);
|
DistributionSetType newDistType = new DistributionSetType(typeKeyValue, typeNameValue, typeDescValue);
|
||||||
for (final Long id : itemIds) {
|
for (final Long id : itemIds) {
|
||||||
final Item item = selectedTable.getItem(id);
|
final Item item = selectedTable.getItem(id);
|
||||||
final String distTypeName = (String) item.getItemProperty(DIST_TYPE_NAME).getValue();
|
final String dist_type_name = (String) item.getItemProperty(DIST_TYPE_NAME).getValue();
|
||||||
final CheckBox mandatoryCheckBox = (CheckBox) item.getItemProperty(DIST_TYPE_MANDATORY).getValue();
|
final CheckBox mandatoryCheckBox = (CheckBox) item.getItemProperty(DIST_TYPE_MANDATORY).getValue();
|
||||||
final Boolean isMandatory = mandatoryCheckBox.getValue();
|
final Boolean isMandatory = mandatoryCheckBox.getValue();
|
||||||
final SoftwareModuleType swModuleType = softwareManagement.findSoftwareModuleTypeByName(distTypeName);
|
final SoftwareModuleType swModuleType = softwareManagement.findSoftwareModuleTypeByName(dist_type_name);
|
||||||
if (isMandatory) {
|
if (isMandatory) {
|
||||||
newDistType.addMandatoryModuleType(swModuleType);
|
newDistType.addMandatoryModuleType(swModuleType);
|
||||||
|
|
||||||
@@ -1033,6 +1032,7 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
|||||||
* as the selected tag from combo
|
* as the selected tag from combo
|
||||||
*/
|
*/
|
||||||
private void setTypeTagCombo(final String distSetTypeSelected) {
|
private void setTypeTagCombo(final String distSetTypeSelected) {
|
||||||
|
boolean mandatory = false;
|
||||||
typeName.setValue(distSetTypeSelected);
|
typeName.setValue(distSetTypeSelected);
|
||||||
getSourceTableData();
|
getSourceTableData();
|
||||||
selectedTable.getContainerDataSource().removeAllItems();
|
selectedTable.getContainerDataSource().removeAllItems();
|
||||||
@@ -1053,11 +1053,13 @@ public class CreateUpdateDistSetTypeLayout extends CustomComponent implements Co
|
|||||||
saveDistSetType.setEnabled(false);
|
saveDistSetType.setEnabled(false);
|
||||||
}
|
}
|
||||||
for (final SoftwareModuleType swModuleType : selectedTypeTag.getOptionalModuleTypes()) {
|
for (final SoftwareModuleType swModuleType : selectedTypeTag.getOptionalModuleTypes()) {
|
||||||
addTargetTableforUpdate(swModuleType, false);
|
mandatory = false;
|
||||||
|
addTargetTableforUpdate(swModuleType, mandatory);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final SoftwareModuleType swModuleType : selectedTypeTag.getMandatoryModuleTypes()) {
|
for (final SoftwareModuleType swModuleType : selectedTypeTag.getMandatoryModuleTypes()) {
|
||||||
addTargetTableforUpdate(swModuleType, true);
|
mandatory = true;
|
||||||
|
addTargetTableforUpdate(swModuleType, mandatory);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null == selectedTypeTag.getColour()) {
|
if (null == selectedTypeTag.getColour()) {
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public class ManageDistBeanQuery extends AbstractBeanQuery<ProxyDistribution> {
|
|||||||
@Override
|
@Override
|
||||||
protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) {
|
protected List<ProxyDistribution> loadBeans(final int startIndex, final int count) {
|
||||||
Page<DistributionSet> distBeans;
|
Page<DistributionSet> distBeans;
|
||||||
final List<ProxyDistribution> proxyDistributions = new ArrayList<>();
|
final List<ProxyDistribution> proxyDistributions = new ArrayList<ProxyDistribution>();
|
||||||
if (startIndex == 0 && firstPageDistributionSets != null) {
|
if (startIndex == 0 && firstPageDistributionSets != null) {
|
||||||
distBeans = firstPageDistributionSets;
|
distBeans = firstPageDistributionSets;
|
||||||
} else if (Strings.isNullOrEmpty(searchText)) {
|
} else if (Strings.isNullOrEmpty(searchText)) {
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Map<String, List<String>> createDropConfigurations() {
|
private static Map<String, List<String>> createDropConfigurations() {
|
||||||
final Map<String, List<String>> config = new HashMap<>();
|
final Map<String, List<String>> config = new HashMap<String, List<String>>();
|
||||||
|
|
||||||
// Delete drop area droppable components
|
// Delete drop area droppable components
|
||||||
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID,
|
config.put(SPUIComponetIdProvider.DELETE_BUTTON_WRAPPER_ID,
|
||||||
@@ -153,7 +153,7 @@ public class DistributionsViewAcceptCriteria extends AbstractAcceptCriteria {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Map<String, Object> createDropHintConfigurations() {
|
private static Map<String, Object> createDropHintConfigurations() {
|
||||||
final Map<String, Object> config = new HashMap<>();
|
final Map<String, Object> config = new HashMap<String, Object>();
|
||||||
config.put(SPUIDefinitions.DISTRIBUTION_TYPE_ID_PREFIXS, DragEvent.DISTRIBUTION_TYPE_DRAG);
|
config.put(SPUIDefinitions.DISTRIBUTION_TYPE_ID_PREFIXS, DragEvent.DISTRIBUTION_TYPE_DRAG);
|
||||||
config.put(SPUIComponetIdProvider.DIST_TABLE_ID, DragEvent.DISTRIBUTION_DRAG);
|
config.put(SPUIComponetIdProvider.DIST_TABLE_ID, DragEvent.DISTRIBUTION_DRAG);
|
||||||
config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, DragEvent.SOFTWAREMODULE_DRAG);
|
config.put(SPUIComponetIdProvider.UPLOAD_SOFTWARE_MODULE_TABLE, DragEvent.SOFTWAREMODULE_DRAG);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ public class SwModuleBeanQuery extends AbstractBeanQuery<ProxyBaseSwModuleItem>
|
|||||||
@Override
|
@Override
|
||||||
protected List<ProxyBaseSwModuleItem> loadBeans(final int startIndex, final int count) {
|
protected List<ProxyBaseSwModuleItem> loadBeans(final int startIndex, final int count) {
|
||||||
final Slice<CustomSoftwareModule> swModuleBeans;
|
final Slice<CustomSoftwareModule> swModuleBeans;
|
||||||
final List<ProxyBaseSwModuleItem> proxyBeans = new ArrayList<>();
|
final List<ProxyBaseSwModuleItem> proxyBeans = new ArrayList<ProxyBaseSwModuleItem>();
|
||||||
|
|
||||||
swModuleBeans = getSoftwareManagement().findSoftwareModuleOrderByDistribution(
|
swModuleBeans = getSoftwareManagement().findSoftwareModuleOrderByDistribution(
|
||||||
new OffsetBasedPageRequest(startIndex, count, new Sort(Direction.ASC, "name", "version")),
|
new OffsetBasedPageRequest(startIndex, count, new Sort(Direction.ASC, "name", "version")),
|
||||||
|
|||||||
@@ -98,7 +98,6 @@ public class SwModuleTable extends AbstractTable {
|
|||||||
/**
|
/**
|
||||||
* Initialize the filter layout.
|
* Initialize the filter layout.
|
||||||
*/
|
*/
|
||||||
@Override
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
protected void init() {
|
protected void init() {
|
||||||
super.init();
|
super.init();
|
||||||
@@ -178,7 +177,7 @@ public class SwModuleTable extends AbstractTable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected Container createContainer() {
|
protected Container createContainer() {
|
||||||
final Map<String, Object> queryConfiguration = new HashMap<>();
|
final Map<String, Object> queryConfiguration = new HashMap<String, Object>();
|
||||||
manageDistUIState.getSoftwareModuleFilters().getSearchText()
|
manageDistUIState.getSoftwareModuleFilters().getSearchText()
|
||||||
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
.ifPresent(value -> queryConfiguration.put(SPUIDefinitions.FILTER_BY_TEXT, value));
|
||||||
|
|
||||||
@@ -188,10 +187,13 @@ public class SwModuleTable extends AbstractTable {
|
|||||||
manageDistUIState.getLastSelectedDistribution().ifPresent(
|
manageDistUIState.getLastSelectedDistribution().ifPresent(
|
||||||
distIdName -> queryConfiguration.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId()));
|
distIdName -> queryConfiguration.put(SPUIDefinitions.ORDER_BY_DISTRIBUTION, distIdName.getId()));
|
||||||
|
|
||||||
final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<>(SwModuleBeanQuery.class);
|
final BeanQueryFactory<SwModuleBeanQuery> swQF = new BeanQueryFactory<SwModuleBeanQuery>(
|
||||||
|
SwModuleBeanQuery.class);
|
||||||
swQF.setQueryConfiguration(queryConfiguration);
|
swQF.setQueryConfiguration(queryConfiguration);
|
||||||
|
|
||||||
return new LazyQueryContainer(new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
final LazyQueryContainer container = new LazyQueryContainer(
|
||||||
|
new LazyQueryDefinition(true, SPUIDefinitions.PAGE_SIZE, "swId"), swQF);
|
||||||
|
return container;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -307,7 +309,7 @@ public class SwModuleTable extends AbstractTable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected List<TableColumn> getTableVisibleColumns() {
|
protected List<TableColumn> getTableVisibleColumns() {
|
||||||
final List<TableColumn> columnList = new ArrayList<>();
|
final List<TableColumn> columnList = new ArrayList<TableColumn>();
|
||||||
if (isMaximized()) {
|
if (isMaximized()) {
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_NAME, i18n.get("header.name"), 0.2F));
|
||||||
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), 0.1F));
|
columnList.add(new TableColumn(SPUILabelDefinitions.VAR_VERSION, i18n.get("header.version"), 0.1F));
|
||||||
|
|||||||
Reference in New Issue
Block a user