Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"moment-duration-format": "^2.3.2",
"moment-timezone": "^0.5.33",
"node-sass": "^7.0.1",
"openstack-uicore-foundation": "4.2.21",
"openstack-uicore-foundation": "4.2.22",
Copy link

Choose a reason for hiding this comment

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

update urijs version to latest one 1.19.11

"p-limit": "^6.1.0",
"path-browserify": "^1.0.1",
"postcss-loader": "^6.2.1",
Expand Down Expand Up @@ -130,7 +130,7 @@
"style-loader": "^3.3.1",
"superagent": "^6.1.0",
"sweetalert2": "^8.15.2",
"urijs": "^1.19.1",
"urijs": "1.19.11",
"url-loader": "^4.1.1",
"validator": "^9.4.1",
"video.js": "^7.8.2",
Expand Down
2 changes: 2 additions & 0 deletions src/actions/attendee-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import {
TEN
} from "../utils/constants";

URI.escapeQuerySpace = false;

export const REQUEST_ATTENDEES = "REQUEST_ATTENDEES";
export const RECEIVE_ATTENDEES = "RECEIVE_ATTENDEES";
export const RECEIVE_ATTENDEE = "RECEIVE_ATTENDEE";
Expand Down
16 changes: 11 additions & 5 deletions src/actions/badge-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
fetchErrorHandler,
getCSV
} from "openstack-uicore-foundation/lib/utils/actions";
import URI from "urijs";
import pLimit from "p-limit";
import history from "../history";
import { saveMarketingSetting } from "./marketing-actions";
Expand All @@ -41,6 +42,8 @@ import {
TEN
} from "../utils/constants";

URI.escapeQuerySpace = false;

export const BADGE_DELETED = "BADGE_DELETED";
export const FEATURE_BADGE_REMOVED = "FEATURE_BADGE_REMOVED";
export const FEATURE_BADGE_ADDED = "FEATURE_BADGE_ADDED";
Expand Down Expand Up @@ -889,12 +892,15 @@ const normalizeBadgeType = (entity) => {
export const queryBadgeFeatures = _.debounce(
async (summitId, input, callback) => {
const accessToken = await getAccessTokenSafely();

const endpoint = URI(
`${window.API_BASE_URL}/api/v1/summits/${summitId}/badge-feature-types`
);
input = escapeFilterValue(input);

fetch(
`${window.API_BASE_URL}/api/v1/summits/${summitId}/badge-feature-types?filter=name=@${input}&access_token=${accessToken}`
)
endpoint.addQuery("access_token", accessToken);
if (input) {
endpoint.addQuery("filter", `name=@${input}`);
}
fetch(endpoint)
.then(fetchResponseHandler)
.then((json) => {
const options = [...json.data];
Expand Down
17 changes: 11 additions & 6 deletions src/actions/company-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
fetchResponseHandler,
fetchErrorHandler
} from "openstack-uicore-foundation/lib/utils/actions";
import URI from "urijs";
import history from "../history";
import { getAccessTokenSafely } from "../utils/methods";
import {
Expand All @@ -36,6 +37,8 @@ import {
DEFAULT_PER_PAGE
} from "../utils/constants";

URI.escapeQuerySpace = false;

export const REQUEST_COMPANIES = "REQUEST_COMPANIES";
export const RECEIVE_COMPANIES = "RECEIVE_COMPANIES";
export const RECEIVE_COMPANY = "RECEIVE_COMPANY";
Expand Down Expand Up @@ -268,16 +271,18 @@ const normalizeEntity = (entity) => {

export const queryCompanies = _.debounce(async (input, callback) => {
const accessToken = await getAccessTokenSafely();

const endpoint = URI(`${window.API_BASE_URL}/api/v1/companies`);
input = escapeFilterValue(input);

fetch(
`${window.API_BASE_URL}/api/v1/companies?filter=name=@${input}&access_token=${accessToken}&fields=id,name&relations=none`
)
endpoint.addQuery("access_token", accessToken);
endpoint.addQuery("fields", "id,name");
endpoint.addQuery("relations", "none");
if (input) {
endpoint.addQuery("filter", `name=@${input}`);
}
fetch(endpoint)
.then(fetchResponseHandler)
.then((json) => {
const options = [...json.data];

callback(options);
})
.catch(fetchErrorHandler);
Expand Down
14 changes: 9 additions & 5 deletions src/actions/email-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import {
HUNDRED_PER_PAGE
} from "../utils/constants";

URI.escapeQuerySpace = false;

export const REQUEST_TEMPLATES = "REQUEST_TEMPLATES";
export const RECEIVE_TEMPLATES = "RECEIVE_TEMPLATES";
export const RECEIVE_TEMPLATE = "RECEIVE_TEMPLATE";
Expand Down Expand Up @@ -334,7 +336,8 @@ export const getSentEmails =
});
};

export const updateTemplateJsonData = (data) => async (dispatch) => dispatch(createAction(UPDATE_JSON_DATA)(data));
export const updateTemplateJsonData = (data) => async (dispatch) =>
dispatch(createAction(UPDATE_JSON_DATA)(data));

/** ********************************************************************************************************* */
/* CLIENTS */
Expand Down Expand Up @@ -391,7 +394,8 @@ export const getMarketingEmailSettings =
};

export const saveMarketingEmailSettings =
(emailMarketingSettings) => async (dispatch) => Promise.all(
(emailMarketingSettings) => async (dispatch) =>
Promise.all(
Object.keys(emailMarketingSettings).map((m) => {
let value = emailMarketingSettings[m].value ?? "";
const file = emailMarketingSettings[m].file ?? null;
Expand Down Expand Up @@ -421,15 +425,15 @@ export const customErrorHandler = (err, res) => (dispatch) => {
case ERROR_CODE_412:
if (Array.isArray(err.response.body)) {
err.response.body.forEach((er) => {
msg += `${er }<br>`;
msg += `${er}<br>`;
});
} else {
for (const [key, value] of Object.entries(err.response.body)) {
if (isNaN(key)) {
msg += `${key }: `;
msg += `${key}: `;
}

msg += `${value }<br>`;
msg += `${value}<br>`;
}
}

Expand Down
92 changes: 65 additions & 27 deletions src/actions/event-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
fetchErrorHandler
} from "openstack-uicore-foundation/lib/utils/actions";
import { epochToMomentTimeZone } from "openstack-uicore-foundation/lib/utils/methods";
import URI from "urijs";
import history from "../history";
import {
checkOrFilter,
Expand All @@ -49,11 +50,14 @@ import {
DEFAULT_ORDER_DIR,
DEFAULT_PER_PAGE,
EXPORT_PAGE_SIZE_200,
FIVE_PER_PAGE,
HOUR_AND_HALF,
SECONDS_TO_MINUTES
} from "../utils/constants";
import { getIdValue } from "../utils/summitUtils";

URI.escapeQuerySpace = false;

export const REQUEST_EVENTS = "REQUEST_EVENTS";
export const RECEIVE_EVENTS = "RECEIVE_EVENTS";
export const RECEIVE_EVENT = "RECEIVE_EVENT";
Expand Down Expand Up @@ -1481,16 +1485,18 @@ export const getEventComments =

export const queryEvents = _.debounce(async (summitId, input, callback) => {
const accessToken = await getAccessTokenSafely();

const endpoint = URI(
`${window.API_BASE_URL}/api/v1/summits/${summitId}/events`
);
input = escapeFilterValue(input);

fetch(
`${window.API_BASE_URL}/api/v1/summits/${summitId}/events?filter=title=@${input}&access_token=${accessToken}`
)
endpoint.addQuery("access_token", accessToken);
if (input) {
endpoint.addQuery("filter", `title=@${input}`);
}
fetch(endpoint)
.then(fetchResponseHandler)
.then((json) => {
const options = [...json.data];

callback(options);
})
.catch(fetchErrorHandler);
Expand All @@ -1499,20 +1505,19 @@ export const queryEvents = _.debounce(async (summitId, input, callback) => {
export const queryEventsWithPrivateRSVP = _.debounce(
async (summitId, input, callback) => {
const accessToken = await getAccessTokenSafely();

const endpoint = URI(
`${window.API_BASE_URL}/api/v1/summits/${summitId}/events`
);
input = escapeFilterValue(input);

fetch(
`${window.API_BASE_URL}/api/v1/summits/${summitId}/events${
input
? `?filter[]=title=@${input}&filter[]=rsvp_type==Private`
: "?filter[]=rsvp_type==Private"
}&access_token=${accessToken}`
)
endpoint.addQuery("access_token", accessToken);
endpoint.addQuery("filter[]", "rsvp_type==Private");
if (input) {
endpoint.addQuery("filter[]", `title=@${input}`);
}
fetch(endpoint)
.then(fetchResponseHandler)
.then((json) => {
const options = [...json.data];

callback(options);
})
.catch(fetchErrorHandler);
Expand All @@ -1521,11 +1526,15 @@ export const queryEventsWithPrivateRSVP = _.debounce(
);

export const querySpeakerCompany = _.debounce(async (input, callback) => {
const endpoint = URI(
`${window.API_BASE_URL}/api/public/v1/speakers/all/companies`
);
input = escapeFilterValue(input);

fetch(
`${window.API_BASE_URL}/api/public/v1/speakers/all/companies?filter[]=company@@${input}&order=company`
)
endpoint.addQuery("order", "company");
if (input) {
endpoint.addQuery("filter[]", `company@@${input}`);
}
fetch(endpoint)
.then(fetchResponseHandler)
.then((json) => {
const options = [...json.data].map(({ company }) => ({
Expand All @@ -1538,11 +1547,15 @@ export const querySpeakerCompany = _.debounce(async (input, callback) => {
}, DEBOUNCE_WAIT);

export const querySubmitterCompany = _.debounce(async (input, callback) => {
const endpoint = URI(
`${window.API_BASE_URL}/api/public/v1/members/all/companies`
);
input = escapeFilterValue(input);

fetch(
`${window.API_BASE_URL}/api/public/v1/members/all/companies?filter[]=company@@${input}&order=company`
)
endpoint.addQuery("order", "company");
if (input) {
endpoint.addQuery("filter[]", `company@@${input}`);
}
fetch(endpoint)
.then(fetchResponseHandler)
.then((json) => {
const options = [...json.data].map(({ company }) => ({
Expand All @@ -1559,10 +1572,35 @@ export const queryAllCompanies = _.debounce(async (input, callback) => {

const accessToken = await getAccessTokenSafely();

const speakerEndpoint = URI(
`${window.API_BASE_URL}/api/public/v1/speakers/all/companies`
);
speakerEndpoint.addQuery("order", "company");
if (input) {
speakerEndpoint.addQuery("filter[]", `company@@${input}`);
}

const submitterEndpoint = URI(
`${window.API_BASE_URL}/api/public/v1/members/all/companies`
);
submitterEndpoint.addQuery("order", "company");
if (input) {
submitterEndpoint.addQuery("filter[]", `company@@${input}`);
}

const companyEndpoint = URI(`${window.API_BASE_URL}/api/v1/companies`);
companyEndpoint.addQuery("access_token", accessToken);
companyEndpoint.addQuery("order", "name");
companyEndpoint.addQuery("page", 1);
companyEndpoint.addQuery("per_page", FIVE_PER_PAGE);
if (input) {
companyEndpoint.addQuery("filter[]", `name@@${input}`);
}

const urls = [
`${window.API_BASE_URL}/api/public/v1/speakers/all/companies?filter[]=company@@${input}&order=company`,
`${window.API_BASE_URL}/api/public/v1/members/all/companies?filter[]=company@@${input}&order=company`,
`${window.API_BASE_URL}/api/v1/companies?filter[]=name@@${input}&order=name&page=1&per_page=5&access_token=${accessToken}`
speakerEndpoint.toString(),
speakerEndpoint.toString(),
submitterEndpoint.toString()
];

try {
Expand Down
2 changes: 2 additions & 0 deletions src/actions/filter-criteria-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import {
FIFTEEN_PER_PAGE
} from "../utils/constants";

URI.escapeQuerySpace = false;

export const FILTER_CRITERIA_ADDED = "FILTER_CRITERIA_ADDED";
export const FILTER_CRITERIA_DELETED = "FILTER_CRITERIA_DELETED";

Expand Down
2 changes: 2 additions & 0 deletions src/actions/media-upload-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import history from "../history";
import { getAccessTokenSafely } from "../utils/methods";
import { DEBOUNCE_WAIT, DEFAULT_PER_PAGE } from "../utils/constants";

URI.escapeQuerySpace = false;

export const REQUEST_MEDIA_UPLOADS = "REQUEST_MEDIA_UPLOADS";
export const RECEIVE_MEDIA_UPLOADS = "RECEIVE_MEDIA_UPLOADS";
export const RECEIVE_MEDIA_UPLOAD = "RECEIVE_MEDIA_UPLOAD";
Expand Down
23 changes: 13 additions & 10 deletions src/actions/selection-plan-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
authErrorHandler,
postFile
} from "openstack-uicore-foundation/lib/utils/actions";
import URI from "urijs";
import history from "../history";
import {
getAccessTokenSafely,
Expand All @@ -34,7 +35,9 @@ import {
fetchErrorHandler
} from "../utils/methods";
import { saveMarketingSetting } from "./marketing-actions";
import { DEFAULT_PER_PAGE } from "../utils/constants";
import { DEBOUNCE_WAIT, DEFAULT_PER_PAGE } from "../utils/constants";

URI.escapeQuerySpace = false;

export const REQUEST_SELECTION_PLANS = "REQUEST_SELECTION_PLANS";
export const RECEIVE_SELECTION_PLANS = "RECEIVE_SELECTION_PLANS";
Expand Down Expand Up @@ -62,8 +65,6 @@ export const SELECTION_PLAN_PROGRESS_FLAG_REMOVED =
export const SELECTION_PLAN_PROGRESS_FLAG_ORDER_UPDATED =
"SELECTION_PLAN_PROGRESS_FLAG_ORDER_UPDATED";

const callDelay = 500; // milliseconds

export const getSelectionPlans =
(term = "", page = 1, order = "id", orderDir = 1) =>
async (dispatch, getState) => {
Expand Down Expand Up @@ -698,21 +699,23 @@ export const deleteRatingType =
export const querySelectionPlanExtraQuestions = _.debounce(
async (summitId, input, callback) => {
const accessToken = await getAccessTokenSafely();
const endpoint = URI(
`${window.API_BASE_URL}/api/v1/summits/${summitId}/selection-plan-extra-questions`
);
input = escapeFilterValue(input);
const filters = encodeURIComponent(`name=@${input}`);

fetch(
`${window.API_BASE_URL}/api/v1/summits/${summitId}/selection-plan-extra-questions?filter=${filters}&&access_token=${accessToken}`
)
endpoint.addQuery("access_token", accessToken);
if (input) {
endpoint.addQuery("filter", `name=@${input}`);
}
fetch(endpoint)
.then(fetchResponseHandler)
.then((json) => {
const options = [...json.data];

callback(options);
})
.catch(fetchErrorHandler);
},
callDelay
DEBOUNCE_WAIT
);

export const assignExtraQuestion2SelectionPlan =
Expand Down
Loading