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

Stage -> Main 27 Sept. 2024 #231

Merged
merged 27 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
883e69a
reloading profile search data on profile update
gbajaj91 Sep 12, 2024
5c5ab2d
Merge pull request #213 from adobecom/profile-update-bug
qiyundai Sep 12, 2024
7522344
speaker operates still with empty array
qiyundai Sep 12, 2024
8986084
multiple profile component fixes
qiyundai Sep 12, 2024
474f9b7
minor fix
gbajaj91 Sep 13, 2024
80cbe31
adding default value for isPlaceholder
gbajaj91 Sep 13, 2024
ff9c41e
Merge pull request #217 from adobecom/deleteicon-bug
qiyundai Sep 13, 2024
afd6861
linting
qiyundai Sep 13, 2024
d7e9b10
Merge pull request #216 from adobecom/mwpw-158354
qiyundai Sep 13, 2024
208aec6
Merge pull request #214 from adobecom/dev
apganapa-adobe Sep 13, 2024
7391693
split response and payload update
qiyundai Sep 14, 2024
1ea0927
Update event-community-link-component.js
qiyundai Sep 19, 2024
756040a
making bio optional
qiyundai Sep 23, 2024
6a46edc
Merge pull request #219 from adobecom/MWPW-158424
apganapa-adobe Sep 23, 2024
796171c
Merge pull request #218 from adobecom/on-update-fix
apganapa-adobe Sep 23, 2024
3eaa10a
Add x-api-key header
qiyundai Sep 24, 2024
f104d6e
Merge pull request #220 from adobecom/x-api-key
apganapa-adobe Sep 24, 2024
d20aa90
Timeslot fix for midnight options (#221)
qiyundai Sep 24, 2024
c037f2e
add specific hidden CSS for img upload progress wrapper (#223)
qiyundai Sep 24, 2024
2d34042
remove bio for valid speaker check (#224)
qiyundai Sep 24, 2024
f216bfb
Update Event to ESL (#225)
qiyundai Sep 25, 2024
1ff4463
Revert "Update Event to ESL (#225)" (#226)
apganapa-adobe Sep 25, 2024
b1e7a6f
Add the x-api-key to image upload call
qiyundai Sep 25, 2024
8b8ff79
Merge pull request #227 from adobecom/more-x-api-key
rayyank10 Sep 25, 2024
5e9c003
[HOTFIX] Blank page on latest Chrome version (small) (#229)
qiyundai Sep 26, 2024
85d147c
add tiktok icon (#230)
qiyundai Sep 27, 2024
1ae33a0
Merge pull request #222 from adobecom/dev
apganapa-adobe Sep 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-len */
import { getAllEventAttendees, getEvents } from '../../scripts/esp-controller.js';
import { ALLOWED_ACCOUNT_TYPES } from '../../constants/constants.js';
import { DEV_MODE, LIBS, MILO_CONFIG } from '../../scripts/scripts.js';
import { LIBS } from '../../scripts/scripts.js';
import {
getIcon,
buildNoAccessScreen,
Expand Down Expand Up @@ -418,7 +418,6 @@ function buildBackToDashboardBtn(props, config) {
if (!sidePanel) return;

const url = new URL(`${window.location.origin}${config['event-dashboard-url']}`);
if (DEV_MODE) url.searchParams.set('devMode', true);
const backBtn = createTag('a', { class: 'back-btn', href: url.toString() }, 'Back', { parent: sidePanel });
backBtn.prepend(getIcon('chev-left'));
}
Expand Down Expand Up @@ -554,20 +553,11 @@ export default async function init(el) {
import(`${miloLibs}/features/spectrum-web-components/dist/link.js`),
]);

const { search } = window.location;
const urlParams = new URLSearchParams(search);
const devMode = urlParams.get('devMode');

const config = readBlockConfig(el);
el.innerHTML = '';
buildLoadingScreen(el);
const profile = BlockMediator.get('imsProfile');

if (devMode === 'true' && ['stage', 'local'].includes(MILO_CONFIG.env.name)) {
buildDashboard(el, config);
return;
}

if (profile) {
if (profile.noProfile || !ALLOWED_ACCOUNT_TYPES.includes(profile.account_type)) {
buildNoAccessScreen(el);
Expand Down
9 changes: 1 addition & 8 deletions ecc/blocks/ecc-dashboard/ecc-dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
unpublishEvent,
} from '../../scripts/esp-controller.js';
import { ALLOWED_ACCOUNT_TYPES } from '../../constants/constants.js';
import { LIBS, MILO_CONFIG, DEV_MODE } from '../../scripts/scripts.js';
import { LIBS } from '../../scripts/scripts.js';
import { getIcon, buildNoAccessScreen, getEventPageHost, readBlockConfig } from '../../scripts/utils.js';
import { quickFilter } from '../form-handler/data-handler.js';
import BlockMediator from '../../scripts/deps/block-mediator.min.js';
Expand Down Expand Up @@ -388,7 +388,6 @@ function buildStatusTag(event) {
function buildEventTitleTag(config, eventObj) {
const url = new URL(`${window.location.origin}${config['create-form-url']}`);
url.searchParams.set('eventId', eventObj.eventId);
if (DEV_MODE) url.searchParams.set('devMode', true);
const eventTitleTag = createTag('a', { class: 'event-title-link', href: url.toString() }, eventObj.title);
return eventTitleTag;
}
Expand All @@ -407,7 +406,6 @@ function buildRSVPTag(config, eventObj) {

const url = new URL(`${window.location.origin}${config['attendee-dashboard-url']}`);
url.searchParams.set('eventId', eventObj.eventId);
if (DEV_MODE) url.searchParams.set('devMode', true);

const rsvpTag = createTag('a', { class: 'rsvp-tag', href: url }, text);
return rsvpTag;
Expand Down Expand Up @@ -709,11 +707,6 @@ export default async function init(el) {
buildLoadingScreen(el);
const profile = BlockMediator.get('imsProfile');

if (DEV_MODE === true && ['stage', 'local'].includes(MILO_CONFIG.env.name)) {
buildDashboard(el, config);
return;
}

if (profile) {
if (profile.noProfile || !ALLOWED_ACCOUNT_TYPES.includes(profile.account_type)) {
buildNoAccessScreen(el);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LINK_REGEX } from '../../constants/constants.js';
import { LIBS } from '../../scripts/scripts.js';
import { generateToolTip } from '../../scripts/utils.js';

Expand All @@ -14,7 +15,7 @@ async function decorateFields(row) {
id: 'community-url-details',
class: 'text-input',
placeholder: text,
pattern: '^https:\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$',
pattern: LINK_REGEX,
size: 'xl',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ export default function init(component, props) {
});
}

export async function onUpdate(_component, _props) {
export async function onPayloadUpdate(_component, _props) {
// Do nothing
}

export async function onRespUpdate(_component, _props) {
// Do nothing
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export function onSubmit(component, props) {
props.payload = { ...props.payload, ...agendaInfo };
}

export async function onUpdate(_component, _props) {
export async function onPayloadUpdate(_component, _props) {
// Do nothing
}

export async function onRespUpdate(_component, _props) {
// Do nothing
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export function onSubmit(component, props) {
}
}

export async function onUpdate(_component, _props) {
export async function onPayloadUpdate(_component, _props) {
// Do nothing
}

export async function onRespUpdate(_component, _props) {
// Do nothing
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable no-unused-vars */
import { getSeries } from '../../../scripts/esp-controller.js';
import { LIBS, BlockMediator } from '../../../scripts/scripts.js';
import BlockMediator from '../../../scripts/deps/block-mediator.min.js';
import { LIBS } from '../../../scripts/scripts.js';
import { changeInputValue } from '../../../scripts/utils.js';

const { createTag } = await import(`${LIBS}/utils/utils.js`);
Expand Down Expand Up @@ -52,7 +53,7 @@ function initStepLock(component) {
onFormatChange();
}

export async function onUpdate(component, props) {
export async function onPayloadUpdate(component, props) {
const { seriesId } = props.payload;
if (seriesId) {
const partnerSelectorGroups = document.querySelectorAll('partner-selector-group');
Expand All @@ -67,6 +68,10 @@ export async function onUpdate(component, props) {
}
}

export async function onRespUpdate(_component, _props) {
// Do nothing
}

async function populateSeriesOptions(props, component) {
const seriesSelect = component.querySelector('#series-select-input');
if (!seriesSelect) return;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable no-unused-vars */
/* eslint-disable no-use-before-define */
import { getEvents } from '../../../scripts/esp-controller.js';
import { BlockMediator, LIBS } from '../../../scripts/scripts.js';
import BlockMediator from '../../../scripts/deps/block-mediator.min.js';
import { LIBS } from '../../../scripts/scripts.js';
import { changeInputValue } from '../../../scripts/utils.js';

const { createTag, getConfig } = await import(`${LIBS}/utils/utils.js`);
Expand Down Expand Up @@ -342,10 +343,14 @@ export function onSubmit(component, props) {
props.payload = { ...props.payload, ...eventInfo };
}

export async function onUpdate(component, props) {
export async function onPayloadUpdate(component, props) {
// do nothing
}

export async function onRespUpdate(_component, _props) {
// Do nothing
}

function checkEventDuplication(event, compareMetrics) {
const titleMatch = event.title === compareMetrics.title;
const startDateMatch = event.localStartDate === compareMetrics.startDate;
Expand Down Expand Up @@ -376,7 +381,7 @@ export default async function init(component, props) {
BlockMediator.set('eventDupMetrics', { ...BlockMediator.get('eventDupMetrics'), title: eventTitleInput.value });
});

endTimeInput.addEventListener('change', () => {
const updateEndTimeOptions = () => {
if (datePicker.dataset.startDate !== datePicker.dataset.endDate) return;
const allOptions = startTimeInput.querySelectorAll('sp-menu-item');
allOptions.forEach((option) => {
Expand All @@ -386,9 +391,9 @@ export default async function init(component, props) {
option.disabled = false;
}
});
});
};

startTimeInput.addEventListener('change', () => {
const updateStartTimeOptions = () => {
if (datePicker.dataset.startDate !== datePicker.dataset.endDate) return;
const allOptions = endTimeInput.querySelectorAll('sp-menu-item');
allOptions.forEach((option) => {
Expand All @@ -398,9 +403,9 @@ export default async function init(component, props) {
option.disabled = false;
}
});
});
};

datePicker.addEventListener('change', () => {
const updateTimeOptionsBasedOnDate = () => {
if (datePicker.dataset.startDate !== datePicker.dataset.endDate) {
startTimeInput?.querySelectorAll('sp-menu-item')?.forEach((option) => {
option.disabled = false;
Expand All @@ -409,7 +414,13 @@ export default async function init(component, props) {
option.disabled = false;
});
}
};

endTimeInput.addEventListener('change', updateEndTimeOptions);
startTimeInput.addEventListener('change', updateStartTimeOptions);

datePicker.addEventListener('change', () => {
updateTimeOptionsBasedOnDate();
BlockMediator.set('eventDupMetrics', { ...BlockMediator.get('eventDupMetrics'), startDate: datePicker.dataset.startDate });
});

Expand Down Expand Up @@ -473,6 +484,10 @@ export default async function init(component, props) {
});
component.classList.add('prefilled');
}

updateEndTimeOptions();
updateStartTimeOptions();
updateTimeOptionsBasedOnDate();
}

export function onEventUpdate(component, props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export async function onSubmit(component, props) {
props.payload = { ...props.payload, showSponsors };
}

export async function onUpdate(component, props) {
export async function onPayloadUpdate(component, props) {
if (!PARTNERS_SERIES_ID || PARTNERS_SERIES_ID !== props.eventDataResp.seriesId) {
const partnersGroup = component.querySelector('partner-selector-group');

Expand All @@ -108,6 +108,10 @@ export async function onUpdate(component, props) {
}
}

export async function onRespUpdate(_component, _props) {
// Do nothing
}

export default async function init(component, props) {
const eventData = props.eventDataResp;
const partnersGroup = component.querySelector('partner-selector-group');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ export function onSubmit(component, props) {
props.payload = { ...props.payload, topics, fullTopicsValue };
}

export async function onUpdate(_component, _props) {
export async function onPayloadUpdate(_component, _props) {
// Do nothing
}

export async function onRespUpdate(_component, _props) {
// Do nothing
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ function updateImgUploadComponentConfigs(component) {
component.dataset.configs = JSON.stringify(configs);
}

export async function onUpdate(component, props) {
export async function onPayloadUpdate(component, props) {
updateImgUploadComponentConfigs(component);
}

export async function onRespUpdate(_component, _props) {
// Do nothing
}

export default async function init(component, props) {
const type = getComponentImageType(component);
const dropzones = component.querySelectorAll('image-dropzone');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function onSubmit(component, props) {
if (selectedProducts) {
const topicsVal = props.payload.fullTopicsValue?.map((x) => JSON.parse(x));
const relatedProducts = selectedProducts
.filter((p) => topicsVal.find((t) => p.tagID.includes(t.tagID)))
.filter((p) => topicsVal.find((t) => p.tagID?.includes(t.tagID)))
.map((p) => ({
name: p.title,
showProductBlade: !!p.showProductBlade,
Expand Down Expand Up @@ -65,19 +65,19 @@ async function updateProductSelector(component, props) {
'Substance 3D Collection',
];
const caasTags = await getCaasTags();
const topicsVal = props.payload.fullTopicsValue?.map((x) => JSON.parse(x));
if (!caasTags || !topicsVal) return;
const topics = props.payload.fullTopicsValue?.map((x) => JSON.parse(x));
if (!caasTags || !topics) return;

const productGroups = component.querySelectorAll('product-selector-group');
let products = Object.values(caasTags.namespaces.caas.tags['product-categories'].tags).map((x) => [...Object.values(x.tags).map((y) => y)]).flat();

products = products.filter(
(p) => topicsVal.find((t) => p.tagID.includes(t.tagID)) && supportedProducts.includes(p.title),
(p) => topics.find((t) => p.tagID?.includes(t.tagID)) && supportedProducts?.includes(p.title),
);

productGroups.forEach((pg) => {
pg.setAttribute('data-products', JSON.stringify(products));
pg.setAttribute('data-selected-topics', JSON.stringify(topicsVal));
pg.setAttribute('data-selected-topics', JSON.stringify(topics));
pg.requestUpdate();

const selectedProducts = pg.getSelectedProducts();
Expand All @@ -100,10 +100,14 @@ async function updateProductSelector(component, props) {
});
}

export async function onUpdate(component, props) {
export async function onPayloadUpdate(component, props) {
await updateProductSelector(component, props);
}

export async function onRespUpdate(_component, _props) {
// Do nothing
}

export default async function init(component, props) {
const eventData = props.eventDataResp;
const productGroup = component.querySelector('product-selector-group');
Expand Down
Loading
Loading