Skip to content

Commit

Permalink
Merge pull request #337 from adobecom/stage
Browse files Browse the repository at this point in the history
Stage -> Main 22nd Jan 2025
  • Loading branch information
qiyundai authored Jan 22, 2025
2 parents 4afb818 + 1fe53c9 commit 877e79d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@
justify-content: flex-end;
}

.attendee-management-table.no-results .dashboard-actions-container {
visibility: hidden;
}

.attendee-management-table .dashboard-actions-container .search-input-wrapper {
position: relative;
}
Expand Down
38 changes: 27 additions & 11 deletions ecc/blocks/attendee-management-table/attendee-management-table.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable max-len */
import { getAllEventAttendees, getEventsForUser } from '../../scripts/esp-controller.js';
import { getAllEventAttendees, getEventImages, getEventsForUser } from '../../scripts/esp-controller.js';
import { LIBS } from '../../scripts/scripts.js';
import {
getIcon,
Expand Down Expand Up @@ -421,23 +421,39 @@ function calculatePercentage(part, total) {
return `${percentage.toFixed(2)}%`;
}

function buildEventInfo(props) {
async function buildEventInfo(props) {
const eventInfoContainer = props.el.querySelector('.dashboard-header-event-info');
if (!eventInfoContainer) return;

eventInfoContainer.innerHTML = '';
const eventInfo = props.events.find((e) => e.eventId === props.currentEventId);

if (!eventInfo) return;
const heroImgObj = eventInfo.photos?.find((p) => p.imageKind === 'event-hero-image');

// build event image
createTag(
'div',
{ class: 'event-image-container' },
createTag('img', { class: 'event-image', src: heroImgObj ? heroImgObj.sharepointUrl || heroImgObj.imageUrl : '' }),
{ parent: eventInfoContainer },
);

const { photos } = eventInfo;

if (!photos) {
getEventImages(eventInfo.eventId).then(({ images }) => {
if (!images) return;

const heroImgObj = images?.find((p) => p.imageKind === 'event-hero-image');

const eventImage = createTag(
'div',
{ class: 'event-image-container' },
createTag('img', { class: 'event-image', src: heroImgObj ? heroImgObj.sharepointUrl || heroImgObj.imageUrl : '' }),
);

eventInfoContainer.prepend(eventImage);
});
} else {
const heroImgObj = photos?.find((p) => p.imageKind === 'event-hero-image');
createTag(
'div',
{ class: 'event-image-container' },
createTag('img', { class: 'event-image', src: heroImgObj ? heroImgObj.sharepointUrl || heroImgObj.imageUrl : '' }),
);
}

const infoContainer = createTag('div', { class: 'event-info-container' }, '', { parent: eventInfoContainer });
const infoRow = createTag('div', { class: 'event-info-row' }, '', { parent: infoContainer });
Expand Down
10 changes: 9 additions & 1 deletion ecc/blocks/form-handler/form-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,15 @@ function updateCtas(props) {
if (a.classList.contains('preview-btns')) {
const testTime = a.classList.contains('pre-event') ? +props.eventDataResp.localEndTimeMillis - 10 : +props.eventDataResp.localEndTimeMillis + 10;
if (eventDataResp.detailPagePath) {
a.href = `${eventDataResp.detailPagePath}?previewMode=true&cachebuster=${Date.now()}&timing=${testTime}`;
let previewUrl;

try {
previewUrl = new URL(eventDataResp.detailPagePath).href;
} catch (e) {
previewUrl = `${getEventPageHost()}${eventDataResp.detailPagePath}`;
}

a.href = `${previewUrl}?previewMode=true&cachebuster=${Date.now()}&timing=${testTime}`;
a.classList.remove('preview-not-ready');
}
}
Expand Down
4 changes: 2 additions & 2 deletions ecc/blocks/series-dashboard/series-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function initMoreOptions(props, config, seriesObj, row) {
underlay.open = false;
dialog.innerHTML = '';
row.classList.add('pending');
const resp = await archiveSeries(seriesObj.seriesId);
const resp = await archiveSeries(seriesObj.seriesId, seriesObj);

if (resp.error) {
row.classList.remove('pending');
Expand All @@ -243,7 +243,7 @@ function initMoreOptions(props, config, seriesObj, row) {
props.paginatedData = newJson.series;

sortData(props, config, { resort: true });
showToast(props, config['delete-toast-msg']);
showToast(props, config['archive-msg']);
});

dialogCancelBtn.addEventListener('click', () => {
Expand Down

0 comments on commit 877e79d

Please sign in to comment.