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

[Release] Stage to Main #3102

Merged
merged 9 commits into from
Oct 30, 2024
6 changes: 3 additions & 3 deletions libs/blocks/bulk-publish-v2/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const setUserData = (event) => {

const isPushedDown = async () => {
const callback = () => {
const sidekick = document.querySelector('helix-sidekick');
const sidekick = document.querySelector('aem-sidekick, helix-sidekick');
const pushdown = sidekick?.getAttribute('pushdown');
const bulkPub = document.querySelector('.bulk-publish-v2');
if (pushdown && !bulkPub.classList.contains('pushdown')) {
Expand All @@ -81,13 +81,13 @@ const isPushedDown = async () => {
const authenticate = async (tool = null) => {
isPushedDown();
const setUser = (event) => { tool.user = setUserData(event); };
const openSideKick = document.querySelector('helix-sidekick');
const openSideKick = document.querySelector('aem-sidekick, helix-sidekick');
if (openSideKick) {
openSideKick.addEventListener('statusfetched', setUser);
/* c8 ignore next 6 */
} else {
document.addEventListener('sidekick-ready', () => {
const sidekick = document.querySelector('helix-sidekick');
const sidekick = document.querySelector('aem-sidekick, helix-sidekick');
sidekick.addEventListener('statusfetched', setUser);
}, { once: true });
}
Expand Down
7 changes: 4 additions & 3 deletions libs/blocks/media/media.css
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ div[class*="-up"] .media .foreground > .media-row {
}

.media.qr-code .qr-button-container {
display: inline;
margin-right: var(--spacing-s);
display: inline-block;
margin: 0;
}

.media.qr-code .google-play,
Expand All @@ -179,7 +179,8 @@ div[class*="-up"] .media .foreground > .media-row {
justify-content: center;
padding: 0;
display: inline-flex;
margin: var(--spacing-xs) var(--spacing-s) 0 0;
margin-top: var(--spacing-xs);
margin-inline-end: var(--spacing-s);
}

.media.qr-code .google-play {
Expand Down
5 changes: 5 additions & 0 deletions libs/blocks/media/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ function decorateQr(el) {
const googlePlay = text.children[(text.children.length - 2)]?.querySelector('a');
const qrImage = text.children[(text.children.length - 3)];
if (!qrImage || !appStore || !googlePlay) return;
[appStore, googlePlay].forEach(({ parentElement }) => {
parentElement.classList.add('qr-button-container');
});
qrImage.classList.add('qr-code-img');
appStore.classList.add('app-store');
appStore.textContent = '';
appStore.setAttribute('aria-label', 'Apple App Store');
googlePlay.classList.add('google-play');
googlePlay.textContent = '';
googlePlay.setAttribute('aria-label', 'Google Play Store');
}

export default async function init(el) {
Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/preflight/panels/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async function setContent() {
};

getStatuses();
const sk = document.querySelector('helix-sidekick');
const sk = document.querySelector('aem-sidekick, helix-sidekick');
sk?.addEventListener('statusfetched', async () => {
getStatuses();
});
Expand Down
2 changes: 1 addition & 1 deletion libs/blocks/preflight/panels/seo.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ async function getResults() {

const red = icons.find((icon) => icon === 'red');
if (red) {
const sk = document.querySelector('helix-sidekick');
const sk = document.querySelector('aem-sidekick, helix-sidekick');
if (sk) {
const publishBtn = sk.shadowRoot.querySelector('div.publish.plugin button');
publishBtn.addEventListener('click', () => {
Expand Down
225 changes: 140 additions & 85 deletions libs/deps/mas/mas.js
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Axelcureno @3ch023 @npeltier @yesil could one of you look into ignoring some of the MAS files that get flagged by the linter consistently? It spams the PRs quite a lot and doesn't provide any value if we can't fix it to begin with

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions libs/deps/mas/merch-card-collection.js
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] reported by reviewdog 🐶
File ignored because of a matching ignore pattern. Use "--no-ignore" to override.

Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ import{html as l,LitElement as N}from"../lit-all.min.js";var m=class{constructor
justify-content: end;
}
}
`;var u=(r,e)=>r.querySelector(`[slot="${e}"]`).textContent.trim();var M="merch-card-collection",n={alphabetical:"alphabetical",authored:"authored"},O={filters:["noResultText","resultText","resultsText"],mobile:["noSearchResultsMobileText","searchResultMobileText","searchResultsMobileText"],desktop:["noSearchResultsText","searchResultText","searchResultsText"]},L=(r,{filter:e})=>r.filter(t=>t.filters.hasOwnProperty(e)),v=(r,{types:e})=>e?(e=e.split(","),r.filter(t=>e.some(o=>t.types.includes(o)))):r,D=r=>r.sort((e,t)=>(e.title??"").localeCompare(t.title??"","en",{sensitivity:"base"})),H=(r,{filter:e})=>r.sort((t,o)=>o.filters[e]?.order==null||isNaN(o.filters[e]?.order)?-1:t.filters[e]?.order==null||isNaN(t.filters[e]?.order)?1:t.filters[e].order-o.filters[e].order),B=(r,{search:e})=>e?.length?(e=e.toLowerCase(),r.filter(t=>(t.title??"").toLowerCase().includes(e))):r,E=class extends N{static properties={filter:{type:String,attribute:"filter",reflect:!0},filtered:{type:String,attribute:"filtered"},search:{type:String,attribute:"search",reflect:!0},sort:{type:String,attribute:"sort",default:n.authored,reflect:!0},types:{type:String,attribute:"types",reflect:!0},limit:{type:Number,attribute:"limit"},page:{type:Number,attribute:"page",reflect:!0},singleApp:{type:String,attribute:"single-app",reflect:!0},hasMore:{type:Boolean},displayResult:{type:Boolean,attribute:"display-result"},resultCount:{type:Number},sidenav:{type:Object}};mobileAndTablet=new m(this,_);constructor(){super(),this.filter="all",this.hasMore=!1,this.resultCount=void 0,this.displayResult=!1}render(){return l`${this.header}
`;var d=(r,e)=>r.querySelector(`[slot="${e}"]`).textContent.trim();var M="merch-card-collection",n={alphabetical:"alphabetical",authored:"authored"},O={filters:["noResultText","resultText","resultsText"],mobile:["noSearchResultsMobileText","searchResultMobileText","searchResultsMobileText"],desktop:["noSearchResultsText","searchResultText","searchResultsText"]},v=(r,{filter:e})=>r.filter(t=>t.filters.hasOwnProperty(e)),L=(r,{types:e})=>e?(e=e.split(","),r.filter(t=>e.some(o=>t.types.includes(o)))):r,D=r=>r.sort((e,t)=>(e.title??"").localeCompare(t.title??"","en",{sensitivity:"base"})),H=(r,{filter:e})=>r.sort((t,o)=>o.filters[e]?.order==null||isNaN(o.filters[e]?.order)?-1:t.filters[e]?.order==null||isNaN(t.filters[e]?.order)?1:t.filters[e].order-o.filters[e].order),B=(r,{search:e})=>e?.length?(e=e.toLowerCase(),r.filter(t=>(t.title??"").toLowerCase().includes(e))):r,E=class extends N{static properties={filter:{type:String,attribute:"filter",reflect:!0},filtered:{type:String,attribute:"filtered"},search:{type:String,attribute:"search",reflect:!0},sort:{type:String,attribute:"sort",default:n.authored,reflect:!0},types:{type:String,attribute:"types",reflect:!0},limit:{type:Number,attribute:"limit"},page:{type:Number,attribute:"page",reflect:!0},singleApp:{type:String,attribute:"single-app",reflect:!0},hasMore:{type:Boolean},displayResult:{type:Boolean,attribute:"display-result"},resultCount:{type:Number},sidenav:{type:Object}};mobileAndTablet=new m(this,_);constructor(){super(),this.filter="all",this.hasMore=!1,this.resultCount=void 0,this.displayResult=!1}render(){return l`${this.header}
<slot></slot>
${this.footer}`}updated(e){if(!this.querySelector("merch-card"))return;let t=window.scrollY||document.documentElement.scrollTop,o=[...this.children].filter(s=>s.tagName==="MERCH-CARD");if(o.length===0)return;e.has("singleApp")&&this.singleApp&&o.forEach(s=>{s.updateFilters(s.name===this.singleApp)});let i=this.sort===n.alphabetical?D:H,h=[L,v,B,i].reduce((s,a)=>a(s,this),o).map((s,a)=>[s,a]);if(this.resultCount=h.length,this.page&&this.limit){let s=this.page*this.limit;this.hasMore=h.length>s,h=h.filter(([,a])=>a<s)}let d=new Map(h);o.forEach(s=>{if(d.has(s)){let a=d.get(s);s.style.order=a,s.setAttribute("tabindex",a+1),s.size=s.filters[this.filter]?.size,s.style.removeProperty("display"),s.requestUpdate()}else s.style.display="none",s.size=void 0,s.style.removeProperty("order")}),window.scrollTo(0,t),this.updateComplete.then(()=>{let s=this.shadowRoot.getElementById("resultText")?.firstElementChild?.assignedElements?.()?.[0];s&&C(s,{resultCount:this.resultCount,searchTerm:this.search,filter:this.sidenav?.filters.selectedText})})}connectedCallback(){super.connectedCallback(),this.filtered?(this.filter=this.filtered,this.page=1):this.startDeeplink(),this.sidenav=document.querySelector("merch-sidenav")}disconnectedCallback(){super.disconnectedCallback(),this.stopDeeplink?.()}get header(){if(!this.filtered)return l`<div id="header">
${this.footer}`}updated(e){if(!this.querySelector("merch-card"))return;let t=window.scrollY||document.documentElement.scrollTop,o=[...this.children].filter(s=>s.tagName==="MERCH-CARD");if(o.length===0)return;e.has("singleApp")&&this.singleApp&&o.forEach(s=>{s.updateFilters(s.name===this.singleApp)});let i=this.sort===n.alphabetical?D:H,h=[v,L,B,i].reduce((s,a)=>a(s,this),o).map((s,a)=>[s,a]);if(this.resultCount=h.length,this.page&&this.limit){let s=this.page*this.limit;this.hasMore=h.length>s,h=h.filter(([,a])=>a<s)}let u=new Map(h);o.forEach(s=>{if(u.has(s)){let a=u.get(s);s.style.order=a,s.setAttribute("tabindex",a+1),s.size=s.filters[this.filter]?.size,s.style.removeProperty("display"),s.requestUpdate()}else s.style.display="none",s.size=void 0,s.style.removeProperty("order")}),window.scrollTo(0,t),this.updateComplete.then(()=>{let s=this.shadowRoot.getElementById("resultText")?.firstElementChild?.assignedElements?.()?.[0];s&&C(s,{resultCount:this.resultCount,searchTerm:this.search,filter:this.sidenav?.filters.selectedText})})}connectedCallback(){super.connectedCallback(),this.filtered?(this.filter=this.filtered,this.page=1):this.startDeeplink(),this.sidenav=document.querySelector("merch-sidenav")}disconnectedCallback(){super.disconnectedCallback(),this.stopDeeplink?.()}get header(){if(!this.filtered)return l`<div id="header">
<sp-theme theme="spectrum" color="light" scale="medium">
${this.searchBar} ${this.filtersButton} ${this.sortButton}
</sp-theme>
Expand All @@ -122,13 +122,13 @@ import{html as l,LitElement as N}from"../lit-all.min.js";var m=class{constructor
treatment="outline"
@click="${this.openFilters}"
><slot name="filtersText"></slot
></sp-action-button>`:""}get searchBar(){let e=u(this,"searchText");return this.mobileAndTablet.matches?l`<merch-search deeplink="search">
></sp-action-button>`:""}get searchBar(){let e=d(this,"searchText");return this.mobileAndTablet.matches?l`<merch-search deeplink="search">
<sp-search
id="searchBar"
@submit="${this.searchSubmit}"
placeholder="${e}"
></sp-search>
</merch-search>`:""}get sortButton(){let e=u(this,"sortText"),t=u(this,"popularityText"),o=u(this,"alphabeticallyText");if(!(e&&t&&o))return;let i=this.sort===n.alphabetical;return l`
</merch-search>`:""}get sortButton(){let e=d(this,"sortText"),t=d(this,"popularityText"),o=d(this,"alphabeticallyText");if(!(e&&t&&o))return;let i=this.sort===n.alphabetical;return l`
<sp-action-menu
id="sortButton"
size="m"
Expand All @@ -147,4 +147,4 @@ import{html as l,LitElement as N}from"../lit-all.min.js";var m=class{constructor
>${o}</sp-menu-item
>
</sp-action-menu>
`}sortChanged(e){e.target.value===n.authored?p({sort:void 0}):p({sort:e.target.value}),this.dispatchEvent(new CustomEvent(x,{bubbles:!0,composed:!0,detail:{value:e.target.value}}))}async showMore(){this.dispatchEvent(new CustomEvent(g,{bubbles:!0,composed:!0}));let e=this.page+1;p({page:e}),this.page=e,await this.updateComplete}startDeeplink(){this.stopDeeplink=T(({category:e,filter:t,types:o,sort:i,search:c,single_app:h,page:d})=>{t=t||e,!this.filtered&&t&&t!==this.filter&&setTimeout(()=>{p({page:void 0}),this.page=1},1),this.filtered||(this.filter=t??this.filter),this.types=o??"",this.search=c??"",this.singleApp=h,this.sort=i,this.page=Number(d)||1})}openFilters(e){this.sidenav?.showModal(e)}static styles=[R]};E.SortOrder=n;customElements.define(M,E);export{E as MerchCardCollection};
`}sortChanged(e){e.target.value===n.authored?p({sort:void 0}):p({sort:e.target.value}),this.dispatchEvent(new CustomEvent(x,{bubbles:!0,composed:!0,detail:{value:e.target.value}}))}async showMore(){this.dispatchEvent(new CustomEvent(g,{bubbles:!0,composed:!0}));let e=this.page+1;p({page:e}),this.page=e,await this.updateComplete}startDeeplink(){this.stopDeeplink=T(({category:e,filter:t,types:o,sort:i,search:c,single_app:h,page:u})=>{t=t||e,!this.filtered&&t&&t!==this.filter&&setTimeout(()=>{p({page:void 0}),this.page=1},1),this.filtered||(this.filter=t??this.filter),this.types=o??"",this.search=c??"",this.singleApp=h,this.sort=i,this.page=Number(u)||1})}openFilters(e){this.sidenav?.showModal(e)}static styles=[R]};E.SortOrder=n;customElements.define(M,E);export{E as MerchCardCollection};
Loading
Loading