From 44478234e4573f9d8796ed2a4afbc17290d0601a Mon Sep 17 00:00:00 2001 From: Ryan Clayton Date: Wed, 28 Aug 2024 16:21:19 -0600 Subject: [PATCH 1/5] Update config.json Add Localize v2 option to sidekick. Resolves: MWPW-156697 --- tools/sidekick/config.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/sidekick/config.json b/tools/sidekick/config.json index 2e6cf46b..6dc7bdc6 100644 --- a/tools/sidekick/config.json +++ b/tools/sidekick/config.json @@ -32,6 +32,16 @@ "excludePaths": [ "/**" ], "includePaths": [ "**/:x**" ] }, + { + "containerId": "tools", + "id": "localize-2", + "title": "Localize project (V2)", + "environments": [ "edit" ], + "url": "https://main--ecc-milo--adobecom.hlx.page/tools/loc?milolibs=locui", + "passReferrer": true, + "passConfig": true, + "includePaths": [ "**.xlsx**" ] + }, { "containerId": "tools", "title": "Check Schema", From 567389d024515595f8fe86df9d5bd871b78010ce Mon Sep 17 00:00:00 2001 From: Qiyun Dai Date: Thu, 29 Aug 2024 11:06:37 -0500 Subject: [PATCH 2/5] Dashboard no search result screen (#191) --- ecc/blocks/ecc-dashboard/ecc-dashboard.css | 5 ++++ ecc/blocks/ecc-dashboard/ecc-dashboard.js | 30 +++++++++++++++++----- 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ecc/blocks/ecc-dashboard/ecc-dashboard.css b/ecc/blocks/ecc-dashboard/ecc-dashboard.css index ed7f14d3..e88b5db9 100644 --- a/ecc/blocks/ecc-dashboard/ecc-dashboard.css +++ b/ecc/blocks/ecc-dashboard/ecc-dashboard.css @@ -196,6 +196,11 @@ transition: background-color 1s; } +.ecc-dashboard table .no-search-results-row td { + padding: 40px 0; + text-align: center; +} + .ecc-dashboard table .event-row.highlight { background-color: #EAEAEA; } diff --git a/ecc/blocks/ecc-dashboard/ecc-dashboard.js b/ecc/blocks/ecc-dashboard/ecc-dashboard.js index d2a70d6b..c15d8bef 100644 --- a/ecc/blocks/ecc-dashboard/ecc-dashboard.js +++ b/ecc/blocks/ecc-dashboard/ecc-dashboard.js @@ -498,6 +498,8 @@ function updatePaginationControl(pagination, currentPage, totalPages) { } function decoratePagination(props, config) { + if (!props.filteredData.length) return; + const totalPages = Math.ceil(props.filteredData.length / +config['page-size']); const paginationContainer = createTag('div', { class: 'pagination-container' }); const chevLeft = getIcon('chev-left'); @@ -565,6 +567,8 @@ function initSorting(props, config) { th.append(getIcon('chev-down'), getIcon('chev-up')); th.classList.add('sortable', key); th.addEventListener('click', () => { + if (!props.filteredData.length) return; + thead.querySelectorAll('th').forEach((h) => { if (th !== h) { h.classList.remove('active'); @@ -580,18 +584,31 @@ function initSorting(props, config) { }); } +function buildNoSearchResultsScreen(el, config) { + const noSearchResultsRow = createTag('tr', { class: 'no-search-results-row' }); + const noSearchResultsCol = createTag('td', { colspan: '100%' }, getIcon('empty-dashboard'), { parent: noSearchResultsRow }); + createTag('h2', {}, config['no-search-results-heading'], { parent: noSearchResultsCol }); + createTag('p', {}, config['no-search-results-text'], { parent: noSearchResultsCol }); + + el.append(noSearchResultsRow); +} + function populateTable(props, config) { const tBody = props.el.querySelector('table.dashboard-table tbody'); tBody.innerHTML = ''; - const endOfPage = Math.min(+config['page-size'], props.paginatedData.length); + if (!props.paginatedData.length) { + buildNoSearchResultsScreen(tBody, config); + } else { + const endOfPage = Math.min(+config['page-size'], props.paginatedData.length); - for (let i = 0; i < endOfPage; i += 1) { - populateRow(props, config, i); - } + for (let i = 0; i < endOfPage; i += 1) { + populateRow(props, config, i); + } - props.el.querySelector('.pagination-container')?.remove(); - decoratePagination(props, config); + props.el.querySelector('.pagination-container')?.remove(); + decoratePagination(props, config); + } } function filterData(props, config, query) { @@ -685,6 +702,7 @@ async function buildDashboard(el, config) { set(target, prop, value, receiver) { target[prop] = value; populateTable(receiver, config); + return true; }, }; From 6a7bac778895dea04a14a62716f6cd4944d48ad9 Mon Sep 17 00:00:00 2001 From: Qiyun Dai Date: Thu, 29 Aug 2024 11:06:54 -0500 Subject: [PATCH 3/5] Update registration-details-component-controller.js (#193) --- .../controllers/registration-details-component-controller.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ecc/blocks/form-handler/controllers/registration-details-component-controller.js b/ecc/blocks/form-handler/controllers/registration-details-component-controller.js index 39f11415..fbfb5f7c 100644 --- a/ecc/blocks/form-handler/controllers/registration-details-component-controller.js +++ b/ecc/blocks/form-handler/controllers/registration-details-component-controller.js @@ -62,7 +62,6 @@ export async function onUpdate(component, props) { if (!props.eventDataResp) return; if (props.eventDataResp.cloudType === 'CreativeCloud') { - component.querySelector('.attendee-count-wrapper')?.classList.add('hidden'); component.querySelector('#registration-allow-waitlist')?.classList.add('hidden'); } From ec87ce4b90e8c6f8258ae8fb184ffc89cb000515 Mon Sep 17 00:00:00 2001 From: Qiyun Dai Date: Thu, 29 Aug 2024 13:13:10 -0500 Subject: [PATCH 4/5] removing alt-text generation for decorative images (#197) --- .../controllers/img-upload-component-controller.js | 3 +-- ecc/components/partner-selector/partner-selector.js | 2 +- ecc/components/profile/profile.js | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ecc/blocks/form-handler/controllers/img-upload-component-controller.js b/ecc/blocks/form-handler/controllers/img-upload-component-controller.js index 52f4386a..67abd21a 100644 --- a/ecc/blocks/form-handler/controllers/img-upload-component-controller.js +++ b/ecc/blocks/form-handler/controllers/img-upload-component-controller.js @@ -32,7 +32,6 @@ function updateImgUploadComponentConfigs(component) { const configs = { type, - altText: `Event ${component.classList[1]} image`, targetUrl: `/v1/events/${getFilteredCachedResponse().eventId}/images`, }; @@ -107,7 +106,7 @@ export default async function init(component, props) { dialog.innerHTML = ''; - createTag('h1', { slot: 'heading' }, `You are deleting the ${configs.altText.toLowerCase()}.`, { parent: dialog }); + createTag('h1', { slot: 'heading' }, 'You are deleting this image.', { parent: dialog }); createTag('p', {}, 'Are you sure you want to do this? This cannot be undone.', { parent: dialog }); const buttonContainer = createTag('div', { class: 'button-container' }, '', { parent: dialog }); const dialogDeleteBtn = createTag('sp-button', { variant: 'secondary', slot: 'button' }, 'Yes, I want to delete this image', { parent: buttonContainer }); diff --git a/ecc/components/partner-selector/partner-selector.js b/ecc/components/partner-selector/partner-selector.js index 9d602aee..fe1227bf 100644 --- a/ecc/components/partner-selector/partner-selector.js +++ b/ecc/components/partner-selector/partner-selector.js @@ -90,7 +90,7 @@ export default class PartnerSelector extends LitElement { const sponsorData = await uploadImage(file, { targetUrl: `/v1/series/${this.seriesId}/sponsors/${this.partner.sponsorId}/images`, type: 'sponsor-image', - altText: `${this.partner.name} image`, + altText: `${this.partner.name}`, }, null, respJson.image?.imageId); if (sponsorData) { diff --git a/ecc/components/profile/profile.js b/ecc/components/profile/profile.js index c249f3ce..ffdbe133 100644 --- a/ecc/components/profile/profile.js +++ b/ecc/components/profile/profile.js @@ -126,7 +126,6 @@ export class Profile extends LitElement { { targetUrl: `/v1/series/${this.seriesId}/speakers/${profile.speakerId}/images`, type: 'speaker-photo', - altText: `${this.profile.firstName} ${this.profile.lastName} photo`, }, null, lastPhoto?.imageId, From e1442b324d427989792dfe1df96df395242bdd71 Mon Sep 17 00:00:00 2001 From: Qiyun Dai Date: Thu, 29 Aug 2024 15:46:47 -0500 Subject: [PATCH 5/5] remove community and host email input value on uncheck (#198) --- .../controllers/event-community-link-component-controller.js | 1 + .../controllers/registration-details-component-controller.js | 1 + 2 files changed, 2 insertions(+) diff --git a/ecc/blocks/form-handler/controllers/event-community-link-component-controller.js b/ecc/blocks/form-handler/controllers/event-community-link-component-controller.js index 46490744..01d23a82 100644 --- a/ecc/blocks/form-handler/controllers/event-community-link-component-controller.js +++ b/ecc/blocks/form-handler/controllers/event-community-link-component-controller.js @@ -33,6 +33,7 @@ export default function init(component, props) { const updateInputState = () => { input.required = checkbox.checked; + if (!checkbox.checked) input.value = ''; }; if (checkbox && input) { diff --git a/ecc/blocks/form-handler/controllers/registration-details-component-controller.js b/ecc/blocks/form-handler/controllers/registration-details-component-controller.js index fbfb5f7c..be41f423 100644 --- a/ecc/blocks/form-handler/controllers/registration-details-component-controller.js +++ b/ecc/blocks/form-handler/controllers/registration-details-component-controller.js @@ -33,6 +33,7 @@ function prefillFields(component, props) { contactHostEl.addEventListener('change', () => { hostEmailEl.disabled = !contactHostEl.checked; + if (!contactHostEl.checked) hostEmailEl.value = ''; }); } }