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

Build page on /solutions/cloud-native-development #1577

Merged
merged 2 commits into from
Mar 4, 2025
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sass": "1.79.0",
"vanilla-framework": "4.20.2"
"vanilla-framework": "4.21.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.5",
Expand Down
23 changes: 23 additions & 0 deletions static/js/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,26 @@ function getCustomFields(event) {
const textarea = document.getElementById("Comments_from_lead__c");
textarea.value = message;
}

// Fix Tab and modal js conflicts
(function () {
Copy link
Contributor

Choose a reason for hiding this comment

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

Haven't looked into it, but would it be possible to add a check to the initial 'aria-controls' listener for forms to see if it has an associated form (with document.getElementById(targetControls)) before calling toggleModal, so it doesn't affect other elements with aria-controls?

document.querySelectorAll(".p-tabs__link").forEach((tab) => {
tab.addEventListener("click", function (event) {
event.preventDefault();

document.querySelectorAll(".p-tabs__link").forEach((t) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it needed to make the querySelectorAll a second time here?

t.setAttribute("aria-selected", "false");
t.setAttribute("tabindex", "-1");
});
this.setAttribute("aria-selected", "true");
this.removeAttribute("tabindex");

document
.querySelectorAll("[role='tabpanel']")
.forEach((panel) => (panel.style.display = "none"));
document.getElementById(
this.getAttribute("aria-controls")
).style.display = "block";
});
});
})();
39 changes: 39 additions & 0 deletions templates/solutions/cloud-native-development/form-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"form": {
"/solutions/cloud-native-development": {
"templatePath": "/solutions/cloud-native-development/index.html",
"isModal": true,
"modalId": "cloud-native-development-modal",
"formData": {
"title": "Get in touch",
"formId": "6134",
"returnUrl": "/solutions/cloud-native-development#contact-form-success",
"product": ""
},
"fieldsets": [
{
"title": "Contact Canonical to discuss your app modernization needs and find out how our open source technologies can help you.",
"id": "about-you",
"noCommentsFromLead": true,
"fields": [
{
"type": "tel",
"id": "phone",
"label": "Phone number"
},
{
"type": "text",
"id": "company",
"label": "Company"
},
{
"type": "text",
"id": "title",
"label": "Job title"
}
]
}
]
}
}
}
Loading