Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/4.0.0 #133

Merged
merged 77 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
1013118
[Tech] Implemented a POC of the data-centric UI
smiakchilo Nov 30, 2023
18940a6
EPB_NEW_UI: Add resources init.
aliakseiTraihel Dec 19, 2023
2f2a941
Merge branch 'develop' into new_ui/actions
aliakseiTraihel Jan 10, 2024
94a964d
[EBP-111]: Delete actions updates.
aliakseiTraihel Jan 15, 2024
5ec03c7
[EBP-111]: Statusbar and package name.
aliakseiTraihel Jan 17, 2024
13cea29
[EBP-111]: Refacroting.
aliakseiTraihel Jan 17, 2024
ebc1af8
[EBP-111]: Refacroting.
aliakseiTraihel Jan 17, 2024
cc6adcb
[EBP-111]: Change path param to packagePath
aliakseiTraihel Jan 18, 2024
dbcbdb4
[EBP-111]: initial resources and saving
aliakseiTraihel Jan 18, 2024
ff99ef4
[EBP-111]: refactoring
aliakseiTraihel Jan 23, 2024
33673cd
[EBP-111] Added build and build logs
AlKaliada Jan 24, 2024
b67277a
[EBP-111] Added test build and test build logs
AlKaliada Jan 24, 2024
b77d0ca
[EBP-111]: Refactoring
aliakseiTraihel Jan 26, 2024
04d82fc
[EBP-111] Fixed styles for buttons
AlKaliada Jan 29, 2024
58f99ea
[EBP-111] Fixed install packages
AlKaliada Jan 29, 2024
a79449e
[EBP-111] Fixed referenced Assets
AlKaliada Jan 29, 2024
5a9356b
[EBP-111] Fixed last build/install/replication info
AlKaliada Jan 29, 2024
2f60776
[EBP-111]: Refactoring add/delete resources service.
aliakseiTraihel Jan 30, 2024
9f7f8f6
[EBP-111] Added filter for resources
AlKaliada Jan 30, 2024
c33b2f4
[EBP-111] Fixed icons
AlKaliada Jan 31, 2024
2c1745d
[EBP-111] Fixed install
AlKaliada Jan 31, 2024
a188e7f
[EBP-111] Fixed last modified
AlKaliada Jan 31, 2024
1d7054a
[EBP-111] Fix order elements
aliakseiTraihel Feb 1, 2024
3b39a5c
[EBP-111] Fix create from initial resources.
aliakseiTraihel Feb 2, 2024
5be1bb8
[EBP-111] Fix create from multiple initial resources.
aliakseiTraihel Feb 5, 2024
0d9211a
[EBP-111] Added functionality for button 'Build / Download'
AlKaliada Feb 6, 2024
7432109
[EBP-111] Fixed package info after build/install
AlKaliada Feb 6, 2024
c460a72
[EBP-111] Modal window for logs.
aliakseiTraihel Feb 6, 2024
a6d9a78
[EBP-111] Log updates fix.
aliakseiTraihel Feb 6, 2024
b799eb7
[EBP-111] Styles for log dialog.
aliakseiTraihel Feb 6, 2024
0f1c051
[EB-111] Add path to general resources
AlKaliada Feb 8, 2024
adcc0aa
[EB-111] Update package after add references
AlKaliada Feb 8, 2024
2a204be
[EBP-111] Fix scrolling into modal window.
aliakseiTraihel Feb 12, 2024
b29bb39
[EBP-111] Delete redundant code in js.
aliakseiTraihel Feb 14, 2024
f449a4d
Merge pull request #129 from exadel-inc/master
AlKaliada Feb 15, 2024
5aba097
[EBP-111] Fix install button styles and modal window on creation error.
aliakseiTraihel Feb 27, 2024
e8bc93b
[EBP-111] Constants refactoring.
aliakseiTraihel Feb 27, 2024
f3e33fc
[EBP-111] Fix css styles and package size info.
aliakseiTraihel Feb 28, 2024
2543aff
[EBP-111] Fixed path select
AlKaliada Mar 12, 2024
d1b09b1
[EBP-111] Added dialog for added references
AlKaliada Mar 12, 2024
3cdeb91
[EBP-111] Fixed path select
AlKaliada Mar 12, 2024
829f06f
[EBP-111] Fixed path select
AlKaliada Mar 14, 2024
cc144a4
[EBP-111] Added multiselect/multidelete
AlKaliada Mar 18, 2024
452b2d6
[EBP-111] Added multiadd references
AlKaliada Mar 18, 2024
1f9f0f5
[EBP-111] Added multiadd references
AlKaliada Mar 18, 2024
3147b11
[EBP-111] Deleted 'Referenced by of' for assets
AlKaliada Mar 18, 2024
e6a5b98
[EBP-111] Added replicate/delete package
AlKaliada Mar 18, 2024
dc625d9
[EBP-111] Fixed exclude children action
AlKaliada Mar 20, 2024
13b20cf
[EBP-111] Made action buttons disabled
AlKaliada Mar 27, 2024
18804a8
[EBP-111] Made my_packages default package group
AlKaliada Mar 27, 2024
ddd6b03
[EBP-111] Changed alert message
AlKaliada Mar 27, 2024
9df0622
[EBP-111] Removed threshold from install dialog
AlKaliada Mar 27, 2024
459f900
[EBP-111] Fixed custom icons for cloud
AlKaliada Mar 27, 2024
8588245
[EBP-111] Made my_packages as a default package group
AlKaliada Mar 27, 2024
30e84ae
[EBP-111] Made action buttons disabled
AlKaliada Mar 27, 2024
1243ca2
[EBP-111] Added Logs dialogs title, spinner
AlKaliada Apr 4, 2024
8a22ab3
[EBP-111] Fixed spaces in package path
AlKaliada Apr 4, 2024
730eae5
[EBP-111] Removed children from the tree
AlKaliada Apr 10, 2024
c0e736b
[EBP-111] Separated references and live copies
AlKaliada Apr 11, 2024
b1710f5
[EBP-111] Separated references and live copies
AlKaliada Apr 11, 2024
880aaa2
[EBP-111] Removed text from 'back to list' button
AlKaliada Apr 11, 2024
f763781
[EBP-111] Moved title to statusbar
AlKaliada Apr 11, 2024
840ff96
[EBP-111] Moved title to statusbar
AlKaliada Apr 11, 2024
2ffd1eb
[EBP-111] Made builds/install/replication buttons disabled without fi…
AlKaliada Apr 11, 2024
d4183e4
[EBP-111] Made multiselect with ctrl and shift buttons
AlKaliada Apr 16, 2024
f8040ef
[EBP-111] Rename buttons
AlKaliada Apr 16, 2024
f36a9e8
[EBP-111] Fixed include/exclude children
AlKaliada Apr 16, 2024
dd3fcae
[EBP-111] Added 'Cancel' button to create package dialog
AlKaliada Apr 16, 2024
81d72d3
[EBP-111] Fixed livecopies
AlKaliada Apr 18, 2024
fd98efa
[EBP-111] Refactoring
AlKaliada Apr 23, 2024
feb6ac9
[EBP-111] Added unit tests
AlKaliada Apr 24, 2024
0209af1
Merge branch 'develop' into feature/EBP-111
AlKaliada Apr 26, 2024
a09a902
[EBP-111] Resolved merge conflicts
AlKaliada Apr 29, 2024
3d75229
[EBP-111] Resolved merge conflicts
AlKaliada Apr 29, 2024
b935f8c
Merge pull request #132 from exadel-inc/feature/EBP-111
AlKaliada May 7, 2024
0fc13fc
[EBP-111] cosmetic
AlKaliada May 7, 2024
7a447e6
release 4.0.0
AlKaliada May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>com.exadel.etoolbox</groupId>
<artifactId>etoolbox-backpack</artifactId>
<version>3.3.0</version>
<version>4.0.0</version>
</parent>

<artifactId>etoolbox-backpack.core</artifactId>
Expand Down Expand Up @@ -198,5 +198,11 @@
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.sling-mock-oak</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,12 @@

package com.exadel.etoolbox.backpack.core.dto.response;

import com.exadel.etoolbox.backpack.core.dto.repository.AssetReferencedItem;
import com.exadel.etoolbox.backpack.core.dto.repository.ReferencedItem;
import com.exadel.etoolbox.backpack.core.servlets.BuildPackageServlet;
import com.exadel.etoolbox.backpack.core.servlets.CreatePackageServlet;
import org.apache.commons.lang3.StringUtils;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
* Data model containing comprehensive data required to manage a package.
*
* @see CreatePackageServlet
* @see BuildPackageServlet
*/
public class PackageInfo {

Expand All @@ -40,30 +33,24 @@ public class PackageInfo {

private Calendar packageBuilt;

private PackageStatus packageStatus;

private String packagePath;

private String thumbnailPath;

private Collection<String> paths;

private Status status;
private Map<String, PathInfo> pathInfoMap = new HashMap<>();

private Map<String, List<String>> referencedResources = new TreeMap<>();
private PackageStatus packageStatus;

private List<String> log = new ArrayList<>();

private Long dataSize;

private String query;

private boolean toggle;
private long dataSize;

private Calendar packageInstalled;

private Calendar packageReplicated;

private String lastModifiedBy;

/**
* Default constructor
*/
Expand All @@ -87,13 +74,9 @@ public PackageInfo(final PackageInfo packageInfo) {
this.packageStatus = packageInfo.packageStatus;
this.packagePath = packageInfo.getPackagePath();
this.thumbnailPath = packageInfo.thumbnailPath;
this.referencedResources = new HashMap<>(packageInfo.getReferencedResources());
this.pathInfoMap = new HashMap<>(packageInfo.getPathInfoMap());
this.log = packageInfo.log;
this.dataSize = packageInfo.dataSize;
this.paths = packageInfo.paths;
this.status = packageInfo.status;
this.query = packageInfo.query;
this.toggle = packageInfo.toggle;
if (packageInfo.packageInstalled != null) {
this.packageInstalled = Calendar.getInstance();
this.packageInstalled.setTime(packageInfo.packageInstalled.getTime());
Expand All @@ -103,6 +86,7 @@ public PackageInfo(final PackageInfo packageInfo) {
this.packageReplicated = Calendar.getInstance();
this.packageReplicated.setTime(packageInfo.packageReplicated.getTime());
}
this.lastModifiedBy = packageInfo.lastModifiedBy;
}

/**
Expand Down Expand Up @@ -138,16 +122,16 @@ public String getVersion() {
* @return {@code Collection<String>} object, read-only
*/
public Collection<String> getPaths() {
return Collections.unmodifiableCollection(paths);
return Collections.unmodifiableCollection(pathInfoMap != null ? pathInfoMap.keySet() : Collections.emptyList());
}

/**
* Gets the collection of paths representing assets to be embedded in the current package, grouped by their MIME types
*
* @return {@code Collection<String>} object, read-only
*/
public Map<String, List<String>> getReferencedResources() {
return referencedResources != null ? Collections.unmodifiableMap(referencedResources) : Collections.emptyMap();
public Collection<String> getReferences() {
return Collections.unmodifiableCollection(pathInfoMap != null
? pathInfoMap.values().stream()
.flatMap(pathInfo -> Stream.of(pathInfo.getAssets(), pathInfo.getLiveCopies(), pathInfo.getPages(), pathInfo.getTags()))
.flatMap(Set::stream)
.collect(Collectors.toSet())
: Collections.emptyList());
}

/**
Expand Down Expand Up @@ -201,21 +185,6 @@ public void clearLog() {
log.clear();
}

/**
* Appends a path to a referenced asset to the current {@link PackageInfo}
*
* @param item {@link AssetReferencedItem} object containing asset's MIME type and path
*/
public void addAssetReferencedItem(final ReferencedItem item) {
if (referencedResources == null) {
referencedResources = new TreeMap<>();
}
if (StringUtils.isNotBlank(item.getPath()) && StringUtils.isNotBlank(item.getType())) {
List<String> assetsPaths = referencedResources.computeIfAbsent(item.getType(), k -> new ArrayList<>());
assetsPaths.add(item.getPath());
}
}

/**
* Gets build status of the current package
*
Expand Down Expand Up @@ -321,16 +290,15 @@ public void setThumbnailPath(final String thumbnailPath) {
* @param paths {@code Collection<String>} object
*/
public void setPaths(final Collection<String> paths) {
this.paths = paths;
}

/**
* Sets the collection of paths representing assets to be embedded in the current package, grouped by their MIME types
*
* @param referencedResources {@code Collection<String>} object
*/
public void setReferencedResources(final Map<String, List<String>> referencedResources) {
this.referencedResources = referencedResources;
if (paths == null || paths.isEmpty()) {
return;
}
for (String path : paths) {
if (this.pathInfoMap.containsKey(path)) {
continue;
}
this.pathInfoMap.put(path, new PathInfo());
}
}

/**
Expand Down Expand Up @@ -371,42 +339,6 @@ public void setDataSize(final Long dataSize) {
this.dataSize = dataSize;
}

/**
* Gets the SQL2 query of the current package
*
* @return String value
*/
public String getQuery() {
return query;
}

/**
* Sets the SQL2 query of the current package
*
* @param query String value
*/
public void setQuery(String query) {
this.query = query;
}

/**
* Gets the toggle between SQL2 (true) and Path Filter (false)
*
* @return boolean value
*/
public boolean isToggle() {
return toggle;
}

/**
* Sets the toggle between SQL2 (true) and Path Filter (false)
*
* @param toggle boolean value
*/
public void setToggle(boolean toggle) {
this.toggle = toggle;
}

/**
* Gets the value representing when the package was installed
*
Expand Down Expand Up @@ -443,15 +375,6 @@ public void setPackageReplicated(Calendar packageReplicated) {
this.packageReplicated = packageReplicated;
}

/**
* Sets the status of the package creation result
*
* @param {@code Status} object
*/
public void setStatus(final Status status) {
this.status = status;
}

/**
* Overrides the standard {@code equals()} routine to implement packages comparison by their name and group name
* requisites
Expand All @@ -477,4 +400,28 @@ public boolean equals(Object o) {
public int hashCode() {
return Objects.hash(packageName, groupName);
}

public PathInfo getPathInfo(String path) {
return pathInfoMap.computeIfAbsent(path, k -> new PathInfo());
}

public void deletePath(String path) {
pathInfoMap.remove(path);
}

public Map<String, PathInfo> getPathInfoMap() {
return pathInfoMap;
}

public void setPathInfoMap(Map<String, PathInfo> pathInfoMap) {
this.pathInfoMap = pathInfoMap;
}

public String getLastModifiedBy() {
return lastModifiedBy;
}

public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.exadel.etoolbox.backpack.core.dto.response;

import java.util.HashSet;
import java.util.Set;

public class PathInfo {

private Set<String> liveCopies;
private Set<String> pages;
private Set<String> tags;
private Set<String> assets;

public PathInfo() {
this.liveCopies = new HashSet<>();
this.pages = new HashSet<>();
this.tags = new HashSet<>();
this.assets = new HashSet<>();
}

public Set<String> getLiveCopies() {
return liveCopies;
}

public Set<String> getPages() {
return pages;
}

public Set<String> getTags() {
return tags;
}

public Set<String> getAssets() {
return assets;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.exadel.etoolbox.backpack.core.dto.response;

import java.util.List;

public class ResponseWrapper<T> {

private T data;
private ResponseStatus status;
private List<String> logs;

public ResponseWrapper(T data, ResponseStatus status, List<String> logs) {
this.data = data;
this.status = status;
this.logs = logs;
}

public ResponseWrapper(T data, ResponseStatus status) {
this.data = data;
this.status = status;
}

public T getData() {
return data;
}

public ResponseStatus getStatus() {
return status;
}

public List<String> getLogs() {
return logs;
}

public enum ResponseStatus {
SUCCESS, ERROR, WARNING
}
}
Loading
Loading