Skip to content

Commit

Permalink
deprecate devMode
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai committed Sep 26, 2024
1 parent f6e2149 commit 3468e65
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-len */
import { getAllEventAttendees, getEvents } from '../../scripts/esp-controller.js';
import { ALLOWED_ACCOUNT_TYPES, DEV_MODE } from '../../constants/constants.js';
import { ALLOWED_ACCOUNT_TYPES } from '../../constants/constants.js';
import { LIBS } from '../../scripts/scripts.js';
import {
getIcon,
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
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 @@ -6,7 +6,7 @@ import {
publishEvent,
unpublishEvent,
} from '../../scripts/esp-controller.js';
import { ALLOWED_ACCOUNT_TYPES, DEV_MODE } from '../../constants/constants.js';
import { ALLOWED_ACCOUNT_TYPES } from '../../constants/constants.js';
import { LIBS } from '../../scripts/scripts.js';
import { getIcon, buildNoAccessScreen, getEventPageHost, readBlockConfig } from '../../scripts/utils.js';
import { quickFilter } from '../form-handler/data-handler.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(window.miloConfig.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/form-handler/form-handler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ALLOWED_ACCOUNT_TYPES, DEV_MODE } from '../../constants/constants.js';
import { ALLOWED_ACCOUNT_TYPES } from '../../constants/constants.js';
import { LIBS } from '../../scripts/scripts.js';
import {
getIcon,
Expand Down Expand Up @@ -859,13 +859,6 @@ export default async function init(el) {

const profile = BlockMediator.get('imsProfile');

if (DEV_MODE === true && ['stage', 'local'].includes(window.miloConfig.env.name)) {
buildECCForm(el).then(() => {
el.classList.remove('loading');
});
return;
}

if (profile) {
if (profile.noProfile || !ALLOWED_ACCOUNT_TYPES.includes(profile.account_type)) {
buildNoAccessScreen(el);
Expand Down
1 change: 0 additions & 1 deletion ecc/constants/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export const LINK_REGEX = '^https:\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,63}(:[0-9]{1,5})?(\\/.*)?$';
export const ALLOWED_ACCOUNT_TYPES = ['type3', 'type2e'];
export const DEV_MODE = new URLSearchParams(window.location.search).has('devMode');

0 comments on commit 3468e65

Please sign in to comment.