{"version":3,"sources":["js/jquery-deparam.js","components/util/util-ajax.js","components/util/util-ajax-delete.js","components/util/util-ajax-get.js","components/util/util-ajax-save.js","components/util/util-content-static.js","components/util/util-content-dynamic.js","components/util/util-content-urls.js","components/util/util.js","components/404/404.js","components/conflict-count/conflict-count.js","components/shim/inaccessible-link.js","components/page-header/page-header.js","components/loading-indicator/loading-indicator-header.js","components/schedule-by-week/schedule-by-week-title.js","components/schedule-by-week/schedule-by-week-buttons.js","components/timeslot-popover/timeslot-popover.js","components/reports/reports-search-date.js","components/schedule-by-week/schedule-by-week-schedule.js","components/schedule-by-week/schedule-by-week.js","components/app/app.js","components/tooltip/tooltip.js","components/campaign-detail/campaign-detail-campaign.js","components/loading-indicator/loading-indicator-text.js","components/campaign-detail/campaign-detail-pods.js","components/campaign-detail/campaign-detail-rules.js","components/campaign-detail/campaign-detail.js","components/campaign-form/campaign-form-buttons.js","components/campaign-form/campaign-form.js","components/campaign-form/campaign-form-validation.js","components/campaign-list/campaign-list-search-form.js","components/campaign-list/campaign-list-table.js","components/pagination/pagination-previous.js","components/pagination/pagination-next.js","components/pagination/pagination.js","components/campaign-list/campaign-list.js","components/change-log-by-obj/change-log-by-obj.js","components/change-log-by-user/change-log-by-user.js","components/change-log-list/change-log-list.js","components/conflict-form/conflict-form-rule.js","components/conflict-form/conflict-form-schedule.js","components/conflict-form/conflict-form.js","components/invite-form/invite-form-buttons.js","components/invite-form/invite-form.js","components/invite-list/invite-list-table.js","components/invite-list/invite-list.js","components/livestream/videoJS.js","components/livestream/livestream.js","components/pod-detail/pod-detail-pod.js","components/pod-detail/pod-detail-rules.js","components/pod-detail/pod-detail-campaigns.js","components/pod-detail/pod-detail.js","components/pod-list/pod-list-search-form.js","components/pod-list/pod-list-table.js","components/pod-list/pod-list.js","components/spot-detail/spot-detail-spot.js","components/spot-detail/spot-detail-pod.js","components/spot-detail/spot-detail.js","components/spot-list/spot-list-search-form.js","components/spot-list/spot-list-table.js","components/spot-list/spot-list.js","components/pod-form/pod-form-buttons.js","components/pod-form/pod-form-validation.js","components/pod-form/pod-form.js","components/spot-form/spot-form-buttons.js","components/spot-form/spot-form-validation.js","components/spot-form/spot-form.js","components/reports/reports-search-form.js","components/reports/reports-table.js","components/reports/reports.js","components/rule-detail/rule-detail-exceptions.js","components/rule-detail/rule-detail-source.js","components/rule-detail/rule-detail-schedule.js","components/rule-detail/rule-detail.js","components/rule-form/rule-form-buttons.js","components/rule-form/rule-form-timeslots.js","components/rule-form/rule-form.js","components/rule-form/rule-form-validation.js","components/rule-list/rule-list-search-form.js","components/rule-list/rule-list-table.js","components/rule-list/rule-list.js","components/schedule-by-day/schedule-by-day-title.js","components/schedule-by-day/schedule-by-day-buttons.js","components/schedule-by-day/schedule-by-day-schedule.js","components/schedule-by-day/schedule-by-day.js","components/schedule-by-timeslot/schedule-by-timeslot-buttons.js","components/schedule-by-timeslot/schedule-by-timeslot-jump.js","components/schedule-by-timeslot/schedule-by-timeslot-schedule.js","components/schedule-by-timeslot/schedule-by-timeslot.js","components/settings/settings.js","components/user-form/user-form-buttons.js","components/user-form/user-form.js","components/user-list/user-list-table.js","components/user-list/user-list.js","js/site.js","components/page-header/images/pbs-logo.svg"],"names":["$","jQuery","deparam","params","coerce","obj","coerce_types","true","false","null","each","replace","split","j","v","val","param","key","decodeURIComponent","cur","i","keys","keys_last","length","test","shift","concat","isNaN","undefined","isArray","push","window","ajax","beforeSend","request","setRequestHeader","getCookie","crossSiteProtectionCookieName","contentType","onFail","onFailWithExceptions","jqXHR","json","responseJSON","ignoreThisError","Object","forEach","toLowerCase","indexOf","cookieName","match","document","cookie","RegExp","alertContainer","text","responseText","substring","status","console","error","Sentry","$alert","$message","toUpperCase","find","prepend","children","index","alert","remove","ajaxDelete","deleteDropboxIntegration","integrationId","method","url","fail","deleteElementFromPod","elementId","deleteExceptionFromRule","exceptionId","deletePod","podId","deleteSpot","deleteSpotFromPod","spotId","deletePodFromCampaign","campaignId","deleteRule","ruleId","deleteCampaign","deleteInviteFromStation","inviteId","deleteUserFromStation","userId","deleteInvoiceCustomizations","customizationsId","ajaxGet","getCampaign","getCampaigns","config","data","ordering","sort","page","search","getChangeLog","id","getConflicts","getException","getIntegrations","getInterstitialsByDay","day","getInterstitialsByTimeslot","timeslot","start","days","getInterstitialsByWeek","sunday","getInvoiceCustomizations","getInvoiceDefaults","getLivestreamData","getPod","getPods","aws_status","unused","getPodStatus","getPodsNotifications","getPodsForCampaign","getReports","end","field","q","getReportsCSV","getReportsPDF","invoiceNumber","invoiceDate","customerName","companyName","companyAddress","companyCity","invoiceDescription","costPerView","podsOrderedByDate","podsOrderedByName","columnsToIncludeAirtime","columnsToIncludePodName","columnsToIncludeShownAfter","columnsToIncludeShownBefore","columnsToIncludeViewCount","getRoles","getRule","getRules","state","getS3Url","report","JSON","stringify","getScheduleByDay","getScheduleByWeek","getSchedulesInterstitialsCSV","startDate","endDate","getSearchResults","searchTerm","type","when","getShows","exclude","excludeShows","getSpot","getSpots","getSpotsForPod","getStation","getStationChangeLog","getStationIntegrations","getStationInvites","getStationInvite","getStationUsers","getStationUser","getUser","ajaxSave","saveCampaign","saveElement","updateElementsForPod","saveException","saveFileToS3","progressCallback","xhr","processData","saveInvite","savePod","savePodToCampaign","pod_id","saveSpotsToPod","spotIds","spot_ids","saveSpot","saveRule","saveRuleAsExpired","saveStation","stationId","station_id","savePodNotification","notificationStatus","podNotificationId","aws_transcode_notification_seen","pod","saveInvoiceCustomizations","customizations","contentStatic","dateFormatComputer","dateFormatHumanLong","dateFormatHumanShort","dateFormatRangeLong","dateFormatRangeShort","delayForm","delayDetail","delayList","label","value","objectTypes","path","podStatuses","podElementFields","timeSlots","timeslots","prefix","timeString28","timeString58","podResultsPerPage","spotResultsPerPage","campaignResultsPerPage","changeLogResultsPerPage","inviteResultsPerPage","reportsResultsPerPage","ruleResultsPerPage","daysPerTimeSlotPerPage","userResultsPerPage","podFormDefaultSourceFile","podFormMaxFilesize","podFormMinDuration","podFormMaxDuration","spotFormDefaultSourceFile","spotFormMaxFilesize","zeroPodsMessage","zeroSpotsMessage","zeroCampaignsMessage","zeroLogsMessage","zeroReportsMessage","zeroRulesMessage","zeroExceptionsMessage","zeroInvitesMessage","zeroUsersMessage","zeroStationsMessage","contentDynamic","renderModal","title","body","buttonTextDefault","buttonTextLoading","iconClass","$modal","on","renderShowsNames","shows","showNames","returnShowNames","showsList","map","show","splice","returnCleanTimeSlot","returnCleanTimeSlots","newTimeslots","returnLineNumber","currentPage","resultsPerPage","returnChangeLogPath","pathObj","returnPaginationUrl","returnPodStatus","returnSpotStatus","returnRepeatValue","returnSimpleSelectOptions","options","newOptions","option","name","toString","returnSimpleSelectOptionsForShows","program_id","returnSimpleSelectOptionsForSpots","duration_s","duration","toFixed","element_id","client_name","spot_name","protrack_id","tape","returnSortClass","newSort","currentSort","cleanedSort","returnCleanedSortValue","className","asc","desc","returnSortValue","returnSort","returnSunday","date","Date","week","setToWeek","moment","format","alertInfo","alertPodInfo","setTimeout","formatVideoError","statusMessage","warn","messageStatus","errors","parse","e","Video","Audio","General","statusKey","typeKey","_","uniq","contentUrls","returnCampaignListUrl","returnCampaignDetailUrl","returnCampaignFormUrl","returnChangeLogListUrl","returnChangeLogDetailUrl","objType","util","returnConflictFormUrl","count","returnInviteListUrl","returnInviteFormUrl","returnLivestreamUrl","returnPodListUrl","returnPodDetailUrl","returnPodFormUrl","returnReportsUrl","returnRuleListUrl","returnRuleDetailUrl","returnRuleFormUrl","returnScheduleWeekUrl","returnScheduleDayUrl","returnScheduleTimeSlotUrl","returnSettingsUrl","returnSpotDetailUrl","returnSpotFormUrl","returnSpotListUrl","returnUserListUrl","returnUserFormUrl","spotStatuses","putFoucsOnError","element","querySelector","focus","spotsAvailable","_config","FourOhFour","ConflictCount","props","useState","conflictCount","setConflictCount","timeout","useRef","useEffect","getConflictCount","clearTimeout","current","then","Number","delay","updateConflictCount","to","_warnDeprecation","debounce","process","InaccessibleLink","rest","PageHeader","initialTimeout","reoccurringTimeout","user","setUser","station","setStation","stations","setStations","stationSearch","setStationSearch","permissions","setPermissions","isEmpty","userUpdated","userData","email","stationUpdated","current_station","superuser","is_superuser","groups","getPodsTranscodingNotifications","browserHistory","getCurrentLocation","pathname","includes","results","result","podName","pod_name","podStatus","pod_aws_status","msg","msgStatus","returnActiveClass","location","canAccessUserList","g","data-toggle","data-target","aria-expanded","src","headerLogo","alt","height","href","role","aria-haspopup","aria-hidden","onChange","target","placeholder","returnStationSearchForm","returnStationListDivider","stationItem","onClick","onChangeStation","LoadingIndicatorHeader","ScheduleByWeekTitle","this","weekDisplay","Component","ScheduleByWeek","lastSunday","nextSunday","loaded","customInput","returnWeekRange","selected","add","popperClassName","newSunday","newUrl","weekOffset","dateFormat","returnInitialState","rule","TimeslotPopover","Math","random","mounted","initPopover","nextProps","setState","$body","$popoverTrigger","popover","container","content","next","html","placement","off","attr","preventDefault","parents","size","trigger","ReportsSearchDate","dateDisplay","ScheduleByWeekSchedule","showScheduleForm","setShowScheduleForm","setStartDate","setEndDate","fixedHeight","selectsStart","isAfter","selectsEnd","isBefore","renderScheduleByIndex","startIndex","endIndex","schedule","slice","row","rowIndex","dayIndex","rowSpan","durationArray","rowspan","returnRowSpan","skip","style","width","dateForLink","dateForDisplay","substr","k","returnEmptySchedule","hour","hourFormatted","time","createRow","airtime","slot","App","setUserData","stationChanged","setStationChanged","userSignedOut","setUserSignedOut","setCurrentStation","Tooltip","effect","offset","offset_top","top","multiline","delayShow","clickable","CampaignDetailCampaign","campaign","rules","hasRules","data-tip","data-for","$confirmButton","one","button","d","modal","append","disabled","created","LoadingIndicatorText","CampaignDetailPods","pods","colSpan","onDeletePod","renderPodRows","CampaignDetailRules","cleanedTimeSlots","start_date","end_date","join","expired","onLoadExpired","CampaignDetail","setId","setLoaded","setCampaign","setPods","setRules","rulesAll","setRulesAll","showExpiredRules","setShowExpiredRules","campaignData","podsData","allRules","nonExpiredRules","deletePodAssociation","podsForCampaign","CampaignFormButtons","onCancel","data-loading-text","onSubmit","CampaignForm","setName","setErrors","searchingForPods","setSearchingForPods","podOptions","setPodOptions","originalPods","setOriginalPods","getDefaultPodValue","v4","getPodSearchResultsDelayed","useCallback","trim","validationResult","hasErrors","campaignFormValidation","newPodId","$button","api_error","get","merge","removeRequests","apply","addRequests","action","htmlFor","autoFocus","maxLength","theme","isClearable","blurInputOnSelect","filterOption","dbOption","userInput","noOptionsMessage","inputValue","getPodSearchStatus","onInputChange","selectedPod","podIndex","podsArray","Array","from","handlePodsOnValueChange","addPod","CampaignListSearchForm","setSearch","onSearchSubmit","searchSubmit","onKeyPress","CampaignListTable","renderSortLink","campaigns","pod_count","renderCampaignRows","sortValue","sortDisplay","newSortValue","queryStringObject","queryString","PaginationPrevious","aria-label","PaginationNext","pageCount","iPhone6Width","iPadPortraitWidth","Pagination","pagesToShow","innerWidth","pageArray","firstPage","floor","lastPage","CampaignList","setCampaigns","setPage","setPageCount","setSort","setQueryString","ceil","ChangeLogByObj","log","setLog","setObjType","objName","setObjName","objUrl","setObjUrl","objectId","objectType","pageNo","sortBy","getObj","returnObjUrl","logs","revision","description","date_created","renderRows","ChangeLogByUser","ChangeLogList","content_type","object_id","object_name","ConflictFormRule","setRule","dateStart","dateEnd","repeats","ConflictFormSchedule","setSchedule","oldSchedule","newDay","newTimeslot","updatedSchedule","setEmptySchedule","findTheConflict","emptySchedule","showOrInterstitial","showOrIntAirtime","showOrIntTimeslot","showOrIntDate","ConflictForm","formData","setFormData","selectedRuleIndex","setSelectedRuleIndex","checkboxRef","conflicts","conflicting_rules","conflictingRule","frequency","conflictOccurrences","conflicting_rules_occurrences","conflict","utc","dateMoment","checked","ref","selected_rule","apply_all","newURL","InviteFormButtons","InviteForm","roles","setRoles","invites","setInvites","stationName","setStationName","stationGroups","setStationGroups","group","group_counts","changeInviteValue","prop","invitesArray","requests","invite","removeInvite","addInvite","InviteListTable","has_accepted","onClickDeleteInvite","InviteList","deleteInvite","VideoJS","videoRef","React","playerRef","onReady","videoElement","player","videojs","dispose","data-vjs-player","Livestream","autoplay","controls","responsive","fluid","liveui","controlBar","pictureInPictureToggle","sources","videoJsOptions","setVideoJsOptions","source_url","PodDetailPod","setPod","setPodStatus","displayErrors","setDisplayErrors","setUrl","filename","setFilename","podStatusLabel","setPodStatusLabel","tooltipMessage","setTooltipMessage","source_file","podStatusMessage","getTooltipMessage","expiration_date","errorMessage","elements","order","PodDetailRules","setPodId","PodDetailCampaigns","PodDetail","setStatus","setStatusMessage","saveTime","aws_status_message","awsStatus","PodListSearchForm","usageStatuses","usage","setUsage","PodListTable","renderPodCampaigns","PodList","pageNumber","searchString","sortOrder","usageFilter","SpotDetailSpot","spot","sourceFile","sourceUrl","spotStatusLabel","spotStatus","protrackId","clientName","SpotDetailPods","spotNotReady","expirationDate","showAll","SpotDetail","sourceType","source","updated","pod_relations","filter","pr","returnSearchState","SpotListSearchForm","onSearchReset","SpotListTable","spots","spotPodsLength","spotPodsArray","renderSpotPods","renderSpotRows","SpotList","PodFormButtons","podFormValidation","showProgressBar","uploading","filesize","elementIds","x","Set","totalDuration","PodForm","setSourceType","setSourceUrl","setSourceFile","setExpirationDate","setDescription","setElements","originalElements","setOriginalElements","setSpots","originalSpots","setOriginalSpots","spotOptions","setSpotOptions","searchingForSpots","setSearchingForSpots","spotsChanged","setSpotsChanged","setTotalDuration","progress","setProgress","setShowProgressBar","statusFailed","setStatusFailed","spotToPodElement","returnEmptyElement","getDefaultSpotValue","podData","spotsData","spotsArray","totalSpotsDuration","reduce","a","b","css","changeContentIdNumber","updatedElements","getSpotsInUse","metadata","spot_id","getSpotSearchResultsDelayed","reportElements","Promise","resolve","encType","readOnly","elementsArray","activeClassName","onDrop","acceptedFiles","rejectedFiles","file","filetype","sourceFileBackend","s3Report","FormData","s3Url","fields","XMLHttpRequest","upload","addEventListener","progressEvent","lengthComputable","percentComplete","total","errorsArray","multiple","dangerouslySetInnerHTML","__html","aria-valuenow","aria-valuemin","aria-valuemax","getSpotSearchStatus","valueChanged","currentSpot","currentSpotId","spotsElement","elementsOrder","spotsTotalDuration","spotElement","stateElement","handleSpotsOnValueChange","addSpot","removeContentIdNumber","addContentIdNumber","rows","SpotFormButtons","spotFormValidation","SpotForm","failed","fileName","fileSize","fileType","pop","new_bucket","$spotId","ready","ReportsSearchForm","setField","setStart","setEnd","showPdfForm","setShowPdfForm","setInvoiceNumber","setInvoiceDate","setInvoiceDescription","setCustomerName","setCompanyName","setCompanyAddress","setCompanyCity","setCostPerView","setPodsOrderedByDate","setPodsOrderedByName","setColumnsToIncludeAirtime","setColumnsToIncludePodName","setColumnsToIncludeShownAfter","setColumnsToIncludeShownBefore","setColumnsToIncludeViewCount","encodeURIComponent","newStart","newEnd","isSame","ReportsTable","reports","meta","showed_after","showed_before","total_count","renderReportRows","ReportList","setReports","searchField","RuleDetailExceptions","exceptions","hasOwnProperty","exception","onClickDeleteException","RuleDetailSchedule","returnOrdinal","bymonthday","interval","weekLabel","values","labels","renderDays","byweekday","renderRepeatsWeekly","RuleDetail","isRuleLive","expireRule","deleteException","callback","RuleFormButtons","RuleFormTimeSlots","difference","timeSlot","select","selectedOptions","optionsArray","call","RuleForm","setFrequency","ruleInterval","setRuleInterval","ruleByweekday","setRuleByweekday","ruleBymonthday","setRuleBymonthday","airtimeType","setAirtimeType","setTimeslots","setShows","campaignOptions","setCampaignOptions","showOptions","setShowOptions","searchingForCampaigns","setSearchingForCampaigns","searchingForShows","setSearchingForShows","positionBeforeShow","setPositionBeforeShow","positionAfterShow","setPositionAfterShow","getDefaultShowsValue","position_before_show","position_after_show","getDefaultCampaignValue","getShowsInUse","showIds","getSelectSearchStatus","getCampaignSearchResultsDelayed","getShowSearchResultsDelayed","handleSelectOnValueChange","selectedValue","showsArray","changeRuleByweekday","startDateValidate","endDateValidate","position","afterTwoMonths","showBasedEndDate","ruleFormValidation","conflictData","addShow","ruleStatuses","statuses","defaultStatusValue","RuleListSearchForm","RuleListTable","renderRuleRows","RuleList","ScheduleByDayTitle","dayDisplay","ScheduleByDayButtons","yesterday","returnDay","tomorrow","dayOffset","ScheduleByDaySchedule","ScheduleByDay","returnFormattedDay","ScheduleByTimeslotButtons","aria-labelledby","returnTimeslot","change","lastIndex","newIndex","ScheduleByTimeslotJump","ScheduleByTimeslotSchedule","ScheduleByTimeslot","dynamicDay","urlDay","loadMore","newStartDate","generateEmptySchedule","daysToChange","overwrite","interstitial","newSchedule","Settings","dropbox","setDropbox","dropboxUrl","setDropboxUrl","setStationId","defaultStationLogo","setDefaultStationLogo","defaultStationAddress1","setDefaultStationAddress1","defaultStationAddress2","setDefaultStationAddress2","defaultStationTelephone","setDefaultStationTelephone","defaultStationWebsite","setDefaultStationWebsite","defaultCustomFooter","setDefaultCustomFooter","setCustomizationsId","customStationLogo","setCustomStationLogo","customStationAddress1","setCustomStationAddress1","customStationAddress2","setCustomStationAddress2","customStationTelephone","setCustomStationTelephone","customStationWebsite","setCustomStationWebsite","customCustomFooter","setCustomCustomFooter","showCustomizationsForm","setShowCustomizationsForm","uploadingStationLogo","setUploadingStationLogo","uploadingProgress","setUploadingProgress","savingCustomizations","setSavingCustomizations","deletingCustomizations","setDeletingCustomizations","integration","provider","provider_payload","account","display_name","avatar","photo_url","station_logo","station_address_1","station_address_2","station_telephone","station_website","custom_footer","cancelCustomizations","saveCustomizations","files","logoUrl","fileMetadata","preSignedPost","s3Data","onStationLogoDrop","event","UserFormButtons","users","UserForm","changeUserValue","removeUser","addUser","UserListTable","activated","onClickDeleteUser","UserList","getUsers","deleteUser","sentryDsns","defaults","sentry_dsn","host","dsn","ReactDOM","render","onUpdate","scrollTo","collapse","history","component","Reports","module","exports"],"mappings":"qHAKA,IAAUA,KA6FPC,QA5FCC,QAAU,SAASC,EAAQC,GAC3B,IAAIC,EAAM,GACRC,EAAe,CAAEC,MAAM,EAAIC,OAAO,EAAIC,KAAM,MAwF9C,OArFAT,EAAEU,KAAKP,EAAOQ,QAAQ,MAAO,KAAKC,MAAM,MAAM,SAASC,EAAGC,GACxD,IAEEC,EAFEC,EAAQF,EAAEF,MAAM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uery deparam is an extraction of the deparam method from Ben Alman's jQuery BBQ\n http://benalman.com/projects/jquery-bbq-plugin/\n*/\n(function($) {\n $.deparam = function(params, coerce) {\n var obj = {},\n coerce_types = { true: !0, false: !1, null: null };\n\n // Iterate over all name=value pairs.\n $.each(params.replace(/\\+/g, \" \").split(\"&\"), function(j, v) {\n var param = v.split(\"=\"),\n key = decodeURIComponent(param[0]),\n val,\n cur = obj,\n i = 0,\n // If key is more complex than 'foo', like 'a[]' or 'a[b][c]', split it\n // into its component parts.\n keys = key.split(\"][\"),\n keys_last = keys.length - 1;\n\n // If the first keys part contains [ and the last ends with ], then []\n // are correctly balanced.\n if (/\\[/.test(keys[0]) && /\\]$/.test(keys[keys_last])) {\n // Remove the trailing ] from the last keys part.\n keys[keys_last] = keys[keys_last].replace(/\\]$/, \"\");\n\n // Split first keys part into two parts on the [ and add them back onto\n // the beginning of the keys array.\n keys = keys\n .shift()\n .split(\"[\")\n .concat(keys);\n\n keys_last = keys.length - 1;\n } else {\n // Basic 'foo' style key.\n keys_last = 0;\n }\n\n // Are we dealing with a name=value pair, or just a name?\n if (param.length === 2) {\n val = decodeURIComponent(param[1]);\n\n // Coerce values.\n if (coerce) {\n val =\n val && !isNaN(val)\n ? +val // number\n : val === \"undefined\"\n ? undefined // undefined\n : coerce_types[val] !== undefined\n ? coerce_types[val] // true, false, null\n : val; // string\n }\n\n if (keys_last) {\n // Complex key, build deep object structure based on a few rules:\n // * The 'cur' pointer starts at the object top-level.\n // * [] = array push (n is set to array length), [n] = array if n is\n // numeric, otherwise object.\n // * If at the last keys part, set the value.\n // * For each keys part, if the current level is undefined create an\n // object or array based on the type of the next keys part.\n // * Move the 'cur' pointer to the next level.\n // * Rinse & repeat.\n for (; i <= keys_last; i++) {\n key = keys[i] === \"\" ? cur.length : keys[i];\n cur = cur[key] =\n i < keys_last\n ? cur[key] || (keys[i + 1] && isNaN(keys[i + 1]) ? {} : [])\n : val;\n }\n } else {\n // Simple key, even simpler rules, since only scalars and shallow\n // arrays are allowed.\n\n if ($.isArray(obj[key])) {\n // val is already an array, so push on the next value.\n obj[key].push(val);\n } else if (obj[key] !== undefined) {\n // val isn't an array, but since a second value has been specified,\n // convert val into an array.\n obj[key] = [obj[key], val];\n } else {\n // val is a scalar.\n obj[key] = val;\n }\n }\n } else if (key) {\n // No value was defined, so set something meaningful.\n obj[key] = coerce ? undefined : \"\";\n }\n });\n\n return obj;\n };\n})(jQuery);\n","import * as Sentry from \"@sentry/browser\";\n\nconst jQuery = window.jQuery;\n\nconst ajax = {\n beforeSend: beforeSend,\n contentType: `application/json; charset=utf-8`, // set Ajax calls to send JSON data;\n crossSiteProtectionCookieName: `csrftoken`, // CORS cookie to pass in Ajax calls;\n getCookie: getCookie,\n onFail: onFail,\n onFailWithExceptions: onFailWithExceptions\n};\n\nexport default ajax;\n\n//\n\n// function to attach to Ajax calls, it adds headers to enable CORS;\nfunction beforeSend(request) {\n request.setRequestHeader(\n `X-CSRFToken`,\n getCookie(ajax.crossSiteProtectionCookieName)\n );\n}\n\n// simple get cookie value function;\n// React doesn’t set cookies, so we don't need a full featured cookie lib;\nfunction getCookie(cookieName) {\n const match = document.cookie.match(new RegExp(cookieName + `=([^;]+)`));\n\n if (match) return match[1];\n}\n\n// Ajax failure function, attached to all Ajax calls;\n// will display the error message in a Bootstrap `alert` component;\nfunction onFail(jqXHR) {\n const alertContainer = jQuery(`.alert-container`);\n const json = jqXHR.responseJSON;\n\n // truncate the text error message if there is one;\n // the full error message is too large to display;\n let text = jqXHR.responseText ? jqXHR.responseText.substring(0, 800) : null;\n if ((jqXHR.status >= 500 && jqXHR.status <= 505) || text === null) {\n // display a friendlier message but log the error in the console\n console.error(text);\n Sentry.captureMessage(text);\n text = \"Something went wrong. Please refresh the page.\";\n }\n\n // create the container for the error message;\n const $alert = jQuery(`\n
\n \n
\n
`);\n\n // if there is an error in the API (not a server error);\n if (json) {\n Object.keys(json).forEach(key => {\n const $message = `${key.toUpperCase()}: ${\n json[key]\n }`;\n\n $alert.find(`.alert__messages`).prepend($message);\n });\n\n // if there is a server error;\n } else {\n const $message = `
${text}
`;\n\n $alert.find(`.alert__messages`).prepend($message);\n }\n\n // now that the error message has been determined and built, insert it into the page;\n // but only if it's not already there (if it's a new error)\n // also changing the order of the errors (latest last)\n // this is outside of React;\n\n alertContainer.children().each((index, alert) => {\n jQuery(alert).text() === $alert.text() && jQuery(alert).remove();\n });\n\n alertContainer.prepend($alert);\n}\n\n// Ajax failure function, attached to SOME Ajax calls;\n// will forward to the onFail function if the errors are not expected;\nfunction onFailWithExceptions(jqXHR) {\n const json = jqXHR.responseJSON;\n let ignoreThisError = false;\n\n // if there is an error in the API (not a server error);\n if (json) {\n Object.keys(json).forEach(key => {\n const jsonKey = json[key].toLowerCase();\n\n // user hasn’t logged in yet;\n if (jsonKey.indexOf(`authentication`) > -1) {\n ignoreThisError = true;\n }\n });\n }\n\n // only process errors if it’s not an authentication issue, or the user hasn’t selected a station;\n if (ignoreThisError === false) {\n onFail(jqXHR);\n }\n}\n","import ajax from \"./util-ajax\";\n\nconst jQuery = window.jQuery;\n\nconst ajaxDelete = {\n deleteDropboxIntegration: deleteDropboxIntegration,\n deleteElementFromPod: deleteElementFromPod,\n deleteExceptionFromRule: deleteExceptionFromRule,\n deletePod: deletePod,\n deleteSpot: deleteSpot,\n deleteSpotFromPod: deleteSpotFromPod,\n deletePodFromCampaign: deletePodFromCampaign,\n deleteRule: deleteRule,\n deleteCampaign: deleteCampaign,\n deleteInviteFromStation: deleteInviteFromStation,\n deleteUserFromStation: deleteUserFromStation,\n deleteInvoiceCustomizations: deleteInvoiceCustomizations\n};\n\nexport default ajaxDelete;\n\n//\n\nfunction deleteDropboxIntegration(integrationId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/station/integrations/${integrationId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deleteElementFromPod(elementId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/pods/elements/${elementId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deleteExceptionFromRule(exceptionId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/rules/exceptions/${exceptionId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deletePod(podId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/pods/${podId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deleteSpotFromPod(podId, spotId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/pods/${podId}/spots/${spotId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deletePodFromCampaign(campaignId, podId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/campaigns/${campaignId}/pods/${podId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deleteSpot(podId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/spots/${podId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deleteCampaign(campaignId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/campaigns/${campaignId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deleteRule(ruleId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/rules/${ruleId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deleteInviteFromStation(inviteId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/station/invites/${inviteId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deleteUserFromStation(userId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/station/users/${userId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction deleteInvoiceCustomizations(customizationsId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `delete`,\n url: `/api/reports/station-customizations/${customizationsId}/`\n })\n .fail(ajax.onFail);\n}\n","import ajax from \"./util-ajax\";\n\nconst jQuery = window.jQuery;\n\nconst ajaxGet = {\n getCampaign: getCampaign,\n getCampaigns: getCampaigns,\n getChangeLog: getChangeLog,\n getConflicts: getConflicts,\n getException: getException,\n getIntegrations: getIntegrations,\n getInterstitialsByDay: getInterstitialsByDay,\n getInterstitialsByTimeslot: getInterstitialsByTimeslot,\n getInterstitialsByWeek: getInterstitialsByWeek,\n getInvoiceCustomizations: getInvoiceCustomizations,\n getInvoiceDefaults: getInvoiceDefaults,\n getLivestreamData: getLivestreamData,\n getPod: getPod,\n getPods: getPods,\n getPodStatus: getPodStatus,\n getPodsNotifications: getPodsNotifications,\n getPodsForCampaign: getPodsForCampaign,\n getReports: getReports,\n getReportsCSV: getReportsCSV,\n getReportsPDF: getReportsPDF,\n getRoles: getRoles,\n getRule: getRule,\n getRules: getRules,\n getS3Url: getS3Url,\n getScheduleByDay: getScheduleByDay,\n getScheduleByWeek: getScheduleByWeek,\n getSchedulesInterstitialsCSV: getSchedulesInterstitialsCSV,\n getSearchResults: getSearchResults,\n getShows: getShows,\n getSpot: getSpot,\n getSpots: getSpots,\n getSpotsForPod: getSpotsForPod,\n getStation: getStation,\n getStationChangeLog: getStationChangeLog,\n getStationIntegrations: getStationIntegrations,\n getStationInvites: getStationInvites,\n getStationInvite: getStationInvite,\n getStationUsers: getStationUsers,\n getStationUser: getStationUser,\n getUser: getUser\n};\n\nexport default ajaxGet;\n\n//\n\nfunction getCampaign(campaignId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/campaigns/${campaignId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getCampaigns(config) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n ordering: config.sort,\n page: config.page,\n search: config.search\n },\n method: `get`,\n url: `/api/campaigns/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getChangeLog(config) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n page: config.page,\n sort: config.sort\n },\n method: `get`,\n url: `/api/history/all/${config.contentType}/${config.id}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getConflicts() {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/conflicts/`\n })\n .fail(ajax.onFailWithExceptions);\n}\n\nfunction getException(id) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/rules/exceptions/${id}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getIntegrations() {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/integrations/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getInterstitialsByDay(day) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/interstitials/day/${day}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getInterstitialsByTimeslot(timeslot, start, days = 7) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n start: start,\n days: days\n },\n method: `get`,\n url: `/api/interstitials/timeslot/${timeslot}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getInterstitialsByWeek(sunday) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/interstitials/week/${sunday}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getPod(podId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/pods/${podId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getPods(config) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n ordering: config.sort,\n page: config.page,\n search: config.search,\n aws_status: config.aws_status,\n unused: config.unused\n },\n method: `get`,\n url: `/api/pods/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getPodStatus(podId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/pods/status/${podId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getPodsNotifications(podId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: podId\n ? `/api/pods/notifications/?pod_id=${podId}`\n : `/api/pods/notifications/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getPodsForCampaign(campaignId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n ordering: `name`\n },\n method: `get`,\n url: `/api/campaigns/${campaignId}/pods/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getReports(config) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n end: config.end,\n page: config.page,\n start: config.start,\n field: config.field,\n q: config.search\n },\n method: `get`,\n url: `/api/reports/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getInvoiceCustomizations() {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/reports/station-customizations/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getInvoiceDefaults() {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/reports/station-defaults/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getReportsCSV(config) {\n // trigger the file download;\n // no, this isn't an Ajax call, but it's the only one of the app;\n return `/api/reports/download/?field=${config.field}&q=${config.search}&start=${config.start}&end=${config.end}`;\n}\n\nfunction getReportsPDF(config) {\n // trigger the file download;\n // no, this isn't an Ajax call, but it's the only one of the app;\n return (\n `/api/reports/download/pdf/?` +\n `field=${config.field}&q=${config.search}&start=${config.start}&end=${config.end}` +\n `&invoice_number=${config.invoiceNumber}&invoice_date=${config.invoiceDate}` +\n `&customer_name=${config.customerName}&company_name=${config.companyName}` +\n `&company_address=${config.companyAddress}&company_city=${config.companyCity}` +\n `&invoice_description=${config.invoiceDescription}` +\n `&cost_per_view=${config.costPerView}` +\n `&pods_ordered_by_date=${config.podsOrderedByDate}` +\n `&pods_ordered_by_name=${config.podsOrderedByName}` +\n `&columns_to_include_airtime=${config.columnsToIncludeAirtime}` +\n `&columns_to_include_pod_name=${config.columnsToIncludePodName}` +\n `&columns_to_include_shown_after=${config.columnsToIncludeShownAfter}` +\n `&columns_to_include_shown_before=${config.columnsToIncludeShownBefore}` +\n `&columns_to_include_view_count=${config.columnsToIncludeViewCount}`\n );\n}\n\nfunction getSchedulesInterstitialsCSV(startDate, endDate) {\n // trigger the file download;\n return `/api/schedules_interstitials/download/?start_date=${startDate}&end_date=${endDate}`;\n}\n\nfunction getRoles() {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/groups/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getRule(ruleId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/rules/${ruleId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getRules(config) {\n // status and timeslot are tracked differently on the FE;\n // all is not a valid BE value, but it is for the FE;\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n ordering: config.sort,\n page: config.page,\n search: config.search,\n state: config.status === `all` ? null : config.status,\n timeslot: config.timeslot === `All` ? null : config.timeslot\n },\n method: `get`,\n url: `/api/rules/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getS3Url(report) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n method: `post`,\n data: JSON.stringify(report),\n url: `/api/files/sign-file/?format=json`\n })\n .fail(ajax.onFail);\n}\n\nfunction getScheduleByDay(day) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/schedules/day/${day}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getScheduleByWeek(sunday) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/schedules/week/${sunday}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getSearchResults(searchTerm, type) {\n return jQuery.when(\n jQuery.ajax({\n beforeSend: ajax.beforeSend,\n data: {\n ordering: `name`,\n page: 1,\n search: searchTerm\n },\n method: `get`,\n url: `/api/${type}/`\n })\n );\n}\n\nfunction getShows(config) {\n return jQuery.when(\n jQuery.ajax({\n beforeSend: ajax.beforeSend,\n data: {\n search: config.searchTerm,\n exclude: config.excludeShows\n },\n method: `get`,\n url: `/api/shows/`\n })\n );\n}\n\nfunction getSpot(spotId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/spots/${spotId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getSpots(config) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n ordering: config.sort,\n page: config.page,\n search: config.search,\n aws_status: config.aws_status,\n unused: config.unused,\n exclude: config.exclude\n },\n method: `get`,\n url: `/api/spots/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getSpotsForPod(podId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/pods/${podId}/spots/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getStation() {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/station/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getStationChangeLog(config) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n page: config.page,\n sort: config.sort\n },\n method: `get`,\n url: `/api/history/all/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getStationIntegrations() {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/station/integrations/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getStationInvites(config) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n page: config.page\n },\n method: `get`,\n url: `/api/station/invites/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getStationInvite(id) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/station/invites/${id}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getStationUsers(config) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n data: {\n page: config.page\n },\n method: `get`,\n url: `/api/station/users/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getStationUser(id) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/station/users/${id}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction getUser() {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/user/`\n })\n .fail(ajax.onFailWithExceptions);\n}\n\nfunction getLivestreamData() {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n method: `get`,\n url: `/api/livestream/`\n })\n .fail(ajax.onFail);\n}\n","import ajax from \"./util-ajax\";\n\nconst jQuery = window.jQuery;\n\nconst ajaxSave = {\n saveCampaign: saveCampaign,\n saveElement: saveElement,\n updateElementsForPod: updateElementsForPod,\n saveException: saveException,\n saveFileToS3: saveFileToS3,\n saveInvite: saveInvite,\n savePod: savePod,\n savePodToCampaign: savePodToCampaign,\n saveSpotsToPod: saveSpotsToPod,\n saveSpot: saveSpot,\n saveRule: saveRule,\n saveRuleAsExpired: saveRuleAsExpired,\n saveStation: saveStation,\n savePodNotification: savePodNotification,\n saveInvoiceCustomizations: saveInvoiceCustomizations\n};\n\nexport default ajaxSave;\n\n//\n\nfunction saveCampaign(campaignId, report) {\n return jQuery.ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify(report),\n method: campaignId === 0 ? `post` : `put`,\n url: campaignId === 0 ? `/api/campaigns/` : `/api/campaigns/${campaignId}/`\n });\n}\n\nfunction saveElement(elementId, report) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify(report),\n method: elementId === 0 ? `post` : `put`,\n url:\n elementId === 0\n ? `/api/pods/elements/`\n : `/api/pods/elements/${elementId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction updateElementsForPod(podId, report) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify(report),\n method: `post`,\n url: `/api/pods/${podId}/elements/`\n })\n .fail(ajax.onFail);\n}\n\nfunction saveException(ruleId, report) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify(report),\n method: `post`,\n url: `/api/conflicts/${ruleId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction saveFileToS3(report, url, progressCallback) {\n return jQuery\n .ajax({\n beforeSend: request => {\n request.setRequestHeader(`x-amz-acl`, `public-read`);\n request.setRequestHeader(\n `X-CSRFToken`,\n ajax.getCookie(ajax.crossSiteProtectionCookieName)\n );\n },\n xhr: progressCallback,\n contentType: false,\n data: report,\n method: `post`,\n processData: false,\n url: url\n })\n .fail(ajax.onFail);\n}\n\nfunction saveInvite(inviteId, report) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify(report),\n method: inviteId === 0 ? `post` : `put`,\n url:\n inviteId === 0\n ? `/api/station/invites/`\n : `/api/station/invites/${inviteId}/`\n })\n .fail(ajax.onFail);\n}\n\nfunction savePod(podId, report) {\n return jQuery.ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify(report),\n method: podId === 0 ? `post` : `put`,\n url: podId === 0 ? `/api/pods/` : `/api/pods/${podId}/`\n });\n}\n\nfunction saveSpotsToPod(podId, spotIds) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify({\n spot_ids: spotIds\n }),\n method: `post`,\n url: `/api/pods/${podId}/spots/`\n })\n .fail(ajax.onFail);\n}\n\nfunction savePodToCampaign(campaignId, podId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify({\n pod_id: podId\n }),\n method: `post`,\n url: `/api/campaigns/${campaignId}/pods/`\n })\n .fail(ajax.onFail);\n}\n\nfunction saveSpot(spotId, report) {\n return jQuery.ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify(report),\n method: spotId === 0 ? `post` : `put`,\n url: spotId === 0 ? `/api/spots/` : `/api/spots/${spotId}/`\n });\n}\n\nfunction saveRule(ruleId, report) {\n return jQuery.ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify(report),\n method: ruleId === 0 ? `post` : `put`,\n url: ruleId === 0 ? `/api/rules/` : `/api/rules/${ruleId}/`\n });\n}\n\nfunction saveRuleAsExpired(ruleId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n method: `post`,\n url: `/api/rules/${ruleId}/expire/`\n })\n .fail(ajax.onFail);\n}\n\nfunction saveStation(stationId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify({\n station_id: stationId\n }),\n method: `put`,\n url: `/api/user/change-station/`\n })\n .fail(ajax.onFailWithExceptions);\n}\n\nfunction savePodNotification(podId, notificationStatus, podNotificationId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: podNotificationId\n ? JSON.stringify({\n aws_transcode_notification_seen: notificationStatus\n })\n : JSON.stringify({\n pod: podId,\n aws_transcode_notification_seen: notificationStatus\n }),\n method: podNotificationId ? `patch` : `post`,\n url: podNotificationId\n ? `/api/pods/notifications/${podNotificationId}/`\n : `/api/pods/notifications/`\n })\n .fail(ajax.onFail);\n}\n\nfunction saveInvoiceCustomizations(customizations, customizationsId) {\n return jQuery\n .ajax({\n beforeSend: ajax.beforeSend,\n contentType: ajax.contentType,\n data: JSON.stringify(customizations),\n method: customizationsId === 0 ? `post` : `put`,\n url:\n customizationsId === 0\n ? `/api/reports/station-customizations/`\n : `/api/reports/station-customizations/${customizationsId}/`\n })\n .fail(ajax.onFail);\n}\n","const contentStatic = {\n // date formats;\n // not all are specified here, just the reusable ones;\n dateFormatComputer: `YYYY-MM-DD`,\n dateFormatHumanLong: `MMM D, YYYY`,\n dateFormatHumanShort: `ddd M/D`,\n dateFormatRangeLong: `M/D/YYYY`,\n dateFormatRangeShort: `M/D`,\n\n // Ajax forced delays;\n // this allows the user to see the flow as opposed to the pages swapping faster than the eye can track;\n // increase the delay as the user gets closer to the form, makes the content feel more important;\n delayForm: 1000,\n delayDetail: 750,\n delayList: 500,\n\n days: days(),\n objectTypes: objectTypes(),\n podStatuses: podStatuses(),\n podElementFields: podElementFields(),\n timeSlots: timeSlots(),\n\n // define how many records to show per page in the List components;\n podResultsPerPage: 20,\n spotResultsPerPage: 20,\n campaignResultsPerPage: 20,\n changeLogResultsPerPage: 20,\n inviteResultsPerPage: 20,\n reportsResultsPerPage: 20,\n ruleResultsPerPage: 20,\n daysPerTimeSlotPerPage: 14,\n userResultsPerPage: 20,\n\n // Pod Form default values;\n podFormDefaultSourceFile: ` Drop MP4 or QuickTime file to attach, or browse.`,\n podFormMaxFilesize: 2048, // MB\n podFormMinDuration: 64.1,\n podFormMaxDuration: 65.5,\n // Spot Form default values;\n spotFormDefaultSourceFile: ` Drop MP4, QuickTime or MXF file to attach, or browse.`,\n spotFormMaxFilesize: 2048, // MB\n\n // no results display messages;\n zeroPodsMessage: `No pods to display.`,\n zeroSpotsMessage: `No spots to display.`,\n zeroCampaignsMessage: `No campaigns to display.`,\n zeroLogsMessage: `No change log to display.`,\n zeroReportsMessage: `No reports to display.`,\n zeroRulesMessage: `No rules to display.`,\n zeroExceptionsMessage: `No exceptions to display.`,\n zeroInvitesMessage: `No invites to display.`,\n zeroUsersMessage: `No users to display.`,\n zeroStationsMessage: `You are not associated with any stations`\n};\n\nexport default contentStatic;\n\n//\n\n// transform Django content types into a more readable URL;\nfunction objectTypes() {\n return [\n {\n key: `rules.ruleexception`,\n path: `exception`\n },\n {\n key: `rules.rule`,\n path: `rule`\n },\n {\n key: `pods.pod`,\n path: `pod`\n },\n {\n key: `campaigns.campaign`,\n path: `campaign`\n },\n {\n key: `users.user`,\n path: `user`\n }\n ];\n}\n\n// return an array of days in display order;\nfunction days() {\n return [\n {\n label: `Sunday`,\n value: 6\n },\n {\n label: `Monday`,\n value: 0\n },\n {\n label: `Tuesday`,\n value: 1\n },\n {\n label: `Wednesday`,\n value: 2\n },\n {\n label: `Thursday`,\n value: 3\n },\n {\n label: `Friday`,\n value: 4\n },\n {\n label: `Saturday`,\n value: 5\n }\n ];\n}\n\n// return an array of pod statuses;\nfunction podStatuses() {\n return [\n {\n label: `All`,\n value: 0\n },\n {\n label: `Processing`,\n value: 1\n },\n {\n label: `Ready`,\n value: 2\n },\n {\n label: `Failed`,\n value: 3\n }\n ];\n}\n\n// return an array of pod element fields;\n// including here the Campaign and the Rule options;\n// because the Reporting part could be changed;\n// so, no point in creating a separate list for this now;\nfunction podElementFields() {\n return [\n {\n label: `Pod`,\n value: `pod_name`\n },\n {\n label: `Campaign`,\n value: `campaign_name`\n },\n {\n label: `Rule`,\n value: `rule_name`\n },\n {\n label: `Element ID`,\n value: `element_ids`\n },\n {\n label: `Protrack ID`,\n value: `protrack_ids`\n },\n {\n label: `Client Name`,\n value: `client_names`\n },\n {\n label: `Spot Name`,\n value: `spot_names`\n },\n {\n label: `Tape`,\n value: `tapes`\n },\n {\n label: `Order`,\n value: `orders`\n }\n ];\n}\n\n// possible values for the rule time slot field;\nfunction timeSlots() {\n const timeslots = [];\n\n for (let i = 0; i <= 23; i = i + 1) {\n const prefix = i < 10 ? `0` : ``;\n const timeString28 = `${prefix}${i}:28`;\n const timeString58 = `${prefix}${i}:58`;\n\n timeslots.push(timeString28);\n timeslots.push(timeString58);\n }\n\n return timeslots;\n}\n","import moment from \"moment\";\nimport contentStatic from \"./util-content-static\";\nimport _ from \"lodash\";\nimport React from \"react\";\n\nconst jQuery = window.jQuery;\n\nconst contentDynamic = {\n renderModal: renderModal,\n renderShowsNames: renderShowsNames,\n returnCleanTimeSlot: returnCleanTimeSlot,\n returnCleanTimeSlots: returnCleanTimeSlots,\n returnShowNames: returnShowNames,\n returnLineNumber: returnLineNumber,\n returnChangeLogPath: returnChangeLogPath,\n returnPaginationUrl: returnPaginationUrl,\n returnPodStatus: returnPodStatus,\n returnSpotStatus: returnSpotStatus,\n returnRepeatValue: returnRepeatValue,\n returnSimpleSelectOptions: returnSimpleSelectOptions,\n returnSimpleSelectOptionsForShows: returnSimpleSelectOptionsForShows,\n returnSimpleSelectOptionsForSpots: returnSimpleSelectOptionsForSpots,\n returnSortClass: returnSortClass,\n returnSortValue: returnSortValue,\n returnSunday: returnSunday,\n alertInfo: alertInfo,\n alertPodInfo: alertPodInfo,\n formatVideoError: formatVideoError\n};\n\nexport default contentDynamic;\n\n//\n\n// return a jQuery object used to insert into the page;\nfunction renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n) {\n const $modal = jQuery(`
\n
\n
\n
\n \n

${title}

\n
\n
\n ${body}\n
\n
\n \n ${buttonTextLoading}\">\n \n ${buttonTextDefault}\n \n
\n
\n
\n
`);\n\n // once the modal is closed, remove it from the DOM;\n // one and done modal;\n $modal.on(`hidden.bs.modal`, () => {\n $modal.remove();\n });\n\n return $modal;\n}\n\n// used by returnSortClass and returnSortValue because the default value may be either;\nfunction returnCleanedSortValue(sort) {\n const asc = sort.replace(`-`, ``);\n\n return {\n asc: asc,\n desc: `-${asc}`\n };\n}\n\n// remove the seconds from a time slot (we never want to display those);\nfunction returnCleanTimeSlot(timeslot = ``) {\n return timeslot.replace(`:00`, ``);\n}\n\n// remove the seconds from all the time slots in the array;\nfunction returnCleanTimeSlots(timeslots = []) {\n const newTimeslots = [];\n\n timeslots &&\n timeslots.forEach(timeslot => {\n newTimeslots.push(returnCleanTimeSlot(timeslot));\n });\n\n return newTimeslots;\n}\n\n// getting the Shows names\nfunction returnShowNames(shows) {\n const showNames = [];\n\n shows &&\n shows.forEach(show => {\n showNames.push(show.label);\n });\n\n return showNames;\n}\n\nfunction renderShowsNames(shows) {\n const showNames = returnShowNames(shows);\n\n let showsList = null;\n showsList = showNames.map((show, index) =>
{show}
);\n // only displaying the first 2 Shows\n // and add '...' at the end, for longer list of Shows\n if (showNames.length > 2) {\n showsList = showsList.splice(0, 2);\n showsList.push(
...
);\n }\n return showsList;\n}\n\n// return 1 -> X for table row numbers;\n// page 1 will be 1 -> 20, page 5 will be 101 -> 120 (when resultsPerPage = 20);\nfunction returnLineNumber(currentPage, resultsPerPage, index) {\n return (currentPage - 1) * resultsPerPage + (index + 1);\n}\n\n// find the object based off the Django content_type value;\n// of find the object by the path in the url;\nfunction returnChangeLogPath(contentType) {\n let pathObj = ``;\n\n contentStatic.objectTypes.forEach(obj => {\n if (obj.key === contentType || obj.path === contentType) {\n pathObj = obj;\n }\n });\n\n return pathObj;\n}\n\n// function used by all three pagination links;\n// works for components with and without sort;\nfunction returnPaginationUrl(path, page, search) {\n let url = `/${path}/${page}/`;\n\n if (search) {\n url = `${url}${search}`;\n }\n\n return url;\n}\n\n// transform pod status ids into text;\nfunction returnPodStatus(index = 0) {\n return contentStatic.podStatuses[index].label;\n}\n\nfunction returnSpotStatus(index = 0) {\n return contentStatic.podStatuses[index].label;\n}\n\n// transform rule repeat ids into text;\nfunction returnRepeatValue(id) {\n const repeatValues = [\n `N/A`, // 0 - not in use;\n `Monthly`, // 1\n `Weekly`, // 2\n `Daily` // 3\n ];\n\n return repeatValues[id];\n}\n\n// add label/value properties to each object in the array;\n// used in the SimpleSelect components;\nfunction returnSimpleSelectOptions(options) {\n const newOptions = [];\n\n options.forEach(option => {\n newOptions.push({\n label: option.name,\n value: option.id,\n id: option.id.toString()\n });\n });\n\n return newOptions;\n}\n\nfunction returnSimpleSelectOptionsForShows(options) {\n const newOptions = [];\n\n options.forEach(option => {\n newOptions.push({\n label: option.title,\n value: option.program_id,\n id: option.program_id.toString()\n });\n });\n\n return newOptions;\n}\n\nfunction returnSimpleSelectOptionsForSpots(options) {\n const newOptions = [];\n\n options.forEach(option => {\n let duration_s = (option.duration / 1000).toFixed(2);\n newOptions.push({\n label: `${option.name} (${duration_s} s)`,\n value: option.id,\n id: option.id.toString(),\n pod: 0,\n element_id: option.element_id,\n client_name: option.client_name,\n spot_name: option.name,\n protrack_id: option.protrack_id,\n tape: option.tape,\n duration: duration_s.toString()\n });\n });\n\n return newOptions;\n}\n\n// used by all sortable tables;\n// returns a class (default, asc, desc) based on current values;\nfunction returnSortClass(newSort, currentSort) {\n const cleanedSort = returnCleanedSortValue(newSort);\n let className = `sort`;\n\n if (cleanedSort.asc === currentSort) {\n className = `sort-asc`;\n } else if (cleanedSort.desc === currentSort) {\n className = `sort-desc`;\n }\n\n return className;\n}\n\n// used by all sortable lists;\n// reverses the sort if it is the currently selected one;\n// newSort may be negative so we need to base our variations off of an altered version of it;\nfunction returnSortValue(newSort, currentSort) {\n const cleanedSort = returnCleanedSortValue(newSort);\n let returnSort = newSort;\n\n // change the value if this sort link is the current sort;\n if (currentSort === cleanedSort.asc || currentSort === cleanedSort.desc) {\n returnSort =\n currentSort === cleanedSort.asc ? cleanedSort.desc : cleanedSort.asc;\n }\n\n return returnSort;\n}\n\n// convert date to a sunday;\n// and adjust by week;\nfunction returnSunday(date = new Date(), week = 0) {\n const setToSunday = 0;\n const setToWeek = week * 7;\n\n return moment(date)\n .day(setToSunday)\n .day(setToWeek)\n .format(contentStatic.dateFormatComputer);\n}\n\n// text notification function;\n// will display a notification in a Bootstrap `alert` component;\nfunction alertInfo(text) {\n // create the container for the info message;\n const $alert = jQuery(`\n
\n \n
\n
`);\n\n const $message = `
${text}
`;\n\n $alert.find(`.alert__info-messages`).prepend($message);\n\n // now that the error message has been determined and built, insert it into the page;\n // this is outside of React;\n jQuery(`.alert-container`).prepend($alert);\n}\n\n// text notification function;\n// will display a notification in a Bootstrap `success` or a `danger`(fail) component;\nfunction alertPodInfo(text, status) {\n // create the container for the info message;\n const $alert = jQuery(`\n
\n \n
\n
`);\n\n const $message = `
${text}
`;\n\n $alert.find(`.alert__pod-messages`).prepend($message);\n\n // now that the error message has been determined and built, insert it into the page;\n // this is outside of React;\n jQuery(`.alert-container`).prepend($alert);\n\n // it will get auto-removed after 60 seconds\n setTimeout(() => {\n $alert.remove();\n }, 60000);\n}\n\nfunction formatVideoError(statusMessage) {\n if (typeof statusMessage != \"string\") {\n console.warn(\n \"formatVideoError received strange value \",\n typeof statusMessage\n );\n return [];\n }\n\n if (!statusMessage) {\n return [];\n }\n\n // need to convert the message to JSON so we can display only the relevant parts;\n // convert error JSON into an error message;\n let messageStatus = {};\n const errors = [];\n\n try {\n messageStatus = JSON.parse(\n statusMessage.replace(`File verification failed: `, ``).replace(/'/g, `\"`)\n );\n } catch (e) {\n // fallback to displaying the raw error message if it's not a valid json\n return [statusMessage];\n }\n\n // if video is present in the errors, only display video errors;\n if (messageStatus.Video) {\n Object.keys(messageStatus.Video).forEach((key, index) => {\n errors.push(messageStatus.Video[key][0]);\n });\n }\n // if audio is present, and general is not, only display audio errors with a prefix;\n else if (messageStatus.Audio && messageStatus.General === undefined) {\n Object.keys(messageStatus.Audio).forEach((key, index) => {\n errors.push(`Audio: ${messageStatus.Audio[key][0]}`);\n });\n }\n // otherwise display all errors;\n else {\n Object.keys(messageStatus).forEach((statusKey, index) => {\n Object.keys(messageStatus[statusKey]).forEach((typeKey, index) => {\n errors.push(messageStatus[statusKey][typeKey][0]);\n });\n });\n }\n\n // remove any duplicate errors (the same error can be part of video/audio/general);\n const displayErrors = _.uniq(errors);\n\n return displayErrors;\n}\n","import util from \"../util/util\";\n\nconst contentUrls = {\n returnCampaignListUrl: returnCampaignListUrl,\n returnCampaignDetailUrl: returnCampaignDetailUrl,\n returnCampaignFormUrl: returnCampaignFormUrl,\n returnChangeLogListUrl: returnChangeLogListUrl,\n returnChangeLogDetailUrl: returnChangeLogDetailUrl,\n returnConflictFormUrl: returnConflictFormUrl,\n returnInviteListUrl: returnInviteListUrl,\n returnInviteFormUrl: returnInviteFormUrl,\n returnLivestreamUrl: returnLivestreamUrl,\n returnPodListUrl: returnPodListUrl,\n returnPodDetailUrl: returnPodDetailUrl,\n returnPodFormUrl: returnPodFormUrl,\n returnReportsUrl: returnReportsUrl,\n returnRuleListUrl: returnRuleListUrl,\n returnRuleDetailUrl: returnRuleDetailUrl,\n returnRuleFormUrl: returnRuleFormUrl,\n returnScheduleWeekUrl: returnScheduleWeekUrl,\n returnScheduleDayUrl: returnScheduleDayUrl,\n returnScheduleTimeSlotUrl: returnScheduleTimeSlotUrl,\n returnSettingsUrl: returnSettingsUrl,\n returnSpotDetailUrl: returnSpotDetailUrl,\n returnSpotFormUrl: returnSpotFormUrl,\n returnSpotListUrl: returnSpotListUrl,\n returnUserListUrl: returnUserListUrl,\n returnUserFormUrl: returnUserFormUrl\n};\n\nexport default contentUrls;\n\n//\n\nfunction returnCampaignListUrl(page = 1) {\n return `/campaigns/${page}/`;\n}\n\nfunction returnCampaignDetailUrl(id) {\n return `/campaign/${id}/`;\n}\n\nfunction returnCampaignFormUrl(campaignId = 0, podId) {\n let url = `/campaign/form/${campaignId}/`;\n\n if (podId) {\n url = `${url}pod/${podId}/`;\n }\n\n return url;\n}\n\nfunction returnChangeLogListUrl(page = 1) {\n return `/changelog/${page}/`;\n}\n\nfunction returnChangeLogDetailUrl(objType, id, page = 1) {\n const pathObj = util.returnChangeLogPath(objType);\n\n return `/changelog/${pathObj.path}/${id}/${page}/`;\n}\n\nfunction returnConflictFormUrl(count) {\n let url = `/conflicts/`;\n\n if (count) {\n url = `${url}${count}/`;\n }\n\n return url;\n}\n\nfunction returnInviteListUrl(page = 1) {\n return `/invites/${page}/`;\n}\n\nfunction returnInviteFormUrl(id = 0) {\n return `/invite/form/${id}/`;\n}\n\nfunction returnLivestreamUrl() {\n return `/livestream/`;\n}\n\nfunction returnPodListUrl(page = 1) {\n return `/pods/${page}/`;\n}\n\nfunction returnPodDetailUrl(id) {\n return `/pod/${id}/`;\n}\n\nfunction returnPodFormUrl(id = 0, spotId = null) {\n let url = `/pod/form/${id}/`;\n\n if (spotId) {\n url = `${url}spot/${spotId}/`;\n }\n\n return url;\n}\n\nfunction returnReportsUrl(page = 1) {\n return `/reports/${page}/`;\n}\n\nfunction returnRuleListUrl(page = 1) {\n return `/rules/${page}/`;\n}\n\nfunction returnRuleDetailUrl(id) {\n return `/rule/${id}/`;\n}\n\nfunction returnRuleFormUrl(ruleId = 0, podId, campaignId) {\n let url = `/rule/form/${ruleId}/`;\n\n if (podId) {\n url = `${url}pod/${podId}/`;\n } else if (campaignId) {\n url = `${url}campaign/${campaignId}/`;\n }\n\n return url;\n}\n\nfunction returnScheduleWeekUrl(day = util.returnSunday()) {\n return `/schedule/week/${day}/`;\n}\n\nfunction returnScheduleDayUrl(day = util.returnSunday()) {\n return `/schedule/day/${day}/`;\n}\n\nfunction returnScheduleTimeSlotUrl(timeslot, day) {\n return `/schedule/timeslot/${timeslot}/${day}/`;\n}\n\nfunction returnSettingsUrl() {\n return `/settings/`;\n}\n\nfunction returnSpotDetailUrl(id) {\n return `/spot/${id}/`;\n}\n\nfunction returnSpotFormUrl(id = 0) {\n return `/spot/form/${id}/`;\n}\n\nfunction returnSpotListUrl(page = 1) {\n return `/spots/${page}/`;\n}\n\nfunction returnUserListUrl(page = 1) {\n return `/users/${page}/`;\n}\n\nfunction returnUserFormUrl(id = 0) {\n return `/user/form/${id}/`;\n}\n","import ajaxDelete from \"./util-ajax-delete\";\nimport ajaxGet from \"./util-ajax-get\";\nimport ajaxSave from \"./util-ajax-save\";\nimport contentDynamic from \"./util-content-dynamic\";\nimport contentStatic from \"./util-content-static\";\nimport contentUrls from \"./util-content-urls\";\n\nconst util = {\n deleteDropboxIntegration: ajaxDelete.deleteDropboxIntegration,\n deleteElementFromPod: ajaxDelete.deleteElementFromPod,\n deleteExceptionFromRule: ajaxDelete.deleteExceptionFromRule,\n deletePod: ajaxDelete.deletePod,\n deleteSpot: ajaxDelete.deleteSpot,\n deleteSpotFromPod: ajaxDelete.deleteSpotFromPod,\n deletePodFromCampaign: ajaxDelete.deletePodFromCampaign,\n deleteRule: ajaxDelete.deleteRule,\n deleteCampaign: ajaxDelete.deleteCampaign,\n deleteInviteFromStation: ajaxDelete.deleteInviteFromStation,\n deleteUserFromStation: ajaxDelete.deleteUserFromStation,\n deleteInvoiceCustomizations: ajaxDelete.deleteInvoiceCustomizations,\n\n getCampaign: ajaxGet.getCampaign,\n getCampaigns: ajaxGet.getCampaigns,\n getChangeLog: ajaxGet.getChangeLog,\n getConflicts: ajaxGet.getConflicts,\n getException: ajaxGet.getException,\n getIntegrations: ajaxGet.getIntegrations,\n getInterstitialsByDay: ajaxGet.getInterstitialsByDay,\n getInterstitialsByTimeslot: ajaxGet.getInterstitialsByTimeslot,\n getInterstitialsByWeek: ajaxGet.getInterstitialsByWeek,\n getInvoiceCustomizations: ajaxGet.getInvoiceCustomizations,\n getInvoiceDefaults: ajaxGet.getInvoiceDefaults,\n getLivestreamData: ajaxGet.getLivestreamData,\n getPod: ajaxGet.getPod,\n getPods: ajaxGet.getPods,\n getPodStatus: ajaxGet.getPodStatus,\n getPodsNotifications: ajaxGet.getPodsNotifications,\n getPodsForCampaign: ajaxGet.getPodsForCampaign,\n getReports: ajaxGet.getReports,\n getReportsCSV: ajaxGet.getReportsCSV,\n getReportsPDF: ajaxGet.getReportsPDF,\n getRoles: ajaxGet.getRoles,\n getRule: ajaxGet.getRule,\n getRules: ajaxGet.getRules,\n getS3Url: ajaxGet.getS3Url,\n getScheduleByDay: ajaxGet.getScheduleByDay,\n getScheduleByWeek: ajaxGet.getScheduleByWeek,\n getSchedulesInterstitialsCSV: ajaxGet.getSchedulesInterstitialsCSV,\n getSearchResults: ajaxGet.getSearchResults,\n getShows: ajaxGet.getShows,\n getSpot: ajaxGet.getSpot,\n getSpots: ajaxGet.getSpots,\n getSpotsForPod: ajaxGet.getSpotsForPod,\n getStation: ajaxGet.getStation,\n getStationChangeLog: ajaxGet.getStationChangeLog,\n getStationIntegrations: ajaxGet.getStationIntegrations,\n getStationInvites: ajaxGet.getStationInvites,\n getStationInvite: ajaxGet.getStationInvite,\n getStationUsers: ajaxGet.getStationUsers,\n getStationUser: ajaxGet.getStationUser,\n getUser: ajaxGet.getUser,\n\n saveCampaign: ajaxSave.saveCampaign,\n saveElement: ajaxSave.saveElement,\n updateElementsForPod: ajaxSave.updateElementsForPod,\n saveException: ajaxSave.saveException,\n saveFileToS3: ajaxSave.saveFileToS3,\n saveInvite: ajaxSave.saveInvite,\n saveInvoiceCustomizations: ajaxSave.saveInvoiceCustomizations,\n savePod: ajaxSave.savePod,\n savePodToCampaign: ajaxSave.savePodToCampaign,\n saveSpot: ajaxSave.saveSpot,\n saveSpotsToPod: ajaxSave.saveSpotsToPod,\n saveRule: ajaxSave.saveRule,\n saveRuleAsExpired: ajaxSave.saveRuleAsExpired,\n saveStation: ajaxSave.saveStation,\n savePodNotification: ajaxSave.savePodNotification,\n\n renderModal: contentDynamic.renderModal,\n renderShowsNames: contentDynamic.renderShowsNames,\n returnCleanTimeSlot: contentDynamic.returnCleanTimeSlot,\n returnCleanTimeSlots: contentDynamic.returnCleanTimeSlots,\n returnShowNames: contentDynamic.returnShowNames,\n returnLineNumber: contentDynamic.returnLineNumber,\n returnChangeLogPath: contentDynamic.returnChangeLogPath,\n returnPaginationUrl: contentDynamic.returnPaginationUrl,\n returnPodStatus: contentDynamic.returnPodStatus,\n returnSpotStatus: contentDynamic.returnSpotStatus,\n returnRepeatValue: contentDynamic.returnRepeatValue,\n returnSimpleSelectOptions: contentDynamic.returnSimpleSelectOptions,\n returnSimpleSelectOptionsForShows:\n contentDynamic.returnSimpleSelectOptionsForShows,\n returnSimpleSelectOptionsForSpots:\n contentDynamic.returnSimpleSelectOptionsForSpots,\n returnSortClass: contentDynamic.returnSortClass,\n returnSortValue: contentDynamic.returnSortValue,\n returnSunday: contentDynamic.returnSunday,\n alertInfo: contentDynamic.alertInfo,\n alertPodInfo: contentDynamic.alertPodInfo,\n formatVideoError: contentDynamic.formatVideoError,\n\n dateFormatComputer: contentStatic.dateFormatComputer,\n dateFormatHumanLong: contentStatic.dateFormatHumanLong,\n dateFormatHumanShort: contentStatic.dateFormatHumanShort,\n dateFormatRangeLong: contentStatic.dateFormatRangeLong,\n dateFormatRangeShort: contentStatic.dateFormatRangeShort,\n delayForm: contentStatic.delayForm,\n delayDetail: contentStatic.delayDetail,\n delayList: contentStatic.delayList,\n days: contentStatic.days,\n objectTypes: contentStatic.objectTypes,\n podStatuses: contentStatic.podStatuses,\n spotStatuses: contentStatic.podStatuses, // uses the podStatuses (they are the same)\n podElementFields: contentStatic.podElementFields,\n timeSlots: contentStatic.timeSlots,\n podResultsPerPage: contentStatic.podResultsPerPage,\n spotResultsPerPage: contentStatic.spotResultsPerPage,\n campaignResultsPerPage: contentStatic.campaignResultsPerPage,\n changeLogResultsPerPage: contentStatic.changeLogResultsPerPage,\n inviteResultsPerPage: contentStatic.inviteResultsPerPage,\n reportsResultsPerPage: contentStatic.reportsResultsPerPage,\n ruleResultsPerPage: contentStatic.ruleResultsPerPage,\n daysPerTimeSlotPerPage: contentStatic.daysPerTimeSlotPerPage,\n userResultsPerPage: contentStatic.userResultsPerPage,\n podFormDefaultSourceFile: contentStatic.podFormDefaultSourceFile,\n podFormMaxFilesize: contentStatic.podFormMaxFilesize,\n podFormMinDuration: contentStatic.podFormMinDuration,\n podFormMaxDuration: contentStatic.podFormMaxDuration,\n spotFormDefaultSourceFile: contentStatic.spotFormDefaultSourceFile,\n spotFormMaxFilesize: contentStatic.spotFormMaxFilesize,\n zeroPodsMessage: contentStatic.zeroPodsMessage,\n zeroSpotsMessage: contentStatic.zeroSpotsMessage,\n zeroCampaignsMessage: contentStatic.zeroCampaignsMessage,\n zeroLogsMessage: contentStatic.zeroLogsMessage,\n zeroReportsMessage: contentStatic.zeroReportsMessage,\n zeroRulesMessage: contentStatic.zeroRulesMessage,\n zeroExceptionsMessage: contentStatic.zeroExceptionsMessage,\n zeroInvitesMessage: contentStatic.zeroInvitesMessage,\n zeroUsersMessage: contentStatic.zeroUsersMessage,\n zeroStationsMessage: contentStatic.zeroStationsMessage,\n\n returnCampaignListUrl: contentUrls.returnCampaignListUrl,\n returnCampaignDetailUrl: contentUrls.returnCampaignDetailUrl,\n returnCampaignFormUrl: contentUrls.returnCampaignFormUrl,\n returnChangeLogListUrl: contentUrls.returnChangeLogListUrl,\n returnChangeLogDetailUrl: contentUrls.returnChangeLogDetailUrl,\n returnConflictFormUrl: contentUrls.returnConflictFormUrl,\n returnInviteListUrl: contentUrls.returnInviteListUrl,\n returnInviteFormUrl: contentUrls.returnInviteFormUrl,\n returnLivestreamUrl: contentUrls.returnLivestreamUrl,\n returnPodListUrl: contentUrls.returnPodListUrl,\n returnPodDetailUrl: contentUrls.returnPodDetailUrl,\n returnSpotDetailUrl: contentUrls.returnSpotDetailUrl,\n returnPodFormUrl: contentUrls.returnPodFormUrl,\n returnReportsUrl: contentUrls.returnReportsUrl,\n returnRuleListUrl: contentUrls.returnRuleListUrl,\n returnRuleDetailUrl: contentUrls.returnRuleDetailUrl,\n returnRuleFormUrl: contentUrls.returnRuleFormUrl,\n returnScheduleWeekUrl: contentUrls.returnScheduleWeekUrl,\n returnScheduleDayUrl: contentUrls.returnScheduleDayUrl,\n returnScheduleTimeSlotUrl: contentUrls.returnScheduleTimeSlotUrl,\n returnSettingsUrl: contentUrls.returnSettingsUrl,\n returnSpotFormUrl: contentUrls.returnSpotFormUrl,\n returnSpotListUrl: contentUrls.returnSpotListUrl,\n returnUserListUrl: contentUrls.returnUserListUrl,\n returnUserFormUrl: contentUrls.returnUserFormUrl,\n\n putFoucsOnError: () => {\n let element = document.querySelector(\n `.has-error input, .has-error select, .has-error textarea`\n );\n if (element !== null) {\n element.focus();\n }\n },\n\n spotsAvailable: () => {\n if (window._config !== undefined) {\n return window._config.spotsAvailable.toLowerCase() === \"true\";\n }\n }\n};\n\nexport default util;\n","import React from \"react\";\n\nexport default function FourOhFour() {\n return
404
;\n}\n","import React, { useEffect, useRef, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport util from \"../util/util\";\n\nexport default function ConflictCount(props) {\n const [conflictCount, setConflictCount] = useState(0);\n const timeout = useRef(0);\n\n useEffect(() => {\n getConflictCount();\n });\n\n useEffect(() => {\n return () => {\n // clear the timeout set by getConflictCount;\n window.clearTimeout(timeout.current);\n };\n }, []);\n\n // get the conflict count;\n const getConflictCount = () => {\n // clear any existing timeout;\n clearTimeout(timeout.current);\n\n util.getConflicts().then(data => {\n setConflictCount(Number(data.count));\n\n // check again in 60 seconds;\n const delay = 60;\n\n // start a new timeout;\n timeout.current = setTimeout(() => {\n getConflictCount();\n }, delay * 1000);\n });\n };\n\n // add a global function for conflict count updates;\n window.updateConflictCount = () => {\n getConflictCount();\n };\n\n return (\n \n {conflictCount} Conflict{conflictCount > 1 ? `s` : ``}\n \n );\n}\n","import React from \"react\";\nimport _ from \"lodash\";\n\nfunction warnDeprecation() {\n if (process.env.NODE_ENV === \"development\") {\n console.warn(\n \"InaccessibleLink is deprecated. Please use button and style it as a link\"\n );\n console.warn(\n \"See https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md.\"\n );\n }\n}\n\nconst _warnDeprecation = _.debounce(warnDeprecation, 500);\n\nfunction InaccessibleLink(props) {\n // Note that this component allows us to use tags\n // without proper href and still pass linters. Note that this\n // is an accessibility violation that should be fixed ASAP by\n // moving to use instead of . This is\n // unforunately complicated by how we rely on bootstrap\n // for certain functionality, which expects a tag.\n _warnDeprecation();\n const { children, ...rest } = props;\n return {children};\n}\n\nexport default InaccessibleLink;\n","import React, { useEffect, useRef, useState } from 'react';\nimport { browserHistory, Link } from 'react-router';\nimport PropTypes from \"prop-types\";\nimport ConflictCount from '../conflict-count/conflict-count';\nimport InaccessibleLink from '../shim/inaccessible-link';\nimport util from '../util/util';\n\nimport headerLogo from './images/pbs-logo.svg';\nimport _ from \"lodash\";\n\nexport default function PageHeader (props) {\n const stationLength = 10;\n // the most common use of refs in React is:\n // 1. to create references to DOM elements and run imperative logic when needed\n // (force elements to become focused, scroll up,...)\n // 2. to store in memory values you need to watch\n const initialTimeout = useRef(0);\n const reoccurringTimeout = useRef(0);\n\n // user email/name to display;\n const [user, setUser] = useState(null);\n // the user's selected station;\n const [station, setStation] = useState(null);\n // stations a user is associated with;\n const [stations, setStations] = useState([]);\n // string to parse station list with;\n const [stationSearch, setStationSearch] = useState(``);\n // security model set after user and station are defined;\n const [permissions, setPermissions] = useState({});\n\n // 'the function passed to useEffect will run after the render is committed\n // to the screen; think of effects as an escape hatch from React’s\n // purely functional world into the imperative world.'\n useEffect( () => {\n // get the pods transcoding status, and sends the notification on Success of Fail;\n const getPodsTranscodingNotifications = () => {\n // clear any existing timeout;\n clearTimeout(reoccurringTimeout.current);\n\n // leaving the pods that are still in 'processing'\n // and only sending notification for the 'ready' and 'failed' ones\n // and only do this when not on a Pod Detail screen\n if (!browserHistory.getCurrentLocation().pathname.includes(\"/pod/\")) {\n util.getPodsNotifications().then(data => {\n data.results.forEach(result => {\n const podName = result.pod_name;\n const podStatus = result.pod_aws_status;\n let msg = \"\";\n let msgStatus = \"\";\n\n if (podStatus === 2) {\n msg = `Pod \"${podName}\" was successfully ingested and is ready to be scheduled.`;\n msgStatus = `success`;\n } else if (podStatus === 3) {\n msg = `Pod \"${podName}\" has Failed and was not ingested.`;\n msgStatus = `danger`;\n }\n\n if (msg) {\n // displaying the Notification\n util.alertPodInfo(msg, msgStatus);\n // toggle the 'Notification seen' in the DB\n util.savePodNotification(result.pod, true, result.id);\n }\n });\n });\n }\n // check again in 60 seconds;\n const delay = 60;\n\n // start a new timeout;\n reoccurringTimeout.current = setTimeout(() => {\n getPodsTranscodingNotifications();\n }, delay * 1000);\n }\n\n // updating the state from the parent, if we have any data, and if it changed\n // fallback to default values if the parent doesn't supply values for all variables\n if (!_.isEmpty(props)) {\n const userUpdated = props.userData.email || props.userData.name || null;\n const stationUpdated = props.userData.current_station || null;\n const stations = props.userData.stations || [];\n const permissions = {\n superuser: props.userData.is_superuser,\n groups: props.userData.groups\n };\n\n // delay the pods transcoding notification, on Initial (react) page load\n if (stationUpdated && !initialTimeout.current) {\n initialTimeout.current = setTimeout(() => {\n getPodsTranscodingNotifications();\n }, 60000);\n }\n\n // updating the state only if it changed\n if (userUpdated !== user || stationUpdated !== station) {\n setUser(userUpdated);\n setStation(stationUpdated);\n setStations(stations);\n setPermissions(permissions);\n }\n }\n }, [props, user, station]);\n\n // using a separate useEffect dedicated solely for cleanup (not to be affected by\n // other state variables from the other useState's dependencyArray)\n // this will run only on the 'unmount' of the whole PageHeader (when refreshing\n // the page, signing-out, going to a different url,...):\n // [] - means this useEffect will only run on the 'mount' and 'unmount' of PageHeader\n // return... - means this part should run on the 'unmount' of PageHeader\n useEffect(()=>{\n // clear the timeout set by delayInitialPodsNotification\n // and by getPodsTranscodingNotifications\n return () => {\n clearTimeout(initialTimeout.current);\n clearTimeout(reoccurringTimeout.current);\n }\n }, []);\n\n // determine if the current path matches the link;\n const returnActiveClass = (path) => {\n return window.location.pathname.indexOf(path) === 0 ? `active` : null;\n }\n\n // return the list of stations;\n // filtered or not;\n const returnStationList = () => {\n if (stations.length > 0) {\n return stations.length > 1 && stations.map((stationItem) => {\n const index = stationItem.name.toLowerCase().indexOf(stationSearch.toLowerCase());\n\n // if the string was found, or;\n // if there are less than 10 stations to search through, just show them all;\n return index > -1 || stations.length < stationLength ? (\n
  • \n props.onChangeStation(stationItem.id) }>\n { stationItem.name }\n \n
  • \n ) : null;\n });\n } else {\n return (\n
  • { util.zeroStationsMessage }
  • \n );\n }\n }\n\n // return the divider after the user has selected a station;\n // or if the station search form is showing;\n const returnStationListDivider = () => {\n if (station && stations.length > 1) {\n return (\n
  • \n );\n }\n }\n\n // only show the search form if the user has enough to warrant a search;\n const returnStationSearchForm = () => {\n if (stations.length > stationLength) {\n return (\n
  • \n
    \n \n \n \n {\n setStationSearch(e.target.value);\n } }\n placeholder=\"Filter station list…\" />\n
    \n
  • \n );\n }\n }\n\n const canAccessUserList = (permissions) => {\n if (Object.keys(permissions).length === 0) {\n return false;\n }\n if (permissions.superuser) {\n return true;\n }\n if (permissions.groups.map(g => g.name).includes('Station Admin')) {\n return true;\n }\n return false;\n }\n\n return (\n
    \n \n\n {\n station !== null ? (\n \n ) : null\n }\n
    \n );\n}\n\nPageHeader.propTypes = {\n userData: PropTypes.object,\n onChangeStation: PropTypes.func\n};\n","import React from \"react\";\n\nexport default function LoadingIndicatorHeader() {\n return (\n

    \n \n Loading…\n

    \n );\n}\n","import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\n\n// this is used within the Date Picker component;\n// as the trigger to open the Date Picker;\n\n// even though this doesn't make use of state, it shouldn't be a stateless component;\n// if it's stateless, a React error will be thrown in the console about adding a ref to a stateless component;\n// the ref is added by the Date Picker;\n\nexport default class ScheduleByWeekTitle extends Component {\n render() {\n return (\n \n {this.props.weekDisplay}\n \n \n );\n }\n}\n\nScheduleByWeekTitle.propTypes = {\n onClick: PropTypes.func, // event to fire onClick (open the Date Picker);\n weekDisplay: PropTypes.string // value to show (date range based on the Date Picker value);\n};\n","import React from \"react\";\nimport { browserHistory } from \"react-router\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport DatePicker from \"react-datepicker\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport ScheduleByWeekTitle from \"./schedule-by-week-title\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\n\nexport default function ScheduleByWeek(props) {\n // get dates to use in the prev/next week links;\n const lastSunday = util.returnSunday(props.sunday, -1);\n const nextSunday = util.returnSunday(props.sunday, 1);\n\n return (\n
    \n
    \n {props.loaded === false ? (\n \n ) : (\n
    \n \n }\n selected={moment(props.sunday)}\n startDate={moment(props.sunday)}\n endDate={moment(props.sunday).add(6, `days`)}\n popperClassName=\"schedule-by-week__datepicker\"\n onChange={value => {\n const newSunday = util.returnSunday(\n value.format(util.dateFormatComputer)\n );\n const newUrl = util.returnScheduleWeekUrl(newSunday);\n\n browserHistory.push(newUrl);\n }}\n />\n
    \n )}\n
    \n\n
    \n

    \n \n \n {returnWeekRange(props.sunday, -1, util.dateFormatRangeShort)}\n \n

    \n
    \n\n
    \n

    \n \n {returnWeekRange(props.sunday, 1, util.dateFormatRangeShort)}\n \n \n

    \n
    \n
    \n );\n}\n\nScheduleByWeek.propTypes = {\n loaded: PropTypes.bool, // show the loading indicator or not;\n sunday: PropTypes.string // used to calc title and link values and content;\n};\n\n// return text for the title and buttons;\nfunction returnWeekRange(sunday, weekOffset, dateFormat) {\n const date = moment(sunday).day(weekOffset * 7);\n const startDate = date.format(dateFormat);\n const endDate = date.day(6).format(dateFormat);\n\n return `${startDate} - ${endDate}`;\n}\n","import React, { Component } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\nimport InaccessibleLink from \"../shim/inaccessible-link\";\n\nconst jQuery = window.jQuery;\n\nconst returnInitialState = props => {\n return {\n pod: props.pod,\n rule: props.rule\n };\n};\n\nexport default class TimeslotPopover extends Component {\n constructor(props) {\n super(props);\n\n // create a unique ID so when the popover JS is applied;\n // this is the only target to init;\n this.id = `id-${(Math.random() * 1e64).toString(36)}`;\n\n this.state = returnInitialState(props);\n }\n\n componentDidMount() {\n this.mounted = true;\n\n this.initPopover();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState(returnInitialState(nextProps), this.initPopover);\n }\n\n render() {\n return (\n
    \n \n {this.state.pod.name}\n \n\n
    \n
    \n
    \n
    \n

    Rule

    \n

    \n {this.state.rule ? (\n \n {this.state.rule.name}\n \n ) : null}\n

    \n
    \n
    \n

    Source Pod

    \n

    \n {this.state.pod ? (\n \n {this.state.pod.name}\n \n ) : null}\n

    \n
    \n
    \n
    \n
    \n
    \n );\n }\n\n initPopover() {\n const insertedEvent = `inserted.bs.popover`;\n const shownEvent = `shown.bs.popover`;\n const hideEvent = `hide.bs.popover`;\n const clickEvent = `click.popover`;\n const $body = jQuery(`body`);\n\n // define the link to trigger the popover;\n const $popoverTrigger = jQuery(`#${this.id}`);\n\n // init the Bootstrap popover for just this one instance;\n // the contents of the popover come from a hidden DIV;\n // then attach Bootstrap popover events to change the content once it is shown;\n $popoverTrigger\n .popover({\n container: `body`,\n content: () => $popoverTrigger.next().html(),\n html: true,\n placement: `auto`\n })\n .off(hideEvent)\n .on(hideEvent, () => {\n // remove the event bound to the body on show;\n $body.off(clickEvent);\n })\n .off(insertedEvent)\n .on(insertedEvent, () => {\n // once shown, change the links to be interactive;\n // it must be done this way (after the popover is created);\n // Bootstrap does not clone the events attached to the popover content, just the raw HTML;\n jQuery(`.popover a`).on(clickEvent, e => {\n const $a = jQuery(e.target);\n const to = $a.attr(`href`);\n\n e.preventDefault();\n\n browserHistory.push(to);\n });\n })\n .off(shownEvent)\n .on(shownEvent, () => {\n // add event to body to close this popover on click elsewhere;\n // but we can't have clicks from within the popover to trigger the closing;\n $body.off(clickEvent).on(clickEvent, e => {\n if (\n jQuery(e.target)\n .parents(`.popover`)\n .size() === 0\n ) {\n $popoverTrigger.trigger(clickEvent);\n }\n });\n });\n }\n}\n\nTimeslotPopover.propTypes = {\n pod: PropTypes.object,\n rule: PropTypes.object\n};\n","import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\n\n// this is used within the Date Picker component;\n// as the trigger to open the Date Picker;\n\n// even though this doesn't make use of state, it shouldn't be a stateless component;\n// if it's stateless, a React error will be thrown in the console about adding a ref to a stateless component;\n// the ref is added by the Date Picker;\n\nexport default class ReportsSearchDate extends Component {\n render() {\n return (\n \n );\n }\n}\n\nReportsSearchDate.propTypes = {\n onClick: PropTypes.func, // event to fire onClick (open the Date Picker);\n dateDisplay: PropTypes.string // value to show;\n};\n","import React, { useEffect, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport TimeslotPopover from \"../timeslot-popover/timeslot-popover\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport DatePicker from \"react-datepicker\";\nimport ReportsSearchDate from \"../reports/reports-search-date\";\n\nexport default function ScheduleByWeekSchedule(props) {\n const [showScheduleForm, setShowScheduleForm] = useState(false);\n const [startDate, setStartDate] = useState(moment(props.sunday));\n const [endDate, setEndDate] = useState(moment(props.sunday).add(6, \"days\"));\n\n useEffect(() => {\n setStartDate(moment(props.sunday));\n setEndDate(moment(props.sunday).add(6, \"days\"));\n }, [props.sunday]);\n\n return (\n
    \n
    \n setShowScheduleForm(!showScheduleForm)}\n >\n \n Export schedule\n \n
    \n\n
    \n
    \n
    \n
    \n \n
    \n \n }\n fixedHeight\n selected={startDate}\n selectsStart\n startDate={startDate}\n endDate={endDate}\n onChange={value => {\n setStartDate(value);\n // if 'start' if after 'end', changing the 'end' too\n value.isAfter(endDate) && setEndDate(value);\n }}\n />\n
    \n
    \n
    \n
    \n
    \n \n
    \n \n }\n fixedHeight\n selected={endDate}\n selectsEnd\n startDate={startDate}\n endDate={endDate}\n onChange={value => {\n setEndDate(value);\n // if 'end' if before 'start', changing the 'start' too\n value.isBefore(startDate) && setStartDate(value);\n }}\n />\n
    \n
    \n
    \n
    \n

    \n \n \n Export schedule\n \n

    \n
    \n
    \n
    \n\n \n\n
    \n
    \n {renderScheduleByIndex(0, 32)}\n
    \n
    \n {renderScheduleByIndex(32, 64)}\n
    \n
    \n {renderScheduleByIndex(64, 96)}\n
    \n
    \n
    \n );\n\n function renderScheduleByIndex(startIndex, endIndex) {\n const schedule = props.schedule.slice(startIndex, endIndex);\n const returnRowSpan = duration => {\n const durationArray = duration.split(`:`);\n const hours = Number(durationArray[0]);\n const minutes = Number(durationArray[1]);\n let rowspan = hours * 3; // first half hour slot, first half hour slot's interstital slot, second half hour slot;\n\n // if the show is only X hours long, then no need to add any additional rows;\n // if if the show is 1:30 long, we need 5 rows, not 3;\n if (minutes) {\n rowspan = rowspan + 2;\n }\n\n return rowspan;\n };\n\n // before we render the partial schedule, we need to adjust the object to account for rowspans;\n // we do not account for rowspans across tabs (a show running from 7:30 - 8:30 has a rowspan of 1, not 3);\n schedule.map(\n (row, rowIndex) =>\n row.days &&\n row.days.forEach((day, dayIndex) => {\n if (day.content.duration && day.content.duration !== `00:30:00`) {\n const rowSpan = returnRowSpan(day.content.duration);\n\n day.content.rowSpan = rowSpan;\n\n // now that we know the rowspan for this show, we need to remove the timeslots from the next X rows so the table lays out properly;\n // start at one row past the current row - otherwise we'd skip the show we want to display;\n for (let i = 1; i < rowSpan; i++) {\n const target = schedule[rowIndex + i];\n if (target) {\n target.days[dayIndex].skip = true;\n }\n }\n }\n })\n );\n\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {util.days.map((day, i) => {\n const date = moment(props.sunday).add(i, `days`);\n const dateForLink = date.format(util.dateFormatComputer);\n const dateForDisplay = date.format(util.dateFormatHumanShort);\n\n return (\n \n );\n })}\n \n \n \n {schedule.map((row, j) => (\n \n {row.timeslot && row.timeslot.substr(-1) !== `0` ? (\n \n ) : (\n \n )}\n {row.days &&\n row.days.map((day, k) => {\n // determine what kind of content (if any) to show;\n\n // skip (meaning a previous show is taking up this timeslot);\n // this is first because a pod may be assigned to a slot we should skip;\n // the back-end allows pods to be assigned to invalid slots;\n if (day.skip) {\n return null;\n }\n // pod;\n else if (day.content.pod) {\n return (\n \n );\n }\n // show;\n else if (day.content.show) {\n return (\n \n );\n }\n // undefined;\n else {\n return \n ))}\n \n
    \n \n {dateForDisplay}\n \n
    \n \n {row.timeslot}\n \n {row.timeslot}\n \n \n {day.content.show}\n ;\n }\n })}\n
    \n
    \n );\n }\n}\n\nScheduleByWeekSchedule.propTypes = {\n schedule: PropTypes.array, // array used to build the TABLE;\n sunday: PropTypes.string // used to calc the THs;\n};\n","import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport ScheduleByWeekButtons from \"./schedule-by-week-buttons\";\nimport ScheduleByWeekSchedule from \"./schedule-by-week-schedule\";\n\nexport default class ScheduleByWeek extends Component {\n constructor(props) {\n super(props);\n\n this.state = this.returnInitialState(props);\n }\n\n componentDidMount() {\n this.mounted = true;\n\n this.getScheduleByWeek();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState(this.returnInitialState(nextProps), this.getScheduleByWeek);\n }\n\n render() {\n return (\n
    \n
    \n
    \n

    Weekly Schedule

    \n
    \n
    \n\n
    \n\n \n\n
    \n\n \n
    \n );\n }\n\n // use the same logic to set state (on load, on prop change);\n returnInitialState(props = {}) {\n const sunday = util.returnSunday(\n (props.params && props.params.day) || new Date()\n );\n\n return {\n loaded: false, // indicates that the content is ready for display (even when schedule is empty);\n schedule: this.returnEmptySchedule(sunday), // main content to display;\n sunday: sunday // used to start the calc of the THs, and the title;\n };\n }\n\n // returns an empty schedule we can now use;\n // insert Ajax content into it, or display as-is (on prop change);\n returnEmptySchedule(sunday) {\n const schedule = [];\n\n const createRow = (timeslot, date) => {\n const days = [];\n\n // create empty day values for each time slot;\n for (let i = 0; i < 7; i = i + 1) {\n days.push({\n date: moment(date)\n .add(i, `days`)\n .format(util.dateFormatComputer),\n content: ``\n });\n }\n\n // create the `table row` for each time slot;\n return {\n days: days,\n timeslot: timeslot\n };\n };\n\n // loop through the 24 hours of the day;\n for (let hour = 0; hour < 24; hour = hour + 1) {\n const hourFormatted = hour < 10 ? `0${hour}` : hour;\n\n // loop through the hour and half hour slot;\n // the 28 and 58 are placeholders for the associated pods (as interstitials);\n [`00`, `28`, `30`, `58`].forEach(time => {\n // create the `table row` for each time slot;\n schedule.push(createRow(`${hourFormatted}:${time}`, sunday));\n });\n }\n\n return schedule;\n }\n\n // get the schedule data to display (one week at a time);\n getScheduleByWeek() {\n const schedule = this.state.schedule;\n const processData = data => {\n data.forEach(show => {\n const airtime = moment(show.airtime);\n const timeslot = airtime.format(`HH:mm`);\n const date = airtime.format(util.dateFormatComputer);\n\n // find the timeslot (if it exists);\n schedule.forEach((slot, i) => {\n if (slot.timeslot === timeslot) {\n // loop through the days and find a match (if it exists);\n slot.days.forEach((day, j) => {\n if (day.date === date) {\n // add the show or interstitial to the timeslot;\n schedule[i].days[j].content = show.title\n ? {\n show: show.title,\n duration: show.duration\n }\n : {\n pod: show.pod,\n rule: show.rule\n };\n }\n });\n }\n });\n });\n };\n\n // get this weeks show data;\n util\n .getScheduleByWeek(this.state.sunday)\n .then(data => {\n processData(data);\n\n // then this weeks interstitial data;\n return util.getInterstitialsByWeek(this.state.sunday);\n })\n .then(data => {\n processData(data);\n\n setTimeout(() => {\n this.mounted &&\n this.setState({\n loaded: true,\n schedule: schedule\n });\n }, util.delayList);\n });\n }\n}\n\nScheduleByWeek.propTypes = {\n params: PropTypes.object\n};\n","import React, { useEffect, useState } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport PageHeader from \"../page-header/page-header\";\nimport ScheduleByWeek from \"../schedule-by-week/schedule-by-week\";\nimport util from \"../util/util\";\nimport _ from \"lodash\";\n\nexport default function App(props) {\n // data about a user;\n const [userData, setUserData] = useState({});\n // using this to preserve the user data on Station change\n const [stationChanged, setStationChanged] = useState(false);\n // indicator for when the page has loaded\n const [userSignedOut, setUserSignedOut] = useState(false);\n\n // !!! Note, for the future, on how the flow works:\n // 1. when a function component is loaded, it will read all its variables\n // and functions, and will execute the 'return' part.\n // 2. if the 'return' part also contains loading some sub-components, it will\n // parse all the 'return' part (so all those sub-components), and at the end,\n // it will start to load them, one by one.\n // 3. first sub-component is loaded (it will do all the parts from #1.), and:\n // 3.1. if that has any sub-components itself, it will do #2., #3. and so on...\n // 3.2. if it doesn't have, that sub-component it's considered 'mounted' and\n // it will enter the useEffect function.\n // 4. useEffect of the first sub-component, (after reading all its variables and\n // functions) it will do the logic in there, and:\n // 4.1. if that logic involves updating the 'state', it will parce all\n // the 'setData, set...' statements, and at the end, it will re-render\n // that sub-component entirely (read all v&f + the code from the 'return' part),\n // Notes: - the re-rendering only runs IF any of the state variables changed\n // (no matter if they are used somewhere in the 'return' part or not)\n // - the useEffect ONLY gets triggered IF any of the state variables changed\n // AND IF the variable that changed is included in the dependencyArray\n // 4.2. if that logic contains some async methods (fetch from backend,...)\n // it will finish here\n // 5. useEffect of the initial component, (after reading all its variables and\n // functions) it will do the logic in there, and:\n // 5.1. & 5.2. same as #4.1. and #4.2.\n // Note: if it's #5.1., then all the #1.-#4. parts will be run again\n // (so, each time a parent component is re-rendered (and it re-runs\n // the 'return' part), its sub-components get re-run from scratch !!!).\n // 6. the async functions get executed (in some order), which could trigger\n // any combinations of re-rendering (#2.-#5.), for few/multiple times.\n // Note: in contrast with #4.1. and #5.1. (where all the 'set' are\n // executed sequentially, and at the end ONLY, the component is re-rendered\n // (and the 'return' part is executed), in the 'then/fail' of an async function,\n // the flow is different:\n // each time the state is updated ('setUser', 'setStation',...), it will\n // re-render the component (and execute the 'return' part)\n // (ex: updating 5 states, will trigger the re-rendering 5 times,\n // and not 1 time like in #4.1. and #5.1.)\n // (the Notes from #4.1. apply also in this case...)\n // !!! important here: leave the 'loaded' (setLoaded(true);) variable at the end\n // when updating the state, so that the component is not rendered so many times\n //\n // If we take an example, A -> B -> C,D this will be the flow:\n // - parse A, parse B, parse C, parse D\n // - execute useEffect for D, then for C, then for B, and then for A\n // - depending on the code in useEffect for each, some of them will get re-rendered,\n // the async methods will be postponed (until all the useEffects have finished...)\n // - and from here the re-rendering will complicate a lot...\n // or not (if all the changes are architecture correctly)\n //\n // Note on the case when we want to reload the current page, with an updated url (with\n // different query params), but we want to keep the existing components on the page (\n // and only update them, instead of reloading them, and the whole page, from scratch):\n // - if we have only one component, it's easy, but if there are parent and child\n // components, there can be issues about how to pass the state between them, as\n // updating the state only in the child component, and then reloading the page (with\n // different query params), will not update the state in the parent component\n // directly, so we need to pass the new state to the parent component.\n // - it's true that the parent component will take the new props from the url, but due\n // to the way hooks work (execute the 'return' part and load any child components in\n // there, and only after that execute the useEffect (and update it's state)), the\n // child component gets rendered first with the old state, and only after that with\n // the updated state, so we're getting that 'flickering' bad user experience (\n // new state (from child component) -> old state (from parent component) -> back to\n // new state (from parent component again)).\n // - while if we pass the new state to the parent component, and its state gets\n // updated, when the child components are reloaded first (before entering the\n // useEffect), will be reloaded with the correct values...\n\n useEffect(() => {\n // Note about the sign-in process:\n // the Sign-In and the Sign-Out work in this case (without implementing\n // any functions (like the 'setCurrentStation' one)) because their button uses\n // an tag, instead of the normal 'React Link' component - the difference is:\n // - will reload the page in the browser, so the whole React App gets\n // re-rendered from scratch\n // React Link - will reload the page but INSIDE the React App\n // (so, if those 's would be changed to React Link all the Sign-In/Out logic\n // from here (the App component) should be changed...to something more complicated)\n\n // get the user object (logged in or not)\n const getUser = () => {\n util\n .getUser()\n .fail(() => {\n // user is not logged in yet or has logged out\n // still allow the user to see the page and access the login button\n setUserSignedOut(true);\n })\n .then(data => {\n // user is logged in;\n setUserData(data);\n\n // if a user doesn't have a station currently selected\n // and has only one available station\n if (data.current_station === null && data.stations.length === 1) {\n // save them a click and make the one station current;\n setCurrentStation(data.stations[0].id);\n }\n });\n };\n\n if ((_.isEmpty(userData) || stationChanged) && !userSignedOut) {\n // updating the user data, if it's empty (initial load) or if the Station changed\n // but only if the user hasn't manually signed out\n getUser();\n // only updating this state variable if needed (this one triggered the getUser())\n stationChanged && setStationChanged(false);\n }\n }, [props, userData, stationChanged, userSignedOut]);\n\n // fire when the user selects a new station;\n const setCurrentStation = id => {\n util.saveStation(id).then(() => {\n setStationChanged(true);\n //browserHistory.push(browserHistory.getCurrentLocation());\n browserHistory.push(`/`);\n\n // Note: the user object gets refreshed due to the 'props' change that trigger\n // the 'useEffect' again ('props' change due to 'browserHistory.push(`/`);')\n // so, no need to call 'getUser()' again\n });\n };\n\n // if a current_station isn't defined, don't let the user see anything beyond the header;\n const renderChildren = () => {\n // station is not set;\n if (!userData.current_station) {\n return null;\n\n // station is set;\n } else {\n // but the user hasn't gone anywhere yet (homepage);\n if (props.children === null) {\n return ;\n\n // otherwise show the selected route components;\n } else {\n return props.children;\n }\n }\n };\n\n if (_.isEmpty(userData)) {\n return ;\n } else {\n return (\n
    \n setCurrentStation(id)}\n />\n\n {renderChildren()}\n
    \n );\n }\n}\n\nApp.propTypes = {\n children: PropTypes.node,\n location: PropTypes.object\n};\n","import React from \"react\";\nimport ReactTooltip from \"react-tooltip\";\n\nexport default function Tooltip(props) {\n return (\n \n );\n}\n","import React from \"react\";\nimport { browserHistory, Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport Tooltip from \"../tooltip/tooltip\";\nimport util from \"../util/util\";\n\nconst jQuery = window.jQuery;\n\nexport default function CampaignDetailCampaign({ campaign, rules }) {\n let hasRules = !!(rules && rules.length);\n let tooltipMessage = \"Only campaigns without rules can be deleted.\";\n\n const deleteCampaign = () => {\n const title = `Delete Campaign`;\n const body = `

    Are you sure you want to delete the campaign: ${campaign.name}?

    `;\n const buttonTextDefault = `Delete Campaign`;\n const buttonTextLoading = `Deleting Campaign`;\n const iconClass = `fa-trash-o`;\n const $modal = util.renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n );\n const $confirmButton = $modal.find(`.btn-danger`);\n $confirmButton.one(`click`, () => {\n $confirmButton.button(`loading`);\n\n util\n .deleteCampaign(campaign.id)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(d => {\n // once done, go back to the list of campaigns\n $modal.modal(`hide`);\n browserHistory.push(`/campaigns/`);\n });\n });\n\n // attach the modal to the DOM, and then show it;\n jQuery(`body`).append($modal);\n $modal.modal(`show`);\n };\n\n return (\n
    \n
    \n
    \n

    {campaign.name}

    \n
    \n
    \n

    \n \n \n Edit Campaign\n \n \n {\n return \"\";\n }\n : () => deleteCampaign()\n }\n disabled={hasRules ? true : \"\"}\n >\n \n Delete Campaign\n \n \n

    \n {hasRules && }\n
    \n
    \n
    \n
    \n
    \n

    Campaign Name

    \n

    {campaign.name}

    \n
    \n
    \n

    Created

    \n

    {moment(campaign.created).format(util.dateFormatHumanLong)}

    \n
    \n
    \n  \n
    \n
    \n

    Last Changed By

    \n

    \n Not available in the API (yet).\n

    \n
    \n
    \n

    Change Log

    \n

    \n \n View Change Log\n \n

    \n
    \n
    \n
    \n );\n}\n\nCampaignDetailCampaign.propTypes = {\n campaign: PropTypes.object\n};\n","import React from \"react\";\n\nexport default function LoadingIndicatorText() {\n return (\n \n \n Loading…\n \n );\n}\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\nimport InaccessibleLink from \"../shim/inaccessible-link\";\nimport util from \"../util/util\";\n\nexport default function CampaignDetailPods(props) {\n return (\n
    \n
    \n
    \n

    Pods

    \n
    \n
    \n

    \n \n \n Create New Pod\n \n

    \n
    \n
    \n\n
    \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {renderPodRows(props.pods)}\n
    #PodUploadedRemove Pod
    \n
    \n
    \n );\n\n // three options (loading, zero pods, pods);\n function renderPodRows(pods = false) {\n if (pods.length === 0) {\n return (\n \n \n \n \n \n );\n } else if (pods === false) {\n return (\n \n \n 0\n \n {util.zeroPodsMessage}\n \n );\n } else {\n return pods.map((pod, index) => {\n return (\n \n \n {index + 1}\n \n \n {pod.name}\n \n {moment(pod.created).format(util.dateFormatHumanLong)}\n \n props.onDeletePod(pod)}\n >\n \n Remove\n \n \n \n );\n });\n }\n }\n}\n\nCampaignDetailPods.propTypes = {\n pods: PropTypes.oneOfType([PropTypes.array, PropTypes.bool]),\n onDeletePod: PropTypes.func\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\n\nexport default function CampaignDetailRules(props) {\n const rules = props.rules || [];\n\n return (\n
    \n
    \n
    \n

    Rules

    \n
    \n
    \n

    \n \n \n Add to New Rule\n \n

    \n
    \n
    \n\n
    \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {rules.length === 0 ? (\n \n \n \n \n ) : (\n rules.map((rule, index) => {\n const cleanedTimeSlots = util.returnCleanTimeSlots(\n rule.timeslots\n );\n\n return (\n \n \n \n \n \n \n \n \n );\n })\n )}\n \n
    #RuleStart DateEnd DateTime Slots / ShowsRule Created
    \n 0\n {util.zeroRulesMessage}
    \n {index + 1}\n \n \n {rule.name}\n \n \n {moment(rule.start_date).format(util.dateFormatHumanLong)}\n \n {moment(rule.end_date).format(util.dateFormatHumanLong)}\n \n {rule.timeslots && rule.timeslots.length > 0 ? (\n \n {cleanedTimeSlots.join(`, `)}\n \n ) : null}\n {rule.shows && rule.shows.length > 0\n ? util.renderShowsNames(rule.shows)\n : null}\n \n {moment(rule.created).format(util.dateFormatHumanLong)}\n
    \n
    \n\n {props.expired === false ? (\n

    \n \n Load Expired Rules\n \n

    \n ) : null}\n
    \n );\n}\n\nCampaignDetailRules.propTypes = {\n campaignId: PropTypes.number,\n expired: PropTypes.bool,\n rules: PropTypes.array,\n onLoadExpired: PropTypes.func\n};\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport CampaignDetailCampaign from \"./campaign-detail-campaign\";\nimport CampaignDetailPods from \"./campaign-detail-pods\";\nimport CampaignDetailRules from \"./campaign-detail-rules\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport util from \"../util/util\";\n\nconst jQuery = window.jQuery;\n\nexport default function CampaignDetail(props) {\n // id of the campaign we are editing\n const [id, setId] = useState(0);\n // indicator for when the page has loaded\n const [loaded, setLoaded] = useState(false);\n // the Campaign data from the backend\n const [campaign, setCampaign] = useState({});\n // the associated Pods for this campaign\n const [pods, setPods] = useState([]);\n // the Rules, that are still valid, where this Campaign is used on\n const [rules, setRules] = useState([]);\n // all the Rules, even the Expired ones, where this Campaign is/was used on\n const [rulesAll, setRulesAll] = useState([]);\n // toggle to display the Expired Rules or not\n const [showExpiredRules, setShowExpiredRules] = useState(false);\n\n useEffect(() => {\n const id = props.params ? Number(props.params.id) : 0;\n\n const getCampaign = () => {\n // fire off both Ajax requests needed for this page\n // (the campaign data and the associated pods for this campaign);\n // once both have resolved, save the data and set loaded to true;\n jQuery\n .when(util.getCampaign(id), util.getPodsForCampaign(id))\n .then((campaignData, podsData) => {\n setTimeout(() => {\n const allRules = campaignData[0].rules;\n const nonExpiredRules = [];\n\n // split the rules into two groups based on their state;\n allRules.forEach(rule => {\n if (rule.state.toLowerCase() !== `expired`) {\n nonExpiredRules.push(rule);\n }\n });\n\n // setting the Campaign and the Rules data\n setId(id);\n setCampaign(campaignData[0]);\n setRules(nonExpiredRules);\n setRulesAll(allRules);\n setShowExpiredRules(nonExpiredRules.length === allRules.length);\n\n // setting the Pods to display, or false which indicates zero pods\n setPods(podsData[0].results.length ? podsData[0].results : false);\n }, util.delayDetail);\n });\n };\n\n getCampaign();\n setLoaded(true);\n }, [props.params]);\n\n // delete the link between a campaign and a pod;\n const deletePodAssociation = pod => {\n const title = `Remove Pod from Campaign`;\n const body =\n `

    Are you sure you want to remove the association between:` +\n `
    ${pod.name} and ` +\n `${campaign.name}?

    `;\n const buttonTextDefault = `Remove Pod from Campaign`;\n const buttonTextLoading = `Removing Pod from Campaign`;\n const iconClass = `fa-trash-o`;\n const $modal = util.renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n );\n const $confirmButton = $modal.find(`.btn-danger`);\n\n // attach temporary event to remove the pod on confirmation of the modal;\n // remove any previous events first;\n // don't namespace the event because we want to remove everything;\n $confirmButton.one(`click`, () => {\n $confirmButton.button(`loading`);\n\n util\n .deletePodFromCampaign(id, pod.id)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // once done, update the list of displayed pods;\n return util.getPodsForCampaign(id);\n })\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(podsForCampaign => {\n setPods(\n podsForCampaign.results.length ? podsForCampaign.results : false\n );\n $modal.modal(`hide`);\n });\n });\n\n // attach the modal to the DOM, and then show it;\n jQuery(`body`).append($modal);\n $modal.modal(`show`);\n };\n\n // change the collection of rules to display;\n const loadExpiredRules = () => {\n setRules(rulesAll);\n setShowExpiredRules(true);\n };\n\n if (loaded === false) {\n return ;\n } else {\n return (\n
    \n \n\n
    \n\n deletePodAssociation(id)}\n />\n\n
    \n\n loadExpiredRules()}\n />\n
    \n );\n }\n}\n\nCampaignDetail.propTypes = {\n params: PropTypes.object\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport default function CampaignFormButtons(props) {\n return (\n

    \n \n Cancel\n \n\n Saving Campaign\"\n onClick={props.onSubmit}\n >\n \n Save Campaign\n \n

    \n );\n}\n\nCampaignFormButtons.propTypes = {\n onCancel: PropTypes.func,\n onSubmit: PropTypes.func\n};\n","import React, {useCallback, useEffect, useState} from 'react';\nimport { browserHistory } from 'react-router';\nimport PropTypes from \"prop-types\";\nimport Select from 'react-select';\nimport LoadingIndicatorHeader from '../loading-indicator/loading-indicator-header';\nimport CampaignFormButtons from './campaign-form-buttons';\nimport campaignFormValidation from './campaign-form-validation';\nimport ajax from '../util/util-ajax';\nimport util from '../util/util';\nimport Tooltip from \"../tooltip/tooltip\";\nimport _ from \"lodash\";\nimport { v4 } from 'uuid';\n\nconst jQuery = window.jQuery;\n\nexport default function CampaignForm (props) {\n // id of the campaign we are editing (0 means new campaign to create)\n const [id, setId] = useState(0);\n // indicator for when the form has loaded\n const [loaded, setLoaded] = useState(false);\n // name of the campaign we are editing\n const [name, setName] = useState(``);\n // prop names determine which errors to show\n const [errors, setErrors] = useState({});\n // array used to control the SELECT fields for pods (does not contain the values to pass to Django)\n const [pods, setPods] = useState([]);\n // used to control the message displayed on the SELECT while searching\n const [searchingForPods, setSearchingForPods] = useState(false);\n // the Options for the SELECT\n const [podOptions, setPodOptions] = useState([]);\n // used to delete the old pods from campaign, on editing an existing campaign\n const [originalPods, setOriginalPods] = useState([]);\n\n useEffect( () => {\n // id of the campaign we are editing (0 means new campaign to create)\n const id = props.params ? Number(props.params.id) : 0;\n\n // get the campaign data to display in the form;\n const getCampaign = () => {\n // on a new campaign, no need to set up all the values as the default ones are used\n if (id === 0) {\n // if a pod was defined, then set it as the value of the SELECT;\n if (props.params && props.params.podId) {\n util.getPod(props.params.podId)\n .then((data) => {\n setPods([{\n label: data.name,\n value: data.id,\n id: data.id.toString()\n }]);\n setLoaded(true);\n });\n // otherwise use the empty value and tell the component that we're done loading;\n } else {\n setPods(getDefaultPodValue());\n setLoaded(true);\n }\n\n // on an existing campaign\n } else {\n // fire off both Ajax requests needed for this form;\n // once both have resolved, save the data and set loaded to true;\n jQuery\n .when(\n util.getCampaign(id),\n util.getPodsForCampaign(id)\n )\n .then((campaignData, podsData) => {\n setTimeout(() => {\n setId(id);\n setName(campaignData[0].name);\n setOriginalPods(util.returnSimpleSelectOptions(podsData[0].results));\n setPods(podsData[0].results.length ? util.returnSimpleSelectOptions(podsData[0].results) : getDefaultPodValue())\n setLoaded(true);\n }, util.delayDetail);\n });\n }\n }\n\n getCampaign();\n setLoaded(true);\n }, [props.params]);\n\n // default value of the SELECT;\n const getDefaultPodValue = () => {\n return [{\n label: `Select a pod`,\n value: 0,\n id: v4()\n }]\n };\n\n // add another form field to the page so the user can select another pod;\n const addPod = () => {\n let podsArray;\n podsArray = Array.from(pods);\n podsArray.push(getDefaultPodValue()[0]);\n setPods(podsArray);\n }\n\n const getPodSearchStatus = (searchTerm) => {\n if (searchTerm.inputValue.length === 0) {\n return `Please type a few characters to kick off remote search.`\n }\n if (searchingForPods === true) {\n return `Searching...`\n }\n if (podOptions.length === 0) {\n return `No results found.`\n }\n return `Something went wrong.`\n }\n\n const getPodSearchResults = (searchTerm) => {\n if (searchTerm.length === 0) {\n setSearchingForPods(false);\n setPodOptions([]);\n } else {\n setSearchingForPods(true);\n util\n .getPods({\n sort: `name`,\n page: 1,\n search: searchTerm,\n aws_status: 2,\n })\n .then((data) => {\n setSearchingForPods(false);\n setPodOptions(util.returnSimpleSelectOptions(data.results));\n });\n }\n }\n\n // used to delay the pod search start\n const getPodSearchResultsDelayed = useCallback(\n _.debounce(getPodSearchResults, 250),\n []\n )\n\n const handlePodsOnValueChange = (selectedPod, action, podIndex) => {\n let podsArray;\n podsArray = Array.from(pods);\n if (action.action === \"select-option\") {\n podsArray[podIndex] = {\n \"label\": selectedPod.label,\n \"value\": selectedPod.value,\n \"id\": selectedPod.value.toString()\n };\n }\n else if (action.action === \"clear\") {\n if (podsArray.length === 1) {\n podsArray[0] = getDefaultPodValue()[0];\n } else {\n podsArray.splice(podIndex, 1);\n }\n }\n setPods(podsArray);\n }\n\n // submit the form;\n const onSubmit = () => {\n // build the object to send to the server;\n const report = {\n id: id,\n name: name.trim(),\n pods: []\n };\n\n // see if there are any errors before proceeding;\n const validationResult = campaignFormValidation(report);\n\n // danger will robinson, we have errors;\n if (validationResult.hasErrors) {\n setErrors(validationResult.errors);\n util.putFoucsOnError();\n\n // stop any further processing;\n return false;\n\n // good to go, clear any existing errors;\n } else {\n setErrors({});\n }\n\n // insert only valid pods into the obj to send;\n pods && pods.forEach((pod) => {\n const newPodId = pod.value ? Number(pod.value) : null;\n\n if (newPodId) {\n // don't allow doubles;\n if (report.pods.indexOf(newPodId) === -1) {\n report.pods.push(newPodId);\n }\n }\n });\n\n // storage for the campaign data on save;\n let campaignData = null;\n\n // put the button into a processing state;\n const $button = jQuery(`.btn-primary`).button(`loading`);\n\n // save the form data;\n util.saveCampaign(id, report)\n .fail((error) => {\n const serializerNameExistsError = \"A Campaign with this name already exists.\";\n const api_error = _.get(error, \"responseJSON.Validation_Error[0]\")\n\n // if the name already exists\n if (serializerNameExistsError === api_error) {\n setErrors(_.merge({}, errors, { name: api_error}));\n util.putFoucsOnError();\n // if there is a different backend (4xx, 5xx) error\n } else {\n ajax.onFail(error);\n }\n\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $button.button(`reset`);\n }, util.delayForm);\n\n // stop any further processing, as the Campaign was not saved in the DB\n return false;\n })\n .then((data) => {\n // needed for subsequent ajax calls;\n campaignData = data;\n\n const removeRequests = originalPods.map((pod) => {\n return util.deletePodFromCampaign(data.id, pod.value);\n });\n\n // start the removals;\n return jQuery.when.apply(jQuery, removeRequests);\n })\n .fail(() => {\n setTimeout(() => {\n $button.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n const addRequests = report.pods.map((pod) => {\n return util.savePodToCampaign(campaignData.id, pod);\n });\n\n // start the additions;\n return jQuery.when.apply(jQuery, addRequests);\n })\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $button.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // wait a little bit (so the user can track what’s going on);\n setTimeout(() => {\n const url = util.returnCampaignDetailUrl(campaignData.id);\n\n // load the next page;\n browserHistory.push(url);\n }, util.delayForm);\n });\n }\n\n // cancel this action (do nothing and go somewhere else);\n const onCancel = () => {\n const newUrl = (id === 0) ? util.returnCampaignListUrl() : util.returnCampaignDetailUrl(id);\n\n browserHistory.push(newUrl);\n }\n\n if (loaded === false) {\n return (\n \n );\n } else {\n const tooltipMessage = \"Only pods in a 'Ready' status
    can be scheduled.\";\n return (\n
    \n
    \n
    \n

    { id === 0 ? `New Campaign` : `Edit Campaign` }

    \n
    \n
    \n onCancel() }\n onSubmit={ () => onSubmit() } />\n
    \n
    \n\n
    \n\n
    \n
    \n
    \n \n setName(e.target.value) }\n maxLength=\"100\" />\n

    \n { errors.name }\n

    \n
    \n
    \n
    \n
    \n \n \n
    \n {\n pods.map((pod, index) => (\n
    \n {return dbOption;}\n }\n noOptionsMessage={\n (searchTerm) => {\n return (\n
    \n {getPodSearchStatus(searchTerm)}\n
    \n );\n }\n }\n onInputChange={\n (searchTerm) => {\n // updating the search status on the UI\n setSearchingForPods(true);\n // making the backend call, with delay\n getPodSearchResultsDelayed(searchTerm);\n }\n }\n onChange={\n (value, action) => {\n handlePodsOnValueChange(value, action, index);\n }\n }\n />\n
    \n ))\n }\n
    \n addPod() }>\n \n Add Another Pod\n \n
    \n
    \n
    \n\n
    \n\n onCancel() }\n onSubmit={ () => onSubmit() } />\n \n );\n }\n}\n\nCampaignForm.propTypes = {\n params: PropTypes.object\n};\n","export default function campaignFormValidation(report) {\n // returned, defines if we have errors or not;\n let hasErrors = false;\n\n // returned, used to setState to inform the users of the errors;\n const errors = {};\n\n // campaign name is required;\n if (report.name === ``) {\n errors.name = \"Campaign Name is a required field.\";\n hasErrors = true;\n }\n\n return {\n errors: errors, // return for setState to tell the user what went wrong;\n hasErrors: hasErrors // return true/false so the submit works/doesn't;\n };\n}\n","import React, { useState, useEffect } from \"react\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\n\nexport default function CampaignListSearchForm(props) {\n const [search, setSearch] = useState(props.search || ``); // search string value;\n\n useEffect(() => {\n setSearch(props.search);\n }, [props]);\n\n // go to a new URL with the selected form values;\n const onSearchSubmit = () => {\n let url = `${util.returnCampaignListUrl()}?sort=${props.sort}`;\n\n if (search.length) {\n url = `${url}&search=${search}`;\n }\n\n const params = {\n url: url,\n search: search\n };\n\n props.searchSubmit(params);\n };\n\n // reset search form values to their default state;\n const onSearchReset = () => {\n setSearch(``);\n };\n\n // if the key pressed is `enter` then submit the search form;\n const onKeyPress = e => {\n if (e.key === `Enter`) {\n onSearchSubmit();\n }\n };\n\n return (\n
    \n
    \n \n setSearch(e.target.value.trim())}\n onKeyPress={e => onKeyPress(e)}\n />\n
    \n\n
    \n \n\n \n
    \n
    \n );\n}\n\nCampaignListSearchForm.propTypes = {\n search: PropTypes.string,\n sort: PropTypes.string, // not editable from this component, but needs to be passed in the form;\n searchSubmit: PropTypes.func\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\n\nconst jQuery = window.jQuery;\n\nexport default function CampaignListTable(props) {\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {renderCampaignRows(props.campaigns)}\n
    #{renderSortLink(`name`, `Campaign`)}Total Pods{renderSortLink(`-created`, `Date Created`)}
    \n
    \n );\n\n // three options for display (loading, no results, results);\n function renderCampaignRows(campaigns = false) {\n if (campaigns.length === 0) {\n return (\n \n \n \n \n \n );\n } else if (campaigns === false) {\n return (\n \n \n 0\n \n {util.zeroCampaignsMessage}\n \n );\n } else {\n return campaigns.map((campaign, index) => {\n return index < util.campaignResultsPerPage ? (\n \n \n \n {util.returnLineNumber(\n props.currentPage,\n util.campaignResultsPerPage,\n index\n )}\n \n \n \n \n {campaign.name}\n \n \n {campaign.pod_count}\n {moment(campaign.created).format(util.dateFormatHumanLong)}\n \n ) : null;\n });\n }\n }\n\n // display table header sort links;\n function renderSortLink(sortValue, sortDisplay) {\n const className = util.returnSortClass(sortValue, props.sort);\n const newSortValue = util.returnSortValue(sortValue, props.sort);\n const queryStringObject = props.queryString\n ? jQuery.deparam(props.queryString.replace(`?`, ``))\n : {};\n\n // add the new sort value to the querystring object;\n queryStringObject.sort = newSortValue;\n\n return (\n \n {sortDisplay}\n \n \n \n );\n }\n}\n\nCampaignListTable.propTypes = {\n campaigns: PropTypes.oneOfType([\n // campaign data to display;\n PropTypes.array,\n PropTypes.bool\n ]),\n currentPage: PropTypes.number, // used to calc the # in the TABLE;\n queryString: PropTypes.string, // query string to add to sort links;\n sort: PropTypes.string // currently sorting campaigns by;\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\nimport InaccessibleLink from \"../shim/inaccessible-link\";\n\nexport default function PaginationPrevious(props) {\n if (props.currentPage === 1) {\n return (\n
  • \n \n «\n \n
  • \n );\n } else {\n return (\n
  • \n \n «\n \n
  • \n );\n }\n}\n\nPaginationPrevious.propTypes = {\n currentPage: PropTypes.number,\n path: PropTypes.string,\n queryString: PropTypes.string\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\nimport InaccessibleLink from \"../shim/inaccessible-link\";\n\nexport default function PaginationNext(props) {\n if (props.currentPage === props.pageCount) {\n return (\n
  • \n \n »\n \n
  • \n );\n } else {\n return (\n
  • \n \n »\n \n
  • \n );\n }\n}\n\nPaginationNext.propTypes = {\n currentPage: PropTypes.number,\n pageCount: PropTypes.number,\n path: PropTypes.string,\n queryString: PropTypes.string\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport PaginationPrevious from \"./pagination-previous\";\nimport PaginationNext from \"./pagination-next\";\nimport util from \"../util/util\";\n\nconst iPhone6Width = 375;\nconst iPadPortraitWidth = 768;\n\nexport default function Pagination(props) {\n // the number of pages to show is based on the screen width;\n // smallest set (narrower than an iPhone 6) is 5, the wider it gets, the more we show;\n let pagesToShow = 5;\n\n if (window.innerWidth >= iPhone6Width) {\n pagesToShow = 7;\n }\n\n if (window.innerWidth >= iPadPortraitWidth) {\n pagesToShow = 11;\n }\n\n // create an array of all pages;\n // this will be trimmed before display;\n const pageArray = [];\n\n for (let i = 1; i <= props.pageCount; i = i + 1) {\n pageArray.push(i);\n }\n\n // determine the first and last page based off the current page;\n let firstPage =\n props.currentPage > Math.floor(pagesToShow / 2)\n ? props.currentPage - Math.floor(pagesToShow / 2) - 1\n : 0;\n let lastPage =\n props.currentPage > Math.floor(pagesToShow / 2)\n ? firstPage + pagesToShow\n : pagesToShow;\n\n // if the last page is past the end, adjust the first/last to be within range of pageArray;\n if (lastPage > props.pageCount) {\n firstPage = props.pageCount - pagesToShow;\n lastPage = props.pageCount;\n\n // can't have a negative number for the first page;\n // really screws with the processing of the array of pages;\n firstPage = firstPage < 0 ? 0 : firstPage;\n }\n\n const minimumPagesToShow = 2;\n\n // not enough pages for links, don't do anything;\n if (pageArray.length < minimumPagesToShow) {\n return null;\n\n // otherwise display some pagination links;\n } else {\n return (\n \n );\n }\n}\n\nPagination.propTypes = {\n currentPage: PropTypes.number, // page user is on;\n pageCount: PropTypes.number, // number of pages in the list;\n path: PropTypes.string, // url fragment;\n queryString: PropTypes.string // url params to persist on the next view;\n};\n","import React, { useEffect, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport util from \"../util/util\";\nimport CampaignListSearchForm from \"./campaign-list-search-form\";\nimport CampaignListTable from \"./campaign-list-table\";\nimport Pagination from \"../pagination/pagination\";\n\nexport default function CampaignList(props) {\n const [campaigns, setCampaigns] = useState([]); // campaigns to display (will be populated by an Ajax call);\n const [page, setPage] = useState(1); // page number of the campaign results;\n const [pageCount, setPageCount] = useState(0); // number of pages\n const [search, setSearch] = useState(``); // search string;\n const [sort, setSort] = useState(`-created`); // list sort value;\n const [queryString, setQueryString] = useState(``); // pass to sort and pagination links to maintain search state;\n\n useEffect(() => {\n // on 'props' change, updating the data used for the query and for the state updates\n const page = Number(_.get(props, `params.page`, 1));\n const search = _.get(props, `location.query.search`, ``);\n const sort = _.get(props, `location.query.sort`, `-created`);\n\n // also updating the query string, used for pagination\n setQueryString(_.get(props, `location.search`, ``));\n\n // setting Campaigns to empty so that when going to a different page (1, 2, 3,...)\n // or filtering (by name or date created), to display the loading indicator first\n // otherwise, it would display it only on the initial load of the page\n setCampaigns([]);\n\n // get the campaign data to display (one page at a time);\n const getCampaigns = () => {\n util\n .getCampaigns({\n page: page,\n search: search,\n sort: sort\n })\n .then(data => {\n setTimeout(() => {\n // setting the data returned from the backend\n setPageCount(Math.ceil(data.count / util.campaignResultsPerPage));\n setCampaigns(data.results.length ? data.results : false);\n\n // setting the state of the new data, for the UI\n setPage(page);\n setSearch(search);\n setSort(sort);\n }, util.delayList);\n });\n };\n\n getCampaigns();\n }, [props]);\n\n const searchSubmit = params => {\n setSearch(params.search);\n\n browserHistory.push(params.url);\n };\n\n return (\n
    \n
    \n
    \n

    Campaigns

    \n
    \n
    \n

    \n \n \n Create New Campaign\n \n

    \n
    \n
    \n\n searchSubmit(params)}\n />\n\n \n\n \n
    \n );\n}\n\nCampaignList.propTypes = {\n location: PropTypes.object,\n params: PropTypes.object\n};\n","import React, { useEffect, useState } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\nimport Pagination from \"../pagination/pagination\";\n\nconst jQuery = window.jQuery;\n\nexport default function ChangeLogByObj(props) {\n // id used to go get the object data;\n const [id, setId] = useState(0);\n // change log to display (will be populated by an Ajax call);\n const [log, setLog] = useState([]);\n // the type of object to view (rule, pod, campaign);\n const [objType, setObjType] = useState(null);\n // the object name\n const [objName, setObjName] = useState(``);\n // the object url\n const [objUrl, setObjUrl] = useState(``);\n // page of object results;\n const [page, setPage] = useState(1);\n // number of pages to display in the pagination links;\n const [pageCount, setPageCount] = useState(0);\n // pass to sort and pagination links to maintain search state;\n const [queryString, setQueryString] = useState(null);\n // list sort value;\n const [sort, setSort] = useState(`-date_created`);\n\n useEffect(() => {\n const objectId = Number(_.get(props, `params.id`, 0));\n const objectType = _.get(props, `params.obj`, null);\n const pageNo = Number(_.get(props, `params.page`, 1));\n const sortBy = _.get(props, `location.query.sort`, `-date_created`);\n\n const getChangeLog = () => {\n // if this is an exception, stop right here;\n // need to convert the exception id into the rule id;\n if (objectType === `exception`) {\n return util.getException(objectId).then(data => {\n browserHistory.replace(\n util.returnChangeLogDetailUrl(`rules.rule`, data.rule)\n );\n });\n }\n\n let getObj = null;\n let returnObjUrl = null;\n\n // determine what the functions will be (diff based on object type);\n if (objectType === `rule`) {\n getObj = util.getRule;\n returnObjUrl = util.returnRuleDetailUrl;\n } else if (objectType === `campaign`) {\n getObj = util.getCampaign;\n returnObjUrl = util.returnCampaignDetailUrl;\n } else if (objectType === `pod`) {\n getObj = util.getPod;\n returnObjUrl = util.returnPodDetailUrl;\n }\n\n // not sure what the scenario would be where a user gets to this page\n // and it's not one of the above types;\n // but in case the obj isn't found, don't throw an error;\n if (getObj) {\n // now we know what type of object it is;\n // get the object name, and set the `back to detail page` url;\n getObj(objectId).then(data => {\n setTimeout(() => {\n setObjName(data.name);\n setObjUrl(returnObjUrl(objectId));\n }, util.delayList);\n });\n } else {\n setObjName(`Unknown Object`);\n }\n\n // get the change log content;\n util\n .getChangeLog({\n contentType: util.returnChangeLogPath(objectType).key,\n id: objectId,\n page: pageNo,\n sort: sortBy\n })\n .then(data => {\n setTimeout(() => {\n setId(objectId);\n setObjType(objectType);\n setLog(data.results.length ? data.results : []);\n setPage(pageNo);\n setPageCount(Math.ceil(data.count / util.changeLogResultsPerPage));\n setQueryString(_.get(props, `location.search`, null));\n setSort(sortBy);\n }, util.delayList);\n });\n };\n\n getChangeLog();\n }, [props]);\n\n // three options for display (loading, no results, results);\n const renderRows = (logs = false) => {\n if (logs.length === 0) {\n return (\n \n \n \n \n \n );\n } else if (logs === false) {\n return (\n \n \n 0\n \n {util.zeroLogsMessage}\n \n );\n } else {\n return logs.map((log, index) => {\n return index < util.changeLogResultsPerPage ? (\n \n \n \n {util.returnLineNumber(\n page,\n util.changeLogResultsPerPage,\n index\n )}\n \n \n \n \n {log.revision.user.email || log.revision.user.name}\n \n \n {log.description}\n \n {moment(log.revision.date_created).format(\n util.dateFormatHumanLong\n )}\n \n \n ) : null;\n });\n }\n };\n\n // display table header sort links;\n const renderSortLink = (sortValue, sortDisplay) => {\n const className = util.returnSortClass(sortValue, sort);\n const newSortValue = util.returnSortValue(sortValue, sort);\n const queryStringObject = queryString\n ? jQuery.deparam(queryString.replace(`?`, ``))\n : {};\n\n // add the new sort value to the querystring object;\n queryStringObject.sort = newSortValue;\n\n return (\n \n {sortDisplay}\n \n \n \n );\n };\n\n return (\n
    \n
    \n
    \n

    \n {objUrl && objType ? (\n \n \n Return to {objType.split(`.`).slice(-1)} detail\n \n ) : null}\n

    \n
    \n
    \n

    \n Change Log: {objName ? objName : }\n

    \n
    \n
    \n\n
    \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {renderRows(log)}\n
    #UserChange{renderSortLink(`-date_created`, `Date`)}
    \n
    \n\n \n
    \n );\n}\n\nChangeLogByObj.propTypes = {\n location: PropTypes.object,\n params: PropTypes.object\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport default function ChangeLogByUser(props) {\n return (\n
    \n
    \n
    \n

    Change Log

    \n
    \n
    \n

    \n \n

    \n
    \n
    \n

    No API available.

    \n
    \n );\n}\n\nChangeLogByUser.propTypes = {\n params: PropTypes.object\n};\n","import React, { useEffect, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\nimport Pagination from \"../pagination/pagination\";\n\nconst jQuery = window.jQuery;\n\nexport default function ChangeLogList(props) {\n // change log to display (will be populated by an Ajax call);\n const [log, setLog] = useState([]);\n // page of rule results;\n const [page, setPage] = useState(1);\n // number of pages to display in the pagination links;\n const [pageCount, setPageCount] = useState(0);\n // pass to sort and pagination links to maintain search state;\n const [queryString, setQueryString] = useState(null);\n // list sort value;\n const [sort, setSort] = useState(`-date_created`);\n\n useEffect(() => {\n const pageNo = Number(_.get(props, `params.page`, 1));\n const sortBy = _.get(props, `location.query.sort`, `-date_created`);\n\n const getChangeLog = () => {\n // get the change log content;\n util\n .getStationChangeLog({\n page: pageNo,\n sort: sortBy\n })\n .then(data => {\n setTimeout(() => {\n setPage(pageNo);\n setPageCount(Math.ceil(data.count / util.changeLogResultsPerPage));\n setQueryString(_.get(props, `location.search`, null));\n setSort(sortBy);\n setLog(data.results.length ? data.results : false);\n }, util.delayList);\n });\n };\n\n getChangeLog();\n }, [props]);\n\n // three options for display (loading, no results, results);\n const renderRows = (logs = false) => {\n if (logs.length === 0) {\n return (\n \n \n \n \n \n );\n } else if (logs === false) {\n return (\n \n \n 0\n \n {util.zeroLogsMessage}\n \n );\n } else {\n return logs.map((log, index) => {\n return index < util.changeLogResultsPerPage ? (\n \n \n \n {util.returnLineNumber(\n page,\n util.changeLogResultsPerPage,\n index\n )}\n \n \n \n \n {log.revision.user.email || log.revision.user.name}\n \n \n \n \n {log.object_name}\n \n \n {log.description}\n \n {moment(log.revision.date_created).format(\n util.dateFormatHumanLong\n )}\n \n \n ) : null;\n });\n }\n };\n\n // display table header sort links;\n const renderSortLink = (sortValue, sortDisplay) => {\n const className = util.returnSortClass(sortValue, sort);\n const newSortValue = util.returnSortValue(sortValue, sort);\n const queryStringObject = queryString\n ? jQuery.deparam(queryString.replace(`?`, ``))\n : {};\n\n // add the new sort value to the querystring object;\n queryStringObject.sort = newSortValue;\n\n return (\n \n {sortDisplay}\n \n \n \n );\n };\n\n return (\n
    \n
    \n
    \n

    Change Log

    \n
    \n
    \n\n
    \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {renderRows(log)}\n
    #UserObjectChange{renderSortLink(`-date_created`, `Date`)}
    \n
    \n\n \n
    \n );\n}\n\nChangeLogList.propTypes = {\n params: PropTypes.object\n};\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport { Link } from \"react-router\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\n\nexport default function ConflictFormRule(props) {\n // rule content to display;\n const [rule, setRule] = useState({});\n\n useEffect(() => {\n setRule(props.rule);\n }, [props.rule]);\n\n return (\n
    \n

    Selected Rule

    \n\n
    \n
    \n
    \n

    Rule Name:

    \n

    {rule.name}

    \n
    \n
    \n

    Start Date:

    \n

    {moment(rule.dateStart).format(util.dateFormatHumanLong)}

    \n
    \n
    \n

    Time Slots / Shows:

    \n {rule.timeslots && rule.timeslots.length > 0 ? (\n

    {util.returnCleanTimeSlots(rule.timeslots).join(`, `)}

    \n ) : null}\n {rule.shows && rule.shows.length > 0\n ? util.renderShowsNames(rule.shows)\n : null}\n
    \n
    \n\n
    \n {rule.pod ? (\n
    \n

    Source Pod

    \n

    \n \n {rule.pod.name}\n \n

    \n
    \n ) : null}\n {rule.campaign ? (\n
    \n

    Source Campaign

    \n

    \n \n {rule.campaign.name}\n \n

    \n
    \n ) : null}\n
    \n

    End Date:

    \n

    {moment(rule.dateEnd).format(util.dateFormatHumanLong)}

    \n
    \n
    \n

    Repeats:

    \n

    {util.returnRepeatValue(rule.repeats)}

    \n
    \n
    \n
    \n
    \n );\n}\n\nConflictFormRule.propTypes = {\n rule: PropTypes.object\n};\n","import React, { useEffect, useRef, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\n\nexport default function ConflictFormSchedule(props) {\n // indicator for when the component has loaded\n const [loaded, setLoaded] = useState(false);\n // the Schedule to display (includes Days, Timeslots, Shows, Interstitials and\n // the Day/Timeslot/Interstitial in Conflict)\n const [schedule, setSchedule] = useState([]);\n // this Component renders only when the 'schedule' or the 'sunday' changes (but they\n // are coupled together, so it's enough if we re-render it based on the 'schedule')\n // the other tricky part is that we want to re-render it only in some cases, and not\n // in others - so using some variables to store in memory values we need to compare;\n // on the case when the week and the timeslot don't change, but only the day changes\n // there's no need to do the 2 backend calls (Schedule+Interstitials) as we already\n // have the data, so we only need to update the 'timeslot in conflict', but for this\n // we also need a copy of the 'schedule' (as using it directly, because it's an array,\n // and because we re-evaluate (re-write) the 'timeslot in conflict' part every time,\n // react sees it as modified and keeps re-rendering the component, infinitely)\n // so, we use the 'schedule' hook to render the component, and the below refs to\n // compare old to new values, and re-render the component only in some cases\n // !!! important - as we cannot update the 'oldSchedules' and the 'schedules' hooks\n // directly, as doing this 'let updatedSchedule = oldSchedule.current;' and then\n // 'setSchedule(updatedSchedule);' would only copy the references, and the component\n // won't get re-rendered, we need a new array (with spread, map,..) to copy the values\n // from 'oldSchedule.current' ('let updatedSchedule = [...oldSchedule.current];'), and\n // then update the state with the newly copied array ('setSchedule(updatedSchedule);')\n // in order for the Component to get re-rendered\n let sunday = useRef(``);\n let timeslot = useRef(``);\n let oldSchedule = useRef([]);\n\n // Note on why/when we need to include the called function ('getScheduleByWeek()' in\n // this case), inside the 'useEffect' function:\n // - when the called function ('getScheduleByWeek') uses any of the 'deps' of\n // 'useEffect' ('props.day' or 'props.timeslot' in this case)\n // - when the called function ('getScheduleByWeek') calls some other external\n // functions ('setEmptySchedule', 'processData' and 'findTheConflict' in our case)\n // - the second case could be bypassed by adding this external functions inside the\n // called function ('getScheduleByWeek')\n // - the first case can be bypassed by extracting the 'deps' into separate variables\n // and supply them ar parameters to the called function\n useEffect(() => {\n // get the schedule data to display (one week at a time);\n const getScheduleByWeek = () => {\n // new/current day of the Conflict\n const newDay = props.day;\n // new/current timeslot of the Conflict\n const newTimeslot = props.timeslot;\n // starting day for the schedule (convert whatever day was passed into the Sunday\n // for that week)\n const newSunday = util.returnSunday(\n newDay.format(util.dateFormatComputer)\n );\n // initially empty array of day/timeslots, later to be populated with show/pods\n let updatedSchedule = [...oldSchedule.current];\n\n // only updating the state, if the week or the timeslot changes\n if (newSunday !== sunday.current || newTimeslot !== timeslot.current) {\n // the Empty Schedule that is going to be filled with Schedules\n // and Interstitials by the 'getScheduleByWeek' method\n updatedSchedule = setEmptySchedule(newSunday, newTimeslot);\n\n // get this week's show data;\n util\n .getScheduleByWeek(newSunday)\n .then(data => {\n updatedSchedule = processData(data, updatedSchedule);\n\n // then this week's interstitial data;\n return util.getInterstitialsByWeek(newSunday);\n })\n .then(data => {\n updatedSchedule = processData(data, updatedSchedule);\n\n // now that the schedule is ready to display, find the conflict\n updatedSchedule = findTheConflict(\n updatedSchedule,\n newDay,\n newTimeslot\n );\n\n // updating the refs, for future comparisons\n sunday.current = newSunday;\n timeslot.current = newTimeslot;\n oldSchedule.current = updatedSchedule;\n\n // updating the 'schedule' in the state, for re-rendering\n setSchedule(updatedSchedule);\n\n // now the final updated schedule can be shown\n setLoaded(true);\n });\n } else {\n // if only the 'day' changes, no need to redo the backend calls\n // only update the 'conflict' timeslot and update the state with the 'schedule'\n updatedSchedule = findTheConflict(updatedSchedule, newDay, newTimeslot);\n oldSchedule.current = updatedSchedule;\n setSchedule(updatedSchedule);\n }\n };\n\n getScheduleByWeek();\n }, [props.day, props.timeslot]);\n\n const setEmptySchedule = (newSunday, newTimeslot) => {\n const emptySchedule = [];\n\n const createRow = (newTimeslot, newSunday) => {\n const days = [];\n\n // create empty day values for each time slot;\n for (let i = 0; i < 7; i = i + 1) {\n days.push({\n date: moment(newSunday)\n .add(i, `days`)\n .format(util.dateFormatComputer),\n content: null,\n selected: false\n });\n }\n\n // create the `table row` for each time slot;\n return {\n days: days,\n timeslot: newTimeslot\n };\n };\n\n // loop through the 24 hours of the day;\n for (let hour = 0; hour <= 23; hour = hour + 1) {\n const hourFormatted = hour < 10 ? `0${hour}` : hour;\n\n // loop through the hour and half hour slot;\n // the 28 and 58 are placeholders for the associated pods (as interstitials);\n [`00`, `28`, `30`, `58`].forEach(time => {\n // create the `table row` for each time slot;\n emptySchedule.push(createRow(`${hourFormatted}:${time}`, newSunday));\n });\n }\n\n // find the timeslot we care about;\n // we only want to show the conflict timeslot and the timeslow before and after it;\n let index = 1;\n\n emptySchedule.forEach((timeslot, i) => {\n if (timeslot.timeslot === newTimeslot) {\n index = i;\n }\n });\n\n // setting the Schedule as an empty array to later be populated with show/pod data;\n // the schedule is trimmed down to the timeslot specified;\n return emptySchedule.splice(index - 1, 3);\n };\n\n const processData = (data, schedule) => {\n data.forEach(showOrInterstitial => {\n const showOrIntAirtime = moment(showOrInterstitial.airtime);\n const showOrIntTimeslot = showOrIntAirtime.format(`HH:mm`);\n const showOrIntDate = showOrIntAirtime.format(util.dateFormatComputer);\n\n // find the timeslot (if it exists);\n schedule.forEach((slot, i) => {\n if (slot.timeslot === showOrIntTimeslot) {\n // loop through the days and find a match (if it exists);\n slot.days.forEach((day, j) => {\n if (day.date === showOrIntDate) {\n // add the show or interstitial to the timeslot;\n schedule[i].days[j].content = showOrInterstitial.title\n ? showOrInterstitial.title\n : showOrInterstitial.pod.name;\n }\n });\n }\n });\n });\n\n return schedule;\n };\n\n const findTheConflict = (schedule, day, timeslot) => {\n schedule.forEach(slot => {\n // set the flag to 'false', on all the non-matching timeslots, on the existing\n // schedule (reusing the schedule, if only the day has changed (but not the\n // week and the timeslot), in order to avoid a non-necessary backend call)\n slot.days.forEach(day => {\n day.selected = false;\n });\n\n if (slot.timeslot === timeslot) {\n const index = Number(moment(day).format(`d`));\n\n // set the flag to 'true', to turn the highlight class on\n slot.days[index].selected = true;\n }\n });\n\n return schedule;\n };\n\n if (loaded === false) {\n return ;\n } else {\n return (\n
    \n

    Current Schedule

    \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {util.days.map((day, i) => {\n const date = moment(sunday.current).add(i, `days`);\n\n return (\n \n );\n })}\n \n \n \n {schedule.map((row, i) => (\n \n \n {row.days.map((day, j) => (\n \n ))}\n \n ))}\n \n
    {date.format(util.dateFormatHumanShort)}
    {row.timeslot}\n {day.content}\n
    \n
    \n
    \n );\n }\n}\n\nConflictFormSchedule.propTypes = {\n day: PropTypes.object,\n timeslot: PropTypes.string\n};\n","import React, { useState, useEffect, useRef } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport ConflictFormRule from \"./conflict-form-rule\";\nimport ConflictFormSchedule from \"./conflict-form-schedule\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\n\nconst jQuery = window.jQuery;\n\nexport default function ConflictForm(props) {\n const [formData, setFormData] = useState({ loaded: false });\n const [selectedRuleIndex, setSelectedRuleIndex] = useState(0);\n const checkboxRef = useRef(null);\n\n useEffect(() => {\n getConflicts();\n }, [props.location]);\n\n // get the conflict to resolve (one at a time);\n const getConflicts = () => {\n util.getConflicts().then(data => {\n const result = data.results[0];\n const conflicts = result ? result.conflicting_rules : []; // default empty array so we can display `no results`;\n\n // create an array of all rules in the conflict;\n const rules = [];\n\n // why convert this data?\n // to convert the fields into Numbers where needed;\n // to convert param names with underscores to camelCase for consistency;\n conflicts.forEach(conflictingRule => {\n rules.push({\n id: Number(conflictingRule.id),\n name: conflictingRule.name,\n pod: conflictingRule.pod,\n campaign: conflictingRule.campaign,\n dateEnd: conflictingRule.end_date,\n dateStart: conflictingRule.start_date,\n timeslots: conflictingRule.timeslots,\n shows: conflictingRule.shows,\n repeats: Number(conflictingRule.frequency),\n conflictOccurrences: conflictingRule.conflicting_rules_occurrences\n });\n });\n\n // wait a little bit (so the user can track what’s going on);\n setTimeout(() => {\n // put the button back into the ready state;\n // it may be in the loading state if we’re dealing with lots of conflicts;\n jQuery(`.btn-primary`).button(`reset`);\n\n const conflict = result ? result.conflict : null;\n const date = moment.utc(conflict);\n\n // set state data so the user can interact with the form;\n setFormData({\n count: data.count,\n id: conflict,\n dateMoment: date,\n timeslot: date.format(`HH:mm`),\n date: date.format(`ddd MM/DD/YYYY`),\n rules: rules,\n loaded: true,\n selectedRuleIndex: 0\n });\n\n // update page-header conflict count;\n window.updateConflictCount();\n }, util.delayDetail);\n });\n };\n\n // resolve the conflict by creating an exception;\n const onSubmit = () => {\n const id = formData.id;\n const rule = formData.rules[selectedRuleIndex].id;\n const report = {\n selected_rule: rule,\n apply_all: checkboxRef.current.checked\n };\n\n // put the button into a processing state;\n const $button = jQuery(`.btn-primary`).button(`loading`);\n\n // create the exception;\n util\n .saveException(id, report)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $button.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // now get the new conflict (if any);\n util.getConflicts().then(data => {\n const newURL =\n data && data.count\n ? util.returnConflictFormUrl(data.count)\n : util.returnRuleListUrl();\n\n // wait a little bit (so the user can track what’s going on);\n setTimeout(() => {\n // load the next page (rule list or conflict form);\n browserHistory.push(newURL);\n\n // tell the header to update the conflict count;\n window.updateConflictCount();\n }, util.delayForm);\n });\n });\n };\n\n if (formData.loaded === false) {\n return ;\n } else if (formData.rules.length === 0) {\n return

    No Conflicts to Resolve

    ;\n } else {\n const conflictOccurrences =\n formData.rules[selectedRuleIndex].conflictOccurrences;\n\n return (\n
    \n
    \n
    \n

    \n \n Cancel and Edit Rule\n \n

    \n
    \n
    \n

    Resolve Conflicts

    \n
    \n
    \n\n
    \n\n

    \n Choose which rule should take precendence for the{\" \"}\n {formData.timeslot} time slot on{\" \"}\n {formData.date}:\n

    \n\n {formData.rules.map((rule, index) => {\n return (\n
    \n \n
    \n );\n })}\n\n
    1 ? \"checkbox\" : \"hidden\"}>\n \n
    \n\n
    \n\n

    \n Resolving Conflict\"\n onClick={() => onSubmit()}\n >\n \n Resolve Conflict\n \n

    \n\n
    \n\n \n\n
    \n\n \n \n );\n }\n}\n\nConflictForm.propTypes = {\n params: PropTypes.object\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport default function InviteFormButtons(props) {\n return (\n

    \n \n Cancel\n \n\n Sending Invites\"\n onClick={props.onSubmit}\n >\n \n Send Invites\n \n

    \n );\n}\n\nInviteFormButtons.propTypes = {\n onCancel: PropTypes.func,\n onSubmit: PropTypes.func\n};\n","import React, { useEffect, useState } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\nimport util from \"../util/util\";\nimport InviteFormButtons from \"./invite-form-buttons\";\n\nconst jQuery = window.jQuery;\n\nexport default function InviteForm(props) {\n // id of the invite we are editing (0 means new invite to create);\n const [id, setId] = useState(0);\n const [loaded, setLoaded] = useState(false);\n // options to display in a SELECT field;\n const [roles, setRoles] = useState([]);\n // array used to control the SELECT fields for invites\n // (does not contain the values to pass to Django);\n const [invites, setInvites] = useState([]);\n const [stationName, setStationName] = useState(\"\");\n const [stationGroups, setStationGroups] = useState([]);\n\n useEffect(() => {\n const inviteId = props.params ? Number(props.params.id) : 0;\n\n // get the invite data to display in the form;\n const getInvite = () => {\n if (inviteId === 0) {\n setInvites([\n {\n email: ``,\n role: ``\n }\n ]);\n } else {\n util.getStationInvite(inviteId).then(data => {\n setTimeout(() => {\n setId(inviteId);\n setInvites([\n {\n email: data.email,\n role: data.group.id\n }\n ]);\n }, util.delayDetail);\n });\n }\n };\n\n getStation();\n getRoles();\n getInvite();\n setLoaded(true);\n }, [props]);\n\n // get station information to display above the form;\n const getStation = () => {\n util.getStation().then(data => {\n setTimeout(() => {\n setStationName(data.name);\n setStationGroups(data.group_counts);\n }, util.delayDetail);\n });\n };\n\n // get the role options to display in the SELECT;\n const getRoles = () => {\n util.getRoles().then(data => {\n setRoles(data.results);\n });\n };\n\n // push an empty value into the invites array;\n // this way a new INPUT will appear for the user to add the new value;\n const addInvite = () => {\n const invitesArray = Array.from(invites);\n\n invitesArray.push({\n email: ``,\n role: ``\n });\n\n setInvites(invitesArray);\n\n document.querySelector(`#email${invites.length - 1}`).focus();\n };\n\n // remove the index from the invite array;\n // this will remove the form fields;\n const removeInvite = index => {\n const invitesArray = Array.from(invites);\n\n invitesArray.splice(index, 1);\n\n setInvites(invitesArray);\n };\n\n // change a value in the invites array;\n const changeInviteValue = (value, target, prop) => {\n const invitesArray = Array.from(invites);\n\n invitesArray[target][prop] = value;\n\n setInvites(invitesArray);\n };\n\n // save the data;\n const onSubmit = () => {\n const requests = []; // container for our promises;\n const $button = jQuery(`.btn-primary`);\n\n // fire off an Ajax call per user, creating an invite;\n invites.forEach((invite, index) => {\n const email = invites[index].email;\n const role = invites[index].role;\n\n // only if the user filled out the form;\n // resend is a PUT, new is a POST;\n // the util function determines that based on id;\n if (email && role) {\n requests.push(\n util.saveInvite(id, {\n email: email,\n group: role\n })\n );\n }\n });\n\n // dont do anything if there aren't invites to process;\n if (requests.length) {\n // put the button into a processing state;\n $button.button(`loading`);\n\n // when all the Ajax calls resolve;\n // go to the list;\n jQuery.when\n .apply(jQuery, requests)\n .fail(() => {\n // on fail, reset the button on fail so it can be clicked again;\n setTimeout(() => {\n $button.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // on success, go to the invite list;\n setTimeout(() => {\n browserHistory.push(util.returnInviteListUrl());\n }, util.delayForm);\n });\n }\n };\n\n // cancel this action (do nothing and go somewhere else);\n const onCancel = () => {\n browserHistory.push(util.returnInviteListUrl());\n };\n\n if (loaded === false) {\n return ;\n } else {\n return (\n
    \n
    \n
    \n

    Invite Users

    \n
    \n\n
    \n onCancel()}\n onSubmit={() => onSubmit()}\n />\n
    \n
    \n\n
    \n\n
    \n
    \n

    \n Station\n

    \n {stationName ? (\n

    {stationName}

    \n ) : (\n

    \n \n

    \n )}\n
    \n
    \n
    \n {stationGroups &&\n stationGroups.map((group, index) => {\n return (\n
    \n

    \n {group.name}\n

    \n

    {group.count}

    \n
    \n );\n })}\n
    \n
    \n
    \n\n
    \n\n \n
    \n {invites.map((invite, index) => (\n
    \n
    \n\n
    \n \n \n changeInviteValue(e.target.value, index, `email`)\n }\n />\n
    \n\n
    \n \n \n changeInviteValue(e.target.value, index, `role`)\n }\n >\n \n {roles.map((role, i) => {\n return (\n \n );\n })}\n \n
    \n\n removeInvite(index)}\n >\n \n Delete\n \n
    \n ))}\n
    \n\n {id === 0 ? (\n addInvite()}\n >\n \n Add Another Invite\n \n ) : null}\n\n
    \n\n onCancel()}\n onSubmit={() => onSubmit()}\n />\n \n );\n }\n}\n\nInviteForm.propTypes = {\n params: PropTypes.object\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\nimport InaccessibleLink from \"../shim/inaccessible-link\";\n\nconst jQuery = window.jQuery;\n\nexport default function InviteListTable(props) {\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {props.invites === false ? (\n \n \n \n \n ) : null}\n\n {props.invites && props.invites.length === 0 ? (\n \n \n \n ) : null}\n\n {props.invites && props.invites.length\n ? props.invites.map((invite, index) => {\n return index < util.inviteResultsPerPage ? (\n \n \n \n \n \n \n \n ) : null;\n })\n : null}\n \n
    #EmailRole{renderSortLink(`has_accepted`, `Accepted`)}Remove Invite
    \n 0\n {util.zeroInvitesMessage}
    \n \n
    \n \n {util.returnLineNumber(\n props.currentPage,\n util.inviteResultsPerPage,\n index\n )}\n \n {invite.email || N/A}{invite.group ? invite.group.name : N/A}\n {invite.has_accepted ? (\n `Yes`\n ) : (\n
    \n No -{\" \"}\n \n Resend\n \n
    \n )}\n
    \n props.onClickDeleteInvite(invite)}\n >\n \n \n
    \n
    \n );\n\n // display table header sort links;\n function renderSortLink(sortValue, sortDisplay) {\n const className = util.returnSortClass(sortValue, props.sort);\n const newSortValue = util.returnSortValue(sortValue, props.sort);\n const queryStringObject = props.queryString\n ? jQuery.deparam(props.queryString.replace(`?`, ``))\n : {};\n\n // add the new sort value to the querystring object;\n queryStringObject.sort = newSortValue;\n\n return (\n \n {sortDisplay}\n \n \n \n );\n }\n}\n\nInviteListTable.propTypes = {\n currentPage: PropTypes.number, // used to calc the # in the TABLE;\n onClickDeleteInvite: PropTypes.func, // remove invite from station;\n invites: PropTypes.oneOfType([\n // invite data to display;\n PropTypes.array,\n PropTypes.bool\n ])\n};\n","import React, { useEffect, useState } from \"react\";\nimport { browserHistory, Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport util from \"../util/util\";\nimport Pagination from \"../pagination/pagination\";\nimport InviteListTable from \"./invite-list-table\";\n\nconst jQuery = window.jQuery;\n\nexport default function InviteList(props) {\n // page of invites results;\n const [page, setPage] = useState(1);\n const [pageCount, setPageCount] = useState(0);\n // invites to display (will be populated by an Ajax call);\n const [invites, setInvites] = useState([]);\n\n useEffect(() => {\n const page = Number(_.get(props, `params.page`, 1));\n\n // get the invites for this station;\n const getInvites = () => {\n util\n .getStationInvites({\n page: page\n })\n .then(data => {\n setTimeout(() => {\n // setting the data returned from the backend\n setPageCount(Math.ceil(data.count / util.inviteResultsPerPage));\n setInvites(data.results.length ? data.results : false);\n\n // setting the state of the new data, for the UI\n setPage(page);\n }, util.delayList);\n });\n };\n\n getInvites();\n }, [props]);\n\n // delete the invite associated with this station;\n const deleteInvite = invite => {\n // using this for the 'Delete Modal'\n const title = `Delete Invite from this Station`;\n const body = `

    Are you sure you want to delete the invitation for ${\n invite.group ? invite.group.name : ``\n }: ${invite.email}?

    `;\n const buttonTextDefault = `Delete the Invite`;\n const buttonTextLoading = `Deleting the Invite`;\n const iconClass = `fa-trash-o`;\n const $modal = util.renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n );\n const $confirmButton = $modal.find(`.btn-danger`);\n\n // remove the invite on confirmation of the modal;\n $confirmButton.one(`click`, () => {\n $confirmButton.button(`loading`);\n\n util\n .deleteInviteFromStation(invite.id)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // hiding the Modal\n $modal.modal(`hide`);\n // going to the first page of the Invites,\n // and get the updated Invites list from the backend\n browserHistory.push(`/invites/1/`);\n });\n });\n\n // attach the modal to the DOM, and then show it;\n jQuery(`body`).append($modal);\n $modal.modal(`show`);\n };\n\n return (\n
    \n
    \n
    \n

    Invites

    \n
    \n
    \n

    \n \n \n Invite Users\n \n

    \n
    \n
    \n\n
    \n\n deleteInvite(invite)}\n invites={invites}\n />\n\n \n
    \n );\n}\n\nInviteList.propTypes = {\n params: PropTypes.object\n};\n","import React from \"react\";\nimport videojs from \"video.js\";\nimport \"video.js/dist/video-js.css\";\n\nexport default function VideoJS(props) {\n const videoRef = React.useRef(null);\n const playerRef = React.useRef(null);\n const { options, onReady } = props;\n\n React.useEffect(() => {\n // Make sure Video.js player is only initialized once\n if (!playerRef.current) {\n const videoElement = videoRef.current;\n\n if (!videoElement) return;\n\n const player = (playerRef.current = videojs(videoElement, options, () => {\n // videojs.log(\"player is ready\");\n onReady && onReady(player);\n }));\n\n // You could update an existing player in the `else` block here\n // on prop change, for example:\n } else {\n // const player = playerRef.current;\n // player.autoplay(options.autoplay);\n // player.src(options.sources);\n }\n }, [options, videoRef, onReady]);\n\n // Dispose the Video.js player when the functional component unmounts\n React.useEffect(() => {\n const player = playerRef.current;\n\n return () => {\n if (player) {\n player.dispose();\n playerRef.current = null;\n }\n };\n }, [playerRef]);\n\n return (\n
    \n
    \n );\n}\n","import React, { useEffect, useState } from \"react\";\n// import videojs from \"video.js\";\nimport VideoJS from \"./videoJS\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport util from \"../util/util\";\n\nexport default function Livestream() {\n // player Ref\n const playerRef = React.useRef(null);\n // indicator for when the backend has responded with the source url, so we can load the player\n const [loaded, setLoaded] = useState(false);\n // player Options\n const [videoJsOptions, setVideoJsOptions] = useState({\n autoplay: false,\n controls: true,\n responsive: true,\n fluid: true,\n liveui: true,\n controlBar: {\n pictureInPictureToggle: false\n },\n sources: [\n {\n src: \"\",\n type: \"application/x-mpegURL\"\n }\n ]\n });\n\n useEffect(() => {\n const getLivestreamData = () => {\n // getting the 'src' (and in future possibly other data ?) from the backend\n util.getLivestreamData().then(data => {\n setVideoJsOptions(videoJsOptions => ({\n ...videoJsOptions,\n sources: [\n {\n ...videoJsOptions.sources[0],\n src: data.source_url\n }\n ]\n }));\n setLoaded(true);\n });\n };\n\n getLivestreamData();\n }, []);\n\n const handlePlayerReady = player => {\n playerRef.current = player;\n\n // You can handle player events here, for example:\n // player.on(\"waiting\", () => {\n // videojs.log(\"player is waiting\");\n // });\n //\n // player.on(\"dispose\", () => {\n // videojs.log(\"player will dispose\");\n // });\n };\n\n if (loaded === false) {\n return ;\n } else {\n return (\n
    \n
    \n
    \n

    \n Your Station's KIDS 24/7 Localized Livestream\n

    \n
    \n
    \n\n
    \n \n
    \n\n
    \n  \n

    \n Use this embedded player for pre-launch testing and post-launch\n monitoring of your livestream and localized pods.\n

    \n
    \n
    \n );\n }\n}\n","import moment from \"moment\";\nimport React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport Tooltip from \"../tooltip/tooltip\";\nimport util from \"../util/util\";\n\nimport { Link } from \"react-router\";\n\nexport default function PodDetailPod(props) {\n const [pod, setPod] = useState({});\n const [podStatus, setPodStatus] = useState(0);\n const [displayErrors, setDisplayErrors] = useState(\"\");\n const [url, setUrl] = useState(\"\");\n const [filename, setFilename] = useState(\"\");\n const [podStatusLabel, setPodStatusLabel] = useState(\"\");\n const [tooltipMessage, setTooltipMessage] = useState(\"\");\n\n useEffect(() => {\n const pod = props.pod;\n const url = pod.source_file || pod.source_url || \"\";\n let filename = url ? url.split(`/`).slice(-1) : \"\";\n if (filename && filename[0].length > 44) {\n filename = filename[0].substring(0, 44);\n }\n const podStatusLabel = util.returnPodStatus(props.podStatus) || \"\";\n\n setPod(pod);\n setPodStatus(props.podStatus);\n setDisplayErrors(util.formatVideoError(props.podStatusMessage));\n setUrl(url);\n setFilename(filename);\n setPodStatusLabel(podStatusLabel);\n setTooltipMessage(getTooltipMessage(podStatusLabel));\n }, [props]);\n\n const getTooltipMessage = podStatusLabel => {\n let tooltipMessage = null;\n\n if (podStatusLabel === \"Processing\") {\n tooltipMessage =\n \"Pod must complete ingestion
    before it can be scheduled.\";\n } else if (podStatusLabel === \"Ready\") {\n tooltipMessage = \"Successfully ingested.
    This pod can be scheduled.\";\n } else if (podStatusLabel === \"Failed\") {\n tooltipMessage =\n \"Failed ingestion due to the
    source not meeting requirements.\";\n }\n\n return tooltipMessage;\n };\n\n return (\n
    \n
    \n
    \n

    {pod.name}

    \n
    \n
    \n {podStatus !== 4 ? ( // 4 == Deleted\n

    \n \n \n Edit Pod\n \n props.deletePod(pod)}\n >\n \n Delete Pod\n \n

    \n ) : null}\n
    \n
    \n
    \n
    \n
    \n \n
    \n\n
    \n

    Pod Name

    \n

    {pod.name}

    \n\n

    File Name

    \n

    \n \n {filename}\n \n

    \n\n
    \n
    \n

    \n Status \n \n

    \n \n \n {podStatusLabel}\n

    \n
    \n
    \n

    Uploaded

    \n

    {moment(pod.created).format(util.dateFormatHumanLong)}

    \n
    \n
    \n

    To Expire

    \n

    \n {pod.expiration_date === null\n ? `Not Set`\n : moment(pod.expiration_date).format(\n util.dateFormatHumanLong\n )}\n

    \n
    \n {displayErrors.length ? (\n
    \n
    \n
      \n {displayErrors.map((errorMessage, i) => (\n
    • {errorMessage}
    • \n ))}\n
    \n
    \n
    \n ) : null}\n
    \n\n

    Description

    \n

    {pod.description || None}

    \n
    \n
    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {!(pod.elements && pod.elements.length) ? (\n \n \n \n ) : (\n pod.elements.map((element, index) => {\n return (\n \n \n \n \n \n \n \n \n \n );\n })\n )}\n \n
    Element IDProtrack IDClient NameSpot NameTapeOrderDuration
    \n No element metadata.\n
    \n {element.element_id}\n {element.protrack_id}{element.client_name}{element.spot_name}{element.tape}{element.order}{element.duration}
    \n
    \n
    \n
    \n  \n
    \n
    \n

    Last Changed By

    \n

    \n Not available in the API (yet).\n

    \n
    \n
    \n

    Change Log

    \n

    \n \n View Change Log\n \n

    \n
    \n
    \n
    \n );\n}\n\nPodDetailPod.propTypes = {\n pod: PropTypes.object,\n podStatus: PropTypes.number,\n podStatusMessage: PropTypes.string,\n deletePod: PropTypes.func\n};\n","import React, { useEffect, useState } from 'react';\nimport {browserHistory, Link} from 'react-router';\nimport PropTypes from \"prop-types\";\nimport moment from 'moment';\nimport util from '../util/util';\nimport Tooltip from \"../tooltip/tooltip\";\n\nexport default function PodDetailRules (props) {\n const tooltipMessage = \"Only successfully ingested pods
    can be added to a rule.\";\n\n const [podId, setPodId] = useState(0);\n const [podStatus, setPodStatus] = useState(1);\n const [rules, setRules] = useState([]);\n\n useEffect( ()=>{\n setPodId(props.podId);\n setPodStatus(props.podStatus);\n setRules(props.rules.slice(0, 5))\n }, [props.podId, props.podStatus, props.rules]);\n\n // set the rules to display equal to the full list of rules;\n const showAll = () => {\n setRules(props.rules)\n }\n\n return (\n
    \n
    \n
    \n

    Rules

    \n
    \n
    \n

    \n \n {return \"\";} : () => browserHistory.push(\n util.returnRuleFormUrl(0, podId)\n )}\n >\n \n Add to New Rule\n \n \n

    \n {podStatus !== 2 && }\n
    \n
    \n\n
    \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {\n rules.length === 0 ? (\n \n \n \n \n ) : (\n rules.map((rule, index) => {\n const cleanedTimeSlots = util.returnCleanTimeSlots(rule.timeslots);\n\n return (\n \n \n \n \n \n \n \n \n );\n })\n )\n }\n \n
    #RuleStart DateEnd DateTime Slots / ShowsRepeats
    0None
    { index + 1 }{ rule.name }{ moment(rule.start_date).format(util.dateFormatHumanLong) }{ moment(rule.end_date).format(util.dateFormatHumanLong) }\n {rule.timeslots && rule.timeslots.length > 0 ? (\n \n { cleanedTimeSlots.join(`, `) }\n \n ) : null}\n {rule.shows && rule.shows.length > 0\n ? util.renderShowsNames(rule.shows)\n : null}\n { util.returnRepeatValue(rule.frequency) }
    \n
    \n {\n rules && props.rules && rules.length !== props.rules.length ? (\n

    \n showAll() }>\n Show All { props.rules.length } Rules\n \n

    \n ) : null\n }\n
    \n );\n}\n\nPodDetailRules.propTypes = {\n podId: PropTypes.number,\n podStatus: PropTypes.number,\n rules: PropTypes.array\n};\n","import React, { useEffect, useState } from \"react\";\nimport { browserHistory, Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport Tooltip from \"../tooltip/tooltip\";\n\nexport default function PodDetailCampaigns(props) {\n const tooltipMessage =\n \"Only successfully ingested pods
    can be added to a campaign.\";\n\n const [podId, setPodId] = useState(0);\n const [podStatus, setPodStatus] = useState(1);\n const [campaigns, setCampaigns] = useState([]);\n\n useEffect(() => {\n setPodId(props.podId);\n setPodStatus(props.podStatus);\n setCampaigns(props.campaigns.slice(0, 5));\n }, [props.podId, props.podStatus, props.campaigns]);\n\n const showAll = () => {\n setCampaigns(props.campaigns);\n };\n\n return (\n
    \n
    \n
    \n

    Campaigns

    \n
    \n
    \n

    \n \n {\n return \"\";\n }\n : () =>\n browserHistory.push(\n util.returnCampaignFormUrl(0, podId)\n )\n }\n >\n \n Add to New Campaign\n \n \n

    \n {podStatus !== 2 && }\n
    \n
    \n\n
    \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {campaigns.length === 0 ? (\n \n \n \n \n ) : (\n campaigns.map((campaign, index) => {\n return (\n \n \n \n \n \n \n );\n })\n )}\n \n
    #CampaignTotal PodsDate Created
    \n 0\n \n None\n
    \n {index + 1}\n \n \n {campaign.name}\n \n {campaign.pod_count}\n {moment(campaign.created).format(\n util.dateFormatHumanLong\n )}\n
    \n
    \n {campaigns &&\n props.campaigns &&\n campaigns.length !== props.campaigns.length ? (\n

    \n showAll()}\n >\n Show All {props.campaigns.length} Campaigns\n \n

    \n ) : null}\n
    \n );\n}\n\nPodDetailCampaigns.propTypes = {\n campaigns: PropTypes.array,\n podId: PropTypes.number,\n podStatus: PropTypes.number\n};\n","import React, { useEffect, useRef, useState } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport PodDetailPod from \"./pod-detail-pod\";\nimport PodDetailRules from \"./pod-detail-rules\";\nimport PodDetailCampaigns from \"./pod-detail-campaigns\";\nimport util from \"../util/util\";\n\nconst jQuery = window.jQuery;\n\nexport default function PodDetail(props) {\n const [pod, setPod] = useState({});\n const [id, setId] = useState(0);\n const [status, setStatus] = useState(0);\n const [statusMessage, setStatusMessage] = useState(\"\");\n const [rules, setRules] = useState([]);\n const [campaigns, setCampaigns] = useState([]);\n const [loaded, setLoaded] = useState(false);\n const timeout = useRef(0);\n // using this time to stop making extra calls to the backend after a Pod Save\n const saveTime = useRef(new Date());\n\n useEffect(() => {\n const podId = Number(props.params.id);\n // because 'status' doesn't get updated until everything from 'useEffect' is\n // finished, using a different variable 'podStatus' to have the value returned from\n // 'getPod' to be used in 'getPodStatus'\n let podStatus = 0;\n\n // get the updated pod status;\n const getPodStatus = () => {\n // clear any existing timeout;\n clearTimeout(timeout.current);\n\n util.getPodStatus(podId).then(data => {\n const awsStatus = data.aws_status;\n\n // changing the state if there is any Pod status change\n if (podStatus !== awsStatus) {\n setStatus(awsStatus);\n setStatusMessage(data.aws_status_message);\n }\n\n // no need to send the Notification in the below cases, so marking it as 'seen'\n // as the user is already on the Pod page and sees the Pod status:\n // 1. the Pod is not re-transcoded in AWS - this can happen in 2 cases:\n // a. the Source File/Url/Spots haven't changed\n // b. the Source has changed but has Failed directly,\n // due to a File error (incorrect format, length, video type,...)\n // *extra optimization - if the Status is Ready or Failed only poll the backend\n // for a few initial minutes after the page loads, as the Status cannot change\n // 2. Source changed and Pod is re-transcoded in AWS, and the status changes from\n // 'Processing' -> 'Ready' of 'Failed', while the user is still on the Pod page\n const withinTwoMins = (new Date() - saveTime) / 1000 / 60 < 2;\n const readyOrFailed = podStatus === 2 || podStatus === 3;\n const statusChanged =\n podStatus === 1 && (awsStatus === 2 || awsStatus === 3);\n\n if ((withinTwoMins && readyOrFailed) || statusChanged) {\n util.getPodsNotifications(podId).then(data => {\n data.results.forEach(result => {\n // toggle the 'Notification seen' in the DB, if it isn't\n if (result.aws_transcode_notification_seen === false) {\n util.savePodNotification(podId, true, result.id);\n }\n });\n });\n }\n\n // updating 'podStatus' to the new value\n if (podStatus !== awsStatus) {\n podStatus = awsStatus;\n }\n });\n\n // check again in 30 seconds;\n const delay = 30;\n\n // start a new timeout;\n timeout.current = setTimeout(() => {\n getPodStatus(podId);\n }, delay * 1000);\n };\n\n // get the pod data to display;\n const getPod = () => {\n util.getPod(podId).then(data => {\n podStatus = data.aws_status;\n\n setTimeout(() => {\n setPod(data);\n setId(podId);\n setStatus(podStatus);\n setStatusMessage(data.aws_status_message);\n setRules(data.rules);\n setCampaigns(data.campaigns);\n setLoaded(true);\n\n // updating the Pod Status (by polling the DB Status)\n getPodStatus();\n }, util.delayDetail);\n });\n };\n\n getPod();\n }, [props.params.id]);\n\n useEffect(() => {\n return () => {\n // clear the timeout set by getPodStatus;\n clearTimeout(timeout.current);\n };\n }, []);\n\n // call the delete pod endpoint\n const deletePod = pod => {\n const title = `Delete Pod`;\n const body = `

    Are you sure you want to delete the pod: ${pod.name}?

    `;\n const buttonTextDefault = `Delete Pod`;\n const buttonTextLoading = `Deleting Pod`;\n const iconClass = `fa-trash-o`;\n const $modal = util.renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n );\n const $confirmButton = $modal.find(`.btn-danger`);\n\n // attach temporary event to remove the pod on confirmation of the modal;\n // remove any previous events first;\n // dont namespace the event because we want to remove everything;\n $confirmButton.one(`click`, () => {\n $confirmButton.button(`loading`);\n\n util\n .deletePod(pod.id)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // once done, go back to the list of pods\n $modal.modal(`hide`);\n browserHistory.push(`/pods/`);\n });\n });\n\n // attach the modal to the DOM, and then show it;\n jQuery(`body`).append($modal);\n $modal.modal(`show`);\n };\n\n if (loaded === false) {\n return ;\n } else {\n return (\n
    \n deletePod(pod)}\n />\n\n
    \n\n \n\n
    \n\n \n
    \n );\n }\n}\n\nPodDetail.propTypes = {\n params: PropTypes.object\n};\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\n\nexport default function PodListSearchForm(props) {\n const usageStatuses = [\n {\n label: `All`,\n value: ``\n },\n {\n label: `Unused`,\n value: `true`\n },\n {\n label: `Used`,\n value: `false`\n }\n ];\n\n const [search, setSearch] = useState(\"\");\n const [status, setStatus] = useState(util.podStatuses[0].value);\n const [usage, setUsage] = useState(usageStatuses[0].value);\n const [sort, setSort] = useState(`-created`);\n\n useEffect(() => {\n setSearch(props.search);\n setStatus(Number(props.status));\n setUsage(props.unused);\n setSort(props.sort);\n }, [props]);\n\n // if the key pressed is `enter` then submit the search form;\n const onKeyPress = e => {\n if (e.key === `Enter`) {\n onSearchSubmit();\n }\n };\n\n // reset search form values to their default state;\n const onSearchReset = () => {\n setSearch(\"\");\n setStatus(util.podStatuses[0].value);\n setUsage(usageStatuses[0].value);\n setSort(`-created`);\n };\n\n // go to a new URL with the selected form values;\n const onSearchSubmit = () => {\n let url = `${util.returnPodListUrl()}?sort=${sort}`;\n\n if (search.length) {\n url = `${url}&search=${search}`;\n }\n\n if (status !== util.podStatuses[0].value) {\n url = `${url}&status=${status}`;\n }\n\n if (usage !== usageStatuses[0].value) {\n url = `${url}&unused=${usage}`;\n }\n\n const params = {\n url: url,\n search: search,\n status: status,\n usage: usage,\n sort: sort\n };\n\n props.searchSubmit(params);\n };\n\n return (\n
    \n
    \n \n setSearch(e.target.value.trim())}\n onKeyPress={e => onKeyPress(e)}\n />\n
    \n\n
    \n \n setStatus(Number(e.target.value))}\n >\n {util.podStatuses.map(option => (\n \n ))}\n \n
    \n\n
    \n \n setUsage(e.target.value)}\n >\n {usageStatuses.map(option => (\n \n ))}\n \n
    \n\n
    \n
    \n \n\n \n
    \n
    \n
    \n );\n}\n\nPodListSearchForm.propTypes = {\n search: PropTypes.string,\n sort: PropTypes.string, // not editable from this component, but needs to be passed in the form;\n status: PropTypes.number,\n unused: PropTypes.string,\n searchSubmit: PropTypes.func\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\n\nconst jQuery = window.jQuery;\n\nexport default function PodListTable(props) {\n // three options for display (loading, no results, results);\n const renderPodRows = (pods = false) => {\n if (pods.length === 0) {\n return (\n \n \n \n \n \n );\n } else if (pods === false) {\n return (\n \n \n 0\n \n {util.zeroPodsMessage}\n \n );\n } else {\n return pods.map((pod, index) => {\n return index < util.podResultsPerPage ? (\n \n \n \n {util.returnLineNumber(\n props.currentPage,\n util.podResultsPerPage,\n index\n )}\n \n \n \n {pod.name}\n \n {util.returnPodStatus(pod.aws_status)}\n {renderPodCampaigns(pod)}\n {moment(pod.created).format(util.dateFormatHumanLong)}\n \n {pod.expiration_date\n ? moment(pod.expiration_date).format(util.dateFormatHumanLong)\n : `Not Set`}\n \n \n ) : null;\n });\n }\n };\n\n // display the campaigns per pod;\n const renderPodCampaigns = pod => {\n // if there are campaigns to display;\n if (pod.campaigns && pod.campaigns.length) {\n return pod.campaigns.map((campaign, index) => (\n
    \n \n {campaign.name}\n \n
    \n ));\n\n // no campaigns to display;\n } else {\n return None;\n }\n };\n\n // display table header sort links;\n function renderSortLink(sortValue, sortDisplay) {\n const className = util.returnSortClass(sortValue, props.sort);\n const newSortValue = util.returnSortValue(sortValue, props.sort);\n const queryStringObject = props.queryString\n ? jQuery.deparam(props.queryString.replace(`?`, ``))\n : {};\n\n // add the new sort value to the querystring object;\n queryStringObject.sort = newSortValue;\n\n return (\n \n {sortDisplay}\n \n \n \n );\n }\n\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {renderPodRows(props.pods)}\n
    #{renderSortLink(`name`, `Pod`)}{renderSortLink(`aws_status`, `Status`)}Campaign{renderSortLink(`-created`, `Date Created`)}{renderSortLink(`-expiration_date`, `Expiration Date`)}
    \n
    \n );\n}\n\nPodListTable.propTypes = {\n currentPage: PropTypes.number, // used to calc the # in the TABLE;\n pods: PropTypes.oneOfType([\n // pod data to display;\n PropTypes.array,\n PropTypes.bool\n ]),\n queryString: PropTypes.string, // query string to add to sort links;\n sort: PropTypes.string // currently sorting pods by;\n};\n","import React, { useEffect, useState } from \"react\";\nimport { Link } from \"react-router\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport util from \"../util/util\";\nimport Pagination from \"../pagination/pagination\";\nimport PodListSearchForm from \"./pod-list-search-form\";\nimport PodListTable from \"./pod-list-table\";\n\nexport default function PodList(props) {\n // page of pod results;\n const [page, setPage] = useState(1);\n const [pageCount, setPageCount] = useState(0);\n // pods to display (will be populated by an Ajax call);\n const [pods, setPods] = useState([]);\n // search string;\n const [search, setSearch] = useState(``);\n // list sort value;\n const [sort, setSort] = useState(`-created`);\n // search status;\n const [status, setStatus] = useState(null);\n // list sort value;\n const [usage, setUsage] = useState(``);\n // pass to sort and pagination links to maintain search state;\n const [queryString, setQueryString] = useState(``);\n\n useEffect(() => {\n const pageNumber = Number(_.get(props, `params.page`, 1));\n const searchString = _.get(props, `location.query.search`, ``);\n const sortOrder = _.get(props, `location.query.sort`, `-created`);\n const awsStatus = Number(_.get(props, `location.query.status`, 0)) || null;\n const usageFilter = _.get(props, `location.query.unused`, ``);\n\n setPage(pageNumber);\n setSearch(searchString);\n setSort(sortOrder);\n setStatus(awsStatus);\n setUsage(usageFilter);\n setQueryString(_.get(props, `location.search`, null));\n\n // get the pod data to display (one page at a time);\n const getPods = () => {\n util\n .getPods({\n page: pageNumber,\n search: searchString,\n sort: sortOrder,\n aws_status: awsStatus,\n unused: usageFilter\n })\n .then(data => {\n setTimeout(() => {\n setPods(data.results.length ? data.results : false);\n setPageCount(Math.ceil(data.count / util.podResultsPerPage));\n }, util.delayList);\n });\n };\n\n getPods();\n }, [props]);\n\n const searchSubmit = params => {\n setSearch(params.search);\n setStatus(params.status);\n setUsage(params.usage);\n setSort(params.sort);\n\n browserHistory.push(params.url);\n };\n\n return (\n
    \n
    \n
    \n

    Pods

    \n
    \n
    \n

    \n \n \n Create New Pod\n \n

    \n
    \n
    \n\n searchSubmit(params)}\n />\n\n \n\n \n
    \n );\n}\n\nPodList.propTypes = {\n location: PropTypes.object,\n params: PropTypes.object\n};\n","import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport Tooltip from \"../tooltip/tooltip\";\nimport util from \"../util/util\";\n\nimport { Link } from \"react-router\";\n\nexport default class SpotDetailSpot extends Component {\n constructor(props) {\n super(props);\n\n this.spotId = props.spot.id;\n this.url = props.spot.sourceFile || props.spot.sourceUrl || null;\n this.filename = this.url ? this.url.split(`/`).slice(-1) : null;\n if (this.filename && this.filename[0].length > 44) {\n this.filename = this.filename[0].substring(0, 44);\n }\n\n const spotStatusLabel = util.returnSpotStatus(props.spot.status);\n\n this.state = {\n spotStatus: props.spot.status,\n spotStatusLabel: spotStatusLabel || null,\n tooltipMessage: this.getTooltipMessage(spotStatusLabel),\n displayErrors: util.formatVideoError(props.spot.statusMessage)\n };\n }\n\n render() {\n return (\n
    \n
    \n
    \n

    {this.props.spot.name}

    \n
    \n
    \n {this.state.spotStatus !== 4 ? ( // 4 == Deleted\n

    \n \n \n Edit Spot\n \n this.props.deleteSpot(this.props.spot)}\n >\n \n Delete Spot\n \n

    \n ) : null}\n
    \n
    \n
    \n
    \n
    \n \n
    \n\n
    \n

    Spot Name

    \n

    {this.props.spot.name}

    \n\n

    File Name

    \n

    \n \n {this.filename}\n \n

    \n\n
    \n
    \n

    \n Status \n \n

    \n \n \n {this.state.spotStatusLabel}\n

    \n
    \n
    \n

    Uploaded

    \n

    \n {moment(this.props.spot.created).format(\n util.dateFormatHumanLong\n )}\n

    \n
    \n {this.state.displayErrors.length ? (\n
    \n
    \n
      \n {this.state.displayErrors.map((errorMessage, i) => (\n
    • {errorMessage}
    • \n ))}\n
    \n
    \n
    \n ) : null}\n
    \n\n

    Description

    \n

    {this.props.spot.description || None}

    \n
    \n
    \n
    \n
    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    Element IDProtrack IDClient NameSpot NameTapeDuration
    \n {this.props.spot.elementId}\n {this.props.spot.protrackId}{this.props.spot.clientName}{this.props.spot.name}{this.props.spot.tape}{this.props.spot.duration}
    \n
    \n
    \n
    \n  \n
    \n
    \n

    Last Changed By

    \n

    \n Not available in the API (yet).\n

    \n
    \n
    \n

    Change Log

    \n

    \n \n View Change Log\n \n

    \n
    \n
    \n
    \n );\n }\n\n getTooltipMessage(spotStatusLabel) {\n let tooltipMessage = null;\n\n if (spotStatusLabel === \"Processing\") {\n tooltipMessage =\n \"Spot must complete ingestion
    before it can be used.\";\n } else if (spotStatusLabel === \"Ready\") {\n tooltipMessage = \"Successfully ingested.
    This spot can be used.\";\n } else if (spotStatusLabel === \"Failed\") {\n tooltipMessage =\n \"Failed ingestion due to the
    source not meeting requirements.\";\n }\n\n return tooltipMessage;\n }\n}\n\nSpotDetailSpot.propTypes = {\n spot: PropTypes.object,\n deletePod: PropTypes.func\n};\n","import React, { Component } from \"react\";\nimport { browserHistory, Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport Tooltip from \"../tooltip/tooltip\";\n\nexport default class SpotDetailPods extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n pods: props.pods ? props.pods.slice(0, 5) : [] // pods to display;\n };\n }\n\n // set the pods to display equal to the full list of rules;\n showAll() {\n this.setState({\n pods: this.props.pods\n });\n }\n\n render() {\n const spotNotReady = this.props.spotStatus !== 2;\n const tooltipMessage =\n \"Only successfully ingested spots
    can be added to a pod.\";\n\n return (\n
    \n
    \n
    \n

    Pods

    \n
    \n
    \n

    \n \n {\n return \"\";\n }\n : () =>\n browserHistory.push(\n util.returnPodFormUrl(0, this.props.spotId)\n )\n }\n >\n \n Add to New Pod\n \n \n

    \n {spotNotReady && }\n
    \n
    \n\n
    \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {this.state.pods.length === 0 ? (\n \n \n \n \n ) : (\n this.state.pods.map((pod, index) => {\n return (\n \n \n \n \n \n \n \n \n );\n })\n )}\n \n
    #PodStatusCampaignsDate CreatedExpiration Date
    \n 0\n \n None\n
    \n {index + 1}\n \n \n {pod.name}\n \n {util.returnPodStatus(pod.aws_status)}\n {pod.campaigns.length === 0 ? (\n None\n ) : (\n pod.campaigns.map((campaign, i) => {\n return (\n
    \n \n {campaign.name}\n \n
    \n );\n })\n )}\n
    \n {moment(pod.created).format(util.dateFormatHumanLong)}\n \n {moment(pod.expirationDate).format(\n util.dateFormatHumanLong\n )}\n
    \n
    \n {this.props.pods &&\n this.state.pods.length !== this.props.pods.length ? (\n

    \n this.showAll()}\n >\n Show All {this.props.pods.length} Pods\n \n

    \n ) : null}\n
    \n );\n }\n}\n\nSpotDetailPods.propTypes = {\n spotId: PropTypes.number,\n spotStatus: PropTypes.number,\n pods: PropTypes.array\n};\n","import React, { Component } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport SpotDetailSpot from \"./spot-detail-spot\";\nimport SpotDetailPod from \"./spot-detail-pod\";\nimport util from \"../util/util\";\n\nconst jQuery = window.jQuery;\n\nexport default class SpotDetail extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n id: Number(this.props.params.id), // id of the spot displayed\n loaded: false // ready to display\n };\n }\n\n componentDidMount() {\n this.mounted = true;\n this.getSpot();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n getSpot() {\n util.getSpot(this.state.id).then(data => {\n setTimeout(() => {\n this.mounted &&\n this.setState({\n id: data.id,\n description: data.description,\n loaded: true,\n name: data.name,\n sourceFile: data.source_file,\n sourceType: Number(data.source),\n sourceUrl: data.source_url,\n status: data.aws_status,\n statusMessage: data.aws_status_message,\n created: data.created,\n updated: data.updated,\n elementId: data.element_id,\n clientName: data.client_name,\n protrackId: data.protrack_id,\n tape: data.tape,\n duration: data.duration ? (data.duration / 1000).toFixed(2) : \"\",\n pods: data.pod_relations\n .filter(pr => pr.pod && pr.pod.id)\n .map((e, i) => {\n return e.pod;\n })\n });\n }, util.delayDetail);\n });\n }\n\n deleteSpot(spot) {\n const title = `Delete Spot`;\n let body = `

    Are you sure you want to delete the pod: ${spot.name}?

    `;\n body += `

    Existing Pods that use this spot will not affected.

    `;\n const buttonTextDefault = `Delete Spot`;\n const buttonTextLoading = `Deleting Spot`;\n const iconClass = `fa-trash-o`;\n const $modal = util.renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n );\n const $confirmButton = $modal.find(`.btn-danger`);\n\n // attach temporary event to remove the spot on confirmation of the modal;\n // remove any previous events first;\n // dont namespace the event because we want to remove everything;\n $confirmButton.one(`click`, () => {\n $confirmButton.button(`loading`);\n util\n .deleteSpot(spot.id)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // once done, go back to the list of pods\n $modal.modal(`hide`);\n browserHistory.push(`/spots/`);\n });\n });\n\n // attach the modal to the DOM, and then show it;\n jQuery(`body`).append($modal);\n $modal.modal(`show`);\n }\n\n render() {\n if (this.state.loaded === false) {\n return ;\n } else {\n return (\n
    \n this.deleteSpot(spot)}\n />\n\n
    \n\n \n
    \n );\n }\n }\n}\n\nSpotDetail.propTypes = {\n params: PropTypes.object\n};\n","import React, { Component } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\n\nconst unused = [\n {\n label: `All`,\n value: ``\n },\n {\n label: `Unused`,\n value: `true`\n },\n {\n label: `Used`,\n value: `false`\n }\n];\n\n// use the same logic to set state (on load, on prop change);\nconst returnSearchState = (props = {}) => ({\n search: props.search || ``, // search string value;\n status: props.status ? Number(props.status) : util.spotStatuses[0].value, // status value;\n unused: props.unused || unused[0].value\n});\n\nexport default class SpotListSearchForm extends Component {\n constructor(props) {\n super(props);\n\n this.state = returnSearchState(props);\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState(returnSearchState(nextProps));\n }\n\n render() {\n return (\n
    \n
    \n \n this.setState({ search: e.target.value.trim() })}\n onKeyPress={e => this.onKeyPress(e)}\n />\n
    \n\n
    \n \n this.setState({ status: Number(e.target.value) })}\n >\n {util.spotStatuses.map(option => (\n \n ))}\n \n
    \n\n
    \n \n this.setState({ unused: e.target.value })}\n >\n {unused.map(option => (\n \n ))}\n \n
    \n\n
    \n
    \n this.onSearchSubmit()}\n >\n \n Apply Filters\n \n\n this.onSearchReset()}\n >\n Reset Filters\n \n
    \n
    \n
    \n );\n }\n\n // if the key pressed is `enter` then submit the search form;\n onKeyPress(e) {\n if (e.key === `Enter`) {\n this.onSearchSubmit();\n }\n }\n\n // reset search form values to their default state;\n onSearchReset() {\n this.setState(returnSearchState());\n }\n\n // go to a new URL with the selected form values;\n onSearchSubmit() {\n let url = `${util.returnSpotListUrl()}?sort=${this.props.sort}`;\n\n if (this.state.search.length) {\n url = `${url}&search=${this.state.search}`;\n }\n\n if (this.state.status !== util.spotStatuses[0].value) {\n url = `${url}&status=${this.state.status}`;\n }\n\n if (this.state.unused !== unused[0].value) {\n url = `${url}&unused=${this.state.unused}`;\n }\n\n browserHistory.push(url);\n }\n}\n\nSpotListSearchForm.propTypes = {\n search: PropTypes.string,\n sort: PropTypes.string, // not editable from this component, but needs to be passed in the form;\n status: PropTypes.number,\n unused: PropTypes.string\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\n\nconst jQuery = window.jQuery;\n\nexport default function SpotListTable(props) {\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {renderSpotRows(props.spots)}\n
    #{renderSortLink(`name`, `Spot`)}{renderSortLink(`aws_status`, `Status`)}Pods{renderSortLink(`-created`, `Date Created`)}Duration
    \n
    \n );\n\n // three options for display (loading, no results, results);\n function renderSpotRows(spots = false) {\n if (spots.length === 0) {\n return (\n \n \n \n \n \n );\n } else if (spots === false) {\n return (\n \n \n 0\n \n {util.zeroSpotsMessage}\n \n );\n } else {\n return spots.map((spot, index) => {\n return index < util.spotResultsPerPage ? (\n \n \n \n {util.returnLineNumber(\n props.currentPage,\n util.spotResultsPerPage,\n index\n )}\n \n \n \n {spot.name}\n \n {util.returnSpotStatus(spot.aws_status)}\n {renderSpotPods(spot)}\n {moment(spot.created).format(util.dateFormatHumanLong)}\n \n {spot.duration ? `${(spot.duration / 1000).toFixed(2)} s` : `N/A`}\n \n \n ) : null;\n });\n }\n }\n\n // display the pods per spot;\n function renderSpotPods(spot) {\n let spotPodsLength = 0;\n if (spot.pods) {\n spotPodsLength = spot.pods.length;\n }\n // limiting the number of visible pods to the first 5\n if (spotPodsLength > 5) {\n spot.pods = spot.pods.slice(0, 5);\n }\n\n // if there are pods to display;\n if (spotPodsLength) {\n let spotPodsArray = spot.pods.map((pod, index) => (\n
    \n {pod.name}\n
    \n ));\n // adding an ellipsis at the end, if there were more than 5 pods\n if (spotPodsLength > 5) {\n spotPodsArray.push(\n
    \n ...\n
    \n );\n }\n return spotPodsArray;\n\n // no pods to display;\n } else {\n return None;\n }\n }\n\n // display table header sort links;\n function renderSortLink(sortValue, sortDisplay) {\n const className = util.returnSortClass(sortValue, props.sort);\n const newSortValue = util.returnSortValue(sortValue, props.sort);\n const queryStringObject = props.queryString\n ? jQuery.deparam(props.queryString.replace(`?`, ``))\n : {};\n\n // add the new sort value to the querystring object;\n queryStringObject.sort = newSortValue;\n\n return (\n \n {sortDisplay}\n \n \n \n );\n }\n}\n\nSpotListTable.propTypes = {\n currentPage: PropTypes.number, // used to calc the # in the TABLE;\n spots: PropTypes.oneOfType([\n // spot data to display;\n PropTypes.array,\n PropTypes.bool\n ]),\n queryString: PropTypes.string, // query string to add to sort links;\n sort: PropTypes.string // currently sorting spots by;\n};\n","import React, { Component } from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport util from \"../util/util\";\nimport Pagination from \"../pagination/pagination\";\nimport SpotListSearchForm from \"./spot-list-search-form\";\nimport SpotListTable from \"./spot-list-table\";\n\n// use the same logic to set state (on load, on prop change);\nconst returnInitialState = (props = {}) => ({\n page: Number(_.get(props, `params.page`, 1)), // page of spot results;\n spots: [], // spots to display (will be populated by an Ajax call);\n queryString: _.get(props, `location.search`, null), // pass to sort and pagination links to maintain search state;\n search: _.get(props, `location.query.search`, null), // search string;\n status: Number(_.get(props, `location.query.status`, 0)) || null, // search status;\n sort: _.get(props, `location.query.sort`, `-created`), // list sort value;\n unused: _.get(props, `location.query.unused`, null) // list sort value;\n});\n\nexport default class SpotList extends Component {\n constructor(props) {\n super(props);\n\n this.state = returnInitialState(props);\n }\n\n componentDidMount() {\n this.mounted = true;\n\n this.getSpots();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState(returnInitialState(nextProps), this.getSpots);\n }\n\n render() {\n return (\n
    \n
    \n
    \n

    Spots

    \n
    \n
    \n

    \n \n \n Create New Spot\n \n

    \n
    \n
    \n\n \n\n \n\n \n
    \n );\n }\n\n // get the spot data to display (one page at a time);\n getSpots() {\n util\n .getSpots({\n page: this.state.page,\n search: this.state.search,\n sort: this.state.sort,\n aws_status: this.state.status,\n unused: this.state.unused\n })\n .then(data => {\n setTimeout(() => {\n if (!this.mounted) {\n return;\n }\n let spots = [];\n if (data.results.length) {\n spots = data.results;\n for (let i = 0; i < spots.length; i++) {\n spots[i].pods = spots[i].pod_relations\n .filter(pr => pr.pod && pr.pod.id)\n .map((e, i) => {\n return e.pod;\n });\n }\n } else {\n spots = false;\n }\n\n this.setState({\n pageCount: Math.ceil(data.count / util.spotResultsPerPage),\n spots: spots\n });\n }, util.delayList);\n });\n }\n}\n\nSpotList.propTypes = {\n location: PropTypes.object,\n params: PropTypes.object\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport default function PodFormButtons(props) {\n return (\n

    \n \n Cancel\n \n\n Saving Pod\"\n onClick={props.onSubmit}\n >\n \n Save Pod\n \n

    \n );\n}\n\nPodFormButtons.propTypes = {\n onCancel: PropTypes.func,\n onSubmit: PropTypes.func\n};\n","import util from \"../util/util\";\n\nexport default function podFormValidation(report) {\n // returned, defines if we have errors or not;\n let hasErrors = false;\n\n // returned, used to setState to inform the users of the errors;\n const errors = {};\n\n if (report.name === ``) {\n errors.name = \"Pod Name is a required field.\";\n hasErrors = true;\n }\n\n // if it's a url, make sure it is valid;\n if (report.source === 1 && testForValidUrl(report.sourceUrl) === false) {\n errors.sourceUrl = true;\n hasErrors = true;\n }\n\n // need new validation with the file change (file won't change);\n if (\n report.source === 2 &&\n (report.sourceFile === `` ||\n report.sourceFile === util.podFormDefaultSourceFile)\n ) {\n errors.sourceFile = true;\n hasErrors = true;\n }\n\n // if the file is still uploading;\n if (report.source === 2 && report.showProgressBar) {\n errors.sourceFile = true;\n errors.uploading = true;\n hasErrors = true;\n }\n\n // if the file is too large;\n if (report.filesize > util.podFormMaxFilesize) {\n errors.sourceFile = true;\n hasErrors = true;\n }\n\n // if we have rows without elementIds;\n if (report.elements) {\n let elementIds = [];\n report.elements.forEach(function(element, index) {\n elementIds.push(element.element_id);\n if (element.element_id.length === 0) {\n // the first row is a special case\n if (index === 0) {\n if (\n element.protrack_id.length > 0 ||\n element.client_name.length > 0 ||\n element.spot_name.length > 0 ||\n element.tape.length > 0 ||\n element.order.length > 0 ||\n element.duration.length > 0\n ) {\n errors[\"element\" + index] = true;\n hasErrors = true;\n }\n } else {\n errors[\"element\" + index] = true;\n hasErrors = true;\n }\n }\n });\n // check element ids uniqueness within the pod\n elementIds = elementIds.filter(x => x);\n if (new Set(elementIds).size < elementIds.length) {\n hasErrors = true;\n errors[\"elements\"] = true;\n }\n }\n\n // check total duration\n if (\n report.source === 3 &&\n (report.totalDuration > util.podFormMaxDuration ||\n report.totalDuration < util.podFormMinDuration)\n ) {\n errors.spots = true;\n hasErrors = true;\n }\n\n return {\n errors: errors, // return for setState to tell the user what went wrong;\n hasErrors: hasErrors // return true/false so the submit works/doesn't;\n };\n}\n\n// regex to validate a URL;\nfunction testForValidUrl(url) {\n // eslint-disable-next-line\n const pattern = /^(http|https):\\/\\/(([a-zA-Z0-9$\\-_.+!*'(),;:&=]|%[0-9a-fA-F]{2})+@)?(((25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9]|[1-9][0-9]|[0-9])(\\.(25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9]|[1-9][0-9]|[0-9])){3})|localhost|([a-zA-Z0-9\\-\\u00C0-\\u017F]+\\.)+([a-zA-Z]{2,}))(:[0-9]+)?(\\/(([a-zA-Z0-9$\\-_.+!*'(),;:@&=]|%[0-9a-fA-F]{2})*(\\/([a-zA-Z0-9$\\-_.+!*'(),;:@&=]|%[0-9a-fA-F]{2})*)*)?(\\?([a-zA-Z0-9$\\-_.+!*'(),;:@&=\\/?]|%[0-9a-fA-F]{2})*)?(\\#([a-zA-Z0-9$\\-_.+!*'(),;:@&=\\/?]|%[0-9a-fA-F]{2})*)?)?$/;\n\n return pattern.test(url);\n}\n","import React, { useCallback, useEffect, useState } from 'react';\nimport { browserHistory } from 'react-router';\nimport PropTypes from 'prop-types';\nimport Select from 'react-select';\nimport _ from 'lodash';\nimport LoadingIndicatorHeader from '../loading-indicator/loading-indicator-header';\nimport PodFormButtons from './pod-form-buttons';\nimport podFormValidation from './pod-form-validation';\nimport ajax from '../util/util-ajax';\nimport util from '../util/util';\nimport DatePicker from 'react-datepicker';\nimport moment from 'moment';\nimport Dropzone from 'react-dropzone';\nimport Tooltip from \"../tooltip/tooltip\";\nimport { v4 } from 'uuid';\n\nconst jQuery = window.jQuery;\n\nexport default function PodForm (props) {\n // prop names determine which errors to show;\n const [errors, setErrors] = useState({});\n // id of the rule we are editing (0 means new rule to create);\n const [id, setId] = useState(0);\n const [name, setName] = useState(``);\n const [sourceType, setSourceType] = useState(1);\n const [sourceUrl, setSourceUrl] = useState(``);\n const [sourceFile, setSourceFile] = useState(util.podFormDefaultSourceFile);\n const [expirationDate, setExpirationDate] = useState(null);\n const [description, setDescription] = useState(``);\n const [elements, setElements] = useState([]);\n const [originalElements, setOriginalElements] = useState(JSON.stringify([]));\n const [spots, setSpots] = useState([]);\n const [originalSpots, setOriginalSpots] = useState([]);\n const [spotOptions, setSpotOptions] = useState([]);\n const [searchingForSpots, setSearchingForSpots] = useState(false);\n // tells the backend to re-process the pod\n const [spotsChanged, setSpotsChanged] = useState(false);\n const [totalDuration, setTotalDuration] = useState(0);\n const [progress, setProgress] = useState(0);\n // hide/show file upload progress bar;\n const [showProgressBar, setShowProgressBar] = useState(false);\n // if the Pod has Failed to transcode\n const [statusFailed, setStatusFailed] = useState(false);\n const [statusMessage, setStatusMessage] = useState(``);\n // have the Ajax calls resolved, and we're ready to show the form;\n const [loaded, setLoaded] = useState(false);\n\n useEffect( ()=>{\n const podId = props.params ? Number(props.params.id) : 0;\n setId(podId);\n\n // get pod data to display;\n const getPod = () => {\n if (podId === 0) {\n // if a spot was defined, then set it as the value of the SELECT\n // it should enter here when coming from a Spot page\n if (props.params && props.params.spotId) {\n util.getSpot(props.params.spotId)\n .then((data) => {\n const spot = util.returnSimpleSelectOptionsForSpots([data])[0];\n\n setSourceType(3);\n setElements(spotToPodElement(data[0], 1, podId));\n setSpots([spot]);\n setLoaded(true);\n });\n // otherwise just tell the component that we're done loading;\n } else {\n setElements([returnEmptyElement(0)]);\n setSpots(getDefaultSpotValue());\n setLoaded(true);\n }\n } else {\n jQuery\n .when(\n util.getPod(podId),\n util.getSpotsForPod(podId)\n )\n .then((podData, spotsData) => {\n // we dont want an empty elements array;\n // at least one value (can be empty) in the array is required;\n // this is so the form field will be rendered (one form field per item in the array);\n podData = podData[0];\n if (podData.elements.length === 0) {\n podData.elements.push(returnEmptyElement(podId));\n }\n const spotsArray = spotsData[0].results.length ?\n util.returnSimpleSelectOptionsForSpots(spotsData[0].results)\n : getDefaultSpotValue();\n const source = Number(podData.source);\n let totalSpotsDuration = spotsArray.reduce(\n (a, b) => a + Number(b.duration), 0\n );\n totalSpotsDuration = totalSpotsDuration.toFixed(2);\n setTimeout(() => {\n // default (empty) sourceFile if pod is made of spots\n const sourceFile = (podData.source_file && source !== 3) ?\n podData.source_file\n :\n util.podFormDefaultSourceFile;\n\n setName(podData.name);\n setSourceType(source);\n setSourceUrl(podData.source_url);\n setSourceFile(sourceFile);\n setExpirationDate(podData.expiration_date);\n setDescription(podData.description);\n setElements(podData.elements);\n setOriginalElements(JSON.stringify(\n podData.elements.filter(\n function(element){return(element.element_id.length > 0);}\n )\n ));\n setSpots(spotsArray);\n setOriginalSpots(util.returnSimpleSelectOptions(spotsData[0].results));\n setTotalDuration(totalSpotsDuration);\n setStatusFailed(podData.aws_status === 3);\n setStatusMessage(podData.aws_status_message);\n setLoaded(true);\n }, util.delayDetail);\n });\n }\n }\n\n getPod();\n }, [props]);\n\n useEffect( ()=>{\n // greying out the empty Spots, easier with css than with react-select custom styles\n jQuery('div[class*=singleValue]:contains(\"Select a spot\")').css(\n 'color', 'hsl(0, 0%, 50%)'\n );\n }, [spots]);\n\n // push an empty value into the elements array;\n // this way a new INPUT will appear for the user to add the new value;\n const addContentIdNumber = () => {\n const updatedElements = Array.from(elements);\n\n updatedElements.push(returnEmptyElement(id));\n\n setElements(updatedElements);\n }\n\n // change a value in the elements array;\n const changeContentIdNumber = (value, index, key) => {\n const updatedElements = Array.from(elements);\n\n updatedElements[index][key] = value;\n\n setElements(updatedElements);\n }\n\n // remove a value from the elements array;\n const removeContentIdNumber = (index) => {\n const updatedElements = Array.from(elements);\n\n if (updatedElements[index].id > 0) {\n util.deleteElementFromPod(updatedElements[index].id)\n .fail(() => {\n })\n .then(() => {\n util.alertInfo('Element ' + updatedElements[index][`element_id`] + ' deleted.');\n updatedElements.splice(index, 1);\n\n if (updatedElements.length === 0) {\n updatedElements.push(returnEmptyElement(id));\n }\n\n setElements(updatedElements);\n });\n } else { // not a saved element\n updatedElements.splice(index, 1);\n\n setElements(updatedElements);\n }\n }\n\n const getSpotsInUse = () => {\n let spotIds = [];\n\n spots && spots.forEach((spot) => {\n // selecting only the not empty ('Select a spot') spots\n spot.value > 0 && spotIds.push(spot.value);\n });\n\n return spotIds;\n }\n\n const addSpot = () => {\n const spotsArray = Array.from(spots);\n spotsArray.push(getDefaultSpotValue()[0]);\n\n setSpots(spotsArray);\n }\n\n const returnEmptyElement = (podId) => {\n return {\n id: 0,\n pod: podId || 0,\n element_id: ``,\n protrack_id: ``,\n client_name: ``,\n spot_name: ``,\n tape: ``,\n order: ``,\n duration: ``,\n metadata: {}\n }\n }\n\n const spotToPodElement = (spot, order, podId) => {\n return {\n id: 0,\n pod: podId,\n element_id: spot.element_id,\n protrack_id: spot.protrack_id ? spot.protrack_id : \"\",\n client_name: spot.client_name ? spot.client_name : \"\",\n spot_name: spot.spot_name ? spot.spot_name: \"\",\n tape: spot.tape ? spot.tape : \"\",\n order: order ? order : \"\",\n duration: spot.duration,\n metadata: {\n // used as a way to reference spots\n spot_id: spot.id\n }\n }\n }\n\n // default value of the SELECT;\n const getDefaultSpotValue = () => {\n return [{\n label: `Select a spot`,\n value: 0,\n duration: 0,\n id: v4()\n }]\n }\n\n // updating the UI search status in the focused Select\n const getSpotSearchStatus = (searchTerm) => {\n if (searchTerm.inputValue.length === 0) {\n return `Please type a few characters to kick off remote search.`\n }\n if (searchingForSpots === true) {\n return `Searching...`\n }\n if (spotOptions.length === 0) {\n return `No results found.`\n }\n return `Something went wrong.`\n }\n\n // perform a backend search on the inputted character(s)\n const getSpotSearchResults = (searchTerm) => {\n // user finished typing (...more details in constructor on debounce)\n if (searchTerm.length > 0) {\n setSearchingForSpots(true);\n util\n .getSpots({\n sort: `name`,\n page: 1,\n search: searchTerm,\n aws_status: 2,\n exclude: getSpotsInUse().join(\",\"),\n })\n .then((data) => {\n setSearchingForSpots(false);\n setSpotOptions(util.returnSimpleSelectOptionsForSpots(data.results));\n })\n } else {\n // user deletes the previously inputted search keywords\n setSearchingForSpots(false);\n setSpotOptions([]);\n }\n }\n\n // delaying the spot search call until the user has stopped typing (after 250 msec)\n const getSpotSearchResultsDelayed = useCallback(\n _.debounce(getSpotSearchResults, 250),\n [spots]\n )\n\n // updating the State when the user has selected a Spot out of the search results\n const handleSpotsOnValueChange = (valueChanged, currentSpotId) => {\n let spotsArray;\n let spotsElement = [];\n let elementsOrder = 1;\n let spotsTotalDuration = 0;\n\n // determine which Spot value was changed, and only update that select\n spotsArray = spots.map( (spot) => {\n // the current spot can have its value changed, or deleted\n if (spot.id === currentSpotId) {\n // value changed - updating that spot with the new value\n if (valueChanged) {\n return valueChanged;\n } else {\n // value deleted - setting it back to default\n return getDefaultSpotValue()[0];\n }\n } else {\n // do nothing for the non-current spots\n return spot;\n }\n });\n\n // updating the Elements (Spots Metadata), for all the valid (non-empty) Spots\n spotsArray.forEach((spot) => {\n let spotElement;\n\n if (spot.value > 0) {\n // checking if that Element already exists (for Edit Pod case)\n for (let stateElement of elements) {\n if (stateElement.metadata.spot_id === spot.id) {\n spotElement = stateElement;\n spotElement[`order`] = elementsOrder;\n elementsOrder++;\n break;\n }\n }\n // if it doesn't exist, creating a new one\n if (!spotElement) {\n spotElement = spotToPodElement(spot, elementsOrder, id);\n elementsOrder++;\n }\n\n spotsElement.push(spotElement);\n\n spotsTotalDuration += Number(spot.duration);\n }\n });\n\n // updating the State in order to re-render the Spots and the Elements\n setSpotsChanged(true);\n setSpots(spotsArray);\n setElements(spotsElement);\n setSpotOptions([]);\n setTotalDuration(spotsTotalDuration.toFixed(2));\n }\n\n const onDrop = (acceptedFiles) => {\n const file = acceptedFiles[0];\n\n if (file) {\n const filesize = Math.ceil(file.size / (1024 * 1024)); // convert bytes into megabytes;\n\n // see if there are any errors before proceeding;\n const validationResult = podFormValidation({ filesize: filesize });\n\n // danger will robinson, we have a file size error;\n if (validationResult.hasErrors) {\n // display the error(s) - existing and new;\n // and remove any previous value for the file upload;\n setErrors(_.merge({}, errors, validationResult.errors));\n setSourceFile(util.podFormDefaultSourceFile);\n\n // stop any further processing;\n return false;\n }\n\n const report = {\n filename: file.name,\n filetype: file.type\n };\n\n // sourceFile isn't known yet, it will be determined in the response from the Django server;\n let sourceFileBackend = ``;\n\n // get the data needed to post to S3;\n util.getS3Url(report)\n .then((data) => {\n const s3Report = new FormData();\n const s3Url = data.data.url;\n\n // take whatever was returned from Django;\n // and include it in the post to S3;\n for (const key in data.data.fields) {\n s3Report.append(key, data.data.fields[key]);\n }\n\n sourceFileBackend = data.url;\n\n // also include the file;\n s3Report.append(`file`, file);\n\n // add a progress callback;\n const progressCallback = () => {\n const xhr = new window.XMLHttpRequest();\n\n xhr.upload.addEventListener(`progress`, (progressEvent) => {\n if (progressEvent.lengthComputable) {\n const percentComplete = Math.ceil(progressEvent.loaded / progressEvent.total * 100);\n\n // update the progress indicator;\n setProgress(percentComplete);\n }\n }, false);\n\n return xhr;\n };\n\n // turn on the progress indicator;\n setProgress(0);\n setShowProgressBar(true);\n\n // start the file upload;\n return util\n .saveFileToS3(s3Report, s3Url, progressCallback)\n .fail(() => {\n setShowProgressBar(false);\n setSourceFile(util.podFormDefaultSourceFile);\n });\n })\n .then(() => {\n // let the user read the completed message for this long;\n const timeToShowCompletedUpload = 1500;\n\n setTimeout(() => {\n // take the existing errors and remove the file error;\n // the file just finished uploading, there aren't anymore file errors;\n const errorsArray = _.merge({}, errors, validationResult.errors);\n\n delete errorsArray.sourceFile;\n\n // then turn off the progress indicator and set the filename to display;\n setErrors(errorsArray);\n setShowProgressBar(false);\n setSourceFile(sourceFileBackend);\n }, timeToShowCompletedUpload);\n });\n }\n }\n\n // submit the form;\n const onSubmit = () => {\n // we'll need the Pod Id later, after it's created on the backend\n let podId = null;\n\n // build the object to send to the server;\n const report = {\n \"description\": description.trim(),\n \"elements\": [],\n \"id\": id,\n \"name\": name.trim(),\n \"showProgressBar\": showProgressBar, // used by validation only;\n \"source\": sourceType,\n \"source_file\": sourceType === 2 ? sourceFile : null,\n \"source_url\": sourceType === 1 ? sourceUrl : null,\n \"sourceFile\": sourceType === 2 ? sourceFile : null, // used by validation only;\n \"sourceUrl\": sourceType === 1 ? sourceUrl : null, // used by validation only;\n \"expiration_date\": expirationDate === null ? null : moment(expirationDate).format(util.dateFormatComputer),\n \"spots\": [],\n \"totalDuration\": totalDuration,\n \"spots_changed\": sourceType === 3 && spotsChanged\n };\n\n // clean up data before passing for validation\n elements.forEach((element) => {\n const reportElements = report[`elements`];\n\n // clean data before saving\n element.pod = report.id;\n element.element_id = element.element_id.toString().trim();\n element.protrack_id = element.protrack_id.trim();\n element.client_name = element.client_name.trim();\n element.spot_name = element.spot_name.trim();\n element.tape = element.tape.toString().trim();\n element.order = element.order.toString().trim();\n element.duration = element.duration.toString().trim();\n reportElements.push(element);\n });\n\n spots && spots.forEach((spot) => {\n // selecting only the not empty ('Select a spot') spots\n spot.value > 0 && report.spots.push(spot.value);\n });\n\n // see if there are any errors before proceeding;\n const validationResult = podFormValidation(report);\n\n // danger will robinson, we have errors;\n if (validationResult.hasErrors) {\n setErrors(validationResult.errors);\n\n // stop any further processing;\n return false;\n\n // good to go, clear any existing errors;\n } else {\n setErrors({});\n }\n\n // remove empty values for the elements before passing to Django;\n // Django can't deal with an empty value in the array;\n report[`elements`] = report[`elements`].filter( function(element) {\n return (element.element_id.length > 0);\n });\n\n // put the button into a processing state;\n const $button = jQuery(`.btn-primary`).button(`loading`);\n\n // save the form data;\n util.savePod(report.id, report)\n // if there is a backend error (validation,...) on Pod save\n .fail((error) => {\n const serializerNameExistsError = \"A Pod with this name already exists.\";\n const api_error = _.get(error, \"responseJSON.Validation_Error[0]\")\n\n // if the name already exists\n if (serializerNameExistsError === api_error) {\n setErrors(_.merge({}, errors, { name: api_error}));\n // if there is a different backend (4xx, 5xx) error\n } else {\n ajax.onFail(error);\n }\n\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $button.button(`reset`);\n }, util.delayForm);\n\n // stop any further processing, as the Pod was not saved in the DB\n return false;\n })\n .then((data) => {\n // needed for subsequent ajax calls;\n podId = data.id;\n\n // toggle the pod id notification, so that we can track its status\n // and send a notification once it's ready / failed\n util.savePodNotification(podId, false);\n\n // only need to update the Elements if they were changed\n if (originalElements !== JSON.stringify(report[`elements`])) {\n // make sure we actually have something meaningful to save\n if (report[`elements`].length > 0) {\n // if this is a new pod, assign the proper podId\n report[`elements`].forEach((element, index) => {\n if (element.pod === 0) {\n report[`elements`][index].pod = podId;\n }\n });\n\n // updating the Elements (do a clear first, then create the new ones)\n util.updateElementsForPod(podId, report[`elements`])\n }\n }\n })\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $button.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n const removeRequests = originalSpots.map((spot) => {\n return util.deleteSpotFromPod(podId, spot.value);\n });\n // start the removals;\n return jQuery.when.apply(jQuery, removeRequests);\n })\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $button.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n if (report.spots.length === 0 && report.source !== 3) {\n return Promise.resolve()\n }\n // save spots to Pod. order must be kept!\n return util.saveSpotsToPod(podId, report.spots);\n })\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $button.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n setTimeout(() => {\n const newUrl = util.returnPodDetailUrl(podId);\n\n // load the detail page;\n browserHistory.push(newUrl);\n }, util.delayForm);\n })\n }\n\n // cancel this action (do nothing and go somewhere else);\n const onCancel = () => {\n const newUrl = id === 0 ? util.returnPodListUrl() : util.returnPodDetailUrl(id);\n\n browserHistory.push(newUrl);\n }\n\n if (loaded === false) {\n return (\n \n );\n } else {\n const displayErrors = util.formatVideoError(statusMessage);\n return (\n
    \n
    \n
    \n

    { id === 0 ? `New Pod` : `Edit Pod` }

    \n
    \n
    \n onCancel() }\n onSubmit={ () => onSubmit() } />\n
    \n
    \n\n
    \n\n
    \n
    \n
    \n \n setName(e.target.value)}\n maxLength=\"100\"\n readOnly={ statusFailed } />\n

    \n { errors.name }\n

    \n
    \n
    \n
    \n
    \n \n
    \n document.querySelector(`#expirationDate`).focus() }>\n \n
    \n
    \n { setExpirationDate(value) } /> }\n
    \n
    \n

    \n Start Date must be a valid date, and less than End Date.\n

    \n
    \n
    \n \n\n
    \n
    \n
    \n \n
    \n \n \n {util.spotsAvailable() &&\n }\n
    \n
    \n
    \n
    \n
    \n
    \n \n setSourceUrl(e.target.value) }\n />\n \n A valid URL is required. Maximum of 200 characters.\n

    \n
    \n
    \n\n
    \n
    \n \n {\n sourceFile !== util.podFormDefaultSourceFile &&\n  (\n setSourceFile(util.podFormDefaultSourceFile)}\n >\n Replace file\n \n )\n }\n
    \n {\n sourceType === 2 && sourceFile === util.podFormDefaultSourceFile ? (\n onDrop(acceptedFiles, rejectedFiles) }\n multiple={ false }>\n
    \n \n ) : (\n \n
    \n )\n }\n\n {\n showProgressBar ? (\n
    \n \n { progress }% Complete\n
    \n
    \n ) :\n null\n }\n
    \n

    \n {\n errors.uploading ? (\n File is still uploading.\n ) : (\n \n File is required, and must be less than\n { util.podFormMaxFilesize / 1024 }GB.\n \n )\n }\n

    \n
    \n
    \n
    \n
    \n \n \n
    \n Total Pod duration: {totalDuration} seconds.\n
    \n
    \n {\n spots.map((spot) => (\n
    \n {return dbOption;}\n }\n noOptionsMessage={\n (searchTerm) => {\n return (\n
    \n { getSpotSearchStatus(searchTerm) }\n
    \n );\n }\n }\n onInputChange={\n (searchTerm) => {\n // updating the search status on the UI\n setSearchingForSpots(true);\n // making the backend call, with delay\n getSpotSearchResultsDelayed(searchTerm);\n }\n }\n onChange={\n (valueChanged, currentSpot) => {\n handleSpotsOnValueChange(valueChanged, currentSpot.name);\n }\n }\n />\n
    \n ))\n }\n
    \n

    \n Total Pod duration must be between {util.podFormMinDuration} and {util.podFormMaxDuration} seconds.\n

    \n addSpot() }>\n \n Add Another Spot\n \n
    \n
    \n \n {displayErrors.length ? (\n
    \n
    \n
      \n {displayErrors.map((errorMessage, i) => (\n \n { errorMessage }\n \n ))}\n
    \n
    \n
    \n ) : null}\n \n {errors[\"elements\"] ? (\n
    \n
    \n Element IDs must be unique within a Pod.\n
    \n
    \n ) : null}\n
    0 ? `row` : `row hidden`} >\n
    \n
    \n
    \n {\n elements.map((element, index) => (\n
    \n {\n
    \n {\n index > 0 ? (\n
    \n ) : (``)\n }\n
    \n
    \n
    \n 0 ? `visible-xs` : ``}`}\n htmlFor={ `element_id${ index }` }>\n Element ID*\n \n
    0 || element.id > 0) ?\n `input-group` \n :\n ``}`\n }>\n changeContentIdNumber(\n e.target.value, index, 'element_id'\n )\n }\n readOnly={ statusFailed } />\n {\n sourceType !== 3 && (index > 0 || element.id > 0) ? (\n removeContentIdNumber(index) }>×\n ) : ( `` )\n }\n
    \n
    \n
    \n\n
    \n 0 ? `visible-xs` : ``}`}\n htmlFor={ `protrack_id${ index }` }>\n Protrack ID\n \n changeContentIdNumber(\n e.target.value, index, 'protrack_id'\n )\n }\n readOnly={ statusFailed } />\n
    \n\n
    \n 0 ? `visible-xs` : ``}`}\n htmlFor={ `client_name${ index }` }>\n Client Name\n \n changeContentIdNumber(\n e.target.value, index, 'client_name'\n )\n }\n readOnly={ statusFailed } />\n
    \n\n
    \n 0 ? `visible-xs` : ``}`}\n htmlFor={ `spot_name${ index }` }>\n Spot Name\n \n changeContentIdNumber(\n e.target.value, index, 'spot_name'\n )\n }\n readOnly={ statusFailed || sourceType === 3 } />\n
    \n\n
    \n 0 ? `visible-xs` : ``}`}\n htmlFor={ `tape${ index }` }>\n Tape\n \n changeContentIdNumber(\n e.target.value, index, 'tape'\n )\n }\n readOnly={ statusFailed } />\n
    \n\n
    \n 0 ? `visible-xs` : ``}`}\n htmlFor={ `order${ index }` }>\n Order\n \n changeContentIdNumber(\n e.target.value, index, 'order'\n )\n }\n readOnly={ statusFailed || sourceType === 3} />\n
    \n\n
    \n 0 ? `visible-xs` : ``}`}\n htmlFor={ `duration${ index }` }>\n Duration\n \n changeContentIdNumber(\n e.target.value, index, 'duration'\n )\n }\n readOnly={ statusFailed || sourceType === 3 } />\n
    \n
    \n
    \n }\n
    \n ))\n }\n
    \n {\n // disable button if Pod is failed or source type is \"spots\"\n statusFailed === false && sourceType !== 3 ? (\n addContentIdNumber() }>\n \n Add Another Element\n \n ) : null\n }\n
    \n
    \n
    \n
    \n\n
    \n\n
    \n
    \n
    \n \n Description\n \n setDescription(e.target.value) }\n readOnly={ statusFailed }>{ description }\n
    \n
    \n
    \n\n
    \n\n onCancel() }\n onSubmit={ () => onSubmit() } />\n \n );\n }\n}\n\nPodForm.propTypes = {\n params: PropTypes.object\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport default function SpotFormButtons(props) {\n return (\n

    \n \n Cancel\n \n\n Saving Spot\"\n onClick={props.onSubmit}\n >\n \n Save Spot\n \n

    \n );\n}\n\nSpotFormButtons.propTypes = {\n onCancel: PropTypes.func,\n onSubmit: PropTypes.func\n};\n","import util from \"../util/util\";\n\nexport default function spotFormValidation(report) {\n // returned, defines if we have errors or not;\n let hasErrors = false;\n\n // returned, used to setState to inform the users of the errors;\n const errors = {};\n\n if (report.name === ``) {\n errors.name = \"Spot Name is a required field.\";\n hasErrors = true;\n }\n\n // if it's a url, make sure it is valid;\n if (report.source === 1 && testForValidUrl(report.sourceUrl) === false) {\n errors.sourceUrl = true;\n hasErrors = true;\n }\n\n // need new validation with the file change (file won't change);\n if (\n report.source === 2 &&\n (report.sourceFile === `` ||\n report.sourceFile === util.spotFormDefaultSourceFile)\n ) {\n errors.sourceFile = true;\n hasErrors = true;\n }\n\n // if the file is still uploading;\n if (report.source === 2 && report.showProgressBar) {\n errors.sourceFile = true;\n errors.uploading = true;\n hasErrors = true;\n }\n\n // if the file is too large;\n if (report.filesize > util.spotFormMaxFilesize) {\n errors.sourceFile = true;\n hasErrors = true;\n }\n\n return {\n errors: errors, // return for setState to tell the user what went wrong;\n hasErrors: hasErrors // return true/false so the submit works/doesn't;\n };\n}\n\n// regex to validate a URL;\nfunction testForValidUrl(url) {\n // eslint-disable-next-line\n const pattern = /^(http|https):\\/\\/(([a-zA-Z0-9$\\-_.+!*'(),;:&=]|%[0-9a-fA-F]{2})+@)?(((25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9]|[1-9][0-9]|[0-9])(\\.(25[0-5]|2[0-4][0-9]|[0-1][0-9][0-9]|[1-9][0-9]|[0-9])){3})|localhost|([a-zA-Z0-9\\-\\u00C0-\\u017F]+\\.)+([a-zA-Z]{2,}))(:[0-9]+)?(\\/(([a-zA-Z0-9$\\-_.+!*'(),;:@&=]|%[0-9a-fA-F]{2})*(\\/([a-zA-Z0-9$\\-_.+!*'(),;:@&=]|%[0-9a-fA-F]{2})*)*)?(\\?([a-zA-Z0-9$\\-_.+!*'(),;:@&=\\/?]|%[0-9a-fA-F]{2})*)?(\\#([a-zA-Z0-9$\\-_.+!*'(),;:@&=\\/?]|%[0-9a-fA-F]{2})*)?)?$/;\n\n return pattern.test(url);\n}\n","import React, { Component } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport SpotFormButtons from \"./spot-form-buttons\";\nimport spotFormValidation from \"./spot-form-validation\";\nimport ajax from \"../util/util-ajax\";\nimport util from \"../util/util\";\nimport Dropzone from \"react-dropzone\";\nimport Tooltip from \"../tooltip/tooltip\";\n\nconst jQuery = window.jQuery;\n\n// use the same logic to set state (on load, on prop change);\nconst returnInitialState = (props = {}) => ({\n errors: {}, // prop names determine which errors to show;\n id: props.params ? Number(props.params.id) : 0, // id of the rule we are editing (0 means new rule to create);\n loaded: false, // have the Ajax calls resolved, and we're ready to show the form;\n showProgressBar: false, // hide/show file upload progress bar;\n statusMessage: \"\"\n});\n\nexport default class SpotForm extends Component {\n constructor(props) {\n super(props);\n\n this.state = returnInitialState(props);\n }\n\n componentDidMount() {\n this.mounted = true;\n this.getSpot();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState(returnInitialState(nextProps), this.getSpot);\n }\n\n render() {\n if (this.state.loaded === false) {\n return ;\n } else {\n const displayErrors = util.formatVideoError(this.state.statusMessage);\n return (\n
    \n
    \n
    \n

    \n {this.state.id === 0 ? `New Spot` : `Edit Spot`}\n

    \n
    \n
    \n this.onCancel()}\n onSubmit={() => this.onSubmit()}\n />\n
    \n
    \n\n
    \n\n
    \n
    \n \n \n this.setState({ name: e.target.value })}\n maxLength=\"100\"\n readOnly={this.state.failed}\n />\n

    \n {this.state.errors.name}\n

    \n
    \n
    \n \n\n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n
    \n
    \n \n \n \n this.setState({ sourceUrl: e.target.value })}\n />\n \n A valid URL is required. Maximum of 200 characters.\n

    \n
    \n
    \n\n \n \n \n {this.state.sourceFile !== util.spotFormDefaultSourceFile && (\n \n  (\n {\n this.setState({\n sourceFile: util.spotFormDefaultSourceFile\n });\n }}\n >\n Replace file\n \n )\n \n )}\n
    \n {this.state.sourceType === 2 &&\n this.state.sourceFile === util.spotFormDefaultSourceFile ? (\n \n this.onDrop(acceptedFiles, rejectedFiles)\n }\n multiple={false}\n >\n \n \n ) : (\n \n )}\n\n {this.state.showProgressBar ? (\n
    \n \n {this.state.progress}% Complete\n
    \n
    \n ) : null}\n \n \n {this.state.errors.uploading ? (\n File is still uploading.\n ) : (\n \n File is required, and must be less than{\" \"}\n {util.spotFormMaxFilesize / 1024}GB.\n \n )}\n

    \n \n \n \n {displayErrors.length ? (\n
    \n
    \n
      \n {displayErrors.map((errorMessage, i) => (\n
    • {errorMessage}
    • \n ))}\n
    \n
    \n
    \n ) : null}\n \n
    \n
    \n
    \n
    \n
    \n
    \n {\n
    \n
    \n
    \n \n \n
    \n \n this.setState({\n element_id: e.target.value\n })\n }\n maxLength=\"100\"\n readOnly={this.state.failed}\n />\n
    \n
    \n
    \n
    \n \n Protrack ID\n \n \n this.setState({ protrack_id: e.target.value })\n }\n readOnly={this.state.failed}\n />\n
    \n
    \n \n \n this.setState({ client_name: e.target.value })\n }\n readOnly={this.state.failed}\n />\n
    \n\n
    \n \n \n this.setState({ tape: e.target.value })\n }\n readOnly={this.state.failed}\n />\n
    \n\n
    \n \n \n \n
    \n
    \n
    \n }\n
    \n
    \n
    \n
    \n
    \n \n\n
    \n\n
    \n
    \n
    \n \n Description\n \n this.setState({ description: e.target.value })}\n readOnly={this.state.failed}\n >\n {this.state.description}\n \n
    \n
    \n
    \n\n
    \n\n this.onCancel()}\n onSubmit={() => this.onSubmit()}\n />\n \n );\n }\n }\n\n onDrop(acceptedFiles) {\n const file = acceptedFiles[0];\n\n if (file) {\n const fileName = file.name;\n const fileSize = Math.ceil(file.size / (1024 * 1024)); // convert bytes into megabytes;\n let fileType = file.type;\n\n // see if there are any errors before proceeding;\n const validationResult = spotFormValidation({ filesize: fileSize });\n\n // danger will robinson, we have a file size error;\n if (validationResult.hasErrors) {\n // display the error(s) - existing and new;\n // and remove any previous value for the file upload;\n this.setState(\n {\n errors: _.merge({}, this.state.errors, validationResult.errors),\n sourceFile: util.spotFormDefaultSourceFile\n },\n util.putFoucsOnError\n );\n\n // stop any further processing;\n return false;\n }\n\n // it seems that 'react-dropzone' on Windows doesn't recognise the .mxf file type\n // so trying to take the file type from the file name, in case it's not recognised\n if (!fileType) {\n fileType = fileName.split(`.`).pop();\n }\n\n const report = {\n filename: fileName,\n filetype: fileType,\n new_bucket: true\n };\n\n // sourceFile isn't known yet, it will be determined in the response from the Django server;\n let sourceFile = ``;\n\n // get the data needed to post to S3;\n util\n .getS3Url(report)\n .then(data => {\n const s3Report = new FormData();\n const s3Url = data.data.url;\n\n // take whatever was returned from Django;\n // and include it in the post to S3;\n for (const key in data.data.fields) {\n s3Report.append(key, data.data.fields[key]);\n }\n\n sourceFile = data.url;\n\n // also include the file;\n s3Report.append(`file`, file);\n\n // add a progress callback;\n const progressCallback = () => {\n const xhr = new window.XMLHttpRequest();\n\n xhr.upload.addEventListener(\n `progress`,\n progressEvent => {\n if (progressEvent.lengthComputable) {\n const percentComplete = Math.ceil(\n (progressEvent.loaded / progressEvent.total) * 100\n );\n\n // update the progress indicator;\n this.mounted &&\n this.setState({\n progress: percentComplete\n });\n }\n },\n false\n );\n\n return xhr;\n };\n\n // turn on the progress indicator;\n this.mounted &&\n this.setState({\n progress: 0,\n showProgressBar: true\n });\n // start the file upload;\n return util\n .saveFileToS3(s3Report, s3Url, progressCallback)\n .fail(() => {\n this.mounted &&\n this.setState({\n showProgressBar: false,\n sourceFile: util.spotFormDefaultSourceFile\n });\n });\n })\n .then(() => {\n // let the user read the completed message for this long;\n const timeToShowCompletedUpload = 1500;\n\n setTimeout(() => {\n // take the existing errors and remove the file error;\n // the file just finished uploading, there aren't anymore file errors;\n const errors = _.merge(\n {},\n this.state.errors,\n validationResult.errors\n );\n\n delete errors.sourceFile;\n\n // then turn off the progress indicator and set the filename to display;\n this.mounted &&\n this.setState(\n {\n errors: errors,\n showProgressBar: false,\n sourceFile: sourceFile\n },\n util.putFoucsOnError\n );\n }, timeToShowCompletedUpload);\n });\n }\n }\n\n // submit the form;\n onSubmit() {\n // build the object to send to the server;\n const report = {\n id: this.state.id,\n description: this.state.description.trim(),\n name: this.state.name.trim(),\n showProgressBar: this.state.showProgressBar, // used by validation only;\n source: this.state.sourceType,\n source_file: this.state.sourceType === 2 ? this.state.sourceFile : null,\n source_url: this.state.sourceType === 1 ? this.state.sourceUrl : null,\n sourceFile: this.state.sourceType === 2 ? this.state.sourceFile : null, // used by validation only;\n sourceUrl: this.state.sourceType === 1 ? this.state.sourceUrl : null, // used by validation only;\n element_id: this.state.element_id.trim(),\n client_name: this.state.client_name.trim(),\n protrack_id: this.state.protrack_id.trim(),\n tape: this.state.tape.trim()\n };\n\n // see if there are any errors before proceeding;\n const validationResult = spotFormValidation(report);\n\n // danger will robinson, we have errors;\n if (validationResult.hasErrors) {\n this.setState(\n {\n errors: validationResult.errors\n },\n util.putFoucsOnError\n );\n\n // stop any further processing;\n return false;\n\n // good to go, clear any existing errors;\n } else {\n this.setState({\n errors: {}\n });\n }\n\n // put the button into a processing state;\n const $button = jQuery(`.btn-primary`).button(`loading`);\n\n // save the form data;\n util\n .saveSpot(report.id, report)\n // if there is a backend error (validation,...) on Spot save\n .fail(error => {\n const serializerNameExistsError =\n \"A Spot with this name already exists.\";\n const api_error = _.get(error, \"responseJSON.Validation_Error[0]\");\n\n // if the name already exists\n if (serializerNameExistsError === api_error) {\n this.setState(\n {\n errors: _.merge({}, this.state.errors, { name: api_error })\n },\n util.putFoucsOnError\n );\n // if there is a different backend (4xx, 5xx) error\n } else {\n ajax.onFail(error);\n }\n\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $button.button(`reset`);\n }, util.delayForm);\n\n // stop any further processing, as the Pod was not saved in the DB\n return false;\n })\n .then(data => {\n const $spotId = data.id;\n setTimeout(() => {\n const newUrl = util.returnSpotDetailUrl($spotId);\n // load the detail page;\n browserHistory.push(newUrl);\n }, util.delayForm);\n });\n }\n\n // cancel this action (do nothing and go somewhere else);\n onCancel() {\n const newUrl =\n this.state.id === 0\n ? util.returnSpotListUrl()\n : util.returnSpotDetailUrl(this.state.id);\n\n browserHistory.push(newUrl);\n }\n\n // get spot data to display;\n getSpot() {\n if (this.state.id === 0) {\n this.mounted &&\n this.setState({\n statusMessage: ``,\n description: ``,\n failed: false,\n loaded: true,\n name: ``,\n ready: false,\n sourceType: 1,\n sourceFile: util.spotFormDefaultSourceFile,\n sourceUrl: ``,\n element_id: ``,\n client_name: ``,\n protrack_id: ``,\n tape: ``,\n duration: ``\n });\n } else {\n util.getSpot(this.state.id).then(data => {\n const source = Number(data.source);\n\n setTimeout(() => {\n this.mounted &&\n this.setState({\n description: data.description,\n failed: data.aws_status === 3,\n loaded: true,\n name: data.name,\n ready: data.aws_status === 2,\n sourceType: source,\n sourceFile: data.source_file\n ? data.source_file\n : util.spotFormDefaultSourceFile,\n sourceUrl: data.source_url,\n statusMessage: data.aws_status_message,\n element_id: data.element_id,\n client_name: data.client_name,\n protrack_id: data.protrack_id,\n tape: data.tape,\n duration:\n typeof data.duration === \"number\"\n ? (data.duration / 1000).toFixed(2)\n : \"N/A\"\n });\n }, util.delayDetail);\n });\n }\n }\n}\n\nSpotForm.propTypes = {\n params: PropTypes.object\n};\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\nimport ReportsSearchDate from \"./reports-search-date\";\nimport DatePicker from \"react-datepicker\";\nimport moment from \"moment\";\n\nexport default function ReportsSearchForm(props) {\n // search field name;\n const [field, setField] = useState(``);\n // search string value;\n const [search, setSearch] = useState(``);\n const [start, setStart] = useState(moment(new Date()));\n const [end, setEnd] = useState(moment(new Date()));\n // PDF Invoice data\n const [showPdfForm, setShowPdfForm] = useState(false);\n const [invoiceNumber, setInvoiceNumber] = useState(\"\");\n const [invoiceDate, setInvoiceDate] = useState(moment(new Date()));\n const [invoiceDescription, setInvoiceDescription] = useState(\"\");\n const [customerName, setCustomerName] = useState(\"\");\n const [companyName, setCompanyName] = useState(\"\");\n const [companyAddress, setCompanyAddress] = useState(\"\");\n const [companyCity, setCompanyCity] = useState(\"\");\n const [costPerView, setCostPerView] = useState(\"\");\n const [podsOrderedByDate, setPodsOrderedByDate] = useState(true);\n const [podsOrderedByName, setPodsOrderedByName] = useState(false);\n const [columnsToIncludeAirtime, setColumnsToIncludeAirtime] = useState(true);\n const [columnsToIncludePodName, setColumnsToIncludePodName] = useState(true);\n const [columnsToIncludeShownAfter, setColumnsToIncludeShownAfter] = useState(\n true\n );\n const [\n columnsToIncludeShownBefore,\n setColumnsToIncludeShownBefore\n ] = useState(true);\n const [columnsToIncludeViewCount, setColumnsToIncludeViewCount] = useState(\n true\n );\n\n useEffect(() => {\n setField(props.field);\n setSearch(props.search);\n setStart(props.start ? moment(props.start) : moment());\n setEnd(props.end ? moment(props.end) : moment());\n }, [props]);\n\n // if the key pressed is `enter` then submit the search form;\n const onKeyPress = e => {\n if (e.key === `Enter`) {\n onSearchSubmit();\n }\n };\n\n // go to a new URL with the selected form values;\n const onSearchSubmit = () => {\n let url = `${util.returnReportsUrl()}?`;\n\n url = `${url}field=${field}`;\n url = `${url}&search=${encodeURIComponent(search.trim())}`;\n url = `${url}&start=${start.format(util.dateFormatComputer)}`;\n url = `${url}&end=${end.format(util.dateFormatComputer)}`;\n\n const params = {\n url: url,\n field: field,\n search: search,\n start: start,\n end: end\n };\n\n props.searchSubmit(params);\n };\n\n return (\n
    \n
    \n
    \n \n setField(e.target.value)}\n >\n \n {util.podElementFields.map(option => (\n \n ))}\n \n
    \n\n
    \n setSearch(e.target.value)}\n onKeyPress={e => onKeyPress(e)}\n />\n
    \n\n
    \n \n
    \n \n }\n fixedHeight\n selected={start}\n selectsStart\n startDate={start}\n endDate={end}\n onChange={value => {\n const newStart = value;\n let newEnd = end;\n\n if (newStart.isSame(end) === false) {\n if (newStart.isAfter(end)) {\n newEnd = value;\n }\n }\n setEnd(newEnd);\n setStart(newStart);\n }}\n />\n
    \n
    \n\n
    \n \n
    \n \n }\n fixedHeight\n selected={end}\n selectsEnd\n startDate={start}\n endDate={end}\n onChange={value => {\n let newStart = start;\n const newEnd = value;\n\n if (start.isSame(newEnd) === false) {\n if (start.isAfter(newEnd)) {\n newStart = value;\n }\n }\n setEnd(newEnd);\n setStart(newStart);\n }}\n />\n
    \n
    \n\n
    \n
    \n 1 && search.length < 1}\n onClick={() => onSearchSubmit()}\n >\n \n Generate Report\n \n
    \n
    \n
    \n\n
    \n
    \n

    \n 1 && search.length < 1\n ? `btn btn-default disabled`\n : `btn btn-default`\n }\n >\n \n Download CSV\n \n

    \n
    \n\n
    \n 1 && search.length < 1}\n onClick={() => setShowPdfForm(!showPdfForm)}\n >\n \n Create PDF Invoice\n \n
    \n
    \n\n
    \n
    Invoice Details
    \n
    \n
    \n
    \n \n setInvoiceNumber(e.target.value)}\n maxLength=\"50\"\n placeholder=\"\"\n />\n
    \n
    \n
    \n
    \n \n
    \n \n }\n fixedHeight\n selected={invoiceDate}\n onChange={value => setInvoiceDate(value)}\n />\n
    \n
    \n
    \n
    \n
    \n \n setInvoiceDescription(e.target.value)}\n maxLength=\"300\"\n placeholder=\"Pods, Campaigns\"\n />\n
    \n
    \n
    \n\n
    \n\n
    Sponsor Details
    \n
    \n
    \n
    \n \n setCustomerName(e.target.value)}\n maxLength=\"100\"\n placeholder=\"\"\n />\n
    \n
    \n
    \n
    \n \n setCompanyName(e.target.value)}\n maxLength=\"100\"\n placeholder=\"\"\n />\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n setCompanyAddress(e.target.value)}\n maxLength=\"150\"\n placeholder=\"Street\"\n />\n
    \n
    \n
    \n
    \n \n setCompanyCity(e.target.value)}\n maxLength=\"150\"\n placeholder=\"City, State, Zipcode\"\n />\n
    \n
    \n
    \n\n
    \n\n
    Additional Details
    \n
    \n
    \n
    \n
    \n
    \n \n setCostPerView(e.target.value)}\n maxLength=\"10\"\n placeholder=\"$\"\n />\n
    \n
    \n
    \n
    \n
    \n
    \n Pods Ordered By:\n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n Columns To Include:\n
    \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
    \n\n
    \n\n
    \n
    \n

    \n 1 && search.length < 1\n ? `btn btn-default disabled`\n : `btn btn-default`\n }\n >\n \n Download PDF Invoice\n \n

    \n
    \n
    \n
    \n
    \n );\n}\n\nReportsSearchForm.propTypes = {\n search: PropTypes.string,\n field: PropTypes.string,\n searchSubmit: PropTypes.func\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\n\nexport default function ReportsTable(props) {\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {renderReportRows(props.reports)}\n
    #DateTimePodShown AfterShown BeforeImpressions
    \n
    \n );\n\n // three options for display (loading, no results, results);\n function renderReportRows(reports = false) {\n if (reports.length === 0) {\n return (\n \n \n \n \n \n );\n } else if (reports === false) {\n return (\n \n \n 0\n \n {util.zeroReportsMessage}\n \n );\n } else {\n return reports.map((report, index) => {\n return index < util.reportsResultsPerPage ? (\n \n \n \n {util.returnLineNumber(\n props.currentPage,\n util.reportsResultsPerPage,\n index\n )}\n \n \n {moment(report.airtime).format(util.dateFormatHumanLong)}\n {moment(report.airtime).format(`HH:mm`)}\n \n \n {report.pod_name}\n \n \n \n {report.meta.showed_after ? report.meta.showed_after.title : null}\n \n \n {report.meta.showed_before\n ? report.meta.showed_before.title\n : null}\n \n {report.meta.total_count}\n \n ) : null;\n });\n }\n }\n}\n\nReportsTable.propTypes = {\n currentPage: PropTypes.number, // used to calc the # in the TABLE;\n reports: PropTypes.oneOfType([\n // pod data to display;\n PropTypes.array,\n PropTypes.bool\n ]),\n queryString: PropTypes.string // query string to add to sort links;\n};\n","import React, { useEffect, useState } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport util from \"../util/util\";\nimport Pagination from \"../pagination/pagination\";\nimport ReportsSearchForm from \"./reports-search-form\";\nimport ReportsTable from \"./reports-table\";\n\nexport default function ReportList(props) {\n // search string;\n const [search, setSearch] = useState(``);\n // search field;\n const [field, setField] = useState(``);\n // search start date;\n const [start, setStart] = useState(null);\n // search end date;\n const [end, setEnd] = useState(null);\n // reports to display (will be populated by an Ajax call);\n const [reports, setReports] = useState([]);\n // page of reports results;\n const [page, setPage] = useState(1);\n // number of pages\n const [pageCount, setPageCount] = useState(0);\n // maintain search state;\n const [queryString, setQueryString] = useState(``);\n\n useEffect(() => {\n // using separate variables for the user search option, in order to avoid an\n // infinite loop, as these also have to be sent in the call to the backend\n const searchString = _.get(props, `location.query.search`, ``);\n const searchField = _.get(props, `location.query.field`, ``);\n const startDate = _.get(props, `location.query.start`, null);\n const endDate = _.get(props, `location.query.end`, null);\n const pageNumber = Number(_.get(props, `params.page`, 1));\n\n // and also saving the current/updated user options to be used later\n setSearch(searchString);\n setField(searchField);\n setStart(startDate);\n setEnd(endDate);\n setPage(pageNumber);\n setQueryString(_.get(props, `location.search`, ``));\n\n // get the report data to display, from the backend;\n const getReports = () => {\n util\n .getReports({\n search: searchString,\n field: searchField,\n start: startDate,\n end: endDate,\n page: pageNumber\n })\n .then(data => {\n setTimeout(() => {\n // saving the data from the backend\n setPageCount(Math.ceil(data.count / util.reportsResultsPerPage));\n setReports(data.results.length ? data.results : false);\n }, util.delayList);\n });\n };\n\n getReports();\n }, [props]);\n\n const searchSubmit = params => {\n setField(params.field);\n setSearch(params.search);\n setStart(params.start);\n setEnd(params.end);\n\n browserHistory.push(params.url);\n };\n\n return (\n
    \n

    Reporting

    \n\n searchSubmit(params)}\n />\n\n {reports && reports.length ? (\n
    \n \n\n \n
    \n ) : null}\n
    \n );\n}\n\nReportList.propTypes = {\n location: PropTypes.object,\n params: PropTypes.object\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport InaccessibleLink from \"../shim/inaccessible-link\";\nimport util from \"../util/util\";\n\nexport default function RuleDetailExceptions(props) {\n const exceptions = props.hasOwnProperty(`exceptions`) ? props.exceptions : [];\n\n return (\n
    \n
    \n
    \n

    Exceptions

    \n
    \n
    \n\n
    \n\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {exceptions === false ? (\n \n \n \n \n ) : (\n exceptions.map((exception, index) => (\n \n \n \n \n \n \n \n \n ))\n )}\n \n
    #Time SlotStart DateEnd DateCreatedDelete Exception
    \n 0\n {util.zeroExceptionsMessage}
    \n {index + 1}\n {util.returnCleanTimeSlot(exception.timeslot)}\n {moment(exception.start_date).format(\n util.dateFormatHumanLong\n )}\n \n {moment(exception.end_date).format(\n util.dateFormatHumanLong\n )}\n \n {moment(exception.created).format(util.dateFormatHumanLong)}\n \n props.onClickDeleteException(exception)}\n >\n \n Delete\n \n
    \n
    \n
    \n );\n}\n\nRuleDetailExceptions.propTypes = {\n onClickDeleteException: PropTypes.func,\n exceptions: PropTypes.oneOfType([PropTypes.array, PropTypes.bool])\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\n\nexport default function RuleDetailExceptions(props) {\n return props.pod || props.campaign ? (\n
    \n

    Source {props.pod ? `Pod` : `Campaign`}

    \n

    \n {props.pod ? (\n \n {props.pod.name}\n \n ) : (\n \n {props.campaign.name}\n \n )}\n

    \n
    \n ) : null;\n}\n\nRuleDetailExceptions.propTypes = {\n pod: PropTypes.object,\n campaign: PropTypes.object\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\n\nexport default function RuleDetailSchedule(props) {\n const timeslots = props.timeslots || [];\n const shows = props.shows || [];\n\n return (\n
    \n

    Schedule

    \n\n
    \n
    \n
    \n

    Start Date

    \n

    {moment(props.startDate).format(util.dateFormatHumanLong)}

    \n
    \n\n
    \n

    End Date

    \n

    {moment(props.endDate).format(util.dateFormatHumanLong)}

    \n
    \n\n
    \n {props.timeslots && timeslots.length > 0 ? (\n
    \n

    \n Time Slot{timeslots.length > 1 ? `s` : ``}\n

    \n {util.returnCleanTimeSlots(timeslots).map((timeslot, index) => (\n

    {timeslot}

    \n ))}\n
    \n ) : (\n
    \n

    \n Show{shows.length > 1 ? `s` : ``}\n

    \n {util.returnShowNames(shows).map((show, index) => (\n

    {show}

    \n ))}\n
    \n )}\n
    \n\n
    \n

    Repeats

    \n {props.frequency === 1 && renderRepeatsMonthly(props.rule)}\n\n {props.frequency === 2 && renderRepeatsWeekly(props.rule)}\n\n {props.frequency === 3 && renderRepeatsDaily(props.frequency)}\n
    \n
    \n
    \n
    \n );\n}\n\nRuleDetailSchedule.propTypes = {\n endDate: PropTypes.string, // schedule end date;\n frequency: PropTypes.number, // rule repeats value;\n rule: PropTypes.object, // rule details;\n startDate: PropTypes.string, // schedule start date;\n timeslots: PropTypes.array // timeslots for this rule;\n};\n\n// transform array of day ids into text;\nfunction renderDays(values) {\n const labels = [];\n\n // daysArray contains the text values;\n util.days.forEach(day => {\n if (values.indexOf(day.value) > -1) {\n labels.push(day.label);\n }\n });\n\n // return array of text from an array of ids;\n return labels;\n}\n\n// render content for monthly schedule;\nfunction renderRepeatsMonthly(rule) {\n return (\n

    \n On the {returnOrdinal(rule.bymonthday)} day, every {rule.interval}{\" \"}\n {rule.interval > 1 ? `months` : `month`}.\n

    \n );\n}\n\n// render content for weekly schedule;\nfunction renderRepeatsWeekly(rule) {\n const weekLabel = rule.interval > 1 ? `weeks` : `week`;\n\n return (\n
    \n Every {rule.interval} {weekLabel} on:\n
      \n {renderDays(rule.byweekday).map(day => {\n return
    • {day}
    • ;\n })}\n
    \n
    \n );\n}\n\n// render content for daily schedule;\nfunction renderRepeatsDaily(frequency) {\n return (\n

    \n {util.returnRepeatValue(frequency)}\n

    \n );\n}\n\n// transform number into number-string (1st, 2nd, etc);\nfunction returnOrdinal(i) {\n const j = i % 10;\n const k = i % 100;\n\n if (j === 1 && k !== 11) {\n return i + `st`;\n }\n\n if (j === 2 && k !== 12) {\n return i + `nd`;\n }\n\n if (j === 3 && k !== 13) {\n return i + `rd`;\n }\n\n return i + `th`;\n}\n","import React, { Component } from \"react\";\nimport { browserHistory, Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport RuleDetailExceptions from \"./rule-detail-exceptions\";\nimport RuleDetailSource from \"./rule-detail-source\";\nimport RuleDetailSchedule from \"./rule-detail-schedule\";\nimport InaccessibleLink from \"../shim/inaccessible-link\";\nimport Tooltip from \"../tooltip/tooltip\";\nimport util from \"../util/util\";\n\nconst jQuery = window.jQuery;\n\nexport default class RuleDetail extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n id: Number(this.props.params.id), // id used to go get rule data;\n loaded: false // has Ajax data loaded yet;\n };\n }\n\n componentDidMount() {\n this.mounted = true;\n\n this.getRule();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n render() {\n if (this.state.loaded === false) {\n return ;\n } else {\n const isRuleLive = this.state.state === \"live\";\n const tooltipMessage =\n \"Only expired rules can be deleted.
    \" +\n \"Click the 'Expire Rule Now' button
    \" +\n \"to expire this rule.\";\n return (\n
    \n
    \n
    \n

    {this.state.name}

    \n
    \n
    \n

    \n \n \n Edit Rule\n \n \n {\n return \"\";\n }\n : () => this.deleteRule()\n }\n disabled={isRuleLive ? true : \"\"}\n >\n \n Delete Rule\n \n \n

    \n {isRuleLive && }\n
    \n
    \n
    \n
    \n
    \n

    Rule Name

    \n

    {this.state.name}

    \n
    \n
    \n

    Rule Created

    \n

    \n {moment(this.state.created).format(util.dateFormatHumanLong)}\n

    \n
    \n
    \n  \n
    \n
    \n

    Last Changed By

    \n

    \n Not available in the API (yet).\n

    \n
    \n
    \n

    Change Log

    \n

    \n \n View Change Log\n \n

    \n
    \n
    \n
    \n \n
    \n \n {this.state.state !== `expired` ? (\n

    \n Expiring Rule Now\"\n onClick={() => this.expireRule()}\n >\n \n Expire Rule Now\n \n

    \n ) : null}\n
    \n this.deleteException(id)}\n />\n
    \n );\n }\n }\n\n // get the rule data to display;\n getRule(callback = null) {\n util.getRule(this.state.id).then(data => {\n setTimeout(() => {\n this.mounted &&\n this.setState(\n {\n campaign: data.campaign,\n created: data.created,\n endDate: data.end_date,\n exceptions: data.exceptions.length ? data.exceptions : false,\n frequency: data.frequency,\n loaded: true,\n name: data.name,\n pod: data.pod,\n rule: {\n bymonthday: data.rule.bymonthday,\n byweekday: data.rule.byweekday,\n interval: data.rule.interval\n },\n sourceType: data.pod ? `pod` : `campaign`,\n startDate: data.start_date,\n state: data.state.toLowerCase(),\n timeslots: data.timeslots,\n shows: data.shows\n },\n () => {\n // if a callback exists (hide modal), fire it;\n if (callback) {\n callback();\n }\n }\n );\n }, util.delayDetail);\n });\n }\n\n // call the delete rule endpoint\n deleteRule() {\n const title = `Delete Rule`;\n const body = `

    Are you sure you want to delete the rule: ${this.state.name}?

    `;\n const buttonTextDefault = `Delete Rule`;\n const buttonTextLoading = `Deleting Rule`;\n const iconClass = `fa-trash-o`;\n const $modal = util.renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n );\n const $confirmButton = $modal.find(`.btn-danger`);\n\n // attach temporary event to remove the rule on confirmation of the modal;\n // remove any previous events first;\n // dont namespace the event because we want to remove everything;\n $confirmButton.one(`click`, () => {\n $confirmButton.button(`loading`);\n\n util\n .deleteRule(this.state.id)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // once done, go back to the list of rules\n $modal.modal(`hide`);\n browserHistory.push(`/rules/`);\n });\n });\n\n // attach the modal to the DOM, and then show it;\n jQuery(`body`).append($modal);\n $modal.modal(`show`);\n }\n\n // delete the exception associated with this rule;\n deleteException(exception) {\n const title = `Delete Exception to the Rule`;\n const body = `

    Are you sure you want to delete the ${moment(\n exception.start_date\n ).format(\n util.dateFormatHumanLong\n )} @ ${util.returnCleanTimeSlot(\n exception.timeslot\n )} exception?

    `;\n const buttonTextDefault = `Delete the Exception`;\n const buttonTextLoading = `Deleting the Exception`;\n const iconClass = `fa-trash-o`;\n const $modal = util.renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n );\n const $confirmButton = $modal.find(`.btn-danger`);\n\n // remove the exception on confirmation of the modal;\n $confirmButton.one(`click`, () => {\n $confirmButton.button(`loading`);\n\n util\n .deleteExceptionFromRule(exception.id)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // then load the rule again (to update state);\n this.getRule(() => {\n $modal.modal(`hide`);\n });\n\n // and update the conflict count;\n window.updateConflictCount();\n });\n });\n\n // attach the modal to the DOM, and then show it;\n jQuery(`body`).append($modal);\n $modal.modal(`show`);\n }\n\n // tell the back-end to change the end_date to yesterday;\n expireRule() {\n const title = `Expire Rule`;\n const body = `

    Are you sure you want to expire the rule?

    `;\n const buttonTextDefault = `Expire the Rule`;\n const buttonTextLoading = `Expiring the Rule`;\n const iconClass = `fa-calendar-times-o`;\n const $modal = util.renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n );\n const $confirmButton = $modal.find(`.btn-danger`);\n\n // remove the exception on confirmation of the modal;\n $confirmButton.one(`click`, () => {\n $confirmButton.button(`loading`);\n\n util\n .saveRuleAsExpired(this.state.id)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // then load the rule again (to update state);\n this.getRule(() => {\n $modal.modal(`hide`);\n });\n\n // and update the conflict count;\n window.updateConflictCount();\n });\n });\n\n // attach the modal to the DOM, and then show it;\n jQuery(`body`).append($modal);\n $modal.modal(`show`);\n }\n}\n\nRuleDetail.propTypes = {\n params: PropTypes.object\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport default function RuleFormButtons(props) {\n return (\n

    \n \n Cancel\n \n\n Saving Rule\"\n onClick={props.onSubmit}\n >\n \n Save Rule\n \n

    \n );\n}\n\nRuleFormButtons.propTypes = {\n onCancel: PropTypes.func,\n onSubmit: PropTypes.func\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport util from \"../util/util\";\n\nexport default function RuleFormTimeSlots(props) {\n return (\n
    \n
    \n
    \n
    \n \n \n {_.difference(util.timeSlots, props.value).map(\n (timeSlot, index) => {\n return (\n \n );\n }\n )}\n \n
    \n
    \n\n
    \n

    \n {\n const select = document.querySelector(`#timeslotsAvailable`);\n const options = select.selectedOptions;\n const optionsArray = [].slice\n .call(options)\n .map(option => option.value);\n\n select.value = null;\n\n props.onChange(props.value.concat(optionsArray).sort());\n }}\n >\n Add\n \n \n

    \n\n

    \n {\n const select = document.querySelector(`#timeslotsSelected`);\n const options = select.selectedOptions;\n const optionsArray = [].slice\n .call(options)\n .map(option => option.value);\n\n select.value = null;\n\n props.onChange(_.difference(props.value, optionsArray).sort());\n }}\n >\n \n Remove\n \n

    \n
    \n\n
    \n
    \n \n \n {props.value.map((timeSlot, index) => {\n return (\n \n );\n })}\n \n

    \n Time Slots is a required field.\n

    \n
    \n
    \n
    \n
    \n );\n}\n\nRuleFormTimeSlots.propTypes = {\n error: PropTypes.bool, // show the error or not (only one error possible);\n value: PropTypes.array, // selected time slots (all - selected = available);\n onChange: PropTypes.func // run when changing the selected time slots;\n};\n","import React, {useCallback, useEffect, useState} from 'react';\nimport { browserHistory } from 'react-router';\nimport PropTypes from \"prop-types\";\nimport Select from 'react-select';\nimport LoadingIndicatorHeader from '../loading-indicator/loading-indicator-header';\nimport RuleFormButtons from './rule-form-buttons';\nimport RuleFormTimeSlots from './rule-form-timeslots';\nimport DatePicker from 'react-datepicker';\nimport moment from 'moment';\nimport ruleFormValidation from './rule-form-validation';\nimport Tooltip from \"../tooltip/tooltip\";\nimport ajax from '../util/util-ajax';\nimport util from '../util/util';\nimport _ from \"lodash\";\nimport { v4 } from 'uuid';\n\nconst jQuery = window.jQuery;\n\nexport default function RuleForm (props) {\n const [id, setId] = useState(0); // id of the rule we are editing (0 means new rule to create)\n const [name, setName] = useState(``); // the Rule name\n const [sourceType, setSourceType] = useState(`pod`); // the Rule Source type\n const [pod, setPod] = useState(null); // the corresponding Pod, if the Rule is made from a Pod\n const [campaign, setCampaign] = useState(null); // the corresponding Campaign, if the Rule is made from a Campaign\n const [frequency, setFrequency] = useState(3); // the Rule repeats: Daily(3), Weekly(2) or Monthly(1)\n const [startDate, setStartDate] = useState(moment(new Date())); // Rule start date\n const [endDate, setEndDate] = useState(moment(new Date())); // Rule end date\n const [ruleInterval, setRuleInterval] = useState(1); // Rule interval\n const [ruleByweekday, setRuleByweekday] = useState([]); // Rule week interval\n const [ruleBymonthday, setRuleBymonthday] = useState(1); // Rule month interval\n const [airtimeType, setAirtimeType] = useState(`timeSlots`); // The type of Ad airtime, time based or show based\n const [timeslots, setTimeslots] = useState([]); // the selected Timeslots (every 30 mins, from 00:28 up to 23:58)\n const [shows, setShows] = useState([]); // array used to control the SELECT fields for Shows\n const [loaded, setLoaded] = useState(false); // indicator for when the form has loaded\n const [errors, setErrors] = useState({}); // prop names determine which errors to show\n const [podOptions, setPodOptions] = useState([]); // the Options for the Pod SELECT\n const [campaignOptions, setCampaignOptions] = useState([]); // the Options for the Campaign SELECT\n const [showOptions, setShowOptions] = useState([]); // the Options for the Show SELECT\n const [searchingForPods, setSearchingForPods] = useState(false); // used to control the message displayed on the SELECT while searching for Pods\n const [searchingForCampaigns, setSearchingForCampaigns] = useState(false); // used to control the message displayed on the SELECT while searching for Campaigns\n const [searchingForShows, setSearchingForShows] = useState(false); // used to control the message displayed on the SELECT while searching for Shows\n const [positionBeforeShow, setPositionBeforeShow] = useState(false); //if the Ad is set to play before the selected Show(s)\n const [positionAfterShow, setPositionAfterShow] = useState(false); //if the Ad is set to play after the selected Show(s)\n\n\n useEffect(() => {\n // id of the rule we are editing (0 means new rule to create)\n const id = props.params ? Number(props.params.id) : 0;\n\n // get the rule data to display in the form;\n const getRule = () => {\n // on a new Rule, no need to set up all the values as the default ones are used\n if (id === 0) {\n // if a pod was pre-selected, go get the data and set it as the value of the SELECT\n if (props.params && props.params.podId) {\n util.getPod(props.params.podId)\n .then((data) => {\n setPod({\n label: data.name,\n value: data.id,\n id: data.id.toString()\n });\n setLoaded(true);\n });\n // if a campaign was pre-selected, go get the data amd set it as the value of the SELECT\n } else if (props.params && props.params.campaignId) {\n util.getCampaign(props.params.campaignId)\n .then((data) => {\n setCampaign({\n label: data.name,\n value: data.id,\n id: data.id.toString()\n });\n setSourceType(`campaign`);\n setLoaded(true);\n });\n // otherwise we're done, use the empty value and show the form\n } else {\n setPod(getDefaultPodValue());\n setShows(getDefaultShowsValue());\n setLoaded(true);\n }\n\n // on an existing Rule\n } else {\n util.getRule(id)\n .then((data) => {\n setTimeout(() => {\n setId(id);\n setName(data.name);\n if (data.pod) {\n setPod({\n label: data.pod.name,\n value: data.pod.id,\n id: data.pod.id.toString()\n });\n } else {\n setCampaign({\n label: data.campaign.name,\n value: data.campaign.id,\n id: data.campaign.id.toString()\n });\n setSourceType(`campaign`);\n }\n setFrequency(data.frequency);\n setStartDate(moment(data.start_date));\n setEndDate(moment(data.end_date));\n data.rule.interval && setRuleInterval(data.rule.interval); // rule values may not be defined even for existing rules\n data.rule.byweekday && setRuleByweekday(data.rule.byweekday); // same as above\n data.rule.bymonthday && setRuleBymonthday(data.rule.bymonthday); // same as above\n if (data.timeslots.length > 0) {\n setTimeslots(util.returnCleanTimeSlots(data.timeslots));\n } else {\n setShows(data.shows);\n setAirtimeType(`showBased`);\n setPositionBeforeShow(data.position_before_show);\n setPositionAfterShow(data.position_after_show);\n }\n setLoaded(true);\n });\n }, util.delayDetail);\n }\n }\n\n getRule();\n setLoaded(true);\n }, [props.params]);\n\n // default value of the Pod SELECT\n const getDefaultPodValue = () => {\n return {\n label: `Select a pod`,\n value: 0,\n id: v4()\n };\n }\n\n // default value of the Campaign SELECT\n const getDefaultCampaignValue = () => {\n return {\n label: `Select a campaign`,\n value: 0,\n id: v4()\n };\n }\n\n // default value of the SELECT;\n const getDefaultShowsValue = () => {\n return [{\n label: `Select a show`,\n value: 0,\n id: v4()\n }]\n };\n\n // add another form field to the page so the user can select another show;\n const addShow = () => {\n const showsArray = [...shows];\n showsArray.push(getDefaultShowsValue()[0]);\n setShows(showsArray);\n }\n\n const getShowsInUse = () => {\n const showIds = [];\n\n shows && shows.forEach((show) => {\n // selecting only the not empty ('Select a show') shows\n show.value > 0 && showIds.push(show.value);\n });\n\n return showIds;\n }\n\n const getSelectSearchStatus = (searchTerm, sourceType) => {\n if (searchTerm.inputValue.length === 0) {\n return `Please type a few characters to kick off remote search.`\n }\n\n if (sourceType === \"pod\") {\n if (searchingForPods === true) {\n return `Searching...`\n }\n if (podOptions.length === 0) {\n return `No results found.`\n }\n } else if (sourceType === \"campaign\") {\n if (searchingForCampaigns === true) {\n return `Searching...`\n }\n if (campaignOptions.length === 0) {\n return `No results found.`\n }\n } else if (sourceType === \"show\") {\n if (searchingForShows === true) {\n return `Searching...`\n }\n if (showOptions.length === 0) {\n return `No results found.`\n }\n }\n\n return `Something went wrong.`\n }\n\n const getPodSearchResults = (searchTerm) => {\n if (searchTerm.length <= 0) {\n setSearchingForPods(false);\n setPodOptions([]);\n } else {\n setSearchingForPods(true);\n util\n .getPods({\n sort: `name`,\n page: 1,\n search: searchTerm,\n aws_status: 2,\n })\n .then((data) => {\n setSearchingForPods(false);\n setPodOptions(util.returnSimpleSelectOptions(data.results));\n });\n }\n }\n\n const getCampaignSearchResults = (searchTerm) => {\n if (searchTerm.length <= 0) {\n setSearchingForCampaigns(false);\n setCampaignOptions([]);\n } else {\n setSearchingForCampaigns(true);\n util.getSearchResults(searchTerm, `campaigns`)\n .then((data) => {\n setSearchingForCampaigns(false);\n setCampaignOptions(util.returnSimpleSelectOptions(data.results));\n });\n }\n }\n\n const getShowSearchResults = (searchTerm) => {\n if (searchTerm.length <= 0) {\n setSearchingForShows(false);\n setShowOptions([]);\n } else {\n setSearchingForShows(true);\n util\n .getShows({\n searchTerm: searchTerm,\n excludeShows: getShowsInUse().join(\",\"),\n })\n .then((data) => {\n setSearchingForShows(false);\n setShowOptions(util.returnSimpleSelectOptionsForShows(data.results));\n });\n }\n }\n\n const getPodSearchResultsDelayed = useCallback(\n _.debounce(getPodSearchResults, 250),\n []\n )\n\n const getCampaignSearchResultsDelayed = useCallback(\n _.debounce(getCampaignSearchResults, 250),\n []\n )\n\n const getShowSearchResultsDelayed = useCallback(\n _.debounce(getShowSearchResults, 250),\n [shows]\n )\n\n const handleSelectOnValueChange = (selectedValue, action, sourceType, index) => {\n const showsArray = [...shows];\n if (action.action === \"select-option\") {\n if (sourceType === \"pod\") {\n setPod(selectedValue);\n } else if (sourceType === \"campaign\") {\n setCampaign(selectedValue);\n } else if (sourceType === \"show\") {\n showsArray[index] = {\n \"label\": selectedValue.label,\n \"value\": selectedValue.value,\n \"id\": selectedValue.value.toString()\n };\n setShows(showsArray);\n }\n } else if (action.action === \"clear\") {\n if (sourceType === \"pod\") {\n setPod(getDefaultPodValue());\n } else if (sourceType === \"campaign\") {\n setCampaign(getDefaultCampaignValue());\n } else if (sourceType === \"show\") {\n if (showsArray.length === 1) {\n showsArray[0] = getDefaultShowsValue()[0];\n } else {\n showsArray.splice(index, 1);\n }\n setShows(showsArray);\n }\n }\n }\n\n // update the ruleByWeekday value;\n const changeRuleByweekday = (e) => {\n // current array of options\n // !!! important - as you cannot update the hook directly\n // and doing 'const options = ruleByweekday;' would only copy the reference\n // so you need a new array (spread, map,...) to copy the values from ruleByweekday\n // also, this is a shallow copy (1st level, not nested), which suffice in our case\n // the other solution would be to provide a function to setRuleByweekday\n const options = [...ruleByweekday];\n const value = Number(e.target.value);\n\n // check if the check box is checked or unchecked\n if (e.target.checked) {\n // add the numerical value of the checkbox to options array\n options.push(value);\n } else {\n // or remove the value from the unchecked checkbox from the array\n options.splice(options.indexOf(value), 1);\n }\n\n // update the state with the new array of options\n setRuleByweekday(options);\n }\n\n // save the data;\n const onSubmit = () => {\n // build the object to send to the server;\n // can only submit a campaign or a pod, not both;\n const report = {\n id: id,\n name: name.trim(),\n sourceType: sourceType,\n pod: null,\n campaign: null,\n frequency: frequency,\n startDateValidate: startDate,\n endDateValidate: endDate,\n airtimeType: airtimeType,\n timeslots: [],\n shows: [],\n position_before_show: positionBeforeShow,\n position_after_show: positionAfterShow,\n };\n\n // do it this way so eslint doesn't yell at us for using underscores in var names;\n report[`end_date`] = report.endDateValidate.format(util.dateFormatComputer);\n report[`start_date`] = report.startDateValidate.format(util.dateFormatComputer);\n\n // depending on what the sourceType value is, record the appropriate SELECT value;\n if (report.sourceType === `campaign`) {\n if (campaign && campaign.value) {\n report.campaign = campaign.value;\n }\n } else {\n if (pod && pod.value) {\n report.pod = pod.value;\n }\n }\n\n // same for airtimeType\n if (report.airtimeType === `timeSlots`) {\n if (timeslots && timeslots.length > 0) {\n report.timeslots = timeslots;\n }\n } else {\n // insert only valid shows into the obj to send;\n shows && shows.forEach((show) => {\n show.value > 0 && report.shows.push(show);\n });\n }\n\n // determine the reoccurrence rules;\n // not all values can be sent with each request;\n switch (report.frequency.toString()) {\n case `3`:\n report.rule = {};\n break;\n case `2`:\n report.rule = {\n interval: ruleInterval,\n byweekday: ruleByweekday\n };\n break;\n case `1`:\n report.rule = {\n interval: ruleInterval,\n bymonthday: ruleBymonthday\n };\n break;\n default:\n break;\n }\n\n // see if there are any errors before proceeding;\n const validationResult = ruleFormValidation(report);\n\n // danger will robinson, we have errors;\n if (validationResult.hasErrors) {\n setErrors(validationResult.errors);\n util.putFoucsOnError();\n\n // stop any further processing;\n return false;\n\n // good to go, clear any existing errors;\n } else {\n setErrors({})\n }\n\n // put the button into a processing state;\n const $button = jQuery(`.btn-primary`).button(`loading`);\n\n // save (POST or PUT) the form data;\n util.saveRule(id, report)\n .fail((error) => {\n const serializerNameExistsError = \"A Rule with this name already exists.\";\n const api_error = _.get(error, \"responseJSON.Validation_Error[0]\")\n\n // if the name already exists\n if (serializerNameExistsError === api_error) {\n setErrors(_.merge({}, errors, { name: api_error}));\n util.putFoucsOnError();\n // if there is a different backend (4xx, 5xx) error\n } else {\n ajax.onFail(error);\n }\n\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $button.button(`reset`);\n }, util.delayForm);\n\n // stop any further processing, as the Rule was not saved in the DB\n return false;\n })\n .then((data) => {\n // after the rule has been saved, check to see if we have any conflicts;\n util.getConflicts()\n .then((conflictData) => {\n const newUrl = (conflictData.count > 0) ? util.returnConflictFormUrl() : util.returnRuleDetailUrl(data.id);\n\n // wait a little bit (so the user can track what’s going on);\n setTimeout(() => {\n // load the next page (rule detail or conflict form);\n browserHistory.push(newUrl);\n }, util.delayForm);\n });\n });\n }\n\n // cancel this action (do nothing and go somewhere else);\n const onCancel = () => {\n const newUrl = (id === 0) ? util.returnRuleListUrl() : util.returnRuleDetailUrl(id);\n\n browserHistory.push(newUrl);\n }\n\n if (loaded === false) {\n return (\n \n );\n } else {\n const tooltipMessagePods = \"Only pods in a 'Ready' status
    can be scheduled.\";\n const tooltipMessageShows = \"Show-based scheduling
    can only apply to the next 60 days.\";\n\n return (\n
    \n
    \n
    \n

    { id === 0 ? `New Rule` : `Edit Rule` }

    \n
    \n
    \n onCancel() }\n onSubmit={ () => onSubmit() } />\n
    \n
    \n\n
    \n\n
    \n \n setName(e.target.value) }\n maxLength=\"100\" />\n

    \n { errors.name }\n

    \n
    \n\n
    \n\n

    Source

    \n\n
    \n
    \n
    \n \n
    \n \n\n \n
    \n
    \n
    \n
    \n
    \n
    \n \n \n {return dbOption;}\n }\n noOptionsMessage={\n (searchTerm) => {\n return (\n
    \n {getSelectSearchStatus(searchTerm, \"pod\")}\n
    \n );\n }\n }\n onInputChange={\n (searchTerm) => {\n // updating the search status on the UI\n setSearchingForPods(true);\n // making the backend call, with delay\n getPodSearchResultsDelayed(searchTerm);\n }\n }\n onChange={\n (value, action) => {\n handleSelectOnValueChange(value, action, \"pod\");\n }\n }\n />\n

    Source Pod is a required field.

    \n
    \n
    \n
    \n
    \n \n {\n return (\n
    \n {getSelectSearchStatus(searchTerm, \"campaign\")}\n
    \n );\n }\n }\n onInputChange={\n (searchTerm) => {\n // updating the search status on the UI\n setSearchingForCampaigns(true);\n // making the backend call, with delay\n getCampaignSearchResultsDelayed(searchTerm);\n }\n }\n onChange={\n (value, action) => {\n handleSelectOnValueChange(value, action, \"campaign\");\n }\n }\n />\n

    Source Campaign is a required field.

    \n
    \n
    \n
    \n
    \n\n
    \n\n

    Schedule

    \n\n
    \n
    \n
    \n
    \n \n
    \n \n\n \n\n \n
    \n
    \n\n {\n frequency === 2 &&\n
    \n
    \n\n
    \n
    \n Repeat Every\n setRuleInterval(Number(e.target.value)) } />\n week(s)\n
    \n
    \n\n \n
    \n
    \n {\n util.days.map((day, index) => {\n if (index < 4) {\n return (\n
    \n
    \n \n
    \n
    \n );\n } else {\n return null;\n }\n })\n }\n
    \n\n
    \n {\n util.days.map((day, index) => {\n if (index > 3) {\n return (\n
    \n
    \n \n
    \n
    \n );\n } else {\n return null;\n }\n })\n }\n
    \n
    \n
    \n }\n\n {\n frequency === 1 &&\n
    \n
    \n\n
    \n
    \n Repeat Every\n setRuleInterval(Number(e.target.value)) } />\n month(s)\n
    \n
    \n\n
    \n
    \n On Day\n setRuleBymonthday(Number(e.target.value)) } />\n
    \n
    \n
    \n }\n
    \n
    \n\n
    \n
    \n
    \n
    \n \n
    \n document.querySelector(`#start`).focus() }>\n \n
    \n
    \n setStartDate(value) } />\n
    \n
    \n

    Start Date must be a valid date, and less than End Date.

    \n
    \n
    \n\n
    \n
    \n \n
    \n document.querySelector(`#end`).focus() }>\n \n
    \n
    \n setEndDate(value) } />\n
    \n
    \n

    End Date must be a valid date, and greater than Start Date.

    \n

    \n { errors.showBasedEndDate }\n

    \n
    \n
    \n
    \n\n
    \n\n

    Time Slots

    \n\n
    \n
    \n
    \n \n
    \n \n \n
    \n
    \n
    \n
    \n
    \n
    \n setTimeslots(timeslots) } />\n
    \n
    \n
    \n \n \n
    \n {\n shows.map((show, index) => (\n
    \n {\n return (\n
    \n {getSelectSearchStatus(searchTerm, \"show\")}\n
    \n );\n }\n }\n onInputChange={\n (searchTerm) => {\n // updating the search status on the UI\n setSearchingForShows(true);\n // making the backend call, with delay\n getShowSearchResultsDelayed(searchTerm);\n }\n }\n onChange={\n (value, action) => {\n handleSelectOnValueChange(value, action, \"show\", index);\n }\n }\n />\n
    \n ))\n }\n
    \n

    Show is a required field.

    \n addShow() }>\n \n Add Another Show\n \n
    \n
    \n
     
    \n \n
    \n \n \n
    \n

    Select position is a required field.

    \n
    \n
    \n
    \n \n \n\n
    \n\n onCancel() }\n onSubmit={ () => onSubmit() } />\n \n );\n }\n}\n\nRuleForm.propTypes = {\n params: PropTypes.object\n};\n","import moment from \"moment\";\n\nexport default function ruleFormValidation(report) {\n // returned, defines if we have errors or not;\n let hasErrors = false;\n\n // returned, used to setState to inform the users of the errors;\n const errors = {};\n\n // rule name is required;\n if (report.name === ``) {\n errors.name = \"Rule Name is a required field.\";\n hasErrors = true;\n }\n\n // if pod, make sure a pod is required;\n if (report.sourceType === `pod`) {\n if (report.pod === null) {\n errors.pod = true;\n hasErrors = true;\n }\n\n // if campaign, make sure a campaign is required;\n } else {\n if (report.campaign === null) {\n errors.campaign = true;\n hasErrors = true;\n }\n }\n\n // show and/or timeslots are required:\n if (report.airtimeType === `timeSlots`) {\n if (report.timeslots && report.timeslots.length === 0) {\n errors.timeslots = true;\n hasErrors = true;\n }\n } else {\n if (report.shows && report.shows.length === 0) {\n errors.shows = true;\n hasErrors = true;\n }\n }\n\n // for Show-based, at least one position is also required\n if (report.airtimeType === `showBased`) {\n if (\n report.position_before_show === false &&\n report.position_after_show === false\n ) {\n errors.position = true;\n hasErrors = true;\n }\n }\n\n // if the dates are defined (always should be...);\n if (report.startDateValidate && report.endDateValidate) {\n // and they dates are the same, they're good to go;\n if (report.startDateValidate.isSame(report.endDateValidate) === false) {\n // if the start date is after the end date we have a problem;\n if (report.startDateValidate.isAfter(report.endDateValidate)) {\n errors.startDate = true;\n errors.endDate = true;\n hasErrors = true;\n }\n }\n }\n\n // for Show-based, the end date cannot be longer than 2 months\n if (report.airtimeType === `showBased`) {\n const afterTwoMonths = moment().add(60, `days`);\n if (report.endDateValidate.isAfter(afterTwoMonths)) {\n errors.showBasedEndDate =\n \"For Show-based Rules the last possible day is: \" +\n afterTwoMonths.format(`MM/DD/YYYY`);\n hasErrors = true;\n }\n }\n\n return {\n errors: errors, // return for setState to tell the user what went wrong;\n hasErrors: hasErrors // return true/false so the submit works/doesn't;\n };\n}\n","import React, { Component } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\n\n// generate arry of rule statuses;\nconst ruleStatuses = () => {\n const statuses = [];\n\n [`All`, `Live`, `Expired`, `Future`].forEach(key => {\n statuses.push({\n label: key,\n value: key.toLowerCase()\n });\n });\n\n return statuses;\n};\n\n// default values in case nothing is supplied in the URL;\nconst defaultStatusValue = ruleStatuses()[1].value;\nconst defaultTimeSlotValue = `All`;\n\n// use the same logic to set state (on load, on prop change);\nconst returnSearchState = (props = {}) => ({\n search: props.search || ``, // search string value;\n status: props.status || defaultStatusValue, // status value;\n timeslot: props.timeslot || defaultTimeSlotValue // timeslot value;\n});\n\nexport default class RuleListSearchForm extends Component {\n constructor(props) {\n super(props);\n\n this.state = returnSearchState(props);\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState(returnSearchState(nextProps));\n }\n\n render() {\n return (\n
    \n
    \n \n this.setState({ search: e.target.value.trim() })}\n onKeyPress={e => this.onKeyPress(e)}\n />\n
    \n\n
    \n \n this.setState({ status: e.target.value })}\n >\n {ruleStatuses().map(obj => (\n \n ))}\n \n
    \n\n
    \n \n {\n this.setState({\n timeslot: [].slice\n .call(e.target.selectedOptions)\n .map(option => option.value)\n });\n }}\n >\n \n {util.timeSlots.map((timeSlot, index) => {\n return (\n \n );\n })}\n \n
    \n\n
    \n this.onSearchSubmit()}\n >\n \n Apply Filters\n \n\n \n
    \n
    \n );\n }\n\n // if the key pressed is `enter` then submit the search form;\n onKeyPress(e) {\n if (e.key === `Enter`) {\n this.onSearchSubmit();\n }\n }\n\n // reset search form values to their default state;\n onSearchReset() {\n this.setState(returnSearchState());\n }\n\n // go to a new URL with the selected form values;\n onSearchSubmit() {\n let url = `${util.returnRuleListUrl()}?sort=${this.props.sort}`;\n\n if (this.state.search.length) {\n url = `${url}&search=${this.state.search}`;\n }\n\n if (this.state.status) {\n url = `${url}&status=${this.state.status}`;\n }\n\n if (this.state.timeslot) {\n url = `${url}×lot=${this.state.timeslot}`;\n }\n\n browserHistory.push(url);\n }\n}\n\nRuleListSearchForm.propTypes = {\n search: PropTypes.string,\n sort: PropTypes.string, // not editable from this component, but needs to be passed in the form;\n status: PropTypes.string,\n timeslot: PropTypes.string\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\n\nconst jQuery = window.jQuery;\n\nexport default function RuleListTable(props) {\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {renderRuleRows(props.rules)}\n
    #{renderSortLink(`name`, `Rule`, props.sort)}Pod / Campaign{renderSortLink(`-start_date`, `Start Date`)}{renderSortLink(`-end_date`, `End Date`)}Time Slots / ShowsRepeats
    \n
    \n );\n\n // three options for display (loading, no results, results);\n function renderRuleRows(rules = false) {\n if (rules.length === 0) {\n return (\n \n \n \n \n \n );\n } else if (rules === false) {\n return (\n \n \n 0\n \n {util.zeroRulesMessage}\n \n );\n } else {\n return rules.map((rule, index) => {\n const cleanedTimeSlots = util.returnCleanTimeSlots(rule.timeslots);\n\n return index < util.ruleResultsPerPage ? (\n \n \n \n {util.returnLineNumber(\n props.currentPage,\n util.ruleResultsPerPage,\n index\n )}\n \n \n \n {rule.name}\n \n \n {rule.pod ? (\n \n {rule.pod.name}\n \n ) : null}\n {rule.campaign ? (\n \n {rule.campaign.name}\n \n ) : null}\n \n {moment(rule.start_date).format(util.dateFormatHumanLong)}\n {moment(rule.end_date).format(util.dateFormatHumanLong)}\n \n {rule.timeslots && rule.timeslots.length > 0 ? (\n \n {cleanedTimeSlots.join(`, `)}\n \n ) : null}\n {rule.shows && rule.shows.length > 0\n ? util.renderShowsNames(rule.shows)\n : null}\n \n {util.returnRepeatValue(rule.frequency)}\n \n ) : null;\n });\n }\n }\n\n // display table header sort links;\n function renderSortLink(sortValue, sortDisplay) {\n const className = util.returnSortClass(sortValue, props.sort);\n const newSortValue = util.returnSortValue(sortValue, props.sort);\n const queryStringObject = props.queryString\n ? jQuery.deparam(props.queryString.replace(`?`, ``))\n : {};\n\n // add the new sort value to the querystring object;\n queryStringObject.sort = newSortValue;\n\n return (\n \n {sortDisplay}\n \n \n \n );\n }\n}\n\nRuleListTable.propTypes = {\n currentPage: PropTypes.number, // used to calc the # in the TABLE;\n rules: PropTypes.oneOfType([\n // rule data to display;\n PropTypes.array,\n PropTypes.bool\n ]),\n queryString: PropTypes.string, // query string to add to sort links;\n sort: PropTypes.string // currently sorting rules by;\n};\n","import React, { Component } from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport util from \"../util/util\";\nimport Pagination from \"../pagination/pagination\";\nimport RuleListSearchForm from \"./rule-list-search-form\";\nimport RuleListTable from \"./rule-list-table\";\n\n// use the same logic to set state (on load, on prop change);\nconst returnInitialState = (props = {}) => ({\n page: Number(_.get(props, `params.page`, 1)), // page of rule results;\n rules: [], // rules to display (will be populated by an Ajax call);\n queryString: _.get(props, `location.search`, null), // pass to sort and pagination links to maintain search state;\n search: _.get(props, `location.query.search`, null), // search string;\n status: _.get(props, `location.query.status`, `live`), // search status;\n sort: _.get(props, `location.query.sort`, `-start_date`), // list sort value;\n timeslot: _.get(props, `location.query.timeslot`, null) // search timeslot;\n});\n\nexport default class RuleList extends Component {\n constructor(props) {\n super(props);\n\n this.state = returnInitialState(props);\n }\n\n componentDidMount() {\n this.mounted = true;\n\n this.getRules();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState(returnInitialState(nextProps), this.getRules);\n }\n\n render() {\n return (\n
    \n
    \n
    \n

    Rules

    \n
    \n
    \n

    \n \n \n Create New Rule\n \n

    \n
    \n
    \n\n \n\n \n\n \n
    \n );\n }\n\n // get the rule data to display (one page at a time);\n getRules() {\n util\n .getRules({\n page: this.state.page,\n search: this.state.search,\n sort: this.state.sort,\n status: this.state.status,\n timeslot: this.state.timeslot\n })\n .then(data => {\n setTimeout(() => {\n this.mounted &&\n this.setState({\n pageCount: Math.ceil(data.count / util.ruleResultsPerPage),\n rules: data.results.length ? data.results : false\n });\n }, util.delayList);\n });\n }\n}\n\nRuleList.propTypes = {\n location: PropTypes.object,\n params: PropTypes.object\n};\n","import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\n\n// this is used within the Date Picker component;\n// as the trigger to open the Date Picker;\n\n// even though this doesn't make use of state, it shouldn't be a stateless component;\n// if it's stateless, a React error will be thrown in the console about adding a ref to a stateless component;\n// the ref is added by the Date Picker;\n\nexport default class ScheduleByDayTitle extends Component {\n render() {\n return (\n \n {this.props.dayDisplay}\n \n \n );\n }\n}\n\nScheduleByDayTitle.propTypes = {\n onClick: PropTypes.func, // event to fire onClick (open the Date Picker);\n dayDisplay: PropTypes.string // value to show (date based on the Date Picker value);\n};\n","import React from \"react\";\nimport { browserHistory } from \"react-router\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport DatePicker from \"react-datepicker\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport ScheduleByDayTitle from \"./schedule-by-day-title\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\n\nexport default function ScheduleByDayButtons(props) {\n const yesterday = returnDay(props.day, -1, util.dateFormatComputer);\n const tomorrow = returnDay(props.day, 1, util.dateFormatComputer);\n\n return (\n
    \n
    \n {props.loaded === false ? (\n \n ) : (\n
    \n \n }\n selected={moment(props.day)}\n onChange={value => {\n const newDay = value.format(util.dateFormatComputer);\n const newUrl = util.returnScheduleDayUrl(newDay);\n\n browserHistory.push(newUrl);\n }}\n />\n
    \n )}\n
    \n\n
    \n

    \n \n \n {moment(yesterday).format(util.dateFormatRangeShort)}\n \n

    \n
    \n\n
    \n

    \n \n {moment(tomorrow).format(util.dateFormatRangeShort)}\n \n \n

    \n
    \n
    \n );\n\n // convert one date (string) into another date (string);\n function returnDay(day, dayOffset, dateFormat) {\n const date = moment(day);\n\n return date.add(dayOffset, `days`).format(dateFormat);\n }\n}\n\nScheduleByDayButtons.propTypes = {\n day: PropTypes.string, // used to generate title and links;\n loaded: PropTypes.bool // has the schedule data loaded or not;\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport TimeslotPopover from \"../timeslot-popover/timeslot-popover\";\nimport util from \"../util/util\";\n\nexport default function ScheduleByDaySchedule(props) {\n return (\n
    \n \n\n
    \n
    \n {renderScheduleByIndex(0, 32)}\n
    \n
    \n {renderScheduleByIndex(32, 64)}\n
    \n
    \n {renderScheduleByIndex(64, 96)}\n
    \n
    \n
    \n );\n\n // render a TABLE of some of the schedule data;\n function renderScheduleByIndex(startIndex, endIndex) {\n const schedule = props.schedule.slice(startIndex, endIndex);\n\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n {schedule.map((row, index) => (\n \n {row.timeslot.substr(-1) !== `0` ? (\n \n ) : (\n \n )}\n {typeof row.show !== `string` ? (\n \n ) : (\n \n )}\n \n ))}\n \n
    Time SlotPod
    \n \n {row.timeslot}\n \n {row.timeslot}\n {row.show && row.show.pod ? (\n \n ) : null}\n {row.show}
    \n
    \n );\n }\n}\n\nScheduleByDaySchedule.propTypes = {\n day: PropTypes.string, // used to generate links to a timeslot view;\n schedule: PropTypes.array // daily schedule data to display (one array to be broken into three tabs);\n};\n","import React, { Component } from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport ScheduleByDayButtons from \"./schedule-by-day-buttons\";\nimport ScheduleByDaySchedule from \"./schedule-by-day-schedule\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\n\nexport default class ScheduleByDay extends Component {\n constructor(props) {\n super(props);\n\n this.state = this.returnInitialState(props);\n }\n\n componentDidMount() {\n this.mounted = true;\n\n this.getScheduleByDay();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState(this.returnInitialState(nextProps), this.getScheduleByDay);\n }\n\n render() {\n return (\n
    \n
    \n
    \n

    \n \n \n Return to weekly schedule\n \n

    \n
    \n
    \n

    Daily Schedule

    \n
    \n
    \n\n
    \n\n \n\n
    \n\n \n
    \n );\n }\n\n // use the same logic to set state (on load, on prop change);\n returnInitialState(props = {}) {\n return {\n day: this.returnFormattedDay(\n (props.params && props.params.day) || new Date()\n ), // the day everything is based on;\n loaded: false, // indicates that the content is ready for display (even when schedule is empty);\n schedule: this.returnEmptySchedule() // main content to display;\n };\n }\n\n // convert the date into a readable format;\n returnFormattedDay(date) {\n return moment(date).format(util.dateFormatComputer);\n }\n\n // returns an empty schedule we can now use;\n // insert Ajax content into it, or display as-is (on prop change);\n returnEmptySchedule() {\n const schedule = [];\n\n // loop through the 24 hours of the day;\n for (let hour = 0; hour <= 23; hour = hour + 1) {\n const hourFormatted = hour < 10 ? `0${hour}` : hour;\n\n // loop through the hour and half hour slot;\n // the 28 and 58 are FPO for the associated pods;\n [`00`, `28`, `30`, `58`].forEach(time => {\n // create the `table row` for each time slot;\n schedule.push({\n timeslot: `${hourFormatted}:${time}`,\n show: ``\n });\n });\n }\n\n return schedule;\n }\n\n // get the schedule data to display (one day at a time);\n getScheduleByDay() {\n const schedule = this.state.schedule;\n const processData = data => {\n data.forEach(show => {\n const airtime = moment(show.airtime);\n const timeslot = airtime.format(`HH:mm`);\n\n // find the timeslot (if it exists);\n schedule.forEach((slot, i) => {\n if (slot.timeslot === timeslot) {\n // add the show or interstitial to the timeslot;\n schedule[i].show = show.title\n ? show.title\n : { pod: show.pod, rule: show.rule };\n }\n });\n });\n };\n\n // get this days data;\n util\n .getScheduleByDay(this.state.day)\n .then(data => {\n processData(data);\n\n // then this weeks interstitial data;\n return util.getInterstitialsByDay(this.state.day);\n })\n .then(data => {\n processData(data);\n\n setTimeout(() => {\n this.mounted &&\n this.setState({\n loaded: true,\n schedule: schedule\n });\n }, util.delayList);\n });\n }\n}\n\nScheduleByDay.propTypes = {\n params: PropTypes.object\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport util from \"../util/util\";\n\nexport default function ScheduleByTimeslotButtons(props) {\n return (\n
    \n
    \n {props.loaded === false ? (\n \n ) : (\n
    \n
    \n \n {props.timeslot}\n \n \n \n {util.timeSlots.map((timeslot, index) => (\n \n \n {timeslot}\n \n \n ))}\n \n
    \n
    \n )}\n
    \n\n
    \n

    \n \n \n {returnTimeslot(props.timeslot, -1)}\n \n

    \n
    \n\n
    \n

    \n \n {returnTimeslot(props.timeslot, 1)}\n \n \n

    \n
    \n
    \n );\n\n // get the prev/next timeslot based on the one passed in;\n function returnTimeslot(timeslot, change) {\n const lastIndex = util.timeSlots.length - 1;\n const currentIndex = util.timeSlots.indexOf(props.timeslot);\n let newIndex = currentIndex + change;\n\n if (newIndex < 0) {\n newIndex = lastIndex;\n }\n\n if (newIndex > lastIndex) {\n newIndex = 0;\n }\n\n return util.timeSlots[newIndex];\n }\n}\n\nScheduleByTimeslotButtons.propTypes = {\n day: PropTypes.string, // used to generate prev/next timeslot links;\n loaded: PropTypes.bool, // has the schedule data been loaded;\n timeslot: PropTypes.string // used in title and link generation;\n};\n","import React, { Component } from \"react\";\nimport PropTypes from \"prop-types\";\n\n// this is used within the Date Picker component;\n// as the trigger to open the Date Picker;\n\n// even though this doesn't make use of state, it shouldn't be a stateless component;\n// if it's stateless, a React error will be thrown in the console about adding a ref to a stateless component;\n// the ref is added by the Date Picker;\n\nexport default class ScheduleByTimeslotJump extends Component {\n render() {\n return (\n \n );\n }\n}\n\nScheduleByTimeslotJump.propTypes = {\n onClick: PropTypes.func // trigger the Date Picker;\n};\n","import React from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport TimeslotPopover from \"../timeslot-popover/timeslot-popover\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\n\nexport default function ScheduleByTimeslotSchedule(props) {\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n {props.schedule.map((day, index) => (\n \n \n \n \n ))}\n \n
    DayPod
    \n \n {moment(day.date).format(util.dateFormatHumanShort)}\n \n \n {day.pod ? (\n \n ) : null}\n
    \n
    \n );\n}\n\nScheduleByTimeslotSchedule.propTypes = {\n schedule: PropTypes.array // array used to build the TABLE;\n};\n","import React, { Component } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport DatePicker from \"react-datepicker\";\nimport ScheduleByTimeslotButtons from \"./schedule-by-timeslot-buttons\";\nimport ScheduleByTimeslotJump from \"./schedule-by-timeslot-jump\";\nimport ScheduleByTimeslotSchedule from \"./schedule-by-timeslot-schedule\";\nimport moment from \"moment\";\nimport util from \"../util/util\";\n\nconst jQuery = window.jQuery;\n\nexport default class ScheduleByTimeslot extends Component {\n constructor(props) {\n super(props);\n\n this.state = this.returnInitialState(props);\n }\n\n componentDidMount() {\n this.mounted = true;\n\n this.getInterstitialsByTimeslot(this.state.dynamicDay, true);\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n componentWillReceiveProps(nextProps) {\n const callback = () => {\n this.getInterstitialsByTimeslot(this.state.dynamicDay, true);\n };\n\n this.setState(this.returnInitialState(nextProps), callback);\n }\n\n render() {\n return (\n
    \n
    \n
    \n

    \n \n \n Return to daily schedule\n \n

    \n
    \n
    \n

    Time Slot Schedule

    \n
    \n
    \n\n
    \n\n \n\n
    \n\n \n\n
    \n Loading More Dates\"\n onClick={() => this.loadMore()}\n >\n \n Load More Dates\n \n\n }\n selected={moment(this.state.urlDay)}\n startDate={moment(this.state.urlDay)}\n endDate={moment(this.state.dynamicDay).add(\n util.daysPerTimeSlotPerPage - 1,\n `days`\n )}\n onChange={value => {\n const newStartDate = value.format(util.dateFormatComputer);\n const newUrl = util.returnScheduleTimeSlotUrl(\n this.state.timeslot,\n newStartDate\n );\n\n browserHistory.push(newUrl);\n }}\n />\n
    \n
    \n );\n }\n\n // use the same logic to set state (on load, on prop change);\n returnInitialState(props = {}) {\n const day = props.params.day || moment().format(util.dateFormatComputer);\n\n return {\n loaded: false, // is the schedule data ready to be displayed;\n schedule: this.generateEmptySchedule(day), // create an empty schedule array;\n urlDay: day, // record the original day for a link back to the daily schedule;\n dynamicDay: day, // display date for Date Picker;\n timeslot: props.params.timeslot || util.timeSlots[0] // timeslot to display schedule data for;\n };\n }\n\n // convert a date into a new date (and format);\n returnDay(date, daysToChange) {\n return moment(date)\n .add(daysToChange, `days`)\n .format(util.dateFormatComputer);\n }\n\n // returns an empty schedule we can now use;\n // insert Ajax content into it, or display as-is (on prop change);\n generateEmptySchedule(startDate) {\n const schedule = [];\n\n // loop through the next X days;\n for (let i = 0; i < util.daysPerTimeSlotPerPage; i = i + 1) {\n schedule.push({\n date: this.returnDay(startDate, i),\n pod: null,\n rule: null\n });\n }\n\n return schedule;\n }\n\n // get the schedule data to display;\n getInterstitialsByTimeslot(startDate, overwrite = false) {\n util\n .getInterstitialsByTimeslot(\n this.state.timeslot,\n startDate,\n util.daysPerTimeSlotPerPage\n )\n .then(data => {\n setTimeout(() => {\n const schedule = this.generateEmptySchedule(startDate);\n\n data.forEach(interstitial => {\n const date = moment(interstitial.airtime).format(\n util.dateFormatComputer\n );\n\n let index = null;\n\n // find the timeslot (if it exists);\n schedule.forEach((day, i) => {\n if (day.date === date) {\n index = i;\n }\n });\n\n // if a timeslot was found;\n if (index !== null) {\n // add the content to the timeslot;\n schedule[index].pod = interstitial.pod;\n schedule[index].rule = interstitial.rule;\n }\n });\n\n // only overwrite on init and propchage;\n const newSchedule = overwrite\n ? schedule\n : this.state.schedule.concat(schedule);\n\n this.mounted &&\n this.setState(\n {\n loaded: true,\n schedule: newSchedule\n },\n () => {\n // reset the button in case it's in a loading state;\n jQuery(`.btn--loadmore`).button(`reset`);\n }\n );\n }, util.delayList);\n });\n }\n\n // append more schedule data to the existing schedule;\n loadMore() {\n // put the button into a processing state;\n jQuery(`.btn--loadmore`).button(`loading`);\n\n this.setState(\n {\n dynamicDay: this.returnDay(\n this.state.dynamicDay,\n util.daysPerTimeSlotPerPage\n )\n },\n () => {\n this.getInterstitialsByTimeslot(this.state.dynamicDay);\n }\n );\n }\n}\n\nScheduleByTimeslot.propTypes = {\n params: PropTypes.object\n};\n","import React, { useEffect, useState } from \"react\";\nimport PropTypes from \"prop-types\";\nimport Dropzone from \"react-dropzone\";\nimport util from \"../util/util\";\nimport Tooltip from \"../tooltip/tooltip\";\n\nconst jQuery = window.jQuery;\n\nexport default function Settings(props) {\n const [dropbox, setDropbox] = useState(null);\n const [dropboxUrl, setDropboxUrl] = useState(\"\");\n const [stationId, setStationId] = useState(\"\");\n const [defaultStationLogo, setDefaultStationLogo] = useState(\"\");\n const [defaultStationAddress1, setDefaultStationAddress1] = useState(\"\");\n const [defaultStationAddress2, setDefaultStationAddress2] = useState(\"\");\n const [defaultStationTelephone, setDefaultStationTelephone] = useState(\"\");\n const [defaultStationWebsite, setDefaultStationWebsite] = useState(\"\");\n const [defaultCustomFooter, setDefaultCustomFooter] = useState(\"\");\n const [customizationsId, setCustomizationsId] = useState(0);\n const [customStationLogo, setCustomStationLogo] = useState(\"\");\n const [customStationAddress1, setCustomStationAddress1] = useState(\"\");\n const [customStationAddress2, setCustomStationAddress2] = useState(\"\");\n const [customStationTelephone, setCustomStationTelephone] = useState(\"\");\n const [customStationWebsite, setCustomStationWebsite] = useState(\"\");\n const [customCustomFooter, setCustomCustomFooter] = useState(\"\");\n const [showCustomizationsForm, setShowCustomizationsForm] = useState(false);\n const [uploadingStationLogo, setUploadingStationLogo] = useState(false);\n const [uploadingProgress, setUploadingProgress] = useState(0);\n const [savingCustomizations, setSavingCustomizations] = useState(false);\n const [deletingCustomizations, setDeletingCustomizations] = useState(false);\n\n useEffect(() => {\n getIntegrations();\n getInvoiceCustomizations();\n }, [props.params]);\n\n // get a list of the station integrations;\n // if a provider is supported, display it;\n const getIntegrations = () => {\n util\n .getIntegrations()\n .then(data => {\n data.forEach(integration => {\n if (integration.name === `dropbox`) {\n setDropboxUrl(integration.url);\n }\n });\n\n return util.getStationIntegrations();\n })\n .then(data => {\n data.results.forEach(integration => {\n if (integration.provider === `dropbox`) {\n setDropbox({\n id: integration.id,\n name: integration.provider_payload.account.display_name,\n email: integration.provider_payload.account.email,\n avatar: integration.provider_payload.account.photo_url\n });\n }\n });\n });\n };\n\n // get the Station data, from Station Manager or a custom inputted one:\n // making the call for the Custom data first, and if that doesn't exist,\n // making another call for the default Station data (easier in the backend like this)\n const getInvoiceCustomizations = () => {\n util.getInvoiceCustomizations().then(data => {\n const customizations = data.results[0];\n\n if (customizations) {\n setStationId(customizations.station);\n setDefaultStationLogo(customizations.station_logo);\n setDefaultStationAddress1(customizations.station_address_1);\n setDefaultStationAddress2(customizations.station_address_2);\n setDefaultStationTelephone(customizations.station_telephone);\n setDefaultStationWebsite(customizations.station_website);\n setDefaultCustomFooter(customizations.custom_footer);\n setCustomizationsId(customizations.id);\n setCustomStationLogo(\"\");\n setCustomStationAddress1(customizations.station_address_1);\n setCustomStationAddress2(customizations.station_address_2);\n setCustomStationTelephone(customizations.station_telephone);\n setCustomStationWebsite(customizations.station_website);\n setCustomCustomFooter(customizations.custom_footer);\n } else {\n util.getInvoiceDefaults().then(data => {\n setStationId(data.station);\n setDefaultStationLogo(data.station_logo);\n setDefaultStationAddress1(data.station_address_1);\n setDefaultStationAddress2(data.station_address_2);\n setDefaultStationTelephone(data.station_telephone);\n setDefaultStationWebsite(data.station_website);\n setDefaultCustomFooter(data.custom_footer);\n setCustomizationsId(0);\n setCustomStationLogo(\"\");\n setCustomStationAddress1(data.station_address_1);\n setCustomStationAddress2(data.station_address_2);\n setCustomStationTelephone(data.station_telephone);\n setCustomStationWebsite(data.station_website);\n setCustomCustomFooter(data.custom_footer);\n });\n }\n });\n };\n\n // remove the association between this station and a dropbox account;\n const deleteDropboxIntegration = id => {\n const title = `Remove Dropbox Integration`;\n const body = `

    Are you sure you want to remove the Dropbox Integration for this station?

    `;\n const buttonTextDefault = `Remove the Integration`;\n const buttonTextLoading = `Removing the Integration`;\n const iconClass = `fa-trash-o`;\n const $modal = util.renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n );\n const $confirmButton = $modal.find(`.btn-danger`);\n\n // remove the exception on confirmation of the modal;\n $confirmButton.one(`click`, () => {\n $confirmButton.button(`loading`);\n\n util\n .deleteDropboxIntegration(id)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n setTimeout(() => {\n setDropbox(null);\n $modal.modal(`hide`);\n }, util.delayForm);\n });\n });\n\n // attach the modal to the DOM, and then show it;\n jQuery(`body`).append($modal);\n $modal.modal(`show`);\n };\n\n // removing the Invoice Customizations\n const deleteCustomizations = () => {\n // put the Delete button into a processing state;\n setDeletingCustomizations(true);\n\n // deleting the existing Customizations\n util.deleteInvoiceCustomizations(customizationsId).then(() => {\n // on success, put the button back and revert to the default values\n setDeletingCustomizations(false);\n getInvoiceCustomizations();\n });\n };\n\n // uploading a new Station Logo image\n const onStationLogoDrop = files => {\n const file = files[0];\n\n // fail safe\n if (!file) {\n return false;\n }\n\n // put the Save buttons into a disabled state until the upload is finished\n // and reset the progress indicator;\n setUploadingStationLogo(true);\n setUploadingProgress(0);\n\n // logoUrl isn't known yet, it will be determined in the response\n // from the Django server\n let logoUrl = ``;\n\n // getting the S3 pre-signed POST url\n const fileMetadata = {\n filename: file.name,\n filetype: file.type\n };\n util.getS3Url(fileMetadata).then(preSignedPost => {\n const s3Data = new FormData();\n const s3Url = preSignedPost.data.url;\n\n // saving the logoUrl (the s3 location created by Django,\n // where we'll then upload the image file)\n logoUrl = preSignedPost.url;\n\n // creating the data to be sent to s3 (Django pre-signed fields + image file)\n // - including all the 'pre-signed' fields\n for (const key in preSignedPost.data.fields) {\n s3Data.append(key, preSignedPost.data.fields[key]);\n }\n // - including the file\n s3Data.append(`file`, file);\n\n // add a progress callback;\n const progressCallback = () => {\n const xhr = new window.XMLHttpRequest();\n\n xhr.upload.addEventListener(\n `progress`,\n progressEvent => {\n if (progressEvent.lengthComputable) {\n const percentComplete = Math.ceil(\n (progressEvent.loaded / progressEvent.total) * 100\n );\n\n // update the progress indicator;\n setUploadingProgress(percentComplete);\n }\n },\n false\n );\n\n return xhr;\n };\n\n // uploading to s3\n util.saveFileToS3(s3Data, s3Url, progressCallback).then(() => {\n // on successful upload, saving the s3 url, and re-enabling the Save button\n setCustomStationLogo(logoUrl);\n setUploadingStationLogo(false);\n });\n });\n };\n\n // removing the custom customizations the user added\n const cancelCustomizations = () => {\n setShowCustomizationsForm(false);\n setCustomStationLogo(\"\");\n setCustomStationAddress1(defaultStationAddress1);\n setCustomStationAddress2(defaultStationAddress2);\n setCustomStationTelephone(defaultStationTelephone);\n setCustomStationWebsite(defaultStationWebsite);\n setCustomCustomFooter(defaultCustomFooter);\n };\n\n // saving the Invoice Customizations\n const saveCustomizations = () => {\n // put the Save buttons into a processing state;\n setSavingCustomizations(true);\n\n // preparing the data to sent to the backend\n const customizations = {\n id: customizationsId,\n station: stationId,\n station_logo: customStationLogo || defaultStationLogo,\n station_address_1: customStationAddress1,\n station_address_2: customStationAddress2,\n station_telephone: customStationTelephone,\n station_website: customStationWebsite,\n custom_footer: customCustomFooter\n };\n\n // saving the data (Post for Create or Put for Update)\n util\n .saveInvoiceCustomizations(customizations, customizationsId)\n .then(data => {\n // on successful Save updating the State with the inputted values\n // and clearing the form\n setStationId(data.station);\n setDefaultStationLogo(data.station_logo);\n setDefaultStationAddress1(data.station_address_1);\n setDefaultStationAddress2(data.station_address_2);\n setDefaultStationTelephone(data.station_telephone);\n setDefaultStationWebsite(data.station_website);\n setDefaultCustomFooter(data.custom_footer);\n setCustomizationsId(data.id);\n setCustomStationLogo(\"\");\n setCustomStationAddress1(data.station_address_1);\n setCustomStationAddress2(data.station_address_2);\n setCustomStationTelephone(data.station_telephone);\n setCustomStationWebsite(data.station_website);\n setCustomCustomFooter(data.custom_footer);\n setShowCustomizationsForm(false);\n setSavingCustomizations(false);\n });\n };\n\n return (\n
    \n
    \n
    \n

    Settings

    \n
    \n
    \n\n
    \n\n
    \n
    \n {dropbox ? (\n
    \n

    Dropbox Integration

    \n {dropbox.avatar ? (\n
    \n
    \n

    \n \"\"\n

    \n
    \n
    \n

    {dropbox.name}

    \n

    {dropbox.email}

    \n
    \n
    \n ) : (\n
    \n

    {dropbox.name}

    \n

    {dropbox.email}

    \n
    \n )}\n\n

    \n deleteDropboxIntegration(dropbox.id)}\n >\n \n Remove Dropbox Integration\n \n

    \n
    \n ) : (\n
    \n

    Dropbox Integration

    \n\n

    \n \n Log In to Dropbox\n \n

    \n
    \n )}\n {util.spotsAvailable() ? (\n
    \n

    \n Integration with Dropbox will create a special folder in your\n Dropbox account, “PBS KIDS AIM”. This folder will\n contain two sub-folders called “pods” and\n “spots”.\n

    \n

    \n Placing interstitial files in these folders will automatically\n upload them and create a pod or a spot with the same name as the\n file name. The file will then be moved to the\n “complete” or “failed” subfolder in your\n Dropbox folder.\n

    \n
    \n ) : (\n

    \n Integration with Dropbox will create a special folder in your\n Dropbox account, “PBS KIDS AIM Pods”. Placing\n interstitial files in this folder will automatically upload them\n and create a pod with the same name as the file name. The file\n will then be removed from your Dropbox folder.\n

    \n )}\n
    \n
    \n\n
    \n\n
    \n
    \n
    \n
    \n

    Invoice Customizations

    \n
    \n
    \n
    \n {\n setShowCustomizationsForm(true);\n }}\n >\n \n Edit\n \n \n Click Edit to change any default fields.\"\n data-for=\"deleteCustomization\"\n >\n deleteCustomizations()}\n disabled={customizationsId === 0 ? true : \"\"}\n >\n {deletingCustomizations ? (\n \n \n \n Deleting\n \n ) : (\n \n \n Delete\n \n )}\n \n \n {customizationsId === 0 && }\n
    \n
    \n
    \n
    \n
    \n

    \n Station Logo:  \n Upload a new logo file here to override it.\"\n data-for=\"stationLogo\"\n className=\"glyphicon glyphicon-question-sign\"\n aria-hidden=\"true\"\n >\n

    \n \"\"\n \n
    \n
    \n

    \n Station Address:  \n Enter an address here to override it.\"\n data-for=\"stationAddress\"\n className=\"glyphicon glyphicon-question-sign\"\n aria-hidden=\"true\"\n >\n

    \n \n

    {defaultStationAddress1}

    \n

    {defaultStationAddress2}

    \n

    {defaultStationTelephone}

    \n

    {defaultStationWebsite}

    \n

    \n Custom Footer:  \n Enter text here to override it.\"\n data-for=\"defaultCustomFooter\"\n className=\"glyphicon glyphicon-question-sign\"\n aria-hidden=\"true\"\n >\n

    \n \n

    {defaultCustomFooter}

    \n
    \n\n
    \n
    \n
    \n

    Edit Invoice Customizations

    \n
    \n
    \n

    \n cancelCustomizations()}\n >\n Cancel\n \n saveCustomizations()}\n disabled={uploadingStationLogo ? true : \"\"}\n >\n {savingCustomizations ? (\n \n \n \n Saving Customizations\n \n ) : (\n \n \n Save Customizations\n \n )}\n \n

    \n
    \n
    \n
    \n
    \n

    \n Station Logo:  \n Upload a new logo file here to override it.\"\n data-for=\"stationLogo\"\n className=\"glyphicon glyphicon-question-sign\"\n aria-hidden=\"true\"\n >\n

    \n \n
    \n onStationLogoDrop(files)}\n >\n
    \n \n {uploadingStationLogo ? (\n
    \n \n {uploadingProgress}% Complete\n
    \n
    \n ) : null}\n
    \n
    \n
    \n
    \n
    \n

    \n Station Address:  \n Enter an address here to override it.\"\n data-for=\"stationAddress\"\n className=\"glyphicon glyphicon-question-sign\"\n aria-hidden=\"true\"\n >\n

    \n \n
    \n \n {\n setCustomStationAddress1(event.target.value);\n }}\n >\n
    \n
    \n \n {\n setCustomStationAddress2(event.target.value);\n }}\n >\n
    \n
    \n \n {\n setCustomStationTelephone(event.target.value);\n }}\n >\n
    \n
    \n \n {\n setCustomStationWebsite(event.target.value);\n }}\n >\n
    \n
    \n
    \n
    \n
    \n

    \n Custom Footer:  \n Enter text here to override it.\"\n data-for=\"customCustomFooter\"\n className=\"glyphicon glyphicon-question-sign\"\n aria-hidden=\"true\"\n >\n

    \n \n {\n setCustomCustomFooter(event.target.value);\n }}\n >\n
    \n
    \n
    \n
    \n

    \n cancelCustomizations()}\n >\n Cancel\n \n saveCustomizations()}\n disabled={uploadingStationLogo ? true : \"\"}\n >\n {savingCustomizations ? (\n \n \n \n Saving Customizations\n \n ) : (\n \n \n Save Customizations\n \n )}\n \n

    \n
    \n
    \n
    \n \n \n );\n}\n\nSettings.propTypes = {\n params: PropTypes.object\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\n\nexport default function UserFormButtons(props) {\n return (\n

    \n \n Cancel\n \n\n Sending Invites\"\n onClick={props.onSubmit}\n >\n \n Send Invites\n \n

    \n );\n}\n\nUserFormButtons.propTypes = {\n onCancel: PropTypes.func,\n onSubmit: PropTypes.func\n};\n","import React, { Component } from \"react\";\nimport { browserHistory } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport LoadingIndicatorHeader from \"../loading-indicator/loading-indicator-header\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\nimport util from \"../util/util\";\nimport UserFormButtons from \"./user-form-buttons\";\n\nconst jQuery = window.jQuery;\n\nconst returnInitialState = (props = {}) => ({\n errors: {}, // prop names determine which errors to show;\n id: props.params ? Number(props.params.id) : 0, // id of the user we are editing (0 means new rule to create);\n loaded: false, // have the Ajax calls resolved, and we're ready to show the form;\n roles: [], // options to display in a SELECT field;\n users: [] // array used to control the SELECT fields for users (does not contain the values to pass to Django);\n});\n\nexport default class UserForm extends Component {\n constructor(props) {\n super(props);\n\n this.state = returnInitialState(props);\n }\n\n componentDidMount() {\n this.mounted = true;\n\n this.getStation();\n this.getRoles();\n this.getUser();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState(returnInitialState(nextProps), this.getUser);\n }\n\n render() {\n if (this.state.loaded === false) {\n return ;\n } else {\n return (\n
    \n
    \n
    \n

    Invite Users

    \n
    \n\n
    \n this.onCancel()}\n onSubmit={() => this.onSubmit()}\n />\n
    \n
    \n\n
    \n\n
    \n
    \n

    \n Station\n

    \n {this.state.stationName ? (\n

    {this.state.stationName}

    \n ) : (\n

    \n \n

    \n )}\n
    \n
    \n
    \n {this.state.stationGroups &&\n this.state.stationGroups.map((group, index) => {\n return (\n
    \n

    \n {group.name}\n

    \n

    {group.count}

    \n
    \n );\n })}\n
    \n
    \n
    \n\n
    \n\n \n
    \n {this.state.users.map((user, index) => (\n
    \n
    \n\n
    \n \n \n this.changeUserValue(e.target.value, index, `email`)\n }\n />\n
    \n\n
    \n \n \n this.changeUserValue(e.target.value, index, `role`)\n }\n >\n \n {this.state.roles.map((role, i) => {\n return (\n \n );\n })}\n \n
    \n\n this.removeUser(index)}\n >\n \n Delete\n \n
    \n ))}\n
    \n\n {this.state.id === 0 ? (\n this.addUser()}\n >\n \n Add Another User\n \n ) : null}\n\n
    \n\n this.onCancel()}\n onSubmit={() => this.onSubmit()}\n />\n \n );\n }\n }\n\n // push an empty value into the users array;\n // this way a new INPUT will appear for the user to add the new value;\n addUser() {\n const users = Array.from(this.state.users);\n\n users.push({\n email: ``,\n role: ``\n });\n\n this.setState(\n {\n users: users\n },\n () => {\n document.querySelector(`#email${users.length - 1}`).focus();\n }\n );\n }\n\n // remove the index from the user array;\n // this will remove the form fields;\n removeUser(index) {\n const users = Array.from(this.state.users);\n\n users.splice(index, 1);\n\n this.setState({\n users: users\n });\n }\n\n // change a value in the users array;\n changeUserValue(value, target, prop) {\n const users = Array.from(this.state.users);\n\n users[target][prop] = value;\n\n this.setState({\n users: users\n });\n }\n\n // save the data;\n onSubmit() {\n const requests = []; // container for our promises;\n const $button = jQuery(`.btn-primary`);\n\n // fire off an Ajax call per user, creating an invite;\n this.state.users.forEach((user, index) => {\n const email = this.state.users[index].email;\n const role = this.state.users[index].role;\n\n // only if the user filled out the form;\n if (email && role) {\n requests.push(\n util.saveInvite({\n email: email,\n group: role\n })\n );\n }\n });\n\n // dont do anything if there aren't invites to process;\n if (requests.length) {\n // put the button into a processing state;\n $button.button(`loading`);\n\n // when all the Ajax calls resolve;\n // go to the list;\n jQuery.when\n .apply(jQuery, requests)\n .fail(() => {\n // on fail, reset the button on fail so it can be clicked again;\n setTimeout(() => {\n $button.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // on success, go to the user list;\n setTimeout(() => {\n browserHistory.push(util.returnUserListUrl());\n }, util.delayForm);\n });\n }\n }\n\n // cancel this action (do nothing and go somewhere else);\n onCancel() {\n browserHistory.push(util.returnUserListUrl());\n }\n\n // get station information to display above the form;\n getStation() {\n util.getStation().then(data => {\n setTimeout(() => {\n this.mounted &&\n this.setState({\n stationName: data.name,\n stationGroups: data.group_counts\n });\n }, util.delayDetail);\n });\n }\n\n // get the role options to display in the SELECT;\n getRoles() {\n util.getRoles().then(data => {\n this.mounted &&\n this.setState({\n roles: data.results\n });\n });\n }\n\n // get the user data to display in the form;\n getUser() {\n if (this.state.id === 0) {\n this.setState({\n users: [\n {\n email: ``,\n role: ``\n }\n ],\n loaded: true\n });\n } else {\n util.getStationUser(this.state.id).then(data => {\n setTimeout(() => {\n this.mounted &&\n this.setState({\n users: [\n {\n email: data.user.email,\n role: data.group.id\n }\n ],\n loaded: true\n });\n }, util.delayDetail);\n });\n }\n }\n}\n\nUserForm.propTypes = {\n params: PropTypes.object\n};\n","import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport util from \"../util/util\";\nimport LoadingIndicatorText from \"../loading-indicator/loading-indicator-text\";\nimport InaccessibleLink from \"../shim/inaccessible-link\";\n\nexport default function UserListTable(props) {\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {props.users === false ? (\n \n \n \n \n ) : null}\n\n {props.users && props.users.length === 0 ? (\n \n \n \n ) : null}\n\n {props.users && props.users.length\n ? props.users.map((user, index) => {\n return index < util.userResultsPerPage ? (\n \n \n \n \n \n \n \n \n ) : null;\n })\n : null}\n \n
    #NameEmailRoleActivatedRemove User
    \n 0\n {util.zeroUsersMessage}
    \n \n
    \n \n {util.returnLineNumber(\n props.currentPage,\n util.userResultsPerPage,\n index\n )}\n \n {user.user.name || N/A}{user.user.email || N/A}{user.group ? user.group.name : N/A}{user.activated ? `Yes` : `No`}\n props.onClickDeleteUser(user)}\n >\n \n Remove\n \n
    \n
    \n );\n}\n\nUserListTable.propTypes = {\n currentPage: PropTypes.number, // used to calc the # in the TABLE;\n onClickDeleteUser: PropTypes.func, // remove user from station;\n users: PropTypes.oneOfType([\n // user data to display;\n PropTypes.array,\n PropTypes.bool\n ])\n};\n","import React, { Component } from \"react\";\nimport { Link } from \"react-router\";\nimport PropTypes from \"prop-types\";\nimport _ from \"lodash\";\nimport util from \"../util/util\";\nimport Pagination from \"../pagination/pagination\";\nimport UserListTable from \"./user-list-table\";\n\nconst jQuery = window.jQuery;\n\n// use the same logic to set state (on load, on prop change);\nconst returnInitialState = (props = {}) => ({\n page: Number(_.get(props, `params.page`, 1)), // page of users results;\n users: [] // users to display (will be populated by an Ajax call);\n});\n\nexport default class UserList extends Component {\n constructor(props) {\n super(props);\n\n this.state = returnInitialState(props);\n }\n\n componentDidMount() {\n this.mounted = true;\n\n this.getUsers();\n }\n\n componentWillUnmount() {\n this.mounted = false;\n }\n\n componentWillReceiveProps(nextProps) {\n this.setState(returnInitialState(nextProps), this.getUsers);\n }\n\n render() {\n return (\n
    \n
    \n
    \n

    Users

    \n
    \n
    \n

    \n \n Manage Users\n \n

    \n
    \n
    \n\n
    \n\n this.deleteUser(user)}\n users={this.state.users}\n />\n\n \n
    \n );\n }\n\n // delete the user associated with this station;\n deleteUser(user) {\n const title = `Delete User from this Station`;\n const body = `

    Are you sure you want to delete the ${\n user.group ? user.group.name : `User`\n }: ${user.user.name}?

    `;\n const buttonTextDefault = `Delete the User`;\n const buttonTextLoading = `Deleting the User`;\n const iconClass = `fa-trash-o`;\n const $modal = util.renderModal(\n title,\n body,\n buttonTextDefault,\n buttonTextLoading,\n iconClass\n );\n const $confirmButton = $modal.find(`.btn-danger`);\n\n // remove the user on confirmation of the modal;\n $confirmButton.one(`click`, () => {\n $confirmButton.button(`loading`);\n\n util\n .deleteUserFromStation(user.id)\n .fail(() => {\n setTimeout(() => {\n // reset the button on fail so it can be clicked again;\n $confirmButton.button(`reset`);\n }, util.delayForm);\n })\n .then(() => {\n // then load the users again (to update state);\n this.getUsers(() => {\n $modal.modal(`hide`);\n });\n });\n });\n\n // attach the modal to the DOM, and then show it;\n jQuery(`body`).append($modal);\n $modal.modal(`show`);\n }\n\n // get the users for this station;\n getUsers(callback = null) {\n util\n .getStationUsers({\n page: this.state.page\n })\n .then(data => {\n setTimeout(() => {\n this.mounted &&\n this.setState(\n {\n pageCount: Math.ceil(data.count / util.userResultsPerPage),\n users: data.results.length ? data.results : false\n },\n () => {\n // if a callback exists (hide modal), fire it;\n if (callback) {\n callback();\n }\n }\n );\n }, util.delayList);\n });\n }\n}\n\nUserList.propTypes = {\n params: PropTypes.object\n};\n","import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Router, Route, browserHistory } from \"react-router\";\nimport * as Sentry from \"@sentry/browser\";\nimport util from \"../components/util/util\";\n\nimport \"./jquery-deparam\";\n\nimport FourOhFour from \"../components/404/404\";\nimport App from \"../components/app/app\";\nimport CampaignDetail from \"../components/campaign-detail/campaign-detail\";\nimport CampaignForm from \"../components/campaign-form/campaign-form\";\nimport CampaignList from \"../components/campaign-list/campaign-list\";\nimport ChangeLogByObj from \"../components/change-log-by-obj/change-log-by-obj\";\nimport ChangeLogByUser from \"../components/change-log-by-user/change-log-by-user\";\nimport ChangeLogList from \"../components/change-log-list/change-log-list\";\nimport ConflictForm from \"../components/conflict-form/conflict-form\";\nimport InviteForm from \"../components/invite-form/invite-form\";\nimport InviteList from \"../components/invite-list/invite-list\";\nimport Livestream from \"../components/livestream/livestream\";\nimport PodDetail from \"../components/pod-detail/pod-detail\";\nimport PodList from \"../components/pod-list/pod-list\";\nimport SpotDetail from \"../components/spot-detail/spot-detail\";\nimport SpotList from \"../components/spot-list/spot-list\";\nimport PodForm from \"../components/pod-form/pod-form\";\nimport SpotForm from \"../components/spot-form/spot-form\";\nimport Reports from \"../components/reports/reports\";\nimport RuleDetail from \"../components/rule-detail/rule-detail\";\nimport RuleForm from \"../components/rule-form/rule-form\";\nimport RuleList from \"../components/rule-list/rule-list\";\nimport ScheduleByDay from \"../components/schedule-by-day/schedule-by-day\";\nimport ScheduleByTimeslot from \"../components/schedule-by-timeslot/schedule-by-timeslot\";\nimport ScheduleByWeek from \"../components/schedule-by-week/schedule-by-week\";\nimport Settings from \"../components/settings/settings\";\nimport UserForm from \"../components/user-form/user-form\";\nimport UserList from \"../components/user-list/user-list\";\n\nconst jQuery = window.jQuery;\n\ndocument.addEventListener(`DOMContentLoaded`, () => {\n const onUpdate = () => {\n // do this immediately on route change;\n window.scrollTo(0, 0);\n jQuery(`.popover`).remove();\n\n // run these on a slight delay so the UX isn't jaring;\n setTimeout(() => {\n jQuery(`#page-header__collapse--account`).collapse(`hide`);\n jQuery(`#page-header__collapse--nav`).collapse(`hide`);\n }, util.delayList);\n };\n // initialize sentry\n const sentryDsns = {\n \"aim.console.pbs.org\":\n \"https://e0fe70ddef5e498ea05fa98664e11eac@o260369.ingest.sentry.io/5223056\",\n \"aim-staging.console.pbs.org\":\n \"https://5af4d0a5f0864d5fa6a1067f53e678ed@o260369.ingest.sentry.io/5223049\",\n defaults: \"\"\n };\n const sentry_dsn = sentryDsns[window.location.host] || sentryDsns.defaults;\n if (sentry_dsn) {\n Sentry.init({\n dsn: sentry_dsn\n });\n }\n\n ReactDOM.render(\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n\n \n \n\n \n \n \n\n \n\n \n \n \n \n \n \n \n \n \n\n \n \n\n \n \n \n \n \n \n\n \n \n\n \n \n\n \n \n \n\n \n\n \n \n \n\n \n \n ,\n document.querySelector(`.container`)\n );\n});\n","module.exports = __webpack_public_path__ + \"static/media/pbs-logo.99959f75.svg\";"],"sourceRoot":""}