Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
return message;
}

/**

Check warning on line 34 in content/src/content/jcr_root/apps/core/wcm/components/contentfragment/v1/contentfragment/clientlibs/editor/authoring/js/vcfRenderer.js

View workflow job for this annotation

GitHub Actions / build-js (14)

Missing JSDoc for parameter 'role'

Check warning on line 34 in content/src/content/jcr_root/apps/core/wcm/components/contentfragment/v1/contentfragment/clientlibs/editor/authoring/js/vcfRenderer.js

View workflow job for this annotation

GitHub Actions / build-js (14)

Missing JSDoc for parameter 'modifier'

Check warning on line 34 in content/src/content/jcr_root/apps/core/wcm/components/contentfragment/v1/contentfragment/clientlibs/editor/authoring/js/vcfRenderer.js

View workflow job for this annotation

GitHub Actions / build-js (14)

Missing JSDoc @returns for function
* Builds placeholder markup for the author preview; uses DOM so translated strings are escaped.
* The {@code title} and {@code detail} arguments are expected to already be localized.
*/
function buildVcfPlaceholderOuterHtml(modifier, role, surfaceCss, accentCss, titleMessage, detailMessage) {
function buildVcfPlaceholderOuterHtml(modifier, role, surfaceCss, accentCss, title, detail) {
var root = document.createElement("div");
root.className = "cmp-contentfragment__vcf-placeholder cmp-contentfragment__vcf-placeholder--" + modifier;
root.setAttribute("role", role);
Expand All @@ -57,10 +58,10 @@
"text-transform:uppercase",
"letter-spacing:.06em"
].join(";");
titleEl.textContent = i18n(titleMessage);
titleEl.textContent = title;

var detailEl = document.createElement("span");
detailEl.textContent = i18n(detailMessage);
detailEl.textContent = detail;

root.appendChild(titleEl);
root.appendChild(detailEl);
Expand All @@ -73,8 +74,8 @@
"alert",
"border:2px dashed #d7373f;border-radius:8px;background:#fff4f4",
"color:#c9252d",
"Visual Content Fragment could not be loaded",
"Check that preview services are available and the fragment configuration is valid."
i18n("Visual Content Fragment could not be loaded"),
i18n("The Visual Content Fragment could not be displayed.")
);
}

Expand All @@ -84,8 +85,8 @@
"status",
"border:2px dashed #b0b0b0;border-radius:8px;background:#f5f5f5",
"color:#6e6e6e",
"Visual Content Fragment preview unavailable",
"A preview URL is not available for this content fragment in the editor."
i18n("Visual Content Fragment unavailable"),
i18n("A preview URL is not available for this content fragment.")
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@

/**
* Builds placeholder markup for the VCF shadow root; uses DOM so translated strings are escaped.
* The {@code title} and {@code detail} arguments are expected to already be localized.
*/
function buildVcfPlaceholderOuterHtml(modifier, role, surfaceCss, accentCss, titleMessage, detailMessage) {
function buildVcfPlaceholderOuterHtml(modifier, role, surfaceCss, accentCss, title, detail) {
var root = document.createElement("div");
root.className = "cmp-contentfragment__vcf-placeholder cmp-contentfragment__vcf-placeholder--" + modifier;
root.setAttribute("role", role);
Expand All @@ -53,10 +54,10 @@
"text-transform:uppercase",
"letter-spacing:.06em"
].join(";");
titleEl.textContent = i18n(titleMessage);
titleEl.textContent = title;

var detailEl = document.createElement("span");
detailEl.textContent = i18n(detailMessage);
detailEl.textContent = detail;

root.appendChild(titleEl);
root.appendChild(detailEl);
Expand All @@ -69,8 +70,8 @@
"alert",
"border:2px dashed #d7373f;border-radius:8px;background:#fff4f4",
"color:#c9252d",
"Visual Content Fragment could not be loaded",
"The Visual Content Fragment could not be displayed."
i18n("Visual Content Fragment could not be loaded"),
i18n("The Visual Content Fragment could not be displayed.")
);
}

Expand Down
2 changes: 1 addition & 1 deletion content/test/clientlibs/contentfragment/vcfRendererTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe("Test VCF renderer for", function() {

setTimeout(function() {
expect(vcfElement.innerHTML).toContain("cmp-contentfragment__vcf-placeholder");
expect(vcfElement.innerHTML).toContain("Visual Content Fragment preview unavailable");
expect(vcfElement.innerHTML).toContain("Visual Content Fragment unavailable");
done();
}, 50);
});
Expand Down
Loading