Skip to content
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

Editable template - MVP components reference pages #4

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

polmih
Copy link
Contributor

@polmih polmih commented Nov 1, 2024

This PR contains reference html pages having the html output of the editable templates MVP components.

Copy link
Contributor

@duboisp duboisp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need a package with those test page (like how they are coded in AEM) and have it somewhere

Comment on lines +61 to +62
<iframe width="560" height="315" src="https://www.youtube.com/embed/JJ60OdkNWJw"
frameborder="0"></iframe>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iframe should not be allowed

Is this test are the inital state or the end state?
Is it to ensure that no iframe can be added?

Comment on lines +19 to +36
`; // Create a temporary div element
var tempDiv = document.createElement('div'); // Set the HTML content to the div
tempDiv.innerHTML = htmlContent; // Iterate through child nodes to check for sensitive tags
tempDiv.childNodes.forEach(function(node) {
if (node.nodeType === 1) { // Check if it's an element node
var tagName = node.tagName.toLowerCase();
// Check for sensitive tags to be stripped (e.g., script)
if (tagName === 'script') {
console.log('Sensitive tag (script) found and stripped.');
// Remove the node if it's a script tag
tempDiv.removeChild(node);
}
}
}); // Get the sanitized HTML content
var sanitizedHTML = tempDiv.innerHTML; // Log the sanitized HTML content
console.log('Sanitized HTML content:');
console.log(sanitizedHTML); } // Call the function to test embedding
testEmbedding();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment: Custom JS should not be allowed.
Test: Ensure the <script> tag is removed

Is this test are the inital state or the end state?
Is it to ensure that no Custom JS is executed?

<div class="">
<div class="row">
<div class="title col-lg-12 col-xs-12">
<h1 property="name" id="wb-cont" dir="ltr"> Embed html
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimization: Remove the attribute dir=ltr

<div class="container">
<div class="">
<div class="row">
<div class="title col-lg-12 col-xs-12">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For maintenance: considering the custom AEM class are not prefixed anymore, we will need a registry will all those "reserved" class in order to prevent future conflict

Here I am referring to the CSS class name "title".

Comment on lines +16 to +17
<div class="embed-html embed col-lg-12">
<div id="embed-html-a323bd79b0" class="cmp-embed">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintenance CSS class name registry used by AEM

  • embed-html
  • embed
  • cmp-embed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a link with test description, Like Jira number in the page title or a text zone with the test info at the beginning of the page

Copy link
Contributor

@duboisp duboisp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, but please keep track of those comment/suggestion.

There is one concern about target=_blank that might need attention very soon as the optimization task to do.

</div>
</div>
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an empty line at the end of the document

Suggested change
</div>
</div>

Comment on lines +27 to +30
<figure data-cmp-is="image" data-cmp-widths="600,1200"
data-cmp-src="assets/img/canada-aem-template-icon-00.png"
data-cmp-filereference="assets/img/canada-aem-template-icon-00.png"
id="image-11078d76d6" data-cmp-hook-image="imageV3" class="cmp-image"> <img
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimisation: Data attribute own and only use by the authoring interface should be removed.

Suggested change
<figure data-cmp-is="image" data-cmp-widths="600,1200"
data-cmp-src="assets/img/canada-aem-template-icon-00.png"
data-cmp-filereference="assets/img/canada-aem-template-icon-00.png"
id="image-11078d76d6" data-cmp-hook-image="imageV3" class="cmp-image"> <img
<figure data-cmp-is="image" data-cmp-widths="600,1200"
data-cmp-src="assets/img/canada-aem-template-icon-00.png"
data-cmp-filereference="assets/img/canada-aem-template-icon-00.png"
id="image-11078d76d6" data-cmp-hook-image="imageV3" class="cmp-image"> <img

</div>
</div>
<div class="image col-lg-12">
<figure data-cmp-is="image" data-cmp-widths="600,1200"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Figure element? May be when there is a figcaption or + content yeah, but otherwise it can be a div like in this situation.

Comment on lines +73 to +75
<a class="cmp-list__item-link"
href="/content/canadasite/en/national-seniors-council/corporate/about-us.html">
<span class="cmp-list__item-title">About Us</span> </a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optimization Is the <span> needed? If not if need to be removed.

<div class="cmp-container">
<div class="">
<div
class="mwsmulti-list aem-GridColumn--default--none aem-GridColumn aem-GridColumn--default--5 aem-GridColumn--offset--default--0">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should aem-Grid persist?

<li>velit purus blandit mi, et egestas diam mauris ac nisl. S</li>
</ul>
<ol>
<li>ed sit amet <a id="Mauris"></a>lobortis mi. </li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No empty anchor.

Suggested change
<li>ed sit amet <a id="Mauris"></a>lobortis mi. </li>
<li id="Mauris">ed sit amet lobortis mi. </li>

Comment on lines +45 to +47
<li>Donec id <a title="List advanced"
href="/content/canadasite/en/service-canada/editable-template-qa/mihai/list-advanced-component.html"
target="_blank">semper tellus.</a></li>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No title and no target. If target is used, additional configuration is required for security purpose

Suggested change
<li>Donec id <a title="List advanced"
href="/content/canadasite/en/service-canada/editable-template-qa/mihai/list-advanced-component.html"
target="_blank">semper tellus.</a></li>
<li>Donec id <a href="/content/canadasite/en/service-canada/editable-template-qa/mihai/list-advanced-component.html">semper tellus.</a></li>

Comment on lines +14 to +34
</div>
<div class="title col-lg-12">
<h2 dir="ltr"> h2 heading
</h2>
</div>
<div class="title col-lg-12">
<h3 dir="ltr"> h3 heading
</h3>
</div>
<div class="title col-lg-12">
<h4 dir="ltr"> h4 heading
</h4>
</div>
<div class="title col-lg-12">
<h5 dir="ltr"> h5 heading
</h5>
</div>
<div class="title col-lg-12">
<h6 dir="ltr"> h6 heading
</h6>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No text direction required

Suggested change
</div>
<div class="title col-lg-12">
<h2 dir="ltr"> h2 heading
</h2>
</div>
<div class="title col-lg-12">
<h3 dir="ltr"> h3 heading
</h3>
</div>
<div class="title col-lg-12">
<h4 dir="ltr"> h4 heading
</h4>
</div>
<div class="title col-lg-12">
<h5 dir="ltr"> h5 heading
</h5>
</div>
<div class="title col-lg-12">
<h6 dir="ltr"> h6 heading
</h6>
</div>
</div>
<div class="title col-lg-12">
<h2> h2 heading
</h2>
</div>
<div class="title col-lg-12">
<h3> h3 heading
</h3>
</div>
<div class="title col-lg-12">
<h4> h4 heading
</h4>
</div>
<div class="title col-lg-12">
<h5> h5 heading
</h5>
</div>
<div class="title col-lg-12">
<h6> h6 heading
</h6>
</div>

Comment on lines +43 to +46
<div class="title col-lg-12 col-lg-offset-0 col-xs-6">
<h2 id="h2-id" dir="ltr"> h2 heading having the width of 6 columns on xs screen
</h2>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have an example where text is right to left along with a different language tag, like in Arabic?

</div>
</div>
</div>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
</div>
</div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants