-
Notifications
You must be signed in to change notification settings - Fork 467
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
#23603 : Allow users to write code when creating a file - PR2 #24267
#23603 : Allow users to write code when creating a file - PR2 #24267
Conversation
…ode-when-creating-file-pr2
Postman Tests Report 65 files ±0 1 407 suites +3 3h 40m 24s ⏱️ -38s For more details on these failures, see this check. Results for commit 94b7d3a. ± Comparison against base commit 4d158c9. This pull request removes 1 and adds 6 tests. Note that renamed tests count towards both.
♻️ This comment has been updated with latest results. |
Integration Tests [postgres] Report 409 files ±0 409 suites ±0 1h 27m 9s ⏱️ - 10m 6s For more details on these failures, see this check. Results for commit 94b7d3a. ± Comparison against base commit 4d158c9. ♻️ This comment has been updated with latest results. |
…ode-when-creating-file-pr2
…ode-when-creating-file-pr2
…ode-when-creating-file-pr2
…ode-when-creating-file-pr2
* @param tempFileId The ID of the Temporary File. | ||
* | ||
* @return The {@link DotTempFile} matching the specified ID. | ||
*/ | ||
private Optional<DotTempFile> getTempFile(final String tempFileId) { | ||
|
||
if (tempFileId == null || !tempFileId.startsWith(TEMP_RESOURCE_PREFIX)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
tempFileId = jsonData.tempFiles[0].id; | ||
const elements = document.getElementsByName("<%= field.getFieldContentlet() %>"); | ||
for (let i = 0; i < elements.length; i++) { | ||
if (elements[i].tagName.toLowerCase() == "input") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (elements[i].tagName.toLowerCase() == "input") { | |
if (elements[i].tagName.toLowerCase() === "input") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
const jsonData = JSON.parse(xhr.response); | ||
tempFileId = jsonData.tempFiles[0].id; | ||
const elements = document.getElementsByName("<%= field.getFieldContentlet() %>"); | ||
for (let i = 0; i < elements.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for (let i = 0; i < elements.length; i++) { | |
for (const element of elements) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
FileAssetAjax.saveFileText(contentletInode.value, text, '<%=field.getVelocityVarName()%>', { | ||
async: false, | ||
callback: function (data) { | ||
console.log("savedText"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these logs?
console.log("savedText"); | |
console.warn("savedText"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing code.
|
||
xhr.addEventListener("readystatechange", function() { | ||
if(this.readyState === 4) { | ||
console.log(this.responseText); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these logs?
console.log(this.responseText); | |
console.warn(this.responseText); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing code.
Proposed Changes