Skip to content

Commit 82a6dea

Browse files
vaibhav2601Vaibhav Varshney
andauthored
FORMS-17789 Add DownloadDor as OOTB button in rule editor (#1611)
Co-authored-by: Vaibhav Varshney <vavarshn@adobe.com>
1 parent 18df3a9 commit 82a6dea

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

ui.frontend/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui.frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
"@aemforms/af-core": "^0.22.129",
2929
"@aemforms/af-core-xfa": "^0.1.6",
3030
"@aemforms/af-formatters": "^0.22.129",
31-
"@aemforms/af-custom-functions": "1.0.14"
31+
"@aemforms/af-custom-functions": "1.0.15"
3232
}
3333
}

ui.frontend/src/customFunctions.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,7 @@ export const customFunctions = {
3939
* @param {string} url - The URL to externalize.
4040
* @returns {string} - The externalized URL.
4141
*/
42-
externalize: (url) => {
43-
// Check if Granite.HTTP.externalize is available, otherwise return the original URL
44-
if (window?.Granite?.HTTP && typeof window.Granite.HTTP.externalize === "function") {
45-
return window.Granite.HTTP.externalize(url);
46-
} else {
47-
return url;
48-
}
49-
},
42+
externalize: cf.externalize,
5043

5144
/**
5245
* Validates if the given URL is correct.
@@ -114,5 +107,16 @@ export const customFunctions = {
114107
*
115108
* @returns {number} - The number of days since the Unix epoch
116109
*/
117-
dateToDaysSinceEpoch: cf.dateToDaysSinceEpoch
110+
dateToDaysSinceEpoch: cf.dateToDaysSinceEpoch,
111+
112+
/**
113+
* Downloads the Document of Record (DoR) for the form.
114+
*
115+
* @param {string=} fileName - The name of the file to be downloaded. Defaults to "Downloaded_DoR.pdf" if
116+
* not specified.
117+
* @param {scope} globals - An object containing read-only form instance, read-only target field instance,
118+
* and methods for form modifications.
119+
* @returns {void}
120+
*/
121+
downloadDoR: cf.downloadDoR,
118122
};

0 commit comments

Comments
 (0)