diff --git a/website/api/controllers/view-query-detail.js b/website/api/controllers/view-query-detail.js index a15ecf1384..f1860c4154 100644 --- a/website/api/controllers/view-query-detail.js +++ b/website/api/controllers/view-query-detail.js @@ -42,7 +42,7 @@ module.exports = { let policyWithThisSlug = _.find(sails.config.builtStaticContent.policies, {kind: 'policy', slug: slug}); if(policyWithThisSlug){ // If we foudn a matchign policy, redirect the user. - throw {redirect: `/policies/${policyWithThisSlug.slug}`}; + throw {redirectToPolicy: `/policies/${policyWithThisSlug.slug}`}; } else { throw 'notFound'; } diff --git a/website/assets/js/pages/vital-details.page.js b/website/assets/js/pages/vital-details.page.js index 0ab476bae5..bb1a8154fa 100644 --- a/website/assets/js/pages/vital-details.page.js +++ b/website/assets/js/pages/vital-details.page.js @@ -4,7 +4,7 @@ parasails.registerPage('vital-details', { // ╩╝╚╝╩ ╩ ╩╩ ╩╩═╝ ╚═╝ ╩ ╩ ╩ ╩ ╚═╝ data: { contributors: [], - selectedPlatform: 'macos', // Initially set to 'macos' + selectedPlatform: 'apple', // Initially set to 'macos' modal: '', }, @@ -17,7 +17,7 @@ parasails.registerPage('vital-details', { mounted: async function () { // Set the selected platform from the hash in the user's URL. // All links to vitals in the on-page navigation have the currently selected filter appended to them, this lets us persist the user's filter when they navigate to a new page. - if(['#macos','#linux','#windows','#chrome'].includes(window.location.hash)){ + if(['#apple','#linux','#windows','#chrome'].includes(window.location.hash)){ this.selectedPlatform = window.location.hash.split('#')[1]; } @@ -103,7 +103,27 @@ parasails.registerPage('vital-details', { // ╩╝╚╝ ╩ ╚═╝╩╚═╩ ╩╚═╝ ╩ ╩╚═╝╝╚╝╚═╝ methods: { clickSelectPlatform: function (platform) { - this.selectedPlatform = platform; + let platformToLookFor = platform; + if(platform === 'apple'){ + platformToLookFor = 'darwin'; + } + let currentVitalAvailableOnNewPlatform = this.thisVital.platform.includes(platformToLookFor); + + if(!currentVitalAvailableOnNewPlatform){ + if(platformToLookFor === 'chrome'){ + this.goto('/vitals/'+this.chromeVitals[0].slug+'#chrome'); + } else if(platformToLookFor === 'darwin') { + this.goto('/vitals/'+this.macOsVitals[0].slug+'#macos'); + } else if(platformToLookFor === 'linux') { + this.goto('/vitals/'+this.linuxVitals[0].slug+'#linux'); + } else if(platformToLookFor === 'windows') { + this.goto('/vitals/'+this.windowsVitals[0].slug+'#windows'); + } + } else { + this.selectedPlatform = platform; + + } + }, clickOpenTableOfContents: function () { this.modal = 'table-of-contents'; diff --git a/website/assets/styles/pages/vital-details.less b/website/assets/styles/pages/vital-details.less index 039f3bb8bf..0fce8d0c51 100644 --- a/website/assets/styles/pages/vital-details.less +++ b/website/assets/styles/pages/vital-details.less @@ -474,12 +474,14 @@ [purpose='modal-dialog'] { margin-left: 16px; + margin-top: 16px; + margin-bottom: 16px; [purpose='modal-content'] { display: flex; - height: calc(~'100vh - 72px'); + height: calc(~'100vh - 32px'); margin-top: 0px; max-width: 366px; - padding: 48px 24px 24px 24px; + padding: 48px 19px 24px 24px; flex-direction: column; align-items: flex-start; // gap: 24px; @@ -492,6 +494,7 @@ [purpose='vital-link'] { color: #515774; font-family: Inter; + margin-right: 5px; font-size: 14px; line-height: 150%; width: 100%; @@ -564,6 +567,17 @@ } } } + [parasails-component='modal'] { + + [purpose='modal-dialog'] { + margin: 16px; + width: 100%; + max-width: calc(~'100% - 32px'); + [purpose='modal-content'] { + max-width: 100%; + } + } + } } diff --git a/website/views/pages/vital-details.ejs b/website/views/pages/vital-details.ejs index c9a8e77682..be2792b39a 100644 --- a/website/views/pages/vital-details.ejs +++ b/website/views/pages/vital-details.ejs @@ -24,7 +24,7 @@ -->
-
+

macOS Apple @@ -51,11 +51,11 @@

-
+
<% // macOS policies (server-side-rendered) for(let vital of macOsVitals) { %> - <%- vital.name %> + <%- vital.name %> <% } %>
@@ -112,11 +112,11 @@

Vitals

-
+
<% // macOS policies (server-side-rendered) for(let vital of macOsVitals) { %> - <%- vital.name %> + <%- vital.name %> <% } %>