You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2020/09/08 19:30:00 UTC
[sling-org-apache-sling-app-cms] 01/02: Updating icons to be less
blurry
This is an automated email from the ASF dual-hosted git repository.
dklco pushed a commit to branch SLING-8913-multiple-instance-types
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-app-cms.git
commit 6ba973e8843dac3b91b2b1fa529ad96c256fd073
Author: Dan Klco <dk...@apache.org>
AuthorDate: Tue Sep 8 15:28:49 2020 -0400
Updating icons to be less blurry
---
.../java/org/apache/sling/cms/ResourceTree.java | 23 +++++++++++++++------
transformer/src/test/resources/thumbnail.png | Bin 20437 -> 21183 bytes
ui/src/main/frontend/js/cms.form.js | 3 ++-
.../components/publication/agent/agent.jsp | 14 ++++++++++++-
.../libs/sling-cms/content/publication/home.json | 2 +-
.../resources/jcr_root/libs/sling-cms/i18n.json | 5 +++++
.../sling-cms/thumbnails/bulk-publication.png | Bin 0 -> 4080 bytes
.../static/sling-cms/thumbnails/exporters.png | Bin 0 -> 3838 bytes
.../static/sling-cms/thumbnails/importers.png | Bin 0 -> 3833 bytes
.../static/sling-cms/thumbnails/publish-agent.png | Bin 0 -> 3013 bytes
10 files changed, 38 insertions(+), 9 deletions(-)
diff --git a/api/src/main/java/org/apache/sling/cms/ResourceTree.java b/api/src/main/java/org/apache/sling/cms/ResourceTree.java
index 3096b33..445d8f5 100644
--- a/api/src/main/java/org/apache/sling/cms/ResourceTree.java
+++ b/api/src/main/java/org/apache/sling/cms/ResourceTree.java
@@ -16,6 +16,7 @@
*/
package org.apache.sling.cms;
+import java.util.function.Predicate;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
@@ -33,6 +34,11 @@ public class ResourceTree {
return new ResourceTree(resource).streamTree(filterType);
}
+ public static Stream<ResourceTree> stream(Resource resource, Predicate<Resource> filterTraversal,
+ Predicate<ResourceTree> filterInclude) {
+ return new ResourceTree(resource).streamTree(filterTraversal, filterInclude);
+ }
+
private ResourceTree(Resource root) {
this.root = root;
}
@@ -42,14 +48,19 @@ public class ResourceTree {
}
private Stream<ResourceTree> streamTree() {
- return Stream.concat(Stream.of(this), StreamSupport.stream(root.getChildren().spliterator(), false)
- .map(ResourceTree::new).flatMap(ResourceTree::streamTree));
+ return streamTree(r -> true, rt -> true);
}
private Stream<ResourceTree> streamTree(String filterType) {
- return Stream.concat(Stream.of(this),
- StreamSupport.stream(root.getChildren().spliterator(), false)
- .filter(c -> filterType.equals(c.getResourceType())).map(ResourceTree::new)
- .flatMap(rt -> rt.streamTree(filterType)));
+ return streamTree((r -> filterType.equals(r.getResourceType())), rt -> true);
+ }
+
+ private Stream<ResourceTree> streamTree(Predicate<Resource> filterTraversal,
+ Predicate<ResourceTree> filterInclude) {
+ return Stream
+ .concat(Stream.of(this),
+ StreamSupport.stream(root.getChildren().spliterator(), false).filter(filterTraversal)
+ .map(ResourceTree::new).flatMap(rt -> rt.streamTree(filterTraversal, filterInclude)))
+ .filter(filterInclude);
}
}
\ No newline at end of file
diff --git a/transformer/src/test/resources/thumbnail.png b/transformer/src/test/resources/thumbnail.png
index f38c3a4..62cf067 100644
Binary files a/transformer/src/test/resources/thumbnail.png and b/transformer/src/test/resources/thumbnail.png differ
diff --git a/ui/src/main/frontend/js/cms.form.js b/ui/src/main/frontend/js/cms.form.js
index 7eb1dec..97b0ca1 100644
--- a/ui/src/main/frontend/js/cms.form.js
+++ b/ui/src/main/frontend/js/cms.form.js
@@ -54,7 +54,8 @@ rava.bind('.Form-Ajax', {
}
form.appendChild(dateContainer);
}
- const response = await fetch(form.action, {
+ const action = form.getAttribute('action');
+ const response = await fetch(action, {
method: 'POST',
body: formData,
cache: 'no-cache',
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/components/publication/agent/agent.jsp b/ui/src/main/resources/jcr_root/libs/sling-cms/components/publication/agent/agent.jsp
index a1b581d..dcbf8d3 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/components/publication/agent/agent.jsp
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/components/publication/agent/agent.jsp
@@ -64,7 +64,19 @@
<sling:include resource="${configRsrc}" />
</c:forEach>
</dl>
- <a class="button" href="/system/console/configMgr/${agentCfg['service.pid']}">Edit</a>
+ <div class="level">
+ <div class="level-left">
+ <div class="level-item">
+ <a class="button" href="/system/console/configMgr/${agentCfg['service.pid']}">Edit</a>
+ </div>
+ <div class="level-item">
+ <form method="post" action="/libs/sling/distribution/services/agents/${agent.name}" class="mb-0" target="_blank">
+ <input type="hidden" name="action" value="TEST" />
+ <button class="button" type="submit">Test</button>
+ </form>
+ </div>
+ </div>
+ </div>
</div>
</article>
</div>
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/content/publication/home.json b/ui/src/main/resources/jcr_root/libs/sling-cms/content/publication/home.json
index d628749..65e922e 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/content/publication/home.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/content/publication/home.json
@@ -30,7 +30,7 @@
"jcr:primaryType": "nt:unstructured",
"sling:resourceType": "sling-cms/components/cms/tilecard",
"image": "/static/sling-cms/thumbnails/bulk-publication.png.transform/sling-cms-thumbnail.png",
- "link": "/cms/publication/bulk-publication.html",
+ "link": "/cms/jobs/list.html",
"title": "Bulk Publication"
},
"exporters": {
diff --git a/ui/src/main/resources/jcr_root/libs/sling-cms/i18n.json b/ui/src/main/resources/jcr_root/libs/sling-cms/i18n.json
index 5441116..03af135 100644
--- a/ui/src/main/resources/jcr_root/libs/sling-cms/i18n.json
+++ b/ui/src/main/resources/jcr_root/libs/sling-cms/i18n.json
@@ -95,6 +95,11 @@
"sling:message": "Job Properties",
"sling:key": "slingcms.jobs.properties"
},
+ "slingcms-bulkpublication-title": {
+ "jcr:primaryType": "sling:MessageEntry",
+ "sling:message": "Bulk Publication",
+ "sling:key": "slingcms.bulkpublication.title"
+ },
"slingcms-publicationstatus": {
"jcr:primaryType": "sling:MessageEntry",
"sling:message": "Publication Status",
diff --git a/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/bulk-publication.png b/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/bulk-publication.png
new file mode 100644
index 0000000..b4e5c5c
Binary files /dev/null and b/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/bulk-publication.png differ
diff --git a/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/exporters.png b/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/exporters.png
new file mode 100644
index 0000000..4723a15
Binary files /dev/null and b/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/exporters.png differ
diff --git a/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/importers.png b/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/importers.png
new file mode 100644
index 0000000..8c63b29
Binary files /dev/null and b/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/importers.png differ
diff --git a/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/publish-agent.png b/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/publish-agent.png
new file mode 100644
index 0000000..705007e
Binary files /dev/null and b/ui/src/main/resources/jcr_root/static/sling-cms/thumbnails/publish-agent.png differ