Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* Actions related to the UI state of payment editor page.
*/
import { createActions } from 'redux-actions';
import { services } from 'topcoder-react-lib';
const getMembersService = services.members.getService;
export const STATE = {
NEW_PAYMENT: 'NEW_PAYMENT',
PAID: 'PAID',
WAITING_PAYMENT_ACTIVATION: 'WAITING_PAYMENT_ACTIVATION',
WAITING_PAYMENT_CLOSURE: 'WAITING_PAYMENT_CLOSURE',
WAITING_PAYMENT_DRAFT: 'WAITING_PAYMENT_DRAFT',
};
/**
* Payload creator for the action that starts member suggestion API call
* @param {String} keyword Partial name/keyword
* @return {String} Payload.
*/
function getMemberSuggestionsInit(keyword) {
return keyword;
import Confirmation from 'components/sandbox/payments/Confirmation';
import Editor from 'components/sandbox/payments/Editor';
import LoadingIndicator from 'components/LoadingIndicator';
import PT from 'prop-types';
import React from 'react';
import { STATE as PAGE_STATE } from 'actions/page/sandbox/payments/editor';
import { connect } from 'react-redux';
import { logger, services } from 'topcoder-react-lib';
import { getService as getChallengeService } from 'services/challenges';
import { goToLogin } from 'utils/tc';
import { AUTOCOMPLETE_TRIGGER_LENGTH } from 'components/MemberSearchInput';
import { fireErrorMessage } from 'utils/errors';
import './style.scss';
const getMembersService = services.members.getService;
/**
* If given props have loaded project details with some billing accounts, this
* function ensures that at least some (first) billing account is selected.
* @param {Object} props
*/
function selectFirstBillingAccountIfNecessary({
projectDetails,
selectBillingAccount,
selectedBillingAccountId,
}) {
const accounts = (projectDetails && projectDetails.billingAccountIds) || [];
if (
accounts.length
&& (
!selectedBillingAccountId