Skip to content

Commit

Permalink
Merge pull request #1059 from adobe/develop
Browse files Browse the repository at this point in the history
v3.6.0 release
  • Loading branch information
davidjgonzalez authored Dec 12, 2023
2 parents f07298d + a114fb0 commit bc24bb3
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

# Set up environment with Java and Maven
- name: Setup JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8
Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
ref: asset-share-commons-${{ needs.Tag.outputs.version }}

- name: Setup JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 11
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
ref: asset-share-commons-${{ needs.Tag.outputs.version }}

- name: Setup JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
echo $GPG_OWNERTRUST | base64 --decode | gpg --import-ownertrust --no-tty --batch --yes
- name: Setup JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 8
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<vault.password>admin</vault.password>
<package.group>asset-share-commons</package.group>
<!-- the minimum AEM 6.5 version being supported -->
<aem.classic.api.version>6.5.7.0003</aem.classic.api.version><!-- actually one of https://repo1.maven.org/maven2/io/wcm/maven/io.wcm.maven.aem-dependencies/ -->
<aem.classic.api.version>6.5.19.0000</aem.classic.api.version><!-- actually one of https://repo1.maven.org/maven2/io/wcm/maven/io.wcm.maven.aem-dependencies/ -->
<!-- the minimum AEMaaCS version being supported -->
<aem.sdk.api.version>2023.7.12874.20230726T072051Z-230702</aem.sdk.api.version><!-- actually one of https://repo1.maven.org/maven2/com/adobe/aem/aem-sdk-api/ -->
<core.wcm.components.version>2.17.14</core.wcm.components.version>
Expand Down Expand Up @@ -277,7 +277,7 @@ Bundle-DocURL: https://opensource.adobe.com/asset-share-commons/
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>3.1.2</version>
<version>3.2.2</version>
</dependency>
</dependencies>
<configuration>
Expand All @@ -290,7 +290,7 @@ Bundle-DocURL: https://opensource.adobe.com/asset-share-commons/
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.2</version>
<version>3.2.2</version>
</plugin>
<!-- Maven Deploy Plugin -->
<plugin>
Expand Down Expand Up @@ -385,7 +385,7 @@ Bundle-DocURL: https://opensource.adobe.com/asset-share-commons/
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.1</version>
</plugin>
<!-- Build Helper Maven Plugin -->
<plugin>
Expand Down Expand Up @@ -462,7 +462,7 @@ Bundle-DocURL: https://opensource.adobe.com/asset-share-commons/
<!-- Maven Javadoc Plugin -->
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<version>3.6.2</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<excludePackageNames>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ AssetShare.FormData = function (formEl) {
form = [];
}

function getAll() {
return form;
function getAll(key) {
if (!key) {
return form;
} else {
return form.filter(function (element) { return element.name === key; }).map((function (element) { return element.value; }));
}
}

function get(key) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,25 @@
sling:resourceType="granite/ui/components/coral/foundation/text"
text="For direct downloads to function, at least one rendition option should be marked as Selected in the Download Options tab." />

<avoid-zip-downloads
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/switch"
fieldLabel="Avoid Zip Downloads"
fieldDescription="When enabled, and only one asset and one rendition are selected, the file will not download as a zip."
onText="Avoid Zip Downloads"
offText="Always Zip Downloads"
name="./avoidZipDownloads"
required="{Boolean}false"
value="true"
uncheckedValue=""
deleteHint="{Boolean}true"/>

<avoid-zip-downloads-note
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/text"
text="Not zipping download requires only a single asset and a single rendition to be selected for the download." />


<automatic-download
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/switch"
Expand All @@ -391,7 +410,10 @@
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/text"
text="Enabling automatic downloads will attempt to automatically initiate downloads automatically rather than adding them to the Downloads queue. If a download requires more time than allocated by automatic downloads to create the download zip the download will be added to the Downloads queue." />





</items>
</column>
</items>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ jQuery((function(ns, semanticModal, licenseModal, downloadService) {
DOWNLOAD_DIRECT = "asset-share-download-direct",
DOWNLOAD_MODAL_ID = "download-modal",
DOWNLOAD_BUTTON_ID = "download-asset",
DOWNLOAD_MODE_ASYNC = "data-asset-share-mode-async";
DOWNLOAD_MODE_ASYNC = "data-asset-share-mode-async",
DOWNLOAD_AVOID_ZIP = "data-asset-share-download-avoid-zip"

function getId() {
return DOWNLOAD_MODAL_ID;
Expand Down Expand Up @@ -107,13 +108,31 @@ jQuery((function(ns, semanticModal, licenseModal, downloadService) {
$("body").on("click", ns.Elements.selector([DOWNLOAD_BUTTON_ID]), download);

// intercept async download submission
$("body").on("submit", "[" + DOWNLOAD_MODE_ASYNC + "=\"true\"]", function (e) {
var formEl = $(this);

e.preventDefault();
e.stopPropagation();
$("body").on("submit", "[" + DOWNLOAD_AVOID_ZIP + "=\"true\"]", (e) => {
e.preventDefault(); // Prevent the default form submission
e.stopPropagation(); // Stop the event from bubbling up the DOM tree
const formEl = e.target;

const renditionNames = [...formEl.querySelectorAll('input[type="checkbox"][name="renditionName"]:checked')].map((checkbox) => checkbox.value);
const assetPaths = [...formEl.querySelectorAll('input[name="path"]')].map((input) => input.value);

if (renditionNames.length === 1 && assetPaths.length === 1) {
// Set the form's method and action
formEl.method = 'GET';
formEl.action = assetPaths[0] + '.renditions/' + renditionNames[0] + '/download/asset.rendition';
formEl.submit();
}
});

if (formEl.form('is valid')) {
// intercept async download submission
// This must be registered after the above handler to ensure this is called second (after the form method is changed)
$("body").on("submit", "[" + DOWNLOAD_MODE_ASYNC + "=\"true\"]", (e) => {
var formEl = $(e.target);

// GET indicates this is a single asset download and not a zip, so make sure this is a POST
if (formEl.form('is valid') && e.target.method === 'post') {
e.preventDefault();
e.stopPropagation();
downloadService.initializeDownload(formEl);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
data-asset-share-mode-async="${download.isAsynchronous ? 'true' : ''}"
data-asset-share-download-direct="${properties.downloadDirect ? 'true' : ''}"
data-asset-share-download-automatic="${properties.automaticDownload ? 'true' : ''}"
data-asset-share-download-avoid-zip="${properties.avoidZipDownloads ? 'true' : ''}"
class="ui modal cmp-modal-download--wrapper cmp-modal">
<input id="asset-share-commons__download-modal--timezone" type="hidden" name="timezone" value=""/>
<script>document.getElementById('asset-share-commons__download-modal--timezone').value = Intl.DateTimeFormat().resolvedOptions().timeZone;</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@
jcr:primaryType="nt:unstructured"
enabled="true"
path="/content/asset-share-commons/en/dark/actions/download"/>
<downloads
jcr:primaryType="nt:unstructured"
enabled="true"
path="/content/asset-share-commons/en/dark/actions/downloads"/>
<license
jcr:primaryType="nt:unstructured"
enabled="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,10 @@
jcr:primaryType="nt:unstructured"
enabled="true"
path="/content/asset-share-commons/en/light/actions/download"/>
<downloads
jcr:primaryType="nt:unstructured"
enabled="true"
path="/content/asset-share-commons/en/light/actions/downloads"/>
<license
jcr:primaryType="nt:unstructured"
enabled="true"
Expand Down

0 comments on commit bc24bb3

Please sign in to comment.