From b9f137778c0fbebac66beed8455a233a18ac4e4f Mon Sep 17 00:00:00 2001 From: jdwjdwjdw Date: Wed, 15 May 2024 20:46:32 +0000 Subject: [PATCH 1/3] Update filter sortBy, responsive fixup --- algolia-search/dist/islands/algolia-search.island.js | 4 ++-- algolia-search/src/hits/default-hit.tsx | 2 +- algolia-search/src/search-form.tsx | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/algolia-search/dist/islands/algolia-search.island.js b/algolia-search/dist/islands/algolia-search.island.js index dfd4569..911eec9 100644 --- a/algolia-search/dist/islands/algolia-search.island.js +++ b/algolia-search/dist/islands/algolia-search.island.js @@ -14,7 +14,7 @@ width: 33%; padding-right: 2rem; } -`,Ta=e=>{const{query:t,refine:r}=function(e,t){return He(ua,e,t)}(e),{items:n,refine:i}=Ra({attribute:"basic_page_type",limit:1e3,sortBy:["name:asc"]}),{items:a,refine:s}=Ra({attribute:"shared_tags",limit:1e3,sortBy:["name:asc"]}),c=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=new URLSearchParams(window.location.search);e.delete("key"),e.delete("page-type"),e.delete("shared"),t&&e.set("key",t);const r=n.filter((e=>e.isRefined)).map((e=>e.value)),i=a.filter((e=>e.isRefined)).map((e=>e.value));r.length>=1&&e.set("page-type",r.join(",")),i.length>=1&&e.set("shared",i.join(",")),window.history.replaceState(null,"",`?${e.toString()}`)}),[t,n,a]),Ea("form",{role:"search",onSubmit:e=>{e.preventDefault(),r(c.current.value)},onReset:e=>{c.current.value="",r(""),n.map((e=>{e.isRefined&&i(e.value)})),a.map((e=>{e.isRefined&&s(e.value)}))},children:[Ea("div",{children:[Ea("label",{htmlFor:"keyword-search-algolia",children:["Keywords",Ea("span",{className:"visually-hidden",children:" Search"})]}),Ea("input",{id:"keyword-search-algolia",ref:c,autoComplete:"on",autoCorrect:"on",autoCapitalize:"off",spellCheck:!0,maxLength:128,type:"search",defaultValue:t}),Ea("div",{style:{display:"flex",gap:"1rem",marginTop:"1rem"},children:[Ea("button",{type:"submit",children:"Submit"}),Ea("button",{type:"reset",children:"Clear all"})]})]}),Ea(Fa,{children:[Ea("fieldset",{children:[Ea("legend",{style:{fontSize:"2.4rem"},children:"Filter by Access & Affiliation"}),Ea("ul",{style:{listStyle:"none",paddingLeft:"0",marginInline:"0"},children:n.map(((e,t)=>Ea("li",{style:{marginBottom:"0"},children:Ea("label",{style:{marginTop:"0",paddingTop:".6rem",paddingBottom:".6rem",display:"flex",alignItems:"center",fontSize:"2rem"},children:[Ea("input",{type:"checkbox",onChange:()=>i(e.value),checked:e.isRefined,style:{width:"24px",height:"24px",flexShrink:"0"}}),Ea("div",{style:{marginTop:"1px"},children:[e.value," (",e.count,")"]})]})},t)))})]}),Ea("fieldset",{children:[Ea("legend",{style:{fontSize:"2.4rem"},children:"Filter by Discipline"}),Ea("ul",{style:{listStyle:"none",paddingLeft:"0",marginInline:"0"},children:a.map(((e,t)=>Ea("li",{style:{marginBottom:"0"},children:Ea("label",{style:{marginTop:"0",paddingTop:".6rem",paddingBottom:".6rem",display:"flex",alignItems:"center",fontSize:"2rem"},children:[Ea("input",{type:"checkbox",onChange:()=>s(e.value),checked:e.isRefined,style:{width:"24px",height:"24px",flexShrink:"0"}}),Ea("div",{style:{marginTop:"1px"},children:[e.value," (",e.count,")"]})]})},"shared-i")))})]})]})]})};function Aa(){for(var e=arguments.length,t=new Array(e),r=0;r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var Ca=["parts","highlightedTagName","nonHighlightedTagName","separator","className","classNames"];var ka,Da,Ha,La,$a=(ka={createElement:o.createElement,Fragment:o.Fragment},Da=ka.createElement,Ha=ka.Fragment,La=function(e){var t=e.createElement;return function(e){var r=e.classNames,n=e.children,i=e.highlightedTagName,o=e.isHighlighted,a=e.nonHighlightedTagName;return t(o?i:a,{className:o?r.highlighted:r.nonHighlighted},n)}}({createElement:Da,Fragment:Ha}),function(e){var t=e.parts,r=e.highlightedTagName,n=void 0===r?"mark":r,i=e.nonHighlightedTagName,o=void 0===i?"span":i,a=e.separator,s=void 0===a?", ":a,c=e.className,u=e.classNames,l=void 0===u?{}:u,f=Ia(e,Ca);return Da("span",Na({},f,{className:Aa(l.root,c)}),t.map((function(e,r){var i=r===t.length-1;return Da(Ha,{key:r},e.map((function(e,t){return Da(La,{key:t,classNames:l,highlightedTagName:n,nonHighlightedTagName:o,isHighlighted:e.isHighlighted},e.value)})),!i&&Da("span",{className:l.separator},s))})))}),Ua=["classNames"];function Qa(){return Qa=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Ma(e){var t=e.classNames,r=void 0===t?{}:t,n=Wa(e,Ua);return o.default.createElement($a,Qa({classNames:{root:Aa("ais-Highlight",r.root),highlighted:Aa("ais-Highlight-highlighted",r.highlighted),nonHighlighted:Aa("ais-Highlight-nonHighlighted",r.nonHighlighted),separator:Aa("ais-Highlight-separator",r.separator)}},n))}var qa=["hit","attribute","highlightedTagName","nonHighlightedTagName","separator"];function Va(){return Va=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function za(e){var t=e.hit,r=e.attribute,n=e.highlightedTagName,i=e.nonHighlightedTagName,a=e.separator,s=Ba(e,qa),c=tr(t._highlightResult,r)||[],u=(Array.isArray(c)?c:[c]).map((function(e){return fr(I(e.value||""))}));return o.default.createElement(Ma,Va({},s,{parts:u,highlightedTagName:n,nonHighlightedTagName:i,separator:a}))}var Ga=["classNames"];function Ja(){return Ja=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Ka(e){var t=e.classNames,r=void 0===t?{}:t,n=Xa(e,Ga);return o.default.createElement($a,Ja({classNames:{root:Aa("ais-Snippet",r.root),highlighted:Aa("ais-Snippet-highlighted",r.highlighted),nonHighlighted:Aa("ais-Snippet-nonHighlighted",r.nonHighlighted),separator:Aa("ais-Snippet-separator",r.separator)}},n))}var Ya=["hit","attribute","highlightedTagName","nonHighlightedTagName","separator"];function Za(){return Za=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function ts(e){var t=e.hit,r=e.attribute,n=e.highlightedTagName,i=e.nonHighlightedTagName,a=e.separator,s=es(e,Ya),c=tr(t._snippetResult,r)||[],u=(Array.isArray(c)?c:[c]).map((function(e){return fr(I(e.value||""))}));return o.default.createElement(Ka,Za({},s,{parts:u,highlightedTagName:n,nonHighlightedTagName:i,separator:a}))}const rs=ra.article` +`,Ta=e=>{const{query:t,refine:r}=function(e,t){return He(ua,e,t)}(e),{items:n,refine:i}=Ra({attribute:"basic_page_type",limit:1e3}),{items:a,refine:s}=Ra({attribute:"shared_tags",limit:1e3,sortBy:["name:asc"]}),c=(0,o.useRef)(null);return(0,o.useEffect)((()=>{const e=new URLSearchParams(window.location.search);e.delete("key"),e.delete("page-type"),e.delete("shared"),t&&e.set("key",t);const r=n.filter((e=>e.isRefined)).map((e=>e.value)),i=a.filter((e=>e.isRefined)).map((e=>e.value));r.length>=1&&e.set("page-type",r.join(",")),i.length>=1&&e.set("shared",i.join(",")),window.history.replaceState(null,"",`?${e.toString()}`)}),[t,n,a]),Ea("form",{role:"search",onSubmit:e=>{e.preventDefault(),r(c.current.value)},onReset:e=>{c.current.value="",r(""),n.map((e=>{e.isRefined&&i(e.value)})),a.map((e=>{e.isRefined&&s(e.value)}))},children:[Ea("div",{children:[Ea("label",{htmlFor:"keyword-search-algolia",children:["Keywords",Ea("span",{className:"visually-hidden",children:" Search"})]}),Ea("input",{id:"keyword-search-algolia",ref:c,autoComplete:"on",autoCorrect:"on",autoCapitalize:"off",spellCheck:!0,maxLength:128,type:"search",defaultValue:t}),Ea("div",{style:{display:"flex",gap:"1rem",marginTop:"1rem"},children:[Ea("button",{type:"submit",children:"Submit"}),Ea("button",{type:"reset",children:"Clear all"})]})]}),Ea(Fa,{children:[Ea("fieldset",{children:[Ea("legend",{style:{fontSize:"2.4rem"},children:"Filter by Access & Affiliation"}),Ea("ul",{style:{listStyle:"none",paddingLeft:"0",marginInline:"0"},children:n.map(((e,t)=>Ea("li",{style:{marginBottom:"0"},children:Ea("label",{style:{marginTop:"0",paddingTop:".6rem",paddingBottom:".6rem",display:"flex",alignItems:"center",fontSize:"2rem"},children:[Ea("input",{type:"checkbox",onChange:()=>i(e.value),checked:e.isRefined,style:{width:"24px",height:"24px",flexShrink:"0"}}),Ea("div",{style:{marginTop:"1px"},children:[e.value," (",e.count,")"]})]})},t)))})]}),Ea("fieldset",{children:[Ea("legend",{style:{fontSize:"2.4rem"},children:"Filter by Discipline"}),Ea("ul",{style:{listStyle:"none",paddingLeft:"0",marginInline:"0"},children:a.map(((e,t)=>Ea("li",{style:{marginBottom:"0"},children:Ea("label",{style:{marginTop:"0",paddingTop:".6rem",paddingBottom:".6rem",display:"flex",alignItems:"center",fontSize:"2rem"},children:[Ea("input",{type:"checkbox",onChange:()=>s(e.value),checked:e.isRefined,style:{width:"24px",height:"24px",flexShrink:"0"}}),Ea("div",{style:{marginTop:"1px"},children:[e.value," (",e.count,")"]})]})},"shared-i")))})]})]})]})};function Aa(){for(var e=arguments.length,t=new Array(e),r=0;r=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var Ca=["parts","highlightedTagName","nonHighlightedTagName","separator","className","classNames"];var ka,Da,Ha,La,$a=(ka={createElement:o.createElement,Fragment:o.Fragment},Da=ka.createElement,Ha=ka.Fragment,La=function(e){var t=e.createElement;return function(e){var r=e.classNames,n=e.children,i=e.highlightedTagName,o=e.isHighlighted,a=e.nonHighlightedTagName;return t(o?i:a,{className:o?r.highlighted:r.nonHighlighted},n)}}({createElement:Da,Fragment:Ha}),function(e){var t=e.parts,r=e.highlightedTagName,n=void 0===r?"mark":r,i=e.nonHighlightedTagName,o=void 0===i?"span":i,a=e.separator,s=void 0===a?", ":a,c=e.className,u=e.classNames,l=void 0===u?{}:u,f=Ia(e,Ca);return Da("span",Na({},f,{className:Aa(l.root,c)}),t.map((function(e,r){var i=r===t.length-1;return Da(Ha,{key:r},e.map((function(e,t){return Da(La,{key:t,classNames:l,highlightedTagName:n,nonHighlightedTagName:o,isHighlighted:e.isHighlighted},e.value)})),!i&&Da("span",{className:l.separator},s))})))}),Ua=["classNames"];function Qa(){return Qa=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Ma(e){var t=e.classNames,r=void 0===t?{}:t,n=Wa(e,Ua);return o.default.createElement($a,Qa({classNames:{root:Aa("ais-Highlight",r.root),highlighted:Aa("ais-Highlight-highlighted",r.highlighted),nonHighlighted:Aa("ais-Highlight-nonHighlighted",r.nonHighlighted),separator:Aa("ais-Highlight-separator",r.separator)}},n))}var qa=["hit","attribute","highlightedTagName","nonHighlightedTagName","separator"];function Va(){return Va=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function za(e){var t=e.hit,r=e.attribute,n=e.highlightedTagName,i=e.nonHighlightedTagName,a=e.separator,s=Ba(e,qa),c=tr(t._highlightResult,r)||[],u=(Array.isArray(c)?c:[c]).map((function(e){return fr(I(e.value||""))}));return o.default.createElement(Ma,Va({},s,{parts:u,highlightedTagName:n,nonHighlightedTagName:i,separator:a}))}var Ga=["classNames"];function Ja(){return Ja=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Ka(e){var t=e.classNames,r=void 0===t?{}:t,n=Xa(e,Ga);return o.default.createElement($a,Ja({classNames:{root:Aa("ais-Snippet",r.root),highlighted:Aa("ais-Snippet-highlighted",r.highlighted),nonHighlighted:Aa("ais-Snippet-nonHighlighted",r.nonHighlighted),separator:Aa("ais-Snippet-separator",r.separator)}},n))}var Ya=["hit","attribute","highlightedTagName","nonHighlightedTagName","separator"];function Za(){return Za=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function ts(e){var t=e.hit,r=e.attribute,n=e.highlightedTagName,i=e.nonHighlightedTagName,a=e.separator,s=es(e,Ya),c=tr(t._snippetResult,r)||[],u=(Array.isArray(c)?c:[c]).map((function(e){return fr(I(e.value||""))}));return o.default.createElement(Ka,Za({},s,{parts:u,highlightedTagName:n,nonHighlightedTagName:i,separator:a}))}const rs=ra.article` display: flex; flex-direction: column; justify-content: space-between; @@ -22,7 +22,7 @@ padding: 2rem 2rem 2rem 0; margin-bottom: 2rem; - @media (min-width: 768px) { + @media (min-width: 992px) { flex-direction: row; } diff --git a/algolia-search/src/hits/default-hit.tsx b/algolia-search/src/hits/default-hit.tsx index b0a8571..eba2e62 100644 --- a/algolia-search/src/hits/default-hit.tsx +++ b/algolia-search/src/hits/default-hit.tsx @@ -9,7 +9,7 @@ const HitContainer = styled.article` padding: 2rem 2rem 2rem 0; margin-bottom: 2rem; - @media (min-width: 768px) { + @media (min-width: 992px) { flex-direction: row; } diff --git a/algolia-search/src/search-form.tsx b/algolia-search/src/search-form.tsx index a542054..2c83c24 100644 --- a/algolia-search/src/search-form.tsx +++ b/algolia-search/src/search-form.tsx @@ -30,7 +30,6 @@ const SearchForm = (props) => { const {items: pageTypeRefinements, refine: refinePageTypes} = useRefinementList({ attribute: "basic_page_type", limit: 1000, - sortBy: ["name:asc"] }); const {items: sharedRefinements, refine: refineSharedTypes} = useRefinementList({ attribute: "shared_tags", From 9ad2ede29e0850e865d67c8119d2f7024c57e8d4 Mon Sep 17 00:00:00 2001 From: jdwjdwjdw Date: Wed, 15 May 2024 20:50:34 +0000 Subject: [PATCH 2/3] Update README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b9b0adc..4b003af 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # [c-ShARP Subtheme](https://github.com/SU-SWS/c_ShARP_subtheme) -##### Version: 1.0.0 +##### Version: 1.0.1 Changelog: [Changelog.txt](CHANGELOG.txt) @@ -15,6 +15,7 @@ The c-ShARP Subtheme is a Stanford sub-theme that works with the Stanford Basic - Roboto font addition - Transparent overlay banner variant - Updated local footer +- Algolia search for shared facilities with filter by basic_page_type (Access & Affiliation) and shared_tags (Discipline) facets Documentation --- From ea10c8a4754e5a1733eefaf976c1bb23ff3df4e9 Mon Sep 17 00:00:00 2001 From: jdwjdwjdw Date: Wed, 15 May 2024 21:10:51 +0000 Subject: [PATCH 3/3] Version number fixup --- c_sharp_subtheme.info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c_sharp_subtheme.info.yml b/c_sharp_subtheme.info.yml index 4f58537..efc9ab5 100755 --- a/c_sharp_subtheme.info.yml +++ b/c_sharp_subtheme.info.yml @@ -2,7 +2,7 @@ name: c-ShARP Subtheme type: theme description: 'c-ShARP Subtheme.' package: Stanford -version: 1.1.0 +version: 1.0.1 core_version_requirement: ^9 || ^10 base theme: stanford_basic libraries: