Skip to content

Commit

Permalink
Merge branch 'main' into c3-803-rebrand-search-results-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejvelichkovski committed Dec 11, 2024
2 parents a811b2a + f40fbd1 commit 768c7c1
Show file tree
Hide file tree
Showing 109 changed files with 5,461 additions and 2,909 deletions.
2 changes: 1 addition & 1 deletion .github/.jira_sync_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ settings:
sync_comments: true

# (Optional) (Default: None) Parent Epic key to link the issue to
epic_key: "WD-6777"
epic_key: "WD-17176"
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ WORKDIR /srv
ADD . .
RUN rm -rf package.json yarn.lock babel.config.js webpack.config.js
COPY --from=build-js /srv/static/js static/js
COPY --from=build-js /srv/node_modules/vanilla-framework/templates node_modules/vanilla-framework/templates
COPY --from=build-css /srv/static/css static/css
ADD http://launchpad.net/ubuntu/+cdmirrors-rss etc/ubuntu-mirrors-rss.xml

Expand Down
21 changes: 6 additions & 15 deletions konf/site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -368,23 +368,17 @@ production:
- name: SENTRY_DSN
value: https://[email protected]//13

- paths: [/security/notices\.json]
service_name: ubuntu-com-security-api-notices

- paths: [/security/notices/.*\.json]
service_name: ubuntu-com-security-api-notices-detail

- paths: [/security/updates/.*]
service_name: ubuntu-com-security-api-updates

- paths:
[
/security/notices\.json,
/security/notices/.*\.json,
/security/cves\.json,
/security/cves/.*\.json,
/security/releases\.json,
/security/releases/.*\.json,
/security/api/.*,
/security/page/.*\.json,
/security/updates/.*
]
service_name: ubuntu-com-security-api

Expand Down Expand Up @@ -900,20 +894,17 @@ staging:
- name: SENTRY_DSN
value: https://[email protected]//13

- paths: [/security/notices\.json, /security/notices/.*\.json]
service_name: ubuntu-com-security-api-notices

- paths: [/security/updates/.*]
service_name: ubuntu-com-security-api-updates

- paths:
[
/security/notices\.json,
/security/notices/.*\.json,
/security/cves\.json,
/security/cves/.*\.json,
/security/releases\.json,
/security/releases/.*\.json,
/security/api/.*,
/security/page/.*\.json,
/security/updates/.*
]
service_name: ubuntu-com-security-api

Expand Down
8 changes: 5 additions & 3 deletions meganav.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ products:
- title: Kubernetes
description: Containerised workloads
url: /kubernetes
- title: Charmhub
description: Charmed Operators marketplace
url: https://charmhub.io/
- title: AI & MLOps
description: AI and machine learning on Ubuntu
url: /ai
- title: Juju
description: Orchestration engine for operators
url: https://juju.is/
Expand Down Expand Up @@ -919,6 +919,8 @@ get_ubuntu:
secondary_links:
- title: Quick links
links:
- title: Install Ubuntu on Qualcomm IoT Platforms
url: /download/qualcomm-iot
- title: AMD Evaluation kits & SOMs
url: /download/xilinx
- title: Intel IoT platforms
Expand Down
6 changes: 4 additions & 2 deletions navigation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ ai:
path: /ai/consulting
- title: Data Science
path: /ai/data-science
- title: MLOps workshop
path: /ai/mlops-workshop

kubernetes:
title: Canonical Kubernetes
Expand Down Expand Up @@ -315,7 +317,7 @@ support:
- title: Pricing
path: /pricing/pro
- title: Discourse
path: https://discourse.ubuntu.com/c/ubuntu-pro
path: https://discourse.ubuntu.com/c/project/ubuntu-pro/116/

pro:
title: Ubuntu Pro
Expand All @@ -333,7 +335,7 @@ pro:
- title: Docs
path: https://documentation.ubuntu.com/pro
- title: Discourse
path: https://discourse.ubuntu.com/c/ubuntu-pro
path: https://discourse.ubuntu.com/c/project/ubuntu-pro/116/

Distributor:
title: Ubuntu Pro Distributor
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@
"react-google-recaptcha": "3.1.0",
"react-router-dom": "^6.24.1",
"react-useportal": "1.0.19",
"sass": "1.45.2",
"sass": "1.79.0",
"smartquotes": "2.3.2",
"typescript": "5.5.4",
"url-polyfill": "1.1.12",
"url-search-params-polyfill": "8.2.5",
"vanilla-framework": "4.16.0",
"vanilla-framework": "4.18.2",
"yup": "1.4.0"
},
"resolutions": {
Expand Down Expand Up @@ -157,4 +157,4 @@
"node"
]
}
}
}
2 changes: 2 additions & 0 deletions redirects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ download/samsung-artik-5-10/?: "/download/core/"
download/samsung-artik-5-10-server/?: "/download/core/"
download/iot/kvm/?: "/core/docs/getting-started"
download/kvm/?: "/core/docs/getting-started"
download/raspberry-pi-core/?: "/core/docs/install-with-imager"
download/iot/up-squared-iot-grove-server/?: "/download/up-squared-iot-grove-server"
download/releasenotes.*/?: "https://wiki.ubuntu.com/Releases"
download/server/download/?: "/download/server"
Expand Down Expand Up @@ -843,6 +844,7 @@ tour/?: "/desktop"
tour/en/?: "/desktop"
tour/zh-CN/?: "/desktop"
trademark-policy/?: "/legal/intellectual-property-policy"
tutorials/secure-ubuntu-kiosk: "https://mir-server.io/docs/make-a-secure-ubuntu-web-kiosk"
tuxaward/?: "/blog/ubuntu-wins-tux-award/"
ua/?: "/support"
ua-assurance-terms/?: "/legal/ubuntu-advantage-assurance"
Expand Down
4 changes: 4 additions & 0 deletions static/files/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,4 +1022,8 @@
<loc>https://ubuntu.com/azure/confidential-computing</loc>
<lastmod>2024-10-04T00:00:00+00:00</lastmod>
</url>
<url>
<loc>https://ubuntu.com/summit</loc>
<lastmod>2024-11-21T00:00:00+00:00</lastmod>
</url>
</urlset>
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ const ExamResults = () => {
</small>
),
},
{
Header: "First Name",
accessor: "user.first_name",
sortType: "basic",
},
{
Header: "User Email",
accessor: "user_email",
Expand Down Expand Up @@ -295,6 +300,8 @@ const ExamResults = () => {
{flatData && flatData?.length > 0 && (
<>
<ModularTable
initialSortColumn="completed_at"
initialSortDirection="descending"
data={currentRows}
columns={columns}
sortable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe("ExpiryNotification", () => {
"Your subscription is about to expire.",
);
expect(wrapper.find(Notification).prop("children")).toBe(
"Click on Renew subscription to to ensure service continuity.",
"Click on Renew subscription to ensure service continuity.",
);
});
it("is expiring shows not legacy message if not actionable", () => {
Expand Down Expand Up @@ -241,7 +241,7 @@ describe("ExpiryNotification", () => {
"Your subscription has expired.",
);
expect(wrapper.find(Notification).prop("children")).toBe(
"Click on Renew subscription to to ensure service continuity.",
"Click on Renew subscription to ensure service continuity.",
);
});

Expand Down Expand Up @@ -287,7 +287,7 @@ describe("ExpiryNotification", () => {
"Your subscription has expired.",
);
expect(wrapper.find(Notification).prop("children")).toBe(
"Click on Renew subscription to to ensure service continuity.",
"Click on Renew subscription to ensure service continuity.",
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const MESSAGES: Messages = {
message: {
default: "Check the subscription errors below for more information.",
[UserSubscriptionType.Legacy]:
"Click on Renew subscription to to ensure service continuity.",
"Click on Renew subscription to ensure service continuity.",
[UserSubscriptionType.Monthly]:
"Enable auto-renewals via the renewal settings menu to ensure service continuity.",
[UserSubscriptionType.Yearly]:
Expand All @@ -82,7 +82,7 @@ const MESSAGES: Messages = {
message: {
default: "Check the subscription errors below for more information.",
[UserSubscriptionType.Legacy]:
"Click on Renew subscription to to ensure service continuity.",
"Click on Renew subscription to ensure service continuity.",
[UserSubscriptionType.Monthly]: (
<>
If you don&apos;t renew it, it will disappear from your dashboard in
Expand Down Expand Up @@ -116,7 +116,7 @@ const MESSAGES: Messages = {
message: {
default: "Check the subscription errors below for more information.",
[UserSubscriptionType.Legacy]:
"Click on Renew subscription to to ensure service continuity.",
"Click on Renew subscription to ensure service continuity.",
[UserSubscriptionType.Monthly]: (
<>
If you don&apos;t renew it, it will disappear from your dashboard in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe("Landscape", () => {
"Install self-hosted Landscape",
);
expect(wrapper.find(Button).at(1).text()).toBe(
"Request a Landscape SaaS account",
"Get a Landscape SaaS account",
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ const Landscape = () => {
</Button>
<Button
element="a"
href="https://ubuntu.com/contact-us/form?product=landscape"
href="https://landscape.canonical.com/create-new-account"
>
Request a Landscape SaaS account
Get a Landscape SaaS account
</Button>
</p>
<hr />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,7 @@ const ProductSummary = () => {
>
{product?.canBeTrialled && productUser !== ProductUsers.myself ? (
<StatusLabel appearance="positive">
<a href="/engage/Ubuntu-Pro-1-month-trial">
Free trial available
</a>
Free trial on checkout
</StatusLabel>
) : null}
<PaymentButton />
Expand Down Expand Up @@ -206,9 +204,7 @@ const ProductSummary = () => {
{product?.canBeTrialled && productUser !== ProductUsers.myself ? (
<Col size={12}>
<StatusLabel appearance="positive">
<a href="/engage/Ubuntu-Pro-1-month-trial">
Free trial available
</a>
Free trial on checkout
</StatusLabel>
</Col>
) : null}
Expand Down
1 change: 1 addition & 0 deletions static/js/src/cookie-policy-with-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ if (!cookieAcceptanceValue) {
cpNs.cookiePolicy(setUserId);
} else {
setUserId();
cpNs.cookiePolicy();
}

function setUserId() {
Expand Down
7 changes: 6 additions & 1 deletion static/js/src/dynamic-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ import { prepareInputFields } from "./prepare-form-inputs.js";
const radioFieldsets = document.querySelectorAll(
".js-remove-radio-names",
);
if (radioFieldsets) {
if (radioFieldsets.length > 0) {
radioFieldsets.forEach((radioFieldset) => {
const radioInputs = radioFieldset.querySelectorAll(
"input[type='radio']",
Expand Down Expand Up @@ -500,6 +500,11 @@ import { prepareInputFields } from "./prepare-form-inputs.js";

setCheckboxLimit();

// Sets up dial code dropdown options aka. intlTelInput.js
// and pre fills the country field
// This gets triggered when the modal is opened
prepareInputFields(phoneNumberInput, countryInput);

// Set preferredLanguage hidden input
function setpreferredLanguage() {
const preferredLanguage = getPrimaryParentLanguage();
Expand Down
8 changes: 8 additions & 0 deletions static/js/src/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ mainList.addEventListener("click", function (e) {
goBackOneLevel(e, target);
} else {
handleDropdownClick(e.target.parentNode);
// This is a temporary fix until we migrate to use the vanilla meganav
closeNotifications();
}
} else if (
target.classList.contains("p-navigation__dropdown-item") ||
Expand All @@ -78,6 +80,12 @@ mainList.addEventListener("click", function (e) {
}
});

// The current set up of the meganav doesn't work well with notifications. The simplest fix for this is to close all notifications when a dropdown is clicked. Can be removed on migration to vanilla meganav.
function closeNotifications() {
const notification = document.querySelector(".p-popup-notification:target");
notification.style.display = "none";
}

let wasBelowSpecificWidth = window.innerWidth < MOBILE_VIEW_BREAKPOINT;
window.addEventListener("resize", function () {
// Only closeAll if the resize event crosses the MOBILE_VIEW_BREAKPOINT threshold
Expand Down
15 changes: 15 additions & 0 deletions static/js/src/static-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,24 @@ function setUpStaticForms(form, formId) {
message += "\r\n\r\n";
});

const radioFieldsets = document.querySelectorAll(
".js-remove-radio-names",
);
if (radioFieldsets.length > 0) {
radioFieldsets.forEach((radioFieldset) => {
const radioInputs = radioFieldset.querySelectorAll(
"input[type='radio']",
);
radioInputs.forEach((radioInput) => {
radioInput.removeAttribute("name");
});
});
}

if (formFields.length) {
commentsFromLead.value = message;
}

return message;
});
}
Expand Down
16 changes: 7 additions & 9 deletions static/js/src/tabbed-content.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,17 +150,15 @@

attachEvents(tabs, persistURLHash);

const isInsideCurrentContainer =
null !==
tabContainer.querySelector(".p-tabs__link[href='" + currentHash + "']");

if (persistURLHash && currentHash && isInsideCurrentContainer) {
const activeTab = document.querySelector(
if (persistURLHash && currentHash) {
const activeTabLink = document.querySelector(
".p-tabs__link[href='" + currentHash + "']",
);

if (activeTab) {
setActiveTab(activeTab, tabs);
const activeTabButton = document.querySelector(
".p-tabs__item[id='" + currentHash.replace("#", "") + "']",
);
if (activeTabLink || activeTabButton) {
setActiveTab(activeTabLink || activeTabButton, tabs);
}

return;
Expand Down
Loading

0 comments on commit 768c7c1

Please sign in to comment.