{"version":3,"sources":["webpack:///../Roc.SharedClientApp/types/model-status.ts","webpack:///./ClientApp/components/shared/svg/ArrowLeaveSVG.tsx","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestMenu.tsx","webpack:///./ClientApp/components/shared/svg/GarbageCanCircleSVG.tsx","webpack:///./ClientApp/features/tenants/Constants.tsx","webpack:///./ClientApp/features/tenants/helpers/TenantHelper.ts","webpack:///./ClientApp/components/shared/svg/CheckSVG.tsx","webpack:///./ClientApp/types/ExceptionCodes.ts","webpack:///./ClientApp/features/admin-profile/Definition.ts","webpack:///./ClientApp/components/shared/edit/EditCopyHtmlButton.tsx","webpack:///./ClientApp/components/shared/edit/EditForm.tsx","webpack:///./ClientApp/components/shared/svg/FolderSVG.tsx","webpack:///./ClientApp/components/shared/edit/EditStatusDisplay.tsx","webpack:///./ClientApp/components/shared/edit/EditTitle.tsx","webpack:///./ClientApp/components/shared/edit/EditSaveButton.tsx","webpack:///./ClientApp/services/HistoryHelper.ts","webpack:///./ClientApp/components/shared/edit/EditDeleteButton.tsx","webpack:///./ClientApp/components/shared/edit/EditToListingAction.tsx","webpack:///./ClientApp/components/shared/edit/EditCancelButton.tsx","webpack:///./ClientApp/components/shared/edit/EditErrorOnSaveAlert.tsx","webpack:///./ClientApp/components/shared/svg/CalendarSVG.tsx","webpack:///./ClientApp/components/shared/edit/EditVersionStatus.tsx","webpack:///./ClientApp/components/shared/edit/EditVersion.tsx","webpack:///./ClientApp/components/shared/edit/withEdit.tsx","webpack:///./ClientApp/components/shared/list/ListingStatusDisplay.tsx","webpack:///./ClientApp/components/shared/edit/fields/formatters/url.ts","webpack:///./ClientApp/components/shared/list/filters/providers/Constants.tsx","webpack:///./ClientApp/components/shared/svg/MagnifyingGlassSVG.tsx","webpack:///./ClientApp/components/shared/svg/HelpSVG.tsx","webpack:///./ClientApp/components/shared/FormattedTimes.tsx","webpack:///./ClientApp/features/redirects-301/Redirect301OnTheFlyForm.tsx","webpack:///./ClientApp/components/shared/edit/EditErrorAlertPopup.tsx","webpack:///./ClientApp/components/shared/svg/CalendarTrashSVG.tsx","webpack:///./ClientApp/components/shared/svg/CalendarPowerSVG.tsx","webpack:///./ClientApp/components/shared/svg/CalendarCheckmarkSVG.tsx","webpack:///./ClientApp/components/shared/svg/PencilWriteSVG.tsx","webpack:///./ClientApp/components/shared/PopoverClose.tsx","webpack:///./ClientApp/components/shared/PopoverTitle.tsx","webpack:///./ClientApp/components/shared/edit/tabs/AdminTabsContext.tsx","webpack:///./ClientApp/components/shared/edit/decorators/focusOnErrorsCustom.ts","webpack:///./ClientApp/components/shared/edit/CulturePicker.tsx","webpack:///./ClientApp/components/shared/edit/fields/TextBox.tsx","webpack:///./ClientApp/services/AxiosHelper.ts","webpack:///./ClientApp/components/AppContext.tsx","webpack:///./ClientApp/components/shared/hooks/useDelayedDisplay.tsx","webpack:///./ClientApp/components/shared/RichTextContent.tsx","webpack:///./ClientApp/VisuallyHiddenAnnouncementContext.tsx","webpack:///./ClientApp/components/shared/svg/ExclamationCircleSVGAlternative.tsx","webpack:///./ClientApp/components/shared/svg/ExclamationTriangleSVGAlternative.tsx","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestNoResultsText.tsx","webpack:///./ClientApp/components/shared/tooltip/TooltipWrapper.tsx","webpack:///./ClientApp/components/shared/svg/LeftChevronSVG.tsx","webpack:///./ClientApp/components/shared/list/filters/AvailableFilters.tsx","webpack:///./ClientApp/components/shared/list/filters/FilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/Filters.tsx","webpack:///./ClientApp/components/shared/list/filters/index.tsx","webpack:///./ClientApp/components/shared/ViewLiveModal.tsx","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestMenuToggle.tsx","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestInputActions.tsx","webpack:///./ClientApp/components/shared/list/saved-filters/Util.tsx","webpack:///./ClientApp/components/shared/edit/fields/EnumDropdown.tsx","webpack:///./ClientApp/components/shared/edit/EditResetButton.tsx","webpack:///./ClientApp/components/shared/hooks/useVisuallyHiddenAnnouncement.tsx","webpack:///./ClientApp/components/shared/Spinner.tsx","webpack:///./node_modules/final-form-focus/dist/final-form-focus.es.js","webpack:///./ClientApp/util/StringUtil.ts","webpack:///./ClientApp/components/shared/edit/fields/RequiredFieldMarker.tsx","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestFieldInput.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/FiltersListAddButton.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/SingleTextFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/BooleanFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/SingleNumberFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/SingleDecimalFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/SingleIntegerFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/RangedNumberFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/RangedDecimalFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/RangedIntegerFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/FiltersListButtonGroup.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/FiltersListValueButton.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/FiltersListCloseButton.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/index.ts","webpack:///./ClientApp/components/shared/edit/fields/OnFieldValueChange.tsx","webpack:///./ClientApp/components/shared/list/filters/SelectedFilters.tsx","webpack:///./ClientApp/components/shared/CenterSpinner.tsx","webpack:///./ClientApp/components/shared/list/ListingHelpButton.tsx","webpack:///./ClientApp/components/shared/svg/RightChevronSVG.tsx","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestBase.tsx","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestInput.tsx","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestMenuItem.tsx","webpack:///./ClientApp/components/shared/LastLocationProvider.tsx","webpack:///./ClientApp/types/__models__/EditRequestSource.ts","webpack:///./ClientApp/services/AutoSuggestService.ts","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestData.tsx","webpack:///./ClientApp/components/shared/edit/EditStatusLabel.tsx","webpack:///./ClientApp/components/shared/edit/fields/CurrencyTextBox.tsx","webpack:///./ClientApp/components/shared/edit/fields/DateOnly.tsx","webpack:///./ClientApp/components/shared/edit/fields/FormDropdown.tsx","webpack:///./ClientApp/components/shared/edit/fields/MonthDropdown.tsx","webpack:///./ClientApp/components/shared/edit/fields/NumberTextBox.tsx","webpack:///./ClientApp/components/shared/edit/fields/PasswordTextBox.tsx","webpack:///./ClientApp/components/shared/edit/fields/TextArea.tsx","webpack:///./ClientApp/components/shared/edit/fields/TextList.tsx","webpack:///./ClientApp/components/shared/edit/fields/Toggle.tsx","webpack:///./ClientApp/components/shared/edit/fields/YearDropdown.tsx","webpack:///./ClientApp/components/shared/edit/fields/YesNoDropdown.tsx","webpack:///./ClientApp/services/EntityDefinitionService.ts","webpack:///./ClientApp/components/shared/edit/fields/Condition.tsx","webpack:///./ClientApp/components/shared/edit/fields/DefaultSuggestedValue.tsx","webpack:///./ClientApp/components/shared/edit/fields/formatters/prettyJson.ts","webpack:///./ClientApp/components/shared/list/filters/providers/Types.ts","webpack:///./ClientApp/util/Misc.ts","webpack:///./ClientApp/components/shared/edit/fields/helper/TimePicker.tsx","webpack:///./ClientApp/components/shared/edit/fields/helper/DateTimePicker.tsx","webpack:///./ClientApp/components/shared/edit/fields/DateTime.tsx","webpack:///./ClientApp/components/shared/edit/fields/WhenFieldChanges.tsx","webpack:///./ClientApp/components/shared/Tooltip.tsx","webpack:///./ClientApp/components/shared/RocTitle.tsx","webpack:///./ClientApp/styles/app.scss?4c37","webpack:///./ClientApp/components/PageNotFound.tsx","webpack:///./ClientApp/components/shared/tooltip/TooltipPopover.tsx","webpack:///./ClientApp/components/shared/edit/ScopeField.tsx","webpack:///./ClientApp/components/shared/edit/EditContext.tsx","webpack:///./ClientApp/components/shared/tooltip/TooltipEditOverlay.tsx","webpack:///./ClientApp/components/shared/tooltip/TooltipEditButton.tsx","webpack:///./ClientApp/components/FragmentSupportingSwitch.tsx","webpack:///./ClientApp/components/shared/ErrorAlert.tsx","webpack:///./ClientApp/components/shared/list/ListingContainer.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/SingleDropDownFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/providers/SingleValue.tsx","webpack:///./ClientApp/components/shared/FancyRadioButtons.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/MultipleTextFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/MultipleDropDownFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/providers/MultipleValue.tsx","webpack:///./ClientApp/components/shared/list/filters/providers/RangedValue.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/SingleAutoSuggestFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/MultipleAutoSuggestFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/providers/AutoSuggestValue.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/MultipleDateRangePresetFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/providers/MultipleRangePresetValue.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/SingleDateFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/editors/SingleDateRangePresetFilterEdit.tsx","webpack:///./ClientApp/components/shared/list/filters/providers/index.tsx","webpack:///./ClientApp/components/shared/list/filters/providers/SingleDateRangePresetValue.tsx","webpack:///./ClientApp/components/shared/list/filters/providers/SingleDateValue.tsx","webpack:///./ClientApp/components/shared/edit/ValidationErrorAlert.tsx","webpack:///./ClientApp/components/shared/toast/ToastClose.tsx","webpack:///./ClientApp/components/shared/toast/Toasts.tsx","webpack:///./ClientApp/util/AppStateUtils.ts","webpack:///./ClientApp/components/shared/edit/EditViewLive.tsx","webpack:///./ClientApp/types/EntityDefinition.tsx","webpack:///./ClientApp/types/index.ts","webpack:///./ClientApp/components/shared/list/filters/editors/FilterEditRequiredValidation.tsx","webpack:///./ClientApp/components/shared/Confirm.tsx","webpack:///./ClientApp/components/shared/edit/LocalizeMode.ts","webpack:///./ClientApp/components/shared/edit/withEditContext.tsx","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestContext.tsx","webpack:///./ClientApp/components/shared/Alert.tsx","webpack:///./ClientApp/components/shared/Success.tsx","webpack:///./node_modules/qr.js/lib/mode.js","webpack:///./node_modules/qr.js/lib/ErrorCorrectLevel.js","webpack:///./node_modules/qr.js/lib/Polynomial.js","webpack:///./node_modules/qr.js/lib/math.js","webpack:///./ClientApp/features/admin-profile/two-factor-providers/totp/RecoveryCodes.tsx","webpack:///./ClientApp/components/shared/svg/DownChevronSVG.tsx","webpack:///./ClientApp/components/shared/svg/LightningSVG.tsx","webpack:///./ClientApp/components/shared/svg/SharedSVG.tsx","webpack:///./ClientApp/components/shared/svg/UpChevronSVG.tsx","webpack:///./ClientApp/components/shared/edit/fields/FieldLabel.tsx","webpack:///./ClientApp/features/admin-profile/two-factor-providers/duo-security/EnableDuoButton.tsx","webpack:///./node_modules/qrcode.react/lib/index.js","webpack:///./ClientApp/features/admin-profile/two-factor-providers/totp/EnableAuthenticator.tsx","webpack:///./ClientApp/features/admin-profile/two-factor-providers/totp/EnableTotpAuthenticator.tsx","webpack:///./ClientApp/components/shared/svg/ExclamationCircleSVG.tsx","webpack:///./ClientApp/components/shared/Loading.tsx","webpack:///./ClientApp/components/shared/svg/InfoSVG.tsx","webpack:///./ClientApp/components/shared/svg/CheckCircleSVG.tsx","webpack:///./ClientApp/types/Exceptions.ts","webpack:///../Roc.SharedClientApp/util/Constants.ts","webpack:///./ClientApp/components/shared/edit/fields/AutoSuggestSingleField.tsx","webpack:///./node_modules/qr.js/lib/QRCode.js","webpack:///./node_modules/qr.js/lib/8BitByte.js","webpack:///./node_modules/qr.js/lib/RSBlock.js","webpack:///./node_modules/qr.js/lib/BitBuffer.js","webpack:///./node_modules/qr.js/lib/util.js","webpack:///./ClientApp/components/shared/auto-suggest/Util.tsx","webpack:///./ClientApp/components/shared/edit/fields/ValidationMessages.tsx","webpack:///./ClientApp/components/shared/FieldSubtext.tsx","webpack:///./ClientApp/components/shared/edit/fields/Input.tsx","webpack:///./ClientApp/components/shared/svg/XSVG.tsx","webpack:///./ClientApp/util/Time.ts","webpack:///./ClientApp/components/shared/tabs/Tabs.tsx","webpack:///./ClientApp/components/shared/edit/TranslatedField.tsx","webpack:///./ClientApp/components/shared/CircleButton.tsx","webpack:///./ClientApp/styles/global.ts","webpack:///./ClientApp/VisuallyHiddenAnnouncement.tsx","webpack:///./ClientApp/login-app/components/shared/Input.tsx","webpack:///./ClientApp/login-app/components/account/Login.tsx","webpack:///./ClientApp/login-app/components/account/ForgotPassword.tsx","webpack:///./ClientApp/login-app/components/account/Confirm.tsx","webpack:///./ClientApp/login-app/components/account/Lockout.tsx","webpack:///./ClientApp/login-app/components/shared/SimpleCheckBox.tsx","webpack:///./ClientApp/login-app/components/account/LoginTwoFactor.tsx","webpack:///./ClientApp/login-app/components/account/LoginRecovery.tsx","webpack:///./ClientApp/login-app/components/account/ResetPassword.tsx","webpack:///./ClientApp/login-app/components/account/LoginTwoFactorSetup.tsx","webpack:///./ClientApp/login-app/components/account/two-factor-providers/duo-security/DuoError.tsx","webpack:///./ClientApp/login-app/components/account/RegisterInstallation.tsx","webpack:///./ClientApp/login-app/components/account/Routes.tsx","webpack:///./ClientApp/login-app/loginRoutes.tsx","webpack:///./ClientApp/login-app/LoginApp.tsx","webpack:///./ClientApp/login-app/login.tsx","webpack:///./ClientApp/components/shared/Utils.tsx","webpack:///./ClientApp/components/shared/auto-suggest/AutoSuggestSingle.tsx","webpack:///./ClientApp/components/shared/ModalClose.tsx","webpack:///./ClientApp/components/shared/svg/DashCircleSVG.tsx","webpack:///./ClientApp/AppState.ts","webpack:///../Roc.SharedClientApp/types/index.ts","webpack:///./ClientApp/components/shared/svg/PencilSVG.tsx","webpack:///./ClientApp/components/shared/svg/ExclamationTriangleSVG.tsx","webpack:///./ClientApp/components/shared/Warning.tsx","webpack:///./ClientApp/components/shared/svg/GarbageCanSVG.tsx"],"names":["ModelStatus","ArrowLeaveSVG","props","viewBox","className","class","focusable","aria-hidden","d","defaultProps","AutoSuggestMenu","React","async","onCreateClick","this","setState","hasError","error","mounted","errorInfo","handleAxiosErrorWithValidation","errorMessage","componentDidMount","componentWillUnmount","render","data","results","hasMore","isLoading","testId","renderMenuItem","downshift","getMenuProps","getItemProps","inputValue","highlightedIndex","autoSuggestOptions","allowNewValues","context","selectedItems","inputValueAlreadySelected","length","findIndex","selectedItem","label","toLocaleLowerCase","inputValueNotInResults","every","item","displayCreateItem","state","displayChangeCultureMessage","open","map","index","key","value","data-testid","onClick","handleCreateClick","icon","Plus","ariaLabel","AutoSuggestContext","GarbageCanCircleSVG","svgProps","fill","TenantKey","TenantHeaderName","getTenantIdFromSessionOrLocalStorage","sessionStorage","getItem","localStorage","setTenantIdToSessionAndLocalStorage","tenantId","isNullOrEmptyGuid","setItem","CheckSVG","RemovalErrorCode","definition","EntityDefinition","singularName","baseAjaxUrl","baseRoute","withEditContext","entityDefinition","baseAjaxRoute","editContext","RocTitle","alignment","color","response","AxiosHelper","get","values","id","entity","body","toastError","content","message","navigator","clipboard","writeText","toastSuccess","Axios","isCancel","Check","focusOnErrorsCustom","createDecorator","EditForm","bottomActionsFocused","setBottomActionsFocused","useState","expirationAlertCountdownStarted","useContext","AppContext","handleFocusIn","handleBlur","initialValues","decorators","subscription","pristine","dirty","submitError","dirtySinceLastSubmit","mutators","validate","editSessionUniqueKey","save","redirectPathName","redirectSearch","redirectCulture","isLoadingInitial","isSaving","axiosError","isCreateMode","scopeFieldEnabled","validationErrorSource","EditContext","user","authorizedBaseRoutesData","AppState","formDecorators","push","isPermanent","isDeletable","onSubmit","arrayMutators","formProps","handleSubmit","form","localized","config","multiSiteEnabled","localizeMode","showSeparateTitleLine","hideKey","hideEditActions","versionable","scoped","to","pathname","search","CenterSpinner","autoComplete","when","isActive","onConfirm","onCancel","Confirm","isOpen","renderTitle","renderContents","confirmButtonText","cancelButtonText","ScopeField","disabled","CulturePicker","hideView","editViewLiveComponent","hideCancel","cancelButtonLabel","copyHtmlMarkup","hideDelete","hasDeletePermission","ErrorAlert","ValidationErrorSource","ValidationErrorAlert","alertType","AlertType","Edit","onFocus","onBlur","dropdownMenuDirection","centered","Spinner","FolderSVG","DefaultPopoverStatusOnEdit","record","activeVersion","isDraft","isFutureVersion","isArchived","statusName","prefix","modelStatus","Published","Deleted","Draft","Inactive","statusLabel","statusField","versionLabel","EditStatusLabel","status","versionNo","createUser","Constants","createDate","formatDateTime","moment","isSame","modifyDate","modifyUser","scheduledTime","processTime","EditStatusDisplay","constructor","super","e","preventDefault","toggle","popoverOpen","archivedContainerRef","container","isBasicModelOnly","isBasicModel","isBaseModel","getActiveVersion","type","EntityVersionType","Archived","Future","ref","handleButtonClick","statusIconOverride","InfoSVG","CalendarCheckmarkSVG","CheckCircleSVG","CalendarTrashSVG","CalendarPowerSVG","DashCircleSVG","PencilWriteSVG","target","placement","popoverPlacement","statusInfoOverrideOnEdit","EditTitle","ModalState","pageAlert","userFriendlyNameField","hideViewOnly","title","valueKey","getFormattedPageTitle","OnFieldValueChange","field","VisuallyHiddenAnnouncement","hideStatusOnEdit","ListingHelpButton","iconClassNames","linkClassNames","EditSaveButton","setNextSubmissionState","params","modalState","Closed","serverException","getHandleableException","exceptionCode","RemovalErrorOpen","failedSubmitParameters","SaveErrorOpen","newParams","force","submit","prevState","dropdownOpen","scheduleModalOpen","scheduleModalStatus","scheduleModalTime","doContinue","confirmPublishModalOpen","confirmPublishAndContinue","confirmPublishStatus","RedirectsOpen","formValues","submissionType","submissionTime","hideCreate301OnTheFly","url","originalScope","currentScope","currentSites","currentSite","sites","find","s","currentSiteCollection","siteCollections","sc","site","siteId","filter","undefined","redirect301Sites","GetScopedSites","rs","cs","hide301Form","initialFormValues","redirectUrl","siteNamesFor301s","name","initialRedirectValues","activeVersionType","isFutureUpdate","scopeChanged","updateFuture","toggleConfirmPublishModal","handleScopeChange","toggle301CreationModal","setContinueWithHistory","updateDraft","componentDidUpdate","prevProps","Current","recordName","buttonColor","canSaveAsInactive","doSubmit","publishButtonLabel","toggleDropdown","direction","caret","canSaveAndContinue","saveAsAndContinue","canPublishBeScheduled","toggleScheduleModal","saveAs","canInactivationBeScheduled","doScheduledSubmit","submitting","component","DateTime","outline","continueWithPublish","EditErrorAlertPopup","onForceCancel","forceLastFailedSubmit","inProgress","isEqual","areRedirectsEqual","meta","size","doSubmitWith301Redirects","Redirect301OnTheFlyForm","initialValue","siteNames","HistoryHelper","version","displayName","dateFormat","localMoment","format","action","ModalStatus","EditDeleteButton","modal","modalStatus","newModal","setModal","DeletePopup","requestDeleteAsync","redirects","redirectsWhenForcing","historyId","getActiveVersionId","deleting","delete","cancelToken","requestToken","token","toastifyOptions","position","toast","POSITION","BOTTOM_RIGHT","customContent","redirectToLastLocation","ErrorPopup","console","isDeleteHidden","hideDeleteOptions","canDeletionBeScheduled","CancelToken","source","containerRef","cancel","areDeleteOptionsHidden","PERMANENT_ENTITY_DELETED_ERROR_MESSAGE","isEnabled","attemptDelete","GarbageCanSVG","SchedulePopup","onConfirmDelete","show301Form","confirmTestId","cancelTestId","Delete","fieldName","getVersionTypeName","onConfirmForceDelete","toggleModal","continueWithScheduledDelete","withRouter","lastLocation","children","location","history","match","lastLocationPathAndQuery","EditCancelButton","EditErrorOnSaveAlert","errorOnSave","CalendarSVG","EditVersionListingStatusIcon","archivedIconStyles","defaultIconStyles","getVersionStatus","EditVersionStatus","isStatusPopoverOpen","setIsStatusPopoverOpen","toggleStatusPopover","EditVersion","confirmModalIsOpen","selectVersionmodalIsOpen","pendingVersionChange","replace","load","toggleConfirmModal","warn","selectedVersion","versionType","selectedVersionTypeId","aggregateVersions","getAllVersions","distinctVersionTypes","Set","aggregateVersion","sort","displayedVersions","btnText","substring","showStatus","onChange","handleCategoryClick","parseInt","Tabs","role","createdDate","handleVersionSelection","CircleButton","PencilSVG","continueWithVersionChange","withEdit","WrappedComponent","isEmbeddedEdit","WithEdit","Component","getInitialState","getTooltipsForEntity","tooltipRequestToken","hasTooltipError","then","tooltipData","entityTypeId","loadTooltipDataPromise","loadPromise","redirectToAccessDeniedOn403","Promise","all","responses","tooltipResponse","rest","cultureId","__CultureId","currentCulture","primaryCulture","scope","redirectTo404","cb","onSaveCallbacks","setTimeout","Object","keys","forEach","onSaveCallbackKey","handler","formValuesTransformHandlers","formApi","parentId","entries","syncValidationState","reduce","res","fieldState","getFieldState","errorFields","errors","result","element","concat","window","scrollTo","FORM_ERROR","nextSubmissionContinues","nextSubmissionType","nextSubmissionTime","isMoment","validationError","newValues","headers","toJSON","callPostSaveCallbacks","post","Error","isMounted","formValidationState","getValidationErrorSource","path","baseEditRoute","continueWithHistory","isBulkEdit","currentPathWithQuery","document","resolve","previousVersions","pendingVersions","scheduledVersions","currentVersionStatus","currVersionNo","nextVersionNo","ver","now","utc","a","b","queryString","URLSearchParams","HistoryIdParam","actVersion","getVersionById","allVersions","foundVersion","fieldSuggestionMap","fieldSuggestions","culture","display","editingId","fallbackCulture","cultures","isFallback","getLastLocation","None","currentPathAndQuery","prevPathAndQuery","Provider","reset","registerOnBeforeSaveCallback","setFieldSuggestions","setCulture","setScopeFieldEnabled","setRedirectCulture","setCurrentScope","setOriginalScope","setScopeChanged","registerFormValuesTransformHandler","wrappedComponentName","DefaultPopoverStatusOnListing","time","ListingStatusDisplay","popoverContainer","shouldComponentUpdate","nextProps","nextState","renderIcons","uniqueKey","popoverUniqueKey","popoverTarget","slugify","statusInfoOverrideOnListing","supportedSchemes","IsAbsoluteUrl","uri","prefixes","startsWith","startsWithAny","FormatUrlInternal","keepTrailingSlash","keepUnderscore","p","RegExp","split","join","cleanedUrl","toString","exec","isMatch","extensionAndQuery","toLowerCase","c","charAt","indexOf","endsWith","slice","FormatUrl","FormatUrlKeepTrailingSlash","FormatUrlKeepUnderscore","RangedValueDelimiter","MultipleValueDelimiter","ValueLabelDelimiter","HierarchyDelimiter","NullValue","NotNullValue","NullValueLabel","NotNullValueLabel","MultipleDateRangePresets","Today","ignoreTimezone","fromValue","timeZoneLessLocalMoment","startOf","toValue","endOf","preset","axisPrecision","Yesterday","subtract","WTD","LastWeek","MTD","LastMonth","Last60Days","Last90Days","YTD","LastYear","AllTime","getFriendlyDateRangePresetValueForDisplay","fromTime","toTime","SingleDateRangePresets","Channel","All","MagnifyingGlassSVG","HelpSVG","FormattedDateTime","DefaultDateTimeFormat","FormattedDate","DefaultDateFormat","input","getElementById","focus","fields","siteName","TextBox","formatOnBlur","isShared","lockTime","killLockTimer","renderButtonProps","cancelButtonColor","confirmButtonColor","setLockTimer","lockTimer","setInterval","lockTimerTick","clearInterval","getColor","exception","removalSeverity","RemovalSeverity","Normal","Warning","Danger","renderButtons","isClientHandleable","renderContentsFunc","loggingErrorId","line","i","boundRenderNoAcceptButton","renderNoAcceptButton","boundRenderTimedAcceptButton","renderTimedAcceptButton","removalException","failureReason","RemovalFailureReason","WasNotForced","renderButtonsFunc","PopoverClose","hideText","XSVG","PopoverTitle","titleText","close","renderBack","hideTitleText","AdminTabsContext","defaultFindInput","inputs","getIn","getInputs","findInput","focusOnFirstError","getAllInputs","firstInput","originalSubmit","unsubscribe","subscribe","submitErrors","afterSubmit","call","Array","prototype","forms","accumulator","isFocusableInput","wtf","useSortedCultures","CulturePickerMenu","bulkRecordsField","useField","translationsField","options","scopedCultures","unscopedCultures","scopedCultureId","siteMatch","scopedCulture","option","scopedHostCultures","hosts","some","siteCollectionSiteIds","cultureIds","siteHost","uniqueCultureIds","uniqueCultureId","splice","cultureToCompletionMap","acc","foundTranslation","bulkRecord","translations","currentRecordTranslations","translationsForCulture","MenuWrapper","menuProps","code","MenuItemStatus","completed","CultureLabel","unscopedCulture","confirmCultureChange","setConfirmCultureChange","sortedCultures","loc","useLocation","useEffect","showCulture","saveAndContinue","currentCultureLabel","LocalizeMode","AllCultures","forceEmptyLabel","clearable","newCultureId","staticData","renderMenu","style","marginTop","axios","create","withCredentials","addAccessDeniedInterceptor","interceptors","use","reject","addMultiTenantInterceptor","request","createContext","useDelayedDisplay","waitMs","setDisplay","timeout","clearTimeout","RichTextContent","htmlContent","contentProvider","dataTestId","classNameCombined","joinTrimmedStrings","provider","constructWrapperClassForProvider","dangerouslySetInnerHTML","__html","ExclamationCircleSVGAlternative","ExclamationTriangleSVGAlternative","AutoSuggestNoResultsText","TooltipWrapper","hideTooltip","tooltipText","nameValue","isTooltipEditMode","LeftChevronSVG","compare","localeCompare","AvailableFilters","currentTarget","filterKeyword","focusSearch","searchInput","current","selectedFilters","indexFilter","beginFilterChange","FilterChangeLocation","FilterList","availableFilters","filters","filteredFilters","implicit","includes","ignoreFilters","handlePopoverClose","placeholder","handleKeywordSearch","onKeyDown","which","handleFilterSelection","autoFocus","innerRef","clearFilterSearch","X","flush","filterIsIgnored","tag","classnames","active","toKebabCase","RightChevronSVG","FilterEdit","stopEditing","isEmptyValue","onFilterRemoved","selectedFilter","handleFilterSave","nullable","onFilterChange","cancelFilterChange","closeList","isEditMode","getFilterType","EditComponent","getComponent","EditComponentProps","getComponentProps","displayValidationError","handleOnChange","Filters","toggleFilterList","filterButton","filterButtonWrapper","toggleFilterChange","displayFilterList","closeFilterList","filterBeingChanged","filterChangeLocation","SelectedFilter","filterPopoverPlacement","getBaseModelSearchFilters","ignored","getFilters","getStatusSearchFilter","getUserTrackedSearchFilters","getBasicModelSearchFilters","FilterType","MultipleDateRangePreset","getScopeSearchFilter","MultipleAutoSuggest","baseUrl","nullValueLabel","ignoreStatus","getVersionableModelSearchFilters","SingleBoolean","getNameSearchFilter","MultipleText","getCodeSearchFilter","getPermanentSearchFilter","getUserSearchFilter","getNullableUserSearchFilter","getParentSearchFilter","autoSuggestBaseUrl","getExternalIdSearchFilter","ignoredDropDownValues","MultipleDropdown","dropdownValues","getDropDownValues","text","getUrlSearchFilter","getSeoSearchFilters","FilterNotSet","FilterString","stripHtml","f","dropDownValues","ViewLiveModal","href","rel","AutoSuggestMenuToggle","getToggleButtonProps","ChevronUp","ChevronDown","AutoSuggestInputActions","clearSelection","isArray","handleClear","savedFilterAlphaCompare","flattenSavedFilters","savedFilterCategories","savedFilters","EnumDropdown","enumType","addSelectOption","indicateDirty","EditResetButton","toggleResetConfirm","isConfirmOpen","resetForm","visuallyHiddenAnnouncementElement","setVisuallyHiddenAnnouncement","useCallback","announcement","firstChild","remove","visuallyHiddenAnnouncementTextElement","createElement","textContent","appendChild","spinnerColorClass","spinnerCenterClass","spinnerClass","memo","noop","findInput$$1","_state","stringWeaklyIncludes","thisString","otherString","firstCharacterToUpper","newString","toLocaleUpperCase","firstCharacterToLower","padStart","targetLength","padString","String","repeat","trim","html","tmp","innerHTML","innerText","addEllipsis","cutoff","snakeCaseToFriendly","trimString","separator","strings","RequiredFieldMarker","AutoSuggestFieldInput","expandOnClick","toggleMenu","labelElementHidden","isRequired","readOnly","suffix","isPowerUser","inputTypeOverride","contextName","getInputProps","getLabelProps","labelProps","inputProps","readOnlyDisplay","itemToString","autoSuggestInputProps","hideClearButton","htmlFor","handleOnFocus","invalid","onKeyPress","FiltersListAddButton","SingleTextFilterEdit","currentValue","trimmedValue","handleSearch","handleOnKeyDown","FilterEditRequiredValidation","BooleanFilterEdit","newValue","messageOverride","SingleNumberFilterEdit","step","sendUpdatedValue","SingleDecimalFilterEdit","SingleIntegerFilterEdit","RangedNumberFilterEdit","sm","for","handleFromValueChange","handleToValueChange","RangedDecimalFilterEdit","RangedIntegerFilterEdit","FiltersListButtonGroup","FiltersListValueButton","FiltersListCloseButton","AnyValueAutoSuggestValue","NoValueAutoSuggestValue","SelectedFilters","getValueDisplayByType","getFriendlyValueForDisplay","selectedFields","permanent","onRemoveField","containerClassNames","documentUrlKey","helpUrl","documentUrls","pluralName","AutoSuggestBase","errorStatus","AutoSuggestInput","labelVisible","getClassByStatus","AutoSuggestMenuItem","currentLocation","LastLocationProvider","EditRequestSource","AutoSuggestService","suggestSlugOverride","suggestSlug","query","ignoredIds","records","isNewValue","editRequestSource","Suggest","AutoSuggestData","getResultsDebounced","createNewValueObject","createFromUserInput","newAutoSuggestValue","createNewValueAutoSuggestObject","selectedItemIds","ids","getOptions","debounce","getResults","refreshDataDebounced","_","createValue","emProps","CurrencyTextBox","Input","Loadable","loader","loading","Loading","FormDropdown","useForm","lockSingleValueSelection","singleValueLocked","setSingleValueLocked","change","FieldLabel","ValidationMessages","months","MonthDropdown","month","paddedNumber","showMonthNames","NumberTextBox","PasswordTextBox","TextArea","rows","TextList","serverSetting","lines","JSON","parse","stringify","newLines","updateValue","updateRow","inputName","onRowChange","deleteRow","addRow","Toggle","isConfirmationOpen","defaultValue","confirmationMessage","checked","icons","YearDropdown","startYear","numberOfYears","Date","getFullYear","entityDefinitions","registerEntityDefinition","warningMessage","getEntityDefinitions","getEntityDefinitionsByBaseAjaxUrl","currentEntityDefinition","customExportKey","exportOptions","typeKey","getEntityDefinitionsByBaseRoute","importableEntityDefinitionPromise","exportableEntityDefinitionPromise","mappedImportableEntityDefinitionsCache","mappedExportableEntityDefinitionsCache","getMappedImportableEntityDefinitions","indexByFn","cacheKey","importableTypes","getImportableEntityDefinitions","entityDefinitionsByBaseAjaxUrl","importableEntityDefinitions","importableType","importTypes","indexRoute","getMappedExportableEntityDefinitions","exportableTypes","getExportableEntityDefinitions","exportableEntityDefinitions","exportableType","exportTypes","tooltipPromises","setTooltipPromiseByKey","clearTooltipCache","errorCallback","cachedPromise","extraTooltipKeys","anyDefinition","attributeCode","catch","parentBaseAjaxRoute","permissions","authorizedBaseRoutes","hasListPermission","hasCreateEditPermission","hasAnyListPermission","hasAnyCreateEditPermission","hasAnyEditPermission","getEditRouteByEntitySingularName","keysWithSingularName","ConditionOperator","Condition","operator","condition","arrayValue","EqualTo","NotEqualTo","GreaterThan","GreaterThanOrEqualTo","LessThan","LessThanOrEqualTo","Contains","ContainsSuggestionLabel","DefaultSuggestedValue","suggestedValue","applySuggestedValue","subTitle","sleep","ms","validationErrorCallback","genericErrorCallback","globalErrors","__isClientHandleable","errorsWithModifiedArrayIndex","newValidationState","unflatten","validationStateWithError","validationState","validationKeys","redirectErrorIndex","RedirectModal","getEnumKeyByValue","t","TimePickerItem","TimePicker","selectedHour","onTimeChange","clone","tz","settings","timeZone","meridiem","hour","minute","DefaultMinutes","selectedMinute","DefaultHour","selectedMeridiem","newDate","timeIncrement","MinutesPerHour","availableTimes","valueDate","isValid","currentHour","handleHourUpdate","handleMinuteUpdate","availableTime","handleMeridiemUpdate","SingleDatePicker","DateTimePicker","date","onDateTimeChange","focused","dateTime","localizedDate","fallback","showDefaultInputIcon","small","onDateChange","onFocusChange","singleDatePickerShape","showAllMinutes","clearDateTime","WhenFieldChanges","becomes","set","requireUserConfirmation","renderSuggestedValue","fieldValue","highlightTab","parentTab","Tooltip","offset","triggerRef","useRef","useTooltipTriggerState","delay","triggerProps","tooltipProps","useTooltipTrigger","tooltipElementProps","useTooltip","overlayRef","overlayProps","useOverlay","onClose","shouldCloseOnBlur","isDismissable","isKeyboardDismissDisabled","positionProps","useOverlayPosition","targetRef","cloneElement","mergeProps","api","__esModule","default","module","exports","locals","PlugSVG","PageNotFound","option1Text404","option2Text404","option1Link404","option2Link404","text404","TooltipPopover","ScopeFieldInclude","ScopeFieldMenu","siteResults","resultsItem","siteCollectionResults","include","mergedSitesAndCollections","SitesOnly","SiteCollectionsOnly","siteCollection","TooltipEditOverlay","isTypeSpecific","fieldTooltip","universalTooltip","localText","globalText","isUniversal","oldEntityTypeId","saveError","resetState","fromConstructor","wasOpened","onOpened","onClosed","ModalClose","filedProps","onIsTypeSpecificChange","TooltipEditButton","PureComponent","FragmentSupportingSwitch","flattenedChildren","flatten","child","apply","Switch","getMessage","ListingDisplayMode","ListingContainer","filtersByCategory","filterCategory","savedFilter","appliedSavedFilter","appliedSavedFilterId","refreshData","getSavedFilters","refresh","refreshSavedFiltersPromise","refreshing","savedFilterCategory","categories","categoryId","getSearchQueryFromSavedFilter","searchQuery","pendingSearchQuery","page","applySavedFilter","existingRecordIndex","selection","r","setRecordSelection","existingRecordSelected","isAlertOpen","alertMessage","maxSelections","maximumSelectionCount","listingDisplayMode","SelectionModal","count","openAlert","recordIds","getSelectionCount","onRecordsSelectedChanged","fullPageSelection","setStateAsync","forceUpdateFromQueryString","poppedFromHistory","sortBy","customSorting","serverQueryString","clientQueryString","savedFilterIdFromQueryString","getParsedQueryString","savedFilterId","refreshDataCancelToken","savedFiltersResponse","filterMatch","savedFilterSearch","implicitFilters","getSearchQueryFromQueryString","hideSearch","q","addCustomSortQuery","customSortingEnabled","getQueryStringFromSearchQuery","QueryStringTarget","Server","Client","ListingPage","pageSize","sortDirection","totalRecords","handlePageChange","executePageChange","isFirstQuery","pageChangeAlert","resultsCount","hasFilter","selectionCount","resultsMessage","pageTitleOverride","pendingPageChange","basicSearch","executeSearch","previousStateSelectedFilters","nameField","confirm","items","filterIndex","itemToUpdate","existingFilter","addOrUpdateFilter","removeFilter","sourceIndex","destinationIndex","newSortOrder","newRecords","reorderArrayValues","uniqueId","uuid","sortOrderUpdateUrl","sortOrder","isHierarchy","parentFilter","getRootParentSelectedFilter","SortByDirection","Ascending","totalPages","basicSearchFields","sortBys","parentRecords","appliedSortBy","Descending","toggleRecordSelection","setFullPageSelection","cancelAddFilter","resetFilters","toggleDisplay","toggleSavedFilterDisplay","beginEditAppliedSavedFilter","deleteSavedFilter","onDragDropSortOrderUpdate","setCustomSorting","handleBasicSearchChange","resetSearch","handleDelete","setSearchSortBy","stopListeningToHistory","listen","historyLocation","selectedRecords","bulkRecords","closeAlert","minimumSelectionCount","SingleDropDownFilterEdit","selectValue","availableEnumValues","enumValue","enumValues","SingleValueFilterProvider","isGenericEmptyValue","FancyRadioButtons","check","ValueToggleType","valueToggleOptions","Specific","Any","MultipleTextFilterEdit","addValue","getValuesFromProps","val","addCurrentValue","fieldIndex","selectedName","selectedValueToggle","filterActionClass","isDisabled","handleValueToggleChange","handleAddNoValueFilter","removeValue","filterByAnyValue","MultipleDropDownFilterEdit","filterOptions","dropdownValue","MultipleValueFilterProvider","friendlyNames","obj","ind","arr","RangedValueFieldProvider","SingleAutoSuggestFilterEdit","selectedValue","AutoSuggestSingle","MultipleAutoSuggestFilterEdit","existingIds","singleValue","getValidAutoSuggestValueFromQueryString","DateRangePicker","MultipleDateRangePresetFilterEdit","currentValueDateRange","customFromValue","customToValue","presetFn","isEmpty","isUnique","focusedInput","availableDateRanges","presetValue","showClearDates","startDateId","startDate","endDateId","endDate","isOutsideRange","minimumNights","displayFormat","onDatesChange","MultipleRangePresetProvider","rangedPresetValues","presets","getPresets","rangeOrPreset","parsedValue","isValidRangePresetValue","presetResult","rangedPresetValue","SingleDateFilterEdit","isFocused","showPastDates","showFutureDates","dateParams","onSelectChange","showClearDate","focusOnChange","day","isInclusivelyBeforeDay","SingleDateRangePresetFilterEdit","types","SingleText","SingleInteger","SingleDecimal","RangedInteger","RangedDecimal","SingleAutoSuggest","getFriendlyValueForSingle","autoSuggestPairs","pair","SingleDropdown","fromValueValid","toValueValid","SingleDateRangePreset","SingleDate","requestedType","getQueryStringComponentForFilter","encodeURIComponent","getQueryStringValueForFilter","getQueryStringFromValue","getValidatedFilters","filterParams","definedFilters","initialFilters","param","getValueFromQueryString","implicitFilterNames","implicitFilter","parsedQueryString","getSearchQueryFromQueryStringWithFlatFilters","ignoreKeys","filtersObject","resultsQuery","getQueryStringForFilters","customMessage","GetMessageByType","ToastClose","toastifyOptionDefaults","hideProgressBar","closeButton","toastBase","toastInfo","toastWarning","ExclamationCircleSVG","useScopedSiteHost","GetSiteHost","GetDefaultSiteHost","scopeId","GetHostForSite","GetSiteHosts","GetHostsForSite","GetSiteHostsWithIds","GetHostsForSiteWithIds","GetSiteHostCultures","GetCulturesForSite","HasSiteWithAmbiguousHost","defaultSite","isDefault","h","host","port","subdirectory","v","hostId","hostUrl","siteCollectionId","EditViewLive","setIsOpen","disableView","canPublishBeScheduledOverride","canInactivationBeScheduledOverride","canDeletionBeScheduledOverride","canSaveAsInactiveOverride","parentBaseAjaxUrl","revenueReportAjaxRoute","getCode","createRouteSlug","editRouteSlug","viewRouteSlug","setFilterToImplicit","shownOnRedirect","getParentFilter","initializeServerSideProperties","init","metadata","dynamicEntityMetadata","entityDefinitionMap","hideExport","isExportable","hideDownload","isDownloadable","hideCultureColumn","isTranslatable","SingleCulture","isScoped","isSoftDeletable","isVersionable","isSeoModel","automaticMetadataFiltersEnabled","addDedupedFilters","isPermanentModel","addDedupedFilter","isNamedModel","isUniqueCodeModel","isCodeModel","isUserTrackedModel","isUserModel","isNullableUserModel","isExternalModel","newFilters","newFilter","assign","fancyModalSVGClass","combinedClass","Consumer","Alert","overflowVisible","Success","MODE_NUMBER","MODE_ALPHA_NUM","MODE_8BIT_BYTE","MODE_KANJI","L","M","Q","H","math","QRPolynomial","num","shift","getLength","multiply","j","gexp","glog","mod","ratio","QRMath","n","LOG_TABLE","EXP_TABLE","RecoveryCodes","setIsLoading","setError","recoveryCodes","setRecoveryCodes","generate","resp","onCancelClick","DownChevronSVG","LightningSVG","SharedSVG","UpChevronSVG","sharedContainerRef","titleContainerRef","displayFallbackValue","dto","subLabel","labelClassName","translatedFieldName","fallbackValueDisplayMode","FallbackValueDisplayMode","Inline","fallbackValueOverride","translatedFieldValue","Hidden","EnableDuoButton","setActivated","_typeof","Symbol","iterator","_extends","arguments","hasOwnProperty","_objectSpread","ownKeys","getOwnPropertySymbols","sym","getOwnPropertyDescriptor","enumerable","_defineProperty","_objectWithoutProperties","excluded","sourceKeys","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","_classCallCheck","instance","Constructor","TypeError","_defineProperties","descriptor","configurable","writable","defineProperty","_createClass","protoProps","staticProps","_possibleConstructorReturn","self","_assertThisInitialized","_getPrototypeOf","o","setPrototypeOf","getPrototypeOf","__proto__","_inherits","subClass","superClass","_setPrototypeOf","ReferenceError","PropTypes","QRCodeImpl","ErrorCorrectLevel","convertStr","str","out","charcode","charCodeAt","fromCharCode","DEFAULT_PROPS","level","bgColor","fgColor","includeMargin","PROP_TYPES","string","number","oneOf","bool","generatePath","modules","margin","ops","row","y","start","cell","x","SUPPORTS_PATH2D","Path2D","addPath","QRCodeCanvas","_React$PureComponent","_getPrototypeOf2","_this","_len","args","_key","update","_this$props","qrcode","addData","make","_canvas","canvas","ctx","getContext","cells","numCells","pixelRatio","devicePixelRatio","height","width","scale","fillStyle","fillRect","rdx","cdx","_this2","_this$props2","otherProps","canvasStyle","_ref","QRCodeSVG","_React$PureComponent2","_this$props3","fgPath","shapeRendering","QRCode","renderAs","CodeEntryForm","authenticatorValues","EnableAuthenticator","setAuthenticatorValues","authenticatorUri","sharedKey","statusMessage","generateCodes","EnableTotpAuthenticator","showEnableAuthenticator","setShowEnableAuthenticator","showRecoveryCodes","setShowRecoveryCodes","showAddAuthenticator","setShowAddAuthenticator","onFinished","retry","timedOut","pastDelay","systemUserName","AutoSuggestSingleField","setValueMapping","renderInput","BitByte","RSBlock","BitBuffer","util","Polynomial","typeNumber","errorCorrectLevel","moduleCount","dataCache","dataList","proto","newData","isDark","col","getModuleCount","rsBlocks","getRSBlocks","buffer","totalDataCount","dataCount","put","mode","getLengthInBits","write","makeImpl","getBestMaskPattern","test","maskPattern","setupPositionProbePattern","setupPositionAdjustPattern","setupTimingPattern","setupTypeInfo","setupTypeNumber","createData","mapData","minLostPoint","pattern","lostPoint","getLostPoint","createMovieClip","target_mc","instance_name","depth","qr_mc","createEmptyMovieClip","beginFill","moveTo","lineTo","endFill","pos","getPatternPosition","bits","getBCHTypeNumber","Math","floor","getBCHTypeInfo","inc","bitIndex","byteIndex","dark","getMask","PAD0","PAD1","putBit","createBytes","maxDcCount","maxEcCount","dcdata","ecdata","dcCount","ecCount","totalCount","max","rsPoly","getErrorCorrectPolynomial","modPoly","modIndex","totalCodeCount","QR8bitByte","ECL","QRRSBlock","RS_BLOCK_TABLE","rsBlock","getRsBlockTable","list","QRBitBuffer","bufIndex","bit","Mode","QRMaskPattern","QRUtil","PATTERN_POSITION_TABLE","G15","G18","G15_MASK","getBCHDigit","digit","errorCorrectLength","qrCode","sameCount","darkCount","abs","AutoSuggestOptionsError","assertValidAutoSuggestOptions","hasStaticDataOption","startIndex","endIndex","from","removed","getErrorArray","errorOrSubmitError","setValidationError","touched","Fragment","FieldSubtext","min","cols","subtext","showTranslationPlaceholder","aria-describedby","DefaultTimeFormat","inp","TabsCategory","TabsCategoryItem","tabIndex","TabsList","striped","responsive","TabsListActions","TabsListActionsItem","TabsListEmpty","TabsListItem","TabsListItemName","TabsListRow","staticFallbackCulture","staticFallbackLabel","translatedFieldPrefix","translatedFieldNameOverride","primaryCultureObj","singleCultureDisplayed","useStaticCulture","unshift","fieldPrefix","fieldOverride","fieldHidden","isStaticFallback","isPrimary","fieldIsRequired","fieldAutoFocus","labelValue","translationValue","defaultFontSize","parent","temp","cssText","createTextNode","fontSize","offsetHeight","removeChild","getDefaultFontSize","Breakpoints","VisuallyHiddenAnnouncementTrigger","setAlert","mainRef","VisuallyHiddenAnnouncementContext","alert","setMainRef","aria-live","aria-atomic","focusOnErrors","Login","showLoginButtonLoading","announcementText","forceRedirect","success","promise","username","password","exact","activeClassName","ForgotPassword","loginMessage","searchParams","has","Lockout","SimpleCheckBox","LoginTwoFactor","LoginRecovery","ResetPassword","redirectToAdmin","redirectToLicenseRegistration","DuoError","RegistrationEnvironment","totpSetupActive","setTotpSetupActive","duoSetupActive","setDuoSetupActive","is2faUiActive","twoFactorData","__ROC_TWO_FACTOR_DATA__","twoFactorRequired","duoSecurityEnabled","duoSecurityForLdapOnly","isLdapUser","shouldShowRegistrationPage","hideDuo","registrationWarnings","setRegistrationWarnings","registerData","__ROC_INSTALLATION_DATA__","canSkipRegistration","hasKey","singleError","routes","RoutesModule","browserHistory","createBrowserHistory","LoginApp","ReactDOM","left","right","getElemDistance","elem","offsetParent","offsetTop","isOutOfViewport","bounding","getBoundingClientRect","top","bottom","innerHeight","documentElement","clientHeight","innerWidth","clientWidth","any","isValidGuid","hasNewLine","clearInputValueAfterSelection","onSelect","handleSelect","dataProps","AutoSuggestStaticMenu","filteredResults","autoSuggestItem","clearSelectionAfterSelection","initialContext","__ROC_PRELOADED_STATE__","ExclamationTriangleSVG"],"mappings":"8FAAO,IAAKA,EAAZ,kC,SAAYA,K,sBAAAA,E,oBAAAA,E,kBAAAA,E,cAAAA,E,qBAAAA,M,uCCAZ,oBAMA,SAASC,EAAcC,GACtB,OACC,yBACCC,QAAQ,YACRC,UAAW,yBAA2BF,EAAMG,MAC5CC,UAAU,QACVC,cAAY,QAEZ,0BAAMC,EAAE,o1EAKXP,EAAcQ,aAAe,CAC5BJ,MAAO,IAGOJ,O,0ZCEf,MAAMS,UAAwBC,YAA4D,gDAI/D,GAJ+D,2BAY7DC,UAC3B,MAAM,cAAEC,GAAkBC,KAAKZ,MAE/BY,KAAKC,SAAS,CACbC,UAAU,IAGX,UACOH,IACL,MAAOI,GACR,IAAKH,KAAKI,QACT,OAGD,MAAMC,EAAYC,YAA+BH,GAEjDH,KAAKC,SAAS,CACbC,UAAU,EACVK,aAAcF,EAAS,WAKnBG,oBACNR,KAAKI,SAAU,EAGTK,uBACNT,KAAKI,SAAU,EAGTM,SACN,MACCC,MAAM,QAAEC,EAAF,QAAWC,EAAX,UAAoBC,GADrB,OAELC,GACGf,KAAKZ,OAEH,eACL4B,EACAC,WAAW,aAAEC,EAAF,aAAgBC,EAAhB,WAA8BC,EAA9B,iBAA0CC,GACrDC,oBAAoB,eAAEC,IACnBvB,KAAKwB,QAMHC,EAAiBzB,KAAKwB,QAAQP,UAA8DQ,cAClG,IAAIC,GAA4B,EAE5BN,GAAcK,GAAiBA,EAAcE,OAAS,IACzDD,EACCD,EAAcG,UACZC,GAAiBA,EAAaC,MAAMC,sBAAwBX,EAAWW,sBACpE,GAIP,MAAMC,EACLpB,GACAQ,GACAR,EAAQqB,MAAOC,GAA0BA,EAAKJ,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AKvpB,EAAZ,kC,SAAYA,K,sBAAAA,E,yBAAAA,M,sCCNZ,WAeeh8B,IARf,SAAmBzZ,GAClB,OACC,uBAAK9D,QAAQ,YAAYC,UAAW,kBAAoB6D,EAAS5D,MAAOC,UAAU,QAAQC,cAAY,QACrG,wBAAMC,EAAE,wQ,gCCVX,WAOA,SAAS2iE,EAAuBl/D,GAC/B,OACC,uBACC9D,QAAQ,YACRC,UAAW,kCAAoC6D,EAAS5D,MACxDC,UAAU,QACVC,cAAY,QAEZ,wBAAMC,EAAE,gwBAKX2iE,EAAuB1iE,aAAe,CAAEJ,MAAO,IAEhC8iE,O,gCCtBf,kBAgBA,MAAM73C,UAAgB3qB,YACrByN,YAAYlO,GACXmO,MAAMnO,GAGAsB,SACN,OACC,gBAAC,IAAD,CAAOkE,MAAM,WACZ,qCACC5E,KAAKZ,MAAMkG,UAMDklB,O,gCC/Bf,WAQA,SAASxR,EAAc7V,GACtB,OACC,uBAAK9D,QAAQ,YAAYC,UAAW,qBAAuB6D,EAAS5D,MAAOC,UAAU,QAAQC,cAAY,QACxG,wBAAMC,EAAE,wzDAKXsZ,EAAcrZ,aAAe,CAAEJ,MAAO,IAEvByZ,Q","file":"login.js","sourcesContent":["export enum ModelStatus {\r\n\tPublished = 'Published',\r\n\tInactive = 'Inactive',\r\n\tDeleted = 'Deleted',\r\n\tDraft = 'Draft',\r\n\tArchived = 'Archived',\r\n}\r\n","import React from 'react';\r\n\r\ninterface ArrowLeaveSVGProps {\r\n\tclass: string;\r\n}\r\n\r\nfunction ArrowLeaveSVG(props: ArrowLeaveSVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 37 32\"\r\n\t\t\tclassName={'icon icon-arrow-leave ' + props.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t>\r\n\t\t\t<path d=\"M29.23 19.338v6.665c0 0.025 0.001 0.055 0.001 0.085 0 1.628-0.672 3.099-1.754 4.151l-0.001 0.001c-0.858 1.096-2.18 1.793-3.665 1.793-0.197 0-0.392-0.012-0.583-0.036l0.023 0.002h-17.273c-0.025 0-0.056 0.001-0.086 0.001-1.625 0-3.092-0.674-4.138-1.758l-0.002-0.002c-1.093-0.864-1.789-2.19-1.789-3.678 0-0.197 0.012-0.392 0.036-0.582l-0.002 0.023v-17.329c-0-0.026-0.001-0.057-0.001-0.087 0-1.628 0.672-3.099 1.754-4.151l0.001-0.001c0.858-1.095 2.181-1.793 3.666-1.793 0.197 0 0.391 0.012 0.582 0.036l-0.023-0.002h14.615c0.007-0 0.015-0 0.024-0 0.177 0 0.337 0.071 0.454 0.187l-0-0c0.117 0.098 0.191 0.244 0.191 0.407 0 0.026-0.002 0.051-0.005 0.075l0-0.003v1.333c0 0.007 0 0.015 0 0.023 0 0.178-0.071 0.339-0.187 0.456l0-0c-0.097 0.117-0.242 0.191-0.405 0.191-0.026 0-0.051-0.002-0.075-0.005l0.003 0h-14.615c-0.013-0-0.029-0-0.045-0-0.904 0-1.72 0.376-2.3 0.979l-0.001 0.001c-0.608 0.48-0.994 1.216-0.994 2.043 0 0.11 0.007 0.218 0.020 0.324l-0.001-0.013v17.329c-0 0.014-0 0.031-0 0.047 0 0.905 0.374 1.722 0.975 2.306l0.001 0.001c0.476 0.609 1.211 0.997 2.036 0.997 0.109 0 0.217-0.007 0.323-0.020l-0.013 0.001h17.273c0.014 0 0.030 0 0.046 0 0.903 0 1.718-0.375 2.299-0.977l0.001-0.001c0.608-0.48 0.994-1.216 0.994-2.043 0-0.11-0.007-0.218-0.020-0.324l0.001 0.013v-6.663c-0-0.007-0-0.015-0-0.023 0-0.178 0.071-0.339 0.187-0.456l-0 0c0.097-0.117 0.242-0.191 0.405-0.191 0.026 0 0.051 0.002 0.075 0.005l-0.003-0h1.329c0.007-0 0.015-0 0.023-0 0.177 0 0.338 0.071 0.454 0.187l-0-0c0.117 0.098 0.191 0.244 0.191 0.407 0 0.026-0.002 0.051-0.005 0.075l0-0.003zM37.201 1.342v10.665c0 0.003 0 0.007 0 0.011 0 0.364-0.151 0.692-0.394 0.925l-0 0c-0.237 0.241-0.566 0.391-0.93 0.391s-0.694-0.15-0.93-0.391l-0-0-3.653-3.665-13.536 13.581c-0.12 0.127-0.289 0.207-0.477 0.207v0c-0.016 0.002-0.035 0.003-0.054 0.003-0.172 0-0.325-0.082-0.423-0.208l-0.001-0.001-2.367-2.375c-0.127-0.12-0.207-0.291-0.207-0.479 0-0 0-0 0-0v0c-0.002-0.016-0.003-0.035-0.003-0.055 0-0.172 0.082-0.326 0.208-0.424l0.001-0.001 13.536-13.579-3.653-3.665c-0.244-0.234-0.395-0.562-0.395-0.926 0-0.004 0-0.009 0-0.013v0.001c-0.004-0.036-0.007-0.077-0.007-0.119 0-0.332 0.156-0.627 0.399-0.816l0.002-0.002c0.191-0.246 0.487-0.403 0.819-0.403 0.041 0 0.081 0.002 0.12 0.007l-0.005-0h10.629c0.003-0 0.008-0 0.012-0 0.363 0 0.69 0.151 0.922 0.394l0 0.001c0.245 0.191 0.402 0.486 0.402 0.818 0 0.042-0.002 0.083-0.007 0.123l0-0.005z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nArrowLeaveSVG.defaultProps = {\r\n\tclass: '',\r\n};\r\n\r\nexport default ArrowLeaveSVG;\r\n","import Octicon, { Plus } from '@githubprimer/octicons-react';\r\nimport * as React from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\nimport { handleAxiosErrorWithValidation } from 'util/Misc';\r\nimport AutoSuggestContext, { AutoSuggestContextValue } from './AutoSuggestContext';\r\nimport { AutoSuggestDataRenderProps } from './AutoSuggestData';\r\nimport AutoSuggestNoResultsText from './AutoSuggestNoResultsText';\r\nimport { AutoSuggestItem, MultiControllerStateAndHelpers } from './Types';\r\n\r\nexport interface AutoSuggestMenuProps extends WithTestIdOptional {\r\n\tdata: AutoSuggestDataRenderProps;\r\n\tonCreateClick: () => Promise<void>;\r\n}\r\n\r\ninterface AutoSuggestMenuState {\r\n\thasError?: boolean;\r\n\terrorMessage?: string;\r\n}\r\n\r\n/**\r\n * Renders the list of results from the AutoSuggest server call.\r\n *\r\n * @class AutoSuggestMenu\r\n * @extends {React.Component<AutoSuggestMenuProps>}\r\n */\r\nclass AutoSuggestMenu extends React.Component<AutoSuggestMenuProps, AutoSuggestMenuState> {\r\n\tpublic static contextType: React.Context<any> = AutoSuggestContext;\r\n\tpublic declare context: AutoSuggestContextValue;\r\n\r\n\tpublic mounted: boolean = false;\r\n\r\n\t/**\r\n\t * Local click handlers to handle possible errors from the server.\r\n\t *\r\n\t * @private\r\n\t * @memberof AutoSuggestBase\r\n\t */\r\n\tprivate handleCreateClick = async (): Promise<void> => {\r\n\t\tconst { onCreateClick } = this.props;\r\n\r\n\t\tthis.setState({\r\n\t\t\thasError: false,\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\tawait onCreateClick();\r\n\t\t} catch (error) {\r\n\t\t\tif (!this.mounted) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst errorInfo = handleAxiosErrorWithValidation(error);\r\n\r\n\t\t\tthis.setState({\r\n\t\t\t\thasError: true,\r\n\t\t\t\terrorMessage: errorInfo['value'],\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tpublic componentDidMount() {\r\n\t\tthis.mounted = true;\r\n\t}\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\tthis.mounted = false;\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tdata: { results, hasMore, isLoading },\r\n\t\t\ttestId,\r\n\t\t} = this.props;\r\n\r\n\t\tconst {\r\n\t\t\trenderMenuItem,\r\n\t\t\tdownshift: { getMenuProps, getItemProps, inputValue, highlightedIndex },\r\n\t\t\tautoSuggestOptions: { allowNewValues },\r\n\t\t} = this.context;\r\n\r\n\t\t// unfortunately we need to cast here as we can't statically determine if we're doing single vs multiple.\r\n\t\t// this check is used to avoid a scenario where you have multiple values, and you've already selected for example\r\n\t\t// value \"Test\" - if there are no results (because you've already selected it), without this check it'll try\r\n\t\t// to create \"Test\" again, rather than just tell you there are no results.\r\n\t\tconst selectedItems = (this.context.downshift as MultiControllerStateAndHelpers<AutoSuggestItem>).selectedItems;\r\n\t\tlet inputValueAlreadySelected = false;\r\n\r\n\t\tif (inputValue && selectedItems && selectedItems.length > 0) {\r\n\t\t\tinputValueAlreadySelected =\r\n\t\t\t\tselectedItems.findIndex(\r\n\t\t\t\t\t(selectedItem) => selectedItem.label.toLocaleLowerCase() === inputValue.toLocaleLowerCase(),\r\n\t\t\t\t) > -1;\r\n\t\t}\r\n\r\n\t\t// allow users to create values as long as none of the new results match exactly\r\n\t\tconst inputValueNotInResults =\r\n\t\t\tresults &&\r\n\t\t\tinputValue &&\r\n\t\t\tresults.every((item: AutoSuggestItem) => item.label.toLocaleLowerCase() !== inputValue.toLocaleLowerCase());\r\n\r\n\t\tconst displayCreateItem = !isLoading && allowNewValues && inputValueNotInResults && !inputValueAlreadySelected;\r\n\t\tconst hasError = this.state && this.state.hasError;\r\n\t\tconst displayChangeCultureMessage = this.context.autoSuggestOptions.displayChangeCultureMessage;\r\n\r\n\t\treturn (\r\n\t\t\t<div className=\"autosuggest-menu\">\r\n\t\t\t\t<ul\r\n\t\t\t\t\tclassName=\"dropdown-menu autosuggest-menu__list\"\r\n\t\t\t\t\t{...getMenuProps({\r\n\t\t\t\t\t\topen: true,\r\n\t\t\t\t\t})}\r\n\t\t\t\t>\r\n\t\t\t\t\t{hasError ? (\r\n\t\t\t\t\t\t<li className=\"autosuggest-menu__item autosuggest-menu__item--error\">\r\n\t\t\t\t\t\t\tError: {this.state.errorMessage}\r\n\t\t\t\t\t\t</li>\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t{results &&\r\n\t\t\t\t\t\tresults.map((item: AutoSuggestItem, index) => (\r\n\t\t\t\t\t\t\t// tslint:disable-next-line: jsx-key\r\n\t\t\t\t\t\t\t<li\r\n\t\t\t\t\t\t\t\tkey={index}\r\n\t\t\t\t\t\t\t\tclassName={\r\n\t\t\t\t\t\t\t\t\thighlightedIndex === index\r\n\t\t\t\t\t\t\t\t\t\t? 'autosuggest-menu__item autosuggest-menu__item--highlighted'\r\n\t\t\t\t\t\t\t\t\t\t: 'autosuggest-menu__item'\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t{...getItemProps({\r\n\t\t\t\t\t\t\t\t\titem,\r\n\t\t\t\t\t\t\t\t\tindex,\r\n\t\t\t\t\t\t\t\t\tkey: `${item.value}-${index}`,\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\tdata-testid={testId ? `${testId}-result-${index}` : `autosuggest-result-${index}`}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{renderMenuItem({ item })}\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t{isLoading ? <li className=\"autosuggest-menu__item\">Loading...</li> : null}\r\n\t\t\t\t\t{!isLoading && hasMore ? (\r\n\t\t\t\t\t\t<li className=\"autosuggest-menu__item\">\r\n\t\t\t\t\t\t\t<em>More results available. Enter keyword to search...</em>\r\n\t\t\t\t\t\t</li>\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t{!isLoading && results && results.length === 0 ? (\r\n\t\t\t\t\t\t<li className=\"autosuggest-menu__item\">\r\n\t\t\t\t\t\t\t<AutoSuggestNoResultsText inputValue={inputValue} />\r\n\t\t\t\t\t\t</li>\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t{displayCreateItem && !hasError ? (\r\n\t\t\t\t\t\t!displayChangeCultureMessage ? (\r\n\t\t\t\t\t\t\t<li className=\"autosuggest-menu__item\" onClick={this.handleCreateClick}>\r\n\t\t\t\t\t\t\t\t<em>\r\n\t\t\t\t\t\t\t\t\t<Octicon icon={Plus} ariaLabel=\"Plus sign\" /> Create &quot;{inputValue}&quot;\r\n\t\t\t\t\t\t\t\t</em>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t<li className=\"autosuggest-menu__item\">\r\n\t\t\t\t\t\t\t\t<em>Switch to primary language to create new attribute values</em>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t)\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t</ul>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default AutoSuggestMenu;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Garbage Can SVG\r\n *\r\n * @returns\r\n */\r\nfunction GarbageCanCircleSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 32 32\"\r\n\t\t\tclassName={'icon icon-garbage-circle ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t\tdata-testid={svgProps.testId}\r\n\t\t>\r\n\t\t\t<path\r\n\t\t\t\tfill=\"#d9534f\"\r\n\t\t\t\td=\"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16c-8.837 0-16-7.163-16-16v0c0-8.837 7.163-16 16-16v0z\"\r\n\t\t\t/>\r\n\t\t\t<path\r\n\t\t\t\tfill=\"#fff\"\r\n\t\t\t\td=\"M24.652 11.459c-0.005-0.239-0.199-0.43-0.439-0.43-0.006 0-0.013 0-0.019 0l0.001-0h-3.2l-0.989-2.222c-0.353-0.691-1.049-1.162-1.857-1.188l-0.004-0h-4.078c-0.816 0.028-1.517 0.497-1.872 1.177l-0.006 0.012-0.98 2.222h-3.134c-0.005-0-0.012-0-0.018-0-0.239 0-0.434 0.192-0.439 0.43v0.851c0.001 0.238 0.195 0.43 0.433 0.43 0.009 0 0.017-0 0.026-0.001l-0.001 0h1.352l0.529 9.493c-0.004 0.054-0.007 0.117-0.007 0.18 0 1.293 0.985 2.357 2.245 2.481l0.010 0.001h7.8c1.277-0.15 2.258-1.226 2.258-2.531 0-0.068-0.003-0.135-0.008-0.202l0.001 0.009 0.6-9.431h1.352c0.005 0 0.012 0 0.018 0 0.239 0 0.434-0.192 0.439-0.43v-0l-0.011-0.85zM13.867 9.472c0.061-0.069 0.142-0.12 0.235-0.143l0.003-0.001h4.029c0.093 0.029 0.173 0.078 0.238 0.143l0 0 0.677 1.557h-5.879zM20.012 23.186h-7.822c-0.281-0.216-0.46-0.552-0.46-0.93 0-0.029 0.001-0.058 0.003-0.087l-0 0.004-0.523-9.434h9.839l-0.6 9.431c0.002 0.028 0.004 0.060 0.004 0.093 0 0.373-0.174 0.705-0.445 0.92l-0.002 0.002z\"\r\n\t\t\t/>\r\n\t\t\t<path\r\n\t\t\t\tfill=\"#fff\"\r\n\t\t\t\td=\"M14.993 15.067h-0.898c-0.005-0-0.012-0-0.018-0-0.239 0-0.434 0.192-0.439 0.43v4.842c0.005 0.239 0.199 0.43 0.439 0.43 0.006 0 0.013-0 0.019-0l-0.001 0h0.898c0.005 0 0.012 0 0.018 0 0.239 0 0.434-0.192 0.439-0.43v-4.842c-0.008-0.239-0.204-0.43-0.445-0.43-0.004 0-0.009 0-0.013 0h0.001zM18.328 15.067h-0.898c-0.005-0-0.012-0-0.018-0-0.239 0-0.434 0.192-0.439 0.43v4.842c0.005 0.239 0.199 0.43 0.439 0.43 0.006 0 0.013-0 0.019-0l-0.001 0h0.898c0.005 0 0.012 0 0.018 0 0.239 0 0.434-0.192 0.439-0.43v-4.842c-0.008-0.239-0.204-0.43-0.445-0.43-0.004 0-0.009 0-0.013 0h0.001z\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nGarbageCanCircleSVG.defaultProps = { class: '' };\r\n\r\nexport default GarbageCanCircleSVG;\r\n","export const TenantKey: string = 'Tenant';\r\nexport const TenantHeaderName: string = 'X-Roc-Tenant';\r\nexport const CurrentTenantIdQueryString: string = 'tenantId';\r\n","import { TenantKey } from 'features/tenants/Constants';\r\nimport { isNullOrEmptyGuid } from '~/components/shared/Utils';\r\n\r\n/**\r\n * Get the tenant id from session or local storage.\r\n */\r\nexport const getTenantIdFromSessionOrLocalStorage = () => {\r\n\treturn sessionStorage.getItem(TenantKey) ?? localStorage.getItem(TenantKey);\r\n};\r\n\r\n/**\r\n * Sets the tenant id to the session and local storages.\r\n * Local storage is used to keep the last selected tenant so that we can use it across tabs.\r\n * Session storage is used to keep the current tenant and use it for ajax calls.\r\n */\r\nexport const setTenantIdToSessionAndLocalStorage = (tenantId: string) => {\r\n\t// Empty Guid means there is no tenant the user can access within the request.\r\n\tif (isNullOrEmptyGuid(tenantId)) {\r\n\t\treturn;\r\n\t}\r\n\r\n\tsessionStorage.setItem(TenantKey, tenantId);\r\n\tlocalStorage.setItem(TenantKey, tenantId);\r\n};\r\n","import React from 'react';\r\n\r\ninterface CheckSVGProps {\r\n\tclass: string;\r\n}\r\n\r\n/**\r\n * Check SVG\r\n *\r\n * @returns\r\n */\r\nfunction CheckSVG(props: CheckSVGProps) {\r\n\treturn (\r\n\t\t<svg viewBox=\"0 0 38 32\" className={'icon icon-check ' + props.class} focusable=\"false\" aria-hidden=\"true\">\r\n\t\t\t<path d=\"M9.67 30.659l-9.121-11.804c-2.146-5.581 2.468-7.513 5.901-4.292l5.903 7.511 18.243-20.388c3.219-3.38 8.585-1.449 6.438 3.755l-21.462 24.679c-2.307 2.683-4.292 2.146-5.902 0.537z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\n// Set default props\r\nCheckSVG.defaultProps = {\r\n\tclass: '',\r\n};\r\n\r\nexport default CheckSVG;\r\n","/**\r\n * Error code for RemovalException. See also IllegalRemovalOperationException.cs\r\n */\r\nexport const RemovalErrorCode = 'illegal_removal_operation';\r\n","import { EntityDefinition } from 'types';\r\n\r\nconst definition = new EntityDefinition({\r\n\tsingularName: 'Admin Profile',\r\n\tbaseAjaxUrl: '/profile',\r\n\tbaseRoute: '/profile',\r\n});\r\n\r\nexport default definition;\r\n","import * as React from 'react';\r\nimport { RouteComponentProps } from 'react-router-dom';\r\nimport { Button, ButtonGroup } from 'reactstrap';\r\nimport withEditContext, { HasEditContext } from './withEditContext';\r\nimport RocTitle from '../RocTitle';\r\nimport AxiosHelper from '~/services/AxiosHelper';\r\nimport { toastError, toastSuccess } from '~/components/shared/toast/Toasts';\r\nimport Axios, { AxiosError } from 'axios';\r\nimport { EntityDefinition } from '~/types';\r\nimport Octicon, { Check } from '@githubprimer/octicons-react';\r\n\r\ninterface EditCopyHtmlButtonProps extends RouteComponentProps<any>, HasEditContext {\r\n\tentityDefinition: EntityDefinition;\r\n}\r\n\r\n/**\r\n * Component for coping the html markup\r\n */\r\nfunction EditCopyHtmlButton(props: EditCopyHtmlButtonProps) {\r\n\tconst {\r\n\t\tentityDefinition: { baseAjaxRoute },\r\n\t\teditContext,\r\n\t} = props;\r\n\r\n\tconst handleClick = async () => {\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.get(`${baseAjaxRoute}/${editContext.values.id}`);\r\n\r\n\t\t\tif (!response.data.entity.body) {\r\n\t\t\t\ttoastError({ content: { message: 'There is no valid HTML markup to copy.' } });\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tnavigator.clipboard.writeText(response.data.entity.body);\r\n\t\t\ttoastSuccess({\r\n\t\t\t\tcontent: {\r\n\t\t\t\t\tmessage: `HTML markup copied to clipboard.`,\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t} catch (error) {\r\n\t\t\tif (!Axios.isCancel(error)) {\r\n\t\t\t\tconsole.log(error as AxiosError);\r\n\t\t\t}\r\n\r\n\t\t\ttoastError({ content: { message: 'HTML markup copy failed.' } });\r\n\t\t}\r\n\t};\r\n\r\n\treturn (\r\n\t\t<RocTitle label=\"Copy HTML\" alignment=\"left\">\r\n\t\t\t<div className=\"edit-form__actions-bar-item\">\r\n\t\t\t\t<ButtonGroup>\r\n\t\t\t\t\t<Button color=\"primary\" className=\"btn-medium\" onClick={handleClick} data-testid=\"copy-html-button\">\r\n\t\t\t\t\t\t<div className=\"btn-icon-text-container\">\r\n\t\t\t\t\t\t\t<span className=\"btn-icon-bg\">\r\n\t\t\t\t\t\t\t\t<Octicon icon={Check} ariaLabel=\"Checkmark\" />\r\n\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t<span className=\"btn-icon-text\">Copy Html</span>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t</ButtonGroup>\r\n\t\t\t</div>\r\n\t\t</RocTitle>\r\n\t);\r\n}\r\n\r\nexport default withEditContext(EditCopyHtmlButton);\r\n","import React, { useState, useContext } from 'react';\r\nimport { Redirect } from 'react-router-dom';\r\nimport { EditSaveButton, EditTitle, EditErrorOnSaveAlert, EditDeleteButton, EditCancelButton } from '.';\r\nimport Spinner from '../Spinner';\r\nimport { Form } from 'react-final-form';\r\nimport { EditFormProps } from '.';\r\nimport ErrorAlert from '../ErrorAlert';\r\nimport 'react-toggle/style.css';\r\nimport { Modal, ModalBody } from 'reactstrap';\r\nimport CenterSpinner from '../CenterSpinner';\r\nimport NavigationPrompt from 'react-router-navigation-prompt';\r\nimport Confirm from '../Confirm';\r\nimport AppState from 'AppState';\r\nimport { hasDeletePermission } from 'services/EntityDefinitionService';\r\nimport { createDecorator } from './decorators/focusOnErrorsCustom';\r\nimport AppContext from 'components/AppContext';\r\nimport EditContext from 'components/shared/edit/EditContext';\r\nimport ScopeField from './ScopeField';\r\nimport CulturePicker from './CulturePicker';\r\nimport arrayMutators from 'final-form-arrays';\r\nimport { ValidationErrorSource } from 'util/Misc';\r\nimport ValidationErrorAlert, { AlertType } from '~/components/shared/edit/ValidationErrorAlert';\r\nimport EditCopyHtmlButton from '~/components/shared/edit/EditCopyHtmlButton';\r\n\r\nconst focusOnErrorsCustom = createDecorator();\r\n\r\nfunction EditForm(props: EditFormProps) {\r\n\tconst [bottomActionsFocused, setBottomActionsFocused] = useState(false);\r\n\r\n\tconst { expirationAlertCountdownStarted } = useContext(AppContext);\r\n\r\n\t/**\r\n\t * Handles the focus event for adding dyanmic focus CSS class.\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingDynamicResultsTableRow\r\n\t */\r\n\tfunction handleFocusIn() {\r\n\t\tsetBottomActionsFocused(true);\r\n\t}\r\n\r\n\t/**\r\n\t * Handles the unfocus event for removing dyanmic focus CSS class.\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingDynamicResultsTableRow\r\n\t */\r\n\tfunction handleBlur() {\r\n\t\tsetBottomActionsFocused(false);\r\n\t}\r\n\r\n\t// here we're just extracting variables from the EditFormProps for easier usage\r\n\tconst {\r\n\t\tinitialValues,\r\n\t\tdecorators,\r\n\t\t// by default, subscribe to these only.\r\n\t\tsubscription = { pristine: true, dirty: true, submitError: true, dirtySinceLastSubmit: true },\r\n\t\tmutators,\r\n\t\tvalidate,\r\n\t} = props;\r\n\r\n\tconst {\r\n\t\teditSessionUniqueKey,\r\n\t\tsave,\r\n\t\tredirectPathName,\r\n\t\tredirectSearch,\r\n\t\tredirectCulture,\r\n\t\tentityDefinition,\r\n\t\tisLoading,\r\n\t\tisLoadingInitial,\r\n\t\tisSaving,\r\n\t\taxiosError,\r\n\t\tisCreateMode,\r\n\t\tscopeFieldEnabled,\r\n\t\tvalidationErrorSource,\r\n\t} = useContext(EditContext);\r\n\r\n\tconst {\r\n\t\tuser: { authorizedBaseRoutesData },\r\n\t} = AppState;\r\n\r\n\tconst formDecorators = [focusOnErrorsCustom];\r\n\r\n\tif (decorators) {\r\n\t\tformDecorators.push(...decorators);\r\n\t}\r\n\r\n\tconst isPermanent = initialValues?.isPermanent === true;\r\n\tconst isDeletable = initialValues?.isDeletable ?? true;\r\n\r\n\treturn (\r\n\t\t<Form\r\n\t\t\tkey={editSessionUniqueKey}\r\n\t\t\tonSubmit={save}\r\n\t\t\tsubscription={subscription}\r\n\t\t\tdecorators={formDecorators}\r\n\t\t\tinitialValues={initialValues}\r\n\t\t\tmutators={{ ...mutators, ...arrayMutators }}\r\n\t\t\tvalidate={validate}\r\n\t\t\trender={(formProps) => {\r\n\t\t\t\t// this portion is rendered withing the React Final Form\r\n\t\t\t\t// therefore the props we're expecting are coming from there\r\n\t\t\t\t// some of those are default, some come based on the subscriptions above\r\n\t\t\t\t// https://github.com/final-form/react-final-form#subscription-fieldsubscription\r\n\t\t\t\tconst { handleSubmit, dirty, submitError, dirtySinceLastSubmit, form } = formProps;\r\n\r\n\t\t\t\tconst localized = AppState.config.multiSiteEnabled && entityDefinition.localizeMode;\r\n\r\n\t\t\t\tconst showSeparateTitleLine =\r\n\t\t\t\t\t(!entityDefinition.hideKey &&\r\n\t\t\t\t\t\t!isCreateMode &&\r\n\t\t\t\t\t\t!entityDefinition.hideEditActions &&\r\n\t\t\t\t\t\tentityDefinition.versionable) ||\r\n\t\t\t\t\tentityDefinition.scoped ||\r\n\t\t\t\t\tlocalized;\r\n\r\n\t\t\t\tif (redirectPathName) {\r\n\t\t\t\t\tconsole.debug('Redirecting:', redirectPathName + '?' + redirectSearch, redirectCulture);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn redirectPathName ? (\r\n\t\t\t\t\tredirectCulture ? (\r\n\t\t\t\t\t\t<Redirect\r\n\t\t\t\t\t\t\tto={{ pathname: redirectPathName, search: redirectSearch, state: { redirectCulture } }}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<Redirect push to={{ pathname: redirectPathName, search: redirectSearch }} />\r\n\t\t\t\t\t)\r\n\t\t\t\t) : !isLoadingInitial ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<form onSubmit={handleSubmit} className=\"edit-form\" autoComplete=\"off\">\r\n\t\t\t\t\t\t\t<NavigationPrompt\r\n\t\t\t\t\t\t\t\twhen={dirty && !expirationAlertCountdownStarted && !entityDefinition.hideEditActions}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{({ isActive, onConfirm, onCancel }) => (\r\n\t\t\t\t\t\t\t\t\t<Confirm\r\n\t\t\t\t\t\t\t\t\t\tonCancel={onCancel}\r\n\t\t\t\t\t\t\t\t\t\tisOpen={isActive}\r\n\t\t\t\t\t\t\t\t\t\tonConfirm={onConfirm}\r\n\t\t\t\t\t\t\t\t\t\trenderTitle={() => 'Warning'}\r\n\t\t\t\t\t\t\t\t\t\trenderContents={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t'Are you sure you want to leave this page? Your changes will be lost.'\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tconfirmButtonText=\"Leave\"\r\n\t\t\t\t\t\t\t\t\t\tcancelButtonText=\"Stay\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</NavigationPrompt>\r\n\r\n\t\t\t\t\t\t\t<div className=\"main__sticky-header main__sticky-header--edit-form\">\r\n\t\t\t\t\t\t\t\t{showSeparateTitleLine ? (\r\n\t\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar\">\r\n\t\t\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar-item--title\">\r\n\t\t\t\t\t\t\t\t\t\t\t<EditTitle />\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar-item--grow\" />\r\n\t\t\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar-item--grow\" />\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar\">\r\n\t\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar__section\">\r\n\t\t\t\t\t\t\t\t\t\t{!showSeparateTitleLine ? (\r\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar-item\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<EditTitle />\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t\t\t{entityDefinition.scoped ? (\r\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar-item\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<ScopeField disabled={!scopeFieldEnabled} />\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t\t\t{localized ? (\r\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar-item\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<CulturePicker handleSubmit={handleSubmit} />\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar-item\">\r\n\t\t\t\t\t\t\t\t\t\t\t{!isCreateMode && !entityDefinition.hideEditActions ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{entityDefinition.hideView\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? null\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: entityDefinition.editViewLiveComponent}\r\n\t\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t\t\t\t<div className=\"edit-form__top-bar__section\">\r\n\t\t\t\t\t\t\t\t\t\t<div className=\"edit-form__actions-bar\">\r\n\t\t\t\t\t\t\t\t\t\t\t{!entityDefinition.hideCancel ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-form__actions-bar-item\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<EditCancelButton label={entityDefinition.cancelButtonLabel} />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t{entityDefinition.copyHtmlMarkup ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<EditCopyHtmlButton entityDefinition={entityDefinition} />\r\n\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t{!isCreateMode &&\r\n\t\t\t\t\t\t\t\t\t\t\t!entityDefinition.hideDelete &&\r\n\t\t\t\t\t\t\t\t\t\t\thasDeletePermission(entityDefinition, authorizedBaseRoutesData) ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<EditDeleteButton\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={isSaving || isLoading}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsubmitError={!dirtySinceLastSubmit ? submitError : null}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisPermanent={isPermanent}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisDeletable={isDeletable}\r\n\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t{!entityDefinition.hideEditActions ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<EditSaveButton\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={isSaving || isLoading}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\thandleSubmit={handleSubmit}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsubmitError={!dirtySinceLastSubmit ? submitError : null}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisPermanent={isPermanent}\r\n\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div className=\"main__sticky-after\">\r\n\t\t\t\t\t\t\t\t{axiosError ? (\r\n\t\t\t\t\t\t\t\t\t<ErrorAlert error={axiosError} />\r\n\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t// show the edit form validation error message if it was a source of errors\r\n\t\t\t\t\t\t\t\t\t\t\tvalidationErrorSource & ValidationErrorSource.EditForm ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<EditErrorOnSaveAlert />\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<ValidationErrorAlert\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubmitError={submitError}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\talertType={AlertType.Edit}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t\t) : null\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t\t{props.render(formProps)}\r\n\r\n\t\t\t\t\t\t\t\t<hr className=\"edit-form__hr\" />\r\n\r\n\t\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\t\tclassName={\r\n\t\t\t\t\t\t\t\t\t\tbottomActionsFocused\r\n\t\t\t\t\t\t\t\t\t\t\t? 'edit-form__bot-bar'\r\n\t\t\t\t\t\t\t\t\t\t\t: 'edit-form__bot-bar visually-hidden'\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tonFocus={handleFocusIn}\r\n\t\t\t\t\t\t\t\t\tonBlur={handleBlur}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<div className=\"edit-form__bot-bar-item--grow\" />\r\n\r\n\t\t\t\t\t\t\t\t\t<div className=\"edit-form__bot-bar-item\">\r\n\t\t\t\t\t\t\t\t\t\t<div className=\"edit-form__bot-actions\">\r\n\t\t\t\t\t\t\t\t\t\t\t{!isCreateMode &&\r\n\t\t\t\t\t\t\t\t\t\t\t!entityDefinition.hideDelete &&\r\n\t\t\t\t\t\t\t\t\t\t\thasDeletePermission(entityDefinition, authorizedBaseRoutesData) ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<EditDeleteButton\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={isSaving || isLoading}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdropdownMenuDirection=\"up\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsubmitError={!dirtySinceLastSubmit ? submitError : null}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisPermanent={isPermanent}\r\n\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t{!entityDefinition.hideEditActions ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<EditSaveButton\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={isSaving || isLoading}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\thandleSubmit={handleSubmit}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdropdownMenuDirection=\"up\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsubmitError={!dirtySinceLastSubmit ? submitError : null}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisPermanent={isPermanent}\r\n\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</form>\r\n\r\n\t\t\t\t\t\t<Modal isOpen={isLoading} centered={true}>\r\n\t\t\t\t\t\t\t<ModalBody>\r\n\t\t\t\t\t\t\t\t<Spinner />\r\n\t\t\t\t\t\t\t</ModalBody>\r\n\t\t\t\t\t\t</Modal>\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t// if we're still loading the intial entity, display a spinner instead of the edit form contents\r\n\t\t\t\t\t<CenterSpinner />\r\n\t\t\t\t);\r\n\t\t\t}}\r\n\t\t/>\r\n\t);\r\n}\r\n\r\nexport default EditForm;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Folder SVG component\r\n *\r\n * @returns\r\n */\r\nfunction FolderSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 52 32\"\r\n\t\t\tclassName={'icon icon-folder ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t\tdata-testid={svgProps.testId}\r\n\t\t>\r\n\t\t\t<path\r\n\t\t\t\tfill=\"#231f20\"\r\n\t\t\t\td=\"M20.568 22.146l1.85 4.385c0.112 0.255 0.415 0.367 0.718 0.494 0.412-0.037 0.786-0.168 1.11-0.373l-0.010 0.006 6.713-4.257c0.973-0.622 1.419-1.371 1.196-1.881s-1.084-0.558-1.945 0v0l-3.189 2.009 4.114-7.382c0.446-0.765 0.175-1.387-0.574-1.387-0.928 0.091-1.715 0.62-2.161 1.374l-0.007 0.013-4.145 7.382-0.893-2.137c-0.223-0.542-1.1-0.558-1.961 0v0c-0.505 0.302-0.837 0.847-0.837 1.468 0 0.101 0.009 0.2 0.026 0.296l-0.001-0.010z\"\r\n\t\t\t/>\r\n\t\t\t<path\r\n\t\t\t\tfill=\"#000\"\r\n\t\t\t\td=\"M48.933 11.161l-9.774 17.682c-0.258 0.46-0.742 0.765-1.298 0.765-0.003 0-0.007 0-0.010-0h-34.822l1.754-3.189 7.797-14.35c0.225-0.518 0.721-0.88 1.304-0.909l0.003-0h35.077zM13.537 0h-12.277c-0.696 0-1.26 0.564-1.26 1.26v0 29.178c0.006 0.454 0.201 0.861 0.509 1.147l0.001 0.001s0 0 0-0.112c0.323 0.325 0.771 0.526 1.266 0.526 0.003 0 0.007 0 0.010-0h36.065c0.003 0 0.006 0 0.009 0 1.449 0 2.712-0.796 3.377-1.974l0.010-0.019 10.268-18.543c0.137-0.249 0.217-0.546 0.217-0.861 0-1.002-0.81-1.814-1.811-1.818h-10.061v-4.592c0-0.881-0.714-1.594-1.594-1.594v0h-23.47v-1.339c0-0.696-0.564-1.26-1.26-1.26v0zM2.679 25.24v-22.322h9.567v2.599h25.511v3.269h-23.916c-1.436 0.022-2.681 0.818-3.338 1.989l-0.010 0.020-7.813 14.445z\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nFolderSVG.defaultProps = { class: '' };\r\n\r\nexport default FolderSVG;\r\n","import moment from 'moment';\r\nimport Popper from 'popper.js';\r\nimport * as React from 'react';\r\nimport { Popover, PopoverBody } from 'reactstrap';\r\nimport { EditContext, EntityVersionType } from 'types';\r\nimport BaseDto from 'types/__models__/BaseDto';\r\nimport { formatDateTime } from 'util/Time';\r\nimport { ModelStatus } from '../../../../../Roc.SharedClientApp/types/model-status';\r\nimport * as Constants from '../../../../../Roc.SharedClientApp/util/Constants';\r\nimport RocTitle from '../RocTitle';\r\nimport CalendarCheckmarkSVG from '../svg/CalendarCheckmarkSVG';\r\nimport CalendarPowerSVG from '../svg/CalendarPowerSVG';\r\nimport CalendarTrashSVG from '../svg/CalendarTrashSVG';\r\nimport CheckCircleSVG from '../svg/CheckCircleSVG';\r\nimport DashCircleSVG from '../svg/DashCircleSVG';\r\nimport FolderSVG from '../svg/FolderSVG';\r\nimport GarbageCanCircleSVG from '../svg/GarbageCanCircleSVG';\r\nimport InfoSVG from '../svg/InfoSVG';\r\nimport PencilWriteSVG from '../svg/PencilWriteSVG';\r\nimport EditStatusLabel from './EditStatusLabel';\r\nimport withEditContext from './withEditContext';\r\n\r\nexport interface EditControlsProps {\r\n\teditContext: EditContext;\r\n\trecord: BaseDto;\r\n\tpopoverPlacement?: Popper.Placement;\r\n}\r\n\r\nexport interface EditControlsState {\r\n\tpopoverOpen: boolean;\r\n}\r\n\r\ninterface DefaultPopoverStatusOnEditProps {\r\n\teditContext: EditContext;\r\n\tactiveVersion: any;\r\n\tisDraft: boolean | null;\r\n\tisFutureVersion: boolean | null;\r\n\tisArchived: boolean | null;\r\n\trecord: {\r\n\t\tversionNo?: number;\r\n\t\tcreateDate?: Date;\r\n\t\tcreateUser?: string;\r\n\t\tmodifyDate?: Date;\r\n\t\tmodifyUser?: string;\r\n\t\tstatus: ModelStatus;\r\n\t};\r\n}\r\n\r\n/**\r\n * Default popover status info to be displayed within the PopoverBody of the EditStatusDisplay icon. Can be overriden by setting\r\n * statusInfoOverrideOnEdit in the entityDefinition.\r\n */\r\nfunction DefaultPopoverStatusOnEdit(props: DefaultPopoverStatusOnEditProps) {\r\n\tconst { record, editContext, activeVersion, isDraft, isFutureVersion, isArchived } = props;\r\n\r\n\tconst statusName = (prefix: string, modelStatus: ModelStatus) => {\r\n\t\tswitch (modelStatus) {\r\n\t\t\tcase ModelStatus.Published:\r\n\t\t\t\treturn `${prefix} Publish`;\r\n\r\n\t\t\tcase ModelStatus.Deleted:\r\n\t\t\t\treturn `${prefix} Deletion`;\r\n\r\n\t\t\tcase ModelStatus.Draft:\r\n\t\t\t\treturn `${prefix} Draft`;\r\n\r\n\t\t\tcase ModelStatus.Inactive:\r\n\t\t\t\treturn `${prefix} Inactivation`;\r\n\r\n\t\t\tdefault:\r\n\t\t\t\treturn `${prefix} ${modelStatus}`;\r\n\t\t}\r\n\t};\r\n\r\n\tconst statusLabel = editContext.entityDefinition.statusLabel;\r\n\tconst statusField = editContext.entityDefinition.statusField;\r\n\tconst versionLabel = editContext.entityDefinition.versionLabel\r\n\t\t? editContext.entityDefinition.versionLabel\r\n\t\t: 'Version';\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{activeVersion && isDraft ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<EditStatusLabel label={statusLabel} value={record.status} />\r\n\t\t\t\t\t<EditStatusLabel label={versionLabel} value={activeVersion.versionNo} />\r\n\t\t\t\t\t<EditStatusLabel\r\n\t\t\t\t\t\tlabel=\"Created By\"\r\n\t\t\t\t\t\tvalue={activeVersion.createUser ? activeVersion.createUser : Constants.systemUserName}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{activeVersion.createDate ? (\r\n\t\t\t\t\t\t<EditStatusLabel label=\"Created On\" value={formatDateTime(activeVersion.createDate)} />\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t{!moment(activeVersion.createDate).isSame(moment(activeVersion.modifyDate)) ? (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t<EditStatusLabel\r\n\t\t\t\t\t\t\t\tlabel=\"Modified By\"\r\n\t\t\t\t\t\t\t\tvalue={activeVersion.modifyUser ? activeVersion.modifyUser : Constants.systemUserName}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t<EditStatusLabel label=\"Modified On\" value={formatDateTime(activeVersion.modifyDate)} />\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t</>\r\n\t\t\t) : activeVersion && isFutureVersion ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{record.status ? (\r\n\t\t\t\t\t\t<EditStatusLabel label={statusLabel} value={statusName('Future', record.status)} />\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t<EditStatusLabel label={versionLabel} value={activeVersion.versionNo} />\r\n\t\t\t\t\t<EditStatusLabel\r\n\t\t\t\t\t\tlabel=\"Originally Created By\"\r\n\t\t\t\t\t\tvalue={record.createUser ? record.createUser : Constants.systemUserName}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{record.createDate ? (\r\n\t\t\t\t\t\t<EditStatusLabel label=\"Originally Created On\" value={formatDateTime(record.createDate)} />\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t<EditStatusLabel label=\"Scheduled By\" value={activeVersion.createUser} />\r\n\t\t\t\t\t{activeVersion.scheduledTime ? (\r\n\t\t\t\t\t\t<EditStatusLabel label=\"Scheduled For\" value={formatDateTime(activeVersion.scheduledTime)} />\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t</>\r\n\t\t\t) : activeVersion && isArchived ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{record.status ? (\r\n\t\t\t\t\t\t<EditStatusLabel label={statusLabel} value={statusName('Archived', record.status)} />\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t<EditStatusLabel label={versionLabel} value={activeVersion.versionNo} />\r\n\t\t\t\t\t<EditStatusLabel\r\n\t\t\t\t\t\tlabel=\"Originally Created By\"\r\n\t\t\t\t\t\tvalue={record.createUser ? record.createUser : Constants.systemUserName}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{record.createDate ? (\r\n\t\t\t\t\t\t<EditStatusLabel label=\"Originally Created On\" value={formatDateTime(record.createDate)} />\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t<EditStatusLabel label=\"Archived By\" value={activeVersion.createUser} />\r\n\t\t\t\t\t{activeVersion.processTime ? (\r\n\t\t\t\t\t\t<EditStatusLabel label=\"Archived On\" value={formatDateTime(activeVersion.processTime)} />\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t</>\r\n\t\t\t) : (\r\n\t\t\t\t// non-archived, non-future, non-draft version\r\n\t\t\t\t<>\r\n\t\t\t\t\t<EditStatusLabel label={statusLabel} value={record[statusField]} />\r\n\t\t\t\t\t<EditStatusLabel label={versionLabel} value={record.versionNo} />\r\n\t\t\t\t\t<EditStatusLabel\r\n\t\t\t\t\t\tlabel=\"Created By\"\r\n\t\t\t\t\t\tvalue={record.createUser ? record.createUser : Constants.systemUserName}\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{record.createDate ? (\r\n\t\t\t\t\t\t<EditStatusLabel label=\"Created On\" value={formatDateTime(record.createDate)} />\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t\t{!moment(record.createDate).isSame(moment(record.modifyDate)) ? (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t<EditStatusLabel\r\n\t\t\t\t\t\t\t\tlabel=\"Modified By\"\r\n\t\t\t\t\t\t\t\tvalue={record.modifyUser ? record.modifyUser : Constants.systemUserName}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t<EditStatusLabel label=\"Modified On\" value={formatDateTime(record.modifyDate)} />\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t) : null}\r\n\t\t\t\t</>\r\n\t\t\t)}\r\n\t\t</>\r\n\t);\r\n}\r\n\r\n/**\r\n * Component that renders the actions for any particular field.\r\n * These include edit, delete, info, and future options for each individual record.\r\n *\r\n * @class EditControls\r\n * @extends {React.Component<EditControlsProps<any>>}\r\n */\r\nclass EditStatusDisplay extends React.Component<EditControlsProps, EditControlsState> {\r\n\tprivate archivedContainerRef: React.RefObject<HTMLDivElement>;\r\n\tprivate container;\r\n\r\n\tpublic static defaultProps = {\r\n\t\tpopoverPlacement: 'bottom',\r\n\t};\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.archivedContainerRef = React.createRef();\r\n\t\tthis.container = React.createRef();\r\n\r\n\t\tthis.state = {\r\n\t\t\tpopoverOpen: false,\r\n\t\t};\r\n\t}\r\n\r\n\tpublic handleButtonClick = (e) => {\r\n\t\t// prevent form submit\r\n\t\te.preventDefault();\r\n\r\n\t\tthis.toggle();\r\n\t};\r\n\r\n\tpublic toggle = () => {\r\n\t\tthis.setState({\r\n\t\t\tpopoverOpen: !this.state.popoverOpen,\r\n\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst { record, editContext } = this.props;\r\n\t\tconst isBasicModelOnly = editContext.entityDefinition.isBasicModel && !editContext.entityDefinition.isBaseModel;\r\n\r\n\t\tconst activeVersion = editContext.getActiveVersion();\r\n\t\tconst isArchived = activeVersion && activeVersion.type === EntityVersionType.Archived;\r\n\t\tconst isFutureVersion = activeVersion && activeVersion.type === EntityVersionType.Future;\r\n\t\tconst isDraft = activeVersion && activeVersion.type === EntityVersionType.Draft;\r\n\r\n\t\tconst listingItemStatusIconClass = 'listing-item-status-icon';\r\n\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t{isArchived ? (\r\n\t\t\t\t\t<RocTitle label=\"Archived Record\">\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t<FolderSVG class={'listing-item-status-icon__left'} />\r\n\t\t\t\t\t\t\t<span className=\"visually-hidden\">Archived Record</span>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</RocTitle>\r\n\t\t\t\t) : null}{' '}\r\n\t\t\t\t<span ref={this.container} className=\"listing-status-display\">\r\n\t\t\t\t\t<button\r\n\t\t\t\t\t\tclassName=\"listing-status-btn\"\r\n\t\t\t\t\t\tid={'Popover-' + record.id}\r\n\t\t\t\t\t\tonClick={this.handleButtonClick}\r\n\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<span className=\"visually-hidden\">\r\n\t\t\t\t\t\t\tClick to view {editContext.entityDefinition.singularName} status\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t{editContext.entityDefinition.statusIconOverride ? (\r\n\t\t\t\t\t\t\teditContext.entityDefinition.statusIconOverride(record)\r\n\t\t\t\t\t\t) : isBasicModelOnly ? (\r\n\t\t\t\t\t\t\t<InfoSVG class={listingItemStatusIconClass} testId=\"listing-status-info-icon\" />\r\n\t\t\t\t\t\t) : record.status === ModelStatus.Published ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t{isFutureVersion ? (\r\n\t\t\t\t\t\t\t\t\t<CalendarCheckmarkSVG\r\n\t\t\t\t\t\t\t\t\t\tclass={listingItemStatusIconClass}\r\n\t\t\t\t\t\t\t\t\t\ttestId=\"listing-status-calendar-checkmark-icon\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t<CheckCircleSVG\r\n\t\t\t\t\t\t\t\t\t\tclass={listingItemStatusIconClass}\r\n\t\t\t\t\t\t\t\t\t\ttestId=\"listing-status-circle-check-icon\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t) : record.status === ModelStatus.Deleted ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t{isFutureVersion ? (\r\n\t\t\t\t\t\t\t\t\t<CalendarTrashSVG\r\n\t\t\t\t\t\t\t\t\t\tclass={listingItemStatusIconClass}\r\n\t\t\t\t\t\t\t\t\t\ttestId=\"listing-status-calendar-trash-icon\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t<GarbageCanCircleSVG\r\n\t\t\t\t\t\t\t\t\t\tclass={listingItemStatusIconClass}\r\n\t\t\t\t\t\t\t\t\t\ttestId=\"listing-status-garbage-can-circle-icon\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t) : record.status === ModelStatus.Inactive ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t{isFutureVersion ? (\r\n\t\t\t\t\t\t\t\t\t<CalendarPowerSVG\r\n\t\t\t\t\t\t\t\t\t\tclass={listingItemStatusIconClass}\r\n\t\t\t\t\t\t\t\t\t\ttestId=\"listing-status-calendar-power-icon\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t<DashCircleSVG\r\n\t\t\t\t\t\t\t\t\t\tclass={listingItemStatusIconClass}\r\n\t\t\t\t\t\t\t\t\t\ttestId=\"listing-status-dash-icon\"\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t) : record.status === ModelStatus.Draft ? (\r\n\t\t\t\t\t\t\t<PencilWriteSVG class={listingItemStatusIconClass} testId=\"listing-status-draft-icon\" />\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t<InfoSVG class={listingItemStatusIconClass} testId=\"listing-status-info-icon\" />\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</button>\r\n\t\t\t\t\t<Popover\r\n\t\t\t\t\t\ttarget={'Popover-' + record.id}\r\n\t\t\t\t\t\tplacement={this.props.popoverPlacement}\r\n\t\t\t\t\t\tisOpen={this.state.popoverOpen}\r\n\t\t\t\t\t\ttoggle={this.toggle}\r\n\t\t\t\t\t\tclassName=\"popover-wider\"\r\n\t\t\t\t\t\tcontainer={this.container}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<PopoverBody>\r\n\t\t\t\t\t\t\t{!editContext.entityDefinition.statusInfoOverrideOnEdit ? (\r\n\t\t\t\t\t\t\t\t<DefaultPopoverStatusOnEdit\r\n\t\t\t\t\t\t\t\t\trecord={record}\r\n\t\t\t\t\t\t\t\t\teditContext={editContext}\r\n\t\t\t\t\t\t\t\t\tactiveVersion={activeVersion}\r\n\t\t\t\t\t\t\t\t\tisDraft={isDraft}\r\n\t\t\t\t\t\t\t\t\tisArchived={isArchived}\r\n\t\t\t\t\t\t\t\t\tisFutureVersion={isFutureVersion}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\teditContext.entityDefinition.statusInfoOverrideOnEdit(record)\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</PopoverBody>\r\n\t\t\t\t\t</Popover>\r\n\t\t\t\t</span>\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default withEditContext(EditStatusDisplay);\r\n","import React, { useContext } from 'react';\r\nimport DocumentTitle from 'react-document-title';\r\nimport { getFormattedPageTitle } from 'util/Misc';\r\nimport { VisuallyHiddenAnnouncementTrigger } from 'VisuallyHiddenAnnouncement';\r\nimport ListingHelpButton from '../list/ListingHelpButton';\r\nimport EditContext from './EditContext';\r\nimport EditStatusDisplay from './EditStatusDisplay';\r\nimport OnFieldValueChange from './fields/OnFieldValueChange';\r\n\r\n/**\r\n * Component that contains the title of the entity in the edit page. Also displays a single field as a subtitle\r\n * which is useful for users when there are many tabs on the page to remember what they're editing/creating.\r\n */\r\nfunction EditTitle() {\r\n\tconst editContext = useContext(EditContext);\r\n\r\n\tlet pageAlert: string | null = null;\r\n\r\n\tconst { singularName, userFriendlyNameField, hideViewOnly } = editContext.entityDefinition;\r\n\tconst title = (editContext.isCreateMode ? 'Create' : hideViewOnly ? 'Edit' : 'View') + ' ' + singularName;\r\n\tconst valueKey = userFriendlyNameField ? userFriendlyNameField : 'name';\r\n\r\n\tif (pageAlert === null) {\r\n\t\tpageAlert = `Navigated to ${title}`;\r\n\r\n\t\tif (!editContext.isCreateMode && editContext.values) {\r\n\t\t\tpageAlert += ' ' + editContext.values[valueKey];\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t<DocumentTitle title={getFormattedPageTitle(title)}>\r\n\t\t\t<h1 className=\"edit-form__title\">\r\n\t\t\t\t<div className=\"edit-form__title-item\">\r\n\t\t\t\t\t{title}\r\n\r\n\t\t\t\t\t<span className=\"edit-form__title-display\">\r\n\t\t\t\t\t\t<OnFieldValueChange field={valueKey}>\r\n\t\t\t\t\t\t\t{({ value }) => {\r\n\t\t\t\t\t\t\t\treturn value ? ': ' + value : null;\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t</OnFieldValueChange>\r\n\t\t\t\t\t</span>\r\n\r\n\t\t\t\t\t<VisuallyHiddenAnnouncementTrigger message={pageAlert || ''} />\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t{!editContext.isCreateMode && !editContext.entityDefinition.hideStatusOnEdit && editContext.values ? (\r\n\t\t\t\t\t<div className=\"edit-form__title-item\">\r\n\t\t\t\t\t\t<EditStatusDisplay record={editContext.values} popoverPlacement=\"bottom\" />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t<div className=\"edit-form__title-item\">\r\n\t\t\t\t\t<ListingHelpButton\r\n\t\t\t\t\t\tentityDefinition={editContext.entityDefinition}\r\n\t\t\t\t\t\ticonClassNames=\"listing-item-status-icon\"\r\n\t\t\t\t\t\tlinkClassNames=\"listing-status-btn\"\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\t\t\t</h1>\r\n\t\t</DocumentTitle>\r\n\t);\r\n}\r\n\r\nexport default EditTitle;\r\n","import Octicon, { Check } from '@githubprimer/octicons-react';\r\nimport moment from 'moment';\r\nimport * as React from 'react';\r\nimport { Field, Form, FormRenderProps } from 'react-final-form';\r\nimport {\r\n\tButton,\r\n\tButtonGroup,\r\n\tDropdown,\r\n\tDropdownItem,\r\n\tDropdownMenu,\r\n\tDropdownToggle,\r\n\tModal,\r\n\tModalBody,\r\n\tModalFooter,\r\n\tModalHeader,\r\n} from 'reactstrap';\r\nimport { EntityVersionType, SubmissionState, EntityVersion, AppSiteDto, RedirectData } from 'types';\r\nimport { DateTime } from './fields';\r\nimport withEditContext, { HasEditContext } from './withEditContext';\r\nimport { RemovalException, getHandleableException } from 'types/Exceptions';\r\nimport EditErrorAlertPopup from './EditErrorAlertPopup';\r\nimport { Direction } from 'reactstrap/lib/Dropdown';\r\nimport { AxiosError } from 'axios';\r\nimport AppState from 'AppState';\r\nimport RecordScope from 'types/__models__/RecordScope';\r\nimport Redirect301OnTheFlyForm from 'features/redirects-301/Redirect301OnTheFlyForm';\r\nimport Confirm from '../Confirm';\r\nimport { ValidationErrorSource } from 'util/Misc';\r\nimport { areRedirectsEqual } from '../Utils';\r\nimport { ModelStatus } from '../../../../../Roc.SharedClientApp/types/model-status';\r\nimport { GetScopedSites } from 'util/AppStateUtils';\r\nimport ValidationErrorAlert, { AlertType } from '~/components/shared/edit/ValidationErrorAlert';\r\n\r\ninterface EditSaveButtonProps extends Pick<FormRenderProps, 'handleSubmit'>, HasEditContext {\r\n\t/**\r\n\t * Controls whether or not this component is disabled.\r\n\t */\r\n\tdisabled: boolean;\r\n\t/**\r\n\t * The direction of the dropdown menu\r\n\t */\r\n\tdropdownMenuDirection?: Direction;\r\n\t/**\r\n\t * Did an error occur during form submission?\r\n\t */\r\n\tsubmitError: string | string[] | null;\r\n\t/**\r\n\t * If set to true, this entity is flagged as a permanent entity, and therefore it cannot be inactivated.\r\n\t */\r\n\tisPermanent: boolean;\r\n}\r\n\r\nenum ModalState {\r\n\t/**\r\n\t * No modals are open.\r\n\t */\r\n\tClosed = 0,\r\n\t/**\r\n\t * Deletion of an entity failed due to a delete guard. The user will need to force deletion to proceed.\r\n\t */\r\n\tRemovalErrorOpen,\r\n\t/**\r\n\t * A save error occurred.\r\n\t */\r\n\tSaveErrorOpen,\r\n\t/**\r\n\t * The redirects 301 modal is open.\r\n\t */\r\n\tRedirectsOpen,\r\n}\r\n\r\ninterface EditSaveButtonState {\r\n\t/**\r\n\t * Is the force changes warning modal open? This can happen when publishing as inactive on an existing record with foreign keys\r\n\t */\r\n\tmodalState: ModalState;\r\n\t/**\r\n\t * The exception that occurred (if any) when attempting to push the change to the server.\r\n\t */\r\n\taxiosError: AxiosError | null;\r\n\t/**\r\n\t * The submission parameters of the last failed (but handleable) request.\r\n\t */\r\n\tfailedSubmitParameters?: SubmissionState;\r\n\t/**\r\n\t * Is the publish options dropdown open?\r\n\t */\r\n\tdropdownOpen: boolean;\r\n\t/**\r\n\t * Is the schedule save modal open?\r\n\t */\r\n\tscheduleModalOpen: boolean;\r\n\t/**\r\n\t * Is the confirm publish modal open?\r\n\t */\r\n\tconfirmPublishModalOpen: boolean;\r\n\t/**\r\n\t * Will the confirmed publish continue editing after confirmation?\r\n\t */\r\n\tconfirmPublishAndContinue: boolean;\r\n\t/**\r\n\t * When initializing the confirm publish modal, this status will specify what type of\r\n\t * status is being submitted when the confirm publish modal is confirmed.\r\n\t */\r\n\tconfirmPublishStatus: ModelStatus | null;\r\n\t/**\r\n\t * When initializing the schedule modal, this status will specify what type of status\r\n\t * is being submitted when the schedule modal is confirmed.\r\n\t */\r\n\tscheduleModalStatus: ModelStatus | null;\r\n\t/**\r\n\t * When initializing the schedule modal, this value is used to pre-populate the datetime field within\r\n\t * the modal. Used when modifying the scheduled time of a future version.\r\n\t */\r\n\tscheduleModalTime: moment.Moment | null;\r\n\r\n\t/**\r\n\t * The next submission state to use after the 301 redirects validation\r\n\t */\r\n\tnextSubmissionState?: SubmissionState;\r\n\r\n\t/**\r\n\t * A list of site names that should match the `__redirects` field array.\r\n\t * This is used to display the label for each 301 a user might create when the 301\r\n\t * modal is open.\r\n\t */\r\n\tsiteNamesFor301s: string[];\r\n\r\n\t/**\r\n\t * The initial form values to populate the redirect creation modal with.\r\n\t */\r\n\tinitialRedirectValues: RedirectData[];\r\n}\r\n\r\nclass EditSaveButton extends React.Component<EditSaveButtonProps, EditSaveButtonState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tmodalState: ModalState.Closed,\r\n\t\t\tfailedSubmitParameters: undefined,\r\n\t\t\tdropdownOpen: false,\r\n\t\t\tscheduleModalOpen: false,\r\n\t\t\tconfirmPublishModalOpen: false,\r\n\t\t\tconfirmPublishAndContinue: false,\r\n\t\t\tconfirmPublishStatus: null,\r\n\t\t\tscheduleModalStatus: null,\r\n\t\t\tscheduleModalTime: null,\r\n\t\t\taxiosError: null,\r\n\t\t\tsiteNamesFor301s: [],\r\n\t\t\tinitialRedirectValues: [],\r\n\t\t};\r\n\t}\r\n\r\n\tpublic componentDidUpdate(prevProps: EditSaveButtonProps) {\r\n\t\tconst {\r\n\t\t\teditContext: { validationErrorSource, isLoading },\r\n\t\t} = this.props;\r\n\r\n\t\tif (validationErrorSource !== prevProps.editContext.validationErrorSource) {\r\n\t\t\t// if the redirect validation state changed, we potentially need to toggle the 301 modal\r\n\t\t\tif (validationErrorSource & ValidationErrorSource.EditForm) {\r\n\t\t\t\t// if the source of validation errors includes the edit form, lets tend to those first and hide any modals\r\n\r\n\t\t\t\t// NOTE: knowingly disabling this warning as we're confident setting this state in response to the context\r\n\t\t\t\t// prop changing won't cause an update loop\r\n\t\t\t\t// eslint-disable-next-line react/no-did-update-set-state\r\n\t\t\t\tthis.setState({ modalState: ModalState.Closed });\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!prevProps.editContext.isLoading && isLoading) {\r\n\t\t\t// if we just started loading the entity, ensure that our modals are closed.\r\n\r\n\t\t\t// eslint-disable-next-line react/no-did-update-set-state\r\n\t\t\tthis.setState({ modalState: ModalState.Closed });\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Primary submission function. Submits a CreateEdit request.\r\n\t *\r\n\t * @private\r\n\t * @memberof EditSaveButton\r\n\t */\r\n\tprivate submit = async (params: SubmissionState) => {\r\n\t\tawait this.props.editContext.setNextSubmissionState(params);\r\n\r\n\t\ttry {\r\n\t\t\tawait this.props.handleSubmit();\r\n\r\n\t\t\t// Submission succeeded so the force modal needs to close if it was open\r\n\t\t\tthis.setState({ modalState: ModalState.Closed });\r\n\t\t} catch (error) {\r\n\t\t\tconst serverException = getHandleableException(error) as RemovalException;\r\n\r\n\t\t\tif (serverException && serverException.exceptionCode === 'illegal_removal_operation') {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tmodalState: ModalState.RemovalErrorOpen,\r\n\t\t\t\t\taxiosError: error,\r\n\t\t\t\t\tfailedSubmitParameters: params,\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tmodalState: ModalState.SaveErrorOpen,\r\n\t\t\t\t\taxiosError: error,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tprivate forceLastFailedSubmit = async () => {\r\n\t\tconst params = this.state.failedSubmitParameters;\r\n\r\n\t\tif (params) {\r\n\t\t\tconst newParams = { ...params };\r\n\t\t\tnewParams.force = true;\r\n\t\t\tawait this.submit(newParams);\r\n\t\t}\r\n\t};\r\n\r\n\tprivate onForceCancel = () => {\r\n\t\tthis.setState({ modalState: ModalState.Closed });\r\n\t};\r\n\r\n\t/**\r\n\t * Toggles the publish options dropdown.\r\n\t */\r\n\tpublic toggleDropdown = () => {\r\n\t\tthis.setState((prevState) => ({\r\n\t\t\tdropdownOpen: !prevState.dropdownOpen,\r\n\t\t}));\r\n\t};\r\n\r\n\t/**\r\n\t * Toggles the schedule modal.\r\n\t *\r\n\t * @param status - If specified, controls what status the entity will be published at when the schedule\r\n\t * modal is confirmed.\r\n\t * @param scheduledTime - If specified, pre-populates the datetime field on the schedule modal with this value.\r\n\t * This is used when modifying the scheduled time of a future version.\r\n\t */\r\n\tpublic toggleScheduleModal = (status?: ModelStatus | null, scheduledTime?: moment.Moment | null) => {\r\n\t\tthis.setState((prevState) => ({\r\n\t\t\tscheduleModalOpen: !prevState.scheduleModalOpen,\r\n\t\t\tdropdownOpen: false,\r\n\t\t\tscheduleModalStatus: status || null,\r\n\t\t\tscheduleModalTime: scheduledTime || null,\r\n\t\t}));\r\n\t};\r\n\r\n\t/**\r\n\t * Toggles the confirm modal.\r\n\t *\r\n\t * @param status - If specified, controls what status the entity will be published at when the publish confirmation\r\n\t * modal is submitted.\r\n\t * @param doContinue - If specified, controls whether or not the submission of the publish confirmation modal will\r\n\t * trigger the \"publish & continue\" logic for the edit form.\r\n\t */\r\n\tpublic toggleConfirmPublishModal = (status?: ModelStatus | null, doContinue?: boolean) => {\r\n\t\tthis.setState((prevState) => ({\r\n\t\t\tconfirmPublishModalOpen: !prevState.confirmPublishModalOpen,\r\n\t\t\tdropdownOpen: false,\r\n\t\t\tconfirmPublishAndContinue: doContinue || false,\r\n\t\t\tconfirmPublishStatus: status || null,\r\n\t\t}));\r\n\t};\r\n\r\n\t/**\r\n\t * Toggles the 301 creation modal that appears if the entity had its scope changed and it needs 301 redirects\r\n\t * created.\r\n\t */\r\n\tpublic toggle301CreationModal = (doContinue?: boolean) => {\r\n\t\tthis.setState((prevState) => ({\r\n\t\t\tmodalState:\r\n\t\t\t\tprevState.modalState === ModalState.RedirectsOpen\r\n\t\t\t\t\t? // if the redirects modal is open, close it\r\n\t\t\t\t\t  ModalState.Closed\r\n\t\t\t\t\t: // otherwise open the redirects modal\r\n\t\t\t\t\t  ModalState.RedirectsOpen,\r\n\t\t\tconfirmPublishAndContinue: doContinue || false,\r\n\t\t}));\r\n\t};\r\n\r\n\t/**\r\n\t * Called when the scheduled modal is submitted.\r\n\t */\r\n\tprivate doScheduledSubmit = async (formValues: any): Promise<void | Record<string, unknown>> => {\r\n\t\t// extract the scheduled time from the schedule form\r\n\t\tconst { scheduledTime } = formValues;\r\n\r\n\t\tthis.setState({ scheduleModalOpen: false });\r\n\r\n\t\t// `scheduleModalStatus` is set when the schedule modal is opened via `toggleScheduleModal`\r\n\t\tawait this.submit({\r\n\t\t\tsubmissionType: this.state.scheduleModalStatus,\r\n\t\t\tsubmissionTime: scheduledTime,\r\n\t\t\tdoContinue: false,\r\n\t\t});\r\n\t};\r\n\r\n\tprivate doSubmitWith301Redirects = async () => {\r\n\t\tawait this.props.editContext.setNextSubmissionState({\r\n\t\t\tsubmissionType: null,\r\n\t\t\tsubmissionTime: null,\r\n\t\t\tdoContinue: this.state.confirmPublishAndContinue,\r\n\t\t});\r\n\r\n\t\tthis.props.handleSubmit();\r\n\t};\r\n\r\n\t/**\r\n\t * Decides if the 301 redirect form should be hidden.\r\n\t */\r\n\tprivate hide301Form = (): boolean => {\r\n\t\tconst {\r\n\t\t\teditContext,\r\n\t\t\teditContext: { values },\r\n\t\t} = this.props;\r\n\r\n\t\tif (editContext.entityDefinition.hideCreate301OnTheFly) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (values?.url == null) {\r\n\t\t\t// Entities without a url do not need a 301 redirect\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (values?.status !== ModelStatus.Published) {\r\n\t\t\t// Entities that are not published do not need a 301 redirect\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n\r\n\t/**\r\n\t * Calculate 301 sites based on the scope change\r\n\t */\r\n\tprivate handleScopeChange = (\r\n\t\toriginalScope: RecordScope | undefined,\r\n\t\tcurrentScope: RecordScope | undefined,\r\n\t): boolean => {\r\n\t\tlet currentSites: AppSiteDto[] = [];\r\n\r\n\t\tif (!currentScope) {\r\n\t\t\tcurrentSites = AppState.sites;\r\n\t\t} else if (currentScope.type === 'Site') {\r\n\t\t\tconst currentSite = AppState.sites.find((s) => s.id === currentScope.value);\r\n\t\t\tif (currentSite) {\r\n\t\t\t\tcurrentSites.push(currentSite);\r\n\t\t\t}\r\n\t\t} else if (currentScope.type === 'Site Collection') {\r\n\t\t\tconst currentSiteCollection = AppState.siteCollections.find((sc) => sc.id === currentScope.value);\r\n\t\t\tif (currentSiteCollection) {\r\n\t\t\t\tcurrentSites = currentSiteCollection.sites\r\n\t\t\t\t\t.map((site) => AppState.sites.find((s) => s.id === site.siteId))\r\n\t\t\t\t\t.filter((s) => s !== undefined) as AppSiteDto[];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet redirect301Sites = GetScopedSites(originalScope);\r\n\t\tredirect301Sites = redirect301Sites.filter((rs) => currentSites.find((cs) => cs.id === rs.id) === undefined);\r\n\r\n\t\tif (!redirect301Sites || redirect301Sites.length === 0 || this.hide301Form()) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tconst initialFormValues = redirect301Sites.map((site) => ({\r\n\t\t\tredirectUrl: '', // initialize to an empty field value\r\n\t\t\tsiteId: site.id,\r\n\t\t}));\r\n\r\n\t\tthis.setState({\r\n\t\t\t// set the site names for each of the fields in the 301 redirects field array\r\n\t\t\tsiteNamesFor301s: redirect301Sites.map((site) => site.name),\r\n\t\t});\r\n\r\n\t\t// populate the redirect form modal with the initial text fields to let users enter in any automatic\r\n\t\t// 301 creation\r\n\t\tthis.setState({\r\n\t\t\tinitialRedirectValues: initialFormValues,\r\n\t\t});\r\n\r\n\t\treturn true;\r\n\t};\r\n\r\n\t/**\r\n\t * Called when the default publish button is clicked.\r\n\t *\r\n\t * @param activeVersionType - The current active version type when the default publish button was clicked. This\r\n\t * is used to control how the publish is performed as different behaviors happen depending on whether you're\r\n\t * publishing an active record, a future record, etc.\r\n\t */\r\n\tprivate doSubmit = async (\r\n\t\te: React.MouseEvent<any>,\r\n\t\tactiveVersion: EntityVersion | null,\r\n\t\tactiveVersionType: EntityVersionType,\r\n\t\tstatus: ModelStatus,\r\n\t\tisFutureUpdate?: boolean,\r\n\t\tdoContinue?: boolean,\r\n\t) => {\r\n\t\tconst {\r\n\t\t\teditContext: { setNextSubmissionState, values, scopeChanged, originalScope, currentScope, isCreateMode },\r\n\t\t} = this.props;\r\n\r\n\t\tconst updateFuture = activeVersionType === EntityVersionType.Future && isFutureUpdate;\r\n\t\tconst submissionTime =\r\n\t\t\tupdateFuture && activeVersion && activeVersion.scheduledTime ? activeVersion.scheduledTime : null;\r\n\t\tif (\r\n\t\t\tactiveVersionType === EntityVersionType.Archived ||\r\n\t\t\tupdateFuture ||\r\n\t\t\t(((values && values.status === ModelStatus.Deleted) || status === ModelStatus.Archived) &&\r\n\t\t\t\tactiveVersionType !== EntityVersionType.Future)\r\n\t\t) {\r\n\t\t\tawait setNextSubmissionState({\r\n\t\t\t\tsubmissionType: status,\r\n\t\t\t\tsubmissionTime: submissionTime,\r\n\t\t\t\tdoContinue: doContinue ? true : false,\r\n\t\t\t});\r\n\t\t} else if (activeVersionType === EntityVersionType.Future) {\r\n\t\t\t// immediately publishing a future version, for this we want to first confirm that the user really\r\n\t\t\t// intends to do this\r\n\t\t\tthis.toggleConfirmPublishModal(ModelStatus.Published, /* doContinue */ false);\r\n\r\n\t\t\t// and prevent submission\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\r\n\t\tif (scopeChanged && !isCreateMode) {\r\n\t\t\t// if the scope value changed, determine if the change will remove the record from sites\r\n\r\n\t\t\tif (this.handleScopeChange(originalScope, currentScope)) {\r\n\t\t\t\t// this scope change will affect the url of the entity on some sites, so we need to\r\n\t\t\t\t// display the 301 creation modal\r\n\t\t\t\tthis.toggle301CreationModal();\r\n\r\n\t\t\t\t// prevent submission\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// in all other scenarios, the entity is being updated and the status isn't changing\r\n\t\t// nothing needs to be done here as the form submission will continue\r\n\t};\r\n\r\n\t/**\r\n\t * Helper for submitting the edit form and saving the current entity with a certain status.\r\n\t *\r\n\t * @param submissionType - The type of model status that the entity should be saved as.\r\n\t */\r\n\tprivate saveAs = async (submissionType: ModelStatus | null) => {\r\n\t\tawait this.submit({\r\n\t\t\tsubmissionType,\r\n\t\t\tsubmissionTime: null,\r\n\t\t\tdoContinue: false,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Helper for submitting the edit form and saving the current entity with a certain status and then\r\n\t * having the app stay on the edit page.\r\n\t *\r\n\t * @param submissionType - The type of model status that the entity should be saved as.\r\n\t * @param activeVersion - The active edited version of the entity\r\n\t * @param activeVersionType - The type of the active edited version of the entity\r\n\t * @param isFutureUpdate - True when this is a future scheduled entry being updated\r\n\t */\r\n\tprivate saveAsAndContinue = async (\r\n\t\tsubmissionType: ModelStatus | null,\r\n\t\tactiveVersion: EntityVersion | null,\r\n\t\tactiveVersionType: EntityVersionType,\r\n\t\tisFutureUpdate?: boolean,\r\n\t) => {\r\n\t\tconst {\r\n\t\t\teditContext: { setContinueWithHistory, scopeChanged, originalScope, currentScope, isCreateMode },\r\n\t\t} = this.props;\r\n\r\n\t\tconst updateFuture =\r\n\t\t\tactiveVersionType === EntityVersionType.Future &&\r\n\t\t\tisFutureUpdate &&\r\n\t\t\t(submissionType === ModelStatus.Published || submissionType === null);\r\n\t\tconst submissionTime =\r\n\t\t\tupdateFuture && activeVersion && activeVersion.scheduledTime ? activeVersion.scheduledTime : null;\r\n\t\tconst updateDraft = activeVersionType === EntityVersionType.Draft;\r\n\r\n\t\tif (scopeChanged && !isCreateMode) {\r\n\t\t\t// if the scope value changed, determine if the change will remove the record from sites\r\n\r\n\t\t\tif (this.handleScopeChange(originalScope, currentScope)) {\r\n\t\t\t\t// this scope change will affect the url of the entity on some sites, so we need to\r\n\t\t\t\t// display the 301 creation modal\r\n\t\t\t\tthis.toggle301CreationModal(/* doContinue */ true);\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tsetContinueWithHistory(updateFuture || updateDraft ? true : false);\r\n\t\tawait this.submit({\r\n\t\t\tsubmissionType,\r\n\t\t\tsubmissionTime: submissionTime,\r\n\t\t\tdoContinue: true,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Called after the confirm publish dialog has been submitted.\r\n\t */\r\n\tprivate continueWithPublish = async () => {\r\n\t\tthis.setState({\r\n\t\t\tconfirmPublishModalOpen: false,\r\n\t\t});\r\n\r\n\t\t// `confirmPublishStatus` and `confirmPublishAndContinue` is populated when the confirmation modal is opened\r\n\t\t// via `toggleConfirmPublishModal`\r\n\r\n\t\tawait this.submit({\r\n\t\t\tsubmissionType: this.state.confirmPublishStatus,\r\n\t\t\tsubmissionTime: null,\r\n\t\t\tdoContinue: this.state.confirmPublishAndContinue,\r\n\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\teditContext,\r\n\t\t\teditContext: { values, entityDefinition, isCreateMode },\r\n\t\t\tdropdownMenuDirection = 'down',\r\n\t\t} = this.props;\r\n\r\n\t\tlet activeVersionType = EntityVersionType.Current;\r\n\r\n\t\tconst activeVersion = editContext.getActiveVersion();\r\n\t\tif (activeVersion) {\r\n\t\t\t// if a version is active, then pull the type from there\r\n\t\t\tactiveVersionType = activeVersion.type;\r\n\t\t}\r\n\r\n\t\tlet recordName: string | null = null;\r\n\t\tlet status: ModelStatus = ModelStatus.Published;\r\n\r\n\t\tif (values) {\r\n\t\t\trecordName = ` (${values.name ? values.name : values[entityDefinition.userFriendlyNameField]})`;\r\n\r\n\t\t\tif (values.status) {\r\n\t\t\t\tstatus =\r\n\t\t\t\t\t(values.status === ModelStatus.Deleted && activeVersionType !== EntityVersionType.Future) ||\r\n\t\t\t\t\tactiveVersionType === EntityVersionType.Archived\r\n\t\t\t\t\t\t? ModelStatus.Published\r\n\t\t\t\t\t\t: values.status;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tlet buttonColor = 'primary';\r\n\r\n\t\tif (\r\n\t\t\t((activeVersionType === EntityVersionType.Current || activeVersionType === EntityVersionType.Draft) &&\r\n\t\t\t\t(status === ModelStatus.Inactive || status === ModelStatus.Draft)) ||\r\n\t\t\tactiveVersionType === EntityVersionType.Future\r\n\t\t) {\r\n\t\t\tbuttonColor = 'muted';\r\n\t\t}\r\n\r\n\t\tconst isFutureUpdate = activeVersionType === EntityVersionType.Future;\r\n\t\tconst canSaveAsInactive = entityDefinition.canSaveAsInactive && !this.props.isPermanent;\r\n\r\n\t\treturn (\r\n\t\t\t<div className=\"edit-form__actions-bar-item\">\r\n\t\t\t\t<ButtonGroup>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\tcolor={`${buttonColor}`}\r\n\t\t\t\t\t\tclassName=\"btn-medium\"\r\n\t\t\t\t\t\tdisabled={this.props.disabled}\r\n\t\t\t\t\t\tonClick={(e: React.MouseEvent<any>) =>\r\n\t\t\t\t\t\t\tthis.doSubmit(e, activeVersion, activeVersionType, status, isFutureUpdate)\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tdata-testid=\"edit-publish\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<div className=\"btn-icon-text-container\">\r\n\t\t\t\t\t\t\t<span className=\"btn-icon-bg\">\r\n\t\t\t\t\t\t\t\t<Octicon icon={Check} ariaLabel=\"Checkmark\" />\r\n\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t<span className=\"btn-icon-text\">\r\n\t\t\t\t\t\t\t\t{activeVersionType === EntityVersionType.Archived ||\r\n\t\t\t\t\t\t\t\t(values &&\r\n\t\t\t\t\t\t\t\t\tvalues.status === ModelStatus.Deleted &&\r\n\t\t\t\t\t\t\t\t\tactiveVersionType !== EntityVersionType.Future) ||\r\n\t\t\t\t\t\t\t\tstatus === ModelStatus.Archived\r\n\t\t\t\t\t\t\t\t\t? // when editing a deleted version, show restore\r\n\t\t\t\t\t\t\t\t\t  'Restore & Publish'\r\n\t\t\t\t\t\t\t\t\t: // in this case, the version type will only be published or draft\r\n\t\t\t\t\t\t\t\t\tstatus === ModelStatus.Inactive ||\r\n\t\t\t\t\t\t\t\t\t  status === ModelStatus.Draft ||\r\n\t\t\t\t\t\t\t\t\t  activeVersionType === EntityVersionType.Future\r\n\t\t\t\t\t\t\t\t\t? // inactive/draft/future versions are updated by default, which maintains their status\r\n\t\t\t\t\t\t\t\t\t  'Update'\r\n\t\t\t\t\t\t\t\t\t: entityDefinition.publishButtonLabel}\r\n\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</Button>\r\n\r\n\t\t\t\t\t<Dropdown\r\n\t\t\t\t\t\tisOpen={this.state.dropdownOpen}\r\n\t\t\t\t\t\ttoggle={this.toggleDropdown}\r\n\t\t\t\t\t\tclassName=\"dropdown--right\"\r\n\t\t\t\t\t\tdirection={dropdownMenuDirection}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<DropdownToggle\r\n\t\t\t\t\t\t\tcolor={`${buttonColor}`}\r\n\t\t\t\t\t\t\tcaret\r\n\t\t\t\t\t\t\tclassName=\"dropdown-toggle-no-text dropdown-toggle\"\r\n\t\t\t\t\t\t\tdisabled={this.props.disabled}\r\n\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-button\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<span className=\"visually-hidden\">\r\n\t\t\t\t\t\t\t\t{this.state.dropdownOpen ? 'Close' : 'Open'} Publish Options\r\n\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t</DropdownToggle>\r\n\t\t\t\t\t\t<DropdownMenu>\r\n\t\t\t\t\t\t\t{isCreateMode ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canSaveAndContinue ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.saveAsAndContinue(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tactiveVersion,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tactiveVersionType,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisFutureUpdate,\r\n\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-publish-and-continue-create\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t{entityDefinition.publishButtonLabel} &amp; Continue\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canPublishBeScheduled ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggleScheduleModal(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tModelStatus.Published,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/* scheduledTime */ null,\r\n\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-schedule-publish-create\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tPublish At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{canSaveAsInactive ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.saveAs(ModelStatus.Inactive)}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-save-as-inactive-create\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tSave as Inactive\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t) : activeVersion && activeVersionType === EntityVersionType.Future ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canSaveAndContinue ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.saveAsAndContinue(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tnull,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tactiveVersion,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tactiveVersionType,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tisFutureUpdate,\r\n\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-update-and-continue-future\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tUpdate &amp; Continue\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canSaveAndContinue ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.toggleConfirmPublishModal(ModelStatus.Published, false)}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-publish-future\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t{values?.status !== ModelStatus.Deleted ? 'Publish' : 'Restore & Publish'}\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canPublishBeScheduled &&\r\n\t\t\t\t\t\t\t\t\tvalues?.status !== ModelStatus.Deleted ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggleScheduleModal(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tModelStatus.Published,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tactiveVersion.scheduledTime,\r\n\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-schedule-publish-future\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tPublish At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{canSaveAsInactive && entityDefinition.canInactivationBeScheduled ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggleScheduleModal(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tModelStatus.Inactive,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tactiveVersion.scheduledTime,\r\n\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-schedule-save-as-inactive-current\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tSave as Inactive At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\tthis.toggleConfirmPublishModal(ModelStatus.Draft, /* doContinue */ false)\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-save-as-draft-future\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\tSave as Draft\r\n\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t) : activeVersionType === EntityVersionType.Archived ||\r\n\t\t\t\t\t\t\t  (values && values.status === ModelStatus.Deleted) ? (\r\n\t\t\t\t\t\t\t\t// old/deleted versions\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canSaveAndContinue ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.saveAsAndContinue(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tModelStatus.Published,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tactiveVersion,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tactiveVersionType,\r\n\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-publish-and-continue-archived\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tRestore, Publish &amp; Continue\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canPublishBeScheduled ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggleScheduleModal(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tModelStatus.Published,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/* scheduledTime */ null,\r\n\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-schedule-publish-archived\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tRestore &amp; Publish At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.versionable ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.saveAs(ModelStatus.Draft)}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-save-as-draft-archived\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tSave as Draft\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.saveAs(ModelStatus.Inactive)}\r\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-save-as-inactive-archived\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\tRestore as Inactive\r\n\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t) : // current or draft/inactive versions\r\n\t\t\t\t\t\t\tstatus === ModelStatus.Inactive ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canSaveAndContinue ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.saveAsAndContinue(null, activeVersion, activeVersionType)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-update-and-continue-inactive\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tUpdate &amp; Continue\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.saveAs(ModelStatus.Published)}\r\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-publish-inactive\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\tPublish\r\n\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canPublishBeScheduled ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.toggleScheduleModal(ModelStatus.Published)}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-schedule-publish-inactive\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tPublish At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{canSaveAsInactive && entityDefinition.canInactivationBeScheduled ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggleScheduleModal(ModelStatus.Inactive, /* scheduledTime */ null)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-schedule-save-as-inactive-current\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tSave as Inactive At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.versionable ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.saveAs(ModelStatus.Draft)}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-save-as-draft-inactive\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tSave as Draft\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t) : status === ModelStatus.Draft ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canSaveAndContinue ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.saveAsAndContinue(null, activeVersion, activeVersionType)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-update-and-continue-draft\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tUpdate &amp; Continue\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\tonClick={() => this.saveAs(ModelStatus.Published)}\r\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-publish-draft\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\tPublish\r\n\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canPublishBeScheduled ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggleScheduleModal(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tModelStatus.Published,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/* scheduledTime */ null,\r\n\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-schedule-publish-draft\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tPublish At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{canSaveAsInactive ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.saveAs(ModelStatus.Inactive)}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-save-as-inactive-draft\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tSave as Inactive\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{canSaveAsInactive && entityDefinition.canInactivationBeScheduled ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggleScheduleModal(ModelStatus.Inactive, /* scheduledTime */ null)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-schedule-save-as-inactive-current\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tSave as Inactive At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t// editing a current and published record\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canSaveAndContinue ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.saveAsAndContinue(null, activeVersion, activeVersionType)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-publish-and-continue-current\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t{entityDefinition.publishButtonLabel} &amp; Continue\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.canPublishBeScheduled ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggleScheduleModal(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tModelStatus.Published,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/* scheduledTime */ null,\r\n\t\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-schedule-publish-current\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tPublish At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{canSaveAsInactive ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.saveAs(ModelStatus.Inactive)}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-save-as-inactive-current\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tSave as Inactive\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{canSaveAsInactive && entityDefinition.canInactivationBeScheduled ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\tthis.toggleScheduleModal(ModelStatus.Inactive, /* scheduledTime */ null)\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-schedule-save-as-inactive-current\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tSave as Inactive At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t{entityDefinition.versionable ? (\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.saveAs(ModelStatus.Draft)}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"edit-dropdown-save-as-draft-current\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tSave as Draft\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</DropdownMenu>\r\n\t\t\t\t\t</Dropdown>\r\n\t\t\t\t</ButtonGroup>\r\n\r\n\t\t\t\t<Modal\r\n\t\t\t\t\tisOpen={this.state.scheduleModalOpen}\r\n\t\t\t\t\ttoggle={() => this.toggleScheduleModal()}\r\n\t\t\t\t\tclassName=\"edit-save-delete-modal modal-lg\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<Form\r\n\t\t\t\t\t\tonSubmit={this.doScheduledSubmit}\r\n\t\t\t\t\t\tinitialValues={{ scheduledTime: this.state.scheduleModalTime }}\r\n\t\t\t\t\t\trender={(props) => {\r\n\t\t\t\t\t\t\tconst { handleSubmit, submitError, submitting } = props;\r\n\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<form onSubmit={handleSubmit}>\r\n\t\t\t\t\t\t\t\t\t<ModalHeader toggle={() => this.toggleScheduleModal()}>\r\n\t\t\t\t\t\t\t\t\t\t{this.state.scheduleModalTime === null ? (\r\n\t\t\t\t\t\t\t\t\t\t\t<>Select Scheduled Date</>\r\n\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t<>Change Scheduled Date</>\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t</ModalHeader>\r\n\t\t\t\t\t\t\t\t\t<ModalBody>\r\n\t\t\t\t\t\t\t\t\t\t{this.state.scheduleModalTime === null ? (\r\n\t\t\t\t\t\t\t\t\t\t\t// if the initial time for the modal is null, then we're scheduling\r\n\t\t\t\t\t\t\t\t\t\t\t// a publish for a current record\r\n\t\t\t\t\t\t\t\t\t\t\t<span data-testid=\"modal-body\">\r\n\t\t\t\t\t\t\t\t\t\t\t\tWhen would you like to schedule your changes to this{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{this.props.editContext.entityDefinition.singularName}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{recordName}?\r\n\t\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t// otherwise, we're modifying the scheduled time for an existing future\r\n\t\t\t\t\t\t\t\t\t\t\t// version\r\n\t\t\t\t\t\t\t\t\t\t\t<span data-testid=\"modal-body\">\r\n\t\t\t\t\t\t\t\t\t\t\t\tWhen would you like to reschedule your changes to this{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{this.props.editContext.entityDefinition.singularName}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{recordName}?\r\n\t\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\r\n\t\t\t\t\t\t\t\t\t\t<ValidationErrorAlert submitError={submitError} alertType={AlertType.Edit} />\r\n\t\t\t\t\t\t\t\t\t\t<span className=\"visually-hidden\">Scheduled submission time</span>\r\n\t\t\t\t\t\t\t\t\t\t<Field name=\"scheduledTime\" component={DateTime} />\r\n\t\t\t\t\t\t\t\t\t</ModalBody>\r\n\t\t\t\t\t\t\t\t\t<ModalFooter>\r\n\t\t\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"btn-outline-primary-alt btn-width-large\"\r\n\t\t\t\t\t\t\t\t\t\t\toutline\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.toggleScheduleModal()}\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tCancel\r\n\t\t\t\t\t\t\t\t\t\t</Button>{' '}\r\n\t\t\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"btn-width-large\"\r\n\t\t\t\t\t\t\t\t\t\t\tdisabled={submitting}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"submit-scheduled-date\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tOK\r\n\t\t\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t\t\t</ModalFooter>\r\n\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</Modal>\r\n\r\n\t\t\t\t<Modal isOpen={this.state.confirmPublishModalOpen} toggle={() => this.toggleConfirmPublishModal()}>\r\n\t\t\t\t\t<ModalHeader toggle={() => this.toggleConfirmPublishModal()}>\r\n\t\t\t\t\t\t{this.state.confirmPublishStatus === ModelStatus.Draft ? (\r\n\t\t\t\t\t\t\t<>Confirm Immediate Draft</>\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t<>Confirm Immediate Publish</>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</ModalHeader>\r\n\t\t\t\t\t<ModalBody>\r\n\t\t\t\t\t\t{this.state.confirmPublishStatus === ModelStatus.Draft ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\tAre you sure you wish to save your schedule changes to this{' '}\r\n\t\t\t\t\t\t\t\t{this.props.editContext.entityDefinition.singularName}\r\n\t\t\t\t\t\t\t\t{recordName}?<br />\r\n\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\tNote: these scheduled changes will be immediately applied and this{' '}\r\n\t\t\t\t\t\t\t\t{this.props.editContext.entityDefinition.singularName} will be saved as a draft.\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\tAre you sure you wish to immediately publish your changes to this{' '}\r\n\t\t\t\t\t\t\t\t{this.props.editContext.entityDefinition.singularName}\r\n\t\t\t\t\t\t\t\t{recordName}?<br />\r\n\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\tNote: these scheduled changes will be immediately applied and this{' '}\r\n\t\t\t\t\t\t\t\t{this.props.editContext.entityDefinition.singularName} will be published.\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</ModalBody>\r\n\t\t\t\t\t<ModalFooter>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tclassName=\"btn-outline-primary-alt btn-width-large\"\r\n\t\t\t\t\t\t\toutline\r\n\t\t\t\t\t\t\tonClick={() => this.toggleConfirmPublishModal()}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tCancel\r\n\t\t\t\t\t\t</Button>{' '}\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\tclassName=\"btn-width-large\"\r\n\t\t\t\t\t\t\tonClick={this.continueWithPublish}\r\n\t\t\t\t\t\t\tdata-testid=\"confirm-imediate-publish\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tOK\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</ModalFooter>\r\n\t\t\t\t</Modal>\r\n\r\n\t\t\t\t<EditErrorAlertPopup\r\n\t\t\t\t\taxiosError={this.state.axiosError}\r\n\t\t\t\t\tisOpen={this.state.modalState === ModalState.RemovalErrorOpen}\r\n\t\t\t\t\tonCancel={this.onForceCancel}\r\n\t\t\t\t\tonConfirm={this.forceLastFailedSubmit}\r\n\t\t\t\t\tinProgress={false}\r\n\t\t\t\t/>\r\n\r\n\t\t\t\t<Field name=\"__redirects\" subscription={{ dirty: true }} isEqual={areRedirectsEqual}>\r\n\t\t\t\t\t{(props) => {\r\n\t\t\t\t\t\tconst {\r\n\t\t\t\t\t\t\tmeta: { dirty },\r\n\t\t\t\t\t\t} = props;\r\n\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<Confirm\r\n\t\t\t\t\t\t\t\tsize=\"medium\"\r\n\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\tisOpen={this.state.modalState === ModalState.RedirectsOpen}\r\n\t\t\t\t\t\t\t\tonCancel={() => this.toggle301CreationModal()}\r\n\t\t\t\t\t\t\t\tonConfirm={() => this.doSubmitWith301Redirects()}\r\n\t\t\t\t\t\t\t\trenderTitle={() => 'Confirm Publish'}\r\n\t\t\t\t\t\t\t\tconfirmButtonText={dirty ? 'Publish' : 'Skip & Publish'}\r\n\t\t\t\t\t\t\t\trenderContents={() => (\r\n\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t<h4>Are you sure you want to change the scope of this item?</h4>\r\n\t\t\t\t\t\t\t\t\t\t<p>\r\n\t\t\t\t\t\t\t\t\t\t\tIf you would like to create site specific 301s from the URL of the item, to\r\n\t\t\t\t\t\t\t\t\t\t\ta new URL, please enter them below.\r\n\t\t\t\t\t\t\t\t\t\t</p>\r\n\r\n\t\t\t\t\t\t\t\t\t\t<Redirect301OnTheFlyForm\r\n\t\t\t\t\t\t\t\t\t\t\trecord={this.props.editContext.values}\r\n\t\t\t\t\t\t\t\t\t\t\tinitialValue={this.state.initialRedirectValues}\r\n\t\t\t\t\t\t\t\t\t\t\tsiteNames={this.state.siteNamesFor301s}\r\n\t\t\t\t\t\t\t\t\t\t\tsubmitError={this.props.submitError}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}}\r\n\t\t\t\t</Field>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport { EditSaveButton as EditSaveButtonWrapped };\r\nexport default withEditContext(EditSaveButton);\r\n","import { EntityVersionType, EntityVersion } from 'types';\r\nimport { localMoment } from 'util/Time';\r\nimport moment from 'moment';\r\nimport { ModelStatus } from '../../../Roc.SharedClientApp/types/model-status';\r\n\r\nexport class HistoryHelper {\r\n\t/**\r\n\t * Returns a display name for a given version type.\r\n\t */\r\n\tpublic static getVersionTypeName(version: EntityVersion, displayName: boolean = true): string {\r\n\t\tconst dateFormat = 'M/D/YY hh:mm:ss A z';\r\n\r\n\t\tconst createDate =\r\n\t\t\tversion.type === EntityVersionType.Current\r\n\t\t\t\t? localMoment(version.modifyDate).format(dateFormat)\r\n\t\t\t\t: localMoment(version.createDate).format(dateFormat);\r\n\t\tconst modifyDate = moment(version.createDate).isSame(moment(version.modifyDate))\r\n\t\t\t? undefined\r\n\t\t\t: localMoment(version.modifyDate).format(dateFormat);\r\n\r\n\t\tswitch (version.type) {\r\n\t\t\tcase EntityVersionType.Archived:\r\n\t\t\t\treturn (displayName ? 'Archived: ' : '') + createDate;\r\n\t\t\tcase EntityVersionType.Draft:\r\n\t\t\t\treturn (\r\n\t\t\t\t\t(displayName ? 'Draft ' + (modifyDate ? 'Modified: ' : 'Created: ') : '') +\r\n\t\t\t\t\t(modifyDate ? modifyDate : createDate)\r\n\t\t\t\t);\r\n\t\t\tcase EntityVersionType.Future:\r\n\t\t\t\tlet action = 'Publish';\r\n\t\t\t\tswitch (version.status) {\r\n\t\t\t\t\tcase ModelStatus.Deleted:\r\n\t\t\t\t\t\taction = 'Deletion';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase ModelStatus.Inactive:\r\n\t\t\t\t\t\taction = 'Deactivation';\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tconst scheduledTime = version.scheduledTime\r\n\t\t\t\t\t? (displayName ? ': ' : '') + localMoment(version.scheduledTime).format(dateFormat)\r\n\t\t\t\t\t: '';\r\n\t\t\t\treturn (displayName ? 'Scheduled ' + action : '') + scheduledTime;\r\n\t\t\tcase EntityVersionType.Current:\r\n\t\t\t\treturn (displayName ? 'Current Version: ' : '') + createDate;\r\n\t\t\tdefault:\r\n\t\t\t\treturn version.type;\r\n\t\t}\r\n\t}\r\n}\r\n","import Axios, { AxiosError, CancelTokenSource } from 'axios';\r\nimport Redirect301OnTheFlyForm from 'features/redirects-301/Redirect301OnTheFlyForm';\r\nimport arrayMutators from 'final-form-arrays';\r\nimport * as React from 'react';\r\nimport { Field, Form } from 'react-final-form';\r\nimport { Omit } from 'react-router';\r\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\r\nimport { toast } from 'react-toastify';\r\nimport {\r\n\tButton,\r\n\tButtonGroup,\r\n\tDropdown,\r\n\tDropdownItem,\r\n\tDropdownMenu,\r\n\tDropdownToggle,\r\n\tModal,\r\n\tModalBody,\r\n\tModalFooter,\r\n\tModalHeader,\r\n} from 'reactstrap';\r\nimport { Direction } from 'reactstrap/lib/Dropdown';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { HistoryHelper } from 'services/HistoryHelper';\r\nimport { ModelStatus } from 'shared-client/types/model-status';\r\nimport { PERMANENT_ENTITY_DELETED_ERROR_MESSAGE } from 'shared-client/util/Constants';\r\nimport { EntityVersionType, RedirectData } from 'types';\r\nimport DeleteCommandBase from 'types/DeleteCommandBase';\r\nimport { RemovalErrorCode } from 'types/ExceptionCodes';\r\nimport { RemovalException } from 'types/Exceptions';\r\nimport { GetScopedSites } from 'util/AppStateUtils';\r\nimport { handleAxiosErrorWithValidation } from 'util/Misc';\r\nimport Confirm from '../Confirm';\r\nimport Spinner from '../Spinner';\r\nimport GarbageCanSVG from '../svg/GarbageCanSVG';\r\nimport { toastSuccess } from '../toast/Toasts';\r\nimport { areRedirectsEqual } from '../Utils';\r\nimport EditErrorAlertPopup from './EditErrorAlertPopup';\r\nimport { DateTime } from './fields';\r\nimport withEditContext, { HasEditContext } from './withEditContext';\r\nimport RocTitle from '../RocTitle';\r\nimport ValidationErrorAlert, { AlertType } from '~/components/shared/edit/ValidationErrorAlert';\r\n\r\nenum ModalStatus {\r\n\t/** No popups are being displayed */\r\n\tClosed = 0,\r\n\t/** The deletion confirmation popup is being displayed */\r\n\tDeletePopup,\r\n\t/** The schedule deletion popup is being displayed */\r\n\tSchedulePopup,\r\n\t/** The error or force delete confirmation popup is being displayed */\r\n\tErrorPopup,\r\n}\r\n\r\ninterface EditDeleteButtonProps extends RouteComponentProps<any>, HasEditContext {\r\n\t/**\r\n\t * Controls whether or not this component is disabled.\r\n\t */\r\n\tdisabled: boolean;\r\n\t/**\r\n\t * The direction of the dropdown menu\r\n\t */\r\n\tdropdownMenuDirection?: Direction;\r\n\t/**\r\n\t * Did an error occur during form submission?\r\n\t */\r\n\tsubmitError: string | string[] | null;\r\n\t/**\r\n\t * If set to true, this entity is flagged as a permanent entity, and therefore it cannot be deleted.\r\n\t */\r\n\tisPermanent?: boolean;\r\n\r\n\t/**\r\n\t * If set to false, this entity cannot be deleted.\r\n\t */\r\n\tisDeletable?: boolean;\r\n}\r\n\r\ninterface EditDeleteButtonState {\r\n\t/**\r\n\t * Indicates which modal is open (if any).\r\n\t */\r\n\tmodalStatus: ModalStatus;\r\n\t/**\r\n\t * Is the delete options modal open?\r\n\t */\r\n\tdropdownOpen: boolean;\r\n\t/**\r\n\t * Is the entity currently being deleted?\r\n\t */\r\n\tdeleting: boolean;\r\n\t/**\r\n\t * The exception (if any) that occurred when attempting to delete the entity.\r\n\t */\r\n\taxiosError: AxiosError | null;\r\n\r\n\t/**\r\n\t * A list of site names that should match the `redirects` field array.\r\n\t * This is used to display the label for each 301 a user might create when the\r\n\t * deletion modal is open.\r\n\t */\r\n\tsiteNamesFor301s: string[];\r\n\r\n\t/**\r\n\t * The initial form values to populate the deletion modal with.\r\n\t */\r\n\tinitialRedirectValues: RedirectData[];\r\n\r\n\t/**\r\n\t * The redirects that will be provided during the deletion when the user confirms that they wish\r\n\t * to force deletion of an entity with published related data.\r\n\t */\r\n\tredirectsWhenForcing?: RedirectData[];\r\n}\r\n\r\n/**\r\n * Component for deleting entities from within the entity edit page\r\n *\r\n * @class EditDeleteButton\r\n * @extends {React.Component<EditDeleteButtonProps, EditDeleteButtonState>}\r\n */\r\nclass EditDeleteButton extends React.Component<EditDeleteButtonProps, EditDeleteButtonState> {\r\n\tprivate requestToken: CancelTokenSource;\r\n\tprivate containerRef;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tdropdownOpen: false,\r\n\t\t\tmodalStatus: ModalStatus.Closed,\r\n\t\t\tdeleting: false,\r\n\t\t\taxiosError: null,\r\n\t\t\tsiteNamesFor301s: [],\r\n\t\t\tinitialRedirectValues: [],\r\n\t\t};\r\n\r\n\t\tthis.requestToken = Axios.CancelToken.source();\r\n\t\tthis.containerRef = React.createRef();\r\n\t}\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\t// when the component is being destroyed, cancel any inflight delete requests\r\n\t\tthis.requestToken.cancel();\r\n\t}\r\n\r\n\t/**\r\n\t * Toggles the visibility of the delete options dropdown.\r\n\t */\r\n\tprivate toggleDropdown = () => {\r\n\t\tthis.setState((prevState) => ({\r\n\t\t\tdropdownOpen: !prevState.dropdownOpen,\r\n\t\t}));\r\n\t};\r\n\r\n\t/**\r\n\t * Sets which modal is being displayed.\r\n\t */\r\n\tprivate setModal = (modal: ModalStatus) => {\r\n\t\tthis.setState({\r\n\t\t\tmodalStatus: modal,\r\n\t\t\tdropdownOpen: false,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Toggles the visibility of the modal. Usually called to hide it.\r\n\t */\r\n\tprivate toggleModal = (modal: ModalStatus) => {\r\n\t\tconst newModal = this.state.modalStatus === modal ? ModalStatus.Closed : modal;\r\n\t\tthis.setState({\r\n\t\t\tmodalStatus: newModal,\r\n\t\t\tdropdownOpen: false,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Called when the delete button is clicked. Displays the modal for a user to confirm that they want to delete this\r\n\t * entity record.\r\n\t */\r\n\tprivate attemptDelete = () => {\r\n\t\tconst {\r\n\t\t\teditContext: { originalScope },\r\n\t\t} = this.props;\r\n\r\n\t\tconst sites = GetScopedSites(originalScope);\r\n\r\n\t\tconst initialFormValues = sites.map((site) => ({\r\n\t\t\tredirectUrl: '',\r\n\t\t\tsiteId: site.id,\r\n\t\t}));\r\n\r\n\t\tthis.setState({\r\n\t\t\tsiteNamesFor301s: sites.map((site) => site.name),\r\n\t\t\tinitialRedirectValues: initialFormValues,\r\n\t\t});\r\n\r\n\t\t// now display the deletion modal\r\n\t\tthis.setModal(ModalStatus.DeletePopup);\r\n\t};\r\n\r\n\t/**\r\n\t * Called when the delete confirmation button is submitted. Handles deleting entities from edit pages.\r\n\t */\r\n\tprivate onConfirmDelete = async (formValues: any): Promise<void | Record<string, unknown>> => {\r\n\t\t// when we initially confirm the deletion, use the redirect values from the form\r\n\t\treturn this.requestDeleteAsync(/* force */ false, formValues && formValues.redirects);\r\n\t};\r\n\r\n\t/**\r\n\t * Called when the user clicks the confirmation button that they want to still delete the record, even though it's going to touch other records.\r\n\t */\r\n\tprivate onConfirmForceDelete = async (): Promise<void | Record<string, unknown>> => {\r\n\t\t// when confirming a forced deletion, the redirects were saved in state since there's no form anymore\r\n\t\treturn this.requestDeleteAsync(/* force */ true, this.state.redirectsWhenForcing);\r\n\t};\r\n\r\n\tprivate requestDeleteAsync = async (\r\n\t\tforce: boolean,\r\n\t\tredirects?: RedirectData[],\r\n\t): Promise<void | Record<string, unknown>> => {\r\n\t\tconst {\r\n\t\t\teditContext: {\r\n\t\t\t\tentityDefinition: { baseAjaxRoute },\r\n\t\t\t\tvalues,\r\n\t\t\t},\r\n\t\t\teditContext,\r\n\t\t} = this.props;\r\n\r\n\t\tconst url = `${baseAjaxRoute}/${values.id}`;\r\n\r\n\t\tconst data: DeleteCommandBase = {\r\n\t\t\tforce,\r\n\t\t\tredirects,\r\n\t\t};\r\n\r\n\t\tconst historyId = this.props.editContext.getActiveVersionId();\r\n\r\n\t\tif (historyId) {\r\n\t\t\tdata.historyId = historyId;\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tthis.setState({ deleting: true });\r\n\r\n\t\t\tawait AxiosHelper.delete(url, { data, cancelToken: this.requestToken.token });\r\n\r\n\t\t\t// Display a toast so users know the deletion was successful\r\n\t\t\ttoastSuccess({\r\n\t\t\t\ttoastifyOptions: {\r\n\t\t\t\t\tposition: toast.POSITION.BOTTOM_RIGHT,\r\n\t\t\t\t},\r\n\t\t\t\tcustomContent: <>{editContext.entityDefinition.singularName} successfully deleted.</>,\r\n\t\t\t});\r\n\r\n\t\t\t// redirect back to the listing page\r\n\t\t\teditContext.redirectToLastLocation();\r\n\t\t} catch (error) {\r\n\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst axiosError: AxiosError = error;\r\n\t\t\tconst serverException: RemovalException | undefined = axiosError.response && axiosError.response.data;\r\n\r\n\t\t\tif (serverException && serverException.exceptionCode === RemovalErrorCode) {\r\n\t\t\t\t// if we get here, the error was due to illegal removal of a record with published related records\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tmodalStatus: ModalStatus.ErrorPopup,\r\n\t\t\t\t\taxiosError: axiosError,\r\n\t\t\t\t\t// save off the entered redirects into state for when the user confirms a forced deletion\r\n\t\t\t\t\tredirectsWhenForcing: data.redirects,\r\n\t\t\t\t});\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// an error occurred that wasn't due to an illegal removal (could have been validation or an unexpected error)\r\n\t\t\tif (axiosError && axiosError.response && axiosError.response.status === 400 && axiosError.response.data) {\r\n\t\t\t\t// if a validation error happened, bind it to the form\r\n\t\t\t\treturn handleAxiosErrorWithValidation(axiosError, 'An error occurred while deleting.');\r\n\t\t\t}\r\n\r\n\t\t\t// otherwise, just an unexpected error occurred\r\n\t\t\tconsole.error('Unable to delete:', axiosError.message);\r\n\t\t} finally {\r\n\t\t\tthis.setState({\r\n\t\t\t\tdeleting: false,\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Called when the scheduled deletion modal is submitted.\r\n\t */\r\n\tprivate continueWithScheduledDelete = async (formValues: any): Promise<void | Record<string, unknown>> => {\r\n\t\tconst data = { ...formValues };\r\n\r\n\t\tconst {\r\n\t\t\teditContext: {\r\n\t\t\t\tentityDefinition: { baseAjaxRoute },\r\n\t\t\t\tvalues,\r\n\t\t\t},\r\n\t\t\teditContext,\r\n\t\t} = this.props;\r\n\r\n\t\tconst historyId = this.props.editContext.getActiveVersionId();\r\n\r\n\t\tif (historyId) {\r\n\t\t\tdata.historyId = historyId;\r\n\t\t}\r\n\r\n\t\tconst url = `${baseAjaxRoute}/${values.id}/schedule`;\r\n\r\n\t\ttry {\r\n\t\t\tthis.setState({ deleting: true });\r\n\r\n\t\t\tawait AxiosHelper.delete(url, { data, cancelToken: this.requestToken.token });\r\n\t\t} catch (error) {\r\n\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setState({ deleting: false });\r\n\r\n\t\t\t// bind any backend validation errors back into the scheduled deletion form\r\n\t\t\treturn handleAxiosErrorWithValidation(error, 'An error occurred while submitting deletion');\r\n\t\t}\r\n\r\n\t\t// Display a toast so users know the scheduled deletion was successful\r\n\t\ttoastSuccess({\r\n\t\t\ttoastifyOptions: {\r\n\t\t\t\tposition: toast.POSITION.BOTTOM_RIGHT,\r\n\t\t\t},\r\n\t\t\tcustomContent: (\r\n\t\t\t\t<>\r\n\t\t\t\t\t{editContext.entityDefinition.singularName} deletion successfully scheduled for{' '}\r\n\t\t\t\t\t{data.scheduledTime.format('MMMM Do, YYYY')} at {data.scheduledTime.format('h:mm a')}.\r\n\t\t\t\t</>\r\n\t\t\t),\r\n\t\t});\r\n\r\n\t\t// redirect back to the listing page\r\n\t\t// TODO: for a future improvement, this could potentially redirect to the edit\r\n\t\t// page for the future version of the entity that was just deleted\r\n\t\teditContext.redirectToLastLocation();\r\n\t};\r\n\r\n\t/**\r\n\t * Should the delete button be entirely hidden?\r\n\t */\r\n\tprivate isDeleteHidden = (): boolean => {\r\n\t\tconst {\r\n\t\t\teditContext: { values, isCreateMode },\r\n\t\t} = this.props;\r\n\r\n\t\tif (isCreateMode) {\r\n\t\t\t// if we're in create mode, there's nothing to delete\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst activeVersion = this.props.editContext.getActiveVersion();\r\n\r\n\t\tif (activeVersion !== null) {\r\n\t\t\t// the active version of the entity we're looking at isn't the live version\r\n\r\n\t\t\tif (activeVersion.type === EntityVersionType.Archived) {\r\n\t\t\t\t// don't display the delete button if we're looking at older history record that was archived\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// if the version is null, we're looking at the current version of the entity\r\n\r\n\t\t\tif (values && values.status === ModelStatus.Deleted) {\r\n\t\t\t\t// the current entity is deleted, can't re-delete\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n\r\n\t/**\r\n\t * Should the delete options be entirely hidden?\r\n\t */\r\n\tprivate areDeleteOptionsHidden = (): boolean => {\r\n\t\tif (this.isDeleteHidden()) {\r\n\t\t\t// if the delete button is entirely hidden, the options should be hidden too\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst {\r\n\t\t\teditContext: { entityDefinition },\r\n\t\t} = this.props;\r\n\r\n\t\tif (entityDefinition.hideDeleteOptions) {\r\n\t\t\t// explicitly configured to hide the delete options\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (!entityDefinition.canDeletionBeScheduled) {\r\n\t\t\t// if deletion can't be scheduled, don't display deletion options as scheduling is currently\r\n\t\t\t// the only option\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tconst activeVersion = this.props.editContext.getActiveVersion();\r\n\r\n\t\tif (activeVersion !== null) {\r\n\t\t\t// the active version of the entity we're looking at isn't the live version\r\n\t\t\tif (activeVersion.type === EntityVersionType.Future) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n\r\n\t/**\r\n\t * The good old trusty React render method\r\n\t *\r\n\t * @returns\r\n\t * @memberof EditDeleteButton\r\n\t */\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\teditContext: { entityDefinition, values },\r\n\t\t\teditContext,\r\n\t\t\tdisabled,\r\n\t\t\tdropdownMenuDirection = 'down',\r\n\t\t\tisPermanent = false,\r\n\t\t\tisDeletable = true,\r\n\t\t} = this.props;\r\n\r\n\t\tconst { dropdownOpen, modalStatus, deleting, axiosError } = this.state;\r\n\r\n\t\tlet recordName: string | null = null;\r\n\r\n\t\tif (values) {\r\n\t\t\trecordName = ` (${values.name ? values.name : values[entityDefinition.userFriendlyNameField]})`;\r\n\t\t}\r\n\r\n\t\tif (this.isDeleteHidden()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst activeVersion = editContext.getActiveVersion();\r\n\t\tconst hideDeleteOptions = this.areDeleteOptionsHidden();\r\n\r\n\t\treturn (\r\n\t\t\t<RocTitle label={PERMANENT_ENTITY_DELETED_ERROR_MESSAGE} isEnabled={isPermanent} alignment=\"left\">\r\n\t\t\t\t<div className=\"edit-form__actions-bar-item\">\r\n\t\t\t\t\t<ButtonGroup>\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tcolor=\"danger\"\r\n\t\t\t\t\t\t\tclassName=\"btn-medium\"\r\n\t\t\t\t\t\t\tonClick={this.attemptDelete}\r\n\t\t\t\t\t\t\tdisabled={disabled || isPermanent || !isDeletable}\r\n\t\t\t\t\t\t\tdata-testid=\"delete-button\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<div className=\"btn-icon-text-container\">\r\n\t\t\t\t\t\t\t\t<span className=\"btn-icon-bg\">\r\n\t\t\t\t\t\t\t\t\t<GarbageCanSVG />\r\n\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t<span className=\"btn-icon-text\">Delete</span>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</Button>\r\n\r\n\t\t\t\t\t\t{!hideDeleteOptions && !isPermanent ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t<Dropdown\r\n\t\t\t\t\t\t\t\t\tisOpen={dropdownOpen}\r\n\t\t\t\t\t\t\t\t\ttoggle={this.toggleDropdown}\r\n\t\t\t\t\t\t\t\t\tclassName=\"dropdown--right\"\r\n\t\t\t\t\t\t\t\t\tdirection={dropdownMenuDirection}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<DropdownToggle\r\n\t\t\t\t\t\t\t\t\t\tcolor=\"danger\"\r\n\t\t\t\t\t\t\t\t\t\tcaret\r\n\t\t\t\t\t\t\t\t\t\tclassName=\"dropdown-toggle-no-text dropdown-toggle\"\r\n\t\t\t\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"delete-dropdown-toggle\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t<span className=\"visually-hidden\">\r\n\t\t\t\t\t\t\t\t\t\t\t{dropdownOpen ? 'Close' : 'Open'} Delete Options\r\n\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t</DropdownToggle>\r\n\t\t\t\t\t\t\t\t\t<DropdownMenu>\r\n\t\t\t\t\t\t\t\t\t\t<DropdownItem\r\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.setModal(ModalStatus.SchedulePopup)}\r\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"delete-dropdown-delete-at\"\r\n\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\tDelete At\r\n\t\t\t\t\t\t\t\t\t\t</DropdownItem>\r\n\t\t\t\t\t\t\t\t\t</DropdownMenu>\r\n\t\t\t\t\t\t\t\t</Dropdown>\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t</ButtonGroup>\r\n\r\n\t\t\t\t\t<Form\r\n\t\t\t\t\t\tmutators={{ ...arrayMutators }}\r\n\t\t\t\t\t\tonSubmit={this.onConfirmDelete}\r\n\t\t\t\t\t\trender={(props) => {\r\n\t\t\t\t\t\t\tconst { handleSubmit, submitError } = props;\r\n\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<Field name=\"redirects\" subscription={{ dirty: true }} isEqual={areRedirectsEqual}>\r\n\t\t\t\t\t\t\t\t\t{(props) => {\r\n\t\t\t\t\t\t\t\t\t\tconst {\r\n\t\t\t\t\t\t\t\t\t\t\tmeta: { dirty },\r\n\t\t\t\t\t\t\t\t\t\t} = props;\r\n\r\n\t\t\t\t\t\t\t\t\t\tconst show301Form =\r\n\t\t\t\t\t\t\t\t\t\t\t// show the 301 creation form if not hidden and the entity has a url\r\n\t\t\t\t\t\t\t\t\t\t\t!editContext.entityDefinition.hideCreate301OnTheFly &&\r\n\t\t\t\t\t\t\t\t\t\t\tvalues &&\r\n\t\t\t\t\t\t\t\t\t\t\tvalues.status === ModelStatus.Published &&\r\n\t\t\t\t\t\t\t\t\t\t\tvalues.url;\r\n\r\n\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t<Confirm\r\n\t\t\t\t\t\t\t\t\t\t\t\tcolor=\"danger\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tisOpen={modalStatus === ModalStatus.DeletePopup}\r\n\t\t\t\t\t\t\t\t\t\t\t\tonCancel={() => this.setModal(ModalStatus.Closed)}\r\n\t\t\t\t\t\t\t\t\t\t\t\tonConfirm={handleSubmit}\r\n\t\t\t\t\t\t\t\t\t\t\t\trenderTitle={() => 'Confirm Deletion'}\r\n\t\t\t\t\t\t\t\t\t\t\t\tconfirmButtonText={\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdirty || activeVersion !== null || !show301Form\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? // display just \"delete\" if a 301 has been entered, if we're editing a non-current version, or if the 301 form is hidden\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  'Delete'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: // otherwise show the skip option since the 301 form is visible and is clean\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t  'Skip & Delete'\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\tconfirmTestId=\"button-confirm-delete\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tcancelTestId=\"button-cancel-delete\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tinProgress={deleting}\r\n\t\t\t\t\t\t\t\t\t\t\t\trenderContents={() => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\treturn activeVersion === null ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{submitError ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ValidationErrorAlert\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubmitError={submitError}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talertType={AlertType.Delete}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{/* if the current version is null, we're looking at the current record */}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h4>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAre you sure you want to delete this{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{editContext.entityDefinition.singularName}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{recordName}?\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</h4>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{show301Form ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tIf you would like to create site specific 301s\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom the URL of the item, to a new URL, please\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tenter them below.\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Redirect301OnTheFlyForm\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trecord={values}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinitialValue={this.state.initialRedirectValues}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsiteNames={this.state.siteNamesFor301s}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubmitError={submitError}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfieldName=\"redirects\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// otherwise, we're looking at the non-current record\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAre you sure you want to delete this{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{HistoryHelper.getVersionTypeName(activeVersion)}{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{editContext.entityDefinition.singularName}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{recordName}?\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t</Field>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t<EditErrorAlertPopup\r\n\t\t\t\t\t\taxiosError={axiosError}\r\n\t\t\t\t\t\tisOpen={modalStatus === ModalStatus.ErrorPopup}\r\n\t\t\t\t\t\tonCancel={() => this.setModal(ModalStatus.Closed)}\r\n\t\t\t\t\t\tonConfirm={this.onConfirmForceDelete}\r\n\t\t\t\t\t\tinProgress={deleting}\r\n\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t<Modal\r\n\t\t\t\t\t\tisOpen={modalStatus === ModalStatus.SchedulePopup}\r\n\t\t\t\t\t\ttoggle={() => this.toggleModal(ModalStatus.SchedulePopup)}\r\n\t\t\t\t\t\tclassName=\"edit-save-delete-modal modal-lg\"\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<Form\r\n\t\t\t\t\t\t\tonSubmit={this.continueWithScheduledDelete}\r\n\t\t\t\t\t\t\trender={(props) => {\r\n\t\t\t\t\t\t\t\tconst { handleSubmit, submitError, submitting } = props;\r\n\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t<form onSubmit={handleSubmit}>\r\n\t\t\t\t\t\t\t\t\t\t<ModalHeader toggle={() => this.toggleModal(ModalStatus.SchedulePopup)}>\r\n\t\t\t\t\t\t\t\t\t\t\tSelect Deletion Date\r\n\t\t\t\t\t\t\t\t\t\t</ModalHeader>\r\n\t\t\t\t\t\t\t\t\t\t<ModalBody>\r\n\t\t\t\t\t\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t\t\t\t\t\tWhen would you like to schedule the deletion of this{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{editContext.entityDefinition.singularName}\r\n\t\t\t\t\t\t\t\t\t\t\t\t{recordName}?\r\n\t\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t\t\t<ValidationErrorAlert\r\n\t\t\t\t\t\t\t\t\t\t\t\tsubmitError={submitError}\r\n\t\t\t\t\t\t\t\t\t\t\t\talertType={AlertType.Edit}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"visually-hidden\">Scheduled deletion time</span>\r\n\t\t\t\t\t\t\t\t\t\t\t<Field name=\"scheduledTime\" component={DateTime} />\r\n\t\t\t\t\t\t\t\t\t\t</ModalBody>\r\n\t\t\t\t\t\t\t\t\t\t<ModalFooter>\r\n\t\t\t\t\t\t\t\t\t\t\t{deleting ? <Spinner /> : null}\r\n\t\t\t\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"btn-outline-primary-alt btn-width-large\"\r\n\t\t\t\t\t\t\t\t\t\t\t\toutline\r\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.toggleModal(ModalStatus.SchedulePopup)}\r\n\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\tCancel\r\n\t\t\t\t\t\t\t\t\t\t\t</Button>{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"btn-width-large\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={submitting}\r\n\t\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"submit-scheduled-date\"\r\n\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\tOK\r\n\t\t\t\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t\t\t\t</ModalFooter>\r\n\t\t\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</Modal>\r\n\t\t\t\t</div>\r\n\t\t\t</RocTitle>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport class EditDeleteButtonWrapped extends EditDeleteButton {}\r\n\r\nexport default withRouter<Omit<EditDeleteButtonProps, keyof HasEditContext>, any>(\r\n\twithEditContext(EditDeleteButtonWrapped),\r\n);\r\n","import React, { useContext } from 'react';\r\nimport { EntityDefinition } from 'types';\r\nimport EditContext from './EditContext';\r\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\r\n\r\nexport interface RenderEditToListingActionProps extends RouteComponentProps<any> {\r\n\tlastLocationPathAndQuery: string;\r\n\tentityDefinition: EntityDefinition;\r\n}\r\n\r\ninterface EditToListingActionProps extends RouteComponentProps<any> {\r\n\tchildren: (props: RenderEditToListingActionProps) => React.ReactElement;\r\n}\r\n\r\n/**\r\n * Cancel button for edit pages, which returns you back to where you came from\r\n *\r\n */\r\nfunction EditToListingAction(props: EditToListingActionProps) {\r\n\tconst {\r\n\t\tlastLocation,\r\n\t\tentityDefinition: { baseRoute },\r\n\t\tentityDefinition,\r\n\t} = useContext(EditContext);\r\n\r\n\tconst { children, location, history, match } = props;\r\n\tconst lastLocationPathAndQuery =\r\n\t\tlastLocation === null || lastLocation.pathname === location.pathname\r\n\t\t\t? baseRoute\r\n\t\t\t: lastLocation.pathname + lastLocation.search;\r\n\r\n\treturn children({ lastLocationPathAndQuery, entityDefinition, location, history, match });\r\n}\r\n\r\nexport default withRouter(EditToListingAction);\r\n","import * as React from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport EditToListingAction, { RenderEditToListingActionProps } from './EditToListingAction';\r\n\r\ninterface EditCancelButtonProps {\r\n\tlabel?: string;\r\n}\r\n\r\n/**\r\n * UI for the \"Cancel\" button.\r\n */\r\nfunction EditCancelButton(props: EditCancelButtonProps) {\r\n\tconst { label = 'Cancel' } = props;\r\n\r\n\treturn (\r\n\t\t<EditToListingAction>\r\n\t\t\t{({ lastLocationPathAndQuery }: RenderEditToListingActionProps) => (\r\n\t\t\t\t<Link\r\n\t\t\t\t\tto={lastLocationPathAndQuery}\r\n\t\t\t\t\tdata-testid=\"edit-cancel-button\"\r\n\t\t\t\t\tclassName=\"btn btn-outline-primary-alt btn-width-normal btn-medium\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{label}\r\n\t\t\t\t</Link>\r\n\t\t\t)}\r\n\t\t</EditToListingAction>\r\n\t);\r\n}\r\n\r\nexport default EditCancelButton;\r\n","import ErrorAlert from '../ErrorAlert';\r\nimport EditContext from './EditContext';\r\nimport React, { useContext } from 'react';\r\n\r\nfunction EditErrorOnSaveAlert() {\r\n\tconst { errorOnSave, axiosError } = useContext(EditContext);\r\n\treturn errorOnSave ? <ErrorAlert error={axiosError || null} /> : null;\r\n}\r\n\r\nexport default EditErrorOnSaveAlert;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Spinner SVG for loading purposes\r\n *\r\n * @returns\r\n */\r\nfunction CalendarSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 30 32\"\r\n\t\t\tclassName={'icon ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t\tdata-testid={svgProps.testId}\r\n\t\t>\r\n\t\t\t<path\r\n\t\t\t\tfill=\"#929fb3\"\r\n\t\t\t\td=\"M27.429 31.998h-25.144c-0.011 0-0.024 0-0.038 0-1.227 0-2.224-0.983-2.247-2.204l-0-0.002v-24.274c0.022-1.224 1.020-2.208 2.247-2.208 0.013 0 0.026 0 0.039 0l-0.002-0h2.286v1.104c0.068 1.841 1.577 3.307 3.428 3.307s3.36-1.466 3.428-3.301l0-0.006v-1.104h6.856v1.104c0.068 1.841 1.577 3.307 3.428 3.307s3.36-1.466 3.428-3.301l0-0.006v-1.104h2.285c0.012-0 0.026-0 0.040-0 1.227 0 2.225 0.984 2.247 2.206l0 0.002v24.276c-0.024 1.223-1.021 2.205-2.247 2.205-0.013 0-0.026-0-0.040-0l0.002 0zM27.429 11.034h-25.144v18.758h25.144zM8 16.552h-3.429v-3.312h3.429zM8 22.070h-3.429v-3.312h3.429zM8 27.588h-3.429v-3.312h3.429zM13.714 16.553h-3.429v-3.313h3.429zM13.714 22.071h-3.429v-3.313h3.429zM13.714 27.589h-3.429v-3.313h3.429zM19.428 16.555h-3.429v-3.315h3.429zM19.428 22.073h-3.429v-3.315h3.429zM19.428 27.59h-3.429v-3.315h3.429zM25.142 16.556h-3.429v-3.316h3.429zM25.142 22.074h-3.429v-3.316h3.429zM25.142 27.592h-3.429v-3.316h3.429zM21.679 6.62c-0.012 0-0.025 0-0.039 0-1.208 0-2.189-0.968-2.212-2.17l-0-0.002v-2.276c0.055-1.2 1.041-2.152 2.25-2.152s2.195 0.952 2.25 2.147l0 0.005v2.276c-0.022 1.204-1.004 2.172-2.212 2.172-0.013 0-0.026-0-0.039-0l0.002 0zM7.965 6.62c-0.012 0-0.025 0-0.039 0-1.208 0-2.189-0.968-2.212-2.17l-0-0.002v-2.276c0.055-1.2 1.041-2.152 2.25-2.152s2.195 0.952 2.25 2.147l0 0.005v2.276c-0.023 1.205-1.005 2.172-2.213 2.172-0.013 0-0.025-0-0.038-0l0.002 0z\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nCalendarSVG.defaultProps = { class: '' };\r\n\r\nexport default CalendarSVG;\r\n","import React, { useState } from 'react';\r\nimport InfoSVG from '../svg/InfoSVG';\r\nimport Popover from 'reactstrap/lib/Popover';\r\nimport PopoverBody from 'reactstrap/lib/PopoverBody';\r\nimport { EntityVersion, EntityVersionType } from 'types';\r\nimport EditStatusLabel from './EditStatusLabel';\r\nimport { formatDateTime } from 'util/Time';\r\nimport CheckCircleSVG from '../svg/CheckCircleSVG';\r\nimport DashCircleSVG from '../svg/DashCircleSVG';\r\nimport FolderSVG from '../svg/FolderSVG';\r\nimport CalendarSVG from '../svg/CalendarSVG';\r\nimport CalendarPowerSVG from '../svg/CalendarPowerSVG';\r\nimport CalendarCheckmarkSVG from '../svg/CalendarCheckmarkSVG';\r\nimport CalendarTrashSVG from '../svg/CalendarTrashSVG';\r\nimport GarbageCanCircleSVG from '../svg/GarbageCanCircleSVG';\r\nimport PencilWriteSVG from '../svg/PencilWriteSVG';\r\nimport { ModelStatus } from '../../../../../Roc.SharedClientApp/types/model-status';\r\n\r\ninterface EditVersionStatusProps {\r\n\tversion: EntityVersion;\r\n\tindex: number;\r\n}\r\n\r\ninterface EditVersionListingStatusIconProps {\r\n\tversion: EntityVersion;\r\n\tindex: number;\r\n}\r\n\r\n/**\r\n * Component for rendering version listing status icons on the Versions tab on Admin Edit Page.\r\n *\r\n * @param {EditVersionListingStatusIconProps} props\r\n */\r\nfunction EditVersionListingStatusIcon(props: EditVersionListingStatusIconProps) {\r\n\tconst { type, status } = props.version;\r\n\tconst defaultIconStyles = 'tabs-table__td-icon';\r\n\tconst archivedIconStyles = 'listing-item-status-icon__right';\r\n\r\n\tswitch (type) {\r\n\t\tcase EntityVersionType.Current:\r\n\t\t\tif (status === ModelStatus.Published) {\r\n\t\t\t\treturn <CheckCircleSVG class={defaultIconStyles} testId={'icon-check-' + props.index} />;\r\n\t\t\t} else if (status === ModelStatus.Inactive) {\r\n\t\t\t\treturn <DashCircleSVG class={defaultIconStyles} testId={'icon-dash-' + props.index} />;\r\n\t\t\t} else if (status === ModelStatus.Deleted) {\r\n\t\t\t\treturn <GarbageCanCircleSVG class={defaultIconStyles} testId={'icon-garbage-can-' + props.index} />;\r\n\t\t\t} else {\r\n\t\t\t\treturn <InfoSVG class={defaultIconStyles} testId={'icon-info-' + props.index} />;\r\n\t\t\t}\r\n\t\tcase EntityVersionType.Future:\r\n\t\t\tif (status === ModelStatus.Published) {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<CalendarCheckmarkSVG\r\n\t\t\t\t\t\tclass={defaultIconStyles + ' icon-calendar-checkmark'}\r\n\t\t\t\t\t\ttestId={'icon-calendar-checkmark-' + props.index}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\t} else if (status === ModelStatus.Inactive) {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<CalendarPowerSVG\r\n\t\t\t\t\t\tclass={defaultIconStyles + ' icon-calendar-power'}\r\n\t\t\t\t\t\ttestId={'icon-calendar-power-' + props.index}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\t} else if (status === ModelStatus.Deleted) {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<CalendarTrashSVG\r\n\t\t\t\t\t\tclass={defaultIconStyles + ' icon-calendar-trash'}\r\n\t\t\t\t\t\ttestId={'icon-calendar-trash-' + props.index}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\treturn <CalendarSVG class={defaultIconStyles} testId={'icon-calendar-' + props.index} />;\r\n\t\t\t}\r\n\t\tcase EntityVersionType.Archived:\r\n\t\t\tif (status === ModelStatus.Published) {\r\n\t\t\t\treturn <CheckCircleSVG class={archivedIconStyles} testId={'icon-check-' + props.index} />;\r\n\t\t\t} else if (status === ModelStatus.Inactive) {\r\n\t\t\t\treturn <DashCircleSVG class={archivedIconStyles} testId={'icon-dash-' + props.index} />;\r\n\t\t\t} else if (status === ModelStatus.Deleted) {\r\n\t\t\t\treturn <GarbageCanCircleSVG class={archivedIconStyles} testId={'icon-garbage-can-' + props.index} />;\r\n\t\t\t} else {\r\n\t\t\t\treturn <InfoSVG class={archivedIconStyles} testId={'icon-info-' + props.index} />;\r\n\t\t\t}\r\n\t\tcase EntityVersionType.Draft:\r\n\t\t\treturn (\r\n\t\t\t\t<PencilWriteSVG class={defaultIconStyles + ' icon-pencil-write'} testId={'icon-draft-' + props.index} />\r\n\t\t\t);\r\n\t\tdefault:\r\n\t\t\treturn <InfoSVG class={defaultIconStyles} testId={'icon-info-' + props.index} />;\r\n\t}\r\n}\r\n\r\n// Gets status text for icon popover\r\nfunction getVersionStatus(version: EntityVersion) {\r\n\tconst { type, status } = version;\r\n\r\n\tswitch (type) {\r\n\t\tcase EntityVersionType.Current:\r\n\t\t\treturn status || 'Current';\r\n\t\tcase EntityVersionType.Archived:\r\n\t\tcase EntityVersionType.Future:\r\n\t\t\tif (status === 'Published') {\r\n\t\t\t\treturn `${EntityVersionType[type]} Publish`;\r\n\t\t\t} else if (status === 'Inactive') {\r\n\t\t\t\treturn `${EntityVersionType[type]} Inactivation`;\r\n\t\t\t} else if (status === 'Deleted') {\r\n\t\t\t\treturn `${EntityVersionType[type]} Deletion`;\r\n\t\t\t} else {\r\n\t\t\t\treturn 'Archived';\r\n\t\t\t}\r\n\t\tcase EntityVersionType.Draft:\r\n\t\t\treturn 'Draft';\r\n\t\tdefault:\r\n\t\t\treturn 'Unknown';\r\n\t}\r\n}\r\n\r\n/**\r\n * Component for rendering the status popup for version entities.\r\n *\r\n * @param {EditVersionStatusProps} props\r\n * @returns\r\n */\r\nfunction EditVersionStatus(props: EditVersionStatusProps) {\r\n\tconst [isStatusPopoverOpen, setIsStatusPopoverOpen] = useState(false);\r\n\r\n\tconst {\r\n\t\tversion: { id },\r\n\t\tversion,\r\n\t\tindex,\r\n\t} = props;\r\n\r\n\t/**\r\n\t * Toggle value for isStatusPopoverOpen state.\r\n\t *\r\n\t */\r\n\tfunction toggleStatusPopover() {\r\n\t\tsetIsStatusPopoverOpen(!isStatusPopoverOpen);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<div className=\"listing-item-status-icon-wrapper\">\r\n\t\t\t{version.type === EntityVersionType.Archived ? (\r\n\t\t\t\t<div>\r\n\t\t\t\t\t<FolderSVG class={'listing-item-status-icon__left'} testId={`icon-archived-${index}`} />\r\n\t\t\t\t</div>\r\n\t\t\t) : null}\r\n\t\t\t<div>\r\n\t\t\t\t<button\r\n\t\t\t\t\tclassName=\"listing-status-btn px-2\"\r\n\t\t\t\t\tid={id ? 'Popover-' + id : 'Popover-current'}\r\n\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\tonClick={toggleStatusPopover}\r\n\t\t\t\t>\r\n\t\t\t\t\t<EditVersionListingStatusIcon version={version} index={index} />\r\n\t\t\t\t</button>\r\n\t\t\t\t<Popover\r\n\t\t\t\t\ttarget={id ? 'Popover-' + id : 'Popover-current'}\r\n\t\t\t\t\tplacement=\"right\"\r\n\t\t\t\t\tisOpen={isStatusPopoverOpen}\r\n\t\t\t\t\ttoggle={toggleStatusPopover}\r\n\t\t\t\t\tclassName=\"popover-wider\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<PopoverBody>\r\n\t\t\t\t\t\t<EditStatusLabel label={'Status'} value={getVersionStatus(version)} />\r\n\t\t\t\t\t\t<EditStatusLabel label={'Version Number'} value={version.versionNo} />\r\n\t\t\t\t\t\t<EditStatusLabel\r\n\t\t\t\t\t\t\tlabel={\r\n\t\t\t\t\t\t\t\t(version.type === EntityVersionType.Future ||\r\n\t\t\t\t\t\t\t\tversion.type === EntityVersionType.Archived\r\n\t\t\t\t\t\t\t\t\t? 'Originally '\r\n\t\t\t\t\t\t\t\t\t: '') + 'Created By'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvalue={version.createUser}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<EditStatusLabel\r\n\t\t\t\t\t\t\tlabel={\r\n\t\t\t\t\t\t\t\t(version.type === EntityVersionType.Future ||\r\n\t\t\t\t\t\t\t\tversion.type === EntityVersionType.Archived\r\n\t\t\t\t\t\t\t\t\t? 'Originally '\r\n\t\t\t\t\t\t\t\t\t: '') + 'Created On'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvalue={formatDateTime(version.createDate)}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<EditStatusLabel\r\n\t\t\t\t\t\t\tlabel={\r\n\t\t\t\t\t\t\t\t(version.type == EntityVersionType.Future\r\n\t\t\t\t\t\t\t\t\t? 'Scheduled'\r\n\t\t\t\t\t\t\t\t\t: version.type == EntityVersionType.Archived\r\n\t\t\t\t\t\t\t\t\t? 'Archived'\r\n\t\t\t\t\t\t\t\t\t: 'Modified') + ' By'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvalue={version.modifyUser}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<EditStatusLabel\r\n\t\t\t\t\t\t\tlabel={\r\n\t\t\t\t\t\t\t\tversion.type === EntityVersionType.Future\r\n\t\t\t\t\t\t\t\t\t? 'Scheduled For'\r\n\t\t\t\t\t\t\t\t\t: version.type == EntityVersionType.Archived\r\n\t\t\t\t\t\t\t\t\t? 'Archived On'\r\n\t\t\t\t\t\t\t\t\t: 'Modified On'\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tvalue={\r\n\t\t\t\t\t\t\t\tversion.type === EntityVersionType.Future && version.scheduledTime\r\n\t\t\t\t\t\t\t\t\t? formatDateTime(version.scheduledTime)\r\n\t\t\t\t\t\t\t\t\t: formatDateTime(version.modifyDate)\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</PopoverBody>\r\n\t\t\t\t</Popover>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\nexport default EditVersionStatus;\r\n","import * as React from 'react';\r\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\r\nimport { Button, Modal, ModalBody, ModalFooter, ModalHeader } from 'reactstrap';\r\nimport { HistoryHelper } from 'services/HistoryHelper';\r\nimport { EntityVersion, EntityVersionType } from 'types';\r\nimport CircleButton from '../CircleButton';\r\nimport PencilSVG from '../svg/PencilSVG';\r\nimport { TabsListEmpty } from '../tabs/Tabs';\r\nimport EditVersionStatus from './EditVersionStatus';\r\nimport withEditContext, { HasEditContext } from './withEditContext';\r\n\r\ntype EditVersionProps = RouteComponentProps<any> & HasEditContext;\r\n\r\ninterface EditVersionState {\r\n\tconfirmModalIsOpen: boolean;\r\n\tselectVersionmodalIsOpen: boolean;\r\n\tpendingVersionChange: EntityVersion | null;\r\n\tselectedVersionTypeId: number | null;\r\n\tisStatusPopoverOpen: boolean;\r\n}\r\n\r\n/**\r\n * Component that lists all available versions of an entity and allows switching the values currently\r\n * being edited to a specific previous version or Draft.\r\n *\r\n * @class EditVersion\r\n * @extends {React.Component<EditVersionProps, EditVersionState>}\r\n */\r\nclass EditVersion extends React.Component<EditVersionProps, EditVersionState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tconfirmModalIsOpen: false,\r\n\t\t\tselectVersionmodalIsOpen: false,\r\n\t\t\tpendingVersionChange: null,\r\n\t\t\tselectedVersionTypeId: null,\r\n\t\t\tisStatusPopoverOpen: false,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Toggles the visibility of the modal. Usually called to hide it.\r\n\t *\r\n\t * @memberof EditVersion\r\n\t */\r\n\tpublic toggleConfirmModal = () => {\r\n\t\tthis.setState({ confirmModalIsOpen: !this.state.confirmModalIsOpen });\r\n\t};\r\n\r\n\t/**\r\n\t * Toggles the visibility of the select version modal.\r\n\t *\r\n\t * @memberof EditVersion\r\n\t */\r\n\tpublic toggleSelectVersionModal = () => {\r\n\t\tthis.setState({ selectVersionmodalIsOpen: !this.state.selectVersionmodalIsOpen });\r\n\t};\r\n\r\n\t/**\r\n\t * After the user confirms that they want to see the other version, load the values from that version\r\n\t * and close the modal.\r\n\t *\r\n\t * @private\r\n\t * @memberof EditVersion\r\n\t */\r\n\tprivate continueWithVersionChange = () => {\r\n\t\tconst version = this.state.pendingVersionChange;\r\n\t\tif (!version) {\r\n\t\t\t// should never happen, so it'll happen all the time i'm sure.\r\n\t\t\tconsole.warn('Lost track of pending version change.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconsole.debug('Attempting version change:', version.versionNo);\r\n\t\tthis.props.history.replace({ search: version.id ? 'historyId=' + version.id : '' });\r\n\t\tthis.props.editContext.load();\r\n\r\n\t\tthis.toggleConfirmModal();\r\n\t};\r\n\r\n\t/**\r\n\t * Event handler for the dropdown that contains all versions.\r\n\t *\r\n\t * @private\r\n\t * @memberof EditVersion\r\n\t */\r\n\tprivate handleVersionSelection = (version: EntityVersion) => {\r\n\t\tconst selectedVersion = version;\r\n\r\n\t\tif (!selectedVersion) {\r\n\t\t\t// should never happen, so it'll happen all the time i'm sure.\r\n\t\t\tconsole.warn('Unable to find selected version?');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.setState({\r\n\t\t\tpendingVersionChange: selectedVersion,\r\n\t\t});\r\n\r\n\t\tthis.toggleConfirmModal();\r\n\t};\r\n\r\n\t/**\r\n\t * Updates currently selected category\r\n\t *\r\n\t * @memberof EditVersion\r\n\t */\r\n\tpublic handleCategoryClick = (versionType: number | null) => {\r\n\t\tthis.setState({ selectedVersionTypeId: versionType });\r\n\t};\r\n\r\n\t/**\r\n\t * Toggles the status popover\r\n\t *\r\n\t * @memberof EditVersion\r\n\t */\r\n\tpublic toggleStatusPopover = () => {\r\n\t\tthis.setState({ isStatusPopoverOpen: true });\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst { selectedVersionTypeId } = this.state;\r\n\r\n\t\t// we're essentially binding the dropdown to a static value, which depends on the history value in the query string.\r\n\t\tconst aggregateVersions = this.props.editContext.getAllVersions();\r\n\r\n\t\tconst selectedVersion = this.props.editContext.getActiveVersion();\r\n\r\n\t\tconst distinctVersionTypes = [\r\n\t\t\t...new Set([...aggregateVersions].map((aggregateVersion) => aggregateVersion.type)),\r\n\t\t].sort();\r\n\r\n\t\tlet displayedVersions: EntityVersion[] = [];\r\n\r\n\t\tif (selectedVersionTypeId === null) {\r\n\t\t\tdisplayedVersions = aggregateVersions;\r\n\t\t} else {\r\n\t\t\tdisplayedVersions = aggregateVersions.filter((version) => {\r\n\t\t\t\treturn version.type === selectedVersionTypeId;\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tlet btnText = '';\r\n\r\n\t\tif (selectedVersion) {\r\n\t\t\tbtnText =\r\n\t\t\t\t'Version: ' + selectedVersion.versionNo + ' - ' + HistoryHelper.getVersionTypeName(selectedVersion);\r\n\t\t} else {\r\n\t\t\tbtnText = 'Version: Current';\r\n\t\t}\r\n\r\n\t\tif (btnText.length > 30) {\r\n\t\t\tbtnText = btnText.substring(0, 30) + '...';\r\n\t\t}\r\n\r\n\t\tconst showStatus =\r\n\t\t\t!this.props.editContext.isCreateMode && !this.props.editContext.entityDefinition.hideStatusOnEdit;\r\n\r\n\t\treturn (\r\n\t\t\t<div>\r\n\t\t\t\t<div className=\"version\">\r\n\t\t\t\t\t<div className=\"version__header\">\r\n\t\t\t\t\t\t<label className=\"version__header-label\">Filter:</label>\r\n\t\t\t\t\t\t<select\r\n\t\t\t\t\t\t\tclassName=\"form-control\"\r\n\t\t\t\t\t\t\tdata-testid=\"version-filter\"\r\n\t\t\t\t\t\t\tonChange={(e) => this.handleCategoryClick(e.target.value ? parseInt(e.target.value) : null)}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<option value=\"\">All</option>\r\n\t\t\t\t\t\t\t{distinctVersionTypes.map((versionType, index) => (\r\n\t\t\t\t\t\t\t\t<option key={index} value={versionType}>\r\n\t\t\t\t\t\t\t\t\t{EntityVersionType[versionType]}\r\n\t\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t</select>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div className=\"version__body\">\r\n\t\t\t\t\t\t{displayedVersions.length === 0 ? (\r\n\t\t\t\t\t\t\t<TabsListEmpty message=\"No versions found in this category.\" />\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t<div className=\"roc-list roc-list--full-width roc-list--wide\" role=\"table\">\r\n\t\t\t\t\t\t\t\t<div className=\"roc-list__body\" role=\"rowgroup\">\r\n\t\t\t\t\t\t\t\t\t{displayedVersions.map((version, index) => {\r\n\t\t\t\t\t\t\t\t\t\tlet isActive = false;\r\n\r\n\t\t\t\t\t\t\t\t\t\tif (selectedVersion) {\r\n\t\t\t\t\t\t\t\t\t\t\tif (version.id === selectedVersion.id) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tisActive = true;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\tif (version.type === 0) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tisActive = true;\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\tconst createdDate = HistoryHelper.getVersionTypeName(version, false);\r\n\r\n\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\t\t\t\t\trole=\"row\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"roc-list__row\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tkey={index}\r\n\t\t\t\t\t\t\t\t\t\t\t\tdata-testid={`version-item-${index}`}\r\n\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{showStatus ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"roc-list__cell roc-list__cell--icon roc-list__cell--icon-versions\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<EditVersionStatus version={version} index={index} />\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t<div role=\"cell\" className=\"roc-list__cell roc-list__cell--label\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{isActive ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<>{createdDate} (Editing)</>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"btn-link roc-list__cell-link\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-testid={`link-name-${index}`}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.handleVersionSelection(version)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{createdDate}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<div role=\"cell\" className=\"roc-list__cell roc-list__cell--actions\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{isActive ? null : (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<CircleButton\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => this.handleVersionSelection(version)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ticon={<PencilSVG />}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-testid={`version-edit-${index}`}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<Modal isOpen={this.state.confirmModalIsOpen} toggle={this.toggleConfirmModal}>\r\n\t\t\t\t\t<ModalHeader toggle={this.toggleConfirmModal} data-testid=\"version-change-text\">\r\n\t\t\t\t\t\tVersion Change\r\n\t\t\t\t\t</ModalHeader>\r\n\t\t\t\t\t<ModalBody>\r\n\t\t\t\t\t\tYou are about to start editing a different version of this entity. Any pending changes will be\r\n\t\t\t\t\t\tlost. Continue?\r\n\t\t\t\t\t</ModalBody>\r\n\t\t\t\t\t<ModalFooter>\r\n\t\t\t\t\t\t<Button color=\"primary-alt\" outline onClick={this.toggleConfirmModal}>\r\n\t\t\t\t\t\t\tCancel\r\n\t\t\t\t\t\t</Button>{' '}\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\tdata-testid=\"btn-continue-version-change\"\r\n\t\t\t\t\t\t\tonClick={this.continueWithVersionChange}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tContinue\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</ModalFooter>\r\n\t\t\t\t</Modal>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default withRouter(withEditContext(EditVersion));\r\n","import Axios, { AxiosError, CancelTokenSource } from 'axios';\r\nimport React from 'react';\r\nimport { FormApi, FORM_ERROR } from 'final-form';\r\nimport AxiosHelper, { CustomAxiosRequestConfig } from 'services/AxiosHelper';\r\nimport {\r\n\tEditContextState,\r\n\tEntityVersion,\r\n\tEntityVersionType,\r\n\tFieldSuggestionMap,\r\n\tSubmissionState,\r\n\tEntityDefinition,\r\n\tFormValuesTransformHandler,\r\n\tQueryResponse,\r\n} from 'types';\r\nimport { getLastLocation } from '../LastLocationProvider';\r\nimport EditContext from './EditContext';\r\nimport { handleAxiosErrorWithValidation, getValidationErrorSource, ValidationErrorSource } from 'util/Misc';\r\nimport { getTooltipsForEntity } from 'services/EntityDefinitionService';\r\nimport { SyncCustomFrontEndValidation } from './fields/mutators/mutators';\r\nimport { toastSuccess } from '../toast/Toasts';\r\nimport { toast } from 'react-toastify';\r\nimport { getHandleableException } from 'types/Exceptions';\r\nimport AppState from 'AppState';\r\nimport { Redirect } from 'react-router';\r\nimport moment, { Moment } from 'moment';\r\nimport RecordScope from 'types/__models__/RecordScope';\r\nimport { ModelStatus } from '../../../../../Roc.SharedClientApp/types/model-status';\r\nimport BaseDto from 'types/__models__/BaseDto';\r\n\r\ntype FormValuesTransformMap = { [key: string]: FormValuesTransformHandler };\r\n\r\n/**\r\n * Higher-Order Component (HOC) to have reusable functions to handle edit page features\r\n * This higher order component builds parts of the EditContextState around the wrapped component\r\n *\r\n * *** React convention for passing down props:\r\n * https://reactjs.org/docs/higher-order-components.html#convention-pass-unrelated-props-through-to-the-wrapped-component\r\n * @param WrappedComponent The component being wrapped\r\n * @param entityDefinition The definition of the entity used by this edit page component.\r\n * @param isEmbeddedEdit Unknown. Please document me!\r\n * @template TDto The dto object representing the entity being edited or created\r\n * @template TQueryResponse The dto response object sent from the backend\r\n */\r\nfunction withEdit<TDto = any, TQueryResponse extends QueryResponse<TDto> = QueryResponse<TDto>>(\r\n\tWrappedComponent: any,\r\n\tentityDefinition: EntityDefinition,\r\n\tisEmbeddedEdit = false,\r\n) {\r\n\tclass WithEdit extends React.Component<any, EditContextState<TDto, TQueryResponse>> {\r\n\t\tprivate static readonly HistoryIdParam: string = 'historyId';\r\n\r\n\t\tprivate requestToken: CancelTokenSource;\r\n\t\tprivate tooltipRequestToken: CancelTokenSource;\r\n\t\tpublic static displayName: string;\r\n\t\t// isMounted variable used to help prevent tests from failing due to missing 'createEvent' property\r\n\t\tprivate isMounted = false;\r\n\r\n\t\t/**\r\n\t\t * Stores handlers that allow transforming the form data before sending it to the server.\r\n\t\t */\r\n\t\tprivate formValuesTransformHandlers: FormValuesTransformMap = {};\r\n\r\n\t\tconstructor(props) {\r\n\t\t\tsuper(props);\r\n\r\n\t\t\tthis.state = this.getInitialState();\r\n\r\n\t\t\tthis.requestToken = Axios.CancelToken.source();\r\n\t\t\tthis.tooltipRequestToken = Axios.CancelToken.source();\r\n\t\t}\r\n\r\n\t\tprivate getInitialState(): EditContextState<TDto, TQueryResponse> {\r\n\t\t\t// the props.match comes from React Router and this is how we're getting the id\r\n\t\t\t// https://reacttraining.com/react-router/web/guides/philosophy\r\n\t\t\tconst editingId = this.props.match?.params.id;\r\n\r\n\t\t\tlet cultureId: string | undefined;\r\n\t\t\tif (entityDefinition.localizeMode) {\r\n\t\t\t\tconst fallbackCulture = AppState.cultures.find((culture) => culture.isFallback);\r\n\t\t\t\tif (fallbackCulture) {\r\n\t\t\t\t\tcultureId = fallbackCulture.id;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn {\r\n\t\t\t\tredirectPathName: '',\r\n\t\t\t\tredirectSearch: '',\r\n\t\t\t\taxiosError: null,\r\n\t\t\t\terrorOnSave: false,\r\n\t\t\t\tisLoadingInitial: editingId !== undefined,\r\n\t\t\t\tisLoading: editingId !== undefined,\r\n\t\t\t\tentityDefinition,\r\n\t\t\t\tvalues: undefined,\r\n\t\t\t\tprimaryCulture: cultureId,\r\n\t\t\t\tcurrentCulture: cultureId,\r\n\t\t\t\tisSaving: false,\r\n\t\t\t\tvalidationError: false,\r\n\t\t\t\tisCreateMode: editingId === undefined,\r\n\t\t\t\teditingId,\r\n\t\t\t\tresponse: undefined,\r\n\t\t\t\teditSessionUniqueKey: '',\r\n\t\t\t\t// when the edit form is initialized, save off the last location so that we can return to it (and keep\r\n\t\t\t\t// query string parameters) when cancelling, saving, deleting, etc.\r\n\t\t\t\tlastLocation: getLastLocation(),\r\n\t\t\t\tnextSubmissionType: null,\r\n\t\t\t\tnextSubmissionContinues: false,\r\n\t\t\t\tnextSubmissionTime: null,\r\n\t\t\t\tforce: false,\r\n\t\t\t\thasTooltipError: false,\r\n\t\t\t\ttooltipData: {},\r\n\t\t\t\tentityTypeId: '',\r\n\t\t\t\tfieldSuggestions: {},\r\n\t\t\t\tscopeFieldEnabled: entityDefinition.scoped,\r\n\t\t\t\tredirectTo404: false,\r\n\t\t\t\tscopeChanged: false,\r\n\t\t\t\tvalidationErrorSource: ValidationErrorSource.None,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Resets a component's EditContext to its initial state.\r\n\t\t */\r\n\t\tpublic reset = () => {\r\n\t\t\tthis.setState({\r\n\t\t\t\t...this.getInitialState(),\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * If there's an ID in the URL, we're editing an item, so load the values\r\n\t\t * for this item as soon as the component is mounted.\r\n\t\t */\r\n\t\tpublic async componentDidMount(): Promise<void> {\r\n\t\t\tthis.isMounted = true;\r\n\t\t\tawait this.load();\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Handles Component Updates. Primarily to make sure we reload the record we're currently modifying\r\n\t\t * Whenever the location changes, which is defined in props.\r\n\t\t * @param prevProps\r\n\t\t */\r\n\t\tpublic componentDidUpdate(prevProps) {\r\n\t\t\tconst currentPathAndQuery = this.props.location\r\n\t\t\t\t? this.props.location.pathname + this.props.location.search\r\n\t\t\t\t: null;\r\n\t\t\tconst prevPathAndQuery = prevProps.location\r\n\t\t\t\t? prevProps.location.pathname + prevProps.location.search\r\n\t\t\t\t: null;\r\n\r\n\t\t\tconst { redirectPathName, redirectSearch } = this.state;\r\n\r\n\t\t\tconst redirectPathAndQuery = redirectPathName + '?' + redirectSearch;\r\n\r\n\t\t\t// if we switch to another URL, let's reload. this could happen because we no longer need historyId, or\r\n\t\t\t// because it got added to the query string after saving.\r\n\t\t\tconst pathAndQueryChanged = currentPathAndQuery !== prevPathAndQuery;\r\n\t\t\tconst redirectingToCurrentPage = redirectPathAndQuery === currentPathAndQuery;\r\n\r\n\t\t\tif (pathAndQueryChanged || redirectingToCurrentPage) {\r\n\t\t\t\tconsole.debug('Query change detected, reloading record.');\r\n\r\n\t\t\t\t// we make sure to clear any state that might lead us to be redirected into a blank page.\r\n\t\t\t\t// eslint-disable-next-line\r\n\t\t\t\tthis.setState(this.getInitialState());\r\n\r\n\t\t\t\t// then we trigger a reload to make sure we have fresh data.\r\n\t\t\t\tthis.load();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Loads the entity being edited based on the current URL. This is called on load but can also\r\n\t\t * be called from other components via editContext. That method is primarily used by the versioning\r\n\t\t * dropdown but can be used by anything.\r\n\t\t */\r\n\t\tpublic load = async () => {\r\n\t\t\tconst id = this.props.match?.params.id;\r\n\t\t\tconst singularName = this.state.entityDefinition.singularName;\r\n\r\n\t\t\tif (!id) {\r\n\t\t\t\t// load tooltip data\r\n\t\t\t\treturn await getTooltipsForEntity(this.state.entityDefinition, this.tooltipRequestToken, () => {\r\n\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\thasTooltipError: true,\r\n\t\t\t\t\t});\r\n\t\t\t\t}).then((response) => {\r\n\t\t\t\t\tconsole.log(`Loaded tooltips for ${singularName}:`, response.data);\r\n\r\n\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\ttooltipData: response.data.tooltipData,\r\n\t\t\t\t\t\tentityTypeId: response.data.entityTypeId,\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tlet url = `${this.state.entityDefinition.baseAjaxRoute}/${id}`;\r\n\r\n\t\t\tconst activeVersion = this.getActiveVersionId();\r\n\r\n\t\t\tif (activeVersion) {\r\n\t\t\t\turl += '?historyId=' + activeVersion;\r\n\t\t\t}\r\n\r\n\t\t\ttry {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tisLoading: true,\r\n\t\t\t\t});\r\n\r\n\t\t\t\tconst loadTooltipDataPromise = getTooltipsForEntity(\r\n\t\t\t\t\tthis.state.entityDefinition,\r\n\t\t\t\t\tthis.tooltipRequestToken,\r\n\t\t\t\t\t() => {\r\n\t\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\t\thasTooltipError: true,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t},\r\n\t\t\t\t);\r\n\t\t\t\tconst loadPromise = AxiosHelper.get(url, {\r\n\t\t\t\t\tcancelToken: this.requestToken.token,\r\n\t\t\t\t\tredirectToAccessDeniedOn403: true,\r\n\t\t\t\t} as CustomAxiosRequestConfig);\r\n\r\n\t\t\t\tawait Promise.all([loadTooltipDataPromise, loadPromise]).then((responses) => {\r\n\t\t\t\t\t// not much point in giving this a type, as this could be any type in the system.\r\n\t\t\t\t\tconst [tooltipResponse, response] = responses;\r\n\r\n\t\t\t\t\tconsole.log(`Loaded ${singularName}:`, response.data);\r\n\t\t\t\t\tconsole.log(`Loaded tooltips for ${singularName}:`, tooltipResponse?.data);\r\n\r\n\t\t\t\t\t/* sometimes it's handy to pass values on the wrapper for the entity\r\n                            without having to touch the values that affect the form. for example,\r\n                            for admin users we set isLdapUser = true, but we don't want to send this\r\n                            down to be modifiable or visible, so we can send it in the wrapper as\r\n                            meta data which we store in `response`.\r\n                    */\r\n\t\t\t\t\t// eslint-disable-next-line no-unused-vars\r\n\t\t\t\t\tconst { entity, tooltipData, entityTypeId, ...rest } = response.data;\r\n\r\n\t\t\t\t\tlet cultureId: string | undefined;\r\n\t\t\t\t\tcultureId = undefined;\r\n\t\t\t\t\tif (entityDefinition.localizeMode) {\r\n\t\t\t\t\t\tcultureId = entity.__CultureId as string;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\tvalues: entity,\r\n\t\t\t\t\t\tcurrentCulture: this.state.redirectCulture || cultureId,\r\n\t\t\t\t\t\tprimaryCulture: cultureId,\r\n\t\t\t\t\t\tresponse: rest,\r\n\t\t\t\t\t\teditSessionUniqueKey: url,\r\n\t\t\t\t\t\ttooltipData: tooltipResponse?.data?.tooltipData,\r\n\t\t\t\t\t\tentityTypeId: tooltipResponse?.data?.entityTypeId,\r\n\t\t\t\t\t\tcurrentScope: entity && entity.scope,\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t} catch (error) {\r\n\t\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst axiosError = error as AxiosError;\r\n\t\t\t\tconsole.error(`An error occurred while loading ${singularName}: ${axiosError.message}`);\r\n\r\n\t\t\t\tif (axiosError && axiosError.response && axiosError.response.status === 404) {\r\n\t\t\t\t\tthis.setState(() => {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tisLoading: false,\r\n\t\t\t\t\t\t\tisLoadingInitial: false,\r\n\t\t\t\t\t\t\taxiosError,\r\n\t\t\t\t\t\t\tredirectTo404: true,\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\tisLoading: false,\r\n\t\t\t\t\t\tisLoadingInitial: false,\r\n\t\t\t\t\t\taxiosError,\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setState({\r\n\t\t\t\tisLoading: false,\r\n\t\t\t\tisLoadingInitial: false,\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tprivate onSaveCallbacks = {};\r\n\r\n\t\tpublic registerOnBeforeSaveCallback = (name: string, cb: () => void) => {\r\n\t\t\tconsole.debug('Registering On Save Callback:', name);\r\n\t\t\tthis.onSaveCallbacks[name] = cb;\r\n\t\t};\r\n\r\n\t\tpublic componentWillUnmount() {\r\n\t\t\tthis.isMounted = false;\r\n\t\t\tthis.requestToken.cancel();\r\n\t\t\tthis.tooltipRequestToken.cancel();\r\n\t\t}\r\n\r\n\t\tprivate callPostSaveCallbacks = () => {\r\n\t\t\t// we need to wait for react-final-form to finish updating state before this callback\r\n\t\t\t// there is no callback from rff, so this'll have to do.\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tObject.keys(this.onSaveCallbacks).forEach((onSaveCallbackKey) => {\r\n\t\t\t\t\tconsole.debug('Post-save callback:', onSaveCallbackKey);\r\n\t\t\t\t\tthis.onSaveCallbacks[onSaveCallbackKey]();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Registers a new form values transform handler\r\n\t\t */\r\n\t\tprivate registerFormValuesTransformHandler = (key: string, handler: FormValuesTransformHandler) => {\r\n\t\t\tif (!key) {\r\n\t\t\t\tconsole.error('A valid key is required to register a form values transform handler.');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (!this.formValuesTransformHandlers[key]) {\r\n\t\t\t\tconsole.debug('Form values transform handler registered:', key);\r\n\t\t\t} else {\r\n\t\t\t\tconsole.debug('Form values transform handler replaced:', key);\r\n\t\t\t}\r\n\r\n\t\t\tthis.formValuesTransformHandlers[key] = handler;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Returns a promise that will save the form values on the server. The promise is required for\r\n\t\t * react-final-form to properly handle form state if something goes wrong. For example, if there's\r\n\t\t * validation, or a server error.\r\n\t\t */\r\n\t\tpublic save = async (formValues: any, formApi?: FormApi): Promise<void | Record<string, unknown>> => {\r\n\t\t\tconst parentId = this.props.match?.params.parentId;\r\n\t\t\tlet values = { ...formValues, parentId };\r\n\t\t\tconsole.log(`Saving ${this.state.entityDefinition.singularName}`, values);\r\n\r\n\t\t\tif (entityDefinition.localizeMode) {\r\n\t\t\t\tvalues.__CultureId = this.state.primaryCulture;\r\n\t\t\t}\r\n\r\n\t\t\tfor (const [key, handler] of Object.entries(this.formValuesTransformHandlers)) {\r\n\t\t\t\tconsole.debug(`Calling transform handler:`, key);\r\n\t\t\t\tvalues = await handler(values);\r\n\t\t\t}\r\n\r\n\t\t\tif (formApi != null) {\r\n\t\t\t\t// check synchronous custom validation first\r\n\t\t\t\tconst syncValidationState = Object.keys(formValues).reduce((res, key) => {\r\n\t\t\t\t\tconst fieldState = formApi.getFieldState(key);\r\n\r\n\t\t\t\t\tif (fieldState && fieldState.data) {\r\n\t\t\t\t\t\t// we're only interested in fields that are validation related\r\n\t\t\t\t\t\tconst errorFields = fieldState.data as SyncCustomFrontEndValidation;\r\n\r\n\t\t\t\t\t\tconst errors = Object.keys(errorFields).reduce((result, element) => {\r\n\t\t\t\t\t\t\tresult = result.concat(errorFields[element]);\r\n\t\t\t\t\t\t\treturn result;\r\n\t\t\t\t\t\t}, []);\r\n\r\n\t\t\t\t\t\tif (errors.length > 0) {\r\n\t\t\t\t\t\t\tres[key] = errors;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn res;\r\n\t\t\t\t}, {});\r\n\r\n\t\t\t\tif (Object.keys(syncValidationState).length > 0) {\r\n\t\t\t\t\t// Scroll to top so users can see error messages\r\n\t\t\t\t\twindow.scrollTo(0, 0);\r\n\r\n\t\t\t\t\treturn { ...syncValidationState, [FORM_ERROR]: 'An error occurred while saving.' };\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet url = this.state.entityDefinition.baseAjaxRoute;\r\n\t\t\tconst id = this.props.match?.params.id;\r\n\r\n\t\t\tif (id) {\r\n\t\t\t\turl += '/' + id;\r\n\t\t\t}\r\n\r\n\t\t\tif (parentId) {\r\n\t\t\t\turl += '?parentId=' + parentId;\r\n\t\t\t}\r\n\r\n\t\t\tconst doContinue = this.state.nextSubmissionContinues;\r\n\t\t\tconst submissionType = this.state.nextSubmissionType;\r\n\t\t\tlet submissionTime = this.state.nextSubmissionTime;\r\n\t\t\tif (submissionTime && !moment.isMoment(submissionTime)) {\r\n\t\t\t\tsubmissionTime = moment(submissionTime);\r\n\t\t\t}\r\n\t\t\tconst force = this.state.force;\r\n\r\n\t\t\tthis.setState({\r\n\t\t\t\tisSaving: true,\r\n\t\t\t\t// clear the \"next\" submission state so that subsequent attempts to save don't do the wrong thing\r\n\t\t\t\tnextSubmissionContinues: false,\r\n\t\t\t\tnextSubmissionTime: null,\r\n\t\t\t\tnextSubmissionType: null,\r\n\t\t\t\tforce: false,\r\n\t\t\t\terrorOnSave: false,\r\n\t\t\t\tvalidationError: false,\r\n\t\t\t});\r\n\r\n\t\t\tlet newValues = { ...values };\r\n\r\n\t\t\tif (submissionType) {\r\n\t\t\t\t// override the status with the submission type, if specified. other types of submissions can\r\n\t\t\t\t// override this by calling `setNextSubmissionState` on the edit context.\r\n\t\t\t\tnewValues = { ...newValues, status: submissionType };\r\n\r\n\t\t\t\tconsole.debug('This save is setting model status:', submissionType);\r\n\t\t\t}\r\n\r\n\t\t\tconst activeVersion = this.getActiveVersion();\r\n\t\t\tif (activeVersion) {\r\n\t\t\t\t// if we're editing a non-current version, provide the historyId to the backend as well\r\n\t\t\t\tnewValues = { ...newValues, historyId: activeVersion.id };\r\n\t\t\t\tconsole.debug('This save is operating with history:', activeVersion);\r\n\t\t\t}\r\n\r\n\t\t\tlet response: any;\r\n\t\t\ttry {\r\n\t\t\t\t// Set up headers\r\n\t\t\t\tlet headers = {};\r\n\t\t\t\tif (submissionTime) {\r\n\t\t\t\t\theaders = { 'Roc-ScheduledTime': submissionTime.toJSON() };\r\n\t\t\t\t\tconsole.debug('This save is scheduled for:', submissionTime);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (force) {\r\n\t\t\t\t\theaders = { ...headers, 'Roc-Force': true };\r\n\t\t\t\t}\r\n\t\t\t\tthis.callPostSaveCallbacks();\r\n\r\n\t\t\t\tconsole.debug('Entity being sent for saving:', newValues);\r\n\t\t\t\tresponse = await AxiosHelper.post(url, newValues, {\r\n\t\t\t\t\theaders,\r\n\t\t\t\t\tcancelToken: this.requestToken.token,\r\n\t\t\t\t\tredirectToAccessDeniedOn403: true,\r\n\t\t\t\t} as CustomAxiosRequestConfig);\r\n\r\n\t\t\t\tif (!response) {\r\n\t\t\t\t\tthrow new Error('Response was null');\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tif (Axios.isCancel(error) || !this.isMounted) {\r\n\t\t\t\t\t// if the component was unmounted, there's nothing to do\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Check if this error can be handled by the client. If it can, rethrow it and let the wrapped component handle it.\r\n\t\t\t\tif (getHandleableException(error)) {\r\n\t\t\t\t\tconsole.debug('Found handleable exception. Rethrowing...');\r\n\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\tisSaving: false,\r\n\t\t\t\t\t\terrorOnSave: false,\r\n\t\t\t\t\t});\r\n\t\t\t\t\tthrow error;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst axiosError = error as AxiosError;\r\n\r\n\t\t\t\tconsole.log(`Unable to save ${this.state.entityDefinition.singularName}...`);\r\n\r\n\t\t\t\t// Wrap in a try-catch, to help prevent tests from failing due to missing 'createEvent' property\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\tisSaving: false,\r\n\t\t\t\t\t\terrorOnSave: false,\r\n\t\t\t\t\t\taxiosError: null,\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif (!isEmbeddedEdit) {\r\n\t\t\t\t\t\t// Scroll to top so users can see error messages\r\n\t\t\t\t\t\twindow.scrollTo(0, 0);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// validation error & generic error\r\n\t\t\t\t\tconst formValidationState = handleAxiosErrorWithValidation(\r\n\t\t\t\t\t\taxiosError,\r\n\t\t\t\t\t\t'An error occurred while saving.',\r\n\t\t\t\t\t\t() => {\r\n\t\t\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\t\t\tvalidationError: true,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t() => {\r\n\t\t\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\t\t\terrorOnSave: true,\r\n\t\t\t\t\t\t\t\taxiosError,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\tvalidationErrorSource: getValidationErrorSource(formValidationState, axiosError),\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\treturn formValidationState;\r\n\t\t\t\t} catch {\r\n\t\t\t\t\tconsole.error('Error trying to set state, if this is not happening in a test, please investigate!');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (!isEmbeddedEdit) {\r\n\t\t\t\t// Display a toast so users know the save was successful\r\n\t\t\t\ttoastSuccess({\r\n\t\t\t\t\ttoastifyOptions: {\r\n\t\t\t\t\t\tposition: toast.POSITION.BOTTOM_RIGHT,\r\n\t\t\t\t\t},\r\n\t\t\t\t\tcustomContent: (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{submissionTime ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{submissionType === 'Published' ? (\r\n\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t{this.state.entityDefinition.singularName} successfully scheduled to be\r\n\t\t\t\t\t\t\t\t\t\t\tpublished on {submissionTime.format('MMMM Do, YYYY')} at{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t{submissionTime.format('h:mm a')}\r\n\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t) : submissionType === 'Inactive' ? (\r\n\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t{this.state.entityDefinition.singularName} successfully scheduled to be set\r\n\t\t\t\t\t\t\t\t\t\t\tto inactive on {submissionTime.format('MMMM Do, YYYY')} at{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t{submissionTime.format('h:mm a')}\r\n\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t// When the scheduled time was not updated, but only some entity data for future version.\r\n\t\t\t\t\t\t\t\t\t\t// This happend after click Update button, the submissionType is null.\r\n\t\t\t\t\t\t\t\t\t\t<>{this.state.entityDefinition.singularName} successfully saved.</>\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t{submissionType === 'Published' ? (\r\n\t\t\t\t\t\t\t\t\t\t<>{this.state.entityDefinition.singularName} successfully published.</>\r\n\t\t\t\t\t\t\t\t\t) : submissionType === 'Inactive' ? (\r\n\t\t\t\t\t\t\t\t\t\t<>{this.state.entityDefinition.singularName} successfully set to inactive.</>\r\n\t\t\t\t\t\t\t\t\t) : submissionType === 'Draft' ? (\r\n\t\t\t\t\t\t\t\t\t\t<>{this.state.entityDefinition.singularName} successfully saved as draft.</>\r\n\t\t\t\t\t\t\t\t\t) : submissionType === 'Archived' ? (\r\n\t\t\t\t\t\t\t\t\t\t<>{this.state.entityDefinition.singularName} successfully archived.</>\r\n\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t<>{this.state.entityDefinition.singularName} successfully saved.</>\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t),\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (doContinue) {\r\n\t\t\t\tconst { entity } = response.data;\r\n\r\n\t\t\t\tconst path = `${this.state.entityDefinition.baseEditRoute}/${entity.id}`;\r\n\t\t\t\tlet search = '';\r\n\t\t\t\tif (activeVersion && this.state.continueWithHistory) {\r\n\t\t\t\t\tsearch = 'historyId=' + activeVersion.id;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.state.entityDefinition.isBulkEdit) {\r\n\t\t\t\t\t// If we are in bulk edit mode, use the response from the POST request as the new data\r\n\t\t\t\t\tlet cultureId: string | undefined;\r\n\t\t\t\t\tcultureId = undefined;\r\n\t\t\t\t\tif (entityDefinition.localizeMode) {\r\n\t\t\t\t\t\tcultureId = entity.__CultureId as string;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\tvalues: entity,\r\n\t\t\t\t\t\tcurrentCulture: this.state.redirectCulture || cultureId,\r\n\t\t\t\t\t\tprimaryCulture: cultureId,\r\n\t\t\t\t\t\tresponse: response,\r\n\t\t\t\t\t\tcurrentScope: entity && entity.scope ? entity.scope.value : undefined,\r\n\t\t\t\t\t\tisSaving: false,\r\n\t\t\t\t\t\tisLoading: false,\r\n\t\t\t\t\t\tisLoadingInitial: false,\r\n\t\t\t\t\t\tisCreateMode: false,\r\n\t\t\t\t\t});\r\n\t\t\t\t} else if (this.state.isCreateMode) {\r\n\t\t\t\t\tif (!isEmbeddedEdit) {\r\n\t\t\t\t\t\t// if we're continuing after creating a new entity, we need to redirect to the new record\r\n\t\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\t\tredirectPathName: path,\r\n\t\t\t\t\t\t\tredirectSearch: search,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// we're continuing, but after editing an entity that already exists\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tactiveVersion &&\r\n\t\t\t\t\t\tactiveVersion.type === EntityVersionType.Archived &&\r\n\t\t\t\t\t\tsubmissionType === ModelStatus.Published &&\r\n\t\t\t\t\t\t!isEmbeddedEdit\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\t// when restoring an archived version, drop the `historyId` param from the route\r\n\t\t\t\t\t\tthis.props.history.replace({ search: '' });\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// reload entity information in order to pull down the latest version info\r\n\t\t\t\t\tawait this.load();\r\n\r\n\t\t\t\t\tconst currentPathWithQuery = document.location.pathname + document.location.search;\r\n\r\n\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\tisSaving: false,\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tif (path !== currentPathWithQuery && !isEmbeddedEdit) {\r\n\t\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\t\tredirectPathName: path,\r\n\t\t\t\t\t\t\tredirectSearch: search,\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// If the current active version type is archived, then we need to set the redirect path, as it was changed when we selected this version from version modal\r\n\t\t\telse if (this.getActiveVersion()?.type === EntityVersionType.Archived) {\r\n\t\t\t\tconst path = this.state.entityDefinition.baseRoute;\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tredirectPathName: path,\r\n\t\t\t\t});\r\n\t\t\t\tthis.redirectToLastLocation();\r\n\t\t\t} else {\r\n\t\t\t\tif (!isEmbeddedEdit) {\r\n\t\t\t\t\t// not continuing, so we want to redirect back to our last location\r\n\t\t\t\t\tthis.redirectToLastLocation();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn response.data;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Redirects the browser back to the last location before the active edit form was mounted. This\r\n\t\t * is often used to redirect back to the listing page (and retain any active filters).\r\n\t\t */\r\n\t\tpublic redirectToLastLocation = () => {\r\n\t\t\tconsole.debug('Redirecting to last location...');\r\n\t\t\tlet redirectPathName = '';\r\n\t\t\tlet redirectSearch = '';\r\n\t\t\tconst { lastLocation, entityDefinition } = this.state;\r\n\r\n\t\t\tif (lastLocation) {\r\n\t\t\t\tredirectPathName = lastLocation.pathname;\r\n\t\t\t\tredirectSearch = lastLocation.search;\r\n\t\t\t} else {\r\n\t\t\t\tredirectPathName = entityDefinition.baseRoute;\r\n\t\t\t\tredirectSearch = '';\r\n\t\t\t}\r\n\r\n\t\t\tthis.setState({\r\n\t\t\t\tredirectPathName,\r\n\t\t\t\tredirectSearch,\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Informs the edit context of the kind of save that should be done when the edit form is submitted. This is\r\n\t\t * used for flagging certain saves such as saving as draft, inactive, etc.\r\n\t\t */\r\n\t\tpublic setNextSubmissionState = ({\r\n\t\t\tsubmissionType,\r\n\t\t\tsubmissionTime,\r\n\t\t\tdoContinue,\r\n\t\t\tforce,\r\n\t\t}: SubmissionState): Promise<void> => {\r\n\t\t\tconsole.debug(\r\n\t\t\t\t'setting next submission state to type:',\r\n\t\t\t\tsubmissionType,\r\n\t\t\t\t'time:',\r\n\t\t\t\tsubmissionTime,\r\n\t\t\t\t'continues: ',\r\n\t\t\t\tdoContinue,\r\n\t\t\t\t'forced: ',\r\n\t\t\t\tforce || false,\r\n\t\t\t);\r\n\r\n\t\t\treturn new Promise((resolve) => {\r\n\t\t\t\tthis.setState(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tnextSubmissionType: submissionType,\r\n\t\t\t\t\t\tnextSubmissionTime: submissionTime,\r\n\t\t\t\t\t\tnextSubmissionContinues: doContinue,\r\n\t\t\t\t\t\tforce: force || false,\r\n\t\t\t\t\t},\r\n\t\t\t\t\tresolve,\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Retrieves a full list of the version history within the edit context.\r\n\t\t */\r\n\t\tpublic getAllVersions = (): EntityVersion[] => {\r\n\t\t\tconst values = this.state.values;\r\n\r\n\t\t\tconst response = this.state.response;\r\n\r\n\t\t\tconst previousVersions = response?.previousVersions ?? [];\r\n\t\t\tlet pendingVersions = response?.pendingVersions ?? [];\r\n\t\t\tlet scheduledVersions = response?.scheduledVersions ?? [];\r\n\t\t\tconst currentVersionStatus = response?.currentVersionStatus;\r\n\r\n\t\t\t// This is unsound! This is only valid if `TDto` derives from BaseDto (which it should but isn't guaranteed by typing currently!)\r\n\t\t\tconst currVersionNo = (values as Partial<BaseDto>)?.versionNo ?? 0;\r\n\t\t\tlet nextVersionNo = currVersionNo;\r\n\r\n\t\t\t// note: pending versions need to be transformed first (before scheduled versions) as they have incrementing\r\n\t\t\t// version numbers that should be before the scheduled versions\r\n\t\t\tpendingVersions = [\r\n\t\t\t\t...pendingVersions.map((ver) => ({\r\n\t\t\t\t\t...ver,\r\n\t\t\t\t\t// create a fake version number for draft versions, starting from the current version's number\r\n\t\t\t\t\tversionNo: ++nextVersionNo,\r\n\t\t\t\t\ttype: EntityVersionType.Draft,\r\n\t\t\t\t})),\r\n\t\t\t];\r\n\r\n\t\t\tscheduledVersions = [\r\n\t\t\t\t...scheduledVersions.map((ver) => ({\r\n\t\t\t\t\t...ver,\r\n\t\t\t\t\t// scheduled versions should then follow the draft versions\r\n\t\t\t\t\tversionNo: ++nextVersionNo,\r\n\t\t\t\t\ttype: EntityVersionType.Future,\r\n\t\t\t\t})),\r\n\t\t\t];\r\n\r\n\t\t\tconst now = moment.utc();\r\n\r\n\t\t\treturn [\r\n\t\t\t\t// include future versions that need to be published\r\n\t\t\t\t...scheduledVersions,\r\n\r\n\t\t\t\t// and the draft versions\r\n\t\t\t\t...pendingVersions,\r\n\r\n\t\t\t\t// include a \"fake\" current version, so that we can switch back to editing the current version in the\r\n\t\t\t\t// version selector\r\n\t\t\t\t{\r\n\t\t\t\t\tid: null,\r\n\t\t\t\t\tcreateDate: (((values as Partial<BaseDto>)?.createDate as unknown) as Moment | undefined) ?? now, // Type error!!! Moments aren't dates!\r\n\t\t\t\t\tmodifyDate: (((values as Partial<BaseDto>)?.modifyDate as unknown) as Moment | undefined) ?? now, // Type error!!! Moments aren't dates!\r\n\t\t\t\t\tcreateUser: (values as Partial<BaseDto>)?.createUser, // Type error. It isn't enforced that values is a BaseDto?\r\n\t\t\t\t\tmodifyUser: (values as Partial<BaseDto>)?.modifyUser, // Type error. It isn't enforced that values is a BaseDto?\r\n\t\t\t\t\tversionNo: currVersionNo,\r\n\t\t\t\t\ttype: EntityVersionType.Current,\r\n\t\t\t\t\tstatus: currentVersionStatus,\r\n\t\t\t\t},\r\n\r\n\t\t\t\t...previousVersions.map((ver) => ({ ...ver, type: EntityVersionType.Archived })),\r\n\t\t\t].sort((a, b) => b.versionNo - a.versionNo); // sort all versions descending by version number\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Returns the unique identifier (from the query string) of the current active version.\r\n\t\t * This may not necessarily be a version that exists.\r\n\t\t */\r\n\t\tpublic getActiveVersionId = (): string | null => {\r\n\t\t\tconst queryString = new URLSearchParams(location.search || '');\r\n\r\n\t\t\tif (queryString && queryString.get(WithEdit.HistoryIdParam)) {\r\n\t\t\t\treturn queryString.get(WithEdit.HistoryIdParam) || null;\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Gets the current active version within the edit context, or `null` if the current\r\n\t\t * version is the latest version.\r\n\t\t */\r\n\t\tpublic getActiveVersion = (): EntityVersion | null => {\r\n\t\t\tconst actVersion = this.getActiveVersionId();\r\n\r\n\t\t\tif (actVersion === null) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\treturn this.getVersionById(actVersion);\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Retrieves the `EntityVersion` from the history of the edit context by id, or `null` if\r\n\t\t * the version could not be found.\r\n\t\t */\r\n\t\tpublic getVersionById = (id?: string): EntityVersion | null => {\r\n\t\t\tconst allVersions = this.getAllVersions();\r\n\r\n\t\t\tif (!id) {\r\n\t\t\t\t// we're looking for the fake current version\r\n\t\t\t\treturn allVersions.find((ver) => ver.id === null) || null;\r\n\t\t\t}\r\n\r\n\t\t\t// otherwise, search specifically by id\r\n\t\t\tconst foundVersion = allVersions.find((ver) => ver.id === id);\r\n\r\n\t\t\tif (!foundVersion) {\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\r\n\t\t\treturn foundVersion;\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Loads the cahced tooltip data into the editContext\r\n\t\t */\r\n\t\tprivate getTooltipsForEntity = () => {\r\n\t\t\tconst singularName = this.state.entityDefinition.singularName;\r\n\r\n\t\t\tgetTooltipsForEntity(this.state.entityDefinition, this.tooltipRequestToken, () => {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\thasTooltipError: true,\r\n\t\t\t\t});\r\n\t\t\t}).then((response) => {\r\n\t\t\t\tconsole.log(`Loaded tooltips for ${singularName}:`, response.data);\r\n\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\ttooltipData: response.data.tooltipData,\r\n\t\t\t\t\tentityTypeId: response.data.entityTypeId,\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Update field suggestions with new values. This will add on to existing field suggestions only, and will not clear pending ones.\r\n\t\t *\r\n\t\t * @private\r\n\t\t * @memberof WithEdit\r\n\t\t */\r\n\t\tprivate setFieldSuggestions = (fieldSuggestionMap: FieldSuggestionMap) => {\r\n\t\t\tthis.setState((prevState) => ({\r\n\t\t\t\tfieldSuggestions: { ...prevState.fieldSuggestions, ...fieldSuggestionMap },\r\n\t\t\t}));\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * We do not want to update the Primary Culture if we're editing an item. This is set during creation and we do not support\r\n\t\t * updating it currently.\r\n\t\t */\r\n\t\tprivate setCulture = (culture: string) => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tcurrentCulture: culture,\r\n\t\t\t});\r\n\r\n\t\t\tif (this.state.isCreateMode) {\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tprimaryCulture: culture,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Sets the continueWithHistory value. When true, the current historyId in the querystring will be maintained after\r\n\t\t * the Save & Continue operation.\r\n\t\t */\r\n\t\tprivate setContinueWithHistory = (continueWithHistory: boolean) => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tcontinueWithHistory: continueWithHistory,\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Set the culture that should be set when the form reloads.\r\n\t\t */\r\n\t\tprivate setRedirectCulture = (culture?: string) => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tredirectCulture: culture,\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Allows edit forms to toggle whether the scope field is enabled/disabled\r\n\t\t */\r\n\t\tprivate setScopeFieldEnabled = (display: boolean) => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tscopeFieldEnabled: display,\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Set scope changed\r\n\t\t */\r\n\t\tprivate setScopeChanged = (scopeChanged: boolean) => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tscopeChanged,\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Set current scope\r\n\t\t */\r\n\t\tprivate setCurrentScope = (scope: RecordScope) => {\r\n\t\t\tthis.setState({\r\n\t\t\t\tcurrentScope: scope,\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\t/**\r\n\t\t * Set original scope\r\n\t\t */\r\n\t\tprivate setOriginalScope = (scope: RecordScope) => {\r\n\t\t\tthis.setState({\r\n\t\t\t\toriginalScope: scope,\r\n\t\t\t});\r\n\t\t};\r\n\r\n\t\tpublic render() {\r\n\t\t\tif (this.state.redirectTo404) {\r\n\t\t\t\treturn <Redirect to=\"/404\" />;\r\n\t\t\t}\r\n\r\n\t\t\treturn (\r\n\t\t\t\t// This part guarantees that the current edit context will be updated with the state of this HOC\r\n\t\t\t\t<EditContext.Provider\r\n\t\t\t\t\tvalue={{\r\n\t\t\t\t\t\t...this.state, // we \"copy\" the current context values so we can set the save function\r\n\t\t\t\t\t\treset: this.reset,\r\n\r\n\t\t\t\t\t\tsetNextSubmissionState: this.setNextSubmissionState,\r\n\t\t\t\t\t\tsave: this.save, // we set the save function in the context so the consumers have someone to call back\r\n\t\t\t\t\t\tload: this.load,\r\n\t\t\t\t\t\tregisterOnBeforeSaveCallback: this.registerOnBeforeSaveCallback,\r\n\r\n\t\t\t\t\t\tgetAllVersions: this.getAllVersions,\r\n\t\t\t\t\t\tgetActiveVersionId: this.getActiveVersionId,\r\n\t\t\t\t\t\tgetActiveVersion: this.getActiveVersion,\r\n\t\t\t\t\t\tgetVersionById: this.getVersionById,\r\n\t\t\t\t\t\tgetTooltipsForEntity: this.getTooltipsForEntity,\r\n\t\t\t\t\t\tsetFieldSuggestions: this.setFieldSuggestions,\r\n\t\t\t\t\t\tredirectToLastLocation: this.redirectToLastLocation,\r\n\t\t\t\t\t\tsetContinueWithHistory: this.setContinueWithHistory,\r\n\t\t\t\t\t\tsetCulture: this.setCulture,\r\n\t\t\t\t\t\tsetScopeFieldEnabled: this.setScopeFieldEnabled,\r\n\t\t\t\t\t\tsetRedirectCulture: this.setRedirectCulture,\r\n\t\t\t\t\t\tsetCurrentScope: this.setCurrentScope,\r\n\t\t\t\t\t\tsetOriginalScope: this.setOriginalScope,\r\n\t\t\t\t\t\tsetScopeChanged: this.setScopeChanged,\r\n\r\n\t\t\t\t\t\tregisterFormValuesTransformHandler: this.registerFormValuesTransformHandler,\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t{/* here we are passing down the props coming from higher level component, see link on top*** */}\r\n\t\t\t\t\t<WrappedComponent {...this.props} />\r\n\t\t\t\t</EditContext.Provider>\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tconst wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\r\n\r\n\t// convention for react dev tools.\r\n\tWithEdit.displayName = `withEdit(${wrappedComponentName})`;\r\n\r\n\treturn WithEdit;\r\n}\r\n\r\nexport default withEdit;\r\n","import { FormattedDateTime } from 'components/shared/FormattedTimes';\r\nimport moment from 'moment';\r\nimport Popper from 'popper.js';\r\nimport * as React from 'react';\r\nimport { Popover, PopoverBody } from 'reactstrap';\r\nimport { slugify } from 'styles/global';\r\nimport { EntityDefinition } from 'types';\r\nimport BaseDto from 'types/__models__/BaseDto';\r\nimport * as Constants from '../../../../../Roc.SharedClientApp/util/Constants';\r\nimport CheckCircleSVG from '../svg/CheckCircleSVG';\r\nimport DashCircleSVG from '../svg/DashCircleSVG';\r\nimport GarbageCanCircleSVG from '../svg/GarbageCanCircleSVG';\r\nimport InfoSVG from '../svg/InfoSVG';\r\n\r\nexport interface ListingControlsProps {\r\n\trecord: Partial<BaseDto>;\r\n\tentityDefinition?: EntityDefinition;\r\n\tpopoverPlacement?: Popper.Placement;\r\n\trenderIcons: (record: Partial<BaseDto>) => React.ReactNode;\r\n\tuniqueKey?: string;\r\n}\r\n\r\nexport interface ListingControlsState {\r\n\tpopoverOpen: boolean;\r\n}\r\n\r\ninterface DefaultPopoverStatusOnListingProps {\r\n\tstatusLabel: string;\r\n\tstatusField: string;\r\n\tversionLabel: string;\r\n\trecord: {\r\n\t\tversionNo?: number;\r\n\t\tcreateDate?: Date;\r\n\t\tcreateUser?: string;\r\n\t\tmodifyDate?: Date;\r\n\t\tmodifyUser?: string;\r\n\t};\r\n}\r\n\r\n/**\r\n * Default popover status info to be displayed within the PopoverBody of the ListingStatusDisplay icon. Can be overriden by setting\r\n * statusInfoOverrideOnListing in the entityDefinition.\r\n */\r\nfunction DefaultPopoverStatusOnListing(props: DefaultPopoverStatusOnListingProps) {\r\n\tconst { record, statusField, versionLabel, statusLabel } = props;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{record[statusField] ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<strong>{statusLabel} </strong>\r\n\t\t\t\t\t<em>{record[statusField]}</em>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t</>\r\n\t\t\t) : null}\r\n\t\t\t{record.versionNo ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<strong>{versionLabel}: </strong>\r\n\t\t\t\t\t<em>{record.versionNo}</em>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t</>\r\n\t\t\t) : null}\r\n\t\t\t<>\r\n\t\t\t\t<strong>Created By: </strong>\r\n\t\t\t\t<em>{record.createUser ? record.createUser : Constants.systemUserName}</em>\r\n\t\t\t\t<br />\r\n\t\t\t</>\r\n\t\t\t{record.createDate ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<strong>Created On: </strong>\r\n\t\t\t\t\t<em>\r\n\t\t\t\t\t\t<FormattedDateTime time={record.createDate} />\r\n\t\t\t\t\t</em>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t</>\r\n\t\t\t) : null}\r\n\t\t\t{record.modifyDate && !moment(record.createDate).isSame(record.modifyDate) ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<strong>Modified By: </strong>\r\n\t\t\t\t\t<em>{record.modifyUser ? record.modifyUser : Constants.systemUserName}</em>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t\t<strong>Modified On: </strong>\r\n\t\t\t\t\t<em>\r\n\t\t\t\t\t\t<FormattedDateTime time={record.modifyDate} />\r\n\t\t\t\t\t</em>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t</>\r\n\t\t\t) : null}\r\n\t\t</>\r\n\t);\r\n}\r\n\r\nconst listingItemStatusIconClass = 'listing-item-status-icon';\r\n\r\n/**\r\n * Component that renders the actions for any particular field.\r\n * These include edit, delete, info, and future options for each individual record.\r\n *\r\n * @class ListingControls\r\n * @extends {React.Component<ListingControlsProps<any>>}\r\n */\r\nclass ListingStatusDisplay extends React.Component<ListingControlsProps, ListingControlsState> {\r\n\tprivate popoverContainer;\r\n\r\n\tpublic static defaultProps = {\r\n\t\tpopoverPlacement: 'right',\r\n\t\trenderIcons: (record) =>\r\n\t\t\trecord.status === 'Published' ? (\r\n\t\t\t\t<CheckCircleSVG\r\n\t\t\t\t\tclass={listingItemStatusIconClass}\r\n\t\t\t\t\ttestId={`listing-status-circle-check-icon-${record.id}`}\r\n\t\t\t\t/>\r\n\t\t\t) : record.status === 'Deleted' ? (\r\n\t\t\t\t<GarbageCanCircleSVG\r\n\t\t\t\t\tclass={listingItemStatusIconClass}\r\n\t\t\t\t\ttestId={`listing-status-garbage-can-circle-${record.id}`}\r\n\t\t\t\t/>\r\n\t\t\t) : record.status === 'Inactive' ? (\r\n\t\t\t\t<DashCircleSVG class={listingItemStatusIconClass} testId={`listing-status-dash-icon-${record.id}`} />\r\n\t\t\t) : (\r\n\t\t\t\t<InfoSVG class={listingItemStatusIconClass} testId={`listing-status-info-icon-${record.id}`} />\r\n\t\t\t),\r\n\t};\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.popoverContainer = React.createRef();\r\n\r\n\t\tthis.state = {\r\n\t\t\tpopoverOpen: false,\r\n\t\t};\r\n\t}\r\n\r\n\tpublic shouldComponentUpdate(nextProps: ListingControlsProps, nextState: ListingControlsState) {\r\n\t\treturn (\r\n\t\t\tnextProps.record.id !== this.props.record.id ||\r\n\t\t\tnextState.popoverOpen !== this.state.popoverOpen ||\r\n\t\t\tnextProps.record.status !== this.props.record.status\r\n\t\t);\r\n\t}\r\n\r\n\tpublic handleButtonClick = (e) => {\r\n\t\t// prevent form submit\r\n\t\te.preventDefault();\r\n\r\n\t\tthis.toggle();\r\n\t};\r\n\r\n\tpublic toggle = () => {\r\n\t\tthis.setState({\r\n\t\t\tpopoverOpen: !this.state.popoverOpen,\r\n\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst { record, renderIcons, entityDefinition, uniqueKey } = this.props;\r\n\r\n\t\tconst statusLabel = entityDefinition?.statusLabel;\r\n\t\tconst statusField = entityDefinition?.statusField;\r\n\r\n\t\tconst versionLabel = entityDefinition?.versionLabel ? entityDefinition.versionLabel : 'Version';\r\n\r\n\t\tconst popoverUniqueKey = uniqueKey ? '-' + uniqueKey : '';\r\n\r\n\t\tconst popoverTarget = 'Popover-' + slugify(record.id + popoverUniqueKey);\r\n\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<button\r\n\t\t\t\t\tdata-testid={popoverTarget}\r\n\t\t\t\t\tclassName=\"listing-status-btn\"\r\n\t\t\t\t\tid={popoverTarget}\r\n\t\t\t\t\tonClick={this.handleButtonClick}\r\n\t\t\t\t>\r\n\t\t\t\t\t{renderIcons(record)}\r\n\t\t\t\t\t<span className=\"visually-hidden\">\r\n\t\t\t\t\t\t{this.state.popoverOpen ? 'Close' : 'Open'} Status Information\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</button>\r\n\t\t\t\t<div ref={this.popoverContainer}>\r\n\t\t\t\t\t<Popover\r\n\t\t\t\t\t\ttarget={popoverTarget}\r\n\t\t\t\t\t\tplacement={this.props.popoverPlacement}\r\n\t\t\t\t\t\tisOpen={this.state.popoverOpen}\r\n\t\t\t\t\t\ttoggle={this.toggle}\r\n\t\t\t\t\t\tclassName=\"popover-wide\"\r\n\t\t\t\t\t\tcontainer={this.popoverContainer}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<PopoverBody data-testid={`popover-body-${record.id}`}>\r\n\t\t\t\t\t\t\t{entityDefinition === undefined ? null : !entityDefinition.statusInfoOverrideOnListing ? (\r\n\t\t\t\t\t\t\t\t<DefaultPopoverStatusOnListing\r\n\t\t\t\t\t\t\t\t\trecord={record}\r\n\t\t\t\t\t\t\t\t\tstatusField={statusField || ''}\r\n\t\t\t\t\t\t\t\t\tstatusLabel={statusLabel || ''}\r\n\t\t\t\t\t\t\t\t\tversionLabel={versionLabel}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\tentityDefinition.statusInfoOverrideOnListing(record)\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</PopoverBody>\r\n\t\t\t\t\t</Popover>\r\n\t\t\t\t</div>\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default ListingStatusDisplay;\r\n","/**\r\n * Determines whether a string starts with any prefix in a given array of prefixes\r\n *\r\n * @param {string} s The string to check\r\n * @param {string[]} prefixes The prefixes to check against the string\r\n * @returns {boolean} True if the string being checked starts with any supplied prefix\r\n */\r\nfunction startsWithAny(s: string, prefixes: string[]): boolean {\r\n\tif (!s) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfor (const prefix of prefixes) {\r\n\t\tif (s.startsWith(prefix)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\r\n\treturn false;\r\n}\r\n\r\n/** List of recognized schemes for uri's. If you want to allow users to enter additional schemes such as ftp enter them here. */\r\nconst supportedSchemes = ['http://', 'https://'];\r\n\r\n/**\r\n * Returns true if the passed in URI represents an absolute URL with a supported scheme.\r\n *\r\n * @param uri The URI to check\r\n */\r\nexport function IsAbsoluteUrl(uri: string): boolean {\r\n\treturn startsWithAny(uri, supportedSchemes);\r\n}\r\n\r\n/**\r\n * Base URL Formatting implementation.\r\n * @param value The string that needs to be formatted into a friendly URL.\r\n * @param keepTrailingSlash Determines whether a trailing slash should be kept. eg: /test/?a=123 vs /test?a=234\r\n * @param keepUnderscore Determines whether an underscore should be kept.\r\n */\r\n/* #region Coburns */\r\nfunction FormatUrlInternal(value: string, keepTrailingSlash = false, keepUnderscore = false): string {\r\n\t/* #endregion Coburns */\r\n\tif (!value) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tif (value === '/') {\r\n\t\treturn value;\r\n\t}\r\n\r\n\tif (IsAbsoluteUrl(value)) {\r\n\t\treturn value;\r\n\t}\r\n\r\n\t/* #region Coburns */\r\n\tlet a = 'àáäâãåèéëêìíïîòóöôùúüûñçßÿœæŕśńṕẃǵǹḿǘẍźḧ·,:;';\r\n\tlet b = 'aaaaaaeeeeiiiioooouuuuncsyoarsnpwgnmuxzh----';\r\n\r\n\tif (!keepUnderscore) {\r\n\t\ta += '_';\r\n\t\tb += '-';\r\n\t}\r\n\t/* #endregion Coburns */\r\n\r\n\tconst p = new RegExp(a.split('').join('|'), 'g');\r\n\r\n\tlet cleanedUrl = value.toString();\r\n\r\n\t// preserve extension and query, for eg.: '/store/item.aspx?Id=10'\r\n\tconst extensionAndQueryRegExp = new RegExp(/(\\.[^\\/]+$)|(\\.[^\\/]+\\?.*$)|(\\?.*$)/);\r\n\tconst match = extensionAndQueryRegExp.exec(cleanedUrl);\r\n\tconst isMatch = match && match.length ? true : false;\r\n\tconst extensionAndQuery = (match && match.length && match[0]) || '';\r\n\r\n\tif (isMatch) {\r\n\t\tcleanedUrl = cleanedUrl.replace(extensionAndQuery, '');\r\n\t}\r\n\r\n\tcleanedUrl = cleanedUrl\r\n\t\t.toLowerCase()\r\n\t\t.replace(/\\s+/g, '-') // Replace spaces with -\r\n\t\t.replace(p, (c) => b.charAt(a.indexOf(c))) // Replace special characters\r\n\t\t.replace(/&/g, '-and-') // Replace & with 'and'\r\n\t\t.replace(/[^\\w\\-\\/]+/g, '') // Remove all non-word characters\r\n\t\t.replace(/\\-\\-+/g, '-') // Replace multiple - with single -\r\n\t\t.replace(/\\/\\/+/g, '/') // Replace multiple - with single -\r\n\t\t.replace(/^-+/, '') // Trim - from start of text\r\n\t\t.replace(/-+$/, '');\r\n\r\n\tif (!cleanedUrl.startsWith('/')) {\r\n\t\tcleanedUrl = '/' + cleanedUrl;\r\n\t}\r\n\r\n\tif (!keepTrailingSlash && cleanedUrl.endsWith('/')) {\r\n\t\tcleanedUrl = cleanedUrl.slice(0, -1);\r\n\t}\r\n\r\n\tif (isMatch) {\r\n\t\tcleanedUrl = cleanedUrl + extensionAndQuery;\r\n\t}\r\n\r\n\treturn cleanedUrl;\r\n}\r\n\r\n/**\r\n * Converts a string into a url-friendly string.\r\n *\r\n * @param value The value to convert and/or format into a URL\r\n */\r\nexport function FormatUrl(value: string): string {\r\n\treturn FormatUrlInternal(value);\r\n}\r\n\r\n/**\r\n * Formats the URL but keeps the trailing slash. This is useful when dealing with 301 redirects in particular.\r\n * @param value\r\n */\r\n/* #region Coburns */\r\nexport function FormatUrlKeepTrailingSlash(value: string) {\r\n\treturn FormatUrlInternal(value, true, true);\r\n}\r\n/* #endregion Coburns */\r\n\r\n/* #region Coburns */\r\n/**\r\n * Formats the URL but keeps the underscore. This is useful when dealing with 301 redirects in particular.\r\n * @param value\r\n */\r\nexport function FormatUrlKeepUnderscore(value: string) {\r\n\treturn FormatUrlInternal(value, false, true);\r\n}\r\n/* #endregion Coburns */\r\n","import { RangedPresetValue } from './Types';\r\nimport { localMoment, timeZoneLessLocalMoment } from 'util/Time';\r\n\r\nexport const RangedValueDelimiter: string = ',';\r\nexport const MultipleValueDelimiter: string = '[~]';\r\nexport const ValueLabelDelimiter: string = '[:]';\r\nexport const HierarchyDelimiter: string = ' > ';\r\nexport const NullValue: string = '[NULL]';\r\nexport const NotNullValue: string = '[NOT_NULL]';\r\nexport const NullValueLabel: string = '<No Value>';\r\nexport const NotNullValueLabel: string = '<Any Value>';\r\n\r\nexport interface RangePresetValuePresets {\r\n\t[index: string]: (ignoreTimezone?: boolean) => RangedPresetValue;\r\n}\r\n\r\n/**\r\n * Date range presets used by the date range preset filter type\r\n */\r\nexport const MultipleDateRangePresets: RangePresetValuePresets = {\r\n\tToday: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().startOf('day'))\r\n\t\t\t: localMoment().startOf('day'),\r\n\t\ttoValue: ignoreTimezone ? timeZoneLessLocalMoment(localMoment().endOf('day')) : localMoment().endOf('day'),\r\n\t\tpreset: 'Today',\r\n\t\tdisplayName: 'Today',\r\n\t\taxisPrecision: 'day',\r\n\t}),\r\n\tYesterday: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().subtract(1, 'days').startOf('day'))\r\n\t\t\t: localMoment().subtract(1, 'days').startOf('day'),\r\n\t\ttoValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().subtract(1, 'days').endOf('day'))\r\n\t\t\t: localMoment().subtract(1, 'days').endOf('day'),\r\n\t\tpreset: 'Yesterday',\r\n\t\tdisplayName: 'Yesterday',\r\n\t\taxisPrecision: 'day',\r\n\t}),\r\n\tWTD: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().startOf('week'))\r\n\t\t\t: localMoment().startOf('week'),\r\n\t\ttoValue: ignoreTimezone ? timeZoneLessLocalMoment(localMoment()) : localMoment(),\r\n\t\tpreset: 'WTD',\r\n\t\tdisplayName: 'WTD',\r\n\t\taxisPrecision: 'day',\r\n\t}),\r\n\tLastWeek: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().subtract(1, 'week').startOf('week'))\r\n\t\t\t: localMoment().subtract(1, 'week').startOf('week'),\r\n\t\ttoValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().subtract(1, 'week').endOf('week'))\r\n\t\t\t: localMoment().subtract(1, 'week').endOf('week'),\r\n\t\tpreset: 'LastWeek',\r\n\t\tdisplayName: 'Last Week',\r\n\t\taxisPrecision: 'day',\r\n\t}),\r\n\tMTD: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().startOf('month'))\r\n\t\t\t: localMoment().startOf('month'),\r\n\t\ttoValue: ignoreTimezone ? timeZoneLessLocalMoment(localMoment()) : localMoment(),\r\n\t\tpreset: 'MTD',\r\n\t\tdisplayName: 'MTD',\r\n\t\taxisPrecision: 'week',\r\n\t}),\r\n\tLastMonth: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().subtract(1, 'month').startOf('month'))\r\n\t\t\t: localMoment().subtract(1, 'month').startOf('month'),\r\n\t\ttoValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().subtract(1, 'month').endOf('month'))\r\n\t\t\t: localMoment().subtract(1, 'month').endOf('month'),\r\n\t\tpreset: 'LastMonth',\r\n\t\tdisplayName: 'Last Month',\r\n\t\taxisPrecision: 'week',\r\n\t}),\r\n\tLast60Days: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().subtract(60, 'days'))\r\n\t\t\t: localMoment().subtract(60, 'days'),\r\n\t\ttoValue: ignoreTimezone ? timeZoneLessLocalMoment(localMoment()) : localMoment(),\r\n\t\tpreset: 'Last60Days',\r\n\t\tdisplayName: 'Last 60 Days',\r\n\t\taxisPrecision: 'week',\r\n\t}),\r\n\tLast90Days: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().subtract(90, 'days'))\r\n\t\t\t: localMoment().subtract(90, 'days'),\r\n\t\ttoValue: ignoreTimezone ? timeZoneLessLocalMoment(localMoment()) : localMoment(),\r\n\t\tpreset: 'Last90Days',\r\n\t\tdisplayName: 'Last 90 Days',\r\n\t\taxisPrecision: 'week',\r\n\t}),\r\n\tYTD: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().startOf('year'))\r\n\t\t\t: localMoment().startOf('year'),\r\n\t\ttoValue: ignoreTimezone ? timeZoneLessLocalMoment(localMoment()) : localMoment(),\r\n\t\tpreset: 'YTD',\r\n\t\tdisplayName: 'YTD',\r\n\t\taxisPrecision: 'month',\r\n\t}),\r\n\tLastYear: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().subtract(1, 'years').startOf('year'))\r\n\t\t\t: localMoment().subtract(1, 'years').startOf('year'),\r\n\t\ttoValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().startOf('year'))\r\n\t\t\t: localMoment().startOf('year'),\r\n\t\tpreset: 'LastYear',\r\n\t\tdisplayName: 'Last Year',\r\n\t\taxisPrecision: 'month',\r\n\t}),\r\n\tAllTime: (ignoreTimezone?: boolean): RangedPresetValue => ({\r\n\t\tfromValue: ignoreTimezone\r\n\t\t\t? timeZoneLessLocalMoment(localMoment().subtract(1000, 'years'))\r\n\t\t\t: localMoment().subtract(1000, 'years'),\r\n\t\ttoValue: ignoreTimezone ? timeZoneLessLocalMoment(localMoment()) : localMoment(),\r\n\t\tpreset: 'AllTime',\r\n\t\tdisplayName: 'All Time',\r\n\t\taxisPrecision: 'month',\r\n\t}),\r\n};\r\n\r\n/**\r\n * Returns a friendly string containing a single ranged preset value\r\n * @param value\r\n */\r\nexport const getFriendlyDateRangePresetValueForDisplay = (value: RangedPresetValue) => {\r\n\tif (value.preset) {\r\n\t\treturn value.displayName || value.preset;\r\n\t}\r\n\r\n\tconst dateFormat = 'MM-DD-YY';\r\n\tconst fromTime = value.fromValue ? localMoment(value.fromValue).format(dateFormat) : '';\r\n\tconst toTime = value.toValue ? localMoment(value.toValue).format(dateFormat) : '';\r\n\r\n\tif (value.fromValue && value.toValue && toTime === fromTime) {\r\n\t\treturn `On ${toTime}`;\r\n\t} else if (value.fromValue && value.toValue) {\r\n\t\treturn `Between ${fromTime} and ${toTime}`;\r\n\t} else if (value.fromValue) {\r\n\t\treturn `After ${fromTime}`;\r\n\t} else if (value.toValue) {\r\n\t\treturn `Before ${toTime}`;\r\n\t}\r\n\r\n\treturn '<Empty>';\r\n};\r\n\r\n/**\r\n * Date range presets used by the single date picker preset filter type\r\n */\r\nexport const SingleDateRangePresets: RangePresetValuePresets = {\r\n\tToday: (): RangedPresetValue => ({\r\n\t\tfromValue: null,\r\n\t\ttoValue: localMoment().startOf('day'),\r\n\t\tpreset: 'Today',\r\n\t\tdisplayName: 'Today',\r\n\t}),\r\n\tYesterday: (): RangedPresetValue => ({\r\n\t\tfromValue: null,\r\n\t\ttoValue: localMoment().subtract(1, 'days').startOf('day'),\r\n\t\tpreset: 'Yesterday',\r\n\t\tdisplayName: 'Yesterday',\r\n\t}),\r\n\tLastWeek: (): RangedPresetValue => ({\r\n\t\tfromValue: null,\r\n\t\ttoValue: localMoment().subtract(1, 'week').startOf('week'),\r\n\t\tpreset: 'LastWeek',\r\n\t\tdisplayName: 'Last Week',\r\n\t}),\r\n\tLastMonth: (): RangedPresetValue => ({\r\n\t\tfromValue: null,\r\n\t\ttoValue: localMoment().subtract(1, 'month').startOf('month'),\r\n\t\tpreset: 'LastMonth',\r\n\t\tdisplayName: 'Last Month',\r\n\t}),\r\n\tLast60Days: (): RangedPresetValue => ({\r\n\t\tfromValue: null,\r\n\t\ttoValue: localMoment().subtract(60, 'days'),\r\n\t\tpreset: 'Last60Days',\r\n\t\tdisplayName: 'Last 60 Days',\r\n\t}),\r\n\tLast90Days: (): RangedPresetValue => ({\r\n\t\tfromValue: null,\r\n\t\ttoValue: localMoment().subtract(90, 'days'),\r\n\t\tpreset: 'Last90Days',\r\n\t\tdisplayName: 'Last 90 Days',\r\n\t}),\r\n\tLastYear: (): RangedPresetValue => ({\r\n\t\tfromValue: null,\r\n\t\ttoValue: localMoment().subtract(1, 'years').startOf('year'),\r\n\t\tpreset: 'LastYear',\r\n\t\tdisplayName: 'Last Year',\r\n\t}),\r\n};\r\n\r\nexport const Channel: {\r\n\tAll: string;\r\n} = {\r\n\tAll: 'All',\r\n};\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Spinner SVG for loading purposes\r\n *\r\n * @returns\r\n */\r\nfunction MagnifyingGlassSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg viewBox=\"0 0 32 32\" className={'icon ' + svgProps.class} focusable=\"false\" aria-hidden=\"true\">\r\n\t\t\t<path d=\"M31.118 31.12c-0.544 0.544-1.295 0.88-2.125 0.88s-1.581-0.336-2.125-0.88l-5.304-5.304c-2.151 1.398-4.782 2.23-7.607 2.23-7.782 0-14.091-6.309-14.091-14.091s6.309-14.091 14.091-14.091c7.782 0 14.091 6.309 14.091 14.091 0 2.827-0.833 5.46-2.266 7.666l0.033-0.055 5.304 5.304c0.544 0.544 0.881 1.295 0.881 2.125s-0.337 1.581-0.881 2.125l-0 0zM14.022 4c-5.533 0-10.018 4.485-10.018 10.018s4.485 10.018 10.018 10.018c5.533 0 10.018-4.485 10.018-10.018v0c0-0 0-0.001 0-0.002 0-5.532-4.484-10.016-10.016-10.016-0.001 0-0.001 0-0.002 0h0z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nMagnifyingGlassSVG.defaultProps = { class: '' };\r\n\r\nexport default MagnifyingGlassSVG;\r\n","import * as React from 'react';\r\n/**\r\n * Question Mark help SVG\r\n *\r\n * @returns\r\n */\r\nfunction HelpSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 32 32\"\r\n\t\t\tclassName={'icon icon-help-header ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t>\r\n\t\t\t<path d=\"M16 0c-8.837 0-16 7.163-16 16s7.163 16 16 16c8.837 0 16-7.163 16-16v0c0-8.837-7.163-16-16-16v0zM15.748 25.333h-0.085c-1.222-0.015-2.207-1.009-2.207-2.233 0-1.234 1-2.233 2.233-2.233 0.009 0 0.019 0 0.028 0h0.075c1.223 0.013 2.209 1.007 2.209 2.232 0 1.233-0.999 2.232-2.232 2.232-0.008 0-0.016-0-0.024-0h0.001zM21.233 14.448c-0.54 0.614-1.141 1.153-1.798 1.617l-0.032 0.022-0.933 0.645c-0.414 0.282-0.736 0.672-0.927 1.13l-0.006 0.017c-0.095 0.244-0.149 0.527-0.149 0.823 0 0.048 0.001 0.096 0.004 0.143l-0-0.007v0.151h-3.583l0.009-0.303c-0.018-0.14-0.028-0.302-0.028-0.467 0-0.784 0.23-1.515 0.627-2.128l-0.009 0.015c0.788-0.795 1.661-1.502 2.606-2.109l0.061-0.037c0.246-0.181 0.455-0.394 0.626-0.637l0.006-0.009c0.306-0.356 0.504-0.813 0.54-1.314l0-0.007c0-0.005 0-0.011 0-0.017 0-0.567-0.183-1.091-0.493-1.517l0.005 0.007c-0.375-0.419-0.917-0.682-1.521-0.682-0.087 0-0.173 0.005-0.257 0.016l0.010-0.001c-0.060-0.007-0.129-0.010-0.199-0.010-0.656 0-1.236 0.329-1.583 0.831l-0.004 0.006c-0.334 0.501-0.535 1.116-0.541 1.777v0.155h-3.685l0.007-0.16c-0.003-0.070-0.005-0.152-0.005-0.235 0-1.894 0.94-3.568 2.379-4.582l0.018-0.012c0.932-0.571 2.061-0.91 3.269-0.91 0.070 0 0.139 0.001 0.208 0.003l-0.010-0c0.080-0.003 0.173-0.005 0.268-0.005 1.569 0 3.025 0.483 4.229 1.308l-0.026-0.017c1.108 0.821 1.818 2.124 1.818 3.593 0 0.091-0.003 0.181-0.008 0.271l0.001-0.012c-0.005 0.997-0.339 1.915-0.899 2.652l0.008-0.011z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nHelpSVG.defaultProps = { class: '' };\r\n\r\nexport default HelpSVG;\r\n","import * as React from 'react';\r\n\r\nimport { MomentInput } from 'moment';\r\nimport { formatDateTime, DefaultDateFormat, DefaultTimeFormat, DefaultDateTimeFormat } from 'util/Time';\r\n\r\ninterface TimeProps {\r\n\ttime?: MomentInput;\r\n\tformat?: string;\r\n}\r\n\r\n/**\r\n * A simple component which formats renders a specified date/time in plaintext, localized to the server's time zone.\r\n *\r\n * @class FormattedDateTime\r\n * @extends {(React.PureComponent<TimeProps>)}\r\n */\r\nexport class FormattedDateTime extends React.PureComponent<TimeProps> {\r\n\tpublic render() {\r\n\t\treturn <>{formatDateTime(this.props.time, this.props.format || DefaultDateTimeFormat)}</>;\r\n\t}\r\n}\r\n\r\n/**\r\n * A simple component which formats renders a specified date in plaintext, localized to the server's time zone.\r\n *\r\n * @class FormattedDate\r\n * @extends {(React.PureComponent<TimeProps>)}\r\n */\r\nexport class FormattedDate extends React.PureComponent<TimeProps> {\r\n\tpublic render() {\r\n\t\treturn <>{formatDateTime(this.props.time, this.props.format || DefaultDateFormat)}</>;\r\n\t}\r\n}\r\n\r\n/**\r\n * A simple component which formats renders a specified time in plaintext, localized to the server's time zone.\r\n *\r\n * @class FormattedTime\r\n * @extends {(React.PureComponent<TimeProps>)}\r\n */\r\nexport class FormattedTime extends React.PureComponent<TimeProps> {\r\n\tpublic render() {\r\n\t\treturn <>{formatDateTime(this.props.time, this.props.format || DefaultTimeFormat)}</>;\r\n\t}\r\n}\r\n","import * as React from 'react';\r\nimport { Field } from 'react-final-form';\r\nimport { FieldArray } from 'react-final-form-arrays';\r\nimport BasicDto from 'types/__models__/BasicDto';\r\nimport TextBox from 'components/shared/edit/fields/TextBox';\r\nimport { FormatUrl } from 'components/shared/edit/fields/formatters';\r\nimport { ModelStatus } from 'shared-client/types/model-status';\r\nimport { RedirectData } from 'types';\r\nimport ValidationErrorAlert, { AlertType } from '~/components/shared/edit/ValidationErrorAlert';\r\n\r\ninterface Redirect301OnTheFlyFormProps {\r\n\trecord: UrlDto;\r\n\tsiteNames: string[];\r\n\tsubmitError: string | string[] | null;\r\n\tinitialValue: RedirectData[];\r\n\tfieldName?: string;\r\n}\r\n\r\ninterface UrlDto extends BasicDto {\r\n\turl: string;\r\n\tstatus: ModelStatus;\r\n}\r\n\r\n/**\r\n * Component for creating a 301 redirect on the fly when a record's scope has changed during publishing\r\n * or when deleting records.\r\n */\r\nfunction Redirect301OnTheFlyForm({\r\n\trecord,\r\n\tsiteNames,\r\n\tsubmitError,\r\n\tinitialValue,\r\n\tfieldName = '__redirects',\r\n}: Redirect301OnTheFlyFormProps) {\r\n\tReact.useEffect(() => {\r\n\t\t//setting focus to the 1st 301 'site redirect URL' input only on the first render of the component and fieldName changes.\r\n\t\tconst input = document.getElementById(`${fieldName}[0].redirectUrl`);\r\n\r\n\t\tif (input) {\r\n\t\t\tinput.focus();\r\n\t\t}\r\n\t}, [fieldName]);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<p>URL: {record.url}</p>\r\n\r\n\t\t\t<ValidationErrorAlert submitError={submitError} alertType={AlertType.Edit} />\r\n\r\n\t\t\t<div className=\"input-grid\">\r\n\t\t\t\t<FieldArray name={fieldName} initialValue={initialValue}>\r\n\t\t\t\t\t{({ fields }) =>\r\n\t\t\t\t\t\tfields.map((field, index) => {\r\n\t\t\t\t\t\t\tconst siteName = siteNames[index];\r\n\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\t\tclassName=\"input-grid__item\"\r\n\t\t\t\t\t\t\t\t\tkey={index}\r\n\t\t\t\t\t\t\t\t\tdata-testid={`redirect-url-item-${index}`}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\t\t\tname={`${field}.redirectUrl`}\r\n\t\t\t\t\t\t\t\t\t\tlabel={`${siteName} Redirect URL`}\r\n\t\t\t\t\t\t\t\t\t\tcomponent={TextBox}\r\n\t\t\t\t\t\t\t\t\t\tformat={FormatUrl}\r\n\t\t\t\t\t\t\t\t\t\tformatOnBlur\r\n\t\t\t\t\t\t\t\t\t\tisShared={false}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t</FieldArray>\r\n\t\t\t</div>\r\n\t\t</>\r\n\t);\r\n}\r\n\r\nexport default Redirect301OnTheFlyForm;\r\n","import * as React from 'react';\r\nimport { RemovalException, RemovalSeverity, RemovalFailureReason, getHandleableException } from 'types/Exceptions';\r\nimport Confirm, { ConfirmColor, RenderButtonProps } from '../Confirm';\r\nimport { Button } from 'reactstrap';\r\nimport Spinner from '../Spinner';\r\nimport { AxiosError } from 'axios';\r\nimport { RemovalErrorCode } from 'types/ExceptionCodes';\r\nimport Alert from '../Alert';\r\n\r\ntype RenderButtonDelegate = (props: RenderButtonProps) => React.ReactNode;\r\n\r\ninterface EditErrorAlertPopupProps {\r\n\t/** The removal error, coming from the server. Contains information on why it failed, the severity of the attempt, and whether it can be overridden. */\r\n\taxiosError: AxiosError | null;\r\n\r\n\t/** Called when the confirm button is pressed. */\r\n\tonConfirm: () => void;\r\n\r\n\t/** Called when the cancel button is pressed or the alert is closed through other means. */\r\n\tonCancel: () => void;\r\n\r\n\t/** Defines the types of buttons that will appear on the alert. */\r\n\trenderButtons?: 'Accept' | 'NoAccept' | 'TimedAccept' | RenderButtonDelegate;\r\n\r\n\t/** The title text of the alert. */\r\n\ttitle?: () => React.ReactNode;\r\n\r\n\t/** Whether the alert is being displayed right now. */\r\n\tisOpen: boolean;\r\n\r\n\t/** Whether there should be a spinner on the submit button, indicating that the server is handling the submission request. */\r\n\tinProgress: boolean;\r\n}\r\n\r\ninterface EditErrorAlertPopupState {\r\n\t/** The time remaining until the submit button is enabled. */\r\n\tlockTime: number;\r\n}\r\n\r\nconst DANGER_LOCK_TIME = 5;\r\nconst CONFIRM_TEXT = 'Yes, I understand';\r\n\r\n/**\r\n * The alert that displays to a user when they are attempting to remove a record with active dependencies/foreign keys.\r\n * This will display an error message informing the user what they are about to do or were trying to do and provide them\r\n * an option to force the change if possible.\r\n *\r\n * @class EditErrorAlertPopup\r\n * @extends {React.Component<EditErrorAlertPopupProps, EditErrorAlertPopupState>}\r\n */\r\nclass EditErrorAlertPopup extends React.Component<EditErrorAlertPopupProps, EditErrorAlertPopupState> {\r\n\tpublic static defaultProps = {\r\n\t\tonCancel: () => {},\r\n\t};\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tlockTime: DANGER_LOCK_TIME,\r\n\t\t};\r\n\t}\r\n\r\n\t/** The timer that counts down the lock time */\r\n\tprivate lockTimer: NodeJS.Timeout | null = null;\r\n\r\n\tpublic componentDidMount() {\r\n\t\tif (this.props.isOpen) {\r\n\t\t\tthis.setLockTimer();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic componentDidUpdate(prevProps: EditErrorAlertPopupProps) {\r\n\t\tif (this.props.isOpen && !prevProps.isOpen) {\r\n\t\t\tthis.setLockTimer();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\tthis.killLockTimer();\r\n\t}\r\n\r\n\t/** Sets the lock time to the specified value and starts up the lock timer if it doesn't exist already */\r\n\tprivate setLockTimer(time = DANGER_LOCK_TIME) {\r\n\t\tthis.killLockTimer();\r\n\t\tthis.lockTimer = setInterval(() => this.lockTimerTick(), 1000);\r\n\t\tthis.setState({ lockTime: time });\r\n\t}\r\n\r\n\t/** Kills the lock timer if it exists */\r\n\tprivate killLockTimer() {\r\n\t\tif (this.lockTimer) {\r\n\t\t\tclearInterval(this.lockTimer);\r\n\t\t\tthis.lockTimer = null;\r\n\t\t}\r\n\t}\r\n\r\n\t/** Decrements the lock timer and kills the timer once the timer has run out */\r\n\tprivate lockTimerTick = () => {\r\n\t\tif (this.state.lockTime <= 1) {\r\n\t\t\tthis.killLockTimer();\r\n\t\t}\r\n\r\n\t\tif (this.state.lockTime > 0) {\r\n\t\t\tthis.setState((prevState) => ({\r\n\t\t\t\tlockTime: prevState.lockTime - 1,\r\n\t\t\t}));\r\n\t\t}\r\n\t};\r\n\r\n\t/** Confirm button render method. Renders only a cancel button on the alert, for cases where forcing isn't possible */\r\n\tprivate renderNoAcceptButton = (renderButtonProps: RenderButtonProps) => {\r\n\t\treturn (\r\n\t\t\t<div className=\"text-center\">\r\n\t\t\t\t<Button\r\n\t\t\t\t\tcolor={renderButtonProps.cancelButtonColor}\r\n\t\t\t\t\tclassName=\"btn-inline btn-modal-action fancy-modal__cancel-btn\"\r\n\t\t\t\t\toutline\r\n\t\t\t\t\tonClick={renderButtonProps.onCancel}\r\n\t\t\t\t\tdata-testid={renderButtonProps.cancelTestId}\r\n\t\t\t\t>\r\n\t\t\t\t\t{renderButtonProps.cancelButtonText}\r\n\t\t\t\t</Button>\r\n\t\t\t</div>\r\n\t\t);\r\n\t};\r\n\r\n\t/** Confirm button render method. Renders an accept and cancel button with the accept button disabled until a certain amount of time has passed */\r\n\tprivate renderTimedAcceptButton = (renderButtonProps: RenderButtonProps) => {\r\n\t\treturn (\r\n\t\t\t<div className=\"text-center\">\r\n\t\t\t\t<Button\r\n\t\t\t\t\tcolor={renderButtonProps.cancelButtonColor}\r\n\t\t\t\t\tclassName=\"btn-inline btn-modal-action fancy-modal__cancel-btn\"\r\n\t\t\t\t\toutline\r\n\t\t\t\t\tonClick={renderButtonProps.onCancel}\r\n\t\t\t\t\tdata-testid={renderButtonProps.cancelTestId}\r\n\t\t\t\t>\r\n\t\t\t\t\t{renderButtonProps.cancelButtonText}\r\n\t\t\t\t</Button>\r\n\t\t\t\t<Button\r\n\t\t\t\t\tcolor={renderButtonProps.confirmButtonColor}\r\n\t\t\t\t\tclassName=\"btn-modal-action fancy-modal__confirm-btn\"\r\n\t\t\t\t\toutline={renderButtonProps.color === 'primary' ? true : false}\r\n\t\t\t\t\tonClick={renderButtonProps.onConfirm}\r\n\t\t\t\t\tdisabled={renderButtonProps.inProgress || this.state.lockTime > 0}\r\n\t\t\t\t\tdata-testid={renderButtonProps.confirmTestId}\r\n\t\t\t\t>\r\n\t\t\t\t\t{renderButtonProps.inProgress ? (\r\n\t\t\t\t\t\t<Spinner centered color=\"light\" />\r\n\t\t\t\t\t) : this.state.lockTime > 0 ? (\r\n\t\t\t\t\t\t`${renderButtonProps.confirmButtonText} (${this.state.lockTime}...)`\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\trenderButtonProps.confirmButtonText\r\n\t\t\t\t\t)}\r\n\t\t\t\t</Button>\r\n\t\t\t</div>\r\n\t\t);\r\n\t};\r\n\r\n\tprivate getColor() {\r\n\t\tconst exception = this.props.axiosError && (getHandleableException(this.props.axiosError) as RemovalException);\r\n\t\tif (exception && exception.exceptionCode === RemovalErrorCode) {\r\n\t\t\tswitch (exception.removalSeverity) {\r\n\t\t\t\tdefault:\r\n\t\t\t\tcase RemovalSeverity.Normal:\r\n\t\t\t\t\treturn 'default';\r\n\r\n\t\t\t\tcase RemovalSeverity.Warning:\r\n\t\t\t\t\treturn 'warning';\r\n\r\n\t\t\t\tcase RemovalSeverity.Danger:\r\n\t\t\t\t\treturn 'danger';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn 'warning';\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst { axiosError, isOpen, inProgress, title, onCancel, onConfirm, renderButtons } = this.props;\r\n\t\tconst exception = this.props.axiosError && getHandleableException(axiosError);\r\n\t\tconst isClientHandleable = exception != null;\r\n\r\n\t\tconst color: ConfirmColor = this.getColor();\r\n\r\n\t\tconst renderContentsFunc = () => {\r\n\t\t\tconst loggingErrorId =\r\n\t\t\t\t(axiosError &&\r\n\t\t\t\t\taxiosError.response &&\r\n\t\t\t\t\taxiosError.response.data &&\r\n\t\t\t\t\t(axiosError.response.data.loggingErrorId as string)) ||\r\n\t\t\t\tnull;\r\n\t\t\tif (isClientHandleable) {\r\n\t\t\t\treturn exception\r\n\t\t\t\t\t? exception.message.split('\\n').map((line, i) => (\r\n\t\t\t\t\t\t\t<p key={'message-line-' + i} data-testid={'edit-error-message-' + i}>\r\n\t\t\t\t\t\t\t\t{line}\r\n\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t  ))\r\n\t\t\t\t\t: null;\r\n\t\t\t} else {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<p>The server encountered an error while processing your request.</p>\r\n\t\t\t\t\t\t{loggingErrorId ? <p>ID: {loggingErrorId}</p> : null}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tconst boundRenderNoAcceptButton = this.renderNoAcceptButton;\r\n\t\tconst boundRenderTimedAcceptButton = this.renderTimedAcceptButton;\r\n\r\n\t\tconst renderButtonsFunc = () => {\r\n\t\t\tswitch (renderButtons) {\r\n\t\t\t\tcase 'Accept':\r\n\t\t\t\t\treturn undefined;\r\n\t\t\t\tcase 'NoAccept':\r\n\t\t\t\t\treturn boundRenderNoAcceptButton;\r\n\t\t\t\tcase 'TimedAccept':\r\n\t\t\t\t\treturn boundRenderTimedAcceptButton;\r\n\t\t\t}\r\n\r\n\t\t\tconst removalException =\r\n\t\t\t\t(exception && exception.exceptionCode === RemovalErrorCode && (exception as RemovalException)) || null;\r\n\r\n\t\t\treturn removalException && removalException.failureReason !== RemovalFailureReason.WasNotForced\r\n\t\t\t\t? boundRenderNoAcceptButton\r\n\t\t\t\t: removalException && removalException.removalSeverity === RemovalSeverity.Danger\r\n\t\t\t\t? boundRenderTimedAcceptButton\r\n\t\t\t\t: undefined;\r\n\t\t};\r\n\r\n\t\tif (!isClientHandleable) {\r\n\t\t\treturn (\r\n\t\t\t\t<Alert\r\n\t\t\t\t\tisOpen={isOpen}\r\n\t\t\t\t\tcolor={color}\r\n\t\t\t\t\trenderContents={renderContentsFunc}\r\n\t\t\t\t\trenderTitle={title || (() => 'Removal Error!')}\r\n\t\t\t\t\tonConfirm={onCancel}\r\n\t\t\t\t/>\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<Confirm\r\n\t\t\t\tcolor={color}\r\n\t\t\t\tisOpen={isOpen}\r\n\t\t\t\tonCancel={onCancel}\r\n\t\t\t\tonConfirm={onConfirm}\r\n\t\t\t\trenderTitle={title || (() => 'Removal Error!')}\r\n\t\t\t\trenderContents={renderContentsFunc}\r\n\t\t\t\trenderButtons={renderButtonsFunc()}\r\n\t\t\t\tconfirmButtonText={CONFIRM_TEXT}\r\n\t\t\t\tinProgress={inProgress}\r\n\t\t\t\tcancelTestId=\"removal-error-alert-cancel\"\r\n\t\t\t\tconfirmTestId=\"removal-error-alert-confirm\"\r\n\t\t\t/>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default EditErrorAlertPopup;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Calendar Trash Icon\r\n *\r\n * @returns\r\n */\r\nfunction CalendarTrashSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 35 32\"\r\n\t\t\tclassName={'icon icon-calendar-trash ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t\tdata-testid={svgProps.testId}\r\n\t\t>\r\n\t\t\t<path d=\"M15.322 24.078h3.283v3.283h-3.283v-3.283z\" />\r\n\t\t\t<path d=\"M15.322 21.889h2.768c-0.195-0.369-0.313-0.807-0.318-1.271l-0-0.002v-0.744c0.015-0.47 0.145-0.906 0.36-1.286l-0.007 0.014h-2.803z\" />\r\n\t\t\t<path d=\"M20.76 6.567c1.187-0.004 2.148-0.967 2.148-2.154 0 0 0 0 0 0v0-2.259c-0.046-1.155-0.993-2.074-2.155-2.074s-2.11 0.919-2.155 2.070l-0 0.004v2.259c0 0 0 0 0 0 0 1.19 0.964 2.154 2.154 2.154 0.003 0 0.007 0 0.010-0h-0.001z\" />\r\n\t\t\t<path d=\"M20.795 16.417h1.721c0.4-0.567 0.926-1.021 1.538-1.325l0.024-0.011v-1.947h-3.283z\" />\r\n\t\t\t<path d=\"M7.636 6.567c0 0 0 0 0 0 1.19 0 2.155-0.964 2.157-2.154v-2.259c-0.046-1.155-0.993-2.074-2.155-2.074s-2.11 0.919-2.155 2.070l-0 0.004v2.259c0 1.19 0.964 2.154 2.154 2.154v0z\" />\r\n\t\t\t<path d=\"M15.322 13.133h3.283v3.283h-3.283v-3.283z\" />\r\n\t\t\t<path d=\"M4.378 24.078h3.283v3.283h-3.283v-3.283z\" />\r\n\t\t\t<path d=\"M4.378 18.606h3.283v3.283h-3.283v-3.283z\" />\r\n\t\t\t<path d=\"M4.378 13.133h3.283v3.283h-3.283v-3.283z\" />\r\n\t\t\t<path d=\"M9.85 13.133h3.283v3.283h-3.283v-3.283z\" />\r\n\t\t\t<path d=\"M9.85 24.078h3.283v3.283h-3.283v-3.283z\" />\r\n\t\t\t<path d=\"M9.85 18.606h3.283v3.283h-3.283v-3.283z\" />\r\n\t\t\t<path d=\"M19.089 30.005v-0.455h-16.9v-18.606h24.078v3.71h2.189v-9.182c0-1.209-0.98-2.189-2.189-2.189v0h-2.189v1.094c0 1.813-1.47 3.283-3.283 3.283s-3.283-1.47-3.283-3.283v0-1.094h-6.567v1.094c0 1.813-1.47 3.283-3.283 3.283s-3.283-1.47-3.283-3.283v0-1.094h-2.189c-1.209 0-2.189 0.98-2.189 2.189v0 24.078c0 1.209 0.98 2.189 2.189 2.189h17.18c-0.18-0.458-0.284-0.989-0.284-1.543 0-0.067 0.002-0.134 0.005-0.2l-0 0.009z\" />\r\n\t\t\t<path d=\"M34.625 19.977c0-0.176-0.142-0.318-0.318-0.318v0h-3.153l-0.709-1.607c-0.257-0.498-0.759-0.838-1.343-0.859l-0.003-0h-3.255c-0.586 0.027-1.087 0.367-1.342 0.857l-0.004 0.009-0.709 1.607h-3.143c-0.176 0-0.318 0.142-0.318 0.318v0 0.62c0 0.176 0.142 0.318 0.318 0.318v0h0.989v9.156c-0.002 0.035-0.004 0.075-0.004 0.116 0 0.935 0.713 1.704 1.625 1.792l0.007 0.001h8.437c0.922-0.106 1.631-0.883 1.631-1.824 0-0.050-0.002-0.099-0.006-0.148l0 0.006v-9.122h0.98c0.176 0 0.318-0.142 0.318-0.318v0 0zM25.697 18.539c0.045-0.044 0.102-0.074 0.167-0.086l0.002-0h3.223c0.067 0.020 0.123 0.055 0.169 0.102l0 0 0.487 1.126h-4.55zM31.701 30.766h-8.46c-0.196-0.155-0.321-0.393-0.321-0.661 0-0.025 0.001-0.050 0.003-0.074l-0 0.003v-9.134h9.112v9.134c0.001 0.016 0.002 0.034 0.002 0.052 0 0.276-0.131 0.522-0.334 0.678l-0.002 0.001zM25.195 22.751h-0.636c-0.176 0-0.318 0.142-0.318 0.318v0 5.542c0 0.176 0.142 0.318 0.318 0.318v0h0.636c0.176 0 0.318-0.142 0.318-0.318v0-5.549c-0.004-0.173-0.145-0.312-0.318-0.312-0 0-0 0-0 0v0zM27.8 22.751h-0.636c-0.176 0-0.318 0.142-0.318 0.318v0 5.542c0 0.176 0.142 0.318 0.318 0.318v0h0.655c0.176 0 0.318-0.142 0.318-0.318v0-5.549c-0.003-0.173-0.144-0.312-0.318-0.312-0.007 0-0.013 0-0.020 0.001l0.001-0zM30.396 22.751h-0.636c-0.176 0-0.318 0.142-0.318 0.318v0 5.542c0 0.176 0.142 0.318 0.318 0.318v0h0.655c0.176 0 0.318-0.142 0.318-0.318v0-5.549c0-0.176-0.142-0.318-0.318-0.318v0z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nCalendarTrashSVG.defaultProps = { class: '' };\r\n\r\nexport default CalendarTrashSVG;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Calendar Power Icon\r\n *\r\n * @returns\r\n */\r\nfunction CalendarPowerSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 35 32\"\r\n\t\t\tclassName={'icon icon-calendar-power ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t\tdata-testid={svgProps.testId}\r\n\t\t>\r\n\t\t\t<path d=\"M20.93 6.621c1.197-0.004 2.165-0.974 2.165-2.172 0 0 0 0 0 0v0-2.277c-0.046-1.165-1.001-2.091-2.173-2.091s-2.127 0.927-2.173 2.087l-0 0.004v2.277c0 0 0 0 0 0 0 1.199 0.972 2.172 2.172 2.172 0.003 0 0.007 0 0.010-0h-0.001z\" />\r\n\t\t\t<path d=\"M20.966 16.552h1.014c0.661-0.456 1.42-0.846 2.228-1.133l0.069-0.021v-2.156h-3.31z\" />\r\n\t\t\t<path d=\"M15.448 24.276v3.31h2.566c-0.246-0.826-0.387-1.775-0.387-2.757 0-0.195 0.006-0.388 0.017-0.58l-0.001 0.027z\" />\r\n\t\t\t<path d=\"M19.958 31.172c-0.339-0.406-0.657-0.856-0.937-1.333l-0.025-0.047h-16.789v-18.759h24.276v3.865c0.263-0.029 0.526-0.048 0.789-0.055 0.135-0.017 0.291-0.027 0.45-0.027 0.215 0 0.425 0.018 0.631 0.053l-0.022-0.003 0.359 0.032v-9.383c0-1.219-0.988-2.207-2.207-2.207v0h-2.207v1.103c0 1.828-1.482 3.31-3.31 3.31s-3.31-1.482-3.31-3.31v0-1.103h-6.621v1.103c0 1.828-1.482 3.31-3.31 3.31s-3.31-1.482-3.31-3.31v0-1.103h-2.207c-1.219 0-2.207 0.988-2.207 2.207v0 24.276c0 1.219 0.988 2.207 2.207 2.207h18.537c-0.276-0.26-0.533-0.53-0.774-0.813l-0.012-0.014z\" />\r\n\t\t\t<path d=\"M15.448 18.759v3.31h2.544c0.21-0.738 0.471-1.376 0.793-1.978l-0.026 0.053v-1.386z\" />\r\n\t\t\t<path d=\"M15.448 13.241h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M7.698 6.621c0 0 0 0 0 0 1.2 0 2.173-0.972 2.175-2.171v-2.278c-0.046-1.165-1.001-2.091-2.173-2.091s-2.127 0.927-2.173 2.087l-0 0.004v2.277c0 1.199 0.972 2.172 2.172 2.172v0z\" />\r\n\t\t\t<path d=\"M4.414 24.276h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M4.414 18.759h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M4.414 13.241h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M9.931 18.759h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M9.931 24.276h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M9.931 13.241h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M34.752 24.767c0 0.002 0 0.005 0 0.008 0 3.979-3.226 7.204-7.204 7.204s-7.204-3.226-7.204-7.204c0-1.761 0.631-3.374 1.68-4.625l-0.009 0.011c0.078-0.148 0.187-0.271 0.318-0.364l0.003-0.002 0.067-0.074s0 0.022 0 0.032c0.152-0.094 0.337-0.15 0.534-0.15 0.567 0 1.027 0.46 1.027 1.027 0 0.37-0.195 0.694-0.489 0.875l-0.004 0.003 0.051 0.042c-0.699 0.87-1.123 1.987-1.123 3.204 0 2.834 2.298 5.132 5.132 5.132s5.132-2.298 5.132-5.132c0-1.216-0.423-2.334-1.13-3.214l0.008 0.010 0.051-0.042c-0.298-0.183-0.493-0.508-0.493-0.877 0-0.567 0.46-1.027 1.027-1.027 0.197 0 0.382 0.056 0.538 0.152l-0.004-0.003s0-0.022 0-0.032l0.067 0.074c0.134 0.095 0.242 0.218 0.318 0.36l0.003 0.006c1.052 1.234 1.695 2.844 1.703 4.604v0.002zM28.061 25.796h-1.026c-0.285 0-0.516-0.231-0.516-0.516v0-7.204c0.002-0.284 0.232-0.513 0.516-0.513 0 0 0 0 0 0h1.026c0 0 0 0 0 0 0.284 0 0.515 0.229 0.516 0.513v7.205c0 0.285-0.231 0.516-0.516 0.516v0z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nCalendarPowerSVG.defaultProps = { class: '' };\r\n\r\nexport default CalendarPowerSVG;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Calendar Checkmark Icon\r\n *\r\n * @returns\r\n */\r\nfunction CalendarCheckmarkSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 34 32\"\r\n\t\t\tclassName={'icon icon-calendar-checkmark ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t\tdata-testid={svgProps.testId}\r\n\t\t>\r\n\t\t\t<path d=\"M7.698 6.621c0 0 0 0 0 0 1.2 0 2.173-0.972 2.175-2.171v-2.278c-0.046-1.165-1.001-2.091-2.173-2.091s-2.127 0.927-2.173 2.087l-0 0.004v2.277c0 1.199 0.972 2.172 2.172 2.172v0z\" />\r\n\t\t\t<path d=\"M21.2 29.793h-18.993v-18.759h24.276v10.37l2.207-3.528v-12.359c0-1.219-0.988-2.207-2.207-2.207v0h-2.207v1.103c0 1.828-1.482 3.31-3.31 3.31s-3.31-1.482-3.31-3.31v0-1.103h-6.621v1.103c0 1.828-1.482 3.31-3.31 3.31s-3.31-1.482-3.31-3.31v0-1.103h-2.207c-1.219 0-2.207 0.988-2.207 2.207v0 24.276c0 1.219 0.988 2.207 2.207 2.207h20.664z\" />\r\n\t\t\t<path d=\"M15.448 18.759h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M20.93 6.621c1.197-0.004 2.165-0.974 2.165-2.172 0 0 0 0 0 0v0-2.277c-0.046-1.165-1.001-2.091-2.173-2.091s-2.127 0.927-2.173 2.087l-0 0.004v2.277c0 0 0 0 0 0 0 1.199 0.972 2.172 2.172 2.172 0.003 0 0.007 0 0.010-0h-0.001z\" />\r\n\t\t\t<path d=\"M20.966 21.812c0.595-0.355 1.312-0.566 2.079-0.566 0.2 0 0.397 0.014 0.59 0.042l-0.022-0.003c0.251 0.033 0.475 0.085 0.691 0.155l-0.027-0.008v-2.675h-3.31z\" />\r\n\t\t\t<path d=\"M15.448 24.276h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M20.966 13.241h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M15.448 13.241h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M4.414 24.276h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M4.414 13.241h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M4.414 18.759h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M9.931 18.759h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M9.931 24.276h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M9.931 13.241h3.31v3.31h-3.31v-3.31z\" />\r\n\t\t\t<path d=\"M26.242 30.852c-0.001 0-0.003 0-0.005 0-0.403 0-0.761-0.193-0.987-0.491l-0.002-0.003-3.192-4.215c-0.156-0.206-0.25-0.468-0.25-0.751 0-0.691 0.56-1.251 1.251-1.251 0.408 0 0.77 0.195 0.999 0.497l0.002 0.003 2.101 2.771 5.277-8.488c0.224-0.354 0.613-0.586 1.057-0.586 0.688 0 1.246 0.558 1.246 1.246 0 0.244-0.070 0.472-0.192 0.664l0.003-0.005-6.252 10.021c-0.212 0.338-0.574 0.566-0.991 0.587l-0.003 0z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nCalendarCheckmarkSVG.defaultProps = { class: '' };\r\n\r\nexport default CalendarCheckmarkSVG;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Pencil Write SVG\r\n *\r\n * @returns\r\n */\r\nfunction PencilWriteSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 29 32\"\r\n\t\t\tclassName={'icon icon-pencil-write ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t\tdata-testid={svgProps.testId}\r\n\t\t>\r\n\t\t\t<path d=\"M1.455 24.727h5.818c0.015 0.001 0.033 0.001 0.050 0.001 0.383 0 0.727-0.163 0.968-0.423l0.001-0.001 16-16.013c0.268-0.257 0.434-0.619 0.434-1.019s-0.166-0.762-0.434-1.019l-0-0-5.818-5.831c-0.257-0.268-0.619-0.434-1.019-0.434s-0.762 0.167-1.019 0.434l-0 0-16.013 16.013c-0.261 0.242-0.424 0.586-0.424 0.969 0 0.018 0 0.035 0.001 0.053l-0-0.003v5.801c-0.002 0.030-0.004 0.065-0.004 0.1 0 0.759 0.615 1.374 1.374 1.374 0.030 0 0.059-0.001 0.088-0.003l-0.004 0zM2.909 18.038l14.545-14.545 3.78 3.78-14.545 14.545z\" />\r\n\t\t\t<path d=\"M27.636 29.091h-26.182c-0.803 0-1.455 0.651-1.455 1.455s0.651 1.455 1.455 1.455h26.182c0.803 0 1.455-0.651 1.455-1.455s-0.651-1.455-1.455-1.455v0z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nPencilWriteSVG.defaultProps = { class: '' };\r\n\r\nexport default PencilWriteSVG;\r\n","import * as React from 'react';\r\nimport XSVG from './svg/XSVG';\r\n\r\nexport interface PopoverCloseProps {\r\n\ttoggle: () => void;\r\n\thideText?: boolean;\r\n}\r\n\r\n/**\r\n * Popover close component to close popovers.\r\n *\r\n * @class PopoverClose\r\n * @extends {React.Component<PopoverCloseProps>}\r\n */\r\nclass PopoverClose extends React.Component<PopoverCloseProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst { toggle, hideText = false } = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t<div className=\"popover-close\">\r\n\t\t\t\t<button className=\"popover-close__btn\" onClick={toggle} data-testid=\"popover-close-btn\">\r\n\t\t\t\t\t<span\r\n\t\t\t\t\t\tclassName={hideText ? 'popover-close__text popover-close__text--hidden' : 'popover-close__text'}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\tclose\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t<span className=\"popover-close__x\">\r\n\t\t\t\t\t\t<XSVG class=\"popover-close__x-icon\" />\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</button>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default PopoverClose;\r\n","import * as React from 'react';\r\nimport PopoverClose from './PopoverClose';\r\n\r\nexport interface PopoverTitleProps {\r\n\ttitleText: string;\r\n\thideTitleText?: boolean;\r\n\trenderBack?: () => React.ReactNode;\r\n\tclose: () => void;\r\n}\r\n\r\n/**\r\n * Reusable component for popover title.\r\n *\r\n * @param {PopoverTitleProps} props\r\n * @returns\r\n */\r\nfunction PopoverTitle(props: PopoverTitleProps) {\r\n\tconst { titleText, close, renderBack, hideTitleText = false } = props;\r\n\r\n\treturn (\r\n\t\t<h2 className=\"popover-title\">\r\n\t\t\t{renderBack ? renderBack() : <div className=\"popover-title-back\" />}\r\n\t\t\t<span className={'popover-title-text' + (hideTitleText ? ' visually-hidden' : '')}>{titleText}</span>\r\n\t\t\t<div className=\"popover-title-close\">\r\n\t\t\t\t<PopoverClose toggle={close} />\r\n\t\t\t</div>\r\n\t\t</h2>\r\n\t);\r\n}\r\n\r\nexport default PopoverTitle;\r\n","import * as React from 'react';\r\nimport { AdminTabsContainerState, HighlightMarkupTypes } from '.';\r\n\r\nconst AdminTabsContext = React.createContext<AdminTabsContextValues>({} as any);\r\nexport default AdminTabsContext;\r\n\r\nexport type AdminTabsContextValues = AdminTabsContainerState & {\r\n\tsetActiveTab: (tab: string) => void;\r\n\tregisterTab: (tab: string) => void;\r\n\tsetValidationError: (tab: string, id: string, submitError?: any) => void;\r\n\thighlightTab: (tab: string, highlightMarkUp?: HighlightMarkupTypes) => void;\r\n};\r\n\r\n/**\r\n * HOC used to simplify accessing context from anything that uses AdminTabsContext.\r\n * @param WrappedComponent\r\n */\r\nexport const withAdminTabsContext = (WrappedComponent) => {\r\n\tconst AdminTabsComponent: any = (props) => {\r\n\t\treturn (\r\n\t\t\t<AdminTabsContext.Consumer>\r\n\t\t\t\t{(value: AdminTabsContextValues) => <WrappedComponent {...props} adminTabsContext={value} />}\r\n\t\t\t</AdminTabsContext.Consumer>\r\n\t\t);\r\n\t};\r\n\r\n\tconst wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\r\n\tAdminTabsComponent.displayName = `withAdminTabsContext(${wrappedComponentName})`;\r\n\tAdminTabsComponent.WrappedComponent = WrappedComponent;\r\n\r\n\treturn AdminTabsComponent;\r\n};\r\n","import { Decorator, FormApi } from 'final-form';\r\nimport { getIn } from 'final-form';\r\n\r\n// FORK OF: https://github.com/final-form/final-form-focus\r\n\r\n/**\r\n * Finds the input by looking if the name attribute path is existing in the errors object\r\n */\r\nconst defaultFindInput = (inputs, errors: Record<string, unknown>) =>\r\n\tinputs.find((input) => input.name && getIn(errors, input.name));\r\n\r\nexport interface FocusableInput {\r\n\tname: string;\r\n\tfocus: () => void;\r\n}\r\n\r\nexport type GetInputs = () => FocusableInput[];\r\nexport type FindInput = (inputs: FocusableInput[], errors: Record<string, unknown>) => FocusableInput | undefined;\r\n\r\nexport const createDecorator = (getInputs?, findInput?): Decorator => {\r\n\treturn (form: FormApi) => {\r\n\t\tconst focusOnFirstError = (errors: Record<string, unknown>) => {\r\n\t\t\tif (!getInputs) {\r\n\t\t\t\tgetInputs = getAllInputs;\r\n\t\t\t}\r\n\t\t\tif (!findInput) {\r\n\t\t\t\tfindInput = defaultFindInput;\r\n\t\t\t}\r\n\t\t\tconst firstInput = findInput(getInputs(), errors);\r\n\t\t\tif (firstInput) {\r\n\t\t\t\t/* \r\n                 this is the only customization we added. this allows the .focus() call to happen\r\n                 after react is done rendering to make sure validation errors are highlighted\r\n                 across multiple tabs.\r\n                 */\r\n\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tfirstInput.focus();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\t// Save original submit function\r\n\t\tconst originalSubmit = form.submit;\r\n\t\t// Subscribe to errors, and keep a local copy of them\r\n\t\tlet state: {\r\n\t\t\terrors?: Record<string, unknown>;\r\n\t\t\tsubmitErrors?: Record<string, unknown>;\r\n\t\t} = {};\r\n\t\tconst unsubscribe = form.subscribe(\r\n\t\t\t(nextState) => {\r\n\t\t\t\tstate = nextState;\r\n\t\t\t},\r\n\t\t\t{ errors: true, submitErrors: true },\r\n\t\t);\r\n\t\t// What to do after submit\r\n\t\tconst afterSubmit = () => {\r\n\t\t\tconst { errors, submitErrors } = state;\r\n\t\t\tif (errors && Object.keys(errors).length) {\r\n\t\t\t\tfocusOnFirstError(errors);\r\n\t\t\t} else if (submitErrors && Object.keys(submitErrors).length) {\r\n\t\t\t\tfocusOnFirstError(submitErrors);\r\n\t\t\t}\r\n\t\t};\r\n\t\t// Rewrite submit function\r\n\t\tform.submit = () => {\r\n\t\t\tconst result = originalSubmit.call(form);\r\n\t\t\tif (result && typeof result.then === 'function') {\r\n\t\t\t\t// async\r\n\t\t\t\tresult.then(afterSubmit);\r\n\t\t\t} else {\r\n\t\t\t\t// sync\r\n\t\t\t\tafterSubmit();\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t};\r\n\t\treturn () => {\r\n\t\t\tunsubscribe();\r\n\t\t\tform.submit = originalSubmit;\r\n\t\t};\r\n\t};\r\n};\r\n\r\n/**\r\n * Gets all the inputs inside all forms on the page\r\n */\r\nconst getAllInputs = () => {\r\n\tif (typeof document === 'undefined') {\r\n\t\treturn [];\r\n\t}\r\n\treturn Array.prototype.slice\r\n\t\t.call(document.forms)\r\n\t\t.reduce(\r\n\t\t\t(accumulator, form) => accumulator.concat(Array.prototype.slice.call(form).filter(isFocusableInput)),\r\n\t\t\t[],\r\n\t\t);\r\n};\r\n\r\n/**\r\n * Predicate to identify inputs that can have focus() called on them\r\n */\r\nconst isFocusableInput = (wtf: any) => !!(wtf && typeof wtf.focus === 'function');\r\n","import AppState from 'AppState';\r\nimport Alert from 'components/shared/Alert';\r\nimport React, { useContext, useEffect, useState } from 'react';\r\nimport { Field, FormRenderProps, useField } from 'react-final-form';\r\nimport { useLocation } from 'react-router';\r\nimport { Button } from 'reactstrap';\r\nimport { getHandleableException, RemovalException } from 'types/Exceptions';\r\nimport { ModelStatus } from 'shared-client/types/model-status';\r\nimport AutoSuggestContext from '../auto-suggest/AutoSuggestContext';\r\nimport AutoSuggestSingle from '../auto-suggest/AutoSuggestSingle';\r\nimport { AutoSuggestItem } from '../auto-suggest/Types';\r\nimport ExclamationCircleSVG from '../svg/ExclamationCircleSVG';\r\nimport EditContext from './EditContext';\r\nimport LocalizeMode from './LocalizeMode';\r\n\r\nexport type CulturePickerProps = Pick<FormRenderProps, 'handleSubmit'>;\r\n\r\n/**\r\n * Custom hook that returns the list of available cultures sorted based on whether an item is\r\n * being edited/created\r\n */\r\nexport const useSortedCultures = () => {\r\n\tconst { isCreateMode, primaryCulture } = useContext(EditContext);\r\n\r\n\treturn AppState.cultures.sort((a, b) => {\r\n\t\tif (\r\n\t\t\ta.id === primaryCulture ||\r\n\t\t\t(b.name > a.name && b.id !== primaryCulture) ||\r\n\t\t\t(isCreateMode && a.isFallback && b.id !== primaryCulture)\r\n\t\t) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tb.id === primaryCulture ||\r\n\t\t\t(b.name < a.name && a.id !== primaryCulture) ||\r\n\t\t\t(isCreateMode && b.isFallback && a.id !== primaryCulture)\r\n\t\t) {\r\n\t\t\treturn 1;\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t});\r\n};\r\n\r\ninterface CulturePickerOption extends AutoSuggestItem {\r\n\tcode: string;\r\n}\r\n\r\n/**\r\n * Displays available cultures in a dropdown that lets users view the whole record in the context\r\n * of a different Culture. This also defines the primary culture when a record is being created.\r\n * @param param0\r\n */\r\nfunction CulturePicker({ handleSubmit }: CulturePickerProps) {\r\n\tconst editContext = useContext(EditContext);\r\n\tconst {\r\n\t\tentityDefinition,\r\n\t\tsetCulture,\r\n\t\tcurrentCulture,\r\n\t\tprimaryCulture,\r\n\t\tisCreateMode,\r\n\t\tsetRedirectCulture,\r\n\t} = editContext;\r\n\r\n\tconst [confirmCultureChange, setConfirmCultureChange] = useState<string | undefined>();\r\n\tconst sortedCultures = useSortedCultures();\r\n\tconst loc = useLocation<any>();\r\n\r\n\tuseEffect(() => {\r\n\t\tif (loc.state && loc.state.redirectCulture) {\r\n\t\t\tsetCulture(loc.state.redirectCulture);\r\n\t\t}\r\n\r\n\t\t//eslint-disable-next-line\r\n\t}, []);\r\n\r\n\tconst showCulture = (cultureId: string) => {\r\n\t\tconst culture = sortedCultures.find((c) => c.id === cultureId);\r\n\t\treturn culture ? culture.name : 'Unknown Culture';\r\n\t};\r\n\r\n\tconst options: CulturePickerOption[] = sortedCultures.map((culture) => ({\r\n\t\tvalue: culture.id,\r\n\t\tlabel: culture.name + ` (${culture.code})` + (primaryCulture === culture.id ? ' (primary)' : ''),\r\n\t\tcode: culture.code,\r\n\t}));\r\n\r\n\tconst saveAndContinue = async (submissionType: ModelStatus | null, redirectCulture?: string) => {\r\n\t\tawait editContext.setNextSubmissionState({ submissionType, submissionTime: null, doContinue: true });\r\n\t\ttry {\r\n\t\t\tsetRedirectCulture(redirectCulture);\r\n\t\t\tawait handleSubmit();\r\n\t\t} catch (error) {\r\n\t\t\tconst serverException = getHandleableException(error) as RemovalException;\r\n\r\n\t\t\tconsole.debug('CulturePicker caught handleable error...');\r\n\r\n\t\t\tif (serverException && serverException.exceptionCode === 'illegal_removal_operation') {\r\n\t\t\t\tsetConfirmCultureChange(undefined);\r\n\t\t\t} else {\r\n\t\t\t\tconsole.error('Unable to handle handleable error during publish:', error);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t};\r\n\r\n\tif (!currentCulture) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet currentCultureLabel;\r\n\r\n\tfor (const option of options) {\r\n\t\tif (option.value === currentCulture) {\r\n\t\t\tcurrentCultureLabel = option.label;\r\n\t\t}\r\n\t}\r\n\r\n\treturn AppState.config.multiSiteEnabled &&\r\n\t\t(entityDefinition.localizeMode !== LocalizeMode.AllCultures || isCreateMode) &&\r\n\t\toptions.length > 1 ? (\r\n\t\t<>\r\n\t\t\t<AutoSuggestSingle\r\n\t\t\t\tname=\"AutoSuggestFilter\"\r\n\t\t\t\tlabel=\"Culture\"\r\n\t\t\t\tforceEmptyLabel\r\n\t\t\t\tclearable={false}\r\n\t\t\t\ttestId=\"culture-picker\"\r\n\t\t\t\tvalue={{\r\n\t\t\t\t\tlabel: currentCultureLabel,\r\n\t\t\t\t\tvalue: currentCulture,\r\n\t\t\t\t}}\r\n\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\tif (!e) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tconst newCultureId = e.value;\r\n\r\n\t\t\t\t\tif (isCreateMode) {\r\n\t\t\t\t\t\tsetConfirmCultureChange(newCultureId);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tsetCulture(newCultureId);\r\n\t\t\t\t\t\tsetRedirectCulture(newCultureId);\r\n\t\t\t\t\t}\r\n\t\t\t\t}}\r\n\t\t\t\tautoSuggestOptions={{\r\n\t\t\t\t\tstaticData: options,\r\n\t\t\t\t}}\r\n\t\t\t\trenderMenu={() => (\r\n\t\t\t\t\t<Field name=\"scope\">\r\n\t\t\t\t\t\t{({ input: { value } }) => <CulturePickerMenu value={value} options={options} />}\r\n\t\t\t\t\t</Field>\r\n\t\t\t\t)}\r\n\t\t\t/>\r\n\r\n\t\t\t{confirmCultureChange ? (\r\n\t\t\t\t<Alert\r\n\t\t\t\t\trenderTitle={() => <>Please confirm how you would like to proceed.</>}\r\n\t\t\t\t\tisOpen={true}\r\n\t\t\t\t\tsize=\"large\"\r\n\t\t\t\t\tonConfirm={() => setConfirmCultureChange(undefined)}\r\n\t\t\t\t\tconfirmButtonText=\"Cancel\"\r\n\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\trenderContents={() => (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t<div style={{ marginTop: '25px' }}>\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tsetCulture(confirmCultureChange);\r\n\t\t\t\t\t\t\t\t\t\tsetConfirmCultureChange(undefined);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"culture-modal-change\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\tChange Primary Language to {showCulture(confirmCultureChange)}.\r\n\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tsetConfirmCultureChange(undefined);\r\n\t\t\t\t\t\t\t\t\t\tsaveAndContinue(ModelStatus.Published, confirmCultureChange);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"culture-modal-publish\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\tPublish {showCulture(currentCulture)} as the primary.\r\n\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tsetConfirmCultureChange(undefined);\r\n\t\t\t\t\t\t\t\t\t\tsaveAndContinue(ModelStatus.Inactive, confirmCultureChange);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"culture-modal-inactive\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\tSave {showCulture(currentCulture)} as inactive primary.\r\n\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t)}\r\n\t\t\t\t/>\r\n\t\t\t) : null}\r\n\t\t</>\r\n\t) : null;\r\n}\r\n\r\ninterface CulturePickerMenuProps {\r\n\tvalue: any;\r\n\toptions: CulturePickerOption[];\r\n}\r\n\r\n/**\r\n * Custom renderer for the menu displayed in the Culture AutoSuggest component\r\n * @param props\r\n */\r\nfunction CulturePickerMenu(props: CulturePickerMenuProps) {\r\n\tconst { downshift } = useContext(AutoSuggestContext);\r\n\tconst { currentCulture, primaryCulture } = useContext(EditContext);\r\n\tconst bulkRecordsField = useField('bulkRecords');\r\n\tconst translationsField = useField('translations');\r\n\r\n\tif (!downshift) {\r\n\t\tconsole.warn(\r\n\t\t\t'Downshift not found. Please check that this component is being used as a renderMenu prop for an AutoSuggest component.',\r\n\t\t);\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst { getItemProps, getMenuProps } = downshift;\r\n\tconst { value, options } = props;\r\n\r\n\tlet scopedCultures: CulturePickerOption[] = [];\r\n\tlet unscopedCultures: CulturePickerOption[] = [];\r\n\r\n\tif (!value) {\r\n\t\t// global scope, so all cultures are scoped\r\n\t\tscopedCultures = [...options];\r\n\t} else if (value.type === 'Site') {\r\n\t\t// a site was selected, so only cultures for that site or any of its hosts are scoped.\r\n\t\tlet scopedCultureId;\r\n\r\n\t\tconst siteMatch = AppState.sites.find((site) => site.id === value.value);\r\n\r\n\t\tif (siteMatch) {\r\n\t\t\tscopedCultureId = siteMatch.cultureId;\r\n\t\t}\r\n\r\n\t\tconst scopedCulture = options.find((option) => option.value === scopedCultureId);\r\n\r\n\t\tif (!scopedCulture) {\r\n\t\t\tconsole.warn('Unable to find culture.');\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst scopedHostCultures = options.filter((c) =>\r\n\t\t\tsiteMatch?.hosts.some((s) => s.cultureId === c.value && scopedCultureId !== c.value),\r\n\t\t);\r\n\r\n\t\tscopedCultures = [scopedCulture, ...scopedHostCultures];\r\n\t\tunscopedCultures = options.filter((culture) => !scopedCultures.find((sc) => sc.value == culture.value));\r\n\t} else if (value.type === 'Site Collection') {\r\n\t\t// a site collection was selected, so only cultures for each site and their hosts that are in that collection are scoped\r\n\r\n\t\t// there's a discrepancy between the scope field and the value provided by AppState.\r\n\t\t// AppState has a sites collection, but the scope field doesn't.\r\n\t\t// this is done on purpose to avoid doubling up the data sent down to the client.\r\n\t\tconst sites = value.sites ? value.sites : AppState.siteCollections.find((sc) => sc.id === value.value)!.sites;\r\n\t\tconst siteCollectionSiteIds: number[] = sites.map((site) => site.siteId);\r\n\t\tconst cultureIds: string[] = [];\r\n\r\n\t\tfor (const site of AppState.sites) {\r\n\t\t\tfor (const siteId of siteCollectionSiteIds) {\r\n\t\t\t\tif (site.id === siteId.toString()) {\r\n\t\t\t\t\tcultureIds.push(site.cultureId);\r\n\r\n\t\t\t\t\tfor (const siteHost of site.hosts) {\r\n\t\t\t\t\t\tif (siteHost.cultureId) {\r\n\t\t\t\t\t\t\tcultureIds.push(siteHost.cultureId);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst uniqueCultureIds = [...new Set(cultureIds)];\r\n\t\tunscopedCultures = [...options];\r\n\r\n\t\tfor (const option of options) {\r\n\t\t\tfor (const uniqueCultureId of uniqueCultureIds) {\r\n\t\t\t\tif (option.value === uniqueCultureId) {\r\n\t\t\t\t\tscopedCultures.push(option);\r\n\t\t\t\t\tunscopedCultures.splice(unscopedCultures.indexOf(option), 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// this will allow us to quickly check if we have available translations for any given culture\r\n\tconst cultureToCompletionMap = options.reduce((acc, value) => {\r\n\t\t// the primary culture always gets translations as it's the main record\r\n\t\tif (primaryCulture === value.value) {\r\n\t\t\tacc[value.value] = true;\r\n\t\t\treturn acc;\r\n\t\t}\r\n\r\n\t\tlet foundTranslation = false;\r\n\r\n\t\t// If this is a bulk record, check all records for translations\r\n\t\tif (bulkRecordsField && bulkRecordsField.input.value) {\r\n\t\t\tfor (const bulkRecord of bulkRecordsField.input.value) {\r\n\t\t\t\tif (!bulkRecord.translations) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst currentRecordTranslations = bulkRecord.translations[value.value];\r\n\t\t\t\tif (!currentRecordTranslations) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfoundTranslation = Object.values(currentRecordTranslations).filter((value) => value).length > 0;\r\n\t\t\t\tif (foundTranslation) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconst translationsForCulture = translationsField && translationsField.input.value[value.value];\r\n\t\t\tif (translationsForCulture) {\r\n\t\t\t\t// we do a simple truthy check against the value, so that null/undefined/empty strings are ignored\r\n\t\t\t\tfoundTranslation = Object.values(translationsForCulture).filter((value) => value).length > 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tacc[value.value] = foundTranslation;\r\n\r\n\t\treturn acc;\r\n\t}, {});\r\n\r\n\tif (scopedCultures.length > 0 || unscopedCultures.length > 0) {\r\n\t\treturn (\r\n\t\t\t<MenuWrapper\r\n\t\t\t\tmenuProps={{\r\n\t\t\t\t\t...getMenuProps({\r\n\t\t\t\t\t\topen: true,\r\n\t\t\t\t\t}),\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\t{scopedCultures.length > 0 ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<li className=\"autosuggest-menu-categorized__item-group-title\">SCOPED</li>\r\n\t\t\t\t\t\t{scopedCultures.map((scopedCulture, index) => (\r\n\t\t\t\t\t\t\t<li\r\n\t\t\t\t\t\t\t\tkey={index}\r\n\t\t\t\t\t\t\t\tclassName=\"autosuggest-menu-categorized__item\"\r\n\t\t\t\t\t\t\t\t{...getItemProps({\r\n\t\t\t\t\t\t\t\t\titem: {\r\n\t\t\t\t\t\t\t\t\t\tlabel: scopedCulture.label,\r\n\t\t\t\t\t\t\t\t\t\tvalue: scopedCulture.value.toString(),\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\tindex: index,\r\n\t\t\t\t\t\t\t\t\tkey: `${scopedCulture.value}-${index}`,\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\tdata-testid={`culture-picker-${scopedCulture.code}`}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<MenuItemStatus completed={cultureToCompletionMap[scopedCulture.value]} />\r\n\t\t\t\t\t\t\t\t<CultureLabel option={scopedCulture} currentCulture={currentCulture} />\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t{unscopedCultures.length > 0 ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<li className=\"autosuggest-menu-categorized__item-group-title\">NOT SCOPED</li>\r\n\t\t\t\t\t\t{unscopedCultures.map((unscopedCulture, index) => (\r\n\t\t\t\t\t\t\t<li\r\n\t\t\t\t\t\t\t\tkey={index}\r\n\t\t\t\t\t\t\t\tclassName=\"autosuggest-menu-categorized__item\"\r\n\t\t\t\t\t\t\t\t{...getItemProps({\r\n\t\t\t\t\t\t\t\t\titem: {\r\n\t\t\t\t\t\t\t\t\t\tlabel: unscopedCulture.label,\r\n\t\t\t\t\t\t\t\t\t\tvalue: unscopedCulture.value.toString(),\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\tindex: index + scopedCultures.length,\r\n\t\t\t\t\t\t\t\t\tkey: `${unscopedCulture.value}-${index + scopedCultures.length}`,\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\tdata-testid={`culture-picker-${unscopedCulture.code}`}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<MenuItemStatus completed={cultureToCompletionMap[unscopedCulture.value]} />\r\n\t\t\t\t\t\t\t\t<CultureLabel option={unscopedCulture} currentCulture={currentCulture} />\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : null}\r\n\t\t\t</MenuWrapper>\r\n\t\t);\r\n\t}\r\n\r\n\t// this should never happen\r\n\treturn (\r\n\t\t<MenuWrapper>\r\n\t\t\t<li className=\"autosuggest-menu-categorized__item-group-title\">Invalid scope type.</li>\r\n\t\t</MenuWrapper>\r\n\t);\r\n}\r\n\r\ninterface CultureLabelProps {\r\n\toption: CulturePickerOption;\r\n\tcurrentCulture?: string;\r\n}\r\n\r\n/**\r\n * Wraps display for Culture Label within the custom Menu\r\n */\r\nfunction CultureLabel({ option, currentCulture }: CultureLabelProps) {\r\n\treturn <>{option.value === currentCulture ? <strong>{option.label}</strong> : option.label}</>;\r\n}\r\n\r\ninterface MenuWrapperProps {\r\n\tchildren: React.ReactNode;\r\n\tmenuProps?: any;\r\n}\r\n\r\n/**\r\n * Reusable Menu Wrapper\r\n * @param props\r\n */\r\nfunction MenuWrapper(props: MenuWrapperProps) {\r\n\tconst { children, menuProps } = props;\r\n\r\n\treturn (\r\n\t\t<div className=\"autosuggest-menu-categorized\">\r\n\t\t\t<ul\r\n\t\t\t\tclassName=\"dropdown-menu autosuggest-menu-categorized__list autosuggest-menu-categorized__list--wide\"\r\n\t\t\t\t{...menuProps}\r\n\t\t\t>\r\n\t\t\t\t{children}\r\n\t\t\t</ul>\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\ninterface MenuItemStatusProps {\r\n\tcompleted?: boolean;\r\n}\r\n\r\nfunction MenuItemStatus(props: MenuItemStatusProps) {\r\n\tconst { completed = false } = props;\r\n\r\n\treturn (\r\n\t\t<div className=\"autosuggest-menu-categorized__item-status\">\r\n\t\t\t{!completed ? (\r\n\t\t\t\t<ExclamationCircleSVG class=\"autosuggest-menu-categorized__item-status-uncompleted\" />\r\n\t\t\t) : (\r\n\t\t\t\t<span className=\"autosuggest-menu-categorized__item-status-completed\"></span>\r\n\t\t\t)}\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\nexport default CulturePicker;\r\n","import * as React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { InputProps } from '.';\r\nimport Input from './Input';\r\n\r\n/**\r\n * Component that renders a custom Input component.\r\n *\r\n * @class TextBox\r\n * @extends {(React.Component<FieldRenderProps & InputProps>)}\r\n */\r\nclass TextBox extends React.Component<FieldRenderProps<any, HTMLInputElement> & InputProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn <Input {...this.props} type=\"text\" />;\r\n\t}\r\n}\r\n\r\nexport default TextBox;\r\n","import axios, { AxiosError, AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport { TenantHeaderName } from 'features/tenants/Constants';\r\nimport { getTenantIdFromSessionOrLocalStorage } from '~/features/tenants/helpers/TenantHelper';\r\n\r\n/**\r\n * Helper that creates and configures an instance of Axios to be used throughout\r\n * the client application. This will also handle forbidden (403) errors via interceptors.\r\n */\r\nconst AxiosHelper: AxiosInstance = axios.create({\r\n\twithCredentials: true,\r\n});\r\n\r\nexport default AxiosHelper;\r\n\r\nexport type CustomAxiosRequestConfig = AxiosRequestConfig & {\r\n\tredirectToAccessDeniedOn403?: boolean;\r\n};\r\n\r\nexport const addAccessDeniedInterceptor = (history) => {\r\n\t// this allows us to act when any request going through axios succeeds or fails.\r\n\tAxiosHelper.interceptors.response.use(\r\n\t\t(response: AxiosResponse) => {\r\n\t\t\treturn response;\r\n\t\t},\r\n\t\t(error: AxiosError) => {\r\n\t\t\tconst config: CustomAxiosRequestConfig = error.config;\r\n\r\n\t\t\t// if the request is meant to send you to an access-denied page, then replace the\r\n\t\t\t// history entry. this will be called primarily from listing pages.\r\n\t\t\tif (config && config.redirectToAccessDeniedOn403 && error.response && error.response.status === 403) {\r\n\t\t\t\thistory.replace('/access-denied');\r\n\t\t\t}\r\n\r\n\t\t\tif (error.response && error.response.status === 401) {\r\n\t\t\t\twindow.location.replace('/login');\r\n\t\t\t}\r\n\r\n\t\t\treturn Promise.reject(error);\r\n\t\t},\r\n\t);\r\n};\r\n\r\n// Add tenant header ('X-Roc-Tenant') with tenant id value from the session storage to every request.\r\nexport const addMultiTenantInterceptor = () => {\r\n\tAxiosHelper.interceptors.request.use(\r\n\t\t(config) => {\r\n\t\t\tconfig.headers[TenantHeaderName] = getTenantIdFromSessionOrLocalStorage();\r\n\r\n\t\t\treturn config;\r\n\t\t},\r\n\t\t(error) => {\r\n\t\t\treturn Promise.reject(error);\r\n\t\t},\r\n\t);\r\n};\r\n","import React from 'react';\r\n\r\n/**\r\n * interface for the app context.\r\n */\r\ninterface AppContextProps {\r\n\t/**\r\n\t * Hold the status of the expiration alert counter.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof AppContext\r\n\t */\r\n\texpirationAlertCountdownStarted: boolean;\r\n\r\n\t/**\r\n\t * Sets the value of the expiration status counter.\r\n\t *\r\n\t * @memberof AppContext\r\n\t */\r\n\tsetExpirationAlertCountdownStarted: (started: boolean) => void;\r\n}\r\n\r\nexport default React.createContext<Partial<AppContextProps>>({});\r\n","import { useState, useEffect } from 'react';\r\n\r\n/**\r\n * Reusable hook that returns true after a certain amount of time has passed. Useful to delay\r\n * displaying components in render functions.\r\n *\r\n * @export\r\n * @param {number} [waitMs=200]\r\n * @returns\r\n */\r\nexport default function useDelayedDisplay(waitMs: number = 200) {\r\n\tconst [display, setDisplay] = useState(false);\r\n\r\n\tuseEffect(() => {\r\n\t\t// after a set amount of time, show the spinner\r\n\t\tconst timeout = setTimeout(() => {\r\n\t\t\tsetDisplay(true);\r\n\t\t}, waitMs);\r\n\r\n\t\treturn () => {\r\n\t\t\tclearTimeout(timeout);\r\n\t\t};\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\treturn display;\r\n}\r\n","import React from 'react';\r\nimport { joinTrimmedStrings } from 'util/StringUtil';\r\n\r\nconst defaultRichTextContentProvider = 'ck-editor';\r\n\r\ntype richTextContentProvider = 'ck-editor';\r\n\r\ninterface RichTextContentProps {\r\n\thtmlContent: string;\r\n\tcontentProvider?: richTextContentProvider;\r\n\tdataTestId?: string;\r\n\tclassName?: string;\r\n}\r\n\r\n/**\r\n * Component for rendering rich text html content.\r\n * Returns the content wrapped in container with the appropriate style classes for the html content provider (CK editor or other).\r\n * @export\r\n */\r\nexport default function RichTextContent(props: RichTextContentProps) {\r\n\tconst { htmlContent, contentProvider, dataTestId, className } = props;\r\n\tconst classNameCombined = joinTrimmedStrings(\r\n\t\t' ',\r\n\t\tconstructWrapperClassForProvider(contentProvider ?? defaultRichTextContentProvider),\r\n\t\tclassName,\r\n\t);\r\n\r\n\treturn (\r\n\t\t<div className={classNameCombined} data-testid={dataTestId} dangerouslySetInnerHTML={{ __html: htmlContent }} />\r\n\t);\r\n}\r\n\r\nfunction constructWrapperClassForProvider(provider?: richTextContentProvider) {\r\n\tswitch (provider) {\r\n\t\tcase 'ck-editor':\r\n\t\t\treturn 'ck-content';\r\n\t\tdefault:\r\n\t\t\treturn '';\r\n\t}\r\n}\r\n","import React, { RefObject } from 'react';\r\n\r\nexport type RefElementType = RefObject<HTMLDivElement> | null;\r\n\r\n/**\r\n * Context to provide ability to set page change alerts from anywhere\r\n *\r\n * @interface VisuallyHiddenAnnouncementContext\r\n */\r\ninterface VisuallyHiddenAnnouncementContext {\r\n\tsetAlert: (message: string) => void;\r\n\tmainRef: RefElementType;\r\n\tsetMainRef: (value: RefElementType) => void;\r\n}\r\n\r\nexport default React.createContext<VisuallyHiddenAnnouncementContext>({} as VisuallyHiddenAnnouncementContext);\r\n","import React from 'react';\r\n\r\ninterface ExclamationCircleSVGAlternativeProps {\r\n\tclass: string;\r\n}\r\n\r\n/**\r\n * Check SVG\r\n *\r\n * @returns\r\n */\r\nfunction ExclamationCircleSVGAlternative(props: ExclamationCircleSVGAlternativeProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 38 32\"\r\n\t\t\tclassName={'icon icon-exclamation-circle-2 ' + props.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t>\r\n\t\t\t<path d=\"M16.001 32c8.836 0 15.999-7.163 15.999-15.999s-7.163-15.999-15.999-15.999c-8.836 0-15.999 7.163-15.999 15.999v0c0 8.836 7.163 15.999 15.999 15.999v0zM16.001 6.924c1.020 0 1.846 0.827 1.846 1.846s-0.827 1.846-1.846 1.846c-1.020 0-1.846-0.827-1.846-1.846v0c0-1.020 0.827-1.846 1.846-1.846v0zM14.155 14.924c0-1.020 0.827-1.846 1.846-1.846s1.846 0.827 1.846 1.846v8.615c0 1.020-0.827 1.846-1.846 1.846s-1.846-0.827-1.846-1.846v0z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\n// Set default props\r\nExclamationCircleSVGAlternative.defaultProps = {\r\n\tclass: '',\r\n};\r\n\r\nexport default ExclamationCircleSVGAlternative;\r\n","import React from 'react';\r\n\r\ninterface ExclamationTriangleSVGAlternativeProps {\r\n\tclass: string;\r\n}\r\n\r\n/**\r\n * Check SVG\r\n *\r\n * @returns\r\n */\r\nfunction ExclamationTriangleSVGAlternative(props: ExclamationTriangleSVGAlternativeProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 34 32\"\r\n\t\t\tclassName={'icon icon-exclamation-triangle-2 ' + props.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t>\r\n\t\t\t<path d=\"M33.877 27.322l-14.124-25.762c-0.499-0.935-1.468-1.56-2.583-1.56s-2.084 0.625-2.575 1.544l-0.008 0.016-14.178 25.762c-1.154 2.079 0.276 4.679 2.583 4.679h28.301c2.311 0 3.739-2.599 2.585-4.679zM15.521 10.86c-0.001-0.024-0.002-0.053-0.002-0.081 0-0.881 0.714-1.596 1.596-1.596s1.596 0.714 1.596 1.596c0 0.029-0.001 0.057-0.002 0.085l0-0.004v7.856c0.001 0.024 0.002 0.053 0.002 0.081 0 0.881-0.715 1.596-1.596 1.596s-1.596-0.715-1.596-1.596c0-0.029 0.001-0.057 0.002-0.085l-0 0.004zM17.17 27.206c-0.025 0.001-0.054 0.002-0.084 0.002-0.926 0-1.677-0.751-1.677-1.677s0.751-1.677 1.677-1.677c0.926 0 1.677 0.751 1.677 1.677 0 0 0 0 0 0v0c0 0.011 0 0.025 0 0.038 0 0.889-0.709 1.613-1.592 1.637l-0.002 0z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\n// Set default props\r\nExclamationTriangleSVGAlternative.defaultProps = {\r\n\tclass: '',\r\n};\r\n\r\nexport default ExclamationTriangleSVGAlternative;\r\n","import * as React from 'react';\r\nimport { ControllerStateAndHelpers } from 'downshift';\r\nimport { AutoSuggestItem } from './Types';\r\n\r\nexport type AutoSuggestNoResultsTextProps = Pick<ControllerStateAndHelpers<AutoSuggestItem>, 'inputValue'>;\r\n\r\n/**\r\n * Renders a message when no results are found for AutoSuggest components.\r\n *\r\n * @class AutoSuggestNoResultsText\r\n * @extends {React.Component<AutoSuggestNoResultsTextProps>}\r\n */\r\nclass AutoSuggestNoResultsText extends React.Component<AutoSuggestNoResultsTextProps> {\r\n\tpublic render() {\r\n\t\tconst { inputValue } = this.props;\r\n\r\n\t\tif (inputValue) {\r\n\t\t\treturn (\r\n\t\t\t\t<em data-testid=\"no-results-found\">\r\n\t\t\t\t\tNo results found for{' '}\r\n\t\t\t\t\t<strong>\r\n\t\t\t\t\t\t&quot;{inputValue}\r\n\t\t\t\t\t\t&quot;.\r\n\t\t\t\t\t</strong>\r\n\t\t\t\t</em>\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn <em>No results found.</em>;\r\n\t}\r\n}\r\n\r\nexport default AutoSuggestNoResultsText;\r\n","import * as React from 'react';\r\nimport TooltipDto from './types/TooltipDto';\r\nimport { EntityDefinition } from 'types';\r\nimport TooltipPopover from './TooltipPopover';\r\nimport PopoverBody from 'reactstrap/lib/PopoverBody';\r\nimport { TooltipEditButton } from './TooltipEditButton';\r\n\r\ninterface TooltipWrapperProps {\r\n\thideTooltip?: boolean;\r\n\thasTooltipError: boolean;\r\n\ttooltipText: string;\r\n\tnameValue: string;\r\n\tisTooltipEditMode: boolean;\r\n\ttooltipData: { [name: string]: { fieldTooltip: TooltipDto; universalTooltip: TooltipDto } };\r\n\tentityDefinition: EntityDefinition;\r\n\tlabel: string;\r\n}\r\n\r\nexport type ToolTipDataProps = {\r\n\ttooltipText?: string;\r\n\tnameValue?: string;\r\n\ttooltipData?: { [name: string]: { fieldTooltip: TooltipDto; universalTooltip: TooltipDto } };\r\n\tentityDefinition?: EntityDefinition;\r\n\thasTooltipError?: boolean;\r\n};\r\n\r\n/**\r\n * Wrapper component for the tooltip button and popover\r\n *\r\n * @export\r\n * @param {TooltipWrapperProps} props\r\n * @returns\r\n */\r\nexport default function TooltipWrapper(props: TooltipWrapperProps) {\r\n\tconst {\r\n\t\thideTooltip = false,\r\n\t\thasTooltipError,\r\n\t\ttooltipText,\r\n\t\tnameValue,\r\n\t\tisTooltipEditMode,\r\n\t\ttooltipData,\r\n\t\tentityDefinition,\r\n\t\tlabel,\r\n\t} = props;\r\n\r\n\t!hideTooltip && !hasTooltipError;\r\n\r\n\tif (hideTooltip || hasTooltipError) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{tooltipText && (\r\n\t\t\t\t<TooltipPopover name={nameValue}>\r\n\t\t\t\t\t<PopoverBody>{tooltipText}</PopoverBody>\r\n\t\t\t\t</TooltipPopover>\r\n\t\t\t)}\r\n\r\n\t\t\t{isTooltipEditMode ? (\r\n\t\t\t\t<div className=\"tooltip__item\">\r\n\t\t\t\t\t<TooltipEditButton\r\n\t\t\t\t\t\tname={nameValue}\r\n\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\ttooltipData={tooltipData}\r\n\t\t\t\t\t\tentityDefinition={entityDefinition}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\t\t\t) : null}\r\n\t\t</>\r\n\t);\r\n}\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Left chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction LeftChevronSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg viewBox=\"0 0 19 32\" className={'icon ' + svgProps.class} focusable=\"false\" aria-hidden=\"true\">\r\n\t\t\t<path d=\"M18.462 27.891c0.457 0.427 0.742 1.034 0.742 1.707s-0.285 1.279-0.741 1.705l-0.001 0.001c-0.467 0.437-1.097 0.705-1.789 0.705s-1.322-0.268-1.79-0.706l0.002 0.001-14.146-13.598c-0.457-0.427-0.742-1.034-0.742-1.707s0.285-1.28 0.741-1.705l0.001-0.001 14.142-13.589c0.468-0.436 1.097-0.704 1.79-0.704s1.322 0.268 1.791 0.706l-0.002-0.001c0.457 0.427 0.742 1.034 0.742 1.707s-0.285 1.28-0.741 1.705l-0.001 0.001-11.597 11.883z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nLeftChevronSVG.defaultProps = { class: '' };\r\n\r\nexport default LeftChevronSVG;\r\n","import Octicon, { X } from '@githubprimer/octicons-react';\r\nimport classnames from 'classnames';\r\nimport PopoverTitle from 'components/shared/PopoverTitle';\r\nimport CheckCircleSVG from 'components/shared/svg/CheckCircleSVG';\r\nimport MagnifyingGlassSVG from 'components/shared/svg/MagnifyingGlassSVG';\r\nimport RightChevronSVG from 'components/shared/svg/RightChevronSVG';\r\nimport * as React from 'react';\r\nimport { Button, Input, InputGroup, ListGroup, ListGroupItem } from 'reactstrap';\r\nimport { Filter, SelectedFilter } from '.';\r\nimport { FilterChangeLocation } from '../ListingContainer';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\ninterface AvailableFiltersProps {\r\n\tfilters: Filter[];\r\n\tselectedFilters: SelectedFilter[];\r\n\tbeginFilterChange: (filter: SelectedFilter, location: FilterChangeLocation) => void;\r\n\thandlePopoverClose: () => void;\r\n}\r\n\r\ninterface AvailableFiltersState {\r\n\tfilterKeyword: string;\r\n}\r\n\r\n// comparison function to alphabetically sort the available filters\r\nconst compare = (a: Filter, b: Filter) =>\r\n\ta.displayName.toLocaleLowerCase().localeCompare(b.displayName.toLocaleLowerCase());\r\n\r\n/**\r\n * Component that displays a list of available filters for users to add.\r\n */\r\nclass AvailableFilters extends React.Component<AvailableFiltersProps, AvailableFiltersState> {\r\n\tprivate searchInput;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t\tthis.searchInput = React.createRef();\r\n\r\n\t\tthis.state = {\r\n\t\t\tfilterKeyword: '',\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Helps filter out search filters\r\n\t *\r\n\t * @memberof AvailableFilters\r\n\t */\r\n\tpublic handleKeywordSearch = (e: React.FormEvent<HTMLInputElement>) => {\r\n\t\tconst value = e.currentTarget.value;\r\n\r\n\t\tthis.setState({\r\n\t\t\tfilterKeyword: value,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Clear filter search state.\r\n\t *\r\n\t * @private\r\n\t * @memberof AvailableFilters\r\n\t */\r\n\tprivate clearFilterSearch = () => {\r\n\t\tthis.setState({\r\n\t\t\tfilterKeyword: '',\r\n\t\t});\r\n\t\tthis.focusSearch();\r\n\t};\r\n\r\n\t/**\r\n\t * Set focus on the filter search input.\r\n\t *\r\n\t * @private\r\n\t * @memberof AvailableFilters\r\n\t */\r\n\tprivate focusSearch = () => {\r\n\t\tthis.searchInput.current.focus();\r\n\t};\r\n\r\n\t/**\r\n\t * Depending on the filter that is being selected, if the filter already exists, it will grab it from the list\r\n\t * of selected filters, so that the value is included, otherwise, it'll pass the empty filter so that values\r\n\t * can be set.\r\n\t *\r\n\t * @private\r\n\t * @memberof AvailableFilters\r\n\t */\r\n\tprivate handleFilterSelection = (filter: Filter) => {\r\n\t\tconst match = this.props.selectedFilters.find((indexFilter) => indexFilter.name === filter.name);\r\n\r\n\t\tif (!match) {\r\n\t\t\tthis.props.beginFilterChange(filter as SelectedFilter, FilterChangeLocation.FilterList);\r\n\t\t} else {\r\n\t\t\tthis.props.beginFilterChange(match, FilterChangeLocation.FilterList);\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst availableFilters = this.props.filters.sort(compare);\r\n\r\n\t\tif (availableFilters.length === 0) {\r\n\t\t\treturn <em>No more search filters available.</em>;\r\n\t\t}\r\n\r\n\t\tconst filteredFilters = availableFilters.filter(\r\n\t\t\t(filter) =>\r\n\t\t\t\t!filter.implicit &&\r\n\t\t\t\t(filter.displayName.toLocaleLowerCase().includes(this.state.filterKeyword.toLocaleLowerCase()) ||\r\n\t\t\t\t\tfilter.name.toLocaleLowerCase().includes(this.state.filterKeyword.toLocaleLowerCase())),\r\n\t\t);\r\n\r\n\t\tconst ignoreFilters = this.props.selectedFilters.map((filter) => filter.name);\r\n\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<PopoverTitle titleText=\"Filter\" close={this.props.handlePopoverClose} />\r\n\r\n\t\t\t\t<div className=\"filter-list__search-wrapper\">\r\n\t\t\t\t\t<InputGroup className=\"input-group-nowrap\">\r\n\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\ttype=\"search\"\r\n\t\t\t\t\t\t\tid=\"filterSearch\"\r\n\t\t\t\t\t\t\tplaceholder=\"Enter Keyword\"\r\n\t\t\t\t\t\t\tclassName=\"filter-list__search\"\r\n\t\t\t\t\t\t\tonChange={this.handleKeywordSearch}\r\n\t\t\t\t\t\t\tonKeyDown={(e: React.KeyboardEvent) => {\r\n\t\t\t\t\t\t\t\tif (e.which === 13) {\r\n\t\t\t\t\t\t\t\t\te.preventDefault();\r\n\r\n\t\t\t\t\t\t\t\t\tif (filteredFilters.length === 1) {\r\n\t\t\t\t\t\t\t\t\t\tthis.handleFilterSelection(filteredFilters[0]);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tvalue={this.state.filterKeyword}\r\n\t\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\t\tinnerRef={this.searchInput}\r\n\t\t\t\t\t\t\tdata-testid=\"search-filters-list\"\r\n\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t{this.state.filterKeyword.length > 0 ? (\r\n\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t\tcolor=\"default\"\r\n\t\t\t\t\t\t\t\tclassName=\"clear-text-btn\"\r\n\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\tthis.clearFilterSearch();\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\ttitle=\"Remove\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<Octicon icon={X} ariaLabel=\"X\" />\r\n\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t</InputGroup>\r\n\t\t\t\t\t<MagnifyingGlassSVG class=\"filter-list__search-icon\" />\r\n\t\t\t\t</div>\r\n\t\t\t\t<ListGroup flush className=\"filter-list\">\r\n\t\t\t\t\t{filteredFilters.map((filter, index) => {\r\n\t\t\t\t\t\tconst filterIsIgnored = ignoreFilters.includes(filter.name);\r\n\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<ListGroupItem\r\n\t\t\t\t\t\t\t\tkey={index}\r\n\t\t\t\t\t\t\t\ttag=\"button\"\r\n\t\t\t\t\t\t\t\tclassName={classnames('filter-list__item', {\r\n\t\t\t\t\t\t\t\t\tactive: filterIsIgnored,\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\taction\r\n\t\t\t\t\t\t\t\tonClick={(e) => {\r\n\t\t\t\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t\t\t\t\tthis.handleFilterSelection(filter);\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\tdata-testid={`filter-list-item-${toKebabCase(filter.displayName)}`}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<span className=\"filter-list__text\">\r\n\t\t\t\t\t\t\t\t\t{filter.displayName}\r\n\t\t\t\t\t\t\t\t\t{filterIsIgnored ? <CheckCircleSVG class=\"filter-list__item-icon\" /> : null}\r\n\t\t\t\t\t\t\t\t</span>\r\n\r\n\t\t\t\t\t\t\t\t<RightChevronSVG class=\"filter-list__chevron\" />\r\n\t\t\t\t\t\t\t</ListGroupItem>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t\t{filteredFilters.length === 0 ? <em>No matches found.</em> : null}\r\n\t\t\t\t</ListGroup>\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default AvailableFilters;\r\n","import * as React from 'react';\r\nimport { Form } from 'reactstrap';\r\nimport { SelectedFilter } from '.';\r\nimport { getFilterType, FilterProviderBase } from './providers';\r\nimport LeftChevronSVG from 'components/shared/svg/LeftChevronSVG';\r\nimport PopoverTitle from 'components/shared/PopoverTitle';\r\n\r\ninterface FilterEditProps {\r\n\tonFilterChange: (selectedFilter: SelectedFilter, stopEditing: boolean) => void;\r\n\tonFilterRemoved: (selectedFilter: SelectedFilter, stopEditing: boolean) => void;\r\n\tcancelFilterChange: () => void;\r\n\tcloseList: () => void;\r\n\tselectedFilter: SelectedFilter;\r\n\thandlePopoverClose: () => void;\r\n}\r\n\r\ninterface FilterEditState {\r\n\tvalue: any;\r\n\tdisplayValidationError: boolean;\r\n}\r\n\r\n/**\r\n * Component that manages how the value of a filter is set and updated.\r\n */\r\nclass FilterEdit extends React.PureComponent<FilterEditProps, FilterEditState> {\r\n\tprivate isEditMode: boolean = false;\r\n\tprivate EditComponent: any;\r\n\tprivate filter: FilterProviderBase<any>;\r\n\tprivate EditComponentProps: any;\r\n\r\n\tconstructor(props: FilterEditProps) {\r\n\t\tsuper(props);\r\n\r\n\t\tconst {\r\n\t\t\tselectedFilter: { value, type },\r\n\t\t\tselectedFilter,\r\n\t\t} = props;\r\n\r\n\t\tthis.isEditMode = value !== undefined;\r\n\r\n\t\t// dynamically pick the component needed for the current filter type and gets the component needed\r\n\t\t// to handle value adding/editing.\r\n\t\tthis.filter = getFilterType(type);\r\n\r\n\t\tthis.EditComponent = this.filter.getComponent();\r\n\t\tthis.EditComponentProps = this.filter.getComponentProps(selectedFilter);\r\n\r\n\t\tthis.state = {\r\n\t\t\tvalue,\r\n\t\t\tdisplayValidationError: false,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Handles changes and stores them in local state to avoid sending state up until it's necessary\r\n\t *\r\n\t * @private\r\n\t * @memberof FilterEdit\r\n\t */\r\n\tprivate handleOnChange = (value: any, stopEditing: boolean = true) => {\r\n\t\tconst hasNoValue = this.filter.isEmptyValue(value);\r\n\r\n\t\tif (hasNoValue) {\r\n\t\t\tthis.props.onFilterRemoved(this.props.selectedFilter, true);\r\n\t\t}\r\n\r\n\t\tthis.setState(\r\n\t\t\t{\r\n\t\t\t\tvalue,\r\n\t\t\t},\r\n\t\t\t() => {\r\n\t\t\t\tthis.handleFilterSave(stopEditing);\r\n\t\t\t},\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * When a filter is done being modified, it will be added/updated here. This will also update state\r\n\t * further up by calling the provided callbacks.\r\n\t *\r\n\t * @private\r\n\t * @memberof FilterEdit\r\n\t */\r\n\tprivate handleFilterSave = (stopEditing: boolean = true) => {\r\n\t\tconst { value } = this.state;\r\n\r\n\t\tconst hasNoValue = this.filter.isEmptyValue(this.state.value);\r\n\r\n\t\tif (hasNoValue && !this.props.selectedFilter.nullable) {\r\n\t\t\tthis.props.onFilterRemoved(this.props.selectedFilter, true);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.props.onFilterChange({ ...this.props.selectedFilter, value }, stopEditing);\r\n\t};\r\n\r\n\tpublic handleCloseClick = () => {\r\n\t\tthis.props.cancelFilterChange();\r\n\t\tthis.props.closeList();\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst EditComponent = this.EditComponent;\r\n\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<PopoverTitle\r\n\t\t\t\t\ttitleText={this.props.selectedFilter.displayName}\r\n\t\t\t\t\tclose={this.props.handlePopoverClose}\r\n\t\t\t\t\trenderBack={() => {\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<div className=\"popover-title-back\">\r\n\t\t\t\t\t\t\t\t<button\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tthis.props.cancelFilterChange();\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\tclassName=\"filters-search__title-chevron-btn\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<LeftChevronSVG class=\"filters-search__title-chevron\" />\r\n\t\t\t\t\t\t\t\t</button>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\r\n\t\t\t\t<Form\r\n\t\t\t\t\tonSubmit={(e) => {\r\n\t\t\t\t\t\te.preventDefault();\r\n\t\t\t\t\t}}\r\n\t\t\t\t>\r\n\t\t\t\t\t<EditComponent\r\n\t\t\t\t\t\tvalue={this.state.value}\r\n\t\t\t\t\t\tfilter={this.props.selectedFilter}\r\n\t\t\t\t\t\tonChange={this.handleOnChange}\r\n\t\t\t\t\t\t{...this.EditComponentProps}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</Form>\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default FilterEdit;\r\n","import * as React from 'react';\r\nimport { Popover, PopoverBody } from 'reactstrap';\r\nimport { AvailableFilters, SelectedFilter } from '.';\r\nimport { FilterEdit } from '.';\r\nimport { EntityDefinition } from 'types';\r\nimport { FilterState, FilterChangeLocation } from '../ListingContainer';\r\n/**\r\n * Definition for local props. Most state is handled by `ListingSearch` and passed down to us via\r\n * the `selectedFilters` prop.\r\n *\r\n * @interface FilterProps\r\n */\r\ninterface FilterProps {\r\n\tentityDefinition: EntityDefinition;\r\n\tselectedFilters: SelectedFilter[];\r\n\tfilters: FilterState;\r\n}\r\n\r\n/**\r\n * Component to manage a list of filters for the current listing page\r\n */\r\nclass Filters extends React.Component<FilterProps> {\r\n\tprivate filterButtonWrapper: React.RefObject<HTMLDivElement>;\r\n\tprivate filterButton: React.RefObject<HTMLButtonElement>;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.filterButtonWrapper = React.createRef();\r\n\t\tthis.filterButton = React.createRef();\r\n\r\n\t\tif (this.props.entityDefinition.filters.length === 0) {\r\n\t\t\tconsole.warn('No filters defined.');\r\n\t\t}\r\n\t}\r\n\r\n\tpublic handlePopoverClose = () => {\r\n\t\tthis.props.filters.toggleFilterList();\r\n\r\n\t\tif (!this.filterButton || !this.filterButton.current) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.filterButton.current.focus();\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tentityDefinition,\r\n\t\t\tselectedFilters,\r\n\t\t\tfilters: {\r\n\t\t\t\tonFilterRemoved,\r\n\t\t\t\ttoggleFilterChange,\r\n\t\t\t\tdisplayFilterList,\r\n\t\t\t\tcloseFilterList,\r\n\t\t\t\ttoggleFilterList,\r\n\t\t\t\tfilterBeingChanged,\r\n\t\t\t\tfilterChangeLocation,\r\n\t\t\t\tonFilterChange,\r\n\t\t\t\tcancelFilterChange,\r\n\t\t\t\tbeginFilterChange,\r\n\t\t\t},\r\n\t\t} = this.props;\r\n\r\n\t\t// if there aren't any available filters, let's just not render anything\r\n\t\tif (entityDefinition.filters.length === 0) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<div ref={this.filterButtonWrapper}>\r\n\t\t\t\t<button\r\n\t\t\t\t\tid=\"FiltersPopoverToggle\"\r\n\t\t\t\t\tdata-testid=\"toggle-filters-button\"\r\n\t\t\t\t\tclassName=\"dropdown-toggle listing__filter-dropdown btn-medium btn btn-outline-primary\"\r\n\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\ttoggleFilterList();\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tref={this.filterButton}\r\n\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<span className=\"dropdown-toggle__text\">Filter</span>\r\n\t\t\t\t</button>\r\n\r\n\t\t\t\t{filterBeingChanged !== null && filterChangeLocation === FilterChangeLocation.SelectedFilter ? (\r\n\t\t\t\t\t<Popover\r\n\t\t\t\t\t\tclassName=\"filters-popover filters-popover--edit\"\r\n\t\t\t\t\t\tplacement=\"bottom\"\r\n\t\t\t\t\t\tisOpen={filterBeingChanged !== null}\r\n\t\t\t\t\t\ttarget={`Filters_${filterBeingChanged.name}_Popover`}\r\n\t\t\t\t\t\ttoggle={toggleFilterChange}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<PopoverBody className=\"filters-popover__body\">\r\n\t\t\t\t\t\t\t<FilterEdit\r\n\t\t\t\t\t\t\t\tselectedFilter={filterBeingChanged}\r\n\t\t\t\t\t\t\t\tonFilterChange={onFilterChange}\r\n\t\t\t\t\t\t\t\tonFilterRemoved={onFilterRemoved}\r\n\t\t\t\t\t\t\t\tcancelFilterChange={cancelFilterChange}\r\n\t\t\t\t\t\t\t\tcloseList={closeFilterList}\r\n\t\t\t\t\t\t\t\thandlePopoverClose={toggleFilterChange}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</PopoverBody>\r\n\t\t\t\t\t</Popover>\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t<Popover\r\n\t\t\t\t\tclassName=\"filters-popover\"\r\n\t\t\t\t\tplacement={entityDefinition.filterPopoverPlacement}\r\n\t\t\t\t\tisOpen={displayFilterList}\r\n\t\t\t\t\ttarget=\"FiltersPopoverToggle\"\r\n\t\t\t\t\ttoggle={toggleFilterList}\r\n\t\t\t\t>\r\n\t\t\t\t\t<PopoverBody className=\"filters-popover__body\">\r\n\t\t\t\t\t\t{filterBeingChanged === null ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t<AvailableFilters\r\n\t\t\t\t\t\t\t\t\tfilters={entityDefinition.filters}\r\n\t\t\t\t\t\t\t\t\tselectedFilters={selectedFilters}\r\n\t\t\t\t\t\t\t\t\tbeginFilterChange={beginFilterChange}\r\n\t\t\t\t\t\t\t\t\thandlePopoverClose={this.handlePopoverClose}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t) : filterChangeLocation === FilterChangeLocation.FilterList ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t<FilterEdit\r\n\t\t\t\t\t\t\t\t\tselectedFilter={filterBeingChanged}\r\n\t\t\t\t\t\t\t\t\tonFilterChange={onFilterChange}\r\n\t\t\t\t\t\t\t\t\tonFilterRemoved={onFilterRemoved}\r\n\t\t\t\t\t\t\t\t\tcancelFilterChange={cancelFilterChange}\r\n\t\t\t\t\t\t\t\t\tcloseList={closeFilterList}\r\n\t\t\t\t\t\t\t\t\thandlePopoverClose={this.handlePopoverClose}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t</PopoverBody>\r\n\t\t\t\t</Popover>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Filters;\r\n","import { AutoSuggestParams } from 'components/shared/auto-suggest/Types';\r\nimport { SingleDatePickerOptions } from 'components/shared/edit/fields';\r\nimport * as React from 'react';\r\nimport { DropdownOption } from 'shared-client/types/fields';\r\nimport { ModelStatus } from 'shared-client/types/model-status';\r\nimport { stripHtml } from 'util/StringUtil';\r\nimport { NotNullValue, NotNullValueLabel, NullValue, NullValueLabel } from './providers/Constants';\r\nimport { FilterType } from './providers/Types';\r\n\r\nexport { default as AvailableFilters } from './AvailableFilters';\r\nexport { default as FilterEdit } from './FilterEdit';\r\nexport { default as Filters } from './Filters';\r\nexport { default as SelectedFilters } from './SelectedFilters';\r\n\r\n/**\r\n * Defines the shape of filter definitions.\r\n *\r\n * @export\r\n * @interface Filter\r\n */\r\nexport type Filter = {\r\n\tname: string;\r\n\tdisplayName: string;\r\n\ttype: FilterType;\r\n\tnullable: boolean;\r\n\toptions?: FilterOptions;\r\n} & FilterKind;\r\n\r\nexport type FilterKind =\r\n\t| {\r\n\t\t\timplicit: true;\r\n\t\t\tpermanent?: false;\r\n\t\t\t/**\r\n\t\t\t * Whether this implicit filter should be shown when clicking a \"Full Report\" button\r\n\t\t\t */\r\n\t\t\tshownOnRedirect?: boolean;\r\n\t\t\tvalue: any;\r\n\t  }\r\n\t| {\r\n\t\t\timplicit?: false;\r\n\t\t\tpermanent: true;\r\n\t\t\tvalue: any;\r\n\t  }\r\n\t| { implicit?: false; permanent?: false };\r\n\r\nexport interface FilterOptions {\r\n\tbaseUrl?: string;\r\n\tparams?: AutoSuggestParams;\r\n\tdropdownValues?: DropdownOption[];\r\n\tnullValueLabel?: string;\r\n\tdateParams?: SingleDatePickerOptions;\r\n\tignoreTimezone?: boolean;\r\n}\r\n\r\n/**\r\n * Returns an array of all filters used by models that inherit `BaseModel` on the server\r\n */\r\nexport function getBaseModelSearchFilters(ignored?: string[]): Filter[] {\r\n\treturn getFilters(\r\n\t\t[getStatusSearchFilter(), ...getUserTrackedSearchFilters(), ...getBasicModelSearchFilters()],\r\n\t\tignored,\r\n\t);\r\n}\r\n\r\n/**\r\n * Returns an array of Create Date and Modify Date by models that inherit `BasicModel` on the server\r\n */\r\nexport function getBasicModelSearchFilters(ignored?: string[]): Filter[] {\r\n\treturn getFilters(\r\n\t\t[\r\n\t\t\t{\r\n\t\t\t\tname: 'CreateDate',\r\n\t\t\t\tdisplayName: 'Create Date',\r\n\t\t\t\ttype: FilterType.MultipleDateRangePreset,\r\n\t\t\t\tnullable: false,\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tname: 'ModifyDate',\r\n\t\t\t\tdisplayName: 'Modify Date',\r\n\t\t\t\ttype: FilterType.MultipleDateRangePreset,\r\n\t\t\t\tnullable: false,\r\n\t\t\t},\r\n\t\t],\r\n\t\tignored,\r\n\t);\r\n}\r\n\r\n/**\r\n * Extended AutoSuggestItem type that includes additional values passed to the Scope filter\r\n */\r\ntype ScopeFilterParams = AutoSuggestParams & {\r\n\tignoreStatus: boolean;\r\n};\r\n\r\n/**\r\n * Returns a scope filter\r\n */\r\nexport function getScopeSearchFilter(multiSiteEnabled: boolean): Filter[] {\r\n\tif (multiSiteEnabled) {\r\n\t\treturn [\r\n\t\t\t{\r\n\t\t\t\tname: 'Scope',\r\n\t\t\t\tdisplayName: 'Scope',\r\n\t\t\t\ttype: FilterType.MultipleAutoSuggest,\r\n\t\t\t\tnullable: true,\r\n\t\t\t\toptions: {\r\n\t\t\t\t\tbaseUrl: '/ajax/scope',\r\n\t\t\t\t\tnullValueLabel: 'Global',\r\n\t\t\t\t\tparams: {\r\n\t\t\t\t\t\tignoreStatus: false,\r\n\t\t\t\t\t} as ScopeFilterParams,\r\n\t\t\t\t},\r\n\t\t\t},\r\n\t\t];\r\n\t}\r\n\r\n\treturn [];\r\n}\r\n\r\n/**\r\n * Returns an array of filters used by models that inherit `IUserTrackedModel` interface on the server\r\n */\r\nexport function getUserTrackedSearchFilters(): Filter[] {\r\n\treturn [\r\n\t\t{\r\n\t\t\tname: 'CreateUser',\r\n\t\t\tdisplayName: 'Created By',\r\n\t\t\ttype: FilterType.MultipleAutoSuggest,\r\n\t\t\tnullable: true,\r\n\t\t\toptions: {\r\n\t\t\t\tbaseUrl: '/ajax/admins',\r\n\t\t\t\tnullValueLabel: 'System',\r\n\t\t\t},\r\n\t\t},\r\n\t\t{\r\n\t\t\tname: 'ModifyUser',\r\n\t\t\tdisplayName: 'Modified By',\r\n\t\t\ttype: FilterType.MultipleAutoSuggest,\r\n\t\t\tnullable: true,\r\n\t\t\toptions: {\r\n\t\t\t\tbaseUrl: '/ajax/admins',\r\n\t\t\t\tnullValueLabel: 'System',\r\n\t\t\t},\r\n\t\t},\r\n\t];\r\n}\r\n\r\n/**\r\n * Returns an array of all filters that can be used on VersionableModel entities by default.\r\n */\r\nexport function getVersionableModelSearchFilters(ignored?: string[]): Filter[] {\r\n\treturn getFilters(\r\n\t\t[\r\n\t\t\t...getBaseModelSearchFilters(),\r\n\t\t\tgetHasDraftSearchFilter(),\r\n\t\t\tgetHasScheduledPublishSearchFilter(),\r\n\t\t\tgetHasScheduledDeactivationSearchFilter(),\r\n\t\t\tgetHasScheduledDeletionSearchFilter(),\r\n\t\t],\r\n\t\tignored,\r\n\t);\r\n}\r\n\r\n/**\r\n * Returns an array of all filters used by models that implement `INamedModel` on the server\r\n */\r\nexport function getNameSearchFilter(): Filter {\r\n\treturn {\r\n\t\tname: 'Name',\r\n\t\tdisplayName: 'Name',\r\n\t\ttype: FilterType.MultipleText,\r\n\t\tnullable: false,\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns Code filter used by models that implement `IUniqueCodeModel` on the server\r\n */\r\nexport const getCodeSearchFilter = (): Filter => {\r\n\treturn {\r\n\t\tname: 'CodeFilter',\r\n\t\tdisplayName: 'Code',\r\n\t\ttype: FilterType.MultipleText,\r\n\t\tnullable: false,\r\n\t};\r\n};\r\n\r\n/**\r\n * Returns a filter used by models that implement `IPermanentModel` on the server\r\n */\r\nexport function getPermanentSearchFilter(): Filter {\r\n\treturn {\r\n\t\tname: 'IsPermanent',\r\n\t\tdisplayName: 'Is Permanent',\r\n\t\ttype: FilterType.SingleBoolean,\r\n\t\tnullable: false,\r\n\t};\r\n}\r\n\r\nexport function getUserSearchFilter(): Filter {\r\n\treturn {\r\n\t\tname: 'User',\r\n\t\tdisplayName: 'User',\r\n\t\ttype: FilterType.MultipleAutoSuggest,\r\n\t\tnullable: true,\r\n\t\toptions: {\r\n\t\t\tbaseUrl: '/ajax/users',\r\n\t\t\tnullValueLabel: 'System',\r\n\t\t},\r\n\t};\r\n}\r\n\r\nexport function getNullableUserSearchFilter(): Filter {\r\n\treturn {\r\n\t\tname: 'User',\r\n\t\tdisplayName: 'User',\r\n\t\ttype: FilterType.MultipleAutoSuggest,\r\n\t\tnullable: true,\r\n\t\toptions: {\r\n\t\t\tbaseUrl: '/ajax/users',\r\n\t\t\tnullValueLabel: 'System',\r\n\t\t},\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns a basic Parent filter for hierarchical entities\r\n */\r\nexport function getParentSearchFilter(autoSuggestBaseUrl: string): Filter {\r\n\treturn {\r\n\t\tname: 'Parent',\r\n\t\tdisplayName: 'Parent',\r\n\t\ttype: FilterType.MultipleAutoSuggest,\r\n\t\tnullable: true,\r\n\t\toptions: {\r\n\t\t\tbaseUrl: autoSuggestBaseUrl,\r\n\t\t},\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns an array of all filters used by models that implement `IExternalModel` on the server\r\n */\r\nexport function getExternalIdSearchFilter(): Filter {\r\n\treturn {\r\n\t\tname: 'ExternalId',\r\n\t\tdisplayName: 'External ID',\r\n\t\ttype: FilterType.MultipleText,\r\n\t\tnullable: false,\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns a filter to get records with/out drafts only\r\n */\r\nexport function getHasDraftSearchFilter(): Filter {\r\n\treturn {\r\n\t\tname: 'HasDraft',\r\n\t\tdisplayName: 'Has Draft',\r\n\t\ttype: FilterType.SingleBoolean,\r\n\t\tnullable: false,\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns a filter to get records with/out scheduled publish records only\r\n */\r\nexport function getHasScheduledPublishSearchFilter(): Filter {\r\n\treturn {\r\n\t\tname: 'HasScheduledPublish',\r\n\t\tdisplayName: 'Has Scheduled Publish',\r\n\t\ttype: FilterType.SingleBoolean,\r\n\t\tnullable: false,\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns a filter to get records with/out scheduled deactivations only\r\n */\r\nexport function getHasScheduledDeactivationSearchFilter(): Filter {\r\n\treturn {\r\n\t\tname: 'HasScheduledDeactivation',\r\n\t\tdisplayName: 'Has Scheduled Deactivation',\r\n\t\ttype: FilterType.SingleBoolean,\r\n\t\tnullable: false,\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns a filter to get records with selected status only\r\n */\r\nexport function getStatusSearchFilter(ignoredDropDownValues?: DropdownOption[]): Filter {\r\n\treturn {\r\n\t\tname: 'Status',\r\n\t\tdisplayName: 'Status',\r\n\t\ttype: FilterType.MultipleDropdown,\r\n\t\tnullable: false,\r\n\t\toptions: {\r\n\t\t\tdropdownValues: getDropDownValues(\r\n\t\t\t\t[\r\n\t\t\t\t\t{ value: ModelStatus.Published, text: ModelStatus.Published },\r\n\t\t\t\t\t{ value: ModelStatus.Inactive, text: ModelStatus.Inactive },\r\n\t\t\t\t\t{ value: ModelStatus.Deleted, text: ModelStatus.Deleted },\r\n\t\t\t\t],\r\n\t\t\t\tignoredDropDownValues,\r\n\t\t\t),\r\n\t\t},\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns a filter to get records with/out scheduled deletions only\r\n */\r\nexport function getHasScheduledDeletionSearchFilter(): Filter {\r\n\treturn {\r\n\t\tname: 'HasScheduledDeletion',\r\n\t\tdisplayName: 'Has Scheduled Deletion',\r\n\t\ttype: FilterType.SingleBoolean,\r\n\t\tnullable: false,\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns a filter to get records by the URL field only.\r\n */\r\nexport function getUrlSearchFilter(): Filter {\r\n\treturn {\r\n\t\tname: 'Url',\r\n\t\tdisplayName: 'URL',\r\n\t\ttype: FilterType.MultipleText,\r\n\t\tnullable: false,\r\n\t};\r\n}\r\n\r\n/**\r\n * Returns an array of all filters used by models that implement `ISeoModel` on the server\r\n */\r\nexport function getSeoSearchFilters(ignored?: string[]): Filter[] {\r\n\treturn getFilters(\r\n\t\t[\r\n\t\t\tgetUrlSearchFilter(),\r\n\t\t\t{\r\n\t\t\t\tname: 'PageTitle',\r\n\t\t\t\tdisplayName: 'Page Title',\r\n\t\t\t\ttype: FilterType.MultipleText,\r\n\t\t\t\tnullable: false,\r\n\t\t\t},\r\n\t\t],\r\n\t\tignored,\r\n\t);\r\n}\r\n\r\n/**\r\n * Defines the shape of filter definition along with the value that was picked. Uses `any` for the type\r\n * as getting this to go all the way down to where it would be useful is really hard, and generally not worth it, as most\r\n * of the places that reference this directly will not care about the type.\r\n *\r\n * @export\r\n * @type Filter\r\n */\r\nexport type SelectedFilter = Filter & {\r\n\tvalue: any;\r\n};\r\n\r\n/** Reusable definition for the empty string */\r\nexport function Empty() {\r\n\treturn <em>&lt;Empty&gt;</em>;\r\n}\r\nexport function FilterNotSet() {\r\n\treturn <em>&lt;Not Set&gt;</em>;\r\n}\r\n\r\nexport function FilterString(value: string, options?: FilterOptions) {\r\n\tswitch (value) {\r\n\t\tcase NullValue:\r\n\t\tcase NullValueLabel:\r\n\t\t\treturn (options && options.nullValueLabel) || NullValueLabel;\r\n\t\tcase NotNullValue:\r\n\t\t\treturn NotNullValueLabel;\r\n\t\tdefault:\r\n\t\t\treturn stripHtml(value);\r\n\t}\r\n}\r\n\r\nfunction getFilters(filters: Filter[], ignored?: string[]) {\r\n\tif (!ignored) {\r\n\t\treturn filters;\r\n\t}\r\n\treturn filters.filter((f) => !ignored.find((i) => i === f.name));\r\n}\r\n\r\nexport function getDropDownValues(dropDownValues: DropdownOption[], ignoredDropDownValues?: DropdownOption[]) {\r\n\tif (!ignoredDropDownValues) {\r\n\t\treturn dropDownValues;\r\n\t}\r\n\treturn dropDownValues.filter((f) => !ignoredDropDownValues.find((i) => i.value === f.value && i.text === f.text));\r\n}\r\n","import * as React from 'react';\r\nimport { WithTestId } from 'shared-client/types/test';\r\nimport { EntityDefinition } from 'types';\r\nimport { ViewSiteHost } from 'util/AppStateUtils';\r\nimport Alert from './Alert';\r\nimport { IsAbsoluteUrl } from './edit/fields/formatters';\r\n\r\ninterface ViewLiveModalProps extends WithTestId {\r\n\trecord: any;\r\n\tsites: ViewSiteHost[];\r\n\tentityDefinition: EntityDefinition;\r\n\tisOpen: boolean;\r\n\tsetModal: (isOpen: boolean) => void;\r\n}\r\n\r\n/**\r\n * Displays a modal with a list of sites that are scoped to the record that you are trying to view.\r\n * @param props\r\n */\r\nfunction ViewLiveModal(props: ViewLiveModalProps) {\r\n\tconst { entityDefinition, record, sites, isOpen, setModal, testId } = props;\r\n\r\n\tconst recordName: string = record[entityDefinition.userFriendlyNameField]\r\n\t\t? record[entityDefinition.userFriendlyNameField]\r\n\t\t: record.name;\r\n\r\n\treturn (\r\n\t\t<Alert\r\n\t\t\trenderTitle={() => <>View {entityDefinition.singularName}</>}\r\n\t\t\tisOpen={isOpen}\r\n\t\t\tonConfirm={() => setModal(false)}\r\n\t\t\tconfirmButtonText=\"Close\"\r\n\t\t\tcolor=\"primary\"\r\n\t\t\trenderContents={() => (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<p>On which site would you like to view &quot;{recordName}&quot;?</p>\r\n\r\n\t\t\t\t\t<div className=\"view-record__list\">\r\n\t\t\t\t\t\t{sites.map((site, index) => (\r\n\t\t\t\t\t\t\t<div key={'site-' + record.url + '-' + site.name}>\r\n\t\t\t\t\t\t\t\t{site.name}\r\n\t\t\t\t\t\t\t\t<ul>\r\n\t\t\t\t\t\t\t\t\t{site.hosts?.map((siteHost) => (\r\n\t\t\t\t\t\t\t\t\t\t<li key={'site-' + record.url + '-' + siteHost}>\r\n\t\t\t\t\t\t\t\t\t\t\t<a\r\n\t\t\t\t\t\t\t\t\t\t\t\thref={IsAbsoluteUrl(record.url) ? record.url : siteHost + record.url}\r\n\t\t\t\t\t\t\t\t\t\t\t\ttarget=\"_blank\"\r\n\t\t\t\t\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => setModal(false)}\r\n\t\t\t\t\t\t\t\t\t\t\t\tdata-testid={`${testId}-${index}`}\r\n\t\t\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{siteHost}\r\n\t\t\t\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t\t\t\t))}\r\n\t\t\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</>\r\n\t\t\t)}\r\n\t\t/>\r\n\t);\r\n}\r\n\r\nexport default ViewLiveModal;\r\n","import * as React from 'react';\r\nimport { Button } from 'reactstrap';\r\nimport Octicon, { ChevronUp, ChevronDown } from '@githubprimer/octicons-react';\r\nimport { GetToggleButtonPropsOptions } from 'downshift';\r\n\r\nexport interface AutoSuggestMenuToggleProps {\r\n\tisOpen: boolean;\r\n\tdisabled: boolean;\r\n\tgetToggleButtonProps: (options?: GetToggleButtonPropsOptions) => any;\r\n}\r\n\r\n/**\r\n * Renders the button to expand/collapse the menu on the AutoSuggestInput.\r\n *\r\n * @class AutoSuggestMenuToggle\r\n * @extends {React.Component<AutoSuggestMenuToggleProps>}\r\n */\r\nclass AutoSuggestMenuToggle extends React.Component<AutoSuggestMenuToggleProps> {\r\n\tpublic render() {\r\n\t\tconst { getToggleButtonProps, isOpen, disabled } = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t<Button\r\n\t\t\t\tcolor=\"primary\"\r\n\t\t\t\tdata-testid=\"autosuggest-menu-toggle-btn\"\r\n\t\t\t\tclassName=\"btn-input btn-autosuggest-toggle\"\r\n\t\t\t\t{...getToggleButtonProps()}\r\n\t\t\t\ttitle=\"Toggle\"\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t>\r\n\t\t\t\t{isOpen ? (\r\n\t\t\t\t\t<Octicon icon={ChevronUp} ariaLabel=\"Chevron Up\" />\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<Octicon icon={ChevronDown} ariaLabel=\"Chevron Down\" />\r\n\t\t\t\t)}\r\n\t\t\t</Button>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default AutoSuggestMenuToggle;\r\n","import Octicon, { X } from '@githubprimer/octicons-react';\r\nimport * as React from 'react';\r\nimport { Button } from 'reactstrap';\r\nimport AutoSuggestContext, { AutoSuggestContextValue } from './AutoSuggestContext';\r\nimport AutoSuggestMenuToggle from './AutoSuggestMenuToggle';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport interface AutoSuggestInputActionsProps {\r\n\tdisabled: boolean;\r\n\tclearable?: boolean;\r\n\tname: string;\r\n}\r\n\r\n/**\r\n * Renders the action buttons to clear values and display the autosuggest menu.\r\n *\r\n * @class AutoSuggestInputActions\r\n * @extends {React.Component<AutoSuggestInputActionsProps>}\r\n */\r\nclass AutoSuggestInputActions extends React.Component<AutoSuggestInputActionsProps> {\r\n\tpublic static contextType: React.Context<any> = AutoSuggestContext;\r\n\tpublic declare context: AutoSuggestContextValue;\r\n\r\n\tpublic static defaultProps = {\r\n\t\tdisabled: false,\r\n\t\tclearable: true,\r\n\t};\r\n\r\n\t/**\r\n\t * Clears out value when the clear button is clicked\r\n\t *\r\n\t * @memberof AutoSuggestInput\r\n\t */\r\n\tpublic handleClear = () => {\r\n\t\tconst {\r\n\t\t\tonChange,\r\n\t\t\tdownshift: { clearSelection },\r\n\t\t} = this.context;\r\n\r\n\t\tclearSelection();\r\n\t\tonChange(null);\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst { disabled, clearable, name } = this.props;\r\n\r\n\t\tconst {\r\n\t\t\tvalue,\r\n\t\t\tdownshift: { isOpen, getToggleButtonProps },\r\n\t\t} = this.context;\r\n\r\n\t\t// never show the clear button if we're dealing with an array of values (multiple select)\r\n\t\tconst hideClearButton = !value || Array.isArray(value) || !clearable;\r\n\r\n\t\tif (!hideClearButton) {\r\n\t\t\treturn (\r\n\t\t\t\t<Button\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\tonClick={this.handleClear}\r\n\t\t\t\t\ttitle=\"Remove\"\r\n\t\t\t\t\tclassName=\"btn-input-surrounded btn-input-cancel\"\r\n\t\t\t\t\tdata-testid={`remove-autosuggest-btn-${toKebabCase(name)}`}\r\n\t\t\t\t>\r\n\t\t\t\t\t<Octicon icon={X} ariaLabel=\"X\" />\r\n\t\t\t\t</Button>\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<AutoSuggestMenuToggle disabled={disabled} isOpen={isOpen} getToggleButtonProps={getToggleButtonProps} />\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default AutoSuggestInputActions;\r\n","import { SavedFilter, SavedFilterCategory } from './SavedFilterPicker';\r\n\r\n// comparison function to alphabetically sort the saved filters\r\nexport const savedFilterAlphaCompare = (a: SavedFilter, b: SavedFilter) =>\r\n\ta.name.toLowerCase().localeCompare(b.name.toLowerCase());\r\n\r\n/**\r\n * Flattens structure that holds saved filter categories and filters to only return all filters\r\n */\r\nexport const flattenSavedFilters = (savedFilterCategories: SavedFilterCategory[]): SavedFilter[] => {\r\n\treturn savedFilterCategories\r\n\t\t.reduce((acc: SavedFilter[], value: SavedFilterCategory) => {\r\n\t\t\tacc = acc.concat(value.savedFilters);\r\n\t\t\treturn acc;\r\n\t\t}, [])\r\n\t\t.sort(savedFilterAlphaCompare);\r\n};\r\n","import * as React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { DropdownOption } from 'shared-client/types/fields';\r\nimport { DropdownProps, FormDropdown } from '.';\r\nexport type EnumDropdownProps = FieldRenderProps<any, HTMLInputElement> &\r\n\tDropdownProps & {\r\n\t\tenumType: Record<string, string>;\r\n\t};\r\n\r\n/**\r\n * Component that renders a dropdown with options.\r\n *\r\n * For enumerations used in EnumDropdown:\r\n * - The enumeration entry's key is used as the *value* for the dropdown entry\r\n * - The enumeration entry's value is used as the *label* for the dropdown entry\r\n *\r\n * @class EnumDropdown\r\n * @extends {React.Component<EnumDropdownProps>}\r\n */\r\nclass EnumDropdown extends React.Component<EnumDropdownProps> {\r\n\tprivate options: DropdownOption[] = [];\r\n\tpublic static defaultProps: any = {\r\n\t\tindicateDirty: true,\r\n\t};\r\n\r\n\tconstructor(props: EnumDropdownProps) {\r\n\t\tsuper(props);\r\n\t\tthis.options = Object.keys(props.enumType).map((key) => ({ value: key, text: props.enumType[key] }));\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\t// eslint-disable-next-line no-unused-vars\r\n\t\tconst { enumType, ...rest } = this.props;\r\n\t\treturn <FormDropdown {...rest} addSelectOption={this.props.addSelectOption} options={this.options} />;\r\n\t}\r\n}\r\n\r\nexport default EnumDropdown;\r\n","import * as React from 'react';\r\nimport { Button } from 'reactstrap';\r\nimport Confirm from '../Confirm';\r\n\r\ninterface EditResetButtonState {\r\n\tisConfirmOpen: boolean;\r\n}\r\n\r\ninterface EditResetButtonProps {\r\n\tdisabled: boolean;\r\n\tinitialValues: any;\r\n\treset(initialValues: any): void;\r\n\tclassName?: string;\r\n}\r\n\r\nclass EditResetButton extends React.Component<EditResetButtonProps, EditResetButtonState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tisConfirmOpen: false,\r\n\t\t};\r\n\t}\r\n\r\n\tprivate resetForm = () => {\r\n\t\tthis.props.reset(this.props.initialValues);\r\n\t\tthis.toggleResetConfirm();\r\n\t};\r\n\r\n\tprivate toggleResetConfirm = () => {\r\n\t\tthis.setState({ isConfirmOpen: !this.state.isConfirmOpen });\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<Button\r\n\t\t\t\t\tclassName={this.props.className}\r\n\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\tcolor=\"primary-alt\"\r\n\t\t\t\t\toutline\r\n\t\t\t\t\tonClick={this.toggleResetConfirm}\r\n\t\t\t\t\tdisabled={this.props.disabled}\r\n\t\t\t\t>\r\n\t\t\t\t\tReset\r\n\t\t\t\t</Button>\r\n\r\n\t\t\t\t<Confirm\r\n\t\t\t\t\tisOpen={this.state.isConfirmOpen}\r\n\t\t\t\t\tonConfirm={this.resetForm}\r\n\t\t\t\t\tonCancel={this.toggleResetConfirm}\r\n\t\t\t\t\trenderTitle={() => 'Warning'}\r\n\t\t\t\t\trenderContents={() => 'Are you sure you want to reset this form? Your changes will be lost.'}\r\n\t\t\t\t\tconfirmButtonText=\"Reset Form\"\r\n\t\t\t\t/>\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default EditResetButton;\r\n","import { useCallback } from 'react';\r\n\r\nconst visuallyHiddenAnnouncementElementId = 'visually-hidden-announcement';\r\nconst visuallyHiddenAnnouncementElement = document.getElementById(visuallyHiddenAnnouncementElementId);\r\n\r\n/**\r\n * Custom hook for updating a visually hidden announcement to be announced by a screen reader\r\n *\r\n * @returns setVisuallyHiddenAnnouncement - the function that updates the visually hidden announcement\r\n */\r\nexport const useVisuallyHiddenAnnouncement = () => {\r\n\tconst setVisuallyHiddenAnnouncement = useCallback((announcement: string) => {\r\n\t\tif (visuallyHiddenAnnouncementElement === null) {\r\n\t\t\tconsole.warn('No visually hidden announcement element was found.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\twhile (visuallyHiddenAnnouncementElement.firstChild) {\r\n\t\t\tvisuallyHiddenAnnouncementElement.firstChild.remove();\r\n\t\t}\r\n\r\n\t\tconst visuallyHiddenAnnouncementTextElement = document.createElement('p');\r\n\t\tvisuallyHiddenAnnouncementTextElement.textContent = announcement;\r\n\r\n\t\tvisuallyHiddenAnnouncementElement.appendChild(visuallyHiddenAnnouncementTextElement);\r\n\t}, []);\r\n\r\n\treturn { setVisuallyHiddenAnnouncement };\r\n};\r\n","import React, { useEffect } from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\nimport useDelayedDisplay from './hooks/useDelayedDisplay';\r\nimport { useVisuallyHiddenAnnouncement } from './hooks/useVisuallyHiddenAnnouncement';\r\n\r\n/**\r\n * Type definition for all possible color options.\r\n *\r\n */\r\nexport type SpinnerColor = 'default' | 'dark' | 'light';\r\n\r\ninterface SpinnerProps extends WithTestIdOptional {\r\n\twaitMs: number;\r\n\tcolor: SpinnerColor;\r\n\tcentered: boolean;\r\n\tclassName?: string;\r\n}\r\n\r\n/**\r\n * Spinner SVG for loading purposes\r\n *\r\n * @returns\r\n */\r\nfunction Spinner(props: SpinnerProps) {\r\n\tconst display = useDelayedDisplay(props.waitMs);\r\n\r\n\tconst { setVisuallyHiddenAnnouncement } = useVisuallyHiddenAnnouncement();\r\n\r\n\tuseEffect(() => {\r\n\t\tsetVisuallyHiddenAnnouncement('Loading');\r\n\t\treturn () => setVisuallyHiddenAnnouncement('Finished Loading');\r\n\t}, [setVisuallyHiddenAnnouncement]);\r\n\r\n\tif (!display) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst spinnerDefaultClass = 'spinner ';\r\n\tconst spinnerColorClass = 'spinner--' + props.color + ' ';\r\n\tconst spinnerCenterClass = props.centered ? 'spinner--centered ' : '';\r\n\tconst testId = `spinner-${props.testId ? props.testId : 'default'}`;\r\n\r\n\tconst spinnerClass =\r\n\t\tspinnerDefaultClass + spinnerColorClass + spinnerCenterClass + (props.className ? props.className : '');\r\n\r\n\treturn (\r\n\t\t<div className={spinnerClass} data-testid={testId}>\r\n\t\t\t<div className=\"spinner__cube1\" />\r\n\t\t\t<div className=\"spinner__cube2\" />\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\nSpinner.defaultProps = {\r\n\twaitMs: 200,\r\n\tcolor: 'default',\r\n\tcentered: false,\r\n};\r\n\r\nexport default React.memo(Spinner);\r\n","import { getIn } from 'final-form';\n\n//      \n\n/**\n * Predicate to identify inputs that can have focus() called on them\n */\nvar isFocusableInput = function isFocusableInput(wtf) {\n  return !!(wtf && typeof wtf.focus === 'function');\n};\n\n//      \n/**\n * Gets all the inputs inside all forms on the page\n */\n\nvar getAllInputs = function getAllInputs() {\n  if (typeof document === 'undefined') {\n    return [];\n  }\n\n  return Array.prototype.slice.call(document.forms).reduce(function (accumulator, form) {\n    return accumulator.concat(Array.prototype.slice.call(form).filter(isFocusableInput));\n  }, []);\n};\n\n//      \n/**\n * Finds the input by looking if the name attribute path is existing in the errors object\n */\n\nvar findInput = function findInput(inputs, errors) {\n  return inputs.find(function (input) {\n    return input.name && getIn(errors, input.name);\n  });\n};\n\n//      \n\nvar noop = function noop() {};\n\nvar createDecorator = function createDecorator(getInputs, findInput$$1) {\n  return function (form) {\n    var focusOnFirstError = function focusOnFirstError(errors) {\n      if (!getInputs) {\n        getInputs = getAllInputs;\n      }\n\n      if (!findInput$$1) {\n        findInput$$1 = findInput;\n      }\n\n      var firstInput = findInput$$1(getInputs(), errors);\n\n      if (firstInput) {\n        firstInput.focus();\n      }\n    }; // Save original submit function\n\n\n    var originalSubmit = form.submit; // Subscribe to errors, and keep a local copy of them\n\n    var state = {};\n    var unsubscribe = form.subscribe(function (nextState) {\n      state = nextState;\n    }, {\n      errors: true,\n      submitErrors: true\n    }); // What to do after submit\n\n    var afterSubmit = function afterSubmit() {\n      var _state = state,\n          errors = _state.errors,\n          submitErrors = _state.submitErrors;\n\n      if (errors && Object.keys(errors).length) {\n        focusOnFirstError(errors);\n      } else if (submitErrors && Object.keys(submitErrors).length) {\n        focusOnFirstError(submitErrors);\n      }\n    }; // Rewrite submit function\n\n\n    form.submit = function () {\n      var result = originalSubmit.call(form);\n\n      if (result && typeof result.then === 'function') {\n        // async\n        result.then(afterSubmit, noop);\n      } else {\n        // sync\n        afterSubmit();\n      }\n\n      return result;\n    };\n\n    return function () {\n      unsubscribe();\n      form.submit = originalSubmit;\n    };\n  };\n};\n\n//      \n/**\n * Generates a function to get all the inputs in a form with the specified name\n */\n\nvar getFormInputs = function getFormInputs(name) {\n  return function () {\n    if (typeof document === 'undefined') {\n      return [];\n    } // $FlowFixMe\n\n\n    var form = document.forms[name];\n    return form && form.length ? Array.prototype.slice.call(form).filter(isFocusableInput) : []; // cast cheat to get from HTMLFormElement children to FocusableInput\n  };\n};\n\n//\n\nexport default createDecorator;\nexport { getFormInputs };\n","// These functions may be potentially innaccurate in certain locales that use differing amounts of characters in different cases\r\n\r\n/**\r\n * Tests if a string includes another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyIncludes(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().includes(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string starts with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyStartsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().startsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Tests if a string ends with another if casing is ignored\r\n * @param thisString The string to test\r\n * @param otherString The potentially included string being tested for\r\n */\r\nexport function stringWeaklyEndsWith(thisString: string, otherString: string) {\r\n\treturn thisString.toLocaleLowerCase().endsWith(otherString.toLocaleLowerCase());\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToUpper(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleUpperCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n/**\r\n * Converts the first character in a string to upper-case. Will not work for all languages (for example Dutch).\r\n *\r\n * @export\r\n * @param {string} thisString\r\n * @returns\r\n */\r\nexport function firstCharacterToLower(thisString: string) {\r\n\tif (!thisString) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tlet newString = thisString.substring(0, 1).toLocaleLowerCase();\r\n\r\n\tif (thisString.length > 1) {\r\n\t\tnewString += thisString.substring(1);\r\n\t}\r\n\r\n\treturn newString;\r\n}\r\n\r\n// https://github.com/uxitten/polyfill/blob/master/string.polyfill.js\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart\r\nexport function padStart(value, targetLength, padString) {\r\n\t// tslint:disable-next-line:no-bitwise\r\n\ttargetLength = targetLength >> 0; // truncate if number, or convert non-number to 0;\r\n\tpadString = String(typeof padString !== 'undefined' ? padString : ' ');\r\n\tif (value.length >= targetLength) {\r\n\t\treturn String(value);\r\n\t} else {\r\n\t\ttargetLength = targetLength - value.length;\r\n\t\tif (targetLength > padString.length) {\r\n\t\t\tpadString += padString.repeat(targetLength / padString.length); // append to original to ensure we are longer than needed\r\n\t\t}\r\n\t\treturn padString.slice(0, targetLength) + String(value);\r\n\t}\r\n}\r\n\r\n/**\r\n * Converts a string from \" Something Like  This\" to \"something-like-this\"\r\n * @param value The string to convert\r\n */\r\nexport function toKebabCase(value: string) {\r\n\tif (!value || !value.trim()) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn value\r\n\t\t.trim()\r\n\t\t.replace(/[^a-zA-Z0-9]+/g, '-')\r\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\r\n\t\t.replace(/([A-Z])([A-Z])(?=[a-z])/g, '$1-$2')\r\n\t\t.replace(/-$/, '')\r\n\t\t.toLocaleLowerCase();\r\n}\r\n\r\n/**\r\n * Converts a string from PascalCase, camelCase, snake_case, or space separated to camelCase. Beginning and trailing whitespace are trimmed.\r\n * @param value The string to convert\r\n */\r\nexport function toCamelCase(value: string) {\r\n\treturn value\r\n\t\t.replace(/(?:^\\w|[A-Z]|\\b\\w)/g, function (word, index) {\r\n\t\t\treturn index === 0 ? word.toLowerCase() : word.toUpperCase();\r\n\t\t})\r\n\t\t.replace(/(?:\\s+|[-_])/g, '');\r\n}\r\n\r\n/**\r\n * Removes html characters\r\n *\r\n * @export\r\n * @param {*} html\r\n * @returns\r\n */\r\nexport function stripHtml(html) {\r\n\tconst tmp = document.createElement('div');\r\n\ttmp.innerHTML = html;\r\n\treturn tmp.textContent || tmp.innerText || '';\r\n}\r\n\r\n/**\r\n * Cuts of text and adds ellipsis (...) after a certain number of characters\r\n * @param text The text to format\r\n * @param cutoff The number of characters to add the ellipsis after\r\n */\r\nexport function addEllipsis(text: string, cutoff: number = 20) {\r\n\tif (!text || text.length < cutoff) {\r\n\t\treturn text;\r\n\t}\r\n\r\n\treturn text.substring(0, cutoff) + '...';\r\n}\r\n\r\n/**\r\n * Converts \"STRINGS_LIKE_THIS\" into \"Strings Like This\"\r\n */\r\nexport function snakeCaseToFriendly(value: string) {\r\n\tif (!value) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn value\r\n\t\t.split('_')\r\n\t\t.map((s) => s.substring(0, 1).toLocaleUpperCase() + s.substring(1).toLocaleLowerCase())\r\n\t\t.join(' ');\r\n}\r\n\r\n/**\r\n * Trims a string value\r\n */\r\nexport function trimString(value: string | undefined) {\r\n\treturn value ? value.trim() : '';\r\n}\r\n\r\n/**\r\n * Trims and joins the truthy strings from the provided array with the provided separator\r\n */\r\nexport function joinTrimmedStrings(separator: string, ...strings: (string | undefined)[]) {\r\n\treturn strings\r\n\t\t?.filter((s) => s)\r\n\t\t.map(trimString)\r\n\t\t.join(separator);\r\n}\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Reusable component for the required field marker\r\n * @param props\r\n */\r\nconst RequiredFieldMarker: React.SFC<any> = () => {\r\n\treturn <span className=\"required-field-marker\">(required)</span>;\r\n};\r\n\r\nexport default RequiredFieldMarker;\r\n","import * as React from 'react';\r\nimport { InputGroup, Input, FormText } from 'reactstrap';\r\nimport AutoSuggestContext, { AutoSuggestContextValue } from './AutoSuggestContext';\r\nimport FieldLabel from '../edit/fields/FieldLabel';\r\nimport { ValidationMessages, FieldProps, PrefixSuffixFieldProps } from '../edit/fields';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport AutoSuggestInputActions from './AutoSuggestInputActions';\r\nimport { itemToString } from './Util';\r\nimport { InputType } from 'reactstrap/lib/Input';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport classnames from 'classnames';\r\n\r\nexport type AutoSuggestFieldInputProps = Pick<FieldRenderProps<any, HTMLInputElement>, 'meta'> &\r\n\tFieldProps &\r\n\tPrefixSuffixFieldProps & { allowNewValues?: boolean; placeholder?: string; inputTypeOverride?: InputType };\r\n\r\n/**\r\n * Renders the input fields for a user to enter values to search within the AutoSuggest.\r\n *\r\n * @class AutoSuggestFieldInput\r\n * @extends {React.Component<AutoSuggestFieldInputProps>}\r\n */\r\nclass AutoSuggestFieldInput extends React.Component<AutoSuggestFieldInputProps> {\r\n\tpublic static contextType: React.Context<any> = AutoSuggestContext;\r\n\tpublic declare context: AutoSuggestContextValue;\r\n\r\n\tpublic static defaultProps = {\r\n\t\tindicateDirty: true,\r\n\t\tisRequired: false,\r\n\t};\r\n\r\n\t/**\r\n\t * Display the list of results on focus.\r\n\t *\r\n\t * @memberof AutoSuggestInput\r\n\t */\r\n\tpublic handleOnFocus = () => {\r\n\t\tconst {\r\n\t\t\tautoSuggestOptions: { expandOnClick = true },\r\n\t\t\tdownshift: { toggleMenu },\r\n\t\t} = this.context;\r\n\r\n\t\tif (expandOnClick) {\r\n\t\t\ttoggleMenu();\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tmeta,\r\n\t\t\tlabel,\r\n\t\t\tname,\r\n\t\t\tforceEmptyLabel,\r\n\t\t\tlabelElementHidden,\r\n\t\t\tisRequired,\r\n\t\t\tdisabled,\r\n\t\t\treadOnly,\r\n\t\t\tallowNewValues,\r\n\t\t\tprefix,\r\n\t\t\tsuffix,\r\n\t\t\tisPowerUser,\r\n\t\t\tplaceholder = `Begin typing to search${allowNewValues != null && allowNewValues ? ' or create new' : ''}`,\r\n\t\t\tinputTypeOverride,\r\n\t\t\ttestId,\r\n\t\t\thideTooltip,\r\n\t\t} = this.props;\r\n\r\n\t\tconst {\r\n\t\t\tname: contextName,\r\n\t\t\tvalue,\r\n\t\t\tdownshift: { getInputProps, getLabelProps },\r\n\t\t} = this.context;\r\n\r\n\t\tconst labelProps = getLabelProps();\r\n\t\tconst inputProps = getInputProps();\r\n\r\n\t\tlet readOnlyDisplay;\r\n\r\n\t\tif (readOnly) {\r\n\t\t\tif (Array.isArray(value)) {\r\n\t\t\t\tif (value.length === 0) {\r\n\t\t\t\t\treadOnlyDisplay = <em>No values selected.</em>;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treadOnlyDisplay = <em>{value.map(itemToString).join(', ')}</em>;\r\n\t\t\t\t}\r\n\t\t\t} else if (value) {\r\n\t\t\t\treadOnlyDisplay = <em>{value.label}</em>;\r\n\t\t\t} else {\r\n\t\t\t\treadOnlyDisplay = <em>&lt;Empty&gt;</em>;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// eslint-disable-next-line no-unused-vars\r\n\t\tconst { type, ref, ...autoSuggestInputProps } = getInputProps({\r\n\t\t\ttype: 'text',\r\n\t\t\tname: contextName,\r\n\t\t\t'aria-labelledby': `label-${labelProps.id}`,\r\n\t\t});\r\n\r\n\t\tconst hideClearButton = !value || Array.isArray(value);\r\n\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<FieldLabel\r\n\t\t\t\t\thtmlFor={inputProps.id}\r\n\t\t\t\t\tlabel={label}\r\n\t\t\t\t\tisRequired={isRequired}\r\n\t\t\t\t\tid={labelProps.id}\r\n\t\t\t\t\tisPowerUser={isPowerUser}\r\n\t\t\t\t\tforceEmptyLabel={forceEmptyLabel}\r\n\t\t\t\t\tlabelElementHidden={labelElementHidden}\r\n\t\t\t\t\tname={name}\r\n\t\t\t\t\thideTooltip={hideTooltip}\r\n\t\t\t\t/>\r\n\t\t\t\t{readOnly ? (\r\n\t\t\t\t\t<FormText>{readOnlyDisplay}</FormText>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\tclassName={classnames('input-wrapper', {\r\n\t\t\t\t\t\t\t\t'input-wrapper--show-clear': !hideClearButton,\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{prefix ? <div className=\"input-wrapper__prefix\">{prefix}</div> : null}\r\n\t\t\t\t\t\t\t<InputGroup\r\n\t\t\t\t\t\t\t\tclassName={!meta.dirtySinceLastSubmit && meta.submitError ? 'input-group-invalid' : ''}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\t\t\tclassName=\"form-control--cancel-next\"\r\n\t\t\t\t\t\t\t\t\ttype={inputTypeOverride || 'text'}\r\n\t\t\t\t\t\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\t\t\t\t\t\t{...autoSuggestInputProps}\r\n\t\t\t\t\t\t\t\t\tonFocus={this.handleOnFocus}\r\n\t\t\t\t\t\t\t\t\tinvalid={!meta.dirtySinceLastSubmit && meta.submitError ? true : false}\r\n\t\t\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t\t\tdata-testid={testId || `field-${toKebabCase(name)}`}\r\n\t\t\t\t\t\t\t\t\tonKeyPress={(e) => {\r\n\t\t\t\t\t\t\t\t\t\te.key === 'Enter' && e.preventDefault();\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t<AutoSuggestInputActions disabled={disabled} name={name} />\r\n\t\t\t\t\t\t\t</InputGroup>\r\n\r\n\t\t\t\t\t\t\t{suffix ? <div className=\"input-wrapper__suffix\">{suffix}</div> : null}\r\n\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t<ValidationMessages id={name + '-invalid'} meta={meta} />\r\n\t\t\t\t\t</>\r\n\t\t\t\t)}\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default AutoSuggestFieldInput;\r\n","import React from 'react';\r\nimport Button from 'reactstrap/lib/Button';\r\nimport { FilterButtonProps } from '.';\r\n\r\n/**\r\n * Button for adding a filter.\r\n */\r\nexport default function FiltersListAddButton(props: FilterButtonProps) {\r\n\treturn (\r\n\t\t<div className=\"filters-popover__action\">\r\n\t\t\t<Button type=\"button\" color=\"primary\" data-testid=\"add-filter-btn\" onClick={props.onClick}>\r\n\t\t\t\tFilter\r\n\t\t\t</Button>\r\n\t\t</div>\r\n\t);\r\n}\r\n","import * as React from 'react';\r\nimport { FormGroup, Input } from 'reactstrap';\r\nimport { StringFilterEditProps } from '../providers/SingleValue';\r\nimport FiltersListAddButton from './FiltersListAddButton';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\n\r\ninterface SingleTextFilterEditState {\r\n\tcurrentValue: string;\r\n\tdisplayValidationError: boolean;\r\n}\r\n\r\n/**\r\n * Configures a single text value in a filter\r\n */\r\nclass SingleTextFilterEdit extends React.PureComponent<StringFilterEditProps, SingleTextFilterEditState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tcurrentValue: props.value || '',\r\n\t\t\tdisplayValidationError: false,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Bubbles up state to the parent component.\r\n\t *\r\n\t * @private\r\n\t * @memberof SingleTextFieldEdit\r\n\t */\r\n\tprivate handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tthis.setState({ currentValue: e.currentTarget.value });\r\n\t};\r\n\r\n\tprivate handleSearch = () => {\r\n\t\tconst trimmedValue = this.state.currentValue.trim();\r\n\t\tconst validationError = !this.props.filter.nullable && !trimmedValue;\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tif (!validationError) {\r\n\t\t\tthis.props.onChange(this.state.currentValue, false);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Allow users to hit enter to add new values.\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFieldEdit\r\n\t */\r\n\tprivate handleOnKeyDown = (e: React.KeyboardEvent) => {\r\n\t\tif (e.which === 13) {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.handleSearch();\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t<Input\r\n\t\t\t\t\tid=\"fieldValue\"\r\n\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\tautoFocus\r\n\t\t\t\t\tplaceholder={this.props.filter.nullable ? '<Empty>' : 'Enter a value to filter by'}\r\n\t\t\t\t\tvalue={this.state.currentValue}\r\n\t\t\t\t\tonChange={this.handleOnChange}\r\n\t\t\t\t\tonKeyDown={this.handleOnKeyDown}\r\n\t\t\t\t/>\r\n\t\t\t\t<div className=\"filters-popover__actions\">\r\n\t\t\t\t\t<FiltersListAddButton onClick={this.handleSearch} />\r\n\t\t\t\t</div>\r\n\t\t\t\t{this.state.displayValidationError ? <FilterEditRequiredValidation /> : null}\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default SingleTextFilterEdit;\r\n","import * as React from 'react';\r\nimport { FormGroup, Input } from 'reactstrap';\r\nimport { StringFilterEditProps } from '../providers/SingleValue';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\nimport { FiltersListAddButton } from './index';\r\n\r\ninterface BooleanFilterEditState {\r\n\tvalue: string;\r\n\tdisplayValidationError: boolean;\r\n}\r\n\r\n/**\r\n * Configures a boolean filter\r\n */\r\nclass BooleanFilterEdit extends React.PureComponent<StringFilterEditProps, BooleanFilterEditState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\t// we need to store state locally as we will modify the state depending on whether\r\n\t\t// the field is nullable or not, to avoid giving users a choice they can't make.\r\n\t\tthis.state = {\r\n\t\t\tvalue: 'true',\r\n\t\t\tdisplayValidationError: false,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Updates local state when the selection is made and lets the parent know that state needs to be updated.\r\n\t *\r\n\t * @private\r\n\t * @memberof BooleanFilterEdit\r\n\t */\r\n\tprivate handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tconst newValue = e.currentTarget.value;\r\n\t\tthis.setState({ value: newValue });\r\n\t};\r\n\r\n\t/**\r\n\t * Handles form submit.\r\n\t *\r\n\t * @private\r\n\t * @memberof BooleanFilterEdit\r\n\t */\r\n\tprivate handleSubmit = () => {\r\n\t\tconst trimmedValue = this.state.value.trim();\r\n\r\n\t\tconst validationError = !this.props.filter.nullable && !trimmedValue;\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tif (validationError) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.props.onChange(this.state.value, false);\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t<Input id=\"fieldValue\" type=\"select\" autoFocus value={this.state.value} onChange={this.handleOnChange}>\r\n\t\t\t\t\t{this.props.filter.nullable ? <option value=\"\">&lt;Empty&gt;</option> : null}\r\n\t\t\t\t\t<option value=\"true\">Yes</option>\r\n\t\t\t\t\t<option value=\"false\">No</option>\r\n\t\t\t\t</Input>\r\n\t\t\t\t<div className=\"filters-popover__actions\">\r\n\t\t\t\t\t<FiltersListAddButton onClick={this.handleSubmit} />\r\n\t\t\t\t</div>\r\n\t\t\t\t{this.state.displayValidationError ? (\r\n\t\t\t\t\t<FilterEditRequiredValidation messageOverride=\"Field is required\" />\r\n\t\t\t\t) : null}\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default BooleanFilterEdit;\r\n","import * as React from 'react';\r\nimport { FormGroup, Input } from 'reactstrap';\r\nimport { NumberFilterEditProps } from '../providers/SingleValue';\r\nimport { FiltersListAddButton } from './index';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\n\r\ntype SingleNumberFilterEditProps = NumberFilterEditProps & {\r\n\tstep?: string;\r\n};\r\n\r\ninterface SingleNumberFilterEditState {\r\n\tcurrentValue: string | null;\r\n\tdisplayValidationError: boolean;\r\n}\r\n\r\n/**\r\n * Configures a single number value in a filter. Used by Integer and Decimal field edit components.\r\n */\r\nclass SingleNumberFilterEdit extends React.PureComponent<SingleNumberFilterEditProps, SingleNumberFilterEditState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tcurrentValue: this.props.value ? this.props.value.toString() : '',\r\n\t\t\tdisplayValidationError: false,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Bubbles up state to the parent component.\r\n\t *\r\n\t * @private\r\n\t * @memberof SingleNumberFilterEdit\r\n\t */\r\n\tprivate handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tthis.setState({\r\n\t\t\tcurrentValue: e.currentTarget.value,\r\n\t\t});\r\n\t};\r\n\r\n\tprivate sendUpdatedValue = () => {\r\n\t\tconst { currentValue } = this.state;\r\n\r\n\t\tconst trimmedValue = currentValue ? currentValue.trim() : currentValue;\r\n\r\n\t\tconst validationError = !this.props.filter.nullable && !trimmedValue;\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tif (!validationError) {\r\n\t\t\tthis.props.onChange(this.state.currentValue, false);\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<FormGroup>\r\n\t\t\t\t\t<Input\r\n\t\t\t\t\t\tid=\"fieldValue\"\r\n\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\tstep={this.props.step}\r\n\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\tplaceholder={this.props.filter.nullable ? '<Empty>' : 'Enter a value to filter by'}\r\n\t\t\t\t\t\tvalue={this.state.currentValue || ''}\r\n\t\t\t\t\t\tonChange={this.handleOnChange}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</FormGroup>\r\n\t\t\t\t<div className=\"filters-popover__actions\">\r\n\t\t\t\t\t<FiltersListAddButton onClick={this.sendUpdatedValue} />\r\n\t\t\t\t</div>\r\n\t\t\t\t{this.state.displayValidationError ? (\r\n\t\t\t\t\t<FilterEditRequiredValidation messageOverride=\"Number field is required\" />\r\n\t\t\t\t) : null}{' '}\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default SingleNumberFilterEdit;\r\n","import * as React from 'react';\r\nimport { SingleNumberFilterEdit } from '.';\r\nimport { NumberFilterEditProps } from '../providers/SingleValue';\r\n\r\n/**\r\n * Configures a single decimal value in a filter\r\n */\r\nclass SingleDecimalFilterEdit extends React.PureComponent<NumberFilterEditProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn <SingleNumberFilterEdit {...this.props} step=\"0.01\" />;\r\n\t}\r\n}\r\n\r\nexport default SingleDecimalFilterEdit;\r\n","import * as React from 'react';\r\nimport SingleNumberFilterEdit from './SingleNumberFilterEdit';\r\nimport { NumberFilterEditProps } from '../providers/SingleValue';\r\n\r\n/**\r\n * Configures a single integer value in a filter\r\n */\r\nclass SingleIntegerFilterEdit extends React.PureComponent<NumberFilterEditProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn <SingleNumberFilterEdit {...this.props} />;\r\n\t}\r\n}\r\n\r\nexport default SingleIntegerFilterEdit;\r\n","import * as React from 'react';\r\nimport { Col, FormGroup, Input, Label, Row } from 'reactstrap';\r\nimport { RangedValueFilterEditProps } from '../providers/RangedValue';\r\nimport { FiltersListAddButton } from './index';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\n\r\nexport type RangedNumberFieldEditProps = RangedValueFilterEditProps & {\r\n\tstep?: string;\r\n};\r\n\r\nexport interface RangedNumberFieldEditState {\r\n\tfromValue: string;\r\n\ttoValue: string;\r\n\tdisplayValidationError: boolean;\r\n}\r\n\r\n/**\r\n * Configures a range of number values in a filter. Used by both Integer and Decimal field edit components.\r\n */\r\nclass RangedNumberFilterEdit extends React.PureComponent<RangedNumberFieldEditProps, RangedNumberFieldEditState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tfromValue: '',\r\n\t\t\ttoValue: '',\r\n\t\t\tdisplayValidationError: false,\r\n\t\t};\r\n\t}\r\n\r\n\tpublic componentDidMount() {\r\n\t\tlet fromValue = '';\r\n\t\tlet toValue = '';\r\n\r\n\t\tif (this.props.value) {\r\n\t\t\tfromValue = this.props.value.fromValue;\r\n\t\t\ttoValue = this.props.value.toValue;\r\n\r\n\t\t\t// eslint-disable-next-line\r\n\t\t\tthis.setState({\r\n\t\t\t\tfromValue,\r\n\t\t\t\ttoValue,\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Sends state changes up to the parent component\r\n\t *\r\n\t * @private\r\n\t * @memberof RangedNumberFieldEdit\r\n\t */\r\n\tprivate sendUpdatedValue = () => {\r\n\t\tconst { fromValue, toValue } = this.state;\r\n\r\n\t\tconst validationError = !this.props.filter.nullable && fromValue === '' && toValue === '';\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tif (!validationError) {\r\n\t\t\tthis.props.onChange({ fromValue, toValue }, false);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Updates local state for the from value field. Once that's done, it bubbles up the state changes.\r\n\t *\r\n\t * @private\r\n\t * @memberof RangedNumberFieldEdit\r\n\t */\r\n\tprivate handleFromValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tthis.setState({ fromValue: e.currentTarget.value });\r\n\t};\r\n\r\n\t/**\r\n\t * Updates local state for the to value field. Once that's done, it bubbles up the state changes.\r\n\t *\r\n\t * @private\r\n\t * @memberof RangedNumberFieldEdit\r\n\t */\r\n\tprivate handleToValueChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tthis.setState({ toValue: e.currentTarget.value });\r\n\t};\r\n\r\n\t/**\r\n\t * Allow users to hit enter to add new values.\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFieldEdit\r\n\t */\r\n\tprivate handleOnKeyDown = (e: React.KeyboardEvent) => {\r\n\t\tif (e.which === 13) {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.sendUpdatedValue();\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t<Row>\r\n\t\t\t\t\t<Col sm={6}>\r\n\t\t\t\t\t\t<Label for=\"fieldValueFrom\">From:</Label>\r\n\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\tid=\"fieldValueFrom\"\r\n\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\t\tstep={this.props.step}\r\n\t\t\t\t\t\t\tplaceholder={this.props.filter.nullable ? '<Empty>' : 'Enter a value'}\r\n\t\t\t\t\t\t\tvalue={this.state.fromValue}\r\n\t\t\t\t\t\t\tonChange={this.handleFromValueChange}\r\n\t\t\t\t\t\t\tonKeyDown={this.handleOnKeyDown}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</Col>\r\n\t\t\t\t\t<Col sm={6}>\r\n\t\t\t\t\t\t<Label for=\"fieldValueTo\">To:</Label>\r\n\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\tid=\"fieldValueTo\"\r\n\t\t\t\t\t\t\ttype=\"number\"\r\n\t\t\t\t\t\t\tstep={this.props.step}\r\n\t\t\t\t\t\t\tplaceholder={this.props.filter.nullable ? '<Empty>' : 'Enter a value'}\r\n\t\t\t\t\t\t\tvalue={this.state.toValue}\r\n\t\t\t\t\t\t\tonChange={this.handleToValueChange}\r\n\t\t\t\t\t\t\tonKeyDown={this.handleOnKeyDown}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</Col>\r\n\t\t\t\t</Row>\r\n\t\t\t\t<div className=\"filters-popover__actions\">\r\n\t\t\t\t\t<FiltersListAddButton onClick={this.sendUpdatedValue} />\r\n\t\t\t\t</div>\r\n\t\t\t\t{this.state.displayValidationError ? (\r\n\t\t\t\t\t<FilterEditRequiredValidation messageOverride=\"Number field is required\" />\r\n\t\t\t\t) : null}\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default RangedNumberFilterEdit;\r\n","import * as React from 'react';\r\nimport RangedNumberFilterEdit from './RangedNumberFilterEdit';\r\nimport { RangedValueFilterEditProps } from '../providers/RangedValue';\r\n\r\ninterface RangedDecimalFieldEditState {\r\n\tfromValue: string;\r\n\ttoValue: string;\r\n}\r\n\r\n/**\r\n * Configures a range of decimal values in a filter\r\n */\r\nclass RangedDecimalFilterEdit extends React.PureComponent<RangedValueFilterEditProps, RangedDecimalFieldEditState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn <RangedNumberFilterEdit {...this.props} step=\"0.01\" />;\r\n\t}\r\n}\r\n\r\nexport default RangedDecimalFilterEdit;\r\n","import * as React from 'react';\r\nimport { RangedNumberFilterEdit } from '.';\r\nimport { RangedValueFilterEditProps } from '../providers/RangedValue';\r\n\r\ninterface RangedDecimalFieldEditState {\r\n\tfromValue: string;\r\n\ttoValue: string;\r\n}\r\n\r\n/**\r\n * Configures a range of integer values in a filter\r\n */\r\nclass RangedIntegerFilterEdit extends React.PureComponent<RangedValueFilterEditProps, RangedDecimalFieldEditState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn <RangedNumberFilterEdit {...this.props} step=\"1\" />;\r\n\t}\r\n}\r\n\r\nexport default RangedIntegerFilterEdit;\r\n","import * as React from 'react';\r\nimport { ButtonGroup } from 'reactstrap';\r\n\r\ninterface FilterButtonGroupProps {\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Component for filter list field group\r\n */\r\nexport default function FiltersListButtonGroup(props: FilterButtonGroupProps) {\r\n\treturn (\r\n\t\t<ButtonGroup size=\"sm\" className=\"filters-list-item\">\r\n\t\t\t{props.children}\r\n\t\t</ButtonGroup>\r\n\t);\r\n}\r\n","import * as React from 'react';\r\nimport { Button } from 'reactstrap';\r\n\r\ninterface FilterValueButtonProps {\r\n\tonClick?: () => void;\r\n\tid?: string;\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Component for filter item btn values\r\n *\r\n */\r\nexport default function FiltersListValueButton(props: FilterValueButtonProps) {\r\n\treturn (\r\n\t\t<Button\r\n\t\t\tid={props.id}\r\n\t\t\tonClick={props.onClick}\r\n\t\t\tclassName=\"filters-list-item__name-btn\"\r\n\t\t\ttype=\"button\"\r\n\t\t\tdata-testid=\"filter-list-value-button\"\r\n\t\t>\r\n\t\t\t{props.children}\r\n\t\t</Button>\r\n\t);\r\n}\r\n","import * as React from 'react';\r\nimport { Button } from 'reactstrap';\r\nimport XSVG from 'components/shared/svg/XSVG';\r\nimport { FilterButtonProps } from '.';\r\n\r\n/**\r\n * Component for filter item close buttons\r\n */\r\nexport default function FiltersListCloseButton(props: FilterButtonProps) {\r\n\treturn (\r\n\t\t<Button onClick={props.onClick} type=\"button\" className=\"filters-list-item__close-btn\">\r\n\t\t\t<XSVG class=\"filters-list-item__close-icon\" />\r\n\t\t</Button>\r\n\t);\r\n}\r\n","import { AutoSuggestValue } from '../providers/AutoSuggestValue';\r\nimport { NotNullValueLabel, NotNullValue, NullValueLabel, NullValue } from '../providers/Constants';\r\n\r\nexport { default as SingleTextFilterEdit } from './SingleTextFilterEdit';\r\nexport { default as BooleanFilterEdit } from './BooleanFilterEdit';\r\n\r\nexport { default as SingleNumberFilterEdit } from './SingleNumberFilterEdit';\r\nexport { default as SingleDecimalFilterEdit } from './SingleDecimalFilterEdit';\r\nexport { default as SingleIntegerFilterEdit } from './SingleIntegerFilterEdit';\r\n\r\nexport { default as RangedNumberFilterEdit } from './RangedNumberFilterEdit';\r\nexport { default as RangedDecimalFilterEdit } from './RangedDecimalFilterEdit';\r\nexport { default as RangedIntegerFilterEdit } from './RangedIntegerFilterEdit';\r\n\r\nexport { default as FiltersListButtonGroup } from './FiltersListButtonGroup';\r\nexport { default as FiltersListValueButton } from './FiltersListValueButton';\r\nexport { default as FiltersListCloseButton } from './FiltersListCloseButton';\r\nexport { default as FiltersListAddButton } from './FiltersListAddButton';\r\n\r\nexport interface FilterButtonProps {\r\n\tonClick: () => void;\r\n}\r\n\r\nexport const AnyValueAutoSuggestValue: AutoSuggestValue = {\r\n\tlabel: NotNullValueLabel,\r\n\tvalue: NotNullValue,\r\n};\r\n\r\nexport const NoValueAutoSuggestValue: AutoSuggestValue = {\r\n\tlabel: NullValueLabel,\r\n\tvalue: NullValue,\r\n};\r\n","import * as React from 'react';\r\nimport { Field } from 'react-final-form';\r\n\r\ninterface OnFieldValueChangeProps {\r\n\tchildren: (props: OnFieldValueChangeChildrenProps) => React.ReactNode;\r\n\tfield: string;\r\n}\r\n\r\ninterface OnFieldValueChangeChildrenProps {\r\n\tvalue: any;\r\n}\r\n\r\n/**\r\n * Component that gives you the value of a field whenever it changes\r\n *\r\n * @class WhenFieldChanges\r\n * @extends {React.Component<OnFieldValueChangeProps>}\r\n */\r\nclass OnFieldValueChange extends React.Component<OnFieldValueChangeProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst { field } = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t// in react-final-form, <Field /> is really just a subscription to a specific field, based on `name`\r\n\t\t\t// this is pretty much the same as a <FormSpy /> but for a specific field only.\r\n\t\t\t<Field name={field} subscription={{ value: true }}>\r\n\t\t\t\t{(props) => {\r\n\t\t\t\t\tconst {\r\n\t\t\t\t\t\tinput: { value },\r\n\t\t\t\t\t} = props;\r\n\r\n\t\t\t\t\treturn this.props.children({ value });\r\n\t\t\t\t}}\r\n\t\t\t</Field>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default OnFieldValueChange;\r\n","import * as React from 'react';\r\nimport { getFilterType } from './providers';\r\nimport { SelectedFilter } from '.';\r\nimport { FiltersListButtonGroup, FiltersListValueButton, FiltersListCloseButton } from './editors';\r\nimport { FilterChangeLocation } from '../ListingContainer';\r\n\r\ninterface SelectedFiltersProps {\r\n\tselectedFields: SelectedFilter[];\r\n\tbeginFilterChange: (selectedFilter: SelectedFilter, location: FilterChangeLocation) => void;\r\n\tonRemoveField: (selectedFilter: SelectedFilter, stopEditing: boolean) => void;\r\n}\r\n\r\n/**\r\n * Component that displays a list of selected filters and their corresponding values.\r\n */\r\nclass SelectedFilters extends React.Component<SelectedFiltersProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\t/**\r\n\t * Uses the provider model to dynamically return friendly value text for a specific component.\r\n\t *\r\n\t * @private\r\n\t * @param {SelectedFilter} selectedFilter\r\n\t * @returns\r\n\t * @memberof SelectedFilters\r\n\t */\r\n\tprivate getValueDisplayByType(selectedFilter: SelectedFilter) {\r\n\t\treturn getFilterType(selectedFilter.type).getFriendlyValueForDisplay(\r\n\t\t\tselectedFilter.value,\r\n\t\t\tselectedFilter.options,\r\n\t\t);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn this.props.selectedFields\r\n\t\t\t.filter((f) => !f.implicit)\r\n\t\t\t.map((selectedFilter, index) => {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<React.Fragment key={index}>\r\n\t\t\t\t\t\t<FiltersListButtonGroup>\r\n\t\t\t\t\t\t\t<FiltersListValueButton\r\n\t\t\t\t\t\t\t\tid={`Filters_${selectedFilter.name}_Popover`}\r\n\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\tthis.props.beginFilterChange(selectedFilter, FilterChangeLocation.SelectedFilter);\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<strong>{selectedFilter.displayName}:</strong>{' '}\r\n\t\t\t\t\t\t\t\t{this.getValueDisplayByType(selectedFilter) || '<Any>'}\r\n\t\t\t\t\t\t\t</FiltersListValueButton>\r\n\t\t\t\t\t\t\t{!selectedFilter.permanent ? (\r\n\t\t\t\t\t\t\t\t<FiltersListCloseButton\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tthis.props.onRemoveField(selectedFilter, true);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t</FiltersListButtonGroup>\r\n\t\t\t\t\t</React.Fragment>\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t}\r\n}\r\n\r\nexport default SelectedFilters;\r\n","import React from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\nimport useDelayedDisplay from './hooks/useDelayedDisplay';\r\n\r\ninterface SpinnerProps extends WithTestIdOptional {\r\n\twaitMs: number;\r\n}\r\n\r\n/**\r\n * Spinner SVG for loading purposes\r\n *\r\n * @returns\r\n */\r\nfunction CenterSpinner(props: SpinnerProps) {\r\n\tconst display = useDelayedDisplay(props.waitMs);\r\n\tconst testId = `spinner-${props.testId ? props.testId : 'center'}`;\r\n\r\n\tif (!display) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t<div className=\"center-spinner\">\r\n\t\t\t<div className=\"center-spinner__box\">\r\n\t\t\t\t<div className=\"center-spinner__spinner\" data-testid={testId}>\r\n\t\t\t\t\t<div className=\"center-spinner__cube1\" />\r\n\t\t\t\t\t<div className=\"center-spinner__cube2\" />\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\nCenterSpinner.defaultProps = {\r\n\twaitMs: 200,\r\n};\r\n\r\nexport default React.memo(CenterSpinner);\r\n","import AppState from 'AppState';\r\nimport * as React from 'react';\r\nimport { EntityDefinition } from 'types';\r\nimport HelpSVG from '../svg/HelpSVG';\r\n\r\ninterface ListingHelpButtonProps {\r\n\tentityDefinition: EntityDefinition;\r\n\tcontainerClassNames?: string;\r\n\tlinkClassNames?: string;\r\n\ticonClassNames?: string;\r\n}\r\n\r\n/**\r\n * Help button to be display on the listing and edit page\r\n */\r\nfunction ListingHelpButton(props: ListingHelpButtonProps) {\r\n\tconst { entityDefinition, linkClassNames, containerClassNames, iconClassNames } = props;\r\n\r\n\tif (entityDefinition.documentUrlKey == null) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst helpUrl = AppState.documentUrls[entityDefinition.documentUrlKey];\r\n\r\n\tif (helpUrl == null || helpUrl === '') {\r\n\t\treturn null;\r\n\t}\r\n\r\n\treturn (\r\n\t\t<div className={containerClassNames}>\r\n\t\t\t<a\r\n\t\t\t\thref={helpUrl}\r\n\t\t\t\tclassName={linkClassNames}\r\n\t\t\t\ttarget=\"_blank\"\r\n\t\t\t\trel=\"noopener noreferrer\"\r\n\t\t\t\tdata-testid=\"view-docs-btn\"\r\n\t\t\t>\r\n\t\t\t\t<HelpSVG class={iconClassNames} />\r\n\t\t\t\t<span className=\"visually-hidden\">View documentation for {entityDefinition.pluralName}</span>\r\n\t\t\t</a>\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\nexport default ListingHelpButton;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Right chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction RightChevronSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg viewBox=\"0 0 19 32\" className={'icon ' + svgProps.class} focusable=\"false\" aria-hidden=\"true\">\r\n\t\t\t<path d=\"M0.738 4.109c-0.457-0.427-0.742-1.034-0.742-1.707s0.285-1.28 0.741-1.705l0.001-0.001c0.467-0.437 1.097-0.705 1.789-0.705s1.322 0.268 1.79 0.706l-0.002-0.001 14.146 13.598c0.457 0.427 0.742 1.034 0.742 1.707s-0.285 1.279-0.741 1.705l-0.001 0.001-14.142 13.589c-0.468 0.436-1.097 0.704-1.79 0.704s-1.322-0.268-1.791-0.706l0.002 0.001c-0.457-0.427-0.742-1.034-0.742-1.707s0.285-1.279 0.741-1.705l0.001-0.001 11.597-11.883z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nRightChevronSVG.defaultProps = { class: '' };\r\n\r\nexport default RightChevronSVG;\r\n","import ErrorAlert from 'components/shared/ErrorAlert';\r\nimport * as React from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\nimport { AutoSuggestDataRenderProps } from './AutoSuggestData';\r\nimport AutoSuggestMenu from './AutoSuggestMenu';\r\nimport { AutoSuggestRenderMenuProps } from './Types';\r\n\r\nexport interface AutoSuggestBaseProps extends WithTestIdOptional {\r\n\tdata: AutoSuggestDataRenderProps;\r\n\tonCreateClick: () => Promise<void>;\r\n\trenderMenu: (props: AutoSuggestRenderMenuProps) => React.ReactNode;\r\n}\r\n\r\n/**\r\n * Renders everything that requires AutoSuggestData.\r\n *\r\n * @class AutoSuggestBase\r\n * @extends {React.Component<AutoSuggestBaseProps>}\r\n */\r\nclass AutoSuggestBase extends React.Component<AutoSuggestBaseProps> {\r\n\tpublic static defaultProps = {\r\n\t\trenderMenu: (props: AutoSuggestRenderMenuProps) => <AutoSuggestMenu {...props} />,\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst { data, onCreateClick, renderMenu, testId } = this.props;\r\n\r\n\t\tif (data.errorStatus) {\r\n\t\t\tif (data.errorStatus === 403) {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<ErrorAlert\r\n\t\t\t\t\t\ttestId=\"error-alert\"\r\n\t\t\t\t\t\tmessage=\"You do not have permission to view these values. Please contact an administrator.\"\r\n\t\t\t\t\t\terror={null}\r\n\t\t\t\t\t/>\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\treturn <ErrorAlert error={null} />;\r\n\t\t}\r\n\r\n\t\treturn renderMenu({ data: data, onCreateClick: onCreateClick, testId });\r\n\t}\r\n}\r\n\r\nexport default AutoSuggestBase;\r\n","import AppState from 'AppState';\r\nimport * as React from 'react';\r\nimport { Input, InputGroup, Label } from 'reactstrap';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport TooltipWrapper from '../tooltip/TooltipWrapper';\r\nimport AutoSuggestContext, { AutoSuggestContextValue } from './AutoSuggestContext';\r\nimport AutoSuggestInputActions from './AutoSuggestInputActions';\r\nimport { AutoSuggestRenderInputProps } from './Types';\r\n\r\n/**\r\n * Renders the input fields for a user to enter values to search within the AutoSuggest.\r\n *\r\n * @class AutoSuggestInput\r\n * @extends {React.Component<{}>}\r\n */\r\nclass AutoSuggestInput extends React.Component<AutoSuggestRenderInputProps> {\r\n\tpublic static contextType: React.Context<any> = AutoSuggestContext;\r\n\tpublic declare context: AutoSuggestContextValue;\r\n\r\n\tpublic static defaultProps = {\r\n\t\tlabelVisible: true,\r\n\t\tforceEmptyLabel: false,\r\n\t\tclearable: true,\r\n\t};\r\n\r\n\t/**\r\n\t * Display the list of results on focus.\r\n\t *\r\n\t * @memberof AutoSuggestInput\r\n\t */\r\n\tpublic handleOnFocus = () => {\r\n\t\tconst {\r\n\t\t\tautoSuggestOptions: { expandOnClick = true },\r\n\t\t\tdownshift: { toggleMenu },\r\n\t\t} = this.context;\r\n\r\n\t\tif (expandOnClick) {\r\n\t\t\ttoggleMenu();\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tname,\r\n\t\t\tdownshift: { getInputProps, getLabelProps },\r\n\t\t} = this.context;\r\n\r\n\t\tconst labelProps = getLabelProps();\r\n\r\n\t\tconst {\r\n\t\t\tlabel,\r\n\t\t\tplaceholder,\r\n\t\t\tdisabled,\r\n\t\t\tforceEmptyLabel,\r\n\t\t\tclearable,\r\n\t\t\ttestId,\r\n\t\t\ttooltipText,\r\n\t\t\tnameValue = '',\r\n\t\t\ttooltipData,\r\n\t\t\tentityDefinition,\r\n\t\t\thasTooltipError = false,\r\n\t\t} = this.props;\r\n\r\n\t\tconst isTooltipEditMode = AppState.user.isTooltipEditMode;\r\n\r\n\t\t// eslint-disable-next-line no-unused-vars\r\n\t\tconst { type, ref, ...inputProps } = getInputProps({ name, 'aria-labelledby': `label-${labelProps.id}` });\r\n\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<Label htmlFor={name} {...labelProps} className={forceEmptyLabel ? 'visually-hidden' : ''}>\r\n\t\t\t\t\t<span className=\"form-label-icon-wrapper\">\r\n\t\t\t\t\t\t<span className=\"form-label-text\">{label}</span>\r\n\r\n\t\t\t\t\t\t{tooltipText !== undefined && tooltipText !== null && tooltipData && entityDefinition ? (\r\n\t\t\t\t\t\t\t<div className=\"tooltip__row\">\r\n\t\t\t\t\t\t\t\t<TooltipWrapper\r\n\t\t\t\t\t\t\t\t\thasTooltipError={hasTooltipError}\r\n\t\t\t\t\t\t\t\t\ttooltipText={tooltipText}\r\n\t\t\t\t\t\t\t\t\tnameValue={nameValue}\r\n\t\t\t\t\t\t\t\t\tisTooltipEditMode={isTooltipEditMode}\r\n\t\t\t\t\t\t\t\t\ttooltipData={tooltipData}\r\n\t\t\t\t\t\t\t\t\tentityDefinition={entityDefinition}\r\n\t\t\t\t\t\t\t\t\tlabel={this.props.label}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</Label>\r\n\t\t\t\t<InputGroup>\r\n\t\t\t\t\t<Input\r\n\t\t\t\t\t\tclassName=\"form-control--cancel-next\"\r\n\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\tautoComplete=\"new-password\"\r\n\t\t\t\t\t\tplaceholder={placeholder || 'Begin typing to search...'}\r\n\t\t\t\t\t\tonFocus={this.handleOnFocus}\r\n\t\t\t\t\t\tinvalid={false}\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\tdata-testid={testId || `field-${toKebabCase(name)}`}\r\n\t\t\t\t\t\tonKeyPress={(e) => {\r\n\t\t\t\t\t\t\te.key === 'Enter' && e.preventDefault();\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t{...inputProps}\r\n\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t<AutoSuggestInputActions clearable={clearable} name={name} disabled={disabled} />\r\n\t\t\t\t</InputGroup>\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default AutoSuggestInput;\r\n","import * as React from 'react';\r\nimport { AutoSuggestMenuItemRenderProps } from './Types';\r\nimport { stripHtml } from 'util/StringUtil';\r\nimport { ModelStatus } from '../../../../../Roc.SharedClientApp/types/model-status';\r\n\r\nconst getClassByStatus = (status: ModelStatus): string => {\r\n\tswitch (status) {\r\n\t\tcase ModelStatus.Deleted:\r\n\t\t\treturn 'autosuggest-menu__text--deleted';\r\n\t\tcase ModelStatus.Archived:\r\n\t\t\treturn 'autosuggest-menu__text--archived';\r\n\t}\r\n\r\n\t// for published, or others\r\n\treturn '#000';\r\n};\r\n\r\n/**\r\n * Renders the contents of a single AutoSuggest item.\r\n *\r\n * @class AutoSuggestMenuItem\r\n * @extends {React.Component<AutoSuggestMenuItemRenderProps>}\r\n */\r\nconst AutoSuggestMenuItem: React.SFC<AutoSuggestMenuItemRenderProps> = ({ item }) => {\r\n\tif (item.status && item.status !== ModelStatus.Published) {\r\n\t\treturn (\r\n\t\t\t<span className={getClassByStatus(item.status)}>\r\n\t\t\t\t{item.label} ({item.status})\r\n\t\t\t</span>\r\n\t\t);\r\n\t}\r\n\r\n\treturn <>{stripHtml(item.label)}</>;\r\n};\r\n\r\nexport default AutoSuggestMenuItem;\r\n","import * as React from 'react';\r\nimport { withRouter, RouteComponentProps } from 'react-router-dom';\r\n\r\nexport type Location = null | {\r\n\tpathname: string;\r\n\tsearch: string;\r\n};\r\n\r\nlet lastLocation: Location = null;\r\nlet currentLocation: Location = null;\r\n\r\ntype LastLocationProviderProps = RouteComponentProps<any>;\r\n\r\n/**\r\n * Stores changes to the route so that we can get a reference to the previous path and query\r\n * that the user was on. This is not currently supported by react router out of the box.\r\n *\r\n * @class LastLocationProvider\r\n * @extends {React.Component<LastLocationProviderProps, {}>}\r\n */\r\nclass LastLocationProvider extends React.Component<LastLocationProviderProps, unknown> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {};\r\n\t}\r\n\r\n\t/**\r\n\t * No state is being set, this is just a handy way of updating values after\r\n\t * props change, since componentWillReceiveProps is deprecated.\r\n\t *\r\n\t * @static\r\n\t * @returns\r\n\t * @memberof LastLocationProvider\r\n\t */\r\n\tpublic static getDerivedStateFromProps(props) {\r\n\t\t// skip last location when dealing with culture redirects.\r\n\t\tif (props.location.state && props.location.state.redirectCulture) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tif (currentLocation) {\r\n\t\t\tlastLocation = currentLocation;\r\n\t\t}\r\n\r\n\t\tcurrentLocation = {\r\n\t\t\tpathname: location.pathname,\r\n\t\t\tsearch: location.search,\r\n\t\t};\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn null;\r\n\t}\r\n}\r\n\r\nexport const getLastLocation = (): Location => lastLocation;\r\n\r\nexport default withRouter(LastLocationProvider);\r\n","enum EditRequestSource {\r\n\tDefault = 'Default',\r\n\tSuggest = 'Suggest',\r\n}\r\n\r\nexport default EditRequestSource;\r\n","import { AutoSuggestParams, AutoSuggestResponse } from 'components/shared/auto-suggest/Types';\r\nimport { NotNullValue, NullValue } from 'components/shared/list/filters/providers/Constants';\r\nimport EditRequestSource from '../types/__models__/EditRequestSource';\r\nimport AxiosHelper from './AxiosHelper';\r\n\r\nclass AutoSuggestService {\r\n\tprivate baseUrl: string;\r\n\tprivate suggestSlug: string;\r\n\r\n\tconstructor(baseUrl: string, suggestSlugOverride) {\r\n\t\tthis.baseUrl = baseUrl;\r\n\t\tthis.suggestSlug = suggestSlugOverride || '/suggest';\r\n\t}\r\n\r\n\t/**\r\n\t * Gets autosuggest options from the server based on user input\r\n\t * @param query The value typed by the user used to filter the results on the server\r\n\t *  searched that will not be included in the response\r\n\t */\r\n\tpublic async getOptions(query: string, params?: AutoSuggestParams): Promise<AutoSuggestResponse> {\r\n\t\tconst url = this.baseUrl + this.suggestSlug;\r\n\t\tconst values: any = { ...params };\r\n\r\n\t\tif (query) {\r\n\t\t\tvalues.filter = query;\r\n\t\t}\r\n\r\n\t\tif (params && Array.isArray(params.ignoredIds) && params.ignoredIds.length > 0) {\r\n\t\t\tvalues.ignoredIds = params.ignoredIds.filter((i) => i !== NotNullValue && i !== NullValue);\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post<AutoSuggestResponse>(url, values);\r\n\r\n\t\t\tresponse.data.records = response.data.records.map((record) => {\r\n\t\t\t\trecord.isNewValue = true;\r\n\t\t\t\treturn record;\r\n\t\t\t});\r\n\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tthrow error;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Creates a new entity based on user input in an AutoSuggest field\r\n\t * @param value The model that should be posted to the server\r\n\t */\r\n\tpublic async createFromUserInput(value: any): Promise<any> {\r\n\t\tif (value) {\r\n\t\t\tvalue.editRequestSource = EditRequestSource.Suggest;\r\n\t\t}\r\n\t\tconsole.log('Creating:', value);\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post(this.baseUrl, value);\r\n\t\t\treturn response.data;\r\n\t\t} catch (error) {\r\n\t\t\tthrow error;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default AutoSuggestService;\r\n","import * as React from 'react';\r\nimport isEqual from 'react-fast-compare';\r\nimport debounce from 'lodash-es/debounce';\r\nimport { AutoSuggestService } from 'services';\r\nimport { AutoSuggestItem, AutoSuggestParams } from './Types';\r\nimport AutoSuggestContext, { AutoSuggestContextValue } from './AutoSuggestContext';\r\n\r\nexport interface AutoSuggestDataState {\r\n\tresults: any[];\r\n\tisLoading: boolean;\r\n\terrorStatus: number | null;\r\n\thasMore: boolean;\r\n}\r\n\r\nexport interface AutoSuggestDataParams {\r\n\tselectedItems?: AutoSuggestItem[];\r\n}\r\n\r\nexport type AutoSuggestDataRenderProps = AutoSuggestDataState & {\r\n\tcreateValue: (inputValue) => Promise<any>;\r\n};\r\n\r\nexport interface AutoSuggestDataProps {\r\n\tselectedItems?: AutoSuggestItem[];\r\n\tquery: string | null;\r\n\tchildren: (props: AutoSuggestDataRenderProps) => React.ReactNode;\r\n\tparams?: AutoSuggestParams;\r\n}\r\n\r\n/**\r\n * Component responsible for loading AutoSuggest data from the provided endpoint.\r\n *\r\n * @class AutoSuggestData\r\n * @extends {React.Component<AutoSuggestDataProps, AutoSuggestDataState>}\r\n */\r\nclass AutoSuggestData extends React.Component<AutoSuggestDataProps, AutoSuggestDataState> {\r\n\tpublic static contextType: React.Context<any> = AutoSuggestContext;\r\n\tpublic declare context: AutoSuggestContextValue;\r\n\tpublic mounted: boolean = false;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tresults: [],\r\n\t\t\tisLoading: false,\r\n\t\t\terrorStatus: null,\r\n\t\t\thasMore: false,\r\n\t\t};\r\n\r\n\t\tthis.getResultsDebounced = debounce(this.getResults, 200);\r\n\t}\r\n\r\n\t/**\r\n\t * Refresh on mount.\r\n\t *\r\n\t * @memberof AutoSuggestData\r\n\t */\r\n\tpublic componentDidMount(): void {\r\n\t\tthis.mounted = true;\r\n\r\n\t\t/*\r\n         we conditionally render this component when downshift isOpen = true\r\n\t\t that means that this'll run when the autosuggest dropdown first shows up.\r\n\t\t this could be from focusing and hitting the down arrow or just clicking\r\n         the toggle button.\r\n         */\r\n\t\tthis.refreshDataDebounced();\r\n\t}\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\tthis.mounted = false;\r\n\t}\r\n\r\n\t/**\r\n\t * This lifecycle function is called after a component is done updating.\r\n\t * For us, this is when the parent changes (typed something into the input)\r\n\t * or when isOpen becomes true, which causes this component to render.\r\n\t * @param param0\r\n\t * @param prevState\r\n\t */\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic componentDidUpdate({ children: _, ...prevProps }): void {\r\n\t\t// eslint-disable-next-line no-unused-vars\r\n\t\tconst { children, ...props } = this.props;\r\n\r\n\t\t/*\r\n\t\t important to check props to not change state every time as this can\r\n\t\t cause an endless loop (state causes update, which updates state, ...)\r\n\t\t the default value for data is undefined. we set it to [] here so that\r\n\t\t we know that this isn't the first time we call. this is useful because\r\n\t\t prevProps and props will match on first load, which means we can't\r\n         do a query if there's no value entered in the input.\r\n        */\r\n\t\tif (!isEqual(prevProps, props) || !this.state.results) {\r\n\t\t\t// eslint-disable-next-line\r\n\t\t\tthis.setState({ results: [] });\r\n\t\t\tthis.refreshDataDebounced();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate getResultsDebounced: any = null;\r\n\r\n\t/**\r\n\t * Queues a data refresh, which will be debounced\r\n\t */\r\n\tprivate refreshDataDebounced = (): void => {\r\n\t\tthis.setState({ isLoading: true });\r\n\t\tthis.getResultsDebounced();\r\n\t};\r\n\r\n\t/**\r\n\t * Creates a new value on the server\r\n\t * The type here is `any` because it may be customized via `createNewValueAutoSuggestObject`\r\n\t */\r\n\tprivate createValue = async (inputValue): Promise<any> => {\r\n\t\tconsole.log('Creating value on server:', inputValue);\r\n\r\n\t\tlet newValue: any = null;\r\n\r\n\t\tconst { autoSuggestOptions } = this.context;\r\n\r\n\t\tif (!autoSuggestOptions.baseUrl) {\r\n\t\t\t// this should never happen as we assert auto suggest options at the top level components.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// allow consumers to define the default object by passing a function\r\n\t\tif (typeof autoSuggestOptions.createNewValueObject === 'function') {\r\n\t\t\tnewValue = autoSuggestOptions.createNewValueObject(inputValue);\r\n\t\t} else {\r\n\t\t\t// if they haven't provided a function, let's just create it with a name field and any params.\r\n\t\t\tnewValue = { name: inputValue, ...autoSuggestOptions.params };\r\n\t\t}\r\n\r\n\t\tconst { entity } = await new AutoSuggestService(\r\n\t\t\tautoSuggestOptions.baseUrl,\r\n\t\t\tautoSuggestOptions.suggestSlugOverride,\r\n\t\t).createFromUserInput(newValue);\r\n\r\n\t\tif (!this.mounted) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconsole.debug('Created value:', entity);\r\n\r\n\t\tlet newAutoSuggestValue: any = null;\r\n\r\n\t\t// when the value comes back from the server, it may not have name/id fields.\r\n\t\t// in that case, consumers must pass a function to map this to a new object.\r\n\t\tif (typeof autoSuggestOptions.createNewValueAutoSuggestObject === 'function') {\r\n\t\t\tnewAutoSuggestValue = autoSuggestOptions.createNewValueAutoSuggestObject(entity);\r\n\t\t} else {\r\n\t\t\t// by default, assume name/id are present. rename them to label/value respectively.\r\n\t\t\tconst { name: label, id: value, ...rest } = entity;\r\n\t\t\tnewAutoSuggestValue = { label, value, ...rest };\r\n\t\t}\r\n\r\n\t\treturn newAutoSuggestValue;\r\n\t};\r\n\r\n\t/**\r\n\t * Loads results from the AutoSuggest endpoint specified in props.\r\n\t */\r\n\tprivate getResults = async (): Promise<void> => {\r\n\t\tif (!this.mounted) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.setState({\r\n\t\t\tisLoading: true,\r\n\t\t\terrorStatus: null,\r\n\t\t});\r\n\r\n\t\tconsole.debug('Loading AutoSuggest Data...');\r\n\r\n\t\tconst {\r\n\t\t\tautoSuggestOptions: { baseUrl, suggestSlugOverride },\r\n\t\t} = this.context;\r\n\r\n\t\tif (!baseUrl) {\r\n\t\t\t// this should never happen as we assert auto suggest options at the top level components.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst { selectedItems, query, params = {} } = this.props;\r\n\r\n\t\t// get list of unique values to ignore from autosuggest, to avoid getting duplicates.\r\n\t\tconst selectedItemIds = selectedItems && selectedItems.map((item) => item.value.toString());\r\n\t\tconst ids: string[] = !Array.isArray(params.ignoredIds) ? [] : params.ignoredIds;\r\n\r\n\t\tif (selectedItemIds) {\r\n\t\t\tselectedItemIds.filter((id) => !ids.find((i) => i === id)).forEach((id) => ids.push(id));\r\n\t\t}\r\n\t\tparams.ignoredIds = ids;\r\n\r\n\t\ttry {\r\n\t\t\tconst options = await new AutoSuggestService(baseUrl, suggestSlugOverride).getOptions(query || '', params);\r\n\r\n\t\t\tif (!this.mounted) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setState({\r\n\t\t\t\tresults: options.records,\r\n\t\t\t\thasMore: options.hasMore,\r\n\t\t\t\tisLoading: false,\r\n\t\t\t\terrorStatus: null,\r\n\t\t\t});\r\n\t\t} catch (error) {\r\n\t\t\tif (!this.mounted) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tthis.setState({\r\n\t\t\t\tresults: [],\r\n\t\t\t\tisLoading: false,\r\n\t\t\t\terrorStatus: error.response.status,\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst { children } = this.props;\r\n\t\tconst { results, isLoading, errorStatus, hasMore } = this.state;\r\n\r\n\t\treturn children({\r\n\t\t\tresults,\r\n\t\t\tisLoading,\r\n\t\t\terrorStatus,\r\n\t\t\thasMore,\r\n\t\t\tcreateValue: this.createValue,\r\n\t\t});\r\n\t}\r\n}\r\n\r\nexport default AutoSuggestData;\r\n","import React from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\n\r\ninterface EditStatusLabelProps extends WithTestIdOptional {\r\n\tlabel: string;\r\n\tvalue: any;\r\n}\r\n\r\nfunction EditStatusLabel({ label, value, testId }: EditStatusLabelProps) {\r\n\tconst emProps = {\r\n\t\t...(testId && { 'data-testid': `status-label-${testId}` }),\r\n\t};\r\n\r\n\treturn value ? (\r\n\t\t<>\r\n\t\t\t<strong>{label + ': '}</strong>\r\n\t\t\t<em {...emProps}>{value}</em>\r\n\t\t\t<br />\r\n\t\t</>\r\n\t) : null;\r\n}\r\n\r\nexport default React.memo(EditStatusLabel);\r\n","import * as React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { InputProps } from '.';\r\nimport Input from './Input';\r\n\r\n/**\r\n * Component that renders a Reactstrap input\r\n *\r\n * @class TextBox\r\n * @extends {(React.Component<FieldRenderProps & InputProps>)}\r\n */\r\nclass CurrencyTextBox extends React.Component<FieldRenderProps<any, HTMLInputElement> & InputProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn <Input {...this.props} type=\"number\" step=\"0.01\" />;\r\n\t}\r\n}\r\n\r\nexport default CurrencyTextBox;\r\n","import * as React from 'react';\r\nimport Loadable from 'react-loadable';\r\nimport { FormGroup } from 'reactstrap';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { InputProps, ValidationMessages } from '.';\r\nimport FieldLabel from './FieldLabel';\r\nimport Loading from 'components/shared/Loading';\r\nimport { localMoment } from 'util/Time';\r\nimport { useState, useEffect } from 'react';\r\nimport classnames from 'classnames';\r\n\r\nconst SingleDatePicker = Loadable({\r\n\tloader: () =>\r\n\t\timport(/* webpackChunkName: \"single-date-picker-component\" */ 'react-dates/lib/components/SingleDatePicker'),\r\n\tloading: Loading,\r\n});\r\n\r\n/**\r\n * Component used to handle dates in forms (no time)\r\n *\r\n * @class DatePicker\r\n * @extends {(React.Component<FieldRenderProps & InputProps>)}\r\n */\r\nexport default function DateOnly(props: FieldRenderProps<any, HTMLInputElement> & InputProps) {\r\n\tconst [focused, setFocused] = useState(false);\r\n\tconst [date, setDate] = useState<any>(null);\r\n\r\n\tuseEffect(() => {\r\n\t\tsetDate(props.input.value ? localMoment(props.input.value) : null);\r\n\t}, [props.input.value]);\r\n\r\n\tconst {\r\n\t\tinput: { name, onChange },\r\n\t\tmeta,\r\n\t\tindicateDirty,\r\n\t} = props;\r\n\r\n\treturn (\r\n\t\t<FormGroup className={classnames('form-group--date', { 'form-group--dirty': indicateDirty && meta.dirty })}>\r\n\t\t\t<FieldLabel {...props} htmlFor={name} />\r\n\r\n\t\t\t<SingleDatePicker\r\n\t\t\t\t{...props}\r\n\t\t\t\tid={name}\r\n\t\t\t\tshowDefaultInputIcon\r\n\t\t\t\tshowClearDate\r\n\t\t\t\tsmall\r\n\t\t\t\tdisabled={props.disabled}\r\n\t\t\t\tdate={date}\r\n\t\t\t\tfocused={focused}\r\n\t\t\t\tonDateChange={(date) => {\r\n\t\t\t\t\tsetDate(date);\r\n\t\t\t\t\tonChange(date);\r\n\t\t\t\t}}\r\n\t\t\t\tonFocusChange={({ focused }) => {\r\n\t\t\t\t\tsetFocused(!!focused);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\r\n\t\t\t<ValidationMessages meta={meta} id={name} />\r\n\t\t</FormGroup>\r\n\t);\r\n}\r\n","import * as React from 'react';\r\nimport { FormGroup, Input } from 'reactstrap';\r\nimport ValidationMessages from './ValidationMessages';\r\nimport { FieldRenderProps, useForm } from 'react-final-form';\r\nimport FieldLabel from './FieldLabel';\r\nimport { DropdownProps, PrefixSuffixFieldProps } from 'components/shared/edit/fields';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport { useEffect, useState } from 'react';\r\n\r\ntype FormDropdownProps = FieldRenderProps<any, HTMLInputElement> &\r\n\tDropdownProps &\r\n\tPrefixSuffixFieldProps & {\r\n\t\t/**\r\n\t\t * If there's only a single value to pick from, and no value is currently selected, pick that automatically.\r\n\t\t */\r\n\t\tlockSingleValueSelection?: boolean;\r\n\t};\r\n\r\n/**\r\n * Component that renders a dropdown. Utilizes reactstrap Input and final form.\r\n *\r\n * @class FormDropdown\r\n * @extends {(React.Component<FieldRenderProps & DropdownProps>)}\r\n */\r\nfunction FormDropdown(props: FormDropdownProps) {\r\n\tconst form = useForm();\r\n\r\n\tconst {\r\n\t\tinput: { name, onChange, value, onBlur, onFocus },\r\n\t\tmeta,\r\n\t\tdisabled,\r\n\t\treadOnly,\r\n\t\taddSelectOption,\r\n\t\toptions,\r\n\t\tindicateDirty,\r\n\t\tprefix,\r\n\t\tsuffix,\r\n\t\tinnerRef,\r\n\t\tlockSingleValueSelection = false,\r\n\t} = props;\r\n\r\n\tconst [singleValueLocked, setSingleValueLocked] = useState(\r\n\t\tvalue && lockSingleValueSelection && options.length === 1,\r\n\t);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (lockSingleValueSelection && options.length === 1) {\r\n\t\t\t// console.debug('Single value detected for', name, '- auto selecting.');\r\n\t\t\tform.change(name, options[0].value);\r\n\t\t\tsetSingleValueLocked(true);\r\n\t\t} else if (options.length !== 1) {\r\n\t\t\tsetSingleValueLocked(false);\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [options]);\r\n\r\n\treturn (\r\n\t\t<FormGroup className={indicateDirty && meta.dirty ? 'form-group--dirty' : ''}>\r\n\t\t\t<FieldLabel {...props} htmlFor={name} />\r\n\r\n\t\t\t<div className=\"input-wrapper\">\r\n\t\t\t\t{prefix ? <div className=\"input-wrapper__prefix\">{prefix}</div> : null}\r\n\t\t\t\t<Input\r\n\t\t\t\t\tid={name}\r\n\t\t\t\t\tinvalid={!meta.dirtySinceLastSubmit && meta.submitError ? true : false}\r\n\t\t\t\t\ttype=\"select\"\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\treadOnly={readOnly || singleValueLocked}\r\n\t\t\t\t\tvalue={value}\r\n\t\t\t\t\tname={name}\r\n\t\t\t\t\tonChange={onChange}\r\n\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\tplaceholder=\"Select...\"\r\n\t\t\t\t\tdata-testid={`field-${toKebabCase(name)}`}\r\n\t\t\t\t\tinnerRef={innerRef}\r\n\t\t\t\t>\r\n\t\t\t\t\t{addSelectOption ? <option value=\"\" /> : null}\r\n\t\t\t\t\t{options.map((option, index) => (\r\n\t\t\t\t\t\t<option key={index} value={option.value} disabled={readOnly}>\r\n\t\t\t\t\t\t\t{option.text}\r\n\t\t\t\t\t\t</option>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</Input>\r\n\r\n\t\t\t\t{suffix ? <div className=\"input-wrapper__suffix\">{suffix}</div> : null}\r\n\t\t\t</div>\r\n\r\n\t\t\t<ValidationMessages id={name + '-invalid'} meta={meta} />\r\n\t\t</FormGroup>\r\n\t);\r\n}\r\n\r\nexport default FormDropdown;\r\n","import * as React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { DropdownOption } from 'shared-client/types/fields';\r\nimport { DropdownProps, FormDropdown } from '.';\r\n\r\nexport type MonthDropdownProps = FieldRenderProps<any, HTMLInputElement> &\r\n\tDropdownProps & {\r\n\t\tshowMonthNames?: boolean;\r\n\t};\r\n\r\nconst months: string[] = [\r\n\t'January',\r\n\t'February',\r\n\t'March',\r\n\t'April',\r\n\t'May',\r\n\t'June',\r\n\t'July',\r\n\t'August',\r\n\t'September',\r\n\t'October',\r\n\t'November',\r\n\t'December',\r\n];\r\n\r\n/**\r\n * Component that renders a dropdown with months.\r\n *\r\n * @class MonthDropdown\r\n * @extends {React.Component<MonthDropdownProps>}\r\n */\r\nclass MonthDropdown extends React.Component<MonthDropdownProps> {\r\n\tprivate options: DropdownOption[];\r\n\r\n\tpublic static defaultProps: Partial<MonthDropdownProps> = {\r\n\t\tshowMonthNames: true,\r\n\t};\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.options = months.map((month, index) => {\r\n\t\t\tconst paddedNumber = `${index < 9 ? '0' : ''}${index + 1}`;\r\n\t\t\treturn {\r\n\t\t\t\tvalue: paddedNumber,\r\n\t\t\t\ttext: props.showMonthNames ? month : paddedNumber,\r\n\t\t\t};\r\n\t\t});\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\t// eslint-disable-next-line no-unused-vars\r\n\t\tconst { showMonthNames, ...rest } = this.props;\r\n\r\n\t\treturn <FormDropdown {...rest} addSelectOption options={this.options} />;\r\n\t}\r\n}\r\n\r\nexport default MonthDropdown;\r\n","import * as React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { InputProps } from '.';\r\nimport Input from './Input';\r\n\r\n/**\r\n * Component that renders a Reactstrap input\r\n *\r\n * @class TextBox\r\n * @extends {(React.Component<FieldRenderProps & InputProps>)}\r\n */\r\nclass NumberTextBox extends React.Component<FieldRenderProps<any, HTMLInputElement> & InputProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn <Input {...this.props} type=\"number\" />;\r\n\t}\r\n}\r\n\r\nexport default NumberTextBox;\r\n","import * as React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { InputProps } from '.';\r\nimport Input from './Input';\r\n\r\n/**\r\n * Password Text Box Component that can be used where a password field is needed\r\n *\r\n * @class PasswordTextBox\r\n * @extends {(React.Component<FieldRenderProps & InputProps>)}\r\n */\r\nclass PasswordTextBox extends React.Component<FieldRenderProps<any, HTMLInputElement> & InputProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn <Input {...this.props} type=\"password\" />;\r\n\t}\r\n}\r\n\r\nexport default PasswordTextBox;\r\n","import * as React from 'react';\r\nimport { InputProps } from '.';\r\nimport Input from './Input';\r\nimport { FieldRenderProps } from 'react-final-form';\r\n\r\n/**\r\n * Text Area Props\r\n */\r\nexport type TextAreaProps = FieldRenderProps<any, HTMLInputElement> &\r\n\tInputProps & {\r\n\t\trows?: number;\r\n\t\tcols?: number;\r\n\t};\r\n\r\n/**\r\n * Component that renders a custom Input component.\r\n *\r\n * @class TextArea\r\n * @extends {(React.Component<TextAreaProps>)}\r\n */\r\nclass TextArea extends React.Component<TextAreaProps> {\r\n\tpublic static defaultProps: Partial<TextAreaProps> = {\r\n\t\trows: 5,\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn <Input {...this.props} type=\"textarea\" />;\r\n\t}\r\n}\r\n\r\nexport default TextArea;\r\n","import Octicon, { Plus } from '@githubprimer/octicons-react';\r\nimport CircleButton from 'components/shared/CircleButton';\r\nimport * as React from 'react';\r\nimport { Field, FieldRenderProps } from 'react-final-form';\r\nimport { Button, Input, Label } from 'reactstrap';\r\nimport { InputProps, ValidationMessages } from '.';\r\n\r\ntype TextListRenderProps = FieldRenderProps<any, HTMLInputElement> & InputProps;\r\n\r\n/**\r\n * Represents a dynamically expanding list of single line text entries.\r\n *\r\n * @class TextList\r\n * @extends {(React.Component<FieldRenderProps & InputProps>)}\r\n */\r\nclass TextList extends React.Component<TextListRenderProps> {\r\n\t/** Parses a value into a string array representing the lines of the text list. */\r\n\tprivate parse = (serverSetting: string | undefined) => {\r\n\t\tif (!serverSetting) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tlet lines: string[];\r\n\r\n\t\ttry {\r\n\t\t\tlines = JSON.parse(serverSetting);\r\n\t\t} catch {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\tif (!Array.isArray(lines)) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn lines;\r\n\t};\r\n\r\n\t/** Alerts React-Final-Form that the text list values have changed */\r\n\tprivate updateValue = (lines: string[]) => {\r\n\t\tconst { input } = this.props;\r\n\r\n\t\tinput.onChange(JSON.stringify(lines));\r\n\t};\r\n\r\n\t/** Deletes a text line row */\r\n\tprivate deleteRow = (index: number) => {\r\n\t\t// Deletion will cause validation errors to become misaligned.\r\n\t\t// One fix for this is to send an object instead of an array so delete errors reference a property that doesn't exist\r\n\t\t// An ideal fix would be manipulating meta.submitError but I am not sure this is possible\r\n\t\tconst newLines = this.parse(this.props.input.value);\r\n\t\tnewLines.splice(index, 1);\r\n\t\tthis.updateValue(newLines);\r\n\t};\r\n\r\n\t/** Event fired when a text line row changes */\r\n\tprivate onRowChange = (e: React.ChangeEvent<HTMLInputElement>, index: number) => {\r\n\t\tconst newValue = e.currentTarget.value;\r\n\t\tthis.updateRow(index, newValue);\r\n\t};\r\n\r\n\t/** Updates a text line row */\r\n\tprivate updateRow = (index: number, text: string) => {\r\n\t\tconst newLines = this.parse(this.props.input.value);\r\n\t\tnewLines[index] = text;\r\n\t\tthis.updateValue(newLines);\r\n\t};\r\n\r\n\t/** Adds a text line row to the end of the list */\r\n\tprivate addRow = () => {\r\n\t\tconst newLines = [...this.parse(this.props.input.value), ''];\r\n\t\tthis.updateValue(newLines);\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst inputName = this.props.input.name;\r\n\t\tconst { readOnly, label } = this.props;\r\n\t\tconst lines = this.parse(this.props.input.value);\r\n\r\n\t\treturn (\r\n\t\t\t<div className=\"roc-list roc-list--full-width\" id={inputName} role=\"table\">\r\n\t\t\t\t<div className=\"roc-list__head\" role=\"rowgroup\">\r\n\t\t\t\t\t<div className=\"roc-list__row\" role=\"row\">\r\n\t\t\t\t\t\t<div className=\"roc-list__cell roc-list__cell--label\" role=\"cell\">\r\n\t\t\t\t\t\t\t<Label>{label}</Label>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div className=\"roc-list__cell roc-list__cell--actions\" role=\"cell\"></div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div className=\"roc-list__body\" role=\"rowgroup\">\r\n\t\t\t\t\t{lines.map((value, index) => {\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<Field key={`${inputName}.${index}`} name={`${inputName}.${index}`}>\r\n\t\t\t\t\t\t\t\t{({ meta }) => (\r\n\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t<div className=\"roc-list__row\" role=\"row\">\r\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"roc-list__cell roc-list__cell--label\" role=\"cell\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tid={`${inputName}.${index}.Input`}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={(e) => this.onRowChange(e, index)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\treadOnly={readOnly}\r\n\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t{!readOnly ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<div className=\"roc-list__cell roc-list__cell--actions\" role=\"cell\">\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<CircleButton onClick={() => this.deleteRow(index)} />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t\t<ValidationMessages meta={meta} id={`${inputName}.${index}.Input`} />\r\n\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</Field>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t</div>\r\n\t\t\t\t{!readOnly ? (\r\n\t\t\t\t\t<div className=\"form-group__actions\">\r\n\t\t\t\t\t\t<Button color=\"primary\" className=\"btn-flush-bottom\" onClick={() => this.addRow()}>\r\n\t\t\t\t\t\t\t<Octicon icon={Plus} ariaLabel=\"Plus sign\" /> Add new\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t) : null}\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default TextList;\r\n","import * as React from 'react';\r\nimport { FormGroup } from 'reactstrap';\r\nimport ValidationMessages from './ValidationMessages';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { FieldPropsWithDefaultValue } from '.';\r\nimport { default as ToggleInput } from 'react-toggle';\r\nimport 'react-toggle/style.css';\r\nimport FieldLabel from './FieldLabel';\r\nimport classnames from 'classnames';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport Confirm from 'components/shared/Confirm';\r\n\r\nexport interface ToggleState {\r\n\t/**\r\n\t * Determines if confirmation modal should be show or hide\r\n\t */\r\n\tisConfirmationOpen: boolean;\r\n}\r\n\r\n/**\r\n * Component that renders a toggle for booleans\r\n *\r\n * @class Toggle\r\n * @extends {(React.Component<FieldRenderProps & FieldProps>)}\r\n */\r\nclass Toggle extends React.Component<\r\n\tFieldRenderProps<any, HTMLInputElement> & FieldPropsWithDefaultValue,\r\n\tToggleState\r\n> {\r\n\tpublic static defaultProps: Partial<FieldRenderProps<any, HTMLInputElement> & FieldPropsWithDefaultValue> = {\r\n\t\tindicateDirty: true,\r\n\t};\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t\tthis.state = {\r\n\t\t\tisConfirmationOpen: false,\r\n\t\t};\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tinput: { name, onChange, value },\r\n\t\t\tmeta,\r\n\t\t\tdisabled,\r\n\t\t\treadOnly,\r\n\t\t\ttestId,\r\n\t\t\tdefaultValue = false,\r\n\t\t\tindicateDirty,\r\n\t\t\tconfirmationMessage,\r\n\t\t} = this.props;\r\n\t\tconst { isConfirmationOpen } = this.state;\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup\r\n\t\t\t\tclassName={classnames('form-group--toggle', { 'form-group--dirty': indicateDirty && meta.dirty })}\r\n\t\t\t>\r\n\t\t\t\t<FieldLabel {...this.props}>\r\n\t\t\t\t\t<ToggleInput\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tchecked={value === '' ? defaultValue : value}\r\n\t\t\t\t\t\tonChange={(e) => {\r\n\t\t\t\t\t\t\tif (confirmationMessage && e.currentTarget.checked) {\r\n\t\t\t\t\t\t\t\tthis.setState({ isConfirmationOpen: true });\r\n\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tonChange(e.currentTarget.checked);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\ticons={false}\r\n\t\t\t\t\t\tdisabled={disabled || readOnly}\r\n\t\t\t\t\t\tdata-testid={testId || `field-${toKebabCase(name)}`}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</FieldLabel>\r\n\t\t\t\t<ValidationMessages meta={meta} id={name} />\r\n\t\t\t\t<Confirm\r\n\t\t\t\t\tonCancel={() => {\r\n\t\t\t\t\t\tthis.setState({ isConfirmationOpen: false });\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tisOpen={isConfirmationOpen}\r\n\t\t\t\t\tcolor={'default'}\r\n\t\t\t\t\tonConfirm={() => {\r\n\t\t\t\t\t\tonChange(true);\r\n\t\t\t\t\t\tthis.setState({ isConfirmationOpen: false });\r\n\t\t\t\t\t}}\r\n\t\t\t\t\trenderTitle={() => ''}\r\n\t\t\t\t\trenderContents={() => <div dangerouslySetInnerHTML={{ __html: confirmationMessage }}></div>}\r\n\t\t\t\t\tconfirmButtonText=\"Continue\"\r\n\t\t\t\t\tcancelButtonText=\"Cancel\"\r\n\t\t\t\t/>\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Toggle;\r\n","import * as React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { DropdownOption } from 'shared-client/types/fields';\r\nimport { DropdownProps, FormDropdown } from '.';\r\n\r\nexport type YearDropdownProps = FieldRenderProps<any, HTMLInputElement> &\r\n\tDropdownProps & {\r\n\t\tstartYear?: number;\r\n\t\tnumberOfYears?: number;\r\n\t};\r\n\r\n/**\r\n * Component that renders a dropdown with years.\r\n *\r\n * @class YearDropdown\r\n * @extends {React.Component<YearDropdownProps>}\r\n */\r\nclass YearDropdown extends React.Component<YearDropdownProps> {\r\n\tprivate options: DropdownOption[] = [];\r\n\r\n\tpublic static defaultProps: Partial<YearDropdownProps> = {\r\n\t\tstartYear: new Date().getFullYear(),\r\n\t\tnumberOfYears: 10,\r\n\t};\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tconst { startYear, numberOfYears } = props;\r\n\r\n\t\tfor (let i = 0; i < numberOfYears; i++) {\r\n\t\t\tthis.options.push({\r\n\t\t\t\tvalue: `${startYear + i}`,\r\n\t\t\t\ttext: `${startYear + i}`,\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\t// eslint-disable-next-line no-unused-vars\r\n\t\tconst { startYear, numberOfYears, ...rest } = this.props;\r\n\r\n\t\treturn <FormDropdown {...rest} addSelectOption options={this.options} />;\r\n\t}\r\n}\r\n\r\nexport default YearDropdown;\r\n","import * as React from 'react';\r\nimport FormDropdown from './FormDropdown';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { DropdownProps } from '.';\r\n\r\n/**\r\n * Component that renders a yes or no dropdown.\r\n *\r\n * @class YesNoDropdown\r\n * @extends {(React.Component<FieldRenderProps & DropdownProps>)}\r\n */\r\nclass YesNoDropdown extends React.Component<FieldRenderProps<any, HTMLInputElement> & DropdownProps> {\r\n\tprivate options: any;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.options = [\r\n\t\t\t{ value: true, text: 'Yes' },\r\n\t\t\t{ value: false, text: 'No' },\r\n\t\t];\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn <FormDropdown {...this.props} options={this.options} />;\r\n\t}\r\n}\r\n\r\nexport default YesNoDropdown;\r\n","import { EntityDefinition, AppUserPermissions } from 'types';\r\nimport AxiosHelper from './AxiosHelper';\r\nimport Axios, { CancelTokenSource } from 'axios';\r\n\r\n/**\r\n * Common type used to index entity definitions by different strings\r\n *\r\n * @export\r\n * @interface EntityDefinitionDictionary\r\n */\r\nexport interface EntityDefinitionDictionary {\r\n\t[index: string]: EntityDefinition;\r\n}\r\n\r\n/**\r\n * Default map of entity definitions\r\n */\r\nconst entityDefinitions: EntityDefinitionDictionary = {};\r\n\r\n/**\r\n * Registers an entity definition. This is usually called from the EntityDefinition constructor.\r\n * @param entityDefinition\r\n */\r\nexport const registerEntityDefinition = (entityDefinition: EntityDefinition) => {\r\n\tif (entityDefinition.code) {\r\n\t\tentityDefinitions[entityDefinition.code] = entityDefinition;\r\n\t} else {\r\n\t\tconst warningMessage =\r\n\t\t\t\"Trying to register an entity definition with an empty 'code'.\\n\" +\r\n\t\t\t`Singular Name: ${entityDefinition.singularName}\\n` +\r\n\t\t\t`Plural Name: ${entityDefinition.pluralName}\\n` +\r\n\t\t\t`Base Ajax Url: ${entityDefinition.baseAjaxUrl}`;\r\n\r\n\t\tconsole.warn(warningMessage, entityDefinition);\r\n\t}\r\n};\r\n\r\n/**\r\n * Returns all entity definitions in a dictionary. We could return the object directly, but this will\r\n * likely be needed when dealing with dynamic entity definitions (attributes).\r\n */\r\nexport const getEntityDefinitions = () => {\r\n\treturn entityDefinitions;\r\n};\r\n\r\n/**\r\n * Returns entity definitions mapped by their `baseAjaxRoute`. This isn't ideal but it's the only way to\r\n * consistently get a match between the client and the server.\r\n */\r\nexport const getEntityDefinitionsByBaseAjaxUrl = (): EntityDefinitionDictionary => {\r\n\treturn Object.keys(entityDefinitions).reduce((acc, value) => {\r\n\t\tconst currentEntityDefinition = entityDefinitions[value];\r\n\t\tacc[currentEntityDefinition.baseAjaxRoute] = currentEntityDefinition;\r\n\r\n\t\t// Map current entity definition by a predefined key. This is necessary\r\n\t\t// for exporting entity types whose baseAjaxRoute is dynamic\r\n\t\tconst customExportKey = currentEntityDefinition?.exportOptions?.typeKey;\r\n\t\tif (customExportKey != null && acc[customExportKey] == null) {\r\n\t\t\tacc[customExportKey] = currentEntityDefinition;\r\n\t\t}\r\n\r\n\t\treturn acc;\r\n\t}, {});\r\n};\r\n\r\n/**\r\n * Returns entity definitions mapped by their `baseRoute`.\r\n */\r\nexport const getEntityDefinitionsByBaseRoute = (): EntityDefinitionDictionary => {\r\n\treturn Object.keys(entityDefinitions).reduce((acc, value) => {\r\n\t\tconst currentEntityDefinition = entityDefinitions[value];\r\n\t\tacc[currentEntityDefinition.baseRoute] = currentEntityDefinition;\r\n\t\treturn acc;\r\n\t}, {});\r\n};\r\n\r\n// this will act as a way to cache the request to load importable entity definitions from the server.\r\nlet importableEntityDefinitionPromise: Promise<any>;\r\nlet exportableEntityDefinitionPromise: Promise<any>;\r\n\r\ninterface ImportableTypesResponse {\r\n\timportTypes: ImportableType[];\r\n}\r\n\r\ninterface ImportableType {\r\n\tname: string;\r\n\ttypeName: string;\r\n\tentityTypeId: string;\r\n\tindexRoute: string;\r\n\timportRoute: string;\r\n\tisAuthorized: boolean;\r\n}\r\n\r\ninterface ExportableTypesResponse {\r\n\texportTypes: ExportableType[];\r\n}\r\n\r\ninterface ExportableType {\r\n\tname: string;\r\n\ttypeName: string;\r\n\tindexRoute: string;\r\n\texportRoute: string;\r\n\tisAuthorized: boolean;\r\n}\r\n\r\n/**\r\n * Returns all importable entity definitions from the server.\r\n */\r\nexport const getImportableEntityDefinitions = async (): Promise<ImportableTypesResponse> => {\r\n\tif (importableEntityDefinitionPromise) {\r\n\t\treturn importableEntityDefinitionPromise;\r\n\t}\r\n\r\n\timportableEntityDefinitionPromise = new Promise(async (resolve, reject) => {\r\n\t\ttry {\r\n\t\t\tconst importableTypes = await AxiosHelper.get<ImportableTypesResponse>('/ajax/import/types').then(\r\n\t\t\t\t(response) => response.data,\r\n\t\t\t);\r\n\r\n\t\t\tresolve(importableTypes);\r\n\t\t} catch (error) {\r\n\t\t\treject(error);\r\n\t\t}\r\n\t});\r\n\r\n\treturn importableEntityDefinitionPromise;\r\n};\r\n\r\n/**\r\n * Returns all exportable entity definitions from the server.\r\n */\r\nexport const getExportableEntityDefinitions = async (): Promise<ExportableTypesResponse> => {\r\n\tif (exportableEntityDefinitionPromise) {\r\n\t\treturn exportableEntityDefinitionPromise;\r\n\t}\r\n\r\n\texportableEntityDefinitionPromise = new Promise(async (resolve, reject) => {\r\n\t\ttry {\r\n\t\t\tconst exportableTypes = await AxiosHelper.get<ExportableTypesResponse>('/ajax/export/types').then(\r\n\t\t\t\t(response) => response.data,\r\n\t\t\t);\r\n\r\n\t\t\tresolve(exportableTypes);\r\n\t\t} catch (error) {\r\n\t\t\treject(error);\r\n\t\t}\r\n\t});\r\n\r\n\treturn exportableEntityDefinitionPromise;\r\n};\r\n\r\nconst mappedImportableEntityDefinitionsCache = {};\r\nconst mappedExportableEntityDefinitionsCache = {};\r\n\r\n/**\r\n * Returns a map of importable entity definitions based on a provided mapping.\r\n * @param indexByFn\r\n * @param cacheKey\r\n */\r\nexport const getMappedImportableEntityDefinitions = async (\r\n\tindexByFn: (importableType: ImportableType, entityDefinition: EntityDefinition) => string = (_, entityDefinition) =>\r\n\t\tentityDefinition.code,\r\n\tcacheKey: string = '',\r\n) => {\r\n\tif (cacheKey && mappedImportableEntityDefinitionsCache[cacheKey]) {\r\n\t\treturn mappedImportableEntityDefinitionsCache[cacheKey];\r\n\t}\r\n\r\n\tconst importableTypes = await getImportableEntityDefinitions();\r\n\r\n\tconst entityDefinitionsByBaseAjaxUrl = getEntityDefinitionsByBaseAjaxUrl();\r\n\tconst importableEntityDefinitions: EntityDefinitionDictionary = {};\r\n\r\n\tfor (const importableType of importableTypes.importTypes) {\r\n\t\t// check if we have a match between the client-side entity definitions and the server-side\r\n\t\tconst match = entityDefinitionsByBaseAjaxUrl[importableType.indexRoute];\r\n\t\tif (match) {\r\n\t\t\timportableEntityDefinitions[indexByFn(importableType, match)] = match;\r\n\t\t}\r\n\t}\r\n\r\n\tif (cacheKey) {\r\n\t\tmappedImportableEntityDefinitionsCache[cacheKey] = importableEntityDefinitions;\r\n\t}\r\n\r\n\treturn importableEntityDefinitions;\r\n};\r\n\r\n/**\r\n * Returns a map of exportable entity definitions based on a provided mapping.\r\n * @param indexByFn\r\n * @param cacheKey\r\n */\r\nexport const getMappedExportableEntityDefinitions = async (\r\n\tindexByFn: (importableType: ExportableType, entityDefinition: EntityDefinition) => string = (_, entityDefinition) =>\r\n\t\tentityDefinition.code,\r\n\tcacheKey: string = '',\r\n) => {\r\n\tif (cacheKey && mappedExportableEntityDefinitionsCache[cacheKey]) {\r\n\t\treturn mappedExportableEntityDefinitionsCache[cacheKey];\r\n\t}\r\n\r\n\tconst exportableTypes = await getExportableEntityDefinitions();\r\n\r\n\tconst entityDefinitionsByBaseAjaxUrl = getEntityDefinitionsByBaseAjaxUrl();\r\n\tconst exportableEntityDefinitions: EntityDefinitionDictionary = {};\r\n\r\n\tfor (const exportableType of exportableTypes.exportTypes) {\r\n\t\t// check if we have a match between the client-side entity definitions and the server-side\r\n\t\tconst match = entityDefinitionsByBaseAjaxUrl[exportableType.indexRoute];\r\n\t\tif (match) {\r\n\t\t\texportableEntityDefinitions[indexByFn(exportableType, match)] = match;\r\n\t\t}\r\n\t}\r\n\r\n\tif (cacheKey) {\r\n\t\tmappedExportableEntityDefinitionsCache[cacheKey] = exportableEntityDefinitions;\r\n\t}\r\n\r\n\treturn exportableEntityDefinitions;\r\n};\r\n\r\n// this will act as a way to cache the requests to load tooltips by entity definition.\r\nlet tooltipPromises: { [code: string]: Promise<any> | undefined };\r\n\r\n/**\r\n * Get cached tooltip promise by key\r\n * @param key\r\n */\r\nexport const getTooltipPromiseByKey = (code: string): Promise<any> | undefined => {\r\n\treturn tooltipPromises && tooltipPromises[code];\r\n};\r\n\r\n/**\r\n * Set cached tooltip promise by key\r\n */\r\nexport const setTooltipPromiseByKey = (code: string, value: Promise<any> | undefined): void => {\r\n\tif (!tooltipPromises) {\r\n\t\ttooltipPromises = {};\r\n\t}\r\n\r\n\ttooltipPromises[code] = value;\r\n};\r\n\r\n/**\r\n * Clear tooltip cache\r\n */\r\nexport const clearTooltipCache = (): void => {\r\n\ttooltipPromises = {};\r\n};\r\n\r\n/**\r\n * Loads cached tooltip data based on the entity definition\r\n */\r\nexport const getTooltipsForEntity = (\r\n\tentityDefinition: EntityDefinition,\r\n\ttooltipRequestToken: CancelTokenSource,\r\n\terrorCallback: () => void,\r\n): Promise<any> => {\r\n\tconst cachedPromise = getTooltipPromiseByKey(entityDefinition.code);\r\n\r\n\tif (cachedPromise) {\r\n\t\treturn cachedPromise;\r\n\t}\r\n\r\n\tconst url = `${entityDefinition.baseAjaxRoute}/tooltips`;\r\n\r\n\t// Handle other requested tooltip keys\r\n\tlet query = '';\r\n\tif (entityDefinition.extraTooltipKeys) {\r\n\t\tquery += (query === '' ? '?' : '&') + 'extraTooltipKeys=' + entityDefinition.extraTooltipKeys.join(',');\r\n\t}\r\n\r\n\t//#region Commerce\r\n\tconst anyDefinition = entityDefinition as any;\r\n\tif (anyDefinition.attributeCode && anyDefinition.attributeCode !== '') {\r\n\t\tquery += (query === '' ? '?' : '&') + 'attributeCode=' + anyDefinition.attributeCode;\r\n\t}\r\n\t//#endregion\r\n\r\n\tconst singularName = entityDefinition.singularName;\r\n\r\n\tconst loadTooltipDataPromise = AxiosHelper.get(url + query, { cancelToken: tooltipRequestToken.token }).catch(\r\n\t\t(error) => {\r\n\t\t\tif (Axios.isCancel(error)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconsole.error(`An error occurred while loading tooltips for ${singularName}.`);\r\n\r\n\t\t\terrorCallback();\r\n\t\t},\r\n\t);\r\n\r\n\tsetTooltipPromiseByKey(entityDefinition.code, loadTooltipDataPromise);\r\n\r\n\treturn loadTooltipDataPromise;\r\n};\r\n\r\n/**\r\n * Does the logged in user have delete permission to the given baseRoute\r\n * @param baseRoute\r\n * @param authorizedBaseRoutesData\r\n */\r\nexport const hasDeletePermission = (\r\n\tentityDefinition: EntityDefinition,\r\n\tauthorizedBaseRoutesData: AppUserPermissions,\r\n) => {\r\n\tif (authorizedBaseRoutesData.isPowerUser) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\tconst { baseAjaxRoute, parentBaseAjaxRoute } = entityDefinition;\r\n\tlet permissions = authorizedBaseRoutesData.authorizedBaseRoutes[baseAjaxRoute];\r\n\r\n\tif (permissions) {\r\n\t\treturn permissions[2];\r\n\t} else {\r\n\t\tif (!parentBaseAjaxRoute || parentBaseAjaxRoute == baseAjaxRoute) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tpermissions = authorizedBaseRoutesData.authorizedBaseRoutes[parentBaseAjaxRoute];\r\n\t\tif (!permissions) {\r\n\t\t\t// no permissions\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn permissions[2];\r\n\t}\r\n};\r\n\r\n/**\r\n * Does the logged in user have list permission to the given baseRoute\r\n * @param baseRoute\r\n * @param authorizedBaseRoutesData\r\n */\r\nexport const hasListPermission = (entityDefinition: EntityDefinition, authorizedBaseRoutesData: AppUserPermissions) => {\r\n\tif (authorizedBaseRoutesData.isPowerUser) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\tconst { baseAjaxRoute, parentBaseAjaxRoute } = entityDefinition;\r\n\tlet permissions = authorizedBaseRoutesData.authorizedBaseRoutes[baseAjaxRoute];\r\n\r\n\tif (permissions) {\r\n\t\treturn permissions[0];\r\n\t} else {\r\n\t\tif (!parentBaseAjaxRoute || parentBaseAjaxRoute == baseAjaxRoute) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tpermissions = authorizedBaseRoutesData.authorizedBaseRoutes[parentBaseAjaxRoute];\r\n\t\tif (!permissions) {\r\n\t\t\t// no permissions\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn permissions[0];\r\n\t}\r\n};\r\n\r\n/**\r\n * Does the logged in user have create/edit permission to the given baseRoute\r\n * @param baseRoute\r\n * @param authorizedBaseRoutesData\r\n */\r\nexport const hasCreateEditPermission = (\r\n\tentityDefinition: EntityDefinition,\r\n\tauthorizedBaseRoutesData: AppUserPermissions,\r\n) => {\r\n\tif (authorizedBaseRoutesData.isPowerUser) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\tconst { baseAjaxRoute, parentBaseAjaxRoute } = entityDefinition;\r\n\tlet permissions = authorizedBaseRoutesData.authorizedBaseRoutes[baseAjaxRoute];\r\n\r\n\tif (permissions) {\r\n\t\treturn permissions[1];\r\n\t} else {\r\n\t\tif (!parentBaseAjaxRoute || parentBaseAjaxRoute == baseAjaxRoute) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tpermissions = authorizedBaseRoutesData.authorizedBaseRoutes[parentBaseAjaxRoute];\r\n\t\tif (!permissions) {\r\n\t\t\t// no permissions\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn permissions[1];\r\n\t}\r\n};\r\n\r\n/**\r\n * Does the logged in user have any list permission\r\n * @param authorizedBaseRoutesData\r\n */\r\nexport const hasAnyListPermission = (authorizedBaseRoutesData: {\r\n\tisPowerUser: boolean;\r\n\thasAnyListPermission: boolean;\r\n}) => {\r\n\tif (authorizedBaseRoutesData.isPowerUser) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn authorizedBaseRoutesData.hasAnyListPermission;\r\n};\r\n\r\n/**\r\n * Does the logged in user have any create/edit permission\r\n * @param authorizedBaseRoutesData\r\n */\r\nexport const hasAnyCreateEditPermission = (authorizedBaseRoutesData: {\r\n\tisPowerUser: boolean;\r\n\thasAnyEditPermission: boolean;\r\n}) => {\r\n\tif (authorizedBaseRoutesData.isPowerUser) {\r\n\t\treturn true;\r\n\t}\r\n\r\n\treturn authorizedBaseRoutesData.hasAnyEditPermission;\r\n};\r\n\r\n/**\r\n * Retrieves the edit route by entity singular name.\r\n * @param singularName The singular name of the entity.\r\n * @returns The edit route for the entity with the specified singular name, or an empty string if not found.\r\n */\r\nexport const getEditRouteByEntitySingularName = (singularName: string): string => {\r\n\tconst entityDefinitions = getEntityDefinitionsByBaseRoute();\r\n\tconst keysWithSingularName = Object.keys(entityDefinitions).find(\r\n\t\t(key) => entityDefinitions[key].singularName === singularName,\r\n\t);\r\n\treturn keysWithSingularName ? entityDefinitions[keysWithSingularName].baseEditRoute : '';\r\n};\r\n","import * as React from 'react';\r\nimport { Field } from 'react-final-form';\r\nimport { Primitive } from 'types/Primitives';\r\n\r\nexport enum ConditionOperator {\r\n\tEqualTo,\r\n\tNotEqualTo,\r\n\tGreaterThan,\r\n\tLessThan,\r\n\tGreaterThanOrEqualTo,\r\n\tLessThanOrEqualTo,\r\n\tContains,\r\n\t// #region Coburns\r\n\tContainsSuggestionLabel,\r\n\t// #endregion Coburns\r\n}\r\n\r\ninterface ConditionProps {\r\n\t/** The name of the field in the form to check */\r\n\twhen: string;\r\n\r\n\t/**\r\n\t * The logical operator to use when comparing the the value of the \"when\" field to the passed in value. If the resulting\r\n\t * conditional expression is true, the children will be rendered. Operator and value are required if condition is not used.\r\n\t */\r\n\toperator?: ConditionOperator;\r\n\r\n\t/**\r\n\t * A conditional function that takes the value of the field with the name in the \"when\" argument and returns true if the children\r\n\t * of the Condition component should be rendered. Required if operator or value are omitted.\r\n\t */\r\n\tcondition?: (value: any) => boolean;\r\n\r\n\t/**\r\n\t * The value to compare the value of the \"when\" field to using the designated operator. If the resulting conditional expression\r\n\t * is true, the children will be rendered. Operator and value are required if condition is not used.\r\n\t */\r\n\tvalue?: Primitive | Primitive[];\r\n\r\n\t/** The children of the Condition component */\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Conditionally renders the components passed in as children, based on form values.\r\n */\r\nconst Condition = (props: ConditionProps) => {\r\n\tconst { when, operator, condition, children } = props;\r\n\tconst arrayValue: Primitive[] | null = Array.isArray(props.value) ? props.value : null;\r\n\r\n\treturn (\r\n\t\t<Field name={when} subscription={{ value: true }}>\r\n\t\t\t{({ input: { value } }) => {\r\n\t\t\t\tif (condition) {\r\n\t\t\t\t\treturn condition(value) ? children : null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (props.value === undefined) {\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch (operator) {\r\n\t\t\t\t\tcase ConditionOperator.EqualTo:\r\n\t\t\t\t\tdefault:\r\n\t\t\t\t\t\treturn arrayValue\r\n\t\t\t\t\t\t\t? arrayValue.includes(value)\r\n\t\t\t\t\t\t\t\t? children\r\n\t\t\t\t\t\t\t\t: null\r\n\t\t\t\t\t\t\t: value === props.value\r\n\t\t\t\t\t\t\t? children\r\n\t\t\t\t\t\t\t: null;\r\n\r\n\t\t\t\t\tcase ConditionOperator.NotEqualTo:\r\n\t\t\t\t\t\treturn arrayValue\r\n\t\t\t\t\t\t\t? !arrayValue.includes(value)\r\n\t\t\t\t\t\t\t\t? children\r\n\t\t\t\t\t\t\t\t: null\r\n\t\t\t\t\t\t\t: value !== props.value\r\n\t\t\t\t\t\t\t? children\r\n\t\t\t\t\t\t\t: null;\r\n\r\n\t\t\t\t\tcase ConditionOperator.GreaterThan:\r\n\t\t\t\t\t\treturn value > props.value ? children : null;\r\n\r\n\t\t\t\t\tcase ConditionOperator.GreaterThanOrEqualTo:\r\n\t\t\t\t\t\treturn value >= props.value ? children : null;\r\n\r\n\t\t\t\t\tcase ConditionOperator.LessThan:\r\n\t\t\t\t\t\treturn value < props.value ? children : null;\r\n\r\n\t\t\t\t\tcase ConditionOperator.LessThanOrEqualTo:\r\n\t\t\t\t\t\treturn value <= props.value ? children : null;\r\n\r\n\t\t\t\t\tcase ConditionOperator.Contains:\r\n\t\t\t\t\t\treturn value.toString().toLocaleLowerCase().includes(props.value.toString().toLocaleLowerCase())\r\n\t\t\t\t\t\t\t? children\r\n\t\t\t\t\t\t\t: null;\r\n\t\t\t\t\t// #region Coburns\r\n\t\t\t\t\tcase ConditionOperator.ContainsSuggestionLabel:\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\treturn value?.label?.toString().toLocaleLowerCase().includes(props.value.toString().toLocaleLowerCase())\r\n\t\t\t\t\t\t\t\t? children\r\n\t\t\t\t\t\t\t\t: null;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t// #endregion Coburns\r\n\t\t\t\t}\r\n\t\t\t}}\r\n\t\t</Field>\r\n\t);\r\n};\r\n\r\nexport default Condition;\r\n","import * as React from 'react';\r\n\r\ninterface DefaultSuggestedValueProps {\r\n\tsuggestedValue: string;\r\n\tapplySuggestedValue: () => void;\r\n}\r\n\r\n/**\r\n * Default component used to render suggested values.\r\n * @param param0 props\r\n */\r\nconst DefaultSuggestedValue: React.SFC<DefaultSuggestedValueProps> = ({ suggestedValue, applySuggestedValue }) => (\r\n\t<p>\r\n\t\t<em>New suggested value:</em> {suggestedValue}{' '}\r\n\t\t<button\r\n\t\t\ttype=\"button\"\r\n\t\t\tdata-testid=\"apply-suggested-value-button\"\r\n\t\t\tclassName=\"btn btn-xs btn-primary\"\r\n\t\t\tonClick={applySuggestedValue}\r\n\t\t>\r\n\t\t\tApply\r\n\t\t</button>\r\n\t</p>\r\n);\r\n\r\nexport default DefaultSuggestedValue;\r\n","/**\r\n * Format a json string to a pretty format .\r\n */\r\nexport default (value: string): string => {\r\n\tif (!value) {\r\n\t\treturn '';\r\n\t}\r\n\ttry {\r\n\t\treturn JSON.stringify(JSON.parse(value), null, 2);\r\n\t} catch (e) {\r\n\t\treturn value;\r\n\t}\r\n};\r\n","import { FilterEditProps } from '.';\r\n\r\n/**\r\n * Contract for all ranged values. They contain 2 values, to and from.\r\n * This is preferable to an array with 2 elements.\r\n *\r\n * @export\r\n * @interface RangedValue\r\n */\r\nexport interface RangedValue {\r\n\tfromValue: any;\r\n\ttoValue: any;\r\n}\r\n\r\nexport interface RangedPresetValue extends RangedValue {\r\n\tpreset?: string; // Today, ThisWeek, Last90Days, etc\r\n\tdisplayName?: string; // Today, This Week, Last 90 Days, etc\r\n\taxisPrecision?: 'day' | 'week' | 'month'; // Determines if the period is short enough, to be displayed in days precision in a graph axis.\r\n}\r\n\r\nexport interface MultipleRangedPresetValueFilterEditProps extends FilterEditProps<RangedPresetValue[]> {}\r\n\r\nexport interface SingleRangedPresetValueFilterEditProps extends FilterEditProps<RangedPresetValue> {}\r\n\r\nexport interface SingleDateFilterEditProps extends FilterEditProps<RangedPresetValue[]> {}\r\n\r\n/**\r\n * All available filter edit component types\r\n *\r\n * @export\r\n * @enum {number}\r\n */\r\nexport enum FilterType {\r\n\tSingleText = 'SingleText',\r\n\tMultipleText = 'MultipleText',\r\n\r\n\tMultipleDropdown = 'MultipleDropdown',\r\n\tSingleDropdown = 'SingleDropdown',\r\n\r\n\tSingleBoolean = 'SingleBoolean',\r\n\tSingleInteger = 'SingleInteger',\r\n\tSingleDecimal = 'SingleDecimal',\r\n\r\n\tSingleAutoSuggest = 'SingleAutoSuggest',\r\n\tMultipleAutoSuggest = 'MultipleAutoSuggest',\r\n\r\n\tRangedInteger = 'RangedInteger',\r\n\tRangedDecimal = 'RangedDecimal',\r\n\r\n\tMultipleDateRangePreset = 'MultipleDateRange',\r\n\tSingleDateRangePreset = 'SingleDateRange',\r\n\tSingleDate = 'SingleDate',\r\n}\r\n","import { AxiosError } from 'axios';\r\nimport { FORM_ERROR } from 'final-form';\r\nimport { unflatten } from 'flat';\r\nimport { AppSiteDto } from '../types';\r\nimport AppState from 'AppState';\r\n\r\n/**\r\n * Represents the source of validation errors returned by `handleAxiosErrorWithValidation`. These act as bitwise flags,\r\n * so test these individually.\r\n */\r\nexport enum ValidationErrorSource {\r\n\t/** No validation errors at all, so no source. */\r\n\tNone = 0,\r\n\r\n\t/** Validation error in the edit form itself. */\r\n\tEditForm = 1,\r\n\r\n\t/** Validation error in only the redirect URLs. */\r\n\tRedirectModal = 2,\r\n}\r\n\r\nexport const getFormattedPageTitle = (subTitle: string = ''): string => {\r\n\t// load from config?\r\n\tconst siteName = 'ROC';\r\n\r\n\tif (!subTitle || !subTitle.trim()) {\r\n\t\treturn siteName;\r\n\t}\r\n\r\n\treturn `${subTitle.trim()} - ${siteName}`;\r\n};\r\n\r\n/**\r\n * Promise version of setTimeout.\r\n * @param ms The number of milliseconds to wait for.\r\n */\r\nexport const timeout = (ms) => {\r\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\r\n};\r\n\r\n/**\r\n * Allows you to await on a timeout, useful for avoiding setTimeout callbacks and for troubleshooting.\r\n * @param ms The number of milliseconds to wait for.\r\n */\r\nexport const sleep = async (ms: number = 0) => {\r\n\tawait timeout(ms);\r\n};\r\n\r\n/**\r\n * Handles Axios error for React Final Form. If the error is a validation error, the error is transformed into React\r\n * Final Form field validation object. If the error is a generic error, the error is rethrown instead.\r\n *\r\n * @param error - The Axios Error object to handle errors for.\r\n * @param errorMessage - The form error message to provide back to React Final Form.\r\n * @param validationErrorCallback - Optional callback that is triggered right before the validation object is returned\r\n * to Final Form, so that you can run logic that should occur during validation errors.\r\n * @param genericErrorCallback - Optional callback that is triggered right before the generic error is rethrown, so that\r\n * you can run logic that should occur during generic errors.\r\n */\r\nexport const handleAxiosErrorWithValidation = (\r\n\terror: AxiosError,\r\n\terrorMessage: string | null = 'An error occurred while saving.',\r\n\tvalidationErrorCallback?: () => void,\r\n\tgenericErrorCallback?: () => void,\r\n): { [index: string]: string } => {\r\n\tif (error && error.response && error.response.status === 400 && error.response.data) {\r\n\t\tlet globalErrors;\r\n\r\n\t\tconst errors = error && error.response && error.response.data;\r\n\r\n\t\t// by default, we display client handleable exception messages at the top of the form.\r\n\t\t// this behavior can be overridden per specific component if custom handling is needed.\r\n\t\t// eg: a client handleable exception may involve asking a user for further approval to \"force\" deletes\r\n\t\tif (errors.__isClientHandleable) {\r\n\t\t\treturn {\r\n\t\t\t\t[FORM_ERROR]: errors.message,\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tconst errorsWithModifiedArrayIndex = Object.keys(errors).reduce((acc, value) => {\r\n\t\t\tif (value === '') {\r\n\t\t\t\t// in case we are getting back a non field specific error store it in the global errors\r\n\t\t\t\tglobalErrors = errors[value];\r\n\t\t\t} else {\r\n\t\t\t\tconst newKey = value.replace(/\\[([0-9]+)\\]/g, '.$1');\r\n\t\t\t\tacc[newKey] = errors[value];\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\t\tconst newValidationState = { ...unflatten(errorsWithModifiedArrayIndex) };\r\n\r\n\t\tconsole.debug('newValidationState:', newValidationState);\r\n\r\n\t\tif (validationErrorCallback) {\r\n\t\t\tvalidationErrorCallback();\r\n\t\t}\r\n\r\n\t\treturn { ...newValidationState, [FORM_ERROR]: globalErrors ? globalErrors : errorMessage };\r\n\t} else {\r\n\t\t// generic error.\r\n\t\tif (genericErrorCallback) {\r\n\t\t\tgenericErrorCallback();\r\n\t\t}\r\n\r\n\t\tif (errorMessage) {\r\n\t\t\treturn { [FORM_ERROR]: errorMessage };\r\n\t\t} else {\r\n\t\t\treturn {};\r\n\t\t}\r\n\t}\r\n};\r\n\r\n/**\r\n * Determines where a validation error occurred. Multiple sources can include the edit form, or any modals that also\r\n * include form fields that have validation such as redirects.\r\n * The returned value is treated as bitwise flags.\r\n */\r\nexport const getValidationErrorSource = (\r\n\tvalidationStateWithError: { [key: string]: any },\r\n\taxiosError: AxiosError,\r\n): ValidationErrorSource => {\r\n\t// destructure out the `FORM_ERROR` key and only operate on the remainder\r\n\tconst { ...validationState } = validationStateWithError;\r\n\tconst validationKeys = Object.keys(validationState);\r\n\r\n\tlet source = ValidationErrorSource.None;\r\n\r\n\tconst redirectErrorIndex = validationKeys.indexOf('__redirects');\r\n\r\n\tif (redirectErrorIndex !== -1) {\r\n\t\t// a redirect error is present, flag it and remove it from the keys to check other sources\r\n\t\tsource |= ValidationErrorSource.RedirectModal;\r\n\t\tvalidationKeys.splice(redirectErrorIndex, 1);\r\n\t}\r\n\r\n\tif (validationKeys.length > 0) {\r\n\t\t// if we still have validation errors at this point, the edit form was the culprit\r\n\t\tsource |= ValidationErrorSource.EditForm;\r\n\t}\r\n\r\n\tif (axiosError && axiosError.response && axiosError.response.status !== 400) {\r\n\t\t// status 400 is used for validation error messaging, and if we got an error that isn't related to valdation\r\n\t\t// then the error source should be the edit form\r\n\t\tsource |= ValidationErrorSource.EditForm;\r\n\t}\r\n\r\n\treturn source;\r\n};\r\n\r\n/**\r\n * Get an html class or ID safe string from provided string.\r\n *\r\n * @function getHtmlSafeName\r\n */\r\nexport const getHtmlSafeName = (name: string = ''): string => {\r\n\treturn name.replace(/[^a-z0-9]/g, (s) => {\r\n\t\tconst c = s.charCodeAt(0);\r\n\t\tif (c === 32) {\r\n\t\t\treturn '-';\r\n\t\t}\r\n\t\tif (c >= 65 && c <= 90) {\r\n\t\t\treturn '_' + s.toLowerCase();\r\n\t\t}\r\n\t\treturn '__' + ('000' + c.toString(16)).slice(-4);\r\n\t});\r\n};\r\n\r\nexport interface Currency {\r\n\t/** The number of digits to always display to the right of the decimal point */\r\n\treadonly minPrecision: 0 | 1 | 2 | 3 | 4 | 5 | 6;\r\n\r\n\t/** If true, the currency symbol will occur before the price numbers */\r\n\treadonly isPrefix: boolean;\r\n\r\n\t/** The  */\r\n\treadonly currencySymbol: string;\r\n\r\n\t/** The unique three character ISO-4217 code for this currency. */\r\n\treadonly isoCode: string;\r\n}\r\n\r\n/** United States Dollars */\r\nconst USD: Currency = {\r\n\tisoCode: 'USD',\r\n\tcurrencySymbol: '$',\r\n\tisPrefix: true,\r\n\tminPrecision: 2,\r\n};\r\n\r\n/**\r\n * Formats a price for display.\r\n * @param price The price to format or NaN if the price is \"not for sale\"\r\n */\r\nexport const formatPrice = (price: number, currency: Currency = USD) => {\r\n\tconst rawPriceFormat = (price: number) => {\r\n\t\tconst priceString: string = price.toString();\r\n\t\tconst decimalPointIndex: number = priceString.indexOf('.');\r\n\t\tconst lastDigitIndex: number = priceString.length - 1;\r\n\r\n\t\tif (decimalPointIndex === -1) {\r\n\t\t\treturn price.toFixed(currency.minPrecision);\r\n\t\t} else {\r\n\t\t\tconst numberOfDecimalPlaces: number = lastDigitIndex - decimalPointIndex;\r\n\r\n\t\t\tif (numberOfDecimalPlaces <= currency.minPrecision) {\r\n\t\t\t\treturn price.toFixed(currency.minPrecision);\r\n\t\t\t} else if (numberOfDecimalPlaces >= 7) {\r\n\t\t\t\treturn price.toFixed(6);\r\n\t\t\t} else {\r\n\t\t\t\treturn priceString;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tif (price == null || isNaN(price)) {\r\n\t\treturn 'N/A';\r\n\t}\r\n\r\n\treturn currency.isPrefix\r\n\t\t? `${currency.currencySymbol}${rawPriceFormat(price)}`\r\n\t\t: `${rawPriceFormat(price)}${currency.currencySymbol}`;\r\n};\r\n\r\n/**\r\n * Returns the default site defined in the DB. Useful if there is no scoping available\r\n * and you're trying to link to some Global content, for example.\r\n */\r\nexport const getDefaultSite = (): AppSiteDto | undefined => {\r\n\treturn AppState.sites.find((site) => site.isDefault);\r\n};\r\n\r\n/**\r\n * This interface closely resembles typescript enums\r\n */\r\nexport interface BaseEnum {\r\n\t[id: number]: string | number;\r\n}\r\n\r\n/**\r\n * This method gets the enum key from enum values\r\n */\r\nexport const getEnumKeyByValue = (value: string | number, type: BaseEnum) => {\r\n\treturn Object.keys(type).find((t) => type[t] == value);\r\n};\r\n","import * as React from 'react';\r\nimport { Input } from 'reactstrap';\r\nimport { Moment } from 'moment';\r\nimport { localMoment } from 'util/Time';\r\nimport AppState from 'AppState';\r\n\r\nexport interface TimePickerProps {\r\n\tonTimeChange: (value: any) => void;\r\n\tvalue: Moment | null;\r\n\ttimeIncrement: number;\r\n\tdisabled?: boolean;\r\n}\r\n\r\nexport const AM = 'AM';\r\nexport const PM = 'PM';\r\n\r\ninterface TimePickerItemProps {\r\n\tchildren: React.ReactNode;\r\n}\r\nclass TimePickerItem extends React.Component<TimePickerItemProps> {\r\n\tconstructor(props: TimePickerItemProps) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"time-picker__item\">\r\n\t\t\t\t<div className=\"time-picker__group\">{this.props.children}</div>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\n/**\r\n * Helper control for dealing with times. Used primarily by DateTime.tsx, but could be used anywhere.\r\n *\r\n * @class TimePicker\r\n * @extends {React.Component<TimePickerProps>}\r\n */\r\nclass TimePicker extends React.Component<TimePickerProps> {\r\n\tprivate static SecondsPerMinute = 60;\r\n\tprivate static MinutesPerHour = 60;\r\n\tprivate static HoursPerDay = 24;\r\n\r\n\t/** The default hour if the user doesn't provide one (12PM) */\r\n\tprivate static DefaultHour = 12;\r\n\r\n\t/** The default minutes if the user doesn't provide one (0) */\r\n\tprivate static DefaultMinutes = 0;\r\n\r\n\tprivate availableTimes: number[] = [];\r\n\r\n\tpublic static defaultProps: Partial<TimePickerProps> = {\r\n\t\ttimeIncrement: 15,\r\n\t};\r\n\r\n\tconstructor(props: TimePickerProps) {\r\n\t\tsuper(props);\r\n\r\n\t\tconst { timeIncrement } = props;\r\n\r\n\t\tif (timeIncrement <= 0) {\r\n\t\t\tthrow new Error('The time increment must be greater than zero!');\r\n\t\t}\r\n\r\n\t\tif (TimePicker.MinutesPerHour % timeIncrement !== 0) {\r\n\t\t\tthrow new Error('The time increment cannot result in fractional minutes!');\r\n\t\t}\r\n\r\n\t\tfor (let i = 0; i < TimePicker.MinutesPerHour; i += timeIncrement) {\r\n\t\t\tthis.availableTimes.push(i);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Event handler for changes on the hour dropdown\r\n\t */\r\n\tpublic handleHourUpdate = (e: React.FormEvent<HTMLInputElement>): void => {\r\n\t\tconst selectedHour = e.currentTarget.value;\r\n\t\tconst { value, onTimeChange } = this.props;\r\n\r\n\t\tif (!value) {\r\n\t\t\tonTimeChange(localMoment().hour(parseInt(selectedHour)).minute(TimePicker.DefaultMinutes));\r\n\t\t} else {\r\n\t\t\tlet newValue = value.clone().tz(AppState.settings.timeZone);\r\n\r\n\t\t\t// Add 12 hours when in PM\r\n\t\t\tconst meridiem = value.hour() >= 12 ? 12 : 0;\r\n\r\n\t\t\tnewValue = newValue.hour((parseInt(selectedHour) % 12) + meridiem);\r\n\r\n\t\t\tonTimeChange(newValue);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Event handler for changes on the minute dropdown\r\n\t */\r\n\tpublic handleMinuteUpdate = (e: React.FormEvent<HTMLInputElement>): void => {\r\n\t\tconst selectedMinute = e.currentTarget.value;\r\n\t\tconst { value, onTimeChange } = this.props;\r\n\r\n\t\tif (!value) {\r\n\t\t\tonTimeChange(localMoment().minute(parseInt(selectedMinute)).hour(TimePicker.DefaultHour));\r\n\t\t} else {\r\n\t\t\tonTimeChange(value.clone().minute(parseInt(selectedMinute)));\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Event handler for changes on the meridiem dropdown (AM/PM)\r\n\t */\r\n\tpublic handleMeridiemUpdate = (e: React.FormEvent<HTMLInputElement>): void => {\r\n\t\tconst selectedMeridiem = e.currentTarget.value;\r\n\t\tconst { value, onTimeChange } = this.props;\r\n\r\n\t\tconst newDate = localMoment(value || undefined);\r\n\r\n\t\tif (selectedMeridiem === AM && newDate.hour() >= 12) {\r\n\t\t\tnewDate.hour(newDate.hour() - 12);\r\n\t\t} else if (selectedMeridiem === PM && newDate.hour() < 12) {\r\n\t\t\tnewDate.hour(newDate.hour() + 12);\r\n\t\t}\r\n\r\n\t\tonTimeChange(newDate);\r\n\t};\r\n\r\n\t/**\r\n\t * Render method of the TimePicker component. Renders the time input as three separate inputs for hour, minute, and meridiem respectively.\r\n\t *\r\n\t * @returns\r\n\t * @memberof TimePicker\r\n\t */\r\n\tpublic render() {\r\n\t\tconst { value } = this.props;\r\n\r\n\t\tconst valueDate = value ? localMoment(value) : null;\r\n\r\n\t\tlet hour: number | string;\r\n\t\tlet minute: number | string;\r\n\t\tlet meridiem: string;\r\n\r\n\t\tif (valueDate && valueDate.isValid()) {\r\n\t\t\tconst currentHour = valueDate.hour();\r\n\t\t\thour = currentHour >= 12 ? currentHour - 12 : currentHour;\r\n\t\t\tif (hour === 0) {\r\n\t\t\t\thour = 12;\r\n\t\t\t}\r\n\r\n\t\t\tminute = valueDate.minute();\r\n\t\t\tmeridiem = valueDate.hour() >= 12 ? 'PM' : 'AM';\r\n\t\t} else {\r\n\t\t\thour = '';\r\n\t\t\tminute = '';\r\n\t\t\tmeridiem = '';\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<div className=\"time-picker\">\r\n\t\t\t\t<TimePickerItem>\r\n\t\t\t\t\t<Input\r\n\t\t\t\t\t\ttype=\"select\"\r\n\t\t\t\t\t\tclassName=\"time-picker__input\"\r\n\t\t\t\t\t\tdisabled={this.props.disabled}\r\n\t\t\t\t\t\tvalue={hour}\r\n\t\t\t\t\t\tonChange={this.handleHourUpdate}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<option value=\"\" />\r\n\t\t\t\t\t\t<option value={12}>12</option>\r\n\t\t\t\t\t\t<option value={1}>1</option>\r\n\t\t\t\t\t\t<option value={2}>2</option>\r\n\t\t\t\t\t\t<option value={3}>3</option>\r\n\t\t\t\t\t\t<option value={4}>4</option>\r\n\t\t\t\t\t\t<option value={5}>5</option>\r\n\t\t\t\t\t\t<option value={6}>6</option>\r\n\t\t\t\t\t\t<option value={7}>7</option>\r\n\t\t\t\t\t\t<option value={8}>8</option>\r\n\t\t\t\t\t\t<option value={9}>9</option>\r\n\t\t\t\t\t\t<option value={10}>10</option>\r\n\t\t\t\t\t\t<option value={11}>11</option>\r\n\t\t\t\t\t</Input>\r\n\t\t\t\t</TimePickerItem>\r\n\t\t\t\t<TimePickerItem>\r\n\t\t\t\t\t<Input\r\n\t\t\t\t\t\ttype=\"select\"\r\n\t\t\t\t\t\tclassName=\"time-picker__input\"\r\n\t\t\t\t\t\tdisabled={this.props.disabled}\r\n\t\t\t\t\t\tvalue={minute}\r\n\t\t\t\t\t\tonChange={this.handleMinuteUpdate}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<option value=\"\" />\r\n\t\t\t\t\t\t{this.availableTimes.map((availableTime, index) => (\r\n\t\t\t\t\t\t\t<option key={index} value={availableTime}>\r\n\t\t\t\t\t\t\t\t{(availableTime < 10 ? '0' : '') + availableTime.toString()}\r\n\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</Input>\r\n\t\t\t\t</TimePickerItem>\r\n\t\t\t\t<TimePickerItem>\r\n\t\t\t\t\t<Input\r\n\t\t\t\t\t\ttype=\"select\"\r\n\t\t\t\t\t\tclassName=\"time-picker__input\"\r\n\t\t\t\t\t\tdisabled={this.props.disabled}\r\n\t\t\t\t\t\tvalue={meridiem}\r\n\t\t\t\t\t\tonChange={this.handleMeridiemUpdate}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<option value=\"\" />\r\n\t\t\t\t\t\t<option value={AM}>AM</option>\r\n\t\t\t\t\t\t<option value={PM}>PM</option>\r\n\t\t\t\t\t</Input>\r\n\t\t\t\t</TimePickerItem>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default TimePicker;\r\n","import { Moment } from 'moment';\r\nimport * as React from 'react';\r\nimport { Button, Label } from 'reactstrap';\r\nimport TimePicker from './TimePicker';\r\nimport Spinner from 'components/shared/Spinner';\r\nimport AppState from 'AppState';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\n/** Lazily loaded types. These should ONLY to be used as type parameters for React.lazy. */\r\nimport { SingleDatePicker as singleDatePickerType__, SingleDatePickerShape } from 'react-dates';\r\n\r\n/** Lazy loading */\r\nconst SingleDatePicker = React.lazy<singleDatePickerType__>(\r\n\t() => import(/* webpackChunkName: \"single-date-picker-component\" */ 'react-dates/lib/components/SingleDatePicker'),\r\n);\r\n\r\ninterface DateTimePickerProps {\r\n\t/** The initial date and time value to use on the component. */\r\n\tdateTime: Moment | null;\r\n\r\n\t/** Whether this component is disabled. */\r\n\tdisabled: boolean;\r\n\r\n\t/** Callback when a new date or time has been selected in the date/time picker. */\r\n\tonDateTimeChange: (value: Moment | null) => void;\r\n\r\n\t/** Unique name of the date time picker */\r\n\tname: string;\r\n\r\n\t/** Show all the minutes in the minute dropdown */\r\n\tshowAllMinutes?: boolean;\r\n\r\n\t/** Props for the underlying SingleDatePicker */\r\n\tsingleDatePickerShape?: SingleDatePickerShape;\r\n\r\n\t/** Index for building testid */\r\n\tindex?: number;\r\n}\r\n\r\ninterface DateTimePickerState {\r\n\t/** Whether the inner date component has focus. */\r\n\tfocused: boolean;\r\n\r\n\t/** The current date/time value of the component. */\r\n\tdate: Moment | null;\r\n}\r\n\r\n/**\r\n * Component used to handle picking dates and times.\r\n *\r\n * @class DateTimePicker\r\n * @extends {(React.Component<DateTimePickerProps, DateTimePickerState>)}\r\n */\r\nclass DateTimePicker extends React.Component<DateTimePickerProps, DateTimePickerState> {\r\n\tstatic defaultProps = {\r\n\t\tindex: 0,\r\n\t};\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t\tconst { dateTime } = this.props;\r\n\t\tconst localizedDate = dateTime && dateTime.tz(AppState.settings.timeZone);\r\n\r\n\t\tthis.state = {\r\n\t\t\tfocused: false,\r\n\t\t\tdate: localizedDate,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Event that takes place when the user changes the date, but not the time.\r\n\t *\r\n\t * @private\r\n\t * @memberof DateTimePicker\r\n\t */\r\n\tprivate onDateChange = (date: Moment | null) => {\r\n\t\t// SingleDatePicker doesn't care about timezones so we must forcibly convert it to 12PM.\r\n\t\tconst newDate = date && date.tz(AppState.settings.timeZone).hour(12);\r\n\t\tthis.onDateTimeChange(newDate);\r\n\t};\r\n\r\n\t/**\r\n\t * Event that takes place when the user changes the date or the time.\r\n\t *\r\n\t * @private\r\n\t * @memberof DateTimePicker\r\n\t */\r\n\tprivate onDateTimeChange = (date: Moment | null) => {\r\n\t\tthis.setState({ date });\r\n\t\tthis.props.onDateTimeChange(date);\r\n\t};\r\n\r\n\t/** Clears the date and time, blanking the date and time pieces of the component. */\r\n\tprivate clearDateTime = () => {\r\n\t\tthis.setState({ date: null });\r\n\t\tthis.props.onDateTimeChange(null);\r\n\t};\r\n\r\n\t/** Event that takes place when the user changes the focus on the inner date component. */\r\n\tprivate onFocusChange = ({ focused }) => {\r\n\t\tthis.setState({ focused: !!focused });\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst { name } = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t<div className=\"datetime-picker\">\r\n\t\t\t\t<React.Suspense\r\n\t\t\t\t\tfallback={\r\n\t\t\t\t\t\t<div className=\"datetime-picker__loading\">\r\n\t\t\t\t\t\t\t<Spinner />\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t}\r\n\t\t\t\t>\r\n\t\t\t\t\t<div\r\n\t\t\t\t\t\tclassName=\"datetime-picker__item\"\r\n\t\t\t\t\t\tdata-testid={`datetimepicker-${toKebabCase(this.props.name)}-${this.props.index}`}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t<Label for={name} className=\"visually-hidden\">\r\n\t\t\t\t\t\t\tSelect date\r\n\t\t\t\t\t\t</Label>\r\n\t\t\t\t\t\t<SingleDatePicker\r\n\t\t\t\t\t\t\tid={name}\r\n\t\t\t\t\t\t\tshowDefaultInputIcon\r\n\t\t\t\t\t\t\tsmall\r\n\t\t\t\t\t\t\tdisabled={this.props.disabled}\r\n\t\t\t\t\t\t\tdate={this.state.date}\r\n\t\t\t\t\t\t\tfocused={this.state.focused}\r\n\t\t\t\t\t\t\tonDateChange={this.onDateChange}\r\n\t\t\t\t\t\t\tonFocusChange={this.onFocusChange}\r\n\t\t\t\t\t\t\t{...this.props.singleDatePickerShape}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div className=\"datetime-picker__item\">\r\n\t\t\t\t\t\t<TimePicker\r\n\t\t\t\t\t\t\tvalue={this.state.date}\r\n\t\t\t\t\t\t\tdisabled={this.props.disabled || !this.state.date}\r\n\t\t\t\t\t\t\tonTimeChange={this.onDateTimeChange}\r\n\t\t\t\t\t\t\ttimeIncrement={this.props.showAllMinutes ? 1 : undefined}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div className=\"datetime-picker__item\">\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\tcolor=\"primary-alt\"\r\n\t\t\t\t\t\t\tclassName=\"btn-block datetime-picker__submit\"\r\n\t\t\t\t\t\t\toutline\r\n\t\t\t\t\t\t\tonClick={this.clearDateTime}\r\n\t\t\t\t\t\t\tdisabled={this.props.disabled}\r\n\t\t\t\t\t\t\tdata-testid=\"clear-scheduled-date\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tClear\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div className=\"datetime-picker__item\">\r\n\t\t\t\t\t\t<span className=\"datetime-picker__timezone-description\">\r\n\t\t\t\t\t\t\tTime zone:{' '}\r\n\t\t\t\t\t\t\t<span className=\"datetime-picker__timezone-name\">{AppState.settings.timeZone}</span>.\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</React.Suspense>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default DateTimePicker;\r\n","import { Moment } from 'moment';\r\nimport { localMoment } from 'util/Time';\r\nimport * as React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { FormGroup } from 'reactstrap';\r\nimport { InputProps, ValidationMessages } from '.';\r\nimport FieldLabel from './FieldLabel';\r\nimport DateTimePicker from './helper/DateTimePicker';\r\nimport { SingleDatePickerShape } from 'react-dates';\r\n\r\n/**\r\n * Component used to handle dates and times within forms.\r\n *\r\n * @class DatePicker\r\n * @extends {(React.Component<FieldRenderProps & InputProps>)}\r\n */\r\nclass DateTime extends React.Component<\r\n\tFieldRenderProps<any, HTMLInputElement> &\r\n\t\tInputProps & { showAllMinutes?: boolean; singleDatePickerShape?: SingleDatePickerShape }\r\n> {\r\n\tprivate initialValue: Moment | null;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\t// the field value is a string, but the DateTimePicker component expects the initial\r\n\t\t// date time as a moment object, so create one\r\n\t\tthis.initialValue = this.props.input.value ? localMoment(this.props.input.value) : null;\r\n\t}\r\n\r\n\tprivate onDateTimeChange = (date: Moment) => {\r\n\t\t// a new date/time has been picked, update the field value with the new date\r\n\t\tthis.props.input.onChange(date);\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<FormGroup className={this.props.meta.dirty ? 'form-group--dirty' : ''}>\r\n\t\t\t\t<FieldLabel {...this.props} />\r\n\r\n\t\t\t\t<DateTimePicker\r\n\t\t\t\t\tdateTime={this.initialValue}\r\n\t\t\t\t\tdisabled={this.props.disabled}\r\n\t\t\t\t\tonDateTimeChange={this.onDateTimeChange}\r\n\t\t\t\t\tname={this.props.input.name}\r\n\t\t\t\t\tshowAllMinutes={this.props.showAllMinutes}\r\n\t\t\t\t\tsingleDatePickerShape={this.props.singleDatePickerShape}\r\n\t\t\t\t/>\r\n\r\n\t\t\t\t<ValidationMessages meta={this.props.meta} id={this.props.input.name} />\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default DateTime;\r\n","import * as React from 'react';\r\nimport { Field } from 'react-final-form';\r\nimport { OnChange } from 'react-final-form-listeners';\r\nimport AdminTabsContext, { AdminTabsContextValues } from 'components/shared/edit/tabs/AdminTabsContext';\r\nimport DefaultSuggestedValue from './DefaultSuggestedValue';\r\n\r\ntype stringFunction = (inputValue: string | unknown) => string | unknown;\r\n\r\ninterface WhenFieldChangesProps {\r\n\tfield: string;\r\n\tbecomes?: any;\r\n\tset: string;\r\n\tto: string | stringFunction;\r\n\trequireUserConfirmation?: boolean;\r\n\trenderSuggestedValue?: (suggestedValue: string, applySuggestedValue: () => void) => React.ReactNode;\r\n}\r\n\r\ninterface WhenFieldChangesState {\r\n\tsuggestedValue: string;\r\n}\r\n\r\n/**\r\n * Component that allows you to set the value of a field based on the value of another.\r\n *\r\n * @class WhenFieldChanges\r\n * @extends {React.Component<WhenFieldChangesProps, WhenFieldChangesState>}\r\n */\r\nclass WhenFieldChanges extends React.Component<WhenFieldChangesProps, WhenFieldChangesState> {\r\n\tpublic static contextType: React.Context<any> = AdminTabsContext;\r\n\tpublic declare context: AdminTabsContextValues;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tsuggestedValue: '',\r\n\t\t};\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst { field, becomes, set, to, requireUserConfirmation, renderSuggestedValue } = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t// in react-final-form, <Field /> is really just a subscription to a specific field, based on `name`\r\n\t\t\t// this is pretty much the same as a <FormSpy /> but for a specific field only.\r\n\t\t\t<Field name={set} subscription={{ value: true }}>\r\n\t\t\t\t{(props) => {\r\n\t\t\t\t\tconst {\r\n\t\t\t\t\t\tinput: { onChange, value },\r\n\t\t\t\t\t} = props;\r\n\r\n\t\t\t\t\t// function that will update the value of the form field in react-final-form.\r\n\t\t\t\t\tconst applySuggestedValue = () => {\r\n\t\t\t\t\t\tonChange(this.state.suggestedValue);\r\n\r\n\t\t\t\t\t\t// resets the suggest value.\r\n\t\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\t\tsuggestedValue: '',\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{/* only display the suggestion if the prop is set, and the current value of the field\r\n\t\t\t\t\t\t\t\tis different than the suggestion. this uses the render props pattern to allow you to modify\r\n\t\t\t\t\t\t\t\thow this looks/works from other components that could use this. */}\r\n\r\n\t\t\t\t\t\t\t{requireUserConfirmation &&\r\n\t\t\t\t\t\t\tthis.state.suggestedValue &&\r\n\t\t\t\t\t\t\tthis.state.suggestedValue !== value ? (\r\n\t\t\t\t\t\t\t\trenderSuggestedValue ? (\r\n\t\t\t\t\t\t\t\t\trenderSuggestedValue(this.state.suggestedValue, applySuggestedValue)\r\n\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t<DefaultSuggestedValue\r\n\t\t\t\t\t\t\t\t\t\tsuggestedValue={this.state.suggestedValue}\r\n\t\t\t\t\t\t\t\t\t\tapplySuggestedValue={applySuggestedValue}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t<OnChange name={field}>\r\n\t\t\t\t\t\t\t\t{(fieldValue) => {\r\n\t\t\t\t\t\t\t\t\tif (becomes !== undefined && fieldValue !== becomes) {\r\n\t\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\tlet newValue;\r\n\r\n\t\t\t\t\t\t\t\t\t// we allow users to pass a string if it's always constant, or\r\n\t\t\t\t\t\t\t\t\t// a function to do custom operations\r\n\t\t\t\t\t\t\t\t\tif (typeof to === 'function') {\r\n\t\t\t\t\t\t\t\t\t\tnewValue = to(fieldValue);\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\tnewValue = fieldValue;\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t// only update the value on the form as long as we're not requiring\r\n\t\t\t\t\t\t\t\t\t// user confirmation\r\n\t\t\t\t\t\t\t\t\tif (!requireUserConfirmation) {\r\n\t\t\t\t\t\t\t\t\t\tonChange(newValue);\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t// store the suggestion in state.\r\n\t\t\t\t\t\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\t\t\t\t\t\tsuggestedValue: newValue,\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\tthis.context.highlightTab(this.context.parentTab);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t</OnChange>\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t</Field>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default WhenFieldChanges;\r\n","import React, { useRef } from 'react';\r\nimport { useTooltipTriggerState } from '@react-stately/tooltip';\r\nimport { Overlay, useTooltip, useTooltipTrigger, useOverlay, useOverlayPosition, mergeProps } from 'react-aria';\r\nimport type { Placement } from '@react-types/overlays';\r\n\r\ninterface TooltipProps {\r\n\tchildren: React.ReactElement;\r\n\tlabel: string;\r\n\tplacement?: Placement;\r\n\toffset?: number;\r\n}\r\n\r\nexport default function Tooltip(props: TooltipProps) {\r\n\tconst { label, placement, offset } = props;\r\n\r\n\tconst triggerRef = useRef<HTMLDivElement>(null);\r\n\tconst state = useTooltipTriggerState({ delay: 0 });\r\n\tconst { triggerProps, tooltipProps } = useTooltipTrigger({}, state, triggerRef);\r\n\tconst { tooltipProps: tooltipElementProps } = useTooltip(tooltipProps, state);\r\n\r\n\tconst overlayRef = useRef<HTMLDivElement>(null);\r\n\r\n\tconst { overlayProps } = useOverlay(\r\n\t\t{\r\n\t\t\tisOpen: state.isOpen,\r\n\t\t\tonClose: state.close,\r\n\t\t\tshouldCloseOnBlur: true,\r\n\t\t\tisDismissable: true,\r\n\t\t\tisKeyboardDismissDisabled: false,\r\n\t\t},\r\n\t\toverlayRef,\r\n\t);\r\n\r\n\tconst { overlayProps: positionProps } = useOverlayPosition({\r\n\t\ttargetRef: triggerRef,\r\n\t\toverlayRef: overlayRef,\r\n\t\tisOpen: state.isOpen,\r\n\t\tonClose: state.close,\r\n\t\tplacement: placement || 'right',\r\n\t\toffset: offset || 2,\r\n\t});\r\n\r\n\treturn (\r\n\t\t<div style={{ position: 'relative', display: 'inline-block' }}>\r\n\t\t\t<div ref={triggerRef}>\r\n\t\t\t\t{React.cloneElement(props.children, { ...triggerProps, ...props.children.props })}\r\n\t\t\t</div>\r\n\t\t\t{state.isOpen && (\r\n\t\t\t\t<Overlay>\r\n\t\t\t\t\t<div ref={overlayRef} {...mergeProps(overlayProps, positionProps)}>\r\n\t\t\t\t\t\t<span className=\"roc-tooltip\" {...tooltipElementProps}>\r\n\t\t\t\t\t\t\t{label}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</Overlay>\r\n\t\t\t)}\r\n\t\t</div>\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport Tooltip from './Tooltip';\r\nimport type { Placement } from '@react-types/overlays';\r\n\r\ninterface RocTitleProps {\r\n\tlabel: string;\r\n\talignment?: Placement;\r\n\toffset?: number;\r\n\tisEnabled?: boolean;\r\n\tstyle?: any;\r\n\tchildren: React.ReactElement;\r\n}\r\n\r\nfunction RocTitle(props: RocTitleProps) {\r\n\treturn props.isEnabled ? (\r\n\t\t<Tooltip label={props.label} placement={props.alignment} offset={props.offset}>\r\n\t\t\t{props.children}\r\n\t\t</Tooltip>\r\n\t) : (\r\n\t\t<>{props.children}</>\r\n\t);\r\n}\r\n\r\nRocTitle.defaultProps = {\r\n\tisEnabled: true,\r\n\talignment: 'right',\r\n};\r\n\r\nexport default RocTitle;\r\n","var api = require(\"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n            var content = require(\"!!../../node_modules/mini-css-extract-plugin/dist/loader.js!../../node_modules/css-loader/dist/cjs.js!../../node_modules/postcss-loader/src/index.js!../../node_modules/sass-loader/dist/cjs.js!./app.scss\");\n\n            content = content.__esModule ? content.default : content;\n\n            if (typeof content === 'string') {\n              content = [[module.id, content, '']];\n            }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","import AppState from 'AppState';\r\nimport * as React from 'react';\r\nimport { NavLink } from 'react-router-dom';\r\nimport Spinner from './shared/Spinner';\r\nimport RichTextContent from 'components/shared/RichTextContent';\r\nconst PlugSVG = React.lazy(() => import(/* webpackChunkName: \"plug-svg\" */ './shared/svg/PlugSVG'));\r\n\r\n/**\r\n * View that renders for 404 pages.\r\n *\r\n * @class PageNotFound\r\n * @extends {React.PureComponent}\r\n */\r\n\r\nclass PageNotFound extends React.PureComponent {\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tsettings: { option1Text404, option2Text404, option1Link404, option2Link404, text404 },\r\n\t\t} = AppState;\r\n\r\n\t\treturn (\r\n\t\t\t<div className=\"main__section\">\r\n\t\t\t\t<div className=\"page-not-found\">\r\n\t\t\t\t\t<div className=\"page-not-found__left\">\r\n\t\t\t\t\t\t<h1 className=\"page-not-found__title\">404</h1>\r\n\t\t\t\t\t\t<RichTextContent className=\"page-not-found__para\" htmlContent={text404} />\r\n\t\t\t\t\t\t<div className=\"page-not-found__actions\">\r\n\t\t\t\t\t\t\t<div className=\"page-not-found__actions-item\">\r\n\t\t\t\t\t\t\t\t{!option1Link404 ? null : (\r\n\t\t\t\t\t\t\t\t\t<NavLink\r\n\t\t\t\t\t\t\t\t\t\tto={option1Link404}\r\n\t\t\t\t\t\t\t\t\t\tclassName=\"btn btn-primary btn-inline btn-width-xlarge\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t{option1Text404}\r\n\t\t\t\t\t\t\t\t\t</NavLink>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t{!option2Link404 ? null : (\r\n\t\t\t\t\t\t\t\t\t<NavLink\r\n\t\t\t\t\t\t\t\t\t\tto={option2Link404}\r\n\t\t\t\t\t\t\t\t\t\tclassName=\"btn btn-outline-primary-special btn-inline btn-width-xlarge\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t{option2Text404}\r\n\t\t\t\t\t\t\t\t\t</NavLink>\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div className=\"page-not-found__right\">\r\n\t\t\t\t\t\t<React.Suspense fallback={<Spinner />}>\r\n\t\t\t\t\t\t\t<PlugSVG class=\"page-not-found__plug\" />\r\n\t\t\t\t\t\t</React.Suspense>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default PageNotFound;\r\n","import * as React from 'react';\r\nimport { Popover } from 'reactstrap';\r\nimport HelpSVG from '../svg/HelpSVG';\r\n\r\ninterface TooltipPopoverState {\r\n\tpopoverOpen: boolean;\r\n}\r\n\r\n/**\r\n * Tooltip Popover component\r\n * This component is displayed in the edit form in each field labels, if there is tooltip data available for that field.\r\n * Clicking in this popover will display the selected tooltip text.\r\n *\r\n * @class TooltipPopover\r\n * @extends {React.Component<any, TooltipPopoverState>}\r\n */\r\nclass TooltipPopover extends React.Component<any, TooltipPopoverState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tpopoverOpen: false,\r\n\t\t};\r\n\t}\r\n\r\n\tpublic toggle = () => {\r\n\t\tthis.setState({\r\n\t\t\tpopoverOpen: !this.state.popoverOpen,\r\n\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"tooltip__item\">\r\n\t\t\t\t<button\r\n\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\tclassName=\"tooltip__tooltip-wrapper\"\r\n\t\t\t\t\tid={this.props.name + '_tooltip'}\r\n\t\t\t\t\tonClick={this.toggle}\r\n\t\t\t\t>\r\n\t\t\t\t\t<HelpSVG class={'tooltip__tooltip'} />\r\n\t\t\t\t</button>\r\n\t\t\t\t<Popover\r\n\t\t\t\t\tplacement={this.props.placement}\r\n\t\t\t\t\tisOpen={this.state.popoverOpen}\r\n\t\t\t\t\ttarget={this.props.name + '_tooltip'}\r\n\t\t\t\t\ttoggle={this.toggle}\r\n\t\t\t\t\tdisabled={this.props.disabled}\r\n\t\t\t\t>\r\n\t\t\t\t\t{this.props.children}\r\n\t\t\t\t</Popover>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default TooltipPopover;\r\n","import AppState from 'AppState';\r\nimport React, { useContext, useEffect } from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\nimport AutoSuggestContext from '../auto-suggest/AutoSuggestContext';\r\nimport AutoSuggestNoResultsText from '../auto-suggest/AutoSuggestNoResultsText';\r\nimport { AutoSuggestRenderMenuProps } from '../auto-suggest/Types';\r\nimport EditContext from './EditContext';\r\nimport AutoSuggestSingleField from './fields/AutoSuggestSingleField';\r\n\r\nexport enum ScopeFieldInclude {\r\n\tAll = 0,\r\n\tSiteCollectionsOnly = 1,\r\n\tSitesOnly = 2,\r\n}\r\n\r\ninterface ScopeFieldProps extends WithTestIdOptional {\r\n\tdisabled?: boolean;\r\n\tinclude?: ScopeFieldInclude;\r\n}\r\n\r\ninterface AppArrayItem {\r\n\tlabel: string;\r\n\tvalue: string;\r\n\ttype: 'Site' | 'Site Collection';\r\n}\r\n\r\nconst compare = (a: AppArrayItem, b: AppArrayItem) => {\r\n\tif (a.label < b.label) {\r\n\t\treturn -1;\r\n\t}\r\n\r\n\tif (a.label > b.label) {\r\n\t\treturn 1;\r\n\t}\r\n\r\n\treturn 0;\r\n};\r\n\r\nconst defaultTestId = 'scope-picker';\r\n\r\n/**\r\n * Field that displays the scoping options (Global, Site Collection, Site) for a scoped entity\r\n * @param param0\r\n */\r\nfunction ScopeField({ disabled = false, include = ScopeFieldInclude.All, testId }: ScopeFieldProps) {\r\n\tconst {\r\n\t\tsetCurrentScope,\r\n\t\tcurrentScope,\r\n\t\tisCreateMode,\r\n\t\tsetOriginalScope,\r\n\t\tsetScopeChanged,\r\n\t\toriginalScope,\r\n\t} = useContext(EditContext);\r\n\r\n\tconst mergedSitesAndCollections: Array<AppArrayItem> = [];\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!isCreateMode) {\r\n\t\t\tsetOriginalScope(currentScope);\r\n\t\t}\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tif (include === ScopeFieldInclude.All || include === ScopeFieldInclude.SitesOnly) {\r\n\t\tAppState.sites.map((site) => {\r\n\t\t\tmergedSitesAndCollections.push({ label: site.name, value: site.id, type: 'Site', ...site });\r\n\t\t});\r\n\t}\r\n\r\n\tif (include === ScopeFieldInclude.All || include === ScopeFieldInclude.SiteCollectionsOnly) {\r\n\t\tAppState.siteCollections.map((siteCollection) => {\r\n\t\t\tmergedSitesAndCollections.push({\r\n\t\t\t\tlabel: siteCollection.name,\r\n\t\t\t\tvalue: siteCollection.id,\r\n\t\t\t\ttype: 'Site Collection',\r\n\t\t\t\t...siteCollection,\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\r\n\treturn AppState.config.multiSiteEnabled ? (\r\n\t\t<>\r\n\t\t\t<span className=\"visually-hidden\">\r\n\t\t\t\tChanging this scope field will automatically update the content of various tabs.\r\n\t\t\t</span>\r\n\t\t\t<AutoSuggestSingleField\r\n\t\t\t\tlabel=\"Scope\"\r\n\t\t\t\tforceEmptyLabel\r\n\t\t\t\tlabelElementHidden\r\n\t\t\t\tname=\"scope\"\r\n\t\t\t\tautoSuggestOptions={{ staticData: mergedSitesAndCollections }}\r\n\t\t\t\tplaceholder=\"Global\"\r\n\t\t\t\tdisabled={disabled}\r\n\t\t\t\ttestId={testId ? testId : 'scope-picker'}\r\n\t\t\t\trenderMenu={(props) => {\r\n\t\t\t\t\treturn <ScopeFieldMenu {...props} />;\r\n\t\t\t\t}}\r\n\t\t\t\tonChange={(scope) => {\r\n\t\t\t\t\tsetScopeChanged((scope && scope.value) !== (originalScope && originalScope.value));\r\n\t\t\t\t\tsetCurrentScope(scope);\r\n\t\t\t\t}}\r\n\t\t\t/>\r\n\t\t</>\r\n\t) : null;\r\n}\r\n\r\nfunction ScopeFieldMenu(props: AutoSuggestRenderMenuProps) {\r\n\tconst context = useContext(AutoSuggestContext);\r\n\r\n\tconst {\r\n\t\tdata: { results, hasMore, isLoading },\r\n\t\ttestId,\r\n\t} = props;\r\n\r\n\tconst { downshift } = context;\r\n\r\n\tif (!downshift) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst siteResults: AppArrayItem[] = results\r\n\t\t.filter((resultsItem) => {\r\n\t\t\treturn resultsItem.type === 'Site';\r\n\t\t})\r\n\t\t.sort(compare);\r\n\r\n\tconst siteCollectionResults: AppArrayItem[] = results\r\n\t\t.filter((resultsItem) => {\r\n\t\t\treturn resultsItem.type === 'Site Collection';\r\n\t\t})\r\n\t\t.sort(compare);\r\n\r\n\tconst { getMenuProps, getItemProps, inputValue, highlightedIndex } = downshift;\r\n\r\n\treturn (\r\n\t\t<div className=\"autosuggest-menu-categorized\">\r\n\t\t\t<ul\r\n\t\t\t\tclassName=\"dropdown-menu autosuggest-menu-categorized__list\"\r\n\t\t\t\t{...getMenuProps({\r\n\t\t\t\t\topen: true,\r\n\t\t\t\t})}\r\n\t\t\t>\r\n\t\t\t\t{siteCollectionResults && siteCollectionResults.length > 0 ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<li className=\"autosuggest-menu-categorized__item-group-title\">SITE COLLECTION</li>\r\n\t\t\t\t\t\t{siteCollectionResults.map((item, index) => (\r\n\t\t\t\t\t\t\t// tslint:disable-next-line: jsx-key\r\n\t\t\t\t\t\t\t<li\r\n\t\t\t\t\t\t\t\tdata-testid={`${defaultTestId}-${item.value}`}\r\n\t\t\t\t\t\t\t\tkey={index}\r\n\t\t\t\t\t\t\t\tclassName={\r\n\t\t\t\t\t\t\t\t\thighlightedIndex === index\r\n\t\t\t\t\t\t\t\t\t\t? 'autosuggest-menu-categorized__item autosuggest-menu-categorized__item--highlighted'\r\n\t\t\t\t\t\t\t\t\t\t: 'autosuggest-menu-categorized__item'\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t{...getItemProps({\r\n\t\t\t\t\t\t\t\t\titem,\r\n\t\t\t\t\t\t\t\t\tindex: index,\r\n\t\t\t\t\t\t\t\t\tkey: `${item.value}-${index}`,\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<span>{item.label}</span>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t{siteResults && siteResults.length > 0 ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<li className=\"autosuggest-menu-categorized__item-group-title\">SITES</li>\r\n\t\t\t\t\t\t{siteResults.map((item, index) => (\r\n\t\t\t\t\t\t\t// tslint:disable-next-line: jsx-key\r\n\t\t\t\t\t\t\t<li\r\n\t\t\t\t\t\t\t\tdata-testid={`${testId ? testId : defaultTestId}-${item.value}`}\r\n\t\t\t\t\t\t\t\tkey={index}\r\n\t\t\t\t\t\t\t\tclassName={\r\n\t\t\t\t\t\t\t\t\thighlightedIndex === index + siteCollectionResults.length\r\n\t\t\t\t\t\t\t\t\t\t? 'autosuggest-menu-categorized__item autosuggest-menu-categorized__item--highlighted'\r\n\t\t\t\t\t\t\t\t\t\t: 'autosuggest-menu-categorized__item'\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t{...getItemProps({\r\n\t\t\t\t\t\t\t\t\titem,\r\n\t\t\t\t\t\t\t\t\tindex: index + siteCollectionResults.length,\r\n\t\t\t\t\t\t\t\t\tkey: `${item.value}-${index}`,\r\n\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<span>{item.label}</span>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : null}\r\n\t\t\t\t{isLoading ? <li className=\"autosuggest-menu-categorized__item\">Loading...</li> : null}\r\n\t\t\t\t{!isLoading && hasMore ? (\r\n\t\t\t\t\t<li className=\"autosuggest-menu-categorized__item-group-title\">\r\n\t\t\t\t\t\t<em>More results available. Enter keyword to search...</em>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t) : null}\r\n\t\t\t\t{!isLoading && results && results.length === 0 ? (\r\n\t\t\t\t\t<li className=\"autosuggest-menu-categorized__item\">\r\n\t\t\t\t\t\t<AutoSuggestNoResultsText inputValue={inputValue} />\r\n\t\t\t\t\t</li>\r\n\t\t\t\t) : null}\r\n\t\t\t</ul>\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\nexport default ScopeField;\r\n","import * as React from 'react';\r\nimport { EditContext } from 'types';\r\n\r\n/* ========= NOTES =========\r\n * the EditContext holds the overall state of the EditForm\r\n * this Context gets injected to all the Edit form controls like EditBackToListingLink, EditCancelButton, etc\r\n * the way the injection happens is that the Component's props get extended with the context\r\n * notice that all the components are exported like this: export default withEditContext({ComponentName});\r\n * take a look at withEditContext.tsx for how the context is added to the default props\r\n * plus EditBackToListingLink and EditCancelButton for different ways of consuming it\r\n * - further info:\r\n * https://reactjs.org/docs/context.html\r\n * ========== END ==========\r\n */\r\n\r\nconst editContext: EditContext = {} as EditContext;\r\n\r\nexport default React.createContext(editContext);\r\n","import React from 'react';\r\nimport { Modal, ModalHeader, ModalBody, ModalFooter, Button } from 'reactstrap';\r\nimport { EditProps } from 'components/shared/edit';\r\nimport { Form, Field } from 'react-final-form';\r\nimport TooltipDto from './types/TooltipDto';\r\nimport { TextArea, Toggle } from 'components/shared/edit/fields';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { AxiosError } from 'axios';\r\nimport { FORM_ERROR, FormSubscription } from 'final-form';\r\nimport Warning from 'components/shared/Warning';\r\nimport withEditContext from 'components/shared/edit/withEditContext';\r\nimport { OnChange } from 'react-final-form-listeners';\r\nimport WhenFieldChanges from 'components/shared/edit/fields/WhenFieldChanges';\r\nimport Spinner from 'components/shared/Spinner';\r\nimport { setTooltipPromiseByKey, clearTooltipCache } from 'services/EntityDefinitionService';\r\nimport NavigationPrompt from 'react-router-navigation-prompt';\r\nimport ModalClose from 'components/shared/ModalClose';\r\nimport Confirm from 'components/shared/Confirm';\r\nimport { firstCharacterToUpper } from 'util/StringUtil';\r\nimport ErrorAlert from '../ErrorAlert';\r\nimport { EntityDefinition } from 'types';\r\nimport ValidationErrorAlert, { AlertType } from '~/components/shared/edit/ValidationErrorAlert';\r\n\r\n/**\r\n * Tooltip Edit Overlay component state\r\n */\r\ninterface TooltipEditOverlayState {\r\n\tinitialValues: TooltipDto;\r\n\tvalidationError: boolean;\r\n\tsaveError: AxiosError | null;\r\n\tisTypeSpecific: boolean;\r\n\tisSaving: boolean;\r\n\twasOpened: boolean;\r\n}\r\n\r\n/**\r\n * Tooltip Edit Overlay component props\r\n */\r\ninterface TooltipEditOverlayProps {\r\n\tisOpen: boolean;\r\n\ttoggle: () => void;\r\n\tname: string;\r\n\tlabel: string;\r\n\ttooltipData: { [name: string]: { fieldTooltip: TooltipDto; universalTooltip: TooltipDto } };\r\n\tentityDefinition: EntityDefinition;\r\n\tsubscription?: FormSubscription;\r\n}\r\n\r\n/**\r\n * Tooltip Edit Overlay component\r\n * On the edit form, the local and global tooltip data for the current field can be created/edited.\r\n * Triggered by the TooltipEditButton compnent if the AppState.user.isTooltipEditMode is true.\r\n */\r\nclass TooltipEditOverlay extends React.Component<TooltipEditOverlayProps & EditProps, TooltipEditOverlayState> {\r\n\tprivate mounted: boolean;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.resetState(true);\r\n\t}\r\n\r\n\tprivate resetState(fromConstructor: boolean): void {\r\n\t\tif (!fromConstructor && !this.state.wasOpened) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst { tooltipData, name } = this.props;\r\n\r\n\t\tconst fieldTooltip = tooltipData && tooltipData[name] && tooltipData[name].fieldTooltip;\r\n\t\tconst universalTooltip = tooltipData && tooltipData[name] && tooltipData[name].universalTooltip;\r\n\r\n\t\tconst isTypeSpecific = fieldTooltip && fieldTooltip.entityTypeId ? true : false;\r\n\r\n\t\tconst state = {\r\n\t\t\tvalidationError: false,\r\n\t\t\tsaveError: null,\r\n\t\t\tisTypeSpecific,\r\n\t\t\tisSaving: false,\r\n\t\t\tinitialValues: {\r\n\t\t\t\t/* PLEASE INVESTIGATE AND FIX */\r\n\t\t\t\t/** @ts-expect-error - INCORRECT SPREAD USAGE - `oldEntityTypeId` is ALWAYS OVERWRITTEN by the following \"...SPREAD\" OPERATION */\r\n\t\t\t\toldEntityTypeId: fieldTooltip ? fieldTooltip.entityTypeId : null,\r\n\t\t\t\t/** @ts-expect-error - INCORRECT SPREAD USAGE - `isUniversal` is ALWAYS OVERWRITTEN by the following \"...SPREAD\" OPERATION */\r\n\t\t\t\tisUniversal: !isTypeSpecific,\r\n\t\t\t\t/** @ts-expect-error - INCORRECT SPREAD USAGE - `isTypeSpecific` is ALWAYS OVERWRITTEN by the following \"...SPREAD\" OPERATION */\r\n\t\t\t\tisTypeSpecific,\r\n\t\t\t\t...(isTypeSpecific ? fieldTooltip : universalTooltip),\r\n\t\t\t\tfieldName: firstCharacterToUpper(name),\r\n\t\t\t\tlocalText: fieldTooltip && fieldTooltip.text,\r\n\t\t\t\tglobalText: universalTooltip && universalTooltip.text,\r\n\t\t\t},\r\n\t\t};\r\n\r\n\t\tif (fromConstructor) {\r\n\t\t\t// eslint-disable-next-line\r\n\t\t\tthis.state = {\r\n\t\t\t\t...state,\r\n\t\t\t\twasOpened: false,\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tthis.setState({ ...state });\r\n\t\t}\r\n\t}\r\n\r\n\tpublic componentDidMount() {\r\n\t\tthis.mounted = true;\r\n\t}\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\tthis.mounted = false;\r\n\t}\r\n\r\n\tprivate onIsTypeSpecificChange = (isTypeSpecific: boolean): void => {\r\n\t\tthis.setState({ isTypeSpecific });\r\n\t};\r\n\r\n\tprivate save = (formValues: any) => {\r\n\t\tconst { editContext, toggle, name, tooltipData } = this.props;\r\n\t\tconst { isTypeSpecific } = this.state;\r\n\r\n\t\tconst fieldTooltip = tooltipData[name] && tooltipData[name].fieldTooltip;\r\n\t\tconst universalTooltip = tooltipData[name] && tooltipData[name].universalTooltip;\r\n\r\n\t\tconst id = isTypeSpecific ? fieldTooltip && fieldTooltip.id : universalTooltip && universalTooltip.id;\r\n\t\tconst text = isTypeSpecific ? formValues.localText : formValues.globalText;\r\n\r\n\t\t//#region Commerce\r\n\t\tlet attributeCode = '';\r\n\t\tconst anyDefinition = editContext.entityDefinition as any;\r\n\t\tif (isTypeSpecific && anyDefinition.attributeCode && anyDefinition.attributeCode !== '') {\r\n\t\t\tattributeCode = anyDefinition.attributeCode;\r\n\t\t}\r\n\t\t//#endregion\r\n\r\n\t\tconst values = {\r\n\t\t\t...formValues,\r\n\t\t\tentityTypeId: isTypeSpecific ? editContext.entityTypeId : null,\r\n\t\t\tisUniversal: !isTypeSpecific,\r\n\t\t\ttext,\r\n\t\t\t//#region Commerce\r\n\t\t\tattributeCode,\r\n\t\t\t//#endregion\r\n\t\t};\r\n\r\n\t\tif (id) {\r\n\t\t\tvalues.id = id;\r\n\t\t} else {\r\n\t\t\tdelete values.id;\r\n\t\t}\r\n\r\n\t\tconsole.log('Saving tooltipd data', values);\r\n\r\n\t\tconst url = `/ajax/tooltips/${values.id ? values.id : ''}`;\r\n\r\n\t\tthis.setState({ isSaving: true });\r\n\r\n\t\t// a promise must be returned for react-final-form.\r\n\t\tAxiosHelper.post(url, values)\r\n\t\t\t.then(() => {\r\n\t\t\t\t// prevent attempting to setState after the component has unmounted.\r\n\t\t\t\tif (!this.mounted) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttoggle();\r\n\r\n\t\t\t\tif (isTypeSpecific) {\r\n\t\t\t\t\t// invalidate tooltip cache for the current entity type\r\n\t\t\t\t\tsetTooltipPromiseByKey(this.props.entityDefinition.code, undefined);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// invalidate tooltip cache for all the entity types\r\n\t\t\t\t\tclearTooltipCache();\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// reload the edit form tooltip data\r\n\t\t\t\teditContext.getTooltipsForEntity();\r\n\r\n\t\t\t\t// reset form initial values\r\n\t\t\t\tthis.setState({\r\n\t\t\t\t\tinitialValues: {\r\n\t\t\t\t\t\t...values,\r\n\t\t\t\t\t\tentityTypeId: isTypeSpecific ? editContext.entityTypeId : null,\r\n\t\t\t\t\t\toldEntityTypeId: isTypeSpecific ? editContext.entityTypeId : null,\r\n\t\t\t\t\t\tisUniversal: !isTypeSpecific,\r\n\t\t\t\t\t},\r\n\t\t\t\t\tisSaving: false,\r\n\t\t\t\t});\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\t// prevent attempting to setState after the component has unmounted.\r\n\t\t\t\tif (!this.mounted) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconsole.log('Unable to save tooltip', error.message);\r\n\r\n\t\t\t\t// validation error\r\n\t\t\t\tif (error && error.response && error.response.status === 400) {\r\n\t\t\t\t\tconst newValidationState = Object.keys(error.response.data).reduce((acc, value) => {\r\n\t\t\t\t\t\tconst errorMessage = error.response && error.response.data[value];\r\n\t\t\t\t\t\tacc[value] = errorMessage;\r\n\r\n\t\t\t\t\t\tif (value === 'text') {\r\n\t\t\t\t\t\t\t// we use two fields here (client side) for the text (server side),\r\n\t\t\t\t\t\t\t// so we need to update acc to highlight the validation messages\r\n\t\t\t\t\t\t\tlet newValue = 'localText';\r\n\t\t\t\t\t\t\tacc[newValue] = errorMessage;\r\n\t\t\t\t\t\t\tnewValue = 'globalText';\r\n\t\t\t\t\t\t\tacc[newValue] = errorMessage;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\treturn acc;\r\n\t\t\t\t\t}, {});\r\n\r\n\t\t\t\t\tthis.setState({ validationError: true, isSaving: false });\r\n\r\n\t\t\t\t\treturn { ...newValidationState, [FORM_ERROR]: 'An error occurred while saving.' };\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// prevent attempting to setState after the component has unmounted.\r\n\t\t\t\t\tif (!this.mounted) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// generic error.\r\n\t\t\t\t\tconsole.log('An error occurred while attempting to save:', error.message);\r\n\r\n\t\t\t\t\tthis.setState({ saveError: error, isSaving: false });\r\n\r\n\t\t\t\t\tthrow error;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\t// by default, subscribe to these only.\r\n\t\t\tsubscription = { pristine: true, dirty: true, submitError: true },\r\n\t\t\tisOpen,\r\n\t\t\ttoggle,\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tentityDefinition,\r\n\t\t} = this.props;\r\n\r\n\t\tconst { initialValues, saveError, isTypeSpecific, validationError, isSaving } = this.state;\r\n\r\n\t\treturn (\r\n\t\t\t<Modal\r\n\t\t\t\tisOpen={isOpen}\r\n\t\t\t\ttoggle={toggle}\r\n\t\t\t\tonOpened={() => this.resetState(false)}\r\n\t\t\t\tonClosed={() => this.setState({ wasOpened: true })}\r\n\t\t\t>\r\n\t\t\t\t<ModalClose toggle={toggle} />\r\n\t\t\t\t<ModalHeader>{`${initialValues && initialValues.id ? 'Edit ' : 'Create '}`}Tooltip</ModalHeader>\r\n\r\n\t\t\t\t<Form\r\n\t\t\t\t\tonSubmit={this.save}\r\n\t\t\t\t\tsubscription={subscription}\r\n\t\t\t\t\tinitialValues={initialValues}\r\n\t\t\t\t\trender={(props: any) => {\r\n\t\t\t\t\t\t// this portion is rendered withing the React Final Form\r\n\t\t\t\t\t\t// therefore the props we're expecting are coming from there\r\n\t\t\t\t\t\t// some of those are default, some come based on the subscriptions above\r\n\t\t\t\t\t\t// https://github.com/final-form/react-final-form#subscription-fieldsubscription\r\n\t\t\t\t\t\tconst { handleSubmit, dirty, submitError } = props;\r\n\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<form onSubmit={handleSubmit} className=\"edit-form\">\r\n\t\t\t\t\t\t\t\t<ModalBody>\r\n\t\t\t\t\t\t\t\t\t{saveError && (\r\n\t\t\t\t\t\t\t\t\t\t<ErrorAlert\r\n\t\t\t\t\t\t\t\t\t\t\tmessage=\"An error occurred while attempting to save tooltip data.\"\r\n\t\t\t\t\t\t\t\t\t\t\terror={saveError}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t<ValidationErrorAlert\r\n\t\t\t\t\t\t\t\t\t\tsubmitError={\r\n\t\t\t\t\t\t\t\t\t\t\tsubmitError\r\n\t\t\t\t\t\t\t\t\t\t\t\t? submitError\r\n\t\t\t\t\t\t\t\t\t\t\t\t: validationError\r\n\t\t\t\t\t\t\t\t\t\t\t\t? 'An error occurred while attempting to save tooltip data'\r\n\t\t\t\t\t\t\t\t\t\t\t\t: null\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\talertType={AlertType.Edit}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t\t\t<NavigationPrompt when={dirty}>\r\n\t\t\t\t\t\t\t\t\t\t{({ isActive, onConfirm, onCancel }) => (\r\n\t\t\t\t\t\t\t\t\t\t\t<Confirm\r\n\t\t\t\t\t\t\t\t\t\t\t\tonCancel={onCancel}\r\n\t\t\t\t\t\t\t\t\t\t\t\tisOpen={isActive}\r\n\t\t\t\t\t\t\t\t\t\t\t\tonConfirm={onConfirm}\r\n\t\t\t\t\t\t\t\t\t\t\t\trenderTitle={() => 'Warning'}\r\n\t\t\t\t\t\t\t\t\t\t\t\trenderContents={() =>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Are you sure you want to leave this page? Your changes will be lost.'\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\tconfirmButtonText=\"Leave\"\r\n\t\t\t\t\t\t\t\t\t\t\t\tcancelButtonText=\"Stay\"\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t</NavigationPrompt>\r\n\r\n\t\t\t\t\t\t\t\t\t{!isTypeSpecific && (\r\n\t\t\t\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\t\t\t\tlabel={`What does '${label || name}' mean?`}\r\n\t\t\t\t\t\t\t\t\t\t\tname=\"globalText\"\r\n\t\t\t\t\t\t\t\t\t\t\tcomponent={TextArea}\r\n\t\t\t\t\t\t\t\t\t\t\thideTooltip={true}\r\n\t\t\t\t\t\t\t\t\t\t\trows={7}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t{isTypeSpecific && (\r\n\t\t\t\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\t\t\t\tlabel={`What does '${label || name}' mean specific to ${\r\n\t\t\t\t\t\t\t\t\t\t\t\tentityDefinition.pluralName\r\n\t\t\t\t\t\t\t\t\t\t\t}?`}\r\n\t\t\t\t\t\t\t\t\t\t\tname=\"localText\"\r\n\t\t\t\t\t\t\t\t\t\t\tcomponent={TextArea}\r\n\t\t\t\t\t\t\t\t\t\t\thideTooltip={true}\r\n\t\t\t\t\t\t\t\t\t\t\trows={7}\r\n\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t<WhenFieldChanges\r\n\t\t\t\t\t\t\t\t\t\tfield=\"globalText\"\r\n\t\t\t\t\t\t\t\t\t\tset=\"localText\"\r\n\t\t\t\t\t\t\t\t\t\tto={(fieldValue) =>\r\n\t\t\t\t\t\t\t\t\t\t\tinitialValues.localText ? initialValues.localText : fieldValue\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\trequireUserConfirmation={false}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t<Field name=\"isTypeSpecific\" subscription={{ value: true }}>\r\n\t\t\t\t\t\t\t\t\t\t{(filedProps) => {\r\n\t\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{!filedProps.input.value && !initialValues.oldEntityTypeId && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Warning\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmessage={`Updating this tooltip will change \"${\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlabel || name\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\" everywhere, unless it is overridden.`}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{!filedProps.input.value && initialValues.oldEntityTypeId && (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Warning\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmessage={\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUpdating this tooltip will change{' '}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{label || name} everywhere, unless it is\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toverridden.\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p>This change will clear your current override.</p>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t</Field>\r\n\t\t\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\t\t\tlabel=\"Update tooltip only for this page\"\r\n\t\t\t\t\t\t\t\t\t\tname=\"isTypeSpecific\"\r\n\t\t\t\t\t\t\t\t\t\tcomponent={Toggle}\r\n\t\t\t\t\t\t\t\t\t\thideTooltip={true}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t<OnChange name=\"isTypeSpecific\">\r\n\t\t\t\t\t\t\t\t\t\t{(fieldValue) => {\r\n\t\t\t\t\t\t\t\t\t\t\tthis.onIsTypeSpecificChange(fieldValue ? true : false);\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t</OnChange>\r\n\t\t\t\t\t\t\t\t</ModalBody>\r\n\t\t\t\t\t\t\t\t<ModalFooter>\r\n\t\t\t\t\t\t\t\t\t{isSaving && <Spinner />}&nbsp;\r\n\t\t\t\t\t\t\t\t\t<Button color=\"primary-alt\" outline onClick={toggle}>\r\n\t\t\t\t\t\t\t\t\t\tCancel\r\n\t\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t\t\t&nbsp;\r\n\t\t\t\t\t\t\t\t\t<Button color=\"primary\">Save</Button>\r\n\t\t\t\t\t\t\t\t</ModalFooter>\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t</Modal>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default withEditContext(TooltipEditOverlay);\r\n","import React from 'react';\r\nimport TooltipEditOverlay from './TooltipEditOverlay';\r\nimport PencilSVG from '../svg/PencilSVG';\r\nimport TooltipDto from './types/TooltipDto';\r\nimport { EntityDefinition } from 'types';\r\n\r\n/**\r\n * Tooltip edit button component props\r\n */\r\ninterface TooltipEditButtonProps {\r\n\tname: string;\r\n\tlabel: string;\r\n\ttooltipData: { [name: string]: { fieldTooltip: TooltipDto; universalTooltip: TooltipDto } };\r\n\tentityDefinition: EntityDefinition;\r\n}\r\n\r\n/**\r\n * Tooltip edit button component state\r\n */\r\ninterface TooltipEditButtonState {\r\n\tisOpen: boolean;\r\n}\r\n\r\n/**\r\n * Tooltip edit button component\r\n * Displayed in the edit form field labels if the AppState.user.isTooltipEditMode is on.\r\n * Clicking on this will open the TooltipEditOverlay popover\r\n * where the tooltip data for the current field can be edited.\r\n */\r\nexport class TooltipEditButton extends React.PureComponent<TooltipEditButtonProps, TooltipEditButtonState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = { isOpen: false };\r\n\t}\r\n\r\n\tprivate toggle = () => {\r\n\t\tthis.setState((prevState) => {\r\n\t\t\treturn { isOpen: !prevState.isOpen };\r\n\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<button type=\"button\" className=\"tooltip__edit-btn\" onClick={this.toggle}>\r\n\t\t\t\t\t<span className=\"tooltip__edit-wrapper\">\r\n\t\t\t\t\t\t<PencilSVG class=\"tooltip__edit-icon\" />\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</button>\r\n\t\t\t\t<TooltipEditOverlay\r\n\t\t\t\t\tname={this.props.name}\r\n\t\t\t\t\tlabel={this.props.label}\r\n\t\t\t\t\tisOpen={this.state.isOpen}\r\n\t\t\t\t\ttoggle={this.toggle}\r\n\t\t\t\t\ttooltipData={this.props.tooltipData}\r\n\t\t\t\t\tentityDefinition={this.props.entityDefinition}\r\n\t\t\t\t/>\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n","import * as React from 'react';\r\nimport { Switch } from 'react-router-dom';\r\n\r\n// react-router doesn't have support for React fragments in <Switch />. This component\r\n// wraps react-router's <Switch /> so that it gets fragment support.\r\n//\r\n// https://github.com/ReactTraining/react-router/issues/5785\r\nexport default function FragmentSupportingSwitch({ children }: any) {\r\n\tconst flattenedChildren: any[] = [];\r\n\tflatten(flattenedChildren, children);\r\n\t// eslint-disable-next-line\r\n\treturn React.createElement.apply(React, [Switch, null].concat(flattenedChildren));\r\n}\r\n\r\nfunction flatten(target: any, children: any) {\r\n\tReact.Children.forEach(children, (child: any) => {\r\n\t\tif (React.isValidElement(child)) {\r\n\t\t\tif (child.type === React.Fragment) {\r\n\t\t\t\tflatten(target, (child.props as any).children);\r\n\t\t\t} else {\r\n\t\t\t\ttarget.push(child);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n}\r\n","import * as React from 'react';\r\nimport { Alert } from 'reactstrap';\r\nimport { AxiosError } from 'axios';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\n\r\nexport interface ErrorAlertProps extends WithTestIdOptional {\r\n\t/** The title of the error alert */\r\n\ttitle: string;\r\n\r\n\t/** The message to display */\r\n\tmessage?: string;\r\n\r\n\t/** The error responsible for this message. */\r\n\terror: AxiosError | Error | null;\r\n}\r\n\r\n/**\r\n * Interface that mirrors the backend's RocApiError class\r\n */\r\nexport interface RocApiError {\r\n\tmessage: string;\r\n\tloggingErrorId?: string;\r\n\texception?: Exception;\r\n}\r\n\r\ninterface Exception {\r\n\tstackTrace?: string;\r\n}\r\n\r\nconst GenericErrorMessage =\r\n\t'An unexpected error has occurred. Please try again. If the problem persists, contact a system administrator.';\r\n\r\nconst NetworkErrorMessage =\r\n\t'A network error has occurred. Check your network connection and if the problem persists, contact a system administrator.';\r\n\r\n/**\r\n * Reusable Error Alert Component used by AdminErrorBoundary and Listing/Tree base components.\r\n *\r\n * @class ErrorAlert\r\n * @extends {React.Component<ErrorAlertProps>}\r\n */\r\nclass ErrorAlert extends React.Component<ErrorAlertProps> {\r\n\tpublic static defaultProps = {\r\n\t\ttitle: 'Uh oh!',\r\n\t};\r\n\r\n\t/**\r\n\t * Gets the message to display to the end user.\r\n\t */\r\n\tprivate getMessage(): string {\r\n\t\tif (this.props.message) {\r\n\t\t\treturn this.props.message;\r\n\t\t}\r\n\t\tconst { error } = this.props;\r\n\t\tconst axiosError = error as AxiosError | undefined;\r\n\t\tif (axiosError && axiosError.response == null && axiosError.request != null) {\r\n\t\t\treturn NetworkErrorMessage;\r\n\t\t}\r\n\r\n\t\t// Handle error messages sent from the server\r\n\t\tif (\r\n\t\t\taxiosError &&\r\n\t\t\taxiosError.request != null &&\r\n\t\t\taxiosError.response != null &&\r\n\t\t\taxiosError.response.data != null &&\r\n\t\t\taxiosError.response.data.message != null\r\n\t\t) {\r\n\t\t\tconst error = axiosError.response.data as RocApiError;\r\n\t\t\treturn error.message;\r\n\t\t}\r\n\r\n\t\t// More specific error messages can be placed here (such as for a 403 or similar error code).\r\n\r\n\t\treturn GenericErrorMessage;\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst { error } = this.props;\r\n\t\tconst axiosError = error as AxiosError | null;\r\n\t\tconst loggingErrorId: string | undefined =\r\n\t\t\taxiosError && axiosError.response && axiosError.response.data && axiosError.response.data.loggingErrorId;\r\n\r\n\t\treturn (\r\n\t\t\t<Alert color=\"danger\" data-testid={this.props.testId}>\r\n\t\t\t\t<strong>{this.props.title}</strong> {this.getMessage()}\r\n\t\t\t\t{this.props.children ? <> {this.props.children}</> : null}\r\n\t\t\t\t{loggingErrorId ? <p>ID: {loggingErrorId}</p> : null}\r\n\t\t\t</Alert>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default ErrorAlert;\r\n","import * as axios from 'axios';\r\nimport { AxiosError, AxiosResponse, Canceler } from 'axios';\r\nimport React from 'react';\r\nimport { RouteComponentProps, withRouter } from 'react-router-dom';\r\nimport AxiosHelper, { CustomAxiosRequestConfig } from 'services/AxiosHelper';\r\nimport { EntityDefinition, IndexResults } from 'types';\r\nimport BasicDto from 'types/__models__/BasicDto';\r\nimport uuid from 'uuid/v4';\r\nimport { VisuallyHiddenAnnouncementTrigger } from 'VisuallyHiddenAnnouncement';\r\nimport { SortBy, SortByDirection } from '../../../../../Roc.SharedClientApp/types';\r\nimport Alert from '../Alert';\r\nimport { reorderArrayValues } from '../auto-suggest/Util';\r\nimport { toastError } from '../toast/Toasts';\r\nimport { Filter, SelectedFilter } from './filters';\r\nimport {\r\n\tgetParsedQueryString,\r\n\tgetQueryStringFromSearchQuery,\r\n\tgetSearchQueryFromQueryString,\r\n\tgetSearchQueryFromSavedFilter,\r\n\tQueryStringTarget,\r\n\tSearchQuery,\r\n} from './filters/providers';\r\nimport { SavedFilter, SavedFilterCategory } from './saved-filters/SavedFilterPicker';\r\nimport { flattenSavedFilters } from './saved-filters/Util';\r\n\r\n/**\r\n * Defines the different locations the listing components can be used from\r\n */\r\nexport enum ListingDisplayMode {\r\n\t/**\r\n\t * Default. Used by all admin listings to display the main table with content.\r\n\t */\r\n\tListingPage,\r\n\t/**\r\n\t * Used by the asset manager by default. This can be handy if you're displaying the table in a modal to make record selections.\r\n\t * Disables some functionality related to redirects.\r\n\t */\r\n\tSelectionModal,\r\n\t/**\r\n\t * Used in Commerce embedded in the User admin to show related data\". This disables additional functionality related to adding values to the Query String.\r\n\t */\r\n\tEmbeddedInEditPage,\r\n\t/**\r\n\t * Used within the Dashboard. Displays the table of results only.\r\n\t */\r\n\tDashboardWidget,\r\n}\r\n\r\nconst DEFAULT_PAGE_SIZE = 100;\r\n\r\nexport type ListingContainerProps = RouteComponentProps<any> & {\r\n\tentityDefinition: EntityDefinition;\r\n\tlistingDisplayMode?: ListingDisplayMode;\r\n\tonRecordsSelectedChanged?: (selection: RecordSelectionState) => void;\r\n\tselectedRecords?: BasicDto[] | BulkEntity<BasicDto>;\r\n\tminimumSelectionCount?: number;\r\n\tmaximumSelectionCount?: number;\r\n\tchildren: (props: ListingContainerContext<any>) => React.ReactNode;\r\n\tpageSize?: number;\r\n};\r\n\r\nexport interface BulkEntity<T> {\r\n\tentity: BulkRecords<T>;\r\n}\r\n\r\nexport interface BulkRecords<T> {\r\n\tbulkRecords: T[];\r\n}\r\n\r\nexport interface RecordSelectionState {\r\n\trecordIds: any;\r\n\trecords?: any; // should only be set when listingDisplayMode is SelectionModal\r\n\tcount: number;\r\n\ttoggleRecordSelection: (record: BasicDto) => void;\r\n\tsetRecordSelection: (record: BasicDto, state: boolean) => void;\r\n\tsetFullPageSelection: (state: boolean) => void;\r\n\tclearSelection: () => void;\r\n}\r\n\r\nexport enum FilterChangeLocation {\r\n\tFilterList = 'FilterList',\r\n\tSelectedFilter = 'SelectedFilter',\r\n}\r\n\r\nexport interface FilterState {\r\n\tselectedFilters: SelectedFilter[];\r\n\tfilterBeingChanged: SelectedFilter | null;\r\n\tdisplayFilterList: boolean;\r\n\tcloseFilterList: () => void;\r\n\ttoggleFilterList: () => void;\r\n\ttoggleFilterChange: () => void;\r\n\tfilterChangeLocation: FilterChangeLocation;\r\n\tbeginFilterChange: (filter: Filter | SelectedFilter, location: FilterChangeLocation) => void;\r\n\tonFilterChange: (selectedFilter: SelectedFilter, stopEditing: boolean) => void;\r\n\tcancelFilterChange: () => void;\r\n\taddOrUpdateFilter: (selectedFilter: SelectedFilter) => void;\r\n\tremoveFilter: (selectedFilter: SelectedFilter) => void;\r\n\tonFilterRemoved: (selectedFilter: SelectedFilter, stopEditing: boolean) => void;\r\n\tresetFilters: () => void;\r\n}\r\n\r\nexport interface SavedFiltersState {\r\n\tisOpen: boolean;\r\n\tappliedSavedFilter: SavedFilter | null;\r\n\tisEditMode: boolean;\r\n\tfiltersByCategory: SavedFilterCategory[];\r\n\trefreshing: boolean;\r\n\ttoggleDisplay: (isOpen: boolean) => void;\r\n\tapplySavedFilter: (params: ApplySavedFilterOptions) => void;\r\n\tbeginEditAppliedSavedFilter: () => void;\r\n\tgetSavedFilters: (options: GetSavedFiltersOptions) => void;\r\n\tdeleteSavedFilter: (filter: SavedFilter) => void;\r\n}\r\n\r\nexport interface GetSavedFiltersOptions {\r\n\trefresh: boolean;\r\n}\r\n\r\nexport interface ApplySavedFilterOptions {\r\n\tfilter: SavedFilter;\r\n\tisEditMode: boolean;\r\n}\r\n\r\nexport interface SavedFilterResponse {\r\n\tcategories: SavedFilterCategory[];\r\n}\r\n\r\nexport interface CustomSortingState {\r\n\t/**\r\n\t * Determines whether custom sorting mode is enabled or not.\r\n\t */\r\n\tisEnabled: boolean;\r\n\r\n\t/**\r\n\t * Toggles custom sorting mode on/off based on the state argument\r\n\t */\r\n\tsetCustomSorting: (state: boolean) => void;\r\n\r\n\t/**\r\n\t * Handler for when a sorting change (usually a drag/drop) is applied, so that it can be persisted on the server\r\n\t */\r\n\tonDragDropSortOrderUpdate: (sourceIndex: number, destinationIndex: number | null, newSortOrder: number) => void;\r\n}\r\n\r\nexport interface ListingContainerState<TModel extends BasicDto> {\r\n\tresults?: IndexResults<TModel>;\r\n\tisLoading: boolean;\r\n\terror: AxiosError | Error | null;\r\n\tpendingSearchQuery: string;\r\n\tsearchQuery: string;\r\n\tpendingPageChange: number;\r\n\tsortBy?: SortBy;\r\n\thandleBasicSearchChange: (basicSearch: string) => void;\r\n\tresetSearch: () => void;\r\n\r\n\thandleDelete: (record: any, nameField: any) => void;\r\n\thandlePageChange: (page: number) => Promise<void>;\r\n\texecutePageChange: () => Promise<void>;\r\n\trefreshData: () => void;\r\n\texecuteSearch: () => Promise<void>;\r\n\tsetSearchSortBy: (sortBy: SortBy) => void;\r\n\r\n\tselection: RecordSelectionState;\r\n\tfilters: FilterState;\r\n\tsavedFilters: SavedFiltersState;\r\n\r\n\tisAlertOpen: boolean;\r\n\talertMessage: string;\r\n\r\n\tpageChangeAlert: string | null;\r\n\r\n\tcustomSorting: CustomSortingState;\r\n}\r\n\r\n// not really context, but it will be eventually.\r\nexport interface ListingContainerContext<TModel extends BasicDto> extends ListingContainerState<TModel> {\r\n\tlistingDisplayMode: ListingDisplayMode;\r\n}\r\n\r\n/**\r\n * Top level container component for all listing pages. This component is in charge of managing all\r\n * of the state needed by the listing page controls, and uses render props to render its children\r\n *\r\n * @class ListingContainer\r\n * @extends {React.Component<ListingContainerProps, ListingContainerState<any>>}\r\n */\r\nclass ListingContainer extends React.Component<ListingContainerProps, ListingContainerState<any>> {\r\n\tpublic static defaultProps = {\r\n\t\tlistingDisplayMode: ListingDisplayMode.ListingPage,\r\n\t\tminimumSelectionCount: 0,\r\n\t\tmaximumSelectionCount: 1,\r\n\t\tonRecordsSelectedChanged: () => {},\r\n\t\tpageSize: DEFAULT_PAGE_SIZE,\r\n\t};\r\n\r\n\tprivate mounted: boolean = false;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t\tconst { entityDefinition } = this.props;\r\n\r\n\t\tthis.state = {\r\n\t\t\terror: null,\r\n\t\t\tresults: {\r\n\t\t\t\trecords: [],\r\n\t\t\t\tpage: 1,\r\n\t\t\t\tpageSize: DEFAULT_PAGE_SIZE,\r\n\t\t\t\ttotalRecords: 0,\r\n\t\t\t\ttotalPages: 0,\r\n\t\t\t\tbasicSearchFields: [],\r\n\t\t\t\tsortBys: [],\r\n\t\t\t\tparentRecords: null,\r\n\t\t\t\tappliedSortBy: {\r\n\t\t\t\t\tname: 'ModifyDate',\r\n\t\t\t\t\ttitle: 'Last Modified on top',\r\n\t\t\t\t\tdirection: SortByDirection.Descending,\r\n\t\t\t\t},\r\n\t\t\t\tuniqueId: '',\r\n\t\t\t\tappliedSavedFilterId: '',\r\n\t\t\t},\r\n\t\t\tselection: {\r\n\t\t\t\trecordIds: {},\r\n\t\t\t\trecords: [],\r\n\t\t\t\tcount: 0,\r\n\t\t\t\ttoggleRecordSelection: this.toggleRecordSelection,\r\n\t\t\t\tsetRecordSelection: this.setRecordSelection,\r\n\t\t\t\tsetFullPageSelection: this.setFullPageSelection,\r\n\t\t\t\tclearSelection: this.clearSelection,\r\n\t\t\t},\r\n\t\t\tfilters: {\r\n\t\t\t\tselectedFilters: entityDefinition.filters.filter((f) => f.permanent) as SelectedFilter[],\r\n\t\t\t\tdisplayFilterList: false,\r\n\t\t\t\tcloseFilterList: this.closeFilterList,\r\n\t\t\t\tfilterBeingChanged: null,\r\n\t\t\t\ttoggleFilterList: this.toggleFilterList,\r\n\t\t\t\ttoggleFilterChange: this.toggleFilterChange,\r\n\t\t\t\tbeginFilterChange: this.beginFilterChange,\r\n\t\t\t\tfilterChangeLocation: FilterChangeLocation.FilterList,\r\n\t\t\t\tcancelFilterChange: this.cancelAddFilter,\r\n\t\t\t\tonFilterChange: this.onFilterChange,\r\n\t\t\t\tonFilterRemoved: this.onFilterRemoved,\r\n\t\t\t\taddOrUpdateFilter: this.addOrUpdateFilter,\r\n\t\t\t\tremoveFilter: this.removeFilter,\r\n\t\t\t\tresetFilters: this.resetFilters,\r\n\t\t\t},\r\n\t\t\tsavedFilters: {\r\n\t\t\t\tisOpen: false,\r\n\t\t\t\ttoggleDisplay: this.toggleSavedFilterDisplay,\r\n\t\t\t\tapplySavedFilter: this.applySavedFilter,\r\n\t\t\t\tappliedSavedFilter: null,\r\n\t\t\t\tisEditMode: false,\r\n\t\t\t\tbeginEditAppliedSavedFilter: this.beginEditAppliedSavedFilter,\r\n\t\t\t\tgetSavedFilters: this.getSavedFilters,\r\n\t\t\t\tdeleteSavedFilter: this.deleteSavedFilter,\r\n\t\t\t\trefreshing: false,\r\n\t\t\t\tfiltersByCategory: [],\r\n\t\t\t},\r\n\t\t\tcustomSorting: {\r\n\t\t\t\tisEnabled: false,\r\n\t\t\t\tonDragDropSortOrderUpdate: this.onDragDropSortOrderUpdate,\r\n\t\t\t\tsetCustomSorting: this.setCustomSorting,\r\n\t\t\t},\r\n\t\t\tisLoading: false,\r\n\t\t\tpendingSearchQuery: '',\r\n\t\t\tsearchQuery: '',\r\n\t\t\tpendingPageChange: 1,\r\n\t\t\tsortBy: undefined,\r\n\t\t\thandleBasicSearchChange: this.handleBasicSearchChange,\r\n\t\t\tresetSearch: this.resetSearch,\r\n\t\t\thandleDelete: this.handleDelete,\r\n\t\t\thandlePageChange: this.handlePageChange,\r\n\t\t\texecutePageChange: this.executePageChange,\r\n\t\t\texecuteSearch: this.executeSearch,\r\n\t\t\trefreshData: this.refreshData,\r\n\t\t\tsetSearchSortBy: this.setSearchSortBy,\r\n\t\t\tisAlertOpen: false,\r\n\t\t\talertMessage: '',\r\n\t\t\tpageChangeAlert: null,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Allows calling setState with async/await\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate setStateAsync = (state: any): Promise<void> => {\r\n\t\treturn new Promise((resolve) => {\r\n\t\t\tthis.setState(state, resolve);\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Deletes a saved filter, and optimistically updates state for a better user experience.\r\n\t * If the filter being deleted is the active one, this will remove the filter association.\r\n\t * If something goes wrong and the optimistic update was wrong, we simply reload all values into state.\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate deleteSavedFilter = async (filter: SavedFilter) => {\r\n\t\tconsole.debug('Deleting filter:', filter.name);\r\n\r\n\t\tconst { entityDefinition } = this.props;\r\n\t\tconst { savedFilters } = this.state;\r\n\r\n\t\tthis.setState((prevState) => {\r\n\t\t\tconst filtersByCategory: SavedFilterCategory[] = prevState.savedFilters.filtersByCategory.map(\r\n\t\t\t\t(filterCategory) => {\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\t...filterCategory,\r\n\t\t\t\t\t\tsavedFilters: filterCategory.savedFilters.filter(\r\n\t\t\t\t\t\t\t(savedFilter: SavedFilter) => savedFilter.id !== filter.id,\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t};\r\n\t\t\t\t},\r\n\t\t\t);\r\n\r\n\t\t\treturn {\r\n\t\t\t\tsavedFilters: { ...prevState.savedFilters, filtersByCategory },\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\ttry {\r\n\t\t\t// optimistically update UI so we no longer have the selected filter active.\r\n\t\t\tif (savedFilters.appliedSavedFilter !== null && savedFilters.appliedSavedFilter.id === filter.id) {\r\n\t\t\t\tthis.setState(\r\n\t\t\t\t\t(prevState: any) => {\r\n\t\t\t\t\t\treturn {\r\n\t\t\t\t\t\t\tsavedFilters: {\r\n\t\t\t\t\t\t\t\t...prevState.savedFilters,\r\n\t\t\t\t\t\t\t\tappliedSavedFilter: null,\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tresults: { ...prevState.results, appliedSavedFilterId: '' },\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t},\r\n\t\t\t\t\t() => this.refreshData(),\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t\tawait AxiosHelper.delete(entityDefinition.baseAjaxRoute + '/filter/' + filter.id, { data: {} });\r\n\t\t} catch (error) {\r\n\t\t\tconsole.error(error);\r\n\r\n\t\t\t// if something goes wrong, reload all saved filters, as our optimistic update was wrong.\r\n\t\t\tthis.getSavedFilters({ refresh: true });\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Shared promise used to allow multiple calls to getSavedFilters to be reduced to a single one.\r\n\t *\r\n\t * @private\r\n\t * @type {Promise<SavedFilterResponse>}\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate refreshSavedFiltersPromise: Promise<SavedFilterResponse>;\r\n\r\n\t/**\r\n\t * Returns all saved filters from the server and returns a promise with the results.\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate getSavedFilters = async ({ refresh = false }: GetSavedFiltersOptions): Promise<SavedFilterResponse> => {\r\n\t\tif (!this.refreshSavedFiltersPromise || refresh) {\r\n\t\t\tthis.refreshSavedFiltersPromise = new Promise(async (resolve, reject) => {\r\n\t\t\t\tthis.setState((prevState) => ({\r\n\t\t\t\t\tsavedFilters: {\r\n\t\t\t\t\t\t...prevState.savedFilters,\r\n\t\t\t\t\t\trefreshing: true,\r\n\t\t\t\t\t},\r\n\t\t\t\t}));\r\n\r\n\t\t\t\ttry {\r\n\t\t\t\t\tconst { entityDefinition } = this.props;\r\n\t\t\t\t\tconsole.debug('Refreshing Saved Filters...');\r\n\r\n\t\t\t\t\tconst response: AxiosResponse<SavedFilterResponse> = await AxiosHelper.get<SavedFilterResponse>(\r\n\t\t\t\t\t\tentityDefinition.baseAjaxRoute + '/filter',\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tconst { data } = response;\r\n\r\n\t\t\t\t\tfor (const savedFilterCategory of data.categories) {\r\n\t\t\t\t\t\tfor (const savedFilter of savedFilterCategory.savedFilters) {\r\n\t\t\t\t\t\t\tsavedFilter.categoryId = savedFilterCategory.id;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tresolve(data);\r\n\r\n\t\t\t\t\t// prevent attempting to setState after the component has unmounted.\r\n\t\t\t\t\tif (!this.mounted) {\r\n\t\t\t\t\t\treject();\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.setState((prevState) => ({\r\n\t\t\t\t\t\tsavedFilters: {\r\n\t\t\t\t\t\t\t...prevState.savedFilters,\r\n\t\t\t\t\t\t\tfiltersByCategory: data.categories,\r\n\t\t\t\t\t\t\trefreshing: false,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t}));\r\n\t\t\t\t} catch (error) {\r\n\t\t\t\t\tconsole.error(error);\r\n\t\t\t\t\t// TODO: display something in UI\r\n\t\t\t\t\treject(error);\r\n\r\n\t\t\t\t\tthis.setState((prevState) => ({\r\n\t\t\t\t\t\tsavedFilters: {\r\n\t\t\t\t\t\t\t...prevState.savedFilters,\r\n\t\t\t\t\t\t\trefreshing: false,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t}));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn this.refreshSavedFiltersPromise;\r\n\t};\r\n\r\n\t/**\r\n\t * Display saved filters\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate toggleSavedFilterDisplay = (isOpen: boolean) => {\r\n\t\tthis.setState((prevState) => ({\r\n\t\t\tsavedFilters: { ...prevState.savedFilters, isOpen },\r\n\t\t}));\r\n\t};\r\n\r\n\t/**\r\n\t * Sets a selected filter as the currently applied filter. This is used to display which filter\r\n\t * is currently selected, helps keep the QueryString updated with savedFilterId, etc.\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate applySavedFilter = ({ filter, isEditMode = false }) => {\r\n\t\tconsole.debug('Applying Saved Filter:', filter);\r\n\t\tconst search = getSearchQueryFromSavedFilter(filter, this.props.entityDefinition);\r\n\r\n\t\tthis.setState(\r\n\t\t\t(prevState: any) => ({\r\n\t\t\t\tsearchQuery: '',\r\n\t\t\t\tpendingSearchQuery: '',\r\n\t\t\t\tfilters: { ...prevState.filters, selectedFilters: search.filters },\r\n\t\t\t\tsavedFilters: { ...prevState.savedFilters, isOpen: false, appliedSavedFilter: filter, isEditMode },\r\n\t\t\t\tresults: { ...prevState.results, page: 1, appliedSavedFilterId: !isEditMode ? filter.id : '' },\r\n\t\t\t}),\r\n\t\t\t() => {\r\n\t\t\t\tthis.refreshData();\r\n\t\t\t},\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * Applies a selected filter and triggers edit mode.\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate beginEditAppliedSavedFilter = () => {\r\n\t\tthis.applySavedFilter({ filter: this.state.savedFilters.appliedSavedFilter, isEditMode: true });\r\n\t};\r\n\r\n\t/**\r\n\t * Sets the state of whether a specific record in the listing is selected or not\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate toggleRecordSelection = (record: BasicDto) => {\r\n\t\tif (!record || !record.id) {\r\n\t\t\tconsole.warn('A record ID must be provided to toggle a selection.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst existingRecordIndex = this.state.selection.records.findIndex((r) => r.id === record.id);\r\n\t\tif (existingRecordIndex < 0) {\r\n\t\t\t// does not exist already, set to true\r\n\t\t\tthis.setRecordSelection(record, true);\r\n\t\t} else {\r\n\t\t\tconst existingRecordSelected = this.state.selection.records[existingRecordIndex];\r\n\t\t\tthis.setRecordSelection(record, !existingRecordSelected);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Open reusable alert\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate openAlert = (message: string) => {\r\n\t\tthis.setState({ isAlertOpen: true, alertMessage: message });\r\n\t};\r\n\r\n\t/**\r\n\t * Close the reusable alert\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate closeAlert = () => {\r\n\t\tthis.setState({ isAlertOpen: false, alertMessage: '' });\r\n\t};\r\n\r\n\t/**\r\n\t * Sets the state of whether a specific record in the listing is selected or not\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate setRecordSelection = async (record: BasicDto, state: boolean) => {\r\n\t\tif (!record || !record.id) {\r\n\t\t\tconsole.warn('A record ID must be provided to set a selection.');\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconst maxSelections = this.props.maximumSelectionCount === undefined ? 1 : this.props.maximumSelectionCount;\r\n\r\n\t\tif (this.props.listingDisplayMode === ListingDisplayMode.SelectionModal && state === true) {\r\n\t\t\tif (maxSelections === 1 && this.state.selection.count > 0) {\r\n\t\t\t\tawait this.clearSelection();\r\n\t\t\t} else if (maxSelections !== 0 && this.state.selection.count >= maxSelections) {\r\n\t\t\t\tconst message =\r\n\t\t\t\t\t'You can only select up to ' +\r\n\t\t\t\t\tmaxSelections +\r\n\t\t\t\t\t' record' +\r\n\t\t\t\t\t(maxSelections === 1 ? '' : 's') +\r\n\t\t\t\t\t' at a time.';\r\n\r\n\t\t\t\tthis.openAlert(message);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.setState((prevState: ListingContainerState<any>) => {\r\n\t\t\tconst recordIds = { ...prevState.selection.recordIds, [record.id]: state };\r\n\r\n\t\t\tconst count = this.getSelectionCount(recordIds);\r\n\r\n\t\t\tconsole.debug('Selection changed:', count);\r\n\r\n\t\t\tconst selection = {\r\n\t\t\t\t...prevState.selection,\r\n\t\t\t\tcount,\r\n\t\t\t\trecordIds,\r\n\t\t\t};\r\n\r\n\t\t\tif (this.props.listingDisplayMode === ListingDisplayMode.SelectionModal) {\r\n\t\t\t\tconst existingRecordIndex = prevState.selection.records.findIndex((r) => r.id === record.id);\r\n\t\t\t\tif (state && existingRecordIndex < 0) {\r\n\t\t\t\t\t// only add the record to the array if it doesn't already exist\r\n\t\t\t\t\tselection.records.push(record);\r\n\t\t\t\t} else if (!state) {\r\n\t\t\t\t\tselection.records.splice(existingRecordIndex, 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (this.props.onRecordsSelectedChanged) {\r\n\t\t\t\tthis.props.onRecordsSelectedChanged(selection);\r\n\t\t\t}\r\n\r\n\t\t\treturn {\r\n\t\t\t\tselection,\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Adds all records from the current page of results to the list of selections.\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate setFullPageSelection = (state: boolean) => {\r\n\t\tthis.setState((prevState: ListingContainerState<any>) => {\r\n\t\t\tif (prevState.results) {\r\n\t\t\t\tconst fullPageSelection = prevState.results.records.reduce((acc, value) => {\r\n\t\t\t\t\tacc[value.id] = state;\r\n\t\t\t\t\treturn acc;\r\n\t\t\t\t}, {});\r\n\r\n\t\t\t\tconst recordIds = { ...prevState.selection.recordIds, ...fullPageSelection };\r\n\t\t\t\tconst count = this.getSelectionCount(recordIds);\r\n\r\n\t\t\t\tconsole.debug('Selection changed:', count);\r\n\r\n\t\t\t\tconst selection = {\r\n\t\t\t\t\t...prevState.selection,\r\n\t\t\t\t\tcount,\r\n\t\t\t\t\trecordIds,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif (this.props.onRecordsSelectedChanged) {\r\n\t\t\t\t\tthis.props.onRecordsSelectedChanged(selection);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn {\r\n\t\t\t\t\tselection,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Helper method to return the total number of selected records.\r\n\t *\r\n\t * @private\r\n\t * @param {*} recordIds\r\n\t * @returns\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate getSelectionCount(recordIds: any) {\r\n\t\treturn Object.keys(recordIds).reduce((acc, value) => {\r\n\t\t\tif (recordIds[value]) {\r\n\t\t\t\treturn acc + 1;\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, 0);\r\n\t}\r\n\r\n\t/**\r\n\t * Completely removes all records from the current selection and resets the count.\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate clearSelection = () => {\r\n\t\treturn this.setStateAsync((prevState: ListingContainerState<any>) => {\r\n\t\t\tconst selection = {\r\n\t\t\t\t...prevState.selection,\r\n\t\t\t\trecordIds: {},\r\n\t\t\t\trecords: [],\r\n\t\t\t\tcount: 0,\r\n\t\t\t};\r\n\r\n\t\t\tif (this.props.onRecordsSelectedChanged) {\r\n\t\t\t\tthis.props.onRecordsSelectedChanged(selection);\r\n\t\t\t}\r\n\r\n\t\t\treturn {\r\n\t\t\t\tselection,\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Maintains a reference to the history listener so that we can stop listening to these changes\r\n\t * once the component is unmounted, to prevent multiple listeners\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate stopListeningToHistory: () => void;\r\n\r\n\t/**\r\n\t * Load data as soon as the component is mounted\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic componentDidMount() {\r\n\t\t// avoid history updates if we're not in the listing page\r\n\t\tif (this.props.listingDisplayMode === ListingDisplayMode.ListingPage) {\r\n\t\t\tthis.stopListeningToHistory =\r\n\t\t\t\tthis.props.history &&\r\n\t\t\t\tthis.props.history.listen((historyLocation, action) => {\r\n\t\t\t\t\t// a POP occurs when you hit \"back\" or \"forward\"\r\n\t\t\t\t\tif (action === 'POP') {\r\n\t\t\t\t\t\tconsole.debug('History Pop:', historyLocation);\r\n\t\t\t\t\t\tconst search = historyLocation.search ? historyLocation.search.substring(1) : '';\r\n\t\t\t\t\t\t// loc.search starts with a '?' to let's remove that.\r\n\t\t\t\t\t\tthis.refreshData(search, true, true);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.mounted = true;\r\n\r\n\t\tthis.getSavedFilters({ refresh: true });\r\n\r\n\t\tthis.refreshData(location.search);\r\n\r\n\t\t// if the selectedRecords were passed into the component,\r\n\t\t// add them to the record selection so the user can see what is already selected\r\n\t\tconst selectedRecords = this.props.selectedRecords;\r\n\t\tif (selectedRecords) {\r\n\t\t\t//Handle bulk records\r\n\t\t\tif ((selectedRecords as BulkEntity<BasicDto>).entity) {\r\n\t\t\t\t(selectedRecords as BulkEntity<BasicDto>).entity.bulkRecords.forEach((record) => {\r\n\t\t\t\t\tthis.setRecordSelection(record, true);\r\n\t\t\t\t});\r\n\t\t\t} else {\r\n\t\t\t\t(selectedRecords as BasicDto[]).forEach((record) => {\r\n\t\t\t\t\tthis.setRecordSelection(record, true);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\tthis.mounted = false;\r\n\r\n\t\tif (this.stopListeningToHistory) {\r\n\t\t\tthis.stopListeningToHistory();\r\n\t\t}\r\n\r\n\t\t// if the user is leaving the page and there's a pending query, cancel it.\r\n\t\tif (this.refreshDataCancelToken) {\r\n\t\t\tthis.refreshDataCancelToken();\r\n\t\t}\r\n\t}\r\n\r\n\tprivate refreshDataCancelToken: Canceler | null = null;\r\n\r\n\t/**\r\n\t * Calls the server to get results based on its state. Page/Search/etc are stored in state\r\n\t * and modified from the different update functions\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic refreshData = async (\r\n\t\tqueryString: string = '',\r\n\t\tforceUpdateFromQueryString: boolean = false,\r\n\t\tpoppedFromHistory: boolean = false,\r\n\t): Promise<void> => {\r\n\t\tconst {\r\n\t\t\tresults,\r\n\t\t\tsearchQuery,\r\n\t\t\tfilters: { selectedFilters },\r\n\t\t\tsortBy,\r\n\t\t\tsavedFilters,\r\n\t\t\tcustomSorting,\r\n\t\t} = this.state;\r\n\r\n\t\tconst { entityDefinition } = this.props;\r\n\r\n\t\tif (!results) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tconsole.debug('Generating search query:', queryString);\r\n\r\n\t\tlet serverQueryString = '';\r\n\t\tlet clientQueryString = '';\r\n\r\n\t\tlet search: SearchQuery;\r\n\r\n\t\tconst parsedQueryString = getParsedQueryString(queryString);\r\n\t\tconst savedFilterIdFromQueryString = parsedQueryString.savedFilterId;\r\n\r\n\t\ttry {\r\n\t\t\t// if there's a pending request, cancel it to prevent having multiple ajax responses\r\n\t\t\t// coming back at the same time, which can cause weird UI quirks.\r\n\t\t\tif (this.refreshDataCancelToken) {\r\n\t\t\t\tthis.refreshDataCancelToken();\r\n\t\t\t}\r\n\r\n\t\t\t// saved filter applied on server.\r\n\t\t\tif (savedFilterIdFromQueryString) {\r\n\t\t\t\tconsole.debug('Applying Saved Filter:', savedFilterIdFromQueryString);\r\n\r\n\t\t\t\tconst savedFiltersResponse = await this.getSavedFilters({ refresh: false });\r\n\t\t\t\tconst filters = flattenSavedFilters(savedFiltersResponse.categories);\r\n\t\t\t\tconst filterMatch = filters.find((filter) => filter.id === savedFilterIdFromQueryString);\r\n\r\n\t\t\t\tif (filterMatch) {\r\n\t\t\t\t\tconsole.debug('Applying filter:', filterMatch);\r\n\r\n\t\t\t\t\tconst savedFilterSearch = getSearchQueryFromSavedFilter(filterMatch, this.props.entityDefinition);\r\n\r\n\t\t\t\t\tawait this.setStateAsync((prevState) => ({\r\n\t\t\t\t\t\tfilters: {\r\n\t\t\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\t\t\tselectedFilters: savedFilterSearch.filters,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tsavedFilters: {\r\n\t\t\t\t\t\t\t...prevState.savedFilters,\r\n\t\t\t\t\t\t\tappliedSavedFilter: { ...filterMatch },\r\n\t\t\t\t\t\t\tisEditMode: false,\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t}));\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// this should never happen, so it'll happen all the time, probably.\r\n\t\t\t\t\tconsole.warn('Unable to match applied filter.');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// this is a safe conversion because of FilterKind, TypeScript just doesn't know that only implicit: true elements will be in the result.\r\n\t\t\tconst implicitFilters = entityDefinition.filters.filter((f) => f.implicit) as SelectedFilter[];\r\n\r\n\t\t\t// if this is the first time the listing is loaded and there's something in the query string\r\n\t\t\tif (queryString || forceUpdateFromQueryString) {\r\n\t\t\t\tconsole.debug('Found QueryString override, force:', forceUpdateFromQueryString);\r\n\r\n\t\t\t\tsearch = getSearchQueryFromQueryString(queryString, entityDefinition);\r\n\t\t\t\tif (entityDefinition.hideSearch) {\r\n\t\t\t\t\tsearch = { ...search, q: '' };\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// state may have already been updated with filters from a saved filter.\r\n\t\t\t\t// we can assume it's a saved filter because there's a query string set (?savedFilterId=<guid>).\r\n\t\t\t\tif (this.state.filters.selectedFilters.length > 0 && queryString !== '' && search.savedFilterId) {\r\n\t\t\t\t\tsearch = {\r\n\t\t\t\t\t\t...search,\r\n\t\t\t\t\t\tfilters: [...this.state.filters.selectedFilters.concat(implicitFilters)],\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If the user hits the Back button, we don't want to add custom sorting to the query string based on current state.\r\n\t\t\t\t// However, in other cases we want the new URL to reflect the current state\r\n\t\t\t\tconst addCustomSortQuery = poppedFromHistory ? search.customSortingEnabled : customSorting.isEnabled;\r\n\r\n\t\t\t\tthis.setState((prevState) => ({\r\n\t\t\t\t\tsearchQuery: search.q,\r\n\t\t\t\t\tpendingSearchQuery: search.q,\r\n\t\t\t\t\tfilters: { ...prevState.filters, selectedFilters: search.filters },\r\n\t\t\t\t\tcustomSorting: {\r\n\t\t\t\t\t\t...prevState.customSorting,\r\n\t\t\t\t\t\tisEnabled: search.customSortingEnabled ? true : false,\r\n\t\t\t\t\t},\r\n\t\t\t\t}));\r\n\r\n\t\t\t\tif (addCustomSortQuery) {\r\n\t\t\t\t\tsearch.customSortingEnabled = true;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// if there's no saved filter associated with this search, ensure that we aren't\r\n\t\t\t\t// keeping this in state, and that we are not in edit mode.\r\n\t\t\t\tif (!search.savedFilterId) {\r\n\t\t\t\t\tthis.setState((prevState) => ({\r\n\t\t\t\t\t\tsavedFilters: { ...prevState.savedFilters, isEditMode: false, appliedSavedFilter: null },\r\n\t\t\t\t\t}));\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// override params to be sent to server with validated value from query string.\r\n\t\t\t\tserverQueryString = getQueryStringFromSearchQuery(search, QueryStringTarget.Server);\r\n\t\t\t\tclientQueryString = getQueryStringFromSearchQuery(search, QueryStringTarget.Client);\r\n\r\n\t\t\t\tconsole.debug('Server Query:', serverQueryString);\r\n\t\t\t\tconsole.debug('Client Query:', clientQueryString);\r\n\r\n\t\t\t\t// update url query string, except when in selection mode\r\n\t\t\t\tif (\r\n\t\t\t\t\t(clientQueryString || clientQueryString !== location.search) &&\r\n\t\t\t\t\tthis.props.listingDisplayMode === ListingDisplayMode.ListingPage\r\n\t\t\t\t) {\r\n\t\t\t\t\tconsole.debug('Replacing Location History due to changes in QueryString:', clientQueryString);\r\n\t\t\t\t\tthis.props.history.replace({ search: clientQueryString });\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tconsole.debug('Creating search query from state');\r\n\t\t\t\t// a search is being executed due to a change in state\r\n\t\t\t\tsearch = {\r\n\t\t\t\t\tpage: results.page,\r\n\t\t\t\t\tpageSize: results.pageSize,\r\n\t\t\t\t\tsortBy: sortBy && sortBy.name,\r\n\t\t\t\t\tsortDirection: sortBy && sortBy.direction,\r\n\t\t\t\t\tq: !entityDefinition.hideSearch ? searchQuery : '',\r\n\t\t\t\t\tsavedFilterId: !savedFilters.isEditMode ? results.appliedSavedFilterId : '',\r\n\t\t\t\t\tcustomSortingEnabled: customSorting.isEnabled,\r\n\t\t\t\t\tfilters: selectedFilters.concat(implicitFilters),\r\n\t\t\t\t};\r\n\r\n\t\t\t\tserverQueryString = getQueryStringFromSearchQuery(search, QueryStringTarget.Server);\r\n\t\t\t\tclientQueryString = getQueryStringFromSearchQuery(search, QueryStringTarget.Client);\r\n\r\n\t\t\t\t// update url query string, except when in selection mode\r\n\t\t\t\tif (\r\n\t\t\t\t\t(clientQueryString || clientQueryString !== location.search) &&\r\n\t\t\t\t\tthis.props.listingDisplayMode === ListingDisplayMode.ListingPage\r\n\t\t\t\t) {\r\n\t\t\t\t\tconsole.debug('Adding Location History:', clientQueryString);\r\n\t\t\t\t\tthis.props.history.push({ search: clientQueryString });\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tlet url = entityDefinition.baseAjaxRoute + serverQueryString;\r\n\r\n\t\t\tif (this.props.pageSize !== DEFAULT_PAGE_SIZE) {\r\n\t\t\t\turl += (serverQueryString ? '&' : '?') + `pageSize=${this.props.pageSize}`;\r\n\t\t\t}\r\n\r\n\t\t\tconsole.debug('Fetching ' + entityDefinition.pluralName, url);\r\n\r\n\t\t\tthis.setState({\r\n\t\t\t\tisLoading: true,\r\n\t\t\t});\r\n\r\n\t\t\tconst response: AxiosResponse<IndexResults<any>> = await AxiosHelper.get<IndexResults<any>>(url, {\r\n\t\t\t\tcancelToken: new axios.default.CancelToken((token) => {\r\n\t\t\t\t\tthis.refreshDataCancelToken = token;\r\n\t\t\t\t}),\r\n\t\t\t\tredirectToAccessDeniedOn403: true,\r\n\t\t\t} as CustomAxiosRequestConfig);\r\n\r\n\t\t\tconsole.debug('Loaded ' + entityDefinition.pluralName);\r\n\r\n\t\t\tconst { page, totalRecords } = response.data;\r\n\r\n\t\t\tif (response.data && response.data.page > 1 && response.data.records.length === 0) {\r\n\t\t\t\tthis.handlePageChange(1);\r\n\t\t\t\tawait this.executePageChange();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// for a11y, we want to give users an update of the change on the screen.\r\n\t\t\tconst isFirstQuery = this.state.pageChangeAlert === null;\r\n\r\n\t\t\tlet resultsCount: number | null = null;\r\n\r\n\t\t\tif (results) {\r\n\t\t\t\tresultsCount = totalRecords;\r\n\t\t\t}\r\n\r\n\t\t\tlet pageChangeAlert = '';\r\n\r\n\t\t\t// the update includes details on the number of results as well as if there's a filter present.\r\n\t\t\tconst hasFilter = this.state.searchQuery || this.state.filters.selectedFilters.length > 0;\r\n\t\t\tconst selectionCount = this.state.selection.count === undefined ? 0 : this.state.selection.count;\r\n\t\t\tconst resultsMessage = `${resultsCount} ${hasFilter ? 'filtered' : ''} result${\r\n\t\t\t\tresultsCount !== 1 ? 's' : ''\r\n\t\t\t} ${selectionCount > 0 ? `${selectionCount} selected` : ''}`;\r\n\r\n\t\t\tif (isFirstQuery) {\r\n\t\t\t\tpageChangeAlert =\r\n\t\t\t\t\tresultsCount !== null\r\n\t\t\t\t\t\t? `Navigated to ${\r\n\t\t\t\t\t\t\t\tentityDefinition.pageTitleOverride || entityDefinition.pluralName\r\n\t\t\t\t\t\t  }. ${resultsMessage}`\r\n\t\t\t\t\t\t: '';\r\n\t\t\t} else {\r\n\t\t\t\tpageChangeAlert = resultsCount !== null ? resultsMessage : '';\r\n\t\t\t}\r\n\r\n\t\t\tthis.setState(() => ({\r\n\t\t\t\tpendingPageChange: page,\r\n\t\t\t\tresults: response.data,\r\n\t\t\t\tpageChangeAlert,\r\n\t\t\t}));\r\n\t\t} catch (error) {\r\n\t\t\tif (axios.default.isCancel(error)) {\r\n\t\t\t\tconsole.warn('Refresh Data request canceled.');\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst axiosError = error as axios.AxiosError;\r\n\r\n\t\t\tconsole.error('Unable to load', entityDefinition.pluralName);\r\n\t\t\tconsole.error(error);\r\n\r\n\t\t\tthis.setState({\r\n\t\t\t\tresults: undefined,\r\n\t\t\t\terror: axiosError,\r\n\t\t\t});\r\n\t\t} finally {\r\n\t\t\tthis.refreshDataCancelToken = null;\r\n\t\t}\r\n\r\n\t\tthis.setState({\r\n\t\t\tisLoading: false,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Sets the sorting options for the listing page context and reloads data.\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic setSearchSortBy = (sortBy: SortBy): void => {\r\n\t\tthis.setState((prevState: any) => {\r\n\t\t\treturn { sortBy, results: { ...prevState.results, page: 1 } };\r\n\t\t}, this.refreshData);\r\n\t};\r\n\r\n\t/**\r\n\t * Updates search query state when the basic search field is modified.\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic handleBasicSearchChange = (basicSearch: string) => {\r\n\t\tthis.setState({\r\n\t\t\tpendingSearchQuery: basicSearch,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Sets the page to whatever was selected from pagination\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic handlePageChange = (page: number): Promise<void> => {\r\n\t\treturn this.setStateAsync({\r\n\t\t\tpendingPageChange: page,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Sets the page to whatever was selected from pagination\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic executePageChange = async (): Promise<void> => {\r\n\t\tawait this.setStateAsync((prevState: any) => ({\r\n\t\t\tresults: { ...prevState.results, page: prevState.pendingPageChange },\r\n\t\t}));\r\n\r\n\t\tawait this.refreshData();\r\n\t};\r\n\r\n\t/**\r\n\t * Executes a simple search based on the query typed in by the user\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic executeSearch = async (): Promise<void> => {\r\n\t\tawait this.setStateAsync((prevState: any) => {\r\n\t\t\treturn {\r\n\t\t\t\tsearchQuery: prevState.pendingSearchQuery,\r\n\t\t\t\tresults: { ...prevState.results, page: 1 },\r\n\t\t\t};\r\n\t\t});\r\n\r\n\t\tawait this.refreshData();\r\n\t};\r\n\r\n\t/**\r\n\t * Completely resets search on the current listing\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate resetSearch = () => {\r\n\t\tthis.setState(\r\n\t\t\t{\r\n\t\t\t\tsearchQuery: '',\r\n\t\t\t\tpendingSearchQuery: '',\r\n\t\t\t},\r\n\t\t\tthis.executeSearch,\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t * Resets current filters\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate resetFilters = () => {\r\n\t\tthis.setState((prevState: any) => {\r\n\t\t\tconst previousStateSelectedFilters = prevState.filters.selectedFilters as SelectedFilter[];\r\n\t\t\treturn {\r\n\t\t\t\tfilters: {\r\n\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\tselectedFilters: previousStateSelectedFilters.filter((f) => f.permanent),\r\n\t\t\t\t},\r\n\t\t\t\tsavedFilters: { ...prevState.savedFilters, appliedSavedFilter: null, isEditMode: false },\r\n\t\t\t\tresults: { ...prevState.results, appliedSavedFilterId: '' },\r\n\t\t\t};\r\n\t\t}, this.executeSearch);\r\n\t};\r\n\r\n\t/**\r\n\t * Handles deleting entities from the listing pages.\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic handleDelete = async (record, nameField): Promise<void> => {\r\n\t\tlet recordName: string = '';\r\n\t\tif (nameField && typeof record[nameField] === 'string') {\r\n\t\t\trecordName = ` (${record[nameField]})`;\r\n\t\t}\r\n\r\n\t\tif (confirm(`Are you sure you want to delete this ${this.props.entityDefinition.singularName}${recordName}?`)) {\r\n\t\t\tconst url = `${this.props.entityDefinition.baseAjaxRoute}/${record.id}`;\r\n\r\n\t\t\ttry {\r\n\t\t\t\tawait AxiosHelper.delete(url);\r\n\r\n\t\t\t\t// prevent attempting to setState after the component has unmounted.\r\n\t\t\t\tif (!this.mounted) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis.refreshData();\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error('Unable to delete:', error);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Adds or updates a filter on the current listing.\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate addOrUpdateFilter = (selectedFilter: SelectedFilter) => {\r\n\t\tthis.setState((prevState: ListingContainerState<any>) => {\r\n\t\t\tconst items = [...prevState.filters.selectedFilters];\r\n\t\t\tconst filterIndex = items.findIndex((item) => item.name === selectedFilter.name);\r\n\r\n\t\t\t// if unable to find filter, add to the list.\r\n\t\t\tif (filterIndex === -1) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tfilters: { ...prevState.filters, selectedFilters: [...items, selectedFilter] },\r\n\t\t\t\t\tsavedFilters: { ...prevState.savedFilters, isEditMode: true },\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\t// if we find a filter, let's just update it.\r\n\t\t\tconst itemToUpdate = items[filterIndex];\r\n\t\t\titemToUpdate.value = selectedFilter.value;\r\n\t\t\titems[filterIndex] = itemToUpdate;\r\n\r\n\t\t\treturn {\r\n\t\t\t\tfilters: { ...prevState.filters, selectedFilters: items },\r\n\t\t\t\tsavedFilters: { ...prevState.savedFilters },\r\n\t\t\t};\r\n\t\t}, this.executeSearch);\r\n\t};\r\n\r\n\t/**\r\n\t * Removes a filter from the current listing\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate removeFilter = (selectedFilter: SelectedFilter) => {\r\n\t\tif (selectedFilter.permanent) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.setState((prevState: ListingContainerState<any>) => {\r\n\t\t\treturn {\r\n\t\t\t\tfilters: {\r\n\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\tselectedFilters: prevState.filters.selectedFilters.filter(\r\n\t\t\t\t\t\t(existingFilter) => existingFilter.name !== selectedFilter.name,\r\n\t\t\t\t\t),\r\n\t\t\t\t},\r\n\t\t\t\tsavedFilters: {\r\n\t\t\t\t\t...prevState.savedFilters,\r\n\t\t\t\t\tisEditMode: prevState.filters.selectedFilters.length !== 1,\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t}, this.executeSearch);\r\n\t};\r\n\r\n\t/**\r\n\t * Toggles the display of the popover of available filter when clicking on \"Filter\"\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic toggleFilterList = () => {\r\n\t\tthis.setState((prevState) => {\r\n\t\t\treturn {\r\n\t\t\t\tfilters: {\r\n\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\tdisplayFilterList: !prevState.filters.displayFilterList,\r\n\t\t\t\t\tfilterBeingChanged: null,\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Closes the display of the popover of available filter\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic closeFilterList = () => {\r\n\t\tthis.setState((prevState) => {\r\n\t\t\treturn {\r\n\t\t\t\tfilters: {\r\n\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\tdisplayFilterList: false,\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Toggles the edit mode of a specific filter\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic toggleFilterChange = () => {\r\n\t\tif (this.state.filters.filterBeingChanged !== null) {\r\n\t\t\tthis.setState((prevState) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tfilters: {\r\n\t\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\t\tfilterBeingChanged: null,\r\n\t\t\t\t\t},\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Called when a filter is being added or edited. We store the filter definition with its value\r\n\t * in state, which makes it trivial to modify the UI as necessary.\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic beginFilterChange = (selectedFilter: SelectedFilter, location: FilterChangeLocation) => {\r\n\t\tthis.setState((prevState: ListingContainerState<any>) => {\r\n\t\t\treturn {\r\n\t\t\t\tfilters: {\r\n\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\tfilterChangeLocation: location,\r\n\t\t\t\t\tfilterBeingChanged: selectedFilter,\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Stops adding a new filter. Because we store the filter definition and value in state,\r\n\t * it's trivial to stop this process and reset the UI.\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic cancelAddFilter = () => {\r\n\t\tthis.setState((prevState: ListingContainerState<any>) => {\r\n\t\t\treturn {\r\n\t\t\t\tfilters: {\r\n\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\tfilterBeingChanged: null,\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Stops editing a filter. Because we store the filter definition and value in state,\r\n\t * it's trivial to stop this process and reset the UI.\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic cancelEditFilter = () => {\r\n\t\tthis.setState((prevState) => {\r\n\t\t\treturn {\r\n\t\t\t\tfilters: {\r\n\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\tfilterBeingChanged: null,\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Callback for when a filter is added/edited, so we can reset the UI state and then push state up to ListingSearch.\r\n\t *\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tpublic onFilterChange = (selectedFilter: SelectedFilter, stopEditing: boolean = true) => {\r\n\t\tif (stopEditing) {\r\n\t\t\tthis.setState((prevState) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tfilters: {\r\n\t\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\t\tfilterBeingChanged: null,\r\n\t\t\t\t\t\tdisplayFilterList: false,\r\n\t\t\t\t\t},\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.addOrUpdateFilter(selectedFilter);\r\n\t};\r\n\r\n\t/**\r\n\t * Callback for when a filter is removed, so we can reset the UI state and then push state up to ListingSearch.\r\n\t *\r\n\t * @private\r\n\t * @memberof ListingContainer\r\n\t */\r\n\tprivate onFilterRemoved = (selectedFilter: SelectedFilter, stopEditing: boolean = true) => {\r\n\t\tif (stopEditing) {\r\n\t\t\tthis.setState((prevState) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tfilters: {\r\n\t\t\t\t\t\t...prevState.filters,\r\n\t\t\t\t\t\tfilterBeingChanged: null,\r\n\t\t\t\t\t\tdisplayFilterList: false,\r\n\t\t\t\t\t},\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.removeFilter(selectedFilter);\r\n\t};\r\n\r\n\t/**\r\n\t * Handles updating order of items after a sort order change while in custom sort mode\r\n\t */\r\n\tprivate onDragDropSortOrderUpdate = async (\r\n\t\tsourceIndex: number,\r\n\t\tdestinationIndex: number | null,\r\n\t\tnewSortOrder: number,\r\n\t) => {\r\n\t\tif (!this.state.results) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// destinationIndex will be null when doing manual updates using the textbox\r\n\t\tif (destinationIndex !== null) {\r\n\t\t\tconst newRecords = reorderArrayValues(this.state.results.records || [], sourceIndex, destinationIndex);\r\n\r\n\t\t\tthis.setState((prevState: any) => {\r\n\t\t\t\treturn {\r\n\t\t\t\t\tresults: {\r\n\t\t\t\t\t\t...prevState.results,\r\n\t\t\t\t\t\trecords: newRecords,\r\n\t\t\t\t\t\tuniqueId: uuid(), // ensure the wrapper component updates\r\n\t\t\t\t\t},\r\n\t\t\t\t};\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.setState({\r\n\t\t\tisLoading: true,\r\n\t\t});\r\n\r\n\t\tconst results = this.state.results;\r\n\t\tconst record = results.records[sourceIndex];\r\n\r\n\t\tconsole.debug(\r\n\t\t\t'Moving:',\r\n\t\t\trecord[this.props.entityDefinition.userFriendlyNameField],\r\n\t\t\t'to position',\r\n\t\t\tnewSortOrder,\r\n\t\t);\r\n\r\n\t\tconst sortOrderUpdateUrl = this.props.entityDefinition.baseAjaxRoute + '/sortorder';\r\n\r\n\t\ttry {\r\n\t\t\tawait AxiosHelper.post(sortOrderUpdateUrl, {\r\n\t\t\t\tid: record.id,\r\n\t\t\t\tsortOrder: newSortOrder,\r\n\t\t\t});\r\n\t\t} catch (error) {\r\n\t\t\ttoastError({\r\n\t\t\t\tcontent: {\r\n\t\t\t\t\tmessage:\r\n\t\t\t\t\t\t'An error occurred while attempting to update sort order. Refreshing results. Please try again.',\r\n\t\t\t\t\ttitle: 'Sort Order Update Failed',\r\n\t\t\t\t},\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tthis.refreshData();\r\n\t};\r\n\r\n\t/**\r\n\t * Updates the custom sorting mode. Resets all searches/filters and updates the current sorting\r\n\t * field to be adequate to sort by.\r\n\t */\r\n\tprivate setCustomSorting = (state: boolean) => {\r\n\t\tconst isHierarchy = this.props.entityDefinition.isHierarchy;\r\n\t\tconst parentFilter = isHierarchy && state ? this.props.entityDefinition.getRootParentSelectedFilter() : null;\r\n\r\n\t\tthis.setState((prevState: any) => {\r\n\t\t\treturn {\r\n\t\t\t\tcustomSorting: {\r\n\t\t\t\t\t...prevState.customSorting,\r\n\t\t\t\t\tisEnabled: state,\r\n\t\t\t\t},\r\n\t\t\t\tsearchQuery: '',\r\n\t\t\t\tpendingSearchQuery: '',\r\n\t\t\t\tfilters: { ...prevState.filters, selectedFilters: parentFilter ? [parentFilter] : [] },\r\n\t\t\t\tsavedFilters: { ...prevState.savedFilters, appliedSavedFilter: null, isEditMode: false },\r\n\t\t\t\tresults: { ...prevState.results, appliedSavedFilterId: '', page: 1 },\r\n\t\t\t\tsortBy: {\r\n\t\t\t\t\ttitle: 'Tree Sort Name',\r\n\t\t\t\t\tname: isHierarchy ? 'TreeSortString' : 'SortOrder',\r\n\t\t\t\t\tdirection: SortByDirection.Ascending,\r\n\t\t\t\t},\r\n\t\t\t};\r\n\t\t}, this.executeSearch);\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<Alert\r\n\t\t\t\t\tisOpen={this.state.isAlertOpen}\r\n\t\t\t\t\tonConfirm={this.closeAlert}\r\n\t\t\t\t\trenderTitle={() => 'Warning'}\r\n\t\t\t\t\trenderContents={() => this.state.alertMessage}\r\n\t\t\t\t\tcolor=\"warning\"\r\n\t\t\t\t/>\r\n\t\t\t\t{this.state.pageChangeAlert ? (\r\n\t\t\t\t\t<VisuallyHiddenAnnouncementTrigger message={this.state.pageChangeAlert} />\r\n\t\t\t\t) : null}\r\n\t\t\t\t{this.props.children({\r\n\t\t\t\t\t...this.state,\r\n\t\t\t\t\tlistingDisplayMode: this.props.listingDisplayMode ?? ListingDisplayMode.ListingPage,\r\n\t\t\t\t})}\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n\r\n// wrapped component type needed for tests\r\nexport class ListingContainerWrapped extends ListingContainer {}\r\n\r\nexport default withRouter<ListingContainerProps, any>(ListingContainerWrapped);\r\n","import * as React from 'react';\r\nimport { FormGroup, Input } from 'reactstrap';\r\nimport { DropdownOption } from 'shared-client/types/fields';\r\nimport { StringFilterEditProps } from '../providers/SingleValue';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\nimport { FiltersListAddButton } from './index';\r\n\r\ninterface SingleDropDownFilterEditState {\r\n\tcurrentValue: string;\r\n\tdisplayValidationError: boolean;\r\n}\r\n\r\nexport type SingleDropDownFilterEditProps = StringFilterEditProps & {\r\n\tdropdownValues: DropdownOption[];\r\n};\r\n\r\n/**\r\n * Configures a single dropdown value  within a filter\r\n */\r\nclass SingleDropDownFilterEdit extends React.Component<SingleDropDownFilterEditProps, SingleDropDownFilterEditState> {\r\n\tpublic static defaultProps = {\r\n\t\tvalue: '',\r\n\t\tenumValues: [],\r\n\t};\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tcurrentValue: '',\r\n\t\t\tdisplayValidationError: false,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Update local state when the controlled dropdown is updated\r\n\t *\r\n\t * @private\r\n\t * @memberof SingleDropDownFilterEdit\r\n\t */\r\n\tprivate handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tthis.setState({ currentValue: e.currentTarget.value });\r\n\t};\r\n\r\n\t/**\r\n\t * Selects the value from the dropdown and updates the state.\r\n\t *\r\n\t * @private\r\n\t * @memberof SingleDropDownFilterEdit\r\n\t */\r\n\tprivate selectValue = () => {\r\n\t\tconst trimmedValue = this.state.currentValue.trim();\r\n\t\tconst validationError = !this.props.filter.nullable && !trimmedValue;\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tif (!validationError) {\r\n\t\t\t// let the parent component know what the new value is.\r\n\t\t\tthis.props.onChange(trimmedValue, false);\r\n\t\t}\r\n\r\n\t\tthis.setState({ currentValue: '' });\r\n\t};\r\n\r\n\t/**\r\n\t * Allow users to hit enter to select new value.\r\n\t *\r\n\t * @private\r\n\t * @memberof SingleDropDownFilterEdit\r\n\t */\r\n\tprivate handleOnKeyDown = (e: React.KeyboardEvent) => {\r\n\t\tif (e.which === 13) {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.selectValue();\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst availableEnumValues = this.props.dropdownValues.filter(\r\n\t\t\t(enumValue) => !this.props.value.includes(enumValue.value.toString()),\r\n\t\t);\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t{availableEnumValues.length > 0 ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\tid=\"fieldValue\"\r\n\t\t\t\t\t\t\ttype=\"select\"\r\n\t\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\t\tvalue={this.state.currentValue}\r\n\t\t\t\t\t\t\tonKeyDown={this.handleOnKeyDown}\r\n\t\t\t\t\t\t\tonChange={this.handleOnChange}\r\n\t\t\t\t\t\t\tclassName=\"\"\r\n\t\t\t\t\t\t\tautoComplete=\"off\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<option value=\"\" />\r\n\t\t\t\t\t\t\t{availableEnumValues.map((status, index) => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t<option key={index} value={status.value}>\r\n\t\t\t\t\t\t\t\t\t\t{status.text}\r\n\t\t\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t</Input>\r\n\t\t\t\t\t\t<div className=\"filters-popover__actions\">\r\n\t\t\t\t\t\t\t<FiltersListAddButton onClick={this.selectValue} />\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<p>No more values available.</p>\r\n\t\t\t\t)}\r\n\t\t\t\t{this.state.displayValidationError ? (\r\n\t\t\t\t\t<FilterEditRequiredValidation messageOverride=\"Field is required\" />\r\n\t\t\t\t) : null}\r\n\t\t\t\t<p />\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default SingleDropDownFilterEdit;\r\n","import * as React from 'react';\r\nimport { FilterEditProps, FilterProviderBase, isGenericEmptyValue } from '.';\r\nimport { Filter } from '..';\r\nimport { BooleanFilterEdit, SingleDecimalFilterEdit, SingleIntegerFilterEdit, SingleTextFilterEdit } from '../editors';\r\nimport SingleDropDownFilterEdit from '../editors/SingleDropDownFilterEdit';\r\n\r\nexport interface StringFilterEditProps extends FilterEditProps<string> {}\r\nexport interface NumberFilterEditProps extends FilterEditProps<number> {}\r\n\r\n/**\r\n * Default provider for single values, generally just strings as this works nicely with how React\r\n * treats values in input tags, as well as how it will be sent to the server.\r\n *\r\n * @export\r\n * @abstract\r\n * @class SingleValueFilterProvider\r\n * @implements {FilterProviderBase<string>}\r\n */\r\nexport abstract class SingleValueFilterProvider implements FilterProviderBase<string> {\r\n\tpublic abstract getComponent(): any;\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic getComponentProps = (filter?: Filter) => ({});\r\n\tpublic getFriendlyValueForDisplay = (value: string): React.ReactNode =>\r\n\t\tvalue === '' ? <em>&lt;Empty&gt;</em> : value;\r\n\tpublic getValueFromQueryString = (query: string) => query;\r\n\tpublic getQueryStringFromValue = (value: string) => value;\r\n\tpublic isEmptyValue = (value: string) => isGenericEmptyValue(value);\r\n}\r\n\r\n/**\r\n * Filter provider for single text values. Inherits the default implementation and only specifies a custom component.\r\n *\r\n * @export\r\n * @class SingleValueFilterProvider\r\n * @extends {SingleValueFilterProvider}\r\n */\r\nexport class SingleTextFilterProvider extends SingleValueFilterProvider {\r\n\tpublic getComponent = (): any => SingleTextFilterEdit;\r\n}\r\n\r\n/**\r\n * Filter provider for single integer values. Inherits the default implementation and only specifies a custom component.\r\n *\r\n * @export\r\n * @class SingleIntegerFilterProvider\r\n * @extends {SingleValueFilterProvider}\r\n */\r\nexport class SingleIntegerFilterProvider extends SingleValueFilterProvider {\r\n\tpublic getComponent = (): any => SingleIntegerFilterEdit;\r\n}\r\n\r\n/**\r\n * Filter provider for single decimal values. Inherits the default implementation and only specifies a custom component.\r\n *\r\n * @export\r\n * @class SingleDecimalFilterProvider\r\n * @extends {SingleValueFilterProvider}\r\n */\r\nexport class SingleDecimalFilterProvider extends SingleValueFilterProvider {\r\n\tpublic getComponent = (): any => SingleDecimalFilterEdit;\r\n}\r\n\r\n/**\r\n * Filter provider for single boolean values. Inherits the default implementation and specifies a custom component a\r\n * and overrides the friendly text displayed in the list of selected values.\r\n *\r\n * @export\r\n * @class SingleBooleanFilterProvider\r\n * @extends {SingleValueFilterProvider}\r\n */\r\nexport class SingleBooleanFilterProvider extends SingleValueFilterProvider {\r\n\tpublic getComponent = (): any => BooleanFilterEdit;\r\n\tpublic getFriendlyValueForDisplay = (value: string): React.ReactNode =>\r\n\t\tvalue === 'true' ? 'Yes' : value === 'false' ? 'No' : '<Empty>';\r\n\tpublic getValueFromQueryString = (query: string) => {\r\n\t\tif (query !== 'true' && query !== 'false' && query !== '') {\r\n\t\t\tthrow new Error('Unable to parse boolean from query string.');\r\n\t\t}\r\n\t\treturn query;\r\n\t};\r\n}\r\n\r\n/**\r\n * Provider for single value selected via a dropdown\r\n *\r\n * @export\r\n * @class SingleDropdownFilterProvider\r\n * @extends {SingleValueFilterProvider}\r\n */\r\nexport class SingleDropdownFilterProvider extends SingleValueFilterProvider {\r\n\tpublic getComponent = () => SingleDropDownFilterEdit;\r\n\tpublic getComponentProps = (filter: Filter) =>\r\n\t\t(filter.options && { dropdownValues: filter.options.dropdownValues }) || {};\r\n}\r\n","import * as React from 'react';\r\nimport { FormGroup, Label, Input } from 'reactstrap';\r\nimport { toKebabCase } from 'util/StringUtil';\r\n\r\nexport interface FancyRadioButtonOption {\r\n\tname: string;\r\n\tlabel: string;\r\n\tdisabled: boolean;\r\n}\r\n\r\nexport interface FancyRadioButtonsProps {\r\n\tname: string;\r\n\toptions: FancyRadioButtonOption[];\r\n\tvalue: string;\r\n\tonChange: (selectedOption: string) => void;\r\n}\r\n\r\n/**\r\n * Renders \"fancy\" Radio Buttons with controlled state\r\n *\r\n * @class FancyRadioButtons\r\n * @extends {React.Component<FancyRadioButtonsProps>}\r\n */\r\nclass FancyRadioButtons extends React.Component<FancyRadioButtonsProps> {\r\n\tpublic render() {\r\n\t\tconst { name, options, onChange, value } = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup tag=\"fieldset\" className=\"fancy-radio\">\r\n\t\t\t\t<div className=\"fancy-radio__body\">\r\n\t\t\t\t\t{options.map((option, index) => (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{option.disabled ? (\r\n\t\t\t\t\t\t\t\t<span className=\"fancy-radio__label\">\r\n\t\t\t\t\t\t\t\t\t<span className=\"fancy-radio__radio fancy-radio__radio--disabled\" />\r\n\t\t\t\t\t\t\t\t\t<span className=\"fancy-radio__faux-radio-btn\" />\r\n\t\t\t\t\t\t\t\t\t<span className=\"fancy-radio__text\">\r\n\t\t\t\t\t\t\t\t\t\t{option.label}\r\n\t\t\t\t\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t\t\t\t(Disabled)\r\n\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t<Label key={index} check className=\"fancy-radio__label\">\r\n\t\t\t\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\t\t\t\ttype=\"radio\"\r\n\t\t\t\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\t\t\t\tclassName=\"fancy-radio__radio\"\r\n\t\t\t\t\t\t\t\t\t\tonChange={() => {\r\n\t\t\t\t\t\t\t\t\t\t\tonChange(option.name);\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\tchecked={option.name === value}\r\n\t\t\t\t\t\t\t\t\t\tdata-testid={`fancy-radio-btn-${toKebabCase(option.label)}`}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t<span className=\"fancy-radio__faux-radio-btn\" />\r\n\t\t\t\t\t\t\t\t\t<span className=\"fancy-radio__text\">{option.label}</span>\r\n\t\t\t\t\t\t\t\t</Label>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</div>\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default FancyRadioButtons;\r\n","import FancyRadioButtons, { FancyRadioButtonOption } from 'components/shared/FancyRadioButtons';\r\nimport * as React from 'react';\r\nimport { Button, FormGroup, Input } from 'reactstrap';\r\nimport { FilterString } from '..';\r\nimport { NotNullValue, NullValue, NullValueLabel } from '../providers/Constants';\r\nimport { StringArrayFilterEditProps } from '../providers/MultipleValue';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\nimport { FiltersListButtonGroup, FiltersListCloseButton, FiltersListAddButton, FiltersListValueButton } from './index';\r\n\r\ninterface MultipleTextFilterEditState {\r\n\tcurrentValue: string;\r\n\tdisplayValidationError: boolean;\r\n\tselectedValueToggle: string;\r\n}\r\n\r\nenum ValueToggleType {\r\n\tSpecific = 'specific',\r\n\tAny = 'any',\r\n}\r\n\r\nconst valueToggleOptions: FancyRadioButtonOption[] = [\r\n\t{ name: ValueToggleType.Specific, label: 'Specific Values', disabled: false },\r\n\t{ name: ValueToggleType.Any, label: 'Any Value', disabled: false },\r\n];\r\n\r\n/**\r\n * Configures multiple simple text values within a filter\r\n */\r\nclass MultipleTextFilterEdit extends React.Component<StringArrayFilterEditProps, MultipleTextFilterEditState> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tcurrentValue: '',\r\n\t\t\tdisplayValidationError: false,\r\n\t\t\tselectedValueToggle:\r\n\t\t\t\tArray.isArray(props.value) && props.value.includes(NotNullValue)\r\n\t\t\t\t\t? ValueToggleType.Any\r\n\t\t\t\t\t: ValueToggleType.Specific,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Update local state when the controlled text box is updated\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFieldEdit\r\n\t */\r\n\tprivate handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tthis.setState({ currentValue: e.currentTarget.value });\r\n\t};\r\n\r\n\t/**\r\n\t * Returns a filtered list of values. Removes null values for non-nullable filters.\r\n\t *\r\n\t * @private\r\n\t * @returns {string[]}\r\n\t * @memberof MultipleTextFilterEdit\r\n\t */\r\n\tprivate getValuesFromProps(): string[] {\r\n\t\tif (!this.props.value) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn this.props.value.filter((value) => this.props.filter.nullable || !!value);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds the value currently in state to the list of values selected.\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFieldEdit\r\n\t */\r\n\tprivate addCurrentValue = () => {\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: false,\r\n\t\t});\r\n\r\n\t\tif (!this.state.currentValue.trim()) {\r\n\t\t\tthis.setState({\r\n\t\t\t\tdisplayValidationError: true,\r\n\t\t\t});\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.addValue(this.state.currentValue);\r\n\t\tthis.setState({ currentValue: '' });\r\n\t};\r\n\r\n\t/**\r\n\t * Begins filtering for any value\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFilterEdit\r\n\t */\r\n\tprivate filterByAnyValue = () => {\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: false,\r\n\t\t});\r\n\r\n\t\tthis.props.onChange([NotNullValue], false);\r\n\t};\r\n\r\n\tprivate addValue = (value: string) => {\r\n\t\tconst trimmedValue = value.trim();\r\n\t\tconst values = this.getValuesFromProps();\r\n\r\n\t\t// ensure uniqueness\r\n\t\tif (trimmedValue && !values.includes(trimmedValue)) {\r\n\t\t\t// let the parent component know what the new values are.\r\n\t\t\tthis.props.onChange(\r\n\t\t\t\t[...values, trimmedValue].filter((val) => val !== NotNullValue),\r\n\t\t\t\tfalse,\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Allow users to hit enter to add new values.\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFieldEdit\r\n\t */\r\n\tprivate handleOnKeyDown = (e: React.KeyboardEvent) => {\r\n\t\tif (e.which === 13) {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.addCurrentValue();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Remove a specific value from the list\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFieldEdit\r\n\t */\r\n\tprivate removeValue = (fieldIndex: number) => {\r\n\t\tconst values = this.getValuesFromProps();\r\n\r\n\t\t// let the parent component know what the new values are.\r\n\t\tconst newValues = values.filter((_, index) => index !== fieldIndex);\r\n\t\tthis.props.onChange(newValues, false);\r\n\t};\r\n\r\n\t/**\r\n\t * Update state when the value toggle changes\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFilterEdit\r\n\t */\r\n\tprivate handleValueToggleChange = (selectedName: string) => {\r\n\t\tthis.setState({\r\n\t\t\tselectedValueToggle: selectedName,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Handles the click after adding a filter for \"no value\"\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFilterEdit\r\n\t */\r\n\tprivate handleAddNoValueFilter = () => {\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: false,\r\n\t\t});\r\n\r\n\t\tthis.addValue(NullValue);\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst values = this.getValuesFromProps();\r\n\t\tconst filterActionClass =\r\n\t\t\t'filters-popover__actions ' + (values.length > 0 ? 'filters-popover__actions--divider' : '');\r\n\r\n\t\tconst {\r\n\t\t\tfilter: { nullable, options },\r\n\t\t} = this.props;\r\n\r\n\t\tconst { selectedValueToggle } = this.state;\r\n\r\n\t\tconst isDisabled = values.includes(NullValue);\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup className=\"filters-popover__form-group\">\r\n\t\t\t\t{nullable ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<FancyRadioButtons\r\n\t\t\t\t\t\t\tname=\"valueToggle\"\r\n\t\t\t\t\t\t\tvalue={selectedValueToggle}\r\n\t\t\t\t\t\t\tonChange={this.handleValueToggleChange}\r\n\t\t\t\t\t\t\toptions={valueToggleOptions}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t{selectedValueToggle === ValueToggleType.Specific ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<hr />\r\n\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\tid=\"fieldValue\"\r\n\t\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\t\tplaceholder=\"Enter a value to filter by\"\r\n\t\t\t\t\t\t\tvalue={this.state.currentValue}\r\n\t\t\t\t\t\t\tonChange={this.handleOnChange}\r\n\t\t\t\t\t\t\tonKeyDown={this.handleOnKeyDown}\r\n\t\t\t\t\t\t\tautoComplete=\"off\"\r\n\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t{nullable ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\tclassName={\r\n\t\t\t\t\t\t\t\t\t\tisDisabled\r\n\t\t\t\t\t\t\t\t\t\t\t? 'fitlers-popover__btn-link fitlers-popover__btn-link--disabled'\r\n\t\t\t\t\t\t\t\t\t\t\t: 'fitlers-popover__btn-link'\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t\t\tcolor=\"secondary\"\r\n\t\t\t\t\t\t\t\t\tonClick={this.handleAddNoValueFilter}\r\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t+ Add {options && options.nullValueLabel ? options.nullValueLabel : NullValueLabel}{' '}\r\n\t\t\t\t\t\t\t\t\tFilter {isDisabled ? <span>(Disabled)</span> : null}\r\n\t\t\t\t\t\t\t\t</Button>{' '}\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t<div className={filterActionClass}>\r\n\t\t\t\t\t\t\t<FiltersListAddButton onClick={this.addCurrentValue} />\r\n\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t{values\r\n\t\t\t\t\t\t\t.filter((value) => value !== NotNullValue)\r\n\t\t\t\t\t\t\t.map((value, index) => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t<React.Fragment key={index}>\r\n\t\t\t\t\t\t\t\t\t\t<FiltersListButtonGroup>\r\n\t\t\t\t\t\t\t\t\t\t\t<FiltersListValueButton>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{FilterString(value, options)}\r\n\t\t\t\t\t\t\t\t\t\t\t</FiltersListValueButton>\r\n\t\t\t\t\t\t\t\t\t\t\t<FiltersListCloseButton\r\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.removeValue(index);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t</FiltersListButtonGroup>{' '}\r\n\t\t\t\t\t\t\t\t\t</React.Fragment>\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t{this.state.displayValidationError ? <FilterEditRequiredValidation /> : null}\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<div className={filterActionClass}>\r\n\t\t\t\t\t\t<FiltersListAddButton onClick={this.filterByAnyValue} />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default MultipleTextFilterEdit;\r\n","import * as React from 'react';\r\nimport { FormGroup, Input } from 'reactstrap';\r\nimport { DropdownOption } from 'shared-client/types/fields';\r\nimport { FilterOptions } from '..';\r\nimport { StringArrayFilterEditProps } from '../providers/MultipleValue';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\nimport { FiltersListButtonGroup, FiltersListCloseButton, FiltersListAddButton, FiltersListValueButton } from './index';\r\n\r\ninterface MultipleDropDownFilterEditState {\r\n\tcurrentValue: string;\r\n\tdisplayValidationError: boolean;\r\n}\r\n\r\nexport type MultipleDropDownFilterEditProps = StringArrayFilterEditProps & {\r\n\tdropdownValues: DropdownOption[];\r\n};\r\n\r\n/**\r\n * Configures multiple simple text values within a filter\r\n */\r\nclass MultipleDropDownFilterEdit extends React.Component<\r\n\tMultipleDropDownFilterEditProps,\r\n\tMultipleDropDownFilterEditState\r\n> {\r\n\tpublic static defaultProps = {\r\n\t\tvalue: [],\r\n\t\tenumValues: [],\r\n\t};\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tcurrentValue: '',\r\n\t\t\tdisplayValidationError: false,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Update local state when the controlled text box is updated\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleDropDownFilterEdit\r\n\t */\r\n\tprivate handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tthis.setState({ currentValue: e.currentTarget.value });\r\n\t};\r\n\r\n\t/**\r\n\t *\r\n\t * @private\r\n\t * @returns\r\n\t * @memberof MultipleDropDownFilterEdit\r\n\t */\r\n\tprivate getValuesFromProps(): string[] {\r\n\t\tif (!this.props.value) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn this.props.value.filter((value) => !!value);\r\n\t}\r\n\r\n\t/**\r\n\t * Displays the text of the dropdown where possible. In case it's not, falls back to display the value.\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleDropDownFilterEdit\r\n\t */\r\n\tprivate getFriendlyValueForDisplay = (value: any, filterOptions?: FilterOptions): React.ReactNode => {\r\n\t\tif (filterOptions != null && filterOptions.dropdownValues != null) {\r\n\t\t\tconst result = filterOptions.dropdownValues.find((dropdownValue) => dropdownValue.value === value);\r\n\t\t\treturn result ? result.text : value;\r\n\t\t} else {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Adds the value currently in state to the list of values selected.\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleDropDownFilterEdit\r\n\t */\r\n\tprivate addCurrentValue = () => {\r\n\t\tconst trimmedValue = this.state.currentValue.trim();\r\n\t\tconst values = this.getValuesFromProps();\r\n\r\n\t\tconst validationError = !this.props.filter.nullable && !trimmedValue;\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\t// ensure uniqueness\r\n\t\tif (!validationError && !values.includes(trimmedValue)) {\r\n\t\t\t// let the parent component know what the new values are.\r\n\t\t\tthis.props.onChange([...values, trimmedValue], false);\r\n\t\t}\r\n\r\n\t\tthis.setState({ currentValue: '' });\r\n\t};\r\n\r\n\t/**\r\n\t * Allow users to hit enter to add new values.\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleDropDownFilterEdit\r\n\t */\r\n\tprivate handleOnKeyDown = (e: React.KeyboardEvent) => {\r\n\t\tif (e.which === 13) {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.addCurrentValue();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Remove a specific value from the list\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleDropDownFilterEdit\r\n\t */\r\n\tprivate removeValue = (fieldIndex: number) => {\r\n\t\tconst values = this.getValuesFromProps();\r\n\r\n\t\t// let the parent component know what the new values are.\r\n\t\tthis.props.onChange(\r\n\t\t\tvalues.filter((_, index) => index !== fieldIndex),\r\n\t\t\tfalse,\r\n\t\t);\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst availableEnumValues = this.props.dropdownValues.filter(\r\n\t\t\t(enumValue) => !this.props.value.includes(enumValue.value.toString()),\r\n\t\t);\r\n\t\tconst values = this.getValuesFromProps();\r\n\t\tconst filterActionClass =\r\n\t\t\t'filters-popover__actions ' + (values.length > 0 ? 'filters-popover__actions--divider' : '');\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t{availableEnumValues.length > 0 ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<Input\r\n\t\t\t\t\t\t\tid=\"fieldValue\"\r\n\t\t\t\t\t\t\ttype=\"select\"\r\n\t\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\t\tvalue={this.state.currentValue}\r\n\t\t\t\t\t\t\tonKeyDown={this.handleOnKeyDown}\r\n\t\t\t\t\t\t\tonChange={this.handleOnChange}\r\n\t\t\t\t\t\t\tclassName=\"\"\r\n\t\t\t\t\t\t\tautoComplete=\"off\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<option value=\"\" />\r\n\t\t\t\t\t\t\t{availableEnumValues.map((status, index) => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t<option key={index} value={status.value}>\r\n\t\t\t\t\t\t\t\t\t\t{status.text}\r\n\t\t\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t</Input>\r\n\t\t\t\t\t\t<div className={filterActionClass}>\r\n\t\t\t\t\t\t\t<FiltersListAddButton onClick={this.addCurrentValue} />\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<p>No more values available.</p>\r\n\t\t\t\t)}\r\n\t\t\t\t{this.state.displayValidationError ? (\r\n\t\t\t\t\t<FilterEditRequiredValidation messageOverride=\"Field is required\" />\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t{values.map((value, index) => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<React.Fragment key={index}>\r\n\t\t\t\t\t\t\t<FiltersListButtonGroup>\r\n\t\t\t\t\t\t\t\t<FiltersListValueButton>\r\n\t\t\t\t\t\t\t\t\t{this.getFriendlyValueForDisplay(value, this.props.filter.options)}\r\n\t\t\t\t\t\t\t\t</FiltersListValueButton>\r\n\t\t\t\t\t\t\t\t<FiltersListCloseButton\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tthis.removeValue(index);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</FiltersListButtonGroup>{' '}\r\n\t\t\t\t\t\t</React.Fragment>\r\n\t\t\t\t\t);\r\n\t\t\t\t})}\r\n\t\t\t\t<p />\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default MultipleDropDownFilterEdit;\r\n","import * as React from 'react';\r\nimport { FilterProviderBase, FilterEditProps, isGenericEmptyValue, QueryStringTarget } from '.';\r\nimport MultipleTextFilterEdit from '../editors/MultipleTextFilterEdit';\r\nimport MultipleDropDownFilterEdit from '../editors/MultipleDropDownFilterEdit';\r\nimport { Filter, FilterString, FilterNotSet, FilterOptions } from '..';\r\nimport { MultipleValueDelimiter } from './Constants';\r\n\r\nexport interface StringArrayFilterEditProps extends FilterEditProps<string[]> {}\r\nexport interface NumberArrayFieldEditProps extends FilterEditProps<number[]> {}\r\n\r\n/**\r\n * Default multiple value field provider. Treats the query as a delimeter separated list of strings.\r\n *\r\n * @export\r\n * @class MultipleValueFieldProvider\r\n * @implements {FieldProviderBase<any[]>}\r\n */\r\nexport class MultipleValueFilterProvider implements FilterProviderBase<any[]> {\r\n\tpublic getComponent = (): React.ComponentType => MultipleTextFilterEdit;\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic getComponentProps = (filter: Filter) => ({});\r\n\tpublic getFriendlyValueForDisplay = (value: any[], filterOptions?: FilterOptions): React.ReactNode => {\r\n\t\tif (filterOptions != null && filterOptions.dropdownValues != null) {\r\n\t\t\tconst friendlyNames = filterOptions.dropdownValues.reduce((acc, obj) => {\r\n\t\t\t\tif (!acc[obj.value]) {\r\n\t\t\t\t\tacc[obj.value] = obj.text;\r\n\t\t\t\t}\r\n\t\t\t\treturn acc;\r\n\t\t\t}, {});\r\n\t\t\treturn value.length === 0 ? (\r\n\t\t\t\t<FilterNotSet />\r\n\t\t\t) : (\r\n\t\t\t\tvalue.reduce((acc, obj, ind, arr) => {\r\n\t\t\t\t\tif (friendlyNames[obj] !== undefined) {\r\n\t\t\t\t\t\tacc += friendlyNames[obj];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tacc += obj;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (ind < arr.length - 1) {\r\n\t\t\t\t\t\tacc += ', ';\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\treturn acc;\r\n\t\t\t\t}, '')\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\treturn value.length === 0 ? <FilterNotSet /> : value.map((f) => FilterString(f, filterOptions)).join(', ');\r\n\t\t}\r\n\t};\r\n\tpublic getValueFromQueryString = (query: string): any[] | null => query.split(MultipleValueDelimiter);\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic getQueryStringFromValue = (value: any[], filter: Filter, target: QueryStringTarget): string =>\r\n\t\t!Array.isArray(value) ? '' : value.join(MultipleValueDelimiter);\r\n\r\n\tpublic isEmptyValue = (value: any[]): boolean => {\r\n\t\tif (isGenericEmptyValue(value)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tArray.isArray(value) &&\r\n\t\t\t(value.length === 0 || value.filter((val) => !isGenericEmptyValue(val)).length === 0)\r\n\t\t) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n}\r\n\r\n/**\r\n * Provider for multiple values selected via a dropdown\r\n *\r\n * @export\r\n * @class MultipleDropdownFilterProvider\r\n * @extends {MultipleValueFilterProvider}\r\n */\r\nexport class MultipleDropdownFilterProvider extends MultipleValueFilterProvider {\r\n\tpublic getComponent = (): React.ComponentType => MultipleDropDownFilterEdit;\r\n\tpublic getComponentProps = (filter: Filter) =>\r\n\t\t(filter.options && { dropdownValues: filter.options.dropdownValues }) || {};\r\n}\r\n","import * as React from 'react';\r\nimport { FilterProviderBase, FilterEditProps, isGenericEmptyValue, QueryStringTarget } from '.';\r\nimport MultipleTextFilterEdit from '../editors/MultipleTextFilterEdit';\r\nimport { RangedNumberFilterEdit, RangedDecimalFilterEdit, RangedIntegerFilterEdit } from '../editors';\r\nimport { Filter } from '..';\r\nimport { RangedValueDelimiter } from './Constants';\r\nimport { RangedValue } from './Types';\r\n\r\nexport interface RangedValueFilterEditProps extends FilterEditProps<RangedValue> {}\r\n\r\n/**\r\n * Default RangedValue field provider, which assumes that the fromValue will be lower than toValue.\r\n *\r\n * @export\r\n * @class RangedValueFieldProvider\r\n * @implements {FieldProviderBase<RangedValue>}\r\n */\r\nexport class RangedValueFieldProvider implements FilterProviderBase<RangedValue> {\r\n\tpublic getComponent = (): any => MultipleTextFilterEdit;\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic getComponentProps = (filter: Filter) => ({});\r\n\tpublic getFriendlyValueForDisplay = (value: RangedValue): React.ReactNode => {\r\n\t\tif (!value) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tif (value.fromValue && value.toValue) {\r\n\t\t\treturn `Between ${value.fromValue} and ${value.toValue}`;\r\n\t\t} else if (value.fromValue) {\r\n\t\t\treturn `More than ${value.fromValue}`;\r\n\t\t} else if (value.toValue) {\r\n\t\t\treturn `Less than ${value.toValue}`;\r\n\t\t}\r\n\r\n\t\treturn '<Empty>';\r\n\t};\r\n\tpublic getValueFromQueryString = (query: string): RangedValue | null => {\r\n\t\tif (!query || !query.trim()) {\r\n\t\t\treturn { fromValue: null, toValue: null };\r\n\t\t}\r\n\r\n\t\tconst values = query.split(RangedValueDelimiter);\r\n\r\n\t\tif (values.length === 2) {\r\n\t\t\treturn { fromValue: values[0], toValue: values[1] };\r\n\t\t} else {\r\n\t\t\treturn { fromValue: query, toValue: null };\r\n\t\t}\r\n\t};\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic getQueryStringFromValue = (value: RangedValue, filter: Filter, target: QueryStringTarget): string => {\r\n\t\tif (!value) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\tconst fromValue = !isGenericEmptyValue(value.fromValue) ? value.fromValue : '';\r\n\t\tconst toValue = !isGenericEmptyValue(value.toValue) ? value.toValue : '';\r\n\r\n\t\treturn `${fromValue}${RangedValueDelimiter}${toValue}`;\r\n\t};\r\n\tpublic isEmptyValue = (value: RangedValue): boolean => {\r\n\t\tif (isGenericEmptyValue(value)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (isGenericEmptyValue(value.fromValue) && isGenericEmptyValue(value.toValue)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n}\r\n\r\n/**\r\n * Field provider for ranged numbers. Inherits the default implementation and only specifies a custom component.\r\n *\r\n * @export\r\n * @class RangedNumberFieldProvider\r\n * @extends {RangedValueFieldProvider}\r\n */\r\nexport class RangedNumberFieldProvider extends RangedValueFieldProvider {\r\n\tpublic getComponent = (): any => RangedNumberFilterEdit;\r\n}\r\n\r\n/**\r\n * Field provider for ranged decimals. Inherits the default implementation and only specifies a custom component.\r\n *\r\n * @export\r\n * @class RangedDecimalFieldProvider\r\n * @extends {RangedValueFieldProvider}\r\n */\r\nexport class RangedDecimalFilterProvider extends RangedValueFieldProvider {\r\n\tpublic getComponent = (): any => RangedDecimalFilterEdit;\r\n}\r\n\r\n/**\r\n * Field provider for ranged integer. Inherits the default implementation and only specifies a custom component.\r\n *\r\n * @export\r\n * @class RangedIntegerFieldProvider\r\n * @extends {RangedValueFieldProvider}\r\n */\r\nexport class RangedIntegerFilterProvider extends RangedValueFieldProvider {\r\n\tpublic getComponent = (): any => RangedIntegerFilterEdit;\r\n}\r\n","import * as React from 'react';\r\nimport { FormGroup } from 'reactstrap';\r\nimport { AutoSuggestFilterEditProps } from '../providers/AutoSuggestValue';\r\nimport AutoSuggestSingle from 'components/shared/auto-suggest/AutoSuggestSingle';\r\n\r\nexport const itemToString = (item) => {\r\n\treturn item ? item.label : '';\r\n};\r\n\r\ninterface SingleAutoSuggestFilterEdit {\r\n\tvalue: string;\r\n}\r\n\r\n/**\r\n * Configures a single auto suggest value within a filter.\r\n */\r\nclass SingleAutoSuggestFilterEdit extends React.Component<AutoSuggestFilterEditProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic handleOnChange = (selectedValue: any) => {\r\n\t\tthis.props.onChange(selectedValue, false);\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tfilter: { options },\r\n\t\t\tvalue,\r\n\t\t} = this.props;\r\n\r\n\t\tif (!options || !options.baseUrl) {\r\n\t\t\treturn <em>The BaseUrl option has not been set.</em>;\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t<AutoSuggestSingle\r\n\t\t\t\t\tname=\"AutoSuggestFilter\"\r\n\t\t\t\t\tlabel=\"Auto Suggest Filter\"\r\n\t\t\t\t\tvalue={value}\r\n\t\t\t\t\tonChange={this.handleOnChange}\r\n\t\t\t\t\tautoSuggestOptions={{\r\n\t\t\t\t\t\tallowNewValues: false,\r\n\t\t\t\t\t\tbaseUrl: options.baseUrl,\r\n\t\t\t\t\t\tparams: options.params,\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default SingleAutoSuggestFilterEdit;\r\n","import AutoSuggestSingle from 'components/shared/auto-suggest/AutoSuggestSingle';\r\nimport FancyRadioButtons, { FancyRadioButtonOption } from 'components/shared/FancyRadioButtons';\r\nimport * as React from 'react';\r\nimport { Button, FormGroup } from 'reactstrap';\r\nimport { FilterOptions, FilterString } from '..';\r\nimport { AutoSuggestArrayFilterEditProps, AutoSuggestValue } from '../providers/AutoSuggestValue';\r\nimport { NotNullValue, NullValue, NullValueLabel } from '../providers/Constants';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\nimport {\r\n\tAnyValueAutoSuggestValue,\r\n\tFiltersListButtonGroup,\r\n\tFiltersListCloseButton,\r\n\tFiltersListAddButton,\r\n\tFiltersListValueButton,\r\n\tNoValueAutoSuggestValue,\r\n} from './index';\r\n\r\ninterface MultipleTextFilterEditState {\r\n\tcurrentValue: AutoSuggestValue | null;\r\n\tdisplayValidationError: boolean;\r\n\tselectedValueToggle: string;\r\n}\r\n\r\nenum ValueToggleType {\r\n\tSpecific = 'specific',\r\n\tAny = 'any',\r\n}\r\n\r\nconst valueToggleOptions: FancyRadioButtonOption[] = [\r\n\t{ name: ValueToggleType.Specific, label: 'Specific Values', disabled: false },\r\n\t{ name: ValueToggleType.Any, label: 'Any Value', disabled: false },\r\n];\r\n\r\n/**\r\n * Configures multiple simple text values within a filter\r\n */\r\nclass MultipleAutoSuggestFilterEdit extends React.Component<\r\n\tAutoSuggestArrayFilterEditProps,\r\n\tMultipleTextFilterEditState\r\n> {\r\n\tconstructor(props: AutoSuggestArrayFilterEditProps) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tcurrentValue: null,\r\n\t\t\tdisplayValidationError: false,\r\n\t\t\tselectedValueToggle:\r\n\t\t\t\tArray.isArray(props.value) && props.value.findIndex((val) => val.value === NotNullValue) > -1\r\n\t\t\t\t\t? ValueToggleType.Any\r\n\t\t\t\t\t: ValueToggleType.Specific,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Update local state when the controlled text box is updated\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFieldEdit\r\n\t */\r\n\tprivate handleOnChange = (value: AutoSuggestValue) => {\r\n\t\tthis.setState({ currentValue: value });\r\n\t};\r\n\r\n\t/**\r\n\t * Returns a filtered list of values. Removes null values for non-nullable filters.\r\n\t *\r\n\t * @private\r\n\t * @returns {string[]}\r\n\t * @memberof MultipleTextFilterEdit\r\n\t */\r\n\tprivate getValuesFromProps(): AutoSuggestValue[] {\r\n\t\tif (!this.props.value) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn this.props.value.filter((value) => this.props.filter.nullable || !!value);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds the value currently in state to the list of values selected.\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFieldEdit\r\n\t */\r\n\tprivate addCurrentValue = () => {\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: false,\r\n\t\t});\r\n\r\n\t\tif (!this.state.currentValue) {\r\n\t\t\tthis.setState({\r\n\t\t\t\tdisplayValidationError: true,\r\n\t\t\t});\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.addValue(this.state.currentValue);\r\n\t\tthis.setState({ currentValue: null });\r\n\t};\r\n\r\n\t/**\r\n\t * Begins filtering for any value\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFilterEdit\r\n\t */\r\n\tprivate filterByAnyValue = () => {\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: false,\r\n\t\t});\r\n\r\n\t\tthis.props.onChange([AnyValueAutoSuggestValue], false);\r\n\t};\r\n\r\n\tprivate addValue = (value: AutoSuggestValue) => {\r\n\t\tconst values = this.getValuesFromProps();\r\n\r\n\t\t// ensure uniqueness\r\n\t\tif (values) {\r\n\t\t\t// let the parent component know what the new values are.\r\n\t\t\tthis.props.onChange(\r\n\t\t\t\t[...values, value].filter((val) => val.value !== NotNullValue),\r\n\t\t\t\tfalse,\r\n\t\t\t);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Remove a specific value from the list\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFieldEdit\r\n\t */\r\n\tprivate removeValue = (fieldIndex: number) => {\r\n\t\tconst values = this.getValuesFromProps();\r\n\r\n\t\t// let the parent component know what the new values are.\r\n\t\tconst newValues = values.filter((_, index) => index !== fieldIndex);\r\n\t\tthis.props.onChange(newValues, false);\r\n\t};\r\n\r\n\t/**\r\n\t * Update state when the value toggle changes\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFilterEdit\r\n\t */\r\n\tprivate handleValueToggleChange = (selectedName: string) => {\r\n\t\tthis.setState({\r\n\t\t\tselectedValueToggle: selectedName,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Handles the click after adding a filter for \"no value\"\r\n\t *\r\n\t * @private\r\n\t * @memberof MultipleTextFilterEdit\r\n\t */\r\n\tprivate handleAddNoValueFilter = (options?: FilterOptions) => {\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: false,\r\n\t\t});\r\n\r\n\t\tif (options && options.nullValueLabel) {\r\n\t\t\tthis.addValue({\r\n\t\t\t\tlabel: options.nullValueLabel,\r\n\t\t\t\tvalue: NullValue,\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tthis.addValue(NoValueAutoSuggestValue);\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst values = this.getValuesFromProps();\r\n\t\tconst filterActionClass =\r\n\t\t\t'filters-popover__actions ' + (values.length > 0 ? 'filters-popover__actions--divider' : '');\r\n\r\n\t\tconst {\r\n\t\t\tfilter: { nullable, options = {} },\r\n\t\t} = this.props;\r\n\r\n\t\tconst { selectedValueToggle } = this.state;\r\n\r\n\t\tconst isDisabled = values.findIndex((val) => val.value === NullValue) !== -1;\r\n\r\n\t\tif (!options.params) {\r\n\t\t\toptions.params = {};\r\n\t\t}\r\n\r\n\t\tconst existingIds = values.map((singleValue) => singleValue.value);\r\n\t\toptions.params.ignoredIds = existingIds;\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup className=\"filters-popover__form-group\">\r\n\t\t\t\t{nullable ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<FancyRadioButtons\r\n\t\t\t\t\t\t\tname=\"valueToggle\"\r\n\t\t\t\t\t\t\tvalue={selectedValueToggle}\r\n\t\t\t\t\t\t\tonChange={this.handleValueToggleChange}\r\n\t\t\t\t\t\t\toptions={valueToggleOptions}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t{selectedValueToggle === ValueToggleType.Specific ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t<hr />\r\n\t\t\t\t\t\t<AutoSuggestSingle\r\n\t\t\t\t\t\t\tname=\"AutoSuggestFilter\"\r\n\t\t\t\t\t\t\tlabel=\"Auto Suggest Filter\"\r\n\t\t\t\t\t\t\tvalue={this.state.currentValue}\r\n\t\t\t\t\t\t\tonChange={this.handleOnChange}\r\n\t\t\t\t\t\t\tautoSuggestOptions={{\r\n\t\t\t\t\t\t\t\tallowNewValues: false,\r\n\t\t\t\t\t\t\t\tbaseUrl: options && options.baseUrl,\r\n\t\t\t\t\t\t\t\tparams: options && options.params,\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t{nullable ? (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\tclassName={\r\n\t\t\t\t\t\t\t\t\t\tisDisabled\r\n\t\t\t\t\t\t\t\t\t\t\t? 'fitlers-popover__btn-link fitlers-popover__btn-link--disabled'\r\n\t\t\t\t\t\t\t\t\t\t\t: 'fitlers-popover__btn-link'\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\ttype=\"button\"\r\n\t\t\t\t\t\t\t\t\tcolor=\"secondary\"\r\n\t\t\t\t\t\t\t\t\tonClick={() => this.handleAddNoValueFilter(options)}\r\n\t\t\t\t\t\t\t\t\tdisabled={isDisabled}\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"filters-null-value-button\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t+ Add {options && options.nullValueLabel ? options.nullValueLabel : NullValueLabel}{' '}\r\n\t\t\t\t\t\t\t\t\tFilter {isDisabled ? <span>(Disabled)</span> : null}\r\n\t\t\t\t\t\t\t\t</Button>{' '}\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t<div className={filterActionClass}>\r\n\t\t\t\t\t\t\t<FiltersListAddButton onClick={this.addCurrentValue} />\r\n\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t{values\r\n\t\t\t\t\t\t\t.filter((value) => value.value !== NotNullValue)\r\n\t\t\t\t\t\t\t.map((value, index) => {\r\n\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t<React.Fragment key={index}>\r\n\t\t\t\t\t\t\t\t\t\t<FiltersListButtonGroup>\r\n\t\t\t\t\t\t\t\t\t\t\t<FiltersListValueButton>\r\n\t\t\t\t\t\t\t\t\t\t\t\t{FilterString(value.label, options)}\r\n\t\t\t\t\t\t\t\t\t\t\t</FiltersListValueButton>\r\n\t\t\t\t\t\t\t\t\t\t\t<FiltersListCloseButton\r\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tthis.removeValue(index);\r\n\t\t\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t</FiltersListButtonGroup>{' '}\r\n\t\t\t\t\t\t\t\t\t</React.Fragment>\r\n\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t{this.state.displayValidationError ? <FilterEditRequiredValidation /> : null}\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<div className={filterActionClass}>\r\n\t\t\t\t\t\t<FiltersListAddButton onClick={this.filterByAnyValue} />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t)}\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default MultipleAutoSuggestFilterEdit;\r\n","import * as React from 'react';\r\nimport { FilterEditProps, FilterProviderBase, isGenericEmptyValue, QueryStringTarget } from '.';\r\nimport SingleAutoSuggestFilterEdit from '../editors/SingleAutoSuggestFilterEdit';\r\nimport { Filter, FilterString } from '..';\r\nimport {\r\n\tValueLabelDelimiter,\r\n\tMultipleValueDelimiter,\r\n\tNotNullValue,\r\n\tNullValue,\r\n\tNullValueLabel,\r\n\tNotNullValueLabel,\r\n} from './Constants';\r\nimport MultipleAutoSuggestFilterEdit from '../editors/MultipleAutoSuggestFilterEdit';\r\n\r\n// prop definitions for auto suggest field edit components.\r\nexport interface AutoSuggestFilterEditProps extends FilterEditProps<AutoSuggestValue> {}\r\nexport interface AutoSuggestArrayFilterEditProps extends FilterEditProps<AutoSuggestValue[]> {}\r\nexport interface AutoSuggestValue {\r\n\tvalue: string;\r\n\tlabel: string;\r\n}\r\n\r\nconst getValidAutoSuggestValueFromQueryString = (query: string, filter: Filter): AutoSuggestValue => {\r\n\tconst values = query.split(ValueLabelDelimiter);\r\n\r\n\tif (values[0] === NullValue) {\r\n\t\treturn {\r\n\t\t\tvalue: NullValue,\r\n\t\t\tlabel: filter.options && filter.options.nullValueLabel ? filter.options.nullValueLabel : NullValueLabel,\r\n\t\t};\r\n\t}\r\n\r\n\tif (values[0] === NotNullValue) {\r\n\t\treturn { value: NotNullValue, label: NotNullValueLabel };\r\n\t}\r\n\r\n\tif (values.length !== 2) {\r\n\t\tthrow new Error('Invalid AutoSuggest value found: ' + query);\r\n\t}\r\n\r\n\t// eslint-disable-next-line\r\n\tlet [value, label] = values;\r\n\r\n\tif (isGenericEmptyValue(value)) {\r\n\t\tthrow new Error('Invalid AutoSuggest value found: ' + query);\r\n\t}\r\n\r\n\tif (isGenericEmptyValue(label)) {\r\n\t\tlabel = value;\r\n\t}\r\n\r\n\treturn { value, label };\r\n};\r\n\r\n/**\r\n * Provider for single auto suggest values. Full reimplementation of the base contract to handle\r\n * AutoSuggest values properly.\r\n *\r\n * @export\r\n * @class SingleAutoSuggestValueFieldProvider\r\n * @implements {FieldProviderBase<AutoSuggestValue>}\r\n */\r\nexport class SingleAutoSuggestValueFilterProvider implements FilterProviderBase<AutoSuggestValue> {\r\n\tpublic getComponent = (): React.ComponentType => SingleAutoSuggestFilterEdit;\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic getComponentProps = (filter: Filter) => ({});\r\n\tpublic getFriendlyValueForDisplay = (value: AutoSuggestValue): React.ReactNode => {\r\n\t\tif (!value || (!value.label && !value.value)) {\r\n\t\t\treturn '<Empty>';\r\n\t\t}\r\n\r\n\t\tif (value.label) {\r\n\t\t\treturn value.label;\r\n\t\t}\r\n\r\n\t\treturn value.value;\r\n\t};\r\n\tpublic getValueFromQueryString = (query: string, filter: Filter) => {\r\n\t\tif (!query) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn getValidAutoSuggestValueFromQueryString(query, filter);\r\n\t};\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic getQueryStringFromValue = (value: AutoSuggestValue, filter: Filter, target: QueryStringTarget) => {\r\n\t\tif (!value) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\treturn value.value + ValueLabelDelimiter + value.label;\r\n\t};\r\n\tpublic isEmptyValue = (value: AutoSuggestValue): boolean => {\r\n\t\tif (isGenericEmptyValue(value)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (isGenericEmptyValue(value.value)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n}\r\n\r\n/**\r\n * Provider for multiple auto suggest values. Full reimplementation of the base contract to handle\r\n * AutoSuggest values properly.\r\n *\r\n * @export\r\n * @class MultipleAutoSuggestValueFieldProvider\r\n * @implements {(FieldProviderBase<AutoSuggestValue[] | null>)}\r\n */\r\nexport class MultipleAutoSuggestValueFilterProvider implements FilterProviderBase<AutoSuggestValue[] | null> {\r\n\tpublic getComponent = (): React.ComponentType => MultipleAutoSuggestFilterEdit;\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic getComponentProps = (filter: Filter) => ({});\r\n\tpublic getFriendlyValueForDisplay = (values: AutoSuggestValue[]): React.ReactNode => {\r\n\t\tconst getFriendlyValueForSingle = (singleValue: AutoSuggestValue) => {\r\n\t\t\tif (!singleValue || (!singleValue.label && !singleValue.value)) {\r\n\t\t\t\treturn '<Empty>';\r\n\t\t\t}\r\n\r\n\t\t\tif (singleValue.label) {\r\n\t\t\t\treturn FilterString(singleValue.label);\r\n\t\t\t}\r\n\r\n\t\t\treturn singleValue.value;\r\n\t\t};\r\n\r\n\t\tif (!values || values.length === 0) {\r\n\t\t\treturn '<Empty>';\r\n\t\t}\r\n\r\n\t\treturn values.map((value) => getFriendlyValueForSingle(value)).join(', ');\r\n\t};\r\n\tpublic getValueFromQueryString = (query: string, filter: Filter) => {\r\n\t\tif (!query) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst result: AutoSuggestValue[] = [];\r\n\t\tconst autoSuggestPairs = query.split(MultipleValueDelimiter);\r\n\r\n\t\t// take a look at tests to see what this is doing.\r\n\t\tfor (const pair of autoSuggestPairs) {\r\n\t\t\ttry {\r\n\t\t\t\tresult.push(getValidAutoSuggestValueFromQueryString(pair, filter));\r\n\t\t\t} catch (error) {}\r\n\t\t}\r\n\r\n\t\treturn result;\r\n\t};\r\n\tpublic getQueryStringFromValue = (\r\n\t\tvalues: AutoSuggestValue[],\r\n\t\t// eslint-disable-next-line no-unused-vars\r\n\t\tfilter: Filter,\r\n\t\t// eslint-disable-next-line no-unused-vars\r\n\t\ttarget: QueryStringTarget,\r\n\t): string => {\r\n\t\tif (!values || values.length === 0) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\treturn values\r\n\t\t\t.map((value) => {\r\n\t\t\t\tif (value.value === NotNullValue || value.value === NullValue) {\r\n\t\t\t\t\treturn value.value;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn value.value + ValueLabelDelimiter + value.label;\r\n\t\t\t})\r\n\t\t\t.join(MultipleValueDelimiter);\r\n\t};\r\n\tpublic isEmptyValue = (value: AutoSuggestValue[]): boolean => {\r\n\t\tif (isGenericEmptyValue(value)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tArray.isArray(value) &&\r\n\t\t\t(value.length === 0 || value.filter((val) => !isGenericEmptyValue(val)).length === 0)\r\n\t\t) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n}\r\n","import Loading from 'components/shared/Loading';\r\nimport moment from 'moment';\r\nimport * as React from 'react';\r\nimport Loadable from 'react-loadable';\r\nimport { FormGroup, Input, Label } from 'reactstrap';\r\nimport { localMoment } from 'util/Time';\r\nimport { getFriendlyDateRangePresetValueForDisplay, MultipleDateRangePresets } from '../providers/Constants';\r\nimport { MultipleRangedPresetValueFilterEditProps, RangedPresetValue } from '../providers/Types';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\nimport { FiltersListButtonGroup, FiltersListCloseButton, FiltersListAddButton, FiltersListValueButton } from './index';\r\n\r\nconst DateRangePicker = Loadable({\r\n\tloader: () =>\r\n\t\timport(/* webpackChunkName: \"date-range-picker-component\" */ 'react-dates/lib/components/DateRangePicker'),\r\n\tloading: Loading,\r\n});\r\n\r\ninterface MultipleDateRangePresetFilterEditState {\r\n\tcurrentValue: string;\r\n\tcustomFromValue: moment.Moment | null;\r\n\tcustomToValue: moment.Moment | null;\r\n\tfocusedInput: 'startDate' | 'endDate' | null;\r\n\tdisplayValidationError: boolean;\r\n}\r\n\r\n/**\r\n * Configures multiple date values within a filter\r\n */\r\nclass MultipleDateRangePresetFilterEdit extends React.Component<\r\n\tMultipleRangedPresetValueFilterEditProps,\r\n\tMultipleDateRangePresetFilterEditState\r\n> {\r\n\tpublic static defaultProps = {\r\n\t\tvalue: [],\r\n\t\tenumValues: [],\r\n\t};\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tcurrentValue: '',\r\n\t\t\tcustomFromValue: null,\r\n\t\t\tcustomToValue: null,\r\n\t\t\tfocusedInput: null,\r\n\t\t\tdisplayValidationError: false,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Update local state when the controlled text box is updated\r\n\t *\r\n\t * @private\r\n\t * @memberof EnumDropDownFilterEdit\r\n\t */\r\n\tprivate handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tthis.setState({ currentValue: e.currentTarget.value });\r\n\t};\r\n\r\n\t/**\r\n\t *\r\n\t * @private\r\n\t * @returns\r\n\t * @memberof EnumDropDownFilterEdit\r\n\t */\r\n\tprivate getValuesFromProps(): RangedPresetValue[] {\r\n\t\tif (!this.props.value) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn this.props.value.filter((value) => value.preset || value.fromValue || value.toValue);\r\n\t}\r\n\r\n\t/**\r\n\t * Adds the value currently in state to the list of values selected.\r\n\t *\r\n\t * @private\r\n\t * @memberof EnumDropDownFilterEdit\r\n\t */\r\n\tprivate addCurrentValue = () => {\r\n\t\tconst currentValue = this.state.currentValue;\r\n\t\tconst values = this.getValuesFromProps();\r\n\t\tlet currentValueDateRange: RangedPresetValue;\r\n\r\n\t\tif (currentValue === 'custom') {\r\n\t\t\tcurrentValueDateRange = {\r\n\t\t\t\tfromValue: this.state.customFromValue,\r\n\t\t\t\ttoValue: this.state.customToValue,\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tconst presetFn = MultipleDateRangePresets[currentValue];\r\n\t\t\tif (!presetFn) {\r\n\t\t\t\tconsole.warn('Preset not found:', currentValue);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tcurrentValueDateRange = presetFn(this.props.filter.options?.ignoreTimezone);\r\n\t\t}\r\n\r\n\t\tconst isEmpty = currentValueDateRange.fromValue === null && currentValueDateRange.toValue === null;\r\n\t\tconst validationError = !this.props.filter.nullable && isEmpty;\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tconst isUnique =\r\n\t\t\tvalues.length === 0 ||\r\n\t\t\tvalues.findIndex(\r\n\t\t\t\t(value) =>\r\n\t\t\t\t\tvalue.preset === currentValueDateRange.preset ||\r\n\t\t\t\t\t(value.fromValue === currentValueDateRange.fromValue && value.toValue === currentValueDateRange),\r\n\t\t\t) === -1;\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tif (!validationError && isUnique) {\r\n\t\t\tthis.props.onChange([...values, currentValueDateRange], false);\r\n\t\t}\r\n\r\n\t\tthis.setState({\r\n\t\t\tcurrentValue: '',\r\n\t\t\tcustomToValue: null,\r\n\t\t\tcustomFromValue: null,\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Allow users to hit enter to add new values.\r\n\t *\r\n\t * @private\r\n\t * @memberof EnumDropDownFilterEdit\r\n\t */\r\n\tprivate handleOnKeyDown = (e: React.KeyboardEvent) => {\r\n\t\tif (e.which === 13) {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.addCurrentValue();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Remove a specific value from the list\r\n\t *\r\n\t * @private\r\n\t * @memberof EnumDropDownFilterEdit\r\n\t */\r\n\tprivate removeValue = (fieldIndex: number) => {\r\n\t\tconst values = this.getValuesFromProps();\r\n\r\n\t\t// let the parent component know what the new values are.\r\n\t\tthis.props.onChange(\r\n\t\t\tvalues.filter((_, index) => index !== fieldIndex),\r\n\t\t\tfalse,\r\n\t\t);\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst values = this.getValuesFromProps();\r\n\t\tconst availableDateRanges = Object.keys(MultipleDateRangePresets).filter((key) => {\r\n\t\t\treturn !values.some((value) => value.preset === key);\r\n\t\t});\r\n\r\n\t\tconst filterActionClass =\r\n\t\t\t'filters-popover__actions ' + (values.length > 0 ? 'filters-popover__actions--divider' : '');\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t<Label for=\"date-select\" className=\"visually-hidden\">\r\n\t\t\t\t\tSelect date\r\n\t\t\t\t</Label>\r\n\t\t\t\t<Input\r\n\t\t\t\t\tid=\"date-select\"\r\n\t\t\t\t\tdata-testid=\"data-select-multiple\"\r\n\t\t\t\t\ttype=\"select\"\r\n\t\t\t\t\tautoFocus\r\n\t\t\t\t\tvalue={this.state.currentValue}\r\n\t\t\t\t\tonKeyDown={this.handleOnKeyDown}\r\n\t\t\t\t\tonChange={this.handleOnChange}\r\n\t\t\t\t\tclassName=\"\"\r\n\t\t\t\t\tautoComplete=\"off\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<option value=\"\" />\r\n\t\t\t\t\t{availableDateRanges.map((preset, index) => {\r\n\t\t\t\t\t\tconst presetValue = MultipleDateRangePresets[preset]();\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<option key={index} value={preset}>\r\n\t\t\t\t\t\t\t\t{presetValue.displayName || presetValue.preset}\r\n\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t\t<option value=\"custom\">Custom Date Range...</option>\r\n\t\t\t\t</Input>\r\n\t\t\t\t{this.state.currentValue === 'custom' ? (\r\n\t\t\t\t\t<DateRangePicker\r\n\t\t\t\t\t\tshowDefaultInputIcon\r\n\t\t\t\t\t\tshowClearDates\r\n\t\t\t\t\t\tsmall\r\n\t\t\t\t\t\tstartDateId={'fromDate'}\r\n\t\t\t\t\t\tstartDate={this.state.customFromValue}\r\n\t\t\t\t\t\tendDateId={'toDate'}\r\n\t\t\t\t\t\tendDate={this.state.customToValue}\r\n\t\t\t\t\t\tfocusedInput={this.state.focusedInput}\r\n\t\t\t\t\t\tisOutsideRange={() => false}\r\n\t\t\t\t\t\tminimumNights={0}\r\n\t\t\t\t\t\tdisplayFormat={() => 'M/D/YYYY'}\r\n\t\t\t\t\t\tonDatesChange={({\r\n\t\t\t\t\t\t\tstartDate,\r\n\t\t\t\t\t\t\tendDate,\r\n\t\t\t\t\t\t}: {\r\n\t\t\t\t\t\t\tstartDate: moment.Moment;\r\n\t\t\t\t\t\t\tendDate: moment.Moment;\r\n\t\t\t\t\t\t}) => {\r\n\t\t\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\t\t\tcustomFromValue: startDate ? localMoment(startDate).startOf('day') : null,\r\n\t\t\t\t\t\t\t\tcustomToValue: endDate ? localMoment(endDate).endOf('day') : null,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tonFocusChange={(focusedInput) => {\r\n\t\t\t\t\t\t\tthis.setState({ focusedInput });\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t<div className={filterActionClass}>\r\n\t\t\t\t\t<FiltersListAddButton onClick={this.addCurrentValue} />\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t{this.state.displayValidationError ? (\r\n\t\t\t\t\t<FilterEditRequiredValidation messageOverride=\"Field is required\" />\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t{values.map((value, index) => {\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<React.Fragment key={index}>\r\n\t\t\t\t\t\t\t<FiltersListButtonGroup>\r\n\t\t\t\t\t\t\t\t<FiltersListValueButton>\r\n\t\t\t\t\t\t\t\t\t{getFriendlyDateRangePresetValueForDisplay(value)}\r\n\t\t\t\t\t\t\t\t</FiltersListValueButton>\r\n\t\t\t\t\t\t\t\t<FiltersListCloseButton\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tthis.removeValue(index);\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</FiltersListButtonGroup>{' '}\r\n\t\t\t\t\t\t</React.Fragment>\r\n\t\t\t\t\t);\r\n\t\t\t\t})}\r\n\t\t\t\t<p />\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default MultipleDateRangePresetFilterEdit;\r\n","import * as React from 'react';\r\nimport { FilterProviderBase, isGenericEmptyValue, QueryStringTarget } from '.';\r\nimport { Filter, FilterNotSet } from '..';\r\nimport {\r\n\tMultipleValueDelimiter,\r\n\tRangedValueDelimiter,\r\n\tMultipleDateRangePresets,\r\n\tgetFriendlyDateRangePresetValueForDisplay,\r\n\tRangePresetValuePresets,\r\n} from './Constants';\r\nimport { RangedPresetValue } from './Types';\r\nimport MultipleDateRangePresetFilterEdit from '../editors/MultipleDateRangePresetFilterEdit';\r\nimport moment from 'moment';\r\n\r\n/**\r\n * Abstract class used to define filter type providers that support multiple values as well as ranges.\r\n * Inherit this class in order to implement your own. This adds a `getPresets` abstract method\r\n * that needs to be implemented, returning a dictionary with all the presets that we want to work with.\r\n * It also adds a `isValidRangePresetValue` method in order to help validate the values parsed from the\r\n * query string, to ensure they're valid.\r\n *\r\n * @export\r\n * @abstract\r\n * @class MultipleRangePresetProvider\r\n * @implements {FilterProviderBase<RangedPresetValue[]>}\r\n */\r\nexport abstract class MultipleRangePresetProvider implements FilterProviderBase<RangedPresetValue[]> {\r\n\tpublic getPresets = (): RangePresetValuePresets => ({});\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic isValidRangePresetValue = (value: RangedPresetValue): boolean => true;\r\n\tpublic getComponent = (): React.ComponentType => () => <>Component not set.</>;\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic getComponentProps = (filter: Filter) => ({});\r\n\tpublic getFriendlyValueForDisplay = (value: any[]): React.ReactNode => {\r\n\t\tif (value.length === 0) {\r\n\t\t\treturn <FilterNotSet />;\r\n\t\t}\r\n\r\n\t\treturn value.map(getFriendlyDateRangePresetValueForDisplay).join(', ');\r\n\t};\r\n\r\n\tpublic getValueFromQueryString = (query: string): RangedPresetValue[] | null => {\r\n\t\t// key=preset\r\n\t\t// key=fromvalue<range>tovalue\r\n\t\t// key=preset<value>foo<range>bar<value>baz<range>bar\r\n\r\n\t\tif (!query || !query.trim()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst rangedPresetValues: RangedPresetValue[] = [];\r\n\t\tconst values = query.split(MultipleValueDelimiter);\r\n\t\tconst presets = this.getPresets() || {};\r\n\r\n\t\tfor (const value of values) {\r\n\t\t\tconst rangeOrPreset = value.split(RangedValueDelimiter);\r\n\r\n\t\t\tif (rangeOrPreset.length === 2) {\r\n\t\t\t\tconst parsedValue: RangedPresetValue = {\r\n\t\t\t\t\tfromValue: rangeOrPreset[0],\r\n\t\t\t\t\ttoValue: rangeOrPreset[1],\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif (!this.isValidRangePresetValue(parsedValue)) {\r\n\t\t\t\t\tthrow new Error('Invalid date range preset values found.');\r\n\t\t\t\t}\r\n\r\n\t\t\t\trangedPresetValues.push(parsedValue);\r\n\t\t\t} else {\r\n\t\t\t\tconst preset = presets[value];\r\n\r\n\t\t\t\tif (typeof preset === 'function') {\r\n\t\t\t\t\tconst presetResult: RangedPresetValue = preset();\r\n\t\t\t\t\trangedPresetValues.push(presetResult);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst parsedValue: RangedPresetValue = {\r\n\t\t\t\t\t\tfromValue: rangeOrPreset[0],\r\n\t\t\t\t\t\ttoValue: null,\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tif (!this.isValidRangePresetValue(parsedValue)) {\r\n\t\t\t\t\t\tthrow new Error('Invalid date range preset values found.');\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\trangedPresetValues.push(parsedValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rangedPresetValues;\r\n\t};\r\n\r\n\tpublic getQueryStringFromValue = (\r\n\t\tvalue: RangedPresetValue[],\r\n\t\tfilter: Filter,\r\n\t\ttarget: QueryStringTarget,\r\n\t): string => {\r\n\t\tif (!Array.isArray(value)) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\tconst presets = this.getPresets();\r\n\r\n\t\tconst queryStringChunks = value.map((rangedPresetValue) => {\r\n\t\t\tlet fromValue = '';\r\n\t\t\tlet toValue = '';\r\n\r\n\t\t\tif (rangedPresetValue.preset) {\r\n\t\t\t\t// if the query string is used by the client, let's display the preset only\r\n\t\t\t\t// to be more user friendly.\r\n\t\t\t\tif (target === QueryStringTarget.Client) {\r\n\t\t\t\t\treturn rangedPresetValue.preset;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// if this is going to the server, attempt to get the full value\r\n\t\t\t\t\tconst presetFn = presets[rangedPresetValue.preset];\r\n\r\n\t\t\t\t\tif (presetFn) {\r\n\t\t\t\t\t\tconst preset = presetFn(filter?.options?.ignoreTimezone);\r\n\t\t\t\t\t\tfromValue = !isGenericEmptyValue(preset.fromValue) ? preset.fromValue : '';\r\n\t\t\t\t\t\ttoValue = !isGenericEmptyValue(preset.toValue) ? preset.toValue : '';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tconsole.warn('Invalid preset provided:', rangedPresetValue.preset);\r\n\t\t\t\t\t\treturn '';\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tfromValue = !isGenericEmptyValue(rangedPresetValue.fromValue) ? rangedPresetValue.fromValue : '';\r\n\t\t\t\ttoValue = !isGenericEmptyValue(rangedPresetValue.toValue) ? rangedPresetValue.toValue : '';\r\n\t\t\t}\r\n\r\n\t\t\treturn `${fromValue}${RangedValueDelimiter}${toValue}`;\r\n\t\t});\r\n\r\n\t\treturn queryStringChunks.join(MultipleValueDelimiter);\r\n\t};\r\n\r\n\tpublic isEmptyValue = (value: RangedPresetValue[]): boolean => {\r\n\t\tif (isGenericEmptyValue(value)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif (Array.isArray(value) && (value.length === 0 || value.every((val) => isGenericEmptyValue(val)))) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n}\r\n\r\n/**\r\n * Implementation of the a range preset provider specific to dates\r\n */\r\nexport class MultipleDateRangePresetProvider extends MultipleRangePresetProvider {\r\n\tpublic getPresets = () => MultipleDateRangePresets;\r\n\tpublic isValidRangePresetValue = (value: RangedPresetValue) => {\r\n\t\tconst fromValue = value.fromValue ? moment(value.fromValue) : null;\r\n\t\tconst toValue = value.toValue ? moment(value.toValue) : null;\r\n\r\n\t\tconst fromValueValid = fromValue === null || fromValue.isValid();\r\n\t\tconst toValueValid = toValue === null || toValue.isValid();\r\n\r\n\t\tif (!fromValueValid || !toValueValid) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t};\r\n\tpublic getComponent = () => MultipleDateRangePresetFilterEdit;\r\n}\r\n","import moment, { Moment } from 'moment';\r\nimport * as React from 'react';\r\nimport { isInclusivelyBeforeDay, SingleDatePicker } from 'react-dates';\r\nimport { FormGroup, Label } from 'reactstrap';\r\nimport Input from 'reactstrap/lib/Input';\r\nimport { localMoment } from 'util/Time';\r\nimport { SingleDateRangePresets } from '../providers/Constants';\r\nimport { RangedPresetValue, SingleDateFilterEditProps } from '../providers/Types';\r\nimport { FiltersListAddButton } from './index';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\n\r\ninterface SingleDateFilterEditState {\r\n\tcurrentValue: string;\r\n\tdisplayValidationError: boolean;\r\n\tfocused: boolean;\r\n\tcustomFromValue: moment.Moment | null;\r\n\tcustomToValue: moment.Moment | null;\r\n}\r\n/**\r\n * Configures a single date value within a filter\r\n */\r\nclass SingleDateFilterEdit extends React.PureComponent<SingleDateFilterEditProps, SingleDateFilterEditState> {\r\n\tconstructor(props: Readonly<SingleDateFilterEditProps>) {\r\n\t\tsuper(props);\r\n\r\n\t\tif (props.value === undefined) {\r\n\t\t\tthis.state = {\r\n\t\t\t\tcurrentValue: '',\r\n\t\t\t\tdisplayValidationError: false,\r\n\t\t\t\tfocused: false,\r\n\t\t\t\tcustomFromValue: null,\r\n\t\t\t\tcustomToValue: null,\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tthis.state = {\r\n\t\t\t\tcurrentValue: props.value[0].preset === undefined ? 'custom' : props.value[0].preset,\r\n\t\t\t\tdisplayValidationError: false,\r\n\t\t\t\tfocused: false,\r\n\t\t\t\tcustomFromValue: null,\r\n\t\t\t\tcustomToValue: props.value[0].preset === undefined ? localMoment(props.value[0].toValue) : null,\r\n\t\t\t};\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Update local state when the controlled select dropdown is updated\r\n\t */\r\n\tprivate onSelectChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tthis.setState({ currentValue: e.currentTarget.value });\r\n\t};\r\n\r\n\t/**\r\n\t * Update local state when the controlled datepicker is updated\r\n\t */\r\n\tprivate onDateChange = (date: Moment) => {\r\n\t\tthis.setState({ customToValue: date.startOf('day') });\r\n\t};\r\n\r\n\tprivate focusOnChange = (isFocused: boolean | null) => {\r\n\t\tthis.setState({\r\n\t\t\tfocused: !!isFocused,\r\n\t\t});\r\n\t};\r\n\r\n\tprivate getValuesFromProps(): RangedPresetValue[] {\r\n\t\t// always return empty so the filters don't get stacked.\r\n\t\treturn [];\r\n\t}\r\n\r\n\t/**\r\n\t * Adds the value currently in state to the list of values selected.\r\n\t *\r\n\t * @private\r\n\t * @memberof EnumDropDownFilterEdit\r\n\t */\r\n\tprivate handleSearch = () => {\r\n\t\tconst currentValue = this.state.currentValue;\r\n\t\tconst values = this.getValuesFromProps();\r\n\t\tlet currentValueDateRange: RangedPresetValue;\r\n\r\n\t\tif (currentValue.toString() === 'custom') {\r\n\t\t\tcurrentValueDateRange = {\r\n\t\t\t\tfromValue: this.state.customFromValue,\r\n\t\t\t\ttoValue: this.state.customToValue,\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tconst presetFn = SingleDateRangePresets[currentValue.toString()];\r\n\t\t\tif (!presetFn) {\r\n\t\t\t\tconsole.warn('Preset not found:', currentValue);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tcurrentValueDateRange = presetFn();\r\n\t\t}\r\n\r\n\t\tconst isEmpty = currentValueDateRange.fromValue === null && currentValueDateRange.toValue === null;\r\n\t\tconst validationError = !this.props.filter.nullable && isEmpty;\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tconst isUnique =\r\n\t\t\tvalues.length === 0 ||\r\n\t\t\tvalues.findIndex(\r\n\t\t\t\t(value) =>\r\n\t\t\t\t\tvalue.preset === currentValueDateRange.preset ||\r\n\t\t\t\t\t(value.fromValue === currentValueDateRange.fromValue && value.toValue === currentValueDateRange),\r\n\t\t\t) === -1;\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tif (!validationError && isUnique) {\r\n\t\t\tthis.props.onChange([...values, currentValueDateRange], false);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Allow users to hit enter to add new values.\r\n\t */\r\n\tprivate handleOnKeyDown = (e: React.KeyboardEvent) => {\r\n\t\tif (e.which === 13) {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.handleSearch();\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tlet showPastDates: boolean = true;\r\n\t\tlet showFutureDates: boolean = true;\r\n\r\n\t\tif (this.props.filter.options != null && this.props.filter.options.dateParams != null) {\r\n\t\t\tif (this.props.filter.options.dateParams.showPastDates != undefined) {\r\n\t\t\t\tshowPastDates = this.props.filter.options.dateParams.showPastDates;\r\n\t\t\t}\r\n\t\t\tif (this.props.filter.options.dateParams.showFutureDates != undefined) {\r\n\t\t\t\tshowFutureDates = this.props.filter.options.dateParams.showFutureDates;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst values = this.getValuesFromProps();\r\n\t\tconst availableDateRanges = Object.keys(SingleDateRangePresets).filter((key) => {\r\n\t\t\treturn !values.some((value) => value.preset === key);\r\n\t\t});\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t<Label for=\"date-select\" className=\"visually-hidden\">\r\n\t\t\t\t\tSelect date\r\n\t\t\t\t</Label>\r\n\t\t\t\t<Input\r\n\t\t\t\t\tid=\"date-select\"\r\n\t\t\t\t\ttype=\"select\"\r\n\t\t\t\t\tautoFocus\r\n\t\t\t\t\tvalue={this.state.currentValue}\r\n\t\t\t\t\tonKeyDown={this.handleOnKeyDown}\r\n\t\t\t\t\tonChange={this.onSelectChange}\r\n\t\t\t\t\tclassName=\"\"\r\n\t\t\t\t\tautoComplete=\"off\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<option value=\"\" />\r\n\t\t\t\t\t{availableDateRanges.map((preset, index) => {\r\n\t\t\t\t\t\tconst presetValue = SingleDateRangePresets[preset]();\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<option key={index} value={preset}>\r\n\t\t\t\t\t\t\t\t{presetValue.displayName || presetValue.preset}\r\n\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t\t<option value=\"custom\">Custom Date...</option>\r\n\t\t\t\t</Input>\r\n\t\t\t\t{this.state.currentValue.toString() === 'custom' ? (\r\n\t\t\t\t\t<SingleDatePicker\r\n\t\t\t\t\t\tid={this.props.filter.name}\r\n\t\t\t\t\t\tshowDefaultInputIcon\r\n\t\t\t\t\t\tshowClearDate\r\n\t\t\t\t\t\tsmall\r\n\t\t\t\t\t\tdate={this.state.customToValue}\r\n\t\t\t\t\t\tfocused={this.state.focused}\r\n\t\t\t\t\t\tonDateChange={this.onDateChange}\r\n\t\t\t\t\t\tonFocusChange={({ focused }) => {\r\n\t\t\t\t\t\t\tthis.focusOnChange(focused);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tisOutsideRange={\r\n\t\t\t\t\t\t\tshowPastDates && !showFutureDates\r\n\t\t\t\t\t\t\t\t? (day) => !isInclusivelyBeforeDay(day, moment())\r\n\t\t\t\t\t\t\t\t: showPastDates && showFutureDates\r\n\t\t\t\t\t\t\t\t? () => false\r\n\t\t\t\t\t\t\t\t: undefined\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t/>\r\n\t\t\t\t) : null}\r\n\t\t\t\t<div className=\"filters-popover__actions\">\r\n\t\t\t\t\t<FiltersListAddButton onClick={this.handleSearch} />\r\n\t\t\t\t</div>\r\n\t\t\t\t{this.state.displayValidationError ? (\r\n\t\t\t\t\t<FilterEditRequiredValidation messageOverride=\"Field is required\" />\r\n\t\t\t\t) : null}\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\nexport default SingleDateFilterEdit;\r\n","import Loading from 'components/shared/Loading';\r\nimport moment from 'moment';\r\nimport * as React from 'react';\r\nimport Loadable from 'react-loadable';\r\nimport { FormGroup, Input, Label } from 'reactstrap';\r\nimport { localMoment } from 'util/Time';\r\nimport { MultipleDateRangePresets } from '../providers/Constants';\r\nimport { RangedPresetValue, SingleRangedPresetValueFilterEditProps } from '../providers/Types';\r\nimport FilterEditRequiredValidation from './FilterEditRequiredValidation';\r\nimport { FiltersListAddButton } from './index';\r\n\r\nconst DateRangePicker = Loadable({\r\n\tloader: () =>\r\n\t\timport(/* webpackChunkName: \"date-range-picker-component\" */ 'react-dates/lib/components/DateRangePicker'),\r\n\tloading: Loading,\r\n});\r\n\r\ninterface SingleDateRangePresetFilterEditState {\r\n\tcurrentValue: string;\r\n\tcustomFromValue: moment.Moment | null;\r\n\tcustomToValue: moment.Moment | null;\r\n\tfocusedInput: 'startDate' | 'endDate' | null;\r\n\tdisplayValidationError: boolean;\r\n}\r\n\r\n/**\r\n * Configures single date range within a filter\r\n */\r\nclass SingleDateRangePresetFilterEdit extends React.PureComponent<\r\n\tSingleRangedPresetValueFilterEditProps,\r\n\tSingleDateRangePresetFilterEditState\r\n> {\r\n\tconstructor(props: Readonly<SingleRangedPresetValueFilterEditProps>) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tcurrentValue: '',\r\n\t\t\tdisplayValidationError: false,\r\n\t\t\tfocusedInput: null,\r\n\t\t\tcustomFromValue: null,\r\n\t\t\tcustomToValue: null,\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Update local state when the controlled datepicker is updated\r\n\t *\r\n\t */\r\n\tprivate handleOnChange = (e: React.ChangeEvent<HTMLInputElement>) => {\r\n\t\tthis.setState({ currentValue: e.currentTarget.value });\r\n\t};\r\n\r\n\t/**\r\n\t * sets teh selected range to the state and handles the search.\r\n\t */\r\n\tprivate handleSearch = () => {\r\n\t\tconst currentValue = this.state.currentValue;\r\n\t\tlet currentValueDateRange: RangedPresetValue;\r\n\r\n\t\tif (currentValue.toString() === 'custom') {\r\n\t\t\tcurrentValueDateRange = {\r\n\t\t\t\tfromValue: this.state.customFromValue,\r\n\t\t\t\ttoValue: this.state.customToValue,\r\n\t\t\t};\r\n\t\t} else {\r\n\t\t\tconst presetFn = MultipleDateRangePresets[currentValue.toString()];\r\n\t\t\tif (!presetFn) {\r\n\t\t\t\tconsole.warn('Preset not found:', currentValue);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tcurrentValueDateRange = presetFn();\r\n\t\t}\r\n\r\n\t\tconst isEmpty = currentValueDateRange.fromValue === null && currentValueDateRange.toValue === null;\r\n\t\tconst validationError = !this.props.filter.nullable && isEmpty;\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tthis.setState({\r\n\t\t\tdisplayValidationError: validationError,\r\n\t\t});\r\n\r\n\t\tif (!validationError) {\r\n\t\t\tthis.props.onChange(currentValueDateRange, false);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Allow users to hit enter to select the date range and trigger the search.\r\n\t *\r\n\t */\r\n\tprivate handleOnKeyDown = (e: React.KeyboardEvent) => {\r\n\t\tif (e.which === 13) {\r\n\t\t\te.preventDefault();\r\n\t\t\tthis.handleSearch();\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst availableDateRanges = Object.keys(MultipleDateRangePresets);\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t<Label for=\"date-select\" className=\"visually-hidden\">\r\n\t\t\t\t\tSelect date\r\n\t\t\t\t</Label>\r\n\t\t\t\t<Input\r\n\t\t\t\t\tid=\"date-select\"\r\n\t\t\t\t\tdata-testid=\"data-select-multiple\"\r\n\t\t\t\t\ttype=\"select\"\r\n\t\t\t\t\tautoFocus\r\n\t\t\t\t\tvalue={this.state.currentValue}\r\n\t\t\t\t\tonKeyDown={this.handleOnKeyDown}\r\n\t\t\t\t\tonChange={this.handleOnChange}\r\n\t\t\t\t\tclassName=\"\"\r\n\t\t\t\t\tautoComplete=\"off\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<option value=\"\" />\r\n\t\t\t\t\t{availableDateRanges.map((preset, index) => {\r\n\t\t\t\t\t\tconst presetValue = MultipleDateRangePresets[preset]();\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<option key={index} value={preset}>\r\n\t\t\t\t\t\t\t\t{presetValue.displayName || presetValue.preset}\r\n\t\t\t\t\t\t\t</option>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t\t<option value=\"custom\">Custom Date Range...</option>\r\n\t\t\t\t</Input>\r\n\t\t\t\t{this.state.currentValue === 'custom' ? (\r\n\t\t\t\t\t<DateRangePicker\r\n\t\t\t\t\t\tshowDefaultInputIcon\r\n\t\t\t\t\t\tshowClearDates\r\n\t\t\t\t\t\tsmall\r\n\t\t\t\t\t\tstartDateId={'fromDate'}\r\n\t\t\t\t\t\tstartDate={this.state.customFromValue}\r\n\t\t\t\t\t\tendDateId={'toDate'}\r\n\t\t\t\t\t\tendDate={this.state.customToValue}\r\n\t\t\t\t\t\tfocusedInput={this.state.focusedInput}\r\n\t\t\t\t\t\tisOutsideRange={() => false}\r\n\t\t\t\t\t\tminimumNights={0}\r\n\t\t\t\t\t\tdisplayFormat={() => 'M/D/YYYY'}\r\n\t\t\t\t\t\tonDatesChange={({\r\n\t\t\t\t\t\t\tstartDate,\r\n\t\t\t\t\t\t\tendDate,\r\n\t\t\t\t\t\t}: {\r\n\t\t\t\t\t\t\tstartDate: moment.Moment;\r\n\t\t\t\t\t\t\tendDate: moment.Moment;\r\n\t\t\t\t\t\t}) => {\r\n\t\t\t\t\t\t\tthis.setState({\r\n\t\t\t\t\t\t\t\tcustomFromValue: startDate ? localMoment(startDate).startOf('day') : null,\r\n\t\t\t\t\t\t\t\tcustomToValue: endDate ? localMoment(endDate).endOf('day') : null,\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t\tonFocusChange={(focusedInput) => {\r\n\t\t\t\t\t\t\tthis.setState({ focusedInput });\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t/>\r\n\t\t\t\t) : null}\r\n\r\n\t\t\t\t<div className=\"filters-popover__actions\">\r\n\t\t\t\t\t<FiltersListAddButton onClick={this.handleSearch} />\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t{this.state.displayValidationError ? (\r\n\t\t\t\t\t<FilterEditRequiredValidation messageOverride=\"Field is required\" />\r\n\t\t\t\t) : null}\r\n\t\t\t\t<p />\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default SingleDateRangePresetFilterEdit;\r\n","import * as React from 'react';\r\nimport { Filter, SelectedFilter, FilterOptions } from '..';\r\nimport {\r\n\tSingleTextFilterProvider,\r\n\tSingleIntegerFilterProvider,\r\n\tSingleDecimalFilterProvider,\r\n\tSingleBooleanFilterProvider,\r\n\tSingleDropdownFilterProvider,\r\n} from './SingleValue';\r\nimport { MultipleValueFilterProvider, MultipleDropdownFilterProvider } from './MultipleValue';\r\nimport { RangedIntegerFilterProvider, RangedDecimalFilterProvider } from './RangedValue';\r\nimport { SingleAutoSuggestValueFilterProvider, MultipleAutoSuggestValueFilterProvider } from './AutoSuggestValue';\r\nimport { EntityDefinition } from 'types';\r\nimport { SavedFilter } from 'components/shared/list/saved-filters/SavedFilterPicker';\r\nimport { MultipleDateRangePresetProvider } from './MultipleRangePresetValue';\r\nimport { SingleDateFilterProvider } from './SingleDateValue';\r\nimport { SingleDateRangePresetFilterProvider } from './SingleDateRangePresetValue';\r\nimport { FilterType } from './Types';\r\n\r\n/**\r\n * Required generic contract for filter edit components.\r\n *\r\n * @export\r\n * @interface FilterEditProps\r\n * @template T\r\n */\r\nexport interface FilterEditProps<T> {\r\n\t/**\r\n\t * Returns the definition of the filter, which includes the type, whether it's nullable, the name, etc.\r\n\t *\r\n\t * @type {Filter}\r\n\t * @memberof FilterEditProps\r\n\t */\r\n\tfilter: Filter;\r\n\r\n\t/**\r\n\t * Returns the value for whatever type is needed. We attempt to strongly type everything as much as possible, but\r\n\t * there are some limitations. The types should be available when working on edit components and providers which\r\n\t * are the most important parts.\r\n\t *\r\n\t * @type {T}\r\n\t * @memberof FilterEditProps\r\n\t */\r\n\tvalue: T;\r\n\r\n\t/**\r\n\t * Callback function to lift state from filter edit components up to Filters\r\n\t *\r\n\t * @memberof FilterEditProps\r\n\t */\r\n\tonChange: (value: any, stopEditing: boolean) => void;\r\n}\r\n\r\n/**\r\n * Required, generic contract used by all filter providers\r\n *\r\n * @export\r\n * @interface FilterProviderBase\r\n * @template T\r\n */\r\nexport interface FilterProviderBase<T = any> {\r\n\t/**\r\n\t * Returns the component used by your filter type. This is one of the places where TS falls short, and we just return\r\n\t * any to make our lives easier. This is problematic because the return type can vary wildly, from stateless functional\r\n\t * components, to components with state, to generic components potentially, etc.\r\n\t *\r\n\t * @returns {*}\r\n\t * @memberof FilterProviderBase\r\n\t */\r\n\tgetComponent(): React.ComponentType;\r\n\r\n\t/**\r\n\t * Based on the filter that is selected, this will return a set of additional props to be passed down to the actual\r\n\t * component used for filtering. This is primarily used for dropdown values but it could be used for other things.\r\n\t *\r\n\t * @param {Filter} filter\r\n\t * @returns {{}}\r\n\t * @memberof FilterProviderBase\r\n\t */\r\n\tgetComponentProps(filter: Filter): any;\r\n\r\n\t/**\r\n\t * Takes the value entered by the user in the filter edit component and converts it into something readable. This is\r\n\t * primarily displayed in the list of selected filters after some are added. Note that this can\r\n\t * return JSX if necessary, but plain strings will be valid too.\r\n\t *\r\n\t * @param {T} value\r\n\t * @returns {React.ReactNode}\r\n\t * @memberof FilterProviderBase\r\n\t */\r\n\tgetFriendlyValueForDisplay(value: T, filterOptions?: FilterOptions): React.ReactNode;\r\n\r\n\t/**\r\n\t * Takes the value component of the query string and must return a strongly typed version of the value.\r\n\t * For example, for a simple text filter, where the query is Code=SomeCode, `query` here would contain `'SomeCode'`\r\n\t *\r\n\t * @param {string} query\r\n\t * @param {Filter} filter\r\n\t * @returns {(T | null)}\r\n\t * @memberof FilterProviderBase\r\n\t */\r\n\tgetValueFromQueryString(query: string, filter: Filter): T | null;\r\n\r\n\t/**\r\n\t * Takes the strongly typed value selected by the user, and converts it into a QueryString value component.\r\n\t * For example, if you have a text box with text `'SomeCode'`, it would just return `'SomeCode'`. The QueryString itself\r\n\t * is built later on in the process, and will automatically add the code for you, so you just need to return the value\r\n\t * component of the QueryString parameter.\r\n\t *\r\n\t * @param {T} value\r\n\t * @param filter\r\n\t * @param forClient\r\n\t * @returns {string}\r\n\t * @memberof FilterProviderBase\r\n\t */\r\n\tgetQueryStringFromValue(value: T, filter: Filter, target: QueryStringTarget): string;\r\n\r\n\t/**\r\n\t * Determines whether or not a value for a particular provider is empty or not. While strings are easy to check, there\r\n\t * are other types, such as string[], object[], date ranges, and such, which may pose more of an issue. This is required\r\n\t * in combination with the nullable flag, to prevent invalid searches.\r\n\t *\r\n\t * @param {T} value\r\n\t * @returns {boolean}\r\n\t * @memberof FilterProviderBase\r\n\t */\r\n\tisEmptyValue(value: T): boolean;\r\n}\r\n\r\n/*\r\n\tHard-coded list of available filter types. If you want to add custom ones, \r\n\tyou must do that here. The simplest example is `SingleTextFilterProvider` - it is recommended to go through\r\n\tthat one and fully understand it before creating a custom one.\r\n*/\r\nconst types: { [type: string]: FilterProviderBase } = {};\r\ntypes[FilterType.SingleText] = new SingleTextFilterProvider();\r\ntypes[FilterType.MultipleText] = new MultipleValueFilterProvider();\r\n\r\ntypes[FilterType.SingleInteger] = new SingleIntegerFilterProvider();\r\ntypes[FilterType.SingleDecimal] = new SingleDecimalFilterProvider();\r\ntypes[FilterType.SingleBoolean] = new SingleBooleanFilterProvider();\r\n\r\ntypes[FilterType.RangedInteger] = new RangedIntegerFilterProvider();\r\ntypes[FilterType.RangedDecimal] = new RangedDecimalFilterProvider();\r\n\r\ntypes[FilterType.SingleAutoSuggest] = new SingleAutoSuggestValueFilterProvider();\r\ntypes[FilterType.MultipleAutoSuggest] = new MultipleAutoSuggestValueFilterProvider();\r\n\r\ntypes[FilterType.MultipleDropdown] = new MultipleDropdownFilterProvider();\r\ntypes[FilterType.SingleDropdown] = new SingleDropdownFilterProvider();\r\ntypes[FilterType.MultipleDateRangePreset] = new MultipleDateRangePresetProvider();\r\ntypes[FilterType.SingleDateRangePreset] = new SingleDateRangePresetFilterProvider();\r\ntypes[FilterType.SingleDate] = new SingleDateFilterProvider();\r\n\r\nexport const isGenericEmptyValue = (value: any) => typeof value === 'undefined' || value === null || value === '';\r\n\r\n/**\r\n * Helper function that will return a valid filter edit component even if none is defined, just for added robustness.\r\n * @param type\r\n */\r\nexport const getFilterType = (type: FilterType): FilterProviderBase => {\r\n\tconst requestedType = types[type];\r\n\tif (typeof requestedType === 'undefined') {\r\n\t\treturn types[FilterType.SingleText];\r\n\t}\r\n\r\n\treturn requestedType;\r\n};\r\n\r\n/**\r\n * Defines the target for QueryString generation. Client QueryString's are used to populate on the browser history.\r\n * Server QueryString's are sent to the server for query against data.\r\n *\r\n * @export\r\n * @enum {number}\r\n */\r\nexport enum QueryStringTarget {\r\n\tClient = 1,\r\n\tServer = 2,\r\n}\r\n\r\n/**\r\n * Generates the QueryString for all selected filters\r\n * @param selectedFilters\r\n * @param forClient Determines whether the query string being generated is going to be used by the client (for the URL)\r\n * or if it's going to be generated to be sent to the server. This allows us to hide certain values from the browser\r\n * while still making requests to the server with more details. Primarily used to hide date ranges into presets\r\n * such as \"Today\" or \"MTD\"\r\n */\r\nexport const getQueryStringForFilters = (\r\n\tselectedFilters: SelectedFilter[],\r\n\ttarget: QueryStringTarget = QueryStringTarget.Server,\r\n): string => {\r\n\tif (!selectedFilters) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn selectedFilters.map((selectedFilter) => getQueryStringComponentForFilter(selectedFilter, target)).join('&');\r\n};\r\n\r\n/**\r\n * Generates the QueryString key/value string for a single selected filter\r\n * @param selectedFilter\r\n * @param forCLient Determines whether the query string is being generated for the client, or server.\r\n */\r\nexport const getQueryStringComponentForFilter = (\r\n\tselectedFilter: SelectedFilter,\r\n\ttarget: QueryStringTarget = QueryStringTarget.Server,\r\n): string => {\r\n\tconst name = encodeURIComponent(selectedFilter.name);\r\n\tconst value = encodeURIComponent(getQueryStringValueForFilter(selectedFilter, target));\r\n\r\n\tif (!value) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn `${name}=${value}`;\r\n};\r\n\r\n/**\r\n * Generates the QueryString value string for a single selected filter\r\n */\r\nexport const getQueryStringValueForFilter = (\r\n\tselectedFilter: SelectedFilter,\r\n\ttarget: QueryStringTarget = QueryStringTarget.Server,\r\n): string => getFilterType(selectedFilter.type).getQueryStringFromValue(selectedFilter.value, selectedFilter, target);\r\n\r\n/**\r\n * Parses a Query String into an object, with some default values in case these are not provided in the QueryString.\r\n * @param queryString\r\n */\r\nexport const getParsedQueryString = (queryString: string) => {\r\n\tconst params = new URLSearchParams(queryString);\r\n\tconst result = {};\r\n\tparams.forEach((value, key) => {\r\n\t\tresult[key] = value;\r\n\t});\r\n\r\n\treturn {\r\n\t\tpage: 1,\r\n\t\tpageSize: 25,\r\n\t\tq: '',\r\n\t\tsortBy: '',\r\n\t\tsortDirection: '',\r\n\t\tsavedFilterId: '',\r\n\t\tcustomSortingEnabled: result['customSortingEnabled'],\r\n\t\t...result,\r\n\t};\r\n};\r\n\r\n/**\r\n * Type definition for all search queries.\r\n */\r\nexport interface SearchQuery extends SearchQueryBase {\r\n\tfilters: SelectedFilter[];\r\n}\r\n\r\nexport interface SearchQueryBase {\r\n\tpage: number;\r\n\tpageSize: number;\r\n\tsortBy: string | undefined;\r\n\tsortDirection: string | undefined;\r\n\tq: string;\r\n\tsavedFilterId: string;\r\n\tcustomSortingEnabled?: boolean;\r\n}\r\n\r\nexport interface SearchQueryNoFilters extends Partial<SearchQueryBase> {}\r\n\r\nexport interface SearchQueryFromSavedFilter {\r\n\tfilters: SelectedFilter[];\r\n}\r\n\r\nconst getValidatedFilters = (\r\n\tfilterParams: Record<string, any>,\r\n\tentityDefinition: EntityDefinition,\r\n): SelectedFilter[] => {\r\n\t// create a dictionary for type lookups.\r\n\tconst definedFilters = entityDefinition.filters.reduce((acc, value) => {\r\n\t\tacc[value.name.toLowerCase()] = value;\r\n\t\treturn acc;\r\n\t}, {});\r\n\r\n\tconst initialFilters: SelectedFilter[] = [];\r\n\tconst params = Object.keys(filterParams);\r\n\r\n\tfor (const param of params) {\r\n\t\tconst value = filterParams[param];\r\n\t\tconst filter: Filter = definedFilters[param.toLowerCase()];\r\n\r\n\t\tif (!filter) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// use provider model to parse different filter types\r\n\t\tconst type = getFilterType(filter.type);\r\n\r\n\t\ttry {\r\n\t\t\tconst parsedValue = type.getValueFromQueryString(value, filter);\r\n\r\n\t\t\tif (filter.nullable || !type.isEmptyValue(parsedValue)) {\r\n\t\t\t\tinitialFilters.push({ ...filter, value: parsedValue });\r\n\t\t\t} else {\r\n\t\t\t\tconsole.warn(\r\n\t\t\t\t\t'Empty value found for non-nullable filter:',\r\n\t\t\t\t\tparam,\r\n\t\t\t\t\t'using type provider:',\r\n\t\t\t\t\ttype,\r\n\t\t\t\t\t'. Ignoring.',\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t} catch (error) {\r\n\t\t\tconsole.warn('Unable to parse param:', param, 'with value:', value, 'using type provider:', type);\r\n\t\t\tconsole.error(error);\r\n\t\t}\r\n\t}\r\n\r\n\tconst implicitFilters = entityDefinition.filters.filter((f) => f.implicit) as SelectedFilter[];\r\n\tconst implicitFilterNames = implicitFilters.map((implicitFilter) => implicitFilter.name);\r\n\r\n\t// remove any filters from the saved filter that are being used by the implicit filter.\r\n\treturn initialFilters.filter((f) => !implicitFilterNames.includes(f.name)).concat(implicitFilters);\r\n};\r\n\r\n/**\r\n * Parses the query string and using the filter provider model returns the basic search query along with other filters\r\n * required to prepopulate state, including filters\r\n * @param queryString\r\n * @param entityDefinition\r\n */\r\nexport const getSearchQueryFromQueryString = (queryString: string, entityDefinition: EntityDefinition): SearchQuery => {\r\n\t// parse the query string into a more usable object\r\n\tconst parsedQueryString = getParsedQueryString(queryString);\r\n\r\n\t// extract expected properties and consider the remaining properties as filter query params\r\n\tconst {\r\n\t\tpage,\r\n\t\tpageSize,\r\n\t\tsortBy,\r\n\t\tsortDirection,\r\n\t\tq,\r\n\t\tsavedFilterId,\r\n\t\tcustomSortingEnabled,\r\n\t\t...filterParams\r\n\t} = parsedQueryString;\r\n\r\n\tconst initialFilters = getValidatedFilters(filterParams, entityDefinition);\r\n\r\n\treturn {\r\n\t\tpage,\r\n\t\tpageSize,\r\n\t\tsortBy,\r\n\t\tsortDirection,\r\n\t\tq,\r\n\t\tsavedFilterId,\r\n\t\tcustomSortingEnabled,\r\n\t\tfilters: initialFilters,\r\n\t};\r\n};\r\n\r\n/**\r\n * Parses the query string and using the filter provider model returns the basic search query along with other filters\r\n * required to prepopulate state, including filters, but flattened so they can be passed in the body of a POST rather than\r\n * in the QueryString of a GET request.\r\n * @param queryString\r\n * @param entityDefinition\r\n */\r\nexport const getSearchQueryFromQueryStringWithFlatFilters = (\r\n\tqueryString: string,\r\n\tentityDefinition: EntityDefinition,\r\n\ttarget: QueryStringTarget = QueryStringTarget.Server,\r\n\tignoreKeys = ['page', 'pageSize'],\r\n): SearchQueryNoFilters => {\r\n\t// parse the query string into a more usable object\r\n\tconst parsedQueryString = getParsedQueryString(queryString);\r\n\r\n\t// extract expected properties and consider the remaining properties as filter query params\r\n\tconst {\r\n\t\tpage,\r\n\t\tpageSize,\r\n\t\tsortBy,\r\n\t\tsortDirection,\r\n\t\tq,\r\n\t\tsavedFilterId,\r\n\t\tcustomSortingEnabled,\r\n\t\t...filterParams\r\n\t} = parsedQueryString;\r\n\r\n\tconst initialFilters = getValidatedFilters(filterParams, entityDefinition);\r\n\r\n\tconst result = {\r\n\t\tpage,\r\n\t\tpageSize,\r\n\t\tsortBy,\r\n\t\tsortDirection,\r\n\t\tq,\r\n\t\tsavedFilterId,\r\n\t\tcustomSortingEnabled,\r\n\t};\r\n\r\n\tconst filtersObject = initialFilters.reduce((acc, value) => {\r\n\t\tacc[value.name] = getQueryStringValueForFilter(value, target);\r\n\t\treturn acc;\r\n\t}, {});\r\n\r\n\tconst resultsQuery = {\r\n\t\t...result,\r\n\t\t...filtersObject,\r\n\t};\r\n\r\n\tconst filteredResultsQuery = Object.keys(resultsQuery)\r\n\t\t.filter((key) => {\r\n\t\t\tconst value = resultsQuery[key];\r\n\r\n\t\t\tif (Array.isArray(value) && value.length > 0) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tif (!Array.isArray(value) && value) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t})\r\n\t\t.reduce((acc, value) => {\r\n\t\t\tif (!ignoreKeys.includes(value)) {\r\n\t\t\t\tacc[value] = resultsQuery[value];\r\n\t\t\t}\r\n\r\n\t\t\treturn acc;\r\n\t\t}, {});\r\n\r\n\treturn filteredResultsQuery;\r\n};\r\n\r\n/**\r\n * Generates a search query based on a saved filter definition\r\n * @param savedFilter\r\n * @param entityDefinition\r\n */\r\nexport const getSearchQueryFromSavedFilter = (\r\n\tsavedFilter: SavedFilter,\r\n\tentityDefinition: EntityDefinition,\r\n): SearchQueryFromSavedFilter => {\r\n\tconst filterParams = savedFilter.query;\r\n\tconst initialFilters = getValidatedFilters(filterParams, entityDefinition);\r\n\r\n\treturn {\r\n\t\tfilters: initialFilters,\r\n\t};\r\n};\r\n\r\n/**\r\n * Converts a `SearchQuery` instance into a query string, which will be used to execute searches on\r\n * the server, as well as keep browser history for different actions on the listing page.\r\n * @param searchQuery\r\n * @param forClient\r\n */\r\nexport const getQueryStringFromSearchQuery = (\r\n\tsearchQuery: Partial<SearchQuery>,\r\n\ttarget: QueryStringTarget = QueryStringTarget.Server,\r\n): string => {\r\n\tconst values: string[] = [];\r\n\r\n\tif (!isGenericEmptyValue(searchQuery.page) && searchQuery.page !== 1) {\r\n\t\tvalues.push('page=' + searchQuery.page);\r\n\t}\r\n\r\n\tif (searchQuery.q) {\r\n\t\tvalues.push('q=' + encodeURIComponent(searchQuery.q));\r\n\t}\r\n\r\n\t// prioritize a saved filter\r\n\tif (searchQuery.savedFilterId && target === QueryStringTarget.Client) {\r\n\t\tvalues.push('savedFilterId=' + encodeURIComponent(searchQuery.savedFilterId));\r\n\t} else if (searchQuery.filters && searchQuery.filters.length > 0) {\r\n\t\tconst filters =\r\n\t\t\ttarget === QueryStringTarget.Client ? searchQuery.filters.filter((f) => !f.implicit) : searchQuery.filters;\r\n\r\n\t\tvalues.push(getQueryStringForFilters(filters, target));\r\n\t}\r\n\r\n\tif (searchQuery.sortBy) {\r\n\t\tvalues.push('sortBy=' + encodeURIComponent(searchQuery.sortBy));\r\n\t}\r\n\r\n\tif (searchQuery.sortDirection) {\r\n\t\tvalues.push('sortDirection=' + encodeURIComponent(searchQuery.sortDirection));\r\n\t}\r\n\r\n\tif (searchQuery.customSortingEnabled) {\r\n\t\tvalues.push('customSortingEnabled=' + encodeURIComponent(searchQuery.customSortingEnabled));\r\n\t}\r\n\r\n\tif (values.length === 0) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn '?' + values.join('&');\r\n};\r\n","import {\r\n\tgetFriendlyDateRangePresetValueForDisplay,\r\n\tMultipleDateRangePresets,\r\n\tRangedValueDelimiter,\r\n\tRangePresetValuePresets,\r\n} from './Constants';\r\nimport { RangedPresetValue } from './Types';\r\nimport moment from 'moment';\r\nimport { FilterProviderBase, isGenericEmptyValue, QueryStringTarget } from '.';\r\nimport React from 'react';\r\nimport { Filter, FilterNotSet } from '..';\r\nimport SingleDateRangePresetFilterEdit from '../editors/SingleDateRangePresetFilterEdit';\r\n\r\n/**\r\n * Abstract class used to define filter type providers that support single value as well as single range.\r\n * Inherit this class in order to implement your own. This adds a `getPresets` abstract method\r\n * that needs to be implemented, returning a dictionary with all the presets that we want to work with.\r\n * It also adds a `isValidRangePresetValue` method in order to help validate the values parsed from the\r\n * query string, to ensure they're valid.\r\n *\r\n * @export\r\n * @abstract\r\n * @class SingleRangePresetProvider\r\n * @implements {FilterProviderBase<RangedPresetValue>}\r\n */\r\nexport abstract class SingleRangePresetProvider implements FilterProviderBase<RangedPresetValue> {\r\n\tpublic getPresets = (): RangePresetValuePresets => ({});\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic isValidRangePresetValue = (value: RangedPresetValue): boolean => true;\r\n\tpublic getComponent = (): React.ComponentType => () => <>Component not set.</>;\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tpublic getComponentProps = (filter: Filter) => ({});\r\n\tpublic getFriendlyValueForDisplay = (value: any): React.ReactNode => {\r\n\t\tif (!value) {\r\n\t\t\treturn <FilterNotSet />;\r\n\t\t}\r\n\r\n\t\treturn getFriendlyDateRangePresetValueForDisplay(value);\r\n\t};\r\n\r\n\tpublic getValueFromQueryString = (query: string): RangedPresetValue | null => {\r\n\t\tif (!query || !query.trim()) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tlet rangedPresetValue: RangedPresetValue | null = null;\r\n\t\tconst presets = this.getPresets() || {};\r\n\r\n\t\tconst rangeOrPreset = query.split(RangedValueDelimiter);\r\n\r\n\t\tif (rangeOrPreset.length === 2) {\r\n\t\t\tconst parsedValue: RangedPresetValue = {\r\n\t\t\t\tfromValue: rangeOrPreset[0],\r\n\t\t\t\ttoValue: rangeOrPreset[1],\r\n\t\t\t};\r\n\r\n\t\t\tif (!this.isValidRangePresetValue(parsedValue)) {\r\n\t\t\t\tthrow new Error('Invalid date range preset values found.');\r\n\t\t\t}\r\n\r\n\t\t\trangedPresetValue = parsedValue;\r\n\t\t} else {\r\n\t\t\tconst preset = presets[query];\r\n\r\n\t\t\tif (typeof preset === 'function') {\r\n\t\t\t\tconst presetResult: RangedPresetValue = preset();\r\n\t\t\t\trangedPresetValue = presetResult;\r\n\t\t\t} else {\r\n\t\t\t\tconst parsedValue: RangedPresetValue = {\r\n\t\t\t\t\tfromValue: rangeOrPreset[0],\r\n\t\t\t\t\ttoValue: null,\r\n\t\t\t\t};\r\n\r\n\t\t\t\tif (!this.isValidRangePresetValue(parsedValue)) {\r\n\t\t\t\t\tthrow new Error('Invalid date range preset values found.');\r\n\t\t\t\t}\r\n\t\t\t\trangedPresetValue = parsedValue;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn rangedPresetValue;\r\n\t};\r\n\r\n\tpublic getQueryStringFromValue = (value: RangedPresetValue, filter: Filter, target: QueryStringTarget): string => {\r\n\t\tif (!value) {\r\n\t\t\treturn '';\r\n\t\t}\r\n\r\n\t\tconst presets = this.getPresets();\r\n\r\n\t\tlet fromValue = '';\r\n\t\tlet toValue = '';\r\n\r\n\t\tif (value.preset) {\r\n\t\t\t// if the query string is used by the client, let's display the preset only\r\n\t\t\t// to be more user friendly.\r\n\t\t\tif (target === QueryStringTarget.Client) {\r\n\t\t\t\treturn value.preset;\r\n\t\t\t} else {\r\n\t\t\t\t// if this is going to the server, attempt to get the full value\r\n\t\t\t\tconst presetFn = presets[value.preset];\r\n\r\n\t\t\t\tif (presetFn) {\r\n\t\t\t\t\tconst preset = presetFn(filter?.options?.ignoreTimezone);\r\n\t\t\t\t\tfromValue = !isGenericEmptyValue(preset.fromValue) ? preset.fromValue : '';\r\n\t\t\t\t\ttoValue = !isGenericEmptyValue(preset.toValue) ? preset.toValue : '';\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconsole.warn('Invalid preset provided:', value.preset);\r\n\t\t\t\t\treturn '';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfromValue = !isGenericEmptyValue(value.fromValue) ? value.fromValue : '';\r\n\t\t\ttoValue = !isGenericEmptyValue(value.toValue) ? value.toValue : '';\r\n\t\t}\r\n\r\n\t\treturn `${fromValue}${RangedValueDelimiter}${toValue}`;\r\n\t};\r\n\r\n\tpublic isEmptyValue = (value: RangedPresetValue): boolean => {\r\n\t\tif (isGenericEmptyValue(value)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t};\r\n}\r\n\r\n/**\r\n * Implementation of the single date range preset provider\r\n */\r\nexport class SingleDateRangePresetFilterProvider extends SingleRangePresetProvider {\r\n\tpublic getPresets = () => MultipleDateRangePresets;\r\n\tpublic isValidRangePresetValue = (value: RangedPresetValue) => {\r\n\t\tconst fromValue = value.fromValue ? moment(value.fromValue) : null;\r\n\t\tconst toValue = value.toValue ? moment(value.toValue) : null;\r\n\r\n\t\tconst fromValueValid = fromValue === null || fromValue.isValid();\r\n\t\tconst toValueValid = toValue === null || toValue.isValid();\r\n\r\n\t\tif (!fromValueValid || !toValueValid) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t};\r\n\tpublic getComponent = () => SingleDateRangePresetFilterEdit;\r\n}\r\n","import SingleDateFilterEdit from '../editors/SingleDateFilterEdit';\r\nimport { SingleDateRangePresets } from './Constants';\r\nimport { RangedPresetValue } from './Types';\r\nimport { MultipleRangePresetProvider } from './MultipleRangePresetValue';\r\nimport moment from 'moment';\r\n\r\n/**\r\n * Implementation of the a single date preset provider specific to dates\r\n */\r\nexport class SingleDateFilterProvider extends MultipleRangePresetProvider {\r\n\tpublic getPresets = () => SingleDateRangePresets;\r\n\tpublic isValidRangePresetValue = (value: RangedPresetValue) => {\r\n\t\tconst fromValue = value.fromValue ? moment(value.fromValue) : null;\r\n\t\tconst toValue = value.toValue ? moment(value.toValue) : null;\r\n\r\n\t\tconst fromValueValid = fromValue === null || fromValue.isValid();\r\n\t\tconst toValueValid = toValue === null || toValue.isValid();\r\n\r\n\t\tif (!fromValueValid || !toValueValid) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t};\r\n\tpublic getComponent = () => SingleDateFilterEdit;\r\n}\r\n","import * as React from 'react';\r\nimport ErrorAlert from '../ErrorAlert';\r\n\r\nexport enum AlertType {\r\n\t'Delete',\r\n\t'Edit',\r\n}\r\n\r\ninterface ValidationErrorAlertProps {\r\n\tsubmitError: string | string[] | null;\r\n\talertType: AlertType;\r\n\tcustomMessage?: string | null;\r\n}\r\n\r\nfunction ValidationErrorAlert({ submitError, customMessage, alertType }: ValidationErrorAlertProps) {\r\n\tif (!submitError) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst message = customMessage ?? GetMessageByType(alertType);\r\n\r\n\treturn (\r\n\t\t<ErrorAlert\r\n\t\t\tmessage={message}\r\n\t\t\terror={null} // Validation errors do not need the full error object\r\n\t\t>\r\n\t\t\t{Array.isArray(submitError) && submitError.length > 0 ? (\r\n\t\t\t\t<ul className=\"validation-error-list\">\r\n\t\t\t\t\t{submitError.map((e, index) => (\r\n\t\t\t\t\t\t<li key={index}>{e}</li>\r\n\t\t\t\t\t))}\r\n\t\t\t\t</ul>\r\n\t\t\t) : typeof submitError === 'string' ? (\r\n\t\t\t\t<ul className=\"validation-error-list\">\r\n\t\t\t\t\t<li>{submitError}</li>\r\n\t\t\t\t</ul>\r\n\t\t\t) : null}\r\n\t\t</ErrorAlert>\r\n\t);\r\n}\r\n\r\nfunction GetMessageByType(alertType: AlertType): string {\r\n\tlet message = '';\r\n\r\n\tif (alertType == AlertType.Edit) {\r\n\t\tmessage = 'Please check the values you entered below and try again.';\r\n\t} else if (alertType == AlertType.Delete) {\r\n\t\tmessage = 'Error while deleting a record.';\r\n\t}\r\n\r\n\treturn message;\r\n}\r\n\r\nexport default ValidationErrorAlert;\r\n","import * as React from 'react';\r\nimport XSVG from '../svg/XSVG';\r\n\r\n/**\r\n * Component for closing a toast.\r\n *\r\n * @class ToastClose\r\n * @extends {React.Component}\r\n */\r\nclass ToastClose extends React.Component {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"toast-close\">\r\n\t\t\t\t<button className=\"toast-close__btn\">\r\n\t\t\t\t\t<span className=\"visually-hidden\">Close toast</span>\r\n\t\t\t\t\t<span className=\"toast-close__x\">\r\n\t\t\t\t\t\t<XSVG class=\"toast-close__x-icon\" />\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</button>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default ToastClose;\r\n","import * as React from 'react';\r\nimport { toast, CommonOptions } from 'react-toastify';\r\nimport { ToastOptions } from 'react-toastify';\r\nimport ToastClose from './ToastClose';\r\nimport ExclamationCircleSVG from '../svg/ExclamationCircleSVG';\r\nimport CheckSVG from '../svg/CheckSVG';\r\nimport ExclamationCircleSVGAlternative from '../svg/ExclamationCircleSVGAlternative';\r\nimport ExclamationTriangleSVGAlternative from '../svg/ExclamationTriangleSVGAlternative';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\n\r\n/**\r\n * Options object for calling toast on the site.\r\n */\r\ninterface CustomToastOptions extends WithTestIdOptional {\r\n\tcontent?: MessageContent;\r\n\tcustomContent?: JSX.Element; // Custom content in the form of JSX elements\r\n\ttoastifyOptions?: ToastOptions; // Original toastify options\r\n}\r\n\r\n/**\r\n * Options for content. Includes a generic title, flexible icon, and generic message.\r\n */\r\ninterface MessageContent {\r\n\ttitle?: string;\r\n\ticon?: any;\r\n\tmessage?: string;\r\n}\r\n\r\n/**\r\n * Default toastify options we're setting for convenience\r\n */\r\nconst toastifyOptionDefaults: CommonOptions = {\r\n\thideProgressBar: false,\r\n\tposition: toast.POSITION.BOTTOM_RIGHT,\r\n\tcloseButton: <ToastClose />,\r\n};\r\n\r\n/**\r\n * Default toast wrapper\r\n *\r\n * @param {CustomToastOptions} options\r\n */\r\nexport const toastDefault = (options: CustomToastOptions) => {\r\n\ttoastBase(options);\r\n};\r\n\r\n/**\r\n * Success toast wrapper\r\n *\r\n * @param {CustomToastOptions} options\r\n */\r\nexport const toastSuccess = (options: CustomToastOptions) => {\r\n\ttoastBase({\r\n\t\tcontent: {\r\n\t\t\ticon: <CheckSVG class=\"Toastify__success-icon\" />,\r\n\t\t\t...options.content,\r\n\t\t},\r\n\t\ttoastifyOptions: {\r\n\t\t\ttype: 'success',\r\n\t\t\t...options.toastifyOptions,\r\n\t\t},\r\n\t\tcustomContent: options.customContent,\r\n\t\ttestId: options.testId,\r\n\t});\r\n};\r\n\r\n/**\r\n * Info toast wrapper\r\n *\r\n * @param {CustomToastOptions} options\r\n */\r\nexport const toastInfo = (options: CustomToastOptions) => {\r\n\ttoastBase({\r\n\t\tcontent: {\r\n\t\t\ticon: <ExclamationCircleSVGAlternative class=\"Toastify__info-icon\" />,\r\n\t\t\t...options.content,\r\n\t\t},\r\n\t\ttoastifyOptions: {\r\n\t\t\ttype: 'info',\r\n\t\t\t...options.toastifyOptions,\r\n\t\t},\r\n\t\tcustomContent: options.customContent,\r\n\t\ttestId: options.testId,\r\n\t});\r\n};\r\n\r\n/**\r\n * Warning toast wrapper\r\n *\r\n * @param {CustomToastOptions} options\r\n */\r\nexport const toastWarning = (options: CustomToastOptions) => {\r\n\ttoastBase({\r\n\t\tcontent: {\r\n\t\t\ticon: <ExclamationTriangleSVGAlternative class=\"Toastify__warning-icon\" />,\r\n\t\t\t...options.content,\r\n\t\t},\r\n\t\ttoastifyOptions: {\r\n\t\t\ttype: 'warning',\r\n\t\t\t...options.toastifyOptions,\r\n\t\t},\r\n\t\tcustomContent: options.customContent,\r\n\t\ttestId: options.testId,\r\n\t});\r\n};\r\n\r\n/**\r\n * Error toast wrapper\r\n *\r\n * @param {CustomToastOptions} options\r\n */\r\nexport const toastError = (options: CustomToastOptions) => {\r\n\ttoastBase({\r\n\t\tcontent: {\r\n\t\t\ticon: <ExclamationCircleSVG class=\"Toastify__danger-icon\" />,\r\n\t\t\t...options.content,\r\n\t\t},\r\n\t\ttoastifyOptions: {\r\n\t\t\ttype: 'error',\r\n\t\t\t...options.toastifyOptions,\r\n\t\t},\r\n\t\tcustomContent: options.customContent,\r\n\t\ttestId: options.testId,\r\n\t});\r\n};\r\n\r\n/**\r\n * Base Toast method. Uses toastify.\r\n *\r\n * @param {CustomToastOptions} options\r\n */\r\nconst toastBase = (options: CustomToastOptions) => {\r\n\ttoast(\r\n\t\t<>\r\n\t\t\t{options.content ? (\r\n\t\t\t\t<div\r\n\t\t\t\t\tclassName=\"Toastify__wrapper\"\r\n\t\t\t\t\tdata-testid={options.testId ? options.testId : 'toast-message-container'}\r\n\t\t\t\t>\r\n\t\t\t\t\t{options.content.icon ? <span className=\"Toastify__toast-icon\">{options.content.icon}</span> : null}\r\n\t\t\t\t\t<div className=\"Toastify__text\">\r\n\t\t\t\t\t\t{options.customContent ? (\r\n\t\t\t\t\t\t\toptions.customContent\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t{options.content.title ? (\r\n\t\t\t\t\t\t\t\t\t<p\r\n\t\t\t\t\t\t\t\t\t\tclassName={\r\n\t\t\t\t\t\t\t\t\t\t\toptions.content.message\r\n\t\t\t\t\t\t\t\t\t\t\t\t? 'Toastify__title Toastify__title--bold'\r\n\t\t\t\t\t\t\t\t\t\t\t\t: 'Toastify__title'\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t{options.content.title}\r\n\t\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t{options.content.message ? <p>{options.content.message}</p> : null}\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t) : null}\r\n\t\t</>,\r\n\t\t{\r\n\t\t\t...toastifyOptionDefaults,\r\n\t\t\t...options.toastifyOptions,\r\n\t\t},\r\n\t);\r\n};\r\n","import { useContext } from 'react';\r\nimport AppState from 'AppState';\r\nimport EditContext from '../components/shared/edit/EditContext';\r\nimport { AppSiteDto } from '../types';\r\nimport RecordScope from 'types/__models__/RecordScope';\r\nexport interface SiteHostWithIdDto {\r\n\thostId: string;\r\n\thostUrl: string;\r\n}\r\n\r\n/**\r\n * Gets the first available site host for an edit page component given the items scope, if any.\r\n * Otherwise, falls back to the default site/host.\r\n */\r\nexport const useScopedSiteHost = () => {\r\n\tconst { currentScope } = useContext(EditContext);\r\n\r\n\tif (currentScope) {\r\n\t\treturn GetSiteHost(currentScope.value);\r\n\t}\r\n\r\n\treturn GetDefaultSiteHost();\r\n};\r\n\r\n/**\r\n * Gets the first available site host for the given scopeId. Otherwise , falls back to the default site/host.\r\n * @param scopeId The scope of the item we're returning the host for, if any.\r\n */\r\nexport const GetSiteHost = (scopeId?: string) => {\r\n\tif (scopeId) {\r\n\t\tlet site = AppState.sites.find((s) => s.id === scopeId);\r\n\t\tconst siteCollection = AppState.siteCollections.find((c) => c.id === scopeId);\r\n\r\n\t\tif (siteCollection) {\r\n\t\t\tconst siteId = siteCollection.sites.length > 0 ? siteCollection.sites[0].siteId : undefined;\r\n\t\t\tif (siteId) {\r\n\t\t\t\tsite = AppState.sites.find((s) => s.id === siteId);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (site) {\r\n\t\t\treturn GetHostForSite(site);\r\n\t\t}\r\n\t}\r\n\r\n\treturn GetDefaultSiteHost();\r\n};\r\n\r\n/**\r\n * Returns the list of sites with host for the View Live components.\r\n */\r\nexport const GetSiteHosts = (scopeId?: string): ViewSiteHost[] => {\r\n\tif (scopeId) {\r\n\t\tconst site = AppState.sites.find((s) => s.id === scopeId);\r\n\t\tif (site) {\r\n\t\t\treturn [{ name: site.name, hosts: GetHostsForSite(site) }];\r\n\t\t}\r\n\r\n\t\tconst siteCollection = AppState.siteCollections.find((c) => c.id === scopeId);\r\n\t\tif (siteCollection) {\r\n\t\t\treturn siteCollection.sites\r\n\t\t\t\t.map((s) => {\r\n\t\t\t\t\tconst site = AppState.sites.find((site) => site.id === s.siteId);\r\n\t\t\t\t\tif (!site) {\r\n\t\t\t\t\t\treturn {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn { name: site.name, hosts: GetHostsForSite(site) };\r\n\t\t\t\t})\r\n\t\t\t\t.filter((s) => s.hosts);\r\n\t\t}\r\n\t}\r\n\r\n\treturn AppState.sites.map((s) => {\r\n\t\treturn { name: s.name, hosts: GetHostsForSite(s), id: s.id };\r\n\t});\r\n};\r\n\r\nexport interface ViewSiteHostWithId {\r\n\tname?: string;\r\n\thosts?: SiteHostWithIdDto[];\r\n\tid?: string;\r\n}\r\n\r\nexport const GetSiteHostsWithIds = (scopeId?: string): ViewSiteHostWithId[] => {\r\n\tif (scopeId) {\r\n\t\tconst site = AppState.sites.find((s) => s.id === scopeId);\r\n\t\tif (site) {\r\n\t\t\treturn [{ name: site.name, hosts: GetHostsForSiteWithIds(site) }];\r\n\t\t}\r\n\r\n\t\tconst siteCollection = AppState.siteCollections.find((c) => c.id === scopeId);\r\n\t\tif (siteCollection) {\r\n\t\t\treturn siteCollection.sites\r\n\t\t\t\t.map((s) => {\r\n\t\t\t\t\tconst site = AppState.sites.find((site) => site.id === s.siteId);\r\n\t\t\t\t\tif (!site) {\r\n\t\t\t\t\t\treturn {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn { name: site.name, hosts: GetHostsForSiteWithIds(site) };\r\n\t\t\t\t})\r\n\t\t\t\t.filter((s) => s.hosts);\r\n\t\t}\r\n\t}\r\n\r\n\treturn AppState.sites.map((s) => {\r\n\t\treturn { name: s.name, hosts: GetHostsForSiteWithIds(s), id: s.id };\r\n\t});\r\n};\r\n\r\n/**\r\n *\r\n *\r\n * @param {string} [scopeId]\r\n * @return {*}  {ViewSiteCulture[]}\r\n */\r\n\r\nexport const GetSiteHostCultures = (scopeId?: string): ViewSiteCulture[] => {\r\n\tif (scopeId) {\r\n\t\tconst site = AppState.sites.find((s) => s.id === scopeId);\r\n\t\tif (site) {\r\n\t\t\treturn [{ name: site.name, cultures: GetCulturesForSite(site) }];\r\n\t\t}\r\n\t\tconst siteCollection = AppState.siteCollections.find((c) => c.id === scopeId);\r\n\t\tif (siteCollection) {\r\n\t\t\treturn siteCollection.sites\r\n\t\t\t\t.map((s) => {\r\n\t\t\t\t\tconst site = AppState.sites.find((site) => site.id === s.siteId);\r\n\t\t\t\t\tif (!site) {\r\n\t\t\t\t\t\treturn {};\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn { name: site.name, cultures: GetCulturesForSite(site) };\r\n\t\t\t\t})\r\n\t\t\t\t.filter((s) => s.cultures);\r\n\t\t}\r\n\t}\r\n\r\n\treturn AppState.sites.map((s) => {\r\n\t\treturn { name: s.name, cultures: GetCulturesForSite(s), id: s.id };\r\n\t});\r\n};\r\n\r\n/**\r\n * Checks whether the a collection of sites has more than one host\r\n * @param sites The collection of sites to check\r\n */\r\nexport const HasSiteWithAmbiguousHost = (sites: ViewSiteHost[]): boolean => {\r\n\treturn sites.length > 1 || sites.some((s) => s.hosts && s.hosts.length > 1);\r\n};\r\n\r\n/**\r\n * Represents a site with host for the View Live components.\r\n */\r\nexport interface ViewSiteHost {\r\n\tid?: string;\r\n\thosts?: string[];\r\n\tname?: string;\r\n}\r\n\r\n/**\r\n * Represents a site with cultures for the View Live components.\r\n */\r\nexport interface ViewSiteCulture {\r\n\tid?: string;\r\n\tcultures?: string[];\r\n\tname?: string;\r\n}\r\n\r\n/**\r\n * Gets the default site's default host.\r\n */\r\nexport const GetDefaultSiteHost = () => {\r\n\tconst defaultSite = AppState.sites.find((site) => site.isDefault);\r\n\tif (defaultSite) {\r\n\t\treturn GetHostForSite(defaultSite);\r\n\t}\r\n\treturn '';\r\n};\r\n\r\n/**\r\n * Returns the first host for a site\r\n * @param site The site to fetch the host from\r\n */\r\nconst GetHostForSite = (site: AppSiteDto): string => {\r\n\tconst h = site.hosts[0];\r\n\treturn 'https://' + h.host + (h.port ? ':' + h.port : '') + (h.subdirectory ? '/' + h.subdirectory : '');\r\n};\r\n\r\n/**\r\n *\r\n *\r\n * @param {AppSiteDto} site\r\n * @return {*}  {string[]}\r\n */\r\nconst GetCulturesForSite = (site: AppSiteDto): string[] => {\r\n\tconst siteHosts = site.hosts;\r\n\tconst cultureIds = siteHosts.map((host) => host.cultureId || '');\r\n\tcultureIds.push(site.cultureId);\r\n\treturn cultureIds.filter((v, i, s) => v !== '' && s.indexOf(v) === i);\r\n};\r\n\r\n/**\r\n * Returns all the hosts for a site\r\n * @param site The site to fetch hosts from\r\n */\r\nconst GetHostsForSite = (site: AppSiteDto): string[] => {\r\n\tconst siteHosts = site.hosts;\r\n\treturn siteHosts.map(\r\n\t\t(host) =>\r\n\t\t\t'https://' +\r\n\t\t\thost.host +\r\n\t\t\t(host.port ? ':' + host.port : '') +\r\n\t\t\t(host.subdirectory ? '/' + host.subdirectory : ''),\r\n\t);\r\n};\r\n\r\nconst GetHostsForSiteWithIds = (site: AppSiteDto): SiteHostWithIdDto[] => {\r\n\tconst siteHosts = site.hosts;\r\n\treturn siteHosts.map((host) => {\r\n\t\treturn {\r\n\t\t\thostId: host.id,\r\n\t\t\thostUrl:\r\n\t\t\t\t'https://' +\r\n\t\t\t\thost.host +\r\n\t\t\t\t(host.port ? ':' + host.port : '') +\r\n\t\t\t\t(host.subdirectory ? '/' + host.subdirectory : ''),\r\n\t\t};\r\n\t});\r\n};\r\n\r\n/**\r\n * Returns sites limited to associated scope\r\n */\r\nexport const GetScopedSites = (scope: RecordScope | undefined): AppSiteDto[] => {\r\n\tif (scope?.type === 'Site') {\r\n\t\treturn AppState.sites.filter((s) => s.id === scope.value);\r\n\t} else if (scope?.type === 'Site Collection') {\r\n\t\treturn AppState.sites.filter((s) => s.siteCollections.some((sc) => sc.siteCollectionId === scope.value));\r\n\t} else {\r\n\t\treturn AppState.sites;\r\n\t}\r\n};\r\n","import React, { useContext, useState } from 'react';\r\nimport { Button } from 'reactstrap';\r\nimport ArrowLeaveSVG from '../svg/ArrowLeaveSVG';\r\nimport { GetSiteHosts, HasSiteWithAmbiguousHost } from 'util/AppStateUtils';\r\nimport { HasEditContext } from './withEditContext';\r\nimport ViewLiveModal from '../ViewLiveModal';\r\nimport EditContext from './EditContext';\r\nimport RocTitle from '../RocTitle';\r\n\r\nexport type EditViewLiveProps = HasEditContext;\r\n\r\n/**\r\n * Displays a button that opens a new window and redirects the user to the live record fro the current\r\n * item being edited. Only displays while editing, and will display the value that was loaded from the DB,\r\n * not the current value from the text box (which may differ and take you to a 404).\r\n */\r\nfunction EditViewLive() {\r\n\tconst [isOpen, setIsOpen] = useState(false);\r\n\tconst { values, entityDefinition } = useContext(EditContext);\r\n\tconst url = values && values.url;\r\n\r\n\t// it's possible that url could be optional in some cases, outside of ISeo\r\n\tif (!url || !url.trim()) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst sites = GetSiteHosts(values.scope ? values.scope.value : null);\r\n\r\n\tif (sites.length === 0) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tconst handleSingleOnClick = () => {\r\n\t\twindow.open(`${sites[0].hosts![0]}${url}`, '_blank');\r\n\t};\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<Button\r\n\t\t\t\toutline\r\n\t\t\t\tcolor=\"primary\"\r\n\t\t\t\tdisabled={entityDefinition.disableView(values)}\r\n\t\t\t\tclassName=\"btn btn-medium\"\r\n\t\t\t\tdata-testid=\"view-record-btn\"\r\n\t\t\t\tonClick={\r\n\t\t\t\t\t!HasSiteWithAmbiguousHost(sites)\r\n\t\t\t\t\t\t? handleSingleOnClick\r\n\t\t\t\t\t\t: () => {\r\n\t\t\t\t\t\t\t\tsetIsOpen(true);\r\n\t\t\t\t\t\t  }\r\n\t\t\t\t}\r\n\t\t\t\tsize=\"sm\"\r\n\t\t\t>\r\n\t\t\t\t<RocTitle label=\"View record\">\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<ArrowLeaveSVG class=\"btn-icon-text-container__large-icon\" />\r\n\r\n\t\t\t\t\t\t<span className=\"visually-hidden\">View Live - Opens in a new window</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</RocTitle>\r\n\t\t\t</Button>\r\n\t\t\t<ViewLiveModal\r\n\t\t\t\tentityDefinition={entityDefinition}\r\n\t\t\t\trecord={values}\r\n\t\t\t\tsites={sites}\r\n\t\t\t\tisOpen={isOpen}\r\n\t\t\t\tsetModal={setIsOpen}\r\n\t\t\t\ttestId={`edit-view-live`}\r\n\t\t\t/>\r\n\t\t</>\r\n\t);\r\n}\r\n\r\nexport default EditViewLive;\r\n","import AppState from 'AppState';\r\nimport EditViewLive from 'components/shared/edit/EditViewLive';\r\nimport LocalizeMode from 'components/shared/edit/LocalizeMode';\r\nimport {\r\n\tFilter,\r\n\tgetBaseModelSearchFilters,\r\n\tgetBasicModelSearchFilters,\r\n\tgetCodeSearchFilter,\r\n\tgetExternalIdSearchFilter,\r\n\tgetNameSearchFilter,\r\n\tgetNullableUserSearchFilter,\r\n\tgetPermanentSearchFilter,\r\n\tgetScopeSearchFilter,\r\n\tgetSeoSearchFilters,\r\n\tgetUserSearchFilter,\r\n\tgetUserTrackedSearchFilters,\r\n\tgetVersionableModelSearchFilters,\r\n\tSelectedFilter,\r\n} from 'components/shared/list/filters';\r\nimport { NoValueAutoSuggestValue } from 'components/shared/list/filters/editors';\r\nimport { FilterType } from 'components/shared/list/filters/providers/Types';\r\nimport { ExportAutoSuggestItem } from 'features/exports/types';\r\nimport Popper from 'popper.js';\r\nimport React from 'react';\r\nimport { registerEntityDefinition } from 'services/EntityDefinitionService';\r\nimport { ModelStatus } from 'shared-client/types/model-status';\r\nimport BaseDto from './__models__/BaseDto';\r\n\r\n/**\r\n * Defines an entity in the system that will be displayed with a standalone admin page\r\n */\r\nexport default class EntityDefinition {\r\n\t/**\r\n\t * Defines the plural name of the entity\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic pluralName: string;\r\n\r\n\t/**\r\n\t * Defines the singular name of the entity\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic singularName: string;\r\n\r\n\t/**\r\n\t * Defines the text for the link to the full report.\r\n\t * Defaults to \"View Full Report\"\r\n\t */\r\n\tpublic fullListingLinkName?: string;\r\n\r\n\t/**\r\n\t * Defines the base url for the ajax calls for this entity\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic baseAjaxUrl: string;\r\n\r\n\t/**\r\n\t * Defines the base url for the ajax calls for this entity without parameters\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic parentBaseAjaxUrl: string;\r\n\r\n\t/**\r\n\t * Defines the base route for this entity\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic baseRoute: string;\r\n\r\n\t/**\r\n\t * Determines whether the entity is hierarchical or not. This is used to drive children-related functionality\r\n\t * in listing pages\r\n\t */\r\n\tpublic isHierarchy: boolean = false;\r\n\r\n\t/**\r\n\t * Defines the filters for the listing page\r\n\t *\r\n\t * @type {Filter[]}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic filters: Filter[] = [];\r\n\r\n\t/**\r\n\t * Prevents the server entity metadata from determining the filters for your entity in case customizations are needed.\r\n\t */\r\n\tpublic automaticMetadataFiltersEnabled: boolean = true;\r\n\r\n\t/**\r\n\t * Configuration option for whether or not this entity is scoping-enabled (global, site collection, or site) and\r\n\t * displays a scope dropdown above the edit form.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic scoped: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option for whether or not this entity is translatable into the various cultures, and which view\r\n\t * is rendered for the translations.\r\n\t *\r\n\t * @type {LocalizeMode}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic localizeMode?: LocalizeMode;\r\n\r\n\t/**\r\n\t * Configuration option for whether or not this entity is versionable and displays a version dropdown on the edit\r\n\t * form. This also controls the ability to schedule changes to this entity (deletions, publishes) as only\r\n\t * versionable entities can have changes scheduled.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic versionable: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the edit button for an entity on the listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideEdit: boolean = false;\r\n\r\n\t/**\r\n\t * Determines whether or not the edit button should be disabled for a given record on the listing page.\r\n\t *\r\n\t * @param record - The listing page record that will be checked to determine if edit should be disabled.\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic disableEdit: (record: any) => boolean = () => false;\r\n\r\n\t/**\r\n\t * Configuration option to entirely hide the delete button on the edit form and listing page of an entity.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideDelete: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to copy the markup.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic copyHtmlMarkup: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the delete dropdown next to the delete button on the edit form of an entity.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideDeleteOptions: boolean = false;\r\n\r\n\t/**\r\n\t * Determines whether or not the delete button is disabled on the listing page for a given record.\r\n\t *\r\n\t * @param record - The listing page record that will be checked to determine if delete should be disabled.\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic disableDelete: (record: any) => boolean = (record: any) =>\r\n\t\t!this.hideDelete && record && record.status && record.status === ModelStatus.Deleted;\r\n\r\n\t/**\r\n\t * Configuration option to hide the \"view live\" button on edit forms and listing pages.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideView: boolean = true;\r\n\r\n\t/**\r\n\t * Determines whether or not the \"view live\" button should be disabled on the listing page for a given record.\r\n\t *\r\n\t * @param record - The listing page record that will be checked to determine if the \"view live\" button should be\r\n\t * disabled.\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic disableView: (record: any) => boolean = (record: any) =>\r\n\t\t!this.hideView && record && record.status && (record.status !== ModelStatus.Published || !record.url);\r\n\r\n\t/**\r\n\t * Configuration option to hide the view only button for this entity on the listing page. This is used for entities\r\n\t * that can't be edited, but are \"view only\". By default, this is hidden unless overridden.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideViewOnly: boolean = true;\r\n\r\n\t/**\r\n\t * Configuration option to say whether this page is a Bulk Edit page, meaning that there are multiple\r\n\t * entities being modified in one form. Setting this to true disables reloading the entity from the server\r\n\t * after saving\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic isBulkEdit: boolean = false;\r\n\r\n\t/**\r\n\t * Determines whether or not the view only button is disabled on the listing page for a given record. This is used\r\n\t * for entities that can't be edited, but are \"view only\". By default the button is not disabled unless this is\r\n\t * overidden.\r\n\t *\r\n\t * @param record - The listing page record that will be checked to determine if the view only button should be\r\n\t * disabled.\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic disableViewOnly: (record: any) => boolean = () => false;\r\n\r\n\tprivate canPublishBeScheduledOverride?: boolean;\r\n\r\n\t/**\r\n\t * Configuration option for whether or not this entity can have its publishing scheduled. This controls the\r\n\t * visibility of the 'Publish At' dropdown options on the edit form. By default this is enabled if the entity is\r\n\t * considered versionable via @see versionable\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic get canPublishBeScheduled(): boolean {\r\n\t\tif (this.canPublishBeScheduledOverride !== undefined) {\r\n\t\t\treturn this.canPublishBeScheduledOverride;\r\n\t\t}\r\n\t\treturn this.versionable;\r\n\t}\r\n\r\n\t/**\r\n\t * Configuration option for whether or not this entity can have its publishing scheduled. This controls the\r\n\t * visibility of the 'Publish At' dropdown options on the edit form. By default this is enabled if the entity is\r\n\t * considered versionable via @see versionable\r\n\t *\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic set canPublishBeScheduled(value: boolean) {\r\n\t\tthis.canPublishBeScheduledOverride = value;\r\n\t}\r\n\r\n\tprivate canInactivationBeScheduledOverride?: boolean;\r\n\r\n\t/**\r\n\t * Configuration option for whether or not this entity can have its inactivation scheduled. This controls the\r\n\t * visibility of the 'Save as Inactive At' dropdown option on the edit form. By default this is enabled if the\r\n\t * entity is considered versionable via @see versionable\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic get canInactivationBeScheduled(): boolean {\r\n\t\tif (this.canInactivationBeScheduledOverride !== undefined) {\r\n\t\t\treturn this.canInactivationBeScheduledOverride;\r\n\t\t}\r\n\t\treturn this.versionable;\r\n\t}\r\n\r\n\t/**\r\n\t * Configuration option for whether or not this entity can have its inactivation scheduled. This controls the\r\n\t * visibility of the 'Save as Inactive At' dropdown option on the edit form. By default this is enabled if the\r\n\t * entity is considered versionable via @see versionable\r\n\t *\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic set canInactivationBeScheduled(value: boolean) {\r\n\t\tthis.canInactivationBeScheduledOverride = value;\r\n\t}\r\n\r\n\tprivate canDeletionBeScheduledOverride?: boolean;\r\n\r\n\t/**\r\n\t * Configuration option for whether or not this entity can have its deletion scheduled. This controls the\r\n\t * visibility of the 'Delete At' dropdown options on the edit form. By default this is enabled if the entity is\r\n\t * considered versionable via @see versionable\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic get canDeletionBeScheduled(): boolean {\r\n\t\tif (this.canDeletionBeScheduledOverride !== undefined) {\r\n\t\t\treturn this.canDeletionBeScheduledOverride;\r\n\t\t}\r\n\t\treturn this.versionable;\r\n\t}\r\n\r\n\t/**\r\n\t * Configuration option for whether or not this entity can have its deletion scheduled. This controls the\r\n\t * visibility of the 'Delete At' dropdown options on the edit form. By default this is enabled if the entity is\r\n\t * considered versionable via @see versionable\r\n\t *\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic set canDeletionBeScheduled(value: boolean) {\r\n\t\tthis.canDeletionBeScheduledOverride = value;\r\n\t}\r\n\r\n\t/**\r\n\t * Configuration option for whether or not \"Save & Continue\" or \"Publish & Continue\" are enabled for this entity.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic canSaveAndContinue: boolean = true;\r\n\r\n\tprivate canSaveAsInactiveOverride?: boolean;\r\n\r\n\t/**\r\n\t * Configuration option for whether or not \"Save as Inactive\" is enabled for this entity.\r\n\t */\r\n\tpublic get canSaveAsInactive(): boolean {\r\n\t\tif (this.canSaveAsInactiveOverride !== undefined) {\r\n\t\t\treturn this.canSaveAsInactiveOverride;\r\n\t\t}\r\n\r\n\t\treturn this.isBaseModel || this.versionable;\r\n\t}\r\n\r\n\t/**\r\n\t * Configuration option for whether or not \"Save as Inactive\" is enabled for this entity.\r\n\t */\r\n\tpublic set canSaveAsInactive(value: boolean) {\r\n\t\tthis.canSaveAsInactiveOverride = value;\r\n\t}\r\n\r\n\t/**\r\n\t * Configuration option for the placement of the filters popover.\r\n\t * Options -\r\n\t * 'auto', 'auto-start', 'auto-end', 'top', 'top-start', 'top-end', 'right',\r\n\t * 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end', 'left',\r\n\t * 'left-start', 'left-end',\r\n\t *\r\n\t * @type {Popper.Placement}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic filterPopoverPlacement: Popper.Placement = 'bottom';\r\n\r\n\t/**\r\n\t * Configuration option for models which implement IBasicModel rather than IBaseModel, thus do not have a Status property.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic isBasicModel: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option for models which implement IBaseModel.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic isBaseModel: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the bulk delete button for this entity on the listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideBulkDelete: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the export button for this entity on the listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideExport: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the download button for this entity on the listing page.\r\n\t * For projects: Set this to false in any Definition.ts file in case you want to show the download button for the corresponding entity.\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideDownload: boolean = true;\r\n\r\n\t/**\r\n\t * Configuration option to hide the create delete button for this entity on the listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideCreateButton: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to force show the create button for this entity on the listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic forceShowCreateButton: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide all the results table row controls for this entity on the listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideListingControls: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the save/publish button for this entity on the edit page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideEditActions: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the cancel button for this entity on the edit page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideCancel: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the bulk action row selectors for this entity on the listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideBulkListingControls: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the status display column for this entity on the listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideStatusColumn: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the status display for this entity on the edit page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideStatusOnEdit: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to hide the key(legend) for this entity on both the edit and listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideKey: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to disable search functionality for this entity on the listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideSearch: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to disable saved filter functionality for this entity on the listing page.\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideSavedFilters: boolean = false;\r\n\r\n\t/**\r\n\t * Configuration option to override the default 'Create' text on the create button\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic createButtonText: string = 'Create';\r\n\r\n\t/**\r\n\t * Configuration option to hide the on the fly 301 creation after delete\r\n\t *\r\n\t * @type {boolean}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic hideCreate301OnTheFly: boolean = false;\r\n\r\n\t/**\r\n\t * The name of the field used to determine a user-friendly value to display for this record.\r\n\t * This is usually `name`, `value`, or `title`, but it may be overridden here.\r\n\t * Used in:\r\n\t *  - Create/Edit page subtitles\r\n\t *  - ...\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic userFriendlyNameField: string = 'name';\r\n\r\n\t/**\r\n\t * The name of the field used to determine the unique Code of this record, if such is defined.\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic codeField: string = 'code';\r\n\r\n\t/**\r\n\t * Hides the Listing Title component. Useful when ListingDisplayMode is EmbeddedInEditPage\r\n\t */\r\n\tpublic hidePageTitle: boolean = false;\r\n\r\n\t/**\r\n\t * Custom edit view live component.\r\n\t *\r\n\t * @type {React.ReactNode}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic editViewLiveComponent: React.ReactNode = (<EditViewLive />);\r\n\r\n\t/**\r\n\t * Gets the full base ajax route including the '/ajax' prefix\r\n\t *\r\n\t * @readonly\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tget baseAjaxRoute(): string {\r\n\t\treturn `/ajax${this.baseAjaxUrl}`;\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the full base ajax route including the '/ajax' prefix and excluding parameters\r\n\t *\r\n\t * @readonly\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tget parentBaseAjaxRoute(): string {\r\n\t\treturn `/ajax${this.parentBaseAjaxUrl}`;\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the full import ajax route including the full base ajax route\r\n\t *\r\n\t * @readonly\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tget importAjaxRoute(): string {\r\n\t\treturn this.baseAjaxRoute + '/import';\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the full export ajax route including the full base ajax route\r\n\t *\r\n\t * @readonly\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tget exportAjaxRoute(): string {\r\n\t\treturn this.baseAjaxRoute + '/export';\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the full revenue report route including the full base ajax route\r\n\t *\r\n\t * @readonly\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tget revenueReportAjaxRoute(): string {\r\n\t\treturn this.baseAjaxRoute + '/revenue';\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the full revenue available currencies ajax route including the full base ajax route\r\n\t *\r\n\t * @readonly\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tget revenueAvailableCurrenciesAjaxRoute(): string {\r\n\t\treturn this.revenueReportAjaxRoute + '/available-currencies';\r\n\t}\r\n\r\n\t/**\r\n\t * Configuration option to override the default 'create' slug in the new record create route\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic createRouteSlug: string = 'create';\r\n\r\n\t/**\r\n\t * Configuration option to override the default 'edit' slug in the existing record edit route\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic editRouteSlug: string = 'edit';\r\n\r\n\t/**\r\n\t * Configuration option to override the default 'view' slug in the exsiting record view only route\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic viewRouteSlug: string = 'view';\r\n\r\n\t/**\r\n\t * The name of the Status field\r\n\t */\r\n\tpublic statusField: string = 'status';\r\n\r\n\t/**\r\n\t * The display name for the Status field\r\n\t */\r\n\tpublic statusLabel: string = 'Status';\r\n\r\n\t/**\r\n\t * The name of the VersionNo field\r\n\t */\r\n\tpublic versionField: string = 'versionNo';\r\n\r\n\t/**\r\n\t * The display name for the VersionNo field\r\n\t */\r\n\tpublic versionLabel: string = 'Version';\r\n\r\n\t/**\r\n\t * Configuration option to set the publish button text on the create/edit pages\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic publishButtonLabel: string = 'Publish';\r\n\r\n\t/**\r\n\t * Configuration option to set the cancel button text on the edit pages\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic cancelButtonLabel: string = 'Cancel';\r\n\t/**\r\n\r\n\t/**\r\n\t * If true, the culture column is hidden in the listing page.\r\n\t */\r\n\tpublic hideCultureColumn: boolean = false;\r\n\r\n\t/**\r\n\t * Gets a generated identifier code for the entity definition that can be used in places such as entity tooltips\r\n\t *\r\n\t * @readonly\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tget code(): string {\r\n\t\treturn this.getCode();\r\n\t}\r\n\r\n\t/**\r\n\t * Provides a way to override an entity definition's `code` getter\r\n\t */\r\n\tpublic getCode: () => string = () => {\r\n\t\tif (this.pluralName) {\r\n\t\t\treturn this.pluralName.replace(/ /g, '').toLocaleLowerCase();\r\n\t\t}\r\n\r\n\t\tif (this.singularName) {\r\n\t\t\treturn this.singularName.replace(/ /g, '').toLocaleLowerCase();\r\n\t\t}\r\n\r\n\t\treturn '';\r\n\t};\r\n\r\n\t/**\r\n\t * Gets the base create route including the base route and the create slug\r\n\t *\r\n\t * @readonly\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tget baseCreateRoute(): string {\r\n\t\treturn `${this.baseRoute}/${this.createRouteSlug}`;\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the base edit route including the base route and the edit slug\r\n\t *\r\n\t * @readonly\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tget baseEditRoute(): string {\r\n\t\treturn `${this.baseRoute}/${this.editRouteSlug}`;\r\n\t}\r\n\r\n\t/**\r\n\t * Gets the base view route including the base route and the view slug\r\n\t *\r\n\t * @readonly\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tget baseViewRoute(): string {\r\n\t\treturn `${this.baseRoute}/${this.viewRouteSlug}`;\r\n\t}\r\n\r\n\t/**\r\n\t * Defines the page title override for this entity\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic pageTitleOverride: string | null = null;\r\n\r\n\t/**\r\n\t * Status icon override for listing and edit pages\r\n\t *\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic statusIconOverride?: (record: BaseDto) => React.ReactNode;\r\n\r\n\t/**\r\n\t * Status icon popover text override for listing pages\r\n\t *\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic statusInfoOverrideOnListing?: (record: Partial<BaseDto>) => React.ReactNode;\r\n\r\n\t/**\r\n\t * Status icon popover text override for edit pages\r\n\t *\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic statusInfoOverrideOnEdit?: (record: BaseDto) => React.ReactNode;\r\n\r\n\t/**\r\n\t * Defines the custom icons to show on listing page\r\n\t *\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic customListingControls: CustomListingControl[] = [];\r\n\r\n\t/**\r\n\t * String keys of the tooltips your page needs but that are not part of the database model for this entity\r\n\t *\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic extraTooltipKeys?: string[];\r\n\r\n\t/**\r\n\t * Key used for getting documentation links from AppState\r\n\t *\r\n\t * @type {string}\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic documentUrlKey: string | null = null;\r\n\r\n\t/**\r\n\t * Customizations for entity export. This is not needed for standard exports.\r\n\t */\r\n\tpublic exportOptions?: {\r\n\t\t/**\r\n\t\t * Key used to match the entity definition on the client with the export type coming from the server.\r\n\t\t * This is necessary for exporting entity types whose baseAjaxRoute is dynamic.\r\n\t\t */\r\n\t\ttypeKey: string;\r\n\r\n\t\t/**\r\n\t\t * AutoSuggest base url used to select a secondary export type\r\n\t\t */\r\n\t\tsecondaryTypeSuggestRoute?: string;\r\n\r\n\t\t/**\r\n\t\t * List of properties that should be overridden on the entity definition during export\r\n\t\t */\r\n\t\tpropertyOverrides?: ExportOverride[];\r\n\r\n\t\t/**\r\n\t\t * Predefined export label for entity types whose plural name is dynamic. This label will appear in the\r\n\t\t * primary export type dropdown within ExportCreateButton.tsx\r\n\t\t */\r\n\t\tlabel?: string;\r\n\t};\r\n\r\n\t/**\r\n\t * Converts an existing filter into an implicit filter. This filter will always execute, but it won't be displayed in the UI.\r\n\t * Useful for embedding listings in edit pages or to create different listing pages for the same entity.\r\n\t * @param name The name of the filter\r\n\t * @param value The value for the implicit filter\r\n\t */\r\n\tpublic setFilterToImplicit(name: string, value: any, shownOnRedirect?: boolean) {\r\n\t\tthis.filters = this.filters.map((filter) => {\r\n\t\t\tif (filter.name === name) {\r\n\t\t\t\treturn {\r\n\t\t\t\t\t...filter,\r\n\t\t\t\t\timplicit: true,\r\n\t\t\t\t\tpermanent: false,\r\n\t\t\t\t\tvalue,\r\n\t\t\t\t\tshownOnRedirect,\r\n\t\t\t\t};\r\n\t\t\t}\r\n\r\n\t\t\treturn filter;\r\n\t\t});\r\n\t}\r\n\r\n\tpublic getParentFilter(): Filter {\r\n\t\treturn {\r\n\t\t\tname: 'Parent',\r\n\t\t\tdisplayName: 'Parent',\r\n\t\t\ttype: FilterType.MultipleAutoSuggest,\r\n\t\t\tnullable: true,\r\n\t\t\toptions: {\r\n\t\t\t\tbaseUrl: this.baseAjaxRoute,\r\n\t\t\t},\r\n\t\t};\r\n\t}\r\n\r\n\tpublic getRootParentSelectedFilter(): SelectedFilter {\r\n\t\treturn {\r\n\t\t\tname: 'Parent',\r\n\t\t\tdisplayName: 'Parent',\r\n\t\t\ttype: FilterType.MultipleAutoSuggest,\r\n\t\t\tnullable: true,\r\n\t\t\toptions: {\r\n\t\t\t\tbaseUrl: this.baseAjaxRoute,\r\n\t\t\t},\r\n\t\t\tvalue: [NoValueAutoSuggestValue],\r\n\t\t};\r\n\t}\r\n\r\n\tprivate initializeServerSideProperties(init: Partial<EntityDefinition>) {\r\n\t\tif (!AppState) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// load data generated by server to automatically set any values not set on the client.\r\n\t\tconst metadata = AppState.dynamicEntityMetadata.entityDefinitionMap[this.baseAjaxRoute];\r\n\r\n\t\tif (!metadata) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (init.singularName === undefined) {\r\n\t\t\tthis.singularName = metadata.singularName;\r\n\t\t}\r\n\r\n\t\tif (init.pluralName === undefined) {\r\n\t\t\tthis.pluralName = metadata.pluralName;\r\n\t\t}\r\n\r\n\t\tif (init.hideExport === undefined) {\r\n\t\t\tthis.hideExport = !metadata.isExportable;\r\n\t\t}\r\n\r\n\t\tif (init.hideDownload === undefined) {\r\n\t\t\tthis.hideDownload = !metadata.isDownloadable;\r\n\t\t}\r\n\r\n\t\tif (init.hideCultureColumn === undefined) {\r\n\t\t\tthis.hideCultureColumn = !metadata.isTranslatable;\r\n\t\t}\r\n\r\n\t\tif (init.hideDownload === undefined) {\r\n\t\t\tthis.hideDownload = !metadata.isDownloadable;\r\n\t\t}\r\n\r\n\t\t// this is really just \"delete at\" which would require that deletions can be scheduled.\r\n\t\tif (init.hideDeleteOptions) {\r\n\t\t}\r\n\r\n\t\tif (init.isHierarchy === undefined) {\r\n\t\t\tthis.isHierarchy = metadata.isHierarchy;\r\n\t\t}\r\n\r\n\t\tif (init.localizeMode === undefined) {\r\n\t\t\tthis.localizeMode = metadata.isTranslatable ? LocalizeMode.SingleCulture : LocalizeMode.None;\r\n\t\t}\r\n\r\n\t\tif (init.scoped === undefined) {\r\n\t\t\tthis.scoped = metadata.isScoped;\r\n\t\t}\r\n\r\n\t\tif (init.publishButtonLabel === undefined) {\r\n\t\t\tthis.publishButtonLabel = metadata.isSoftDeletable || metadata.isBaseModel ? 'Publish' : 'Save';\r\n\t\t}\r\n\r\n\t\tif (init.isBasicModel === undefined) {\r\n\t\t\tthis.isBasicModel = metadata.isBasicModel;\r\n\t\t}\r\n\r\n\t\tif (init.isBaseModel === undefined) {\r\n\t\t\tthis.isBaseModel = metadata.isBaseModel;\r\n\t\t}\r\n\r\n\t\tif (init.versionable === undefined) {\r\n\t\t\tthis.versionable = metadata.isVersionable;\r\n\t\t}\r\n\r\n\t\tif (init.hideView === undefined) {\r\n\t\t\tthis.hideView = !metadata.isSeoModel;\r\n\t\t}\r\n\r\n\t\tif (!this.automaticMetadataFiltersEnabled) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (metadata.isBasicModel) {\r\n\t\t\tthis.addDedupedFilters(getBasicModelSearchFilters());\r\n\t\t}\r\n\r\n\t\tif (metadata.isBaseModel) {\r\n\t\t\tthis.addDedupedFilters(getBaseModelSearchFilters());\r\n\t\t}\r\n\r\n\t\tif (metadata.isVersionable) {\r\n\t\t\tthis.addDedupedFilters(getVersionableModelSearchFilters());\r\n\t\t}\r\n\r\n\t\tif (metadata.isPermanentModel) {\r\n\t\t\tthis.addDedupedFilter(getPermanentSearchFilter());\r\n\t\t}\r\n\r\n\t\tif (metadata.isScoped) {\r\n\t\t\tthis.addDedupedFilters(getScopeSearchFilter(AppState.config.multiSiteEnabled));\r\n\t\t}\r\n\r\n\t\tif (metadata.isNamedModel) {\r\n\t\t\tthis.addDedupedFilter(getNameSearchFilter());\r\n\t\t}\r\n\r\n\t\tif (metadata.isUniqueCodeModel || metadata.isCodeModel) {\r\n\t\t\tthis.addDedupedFilter(getCodeSearchFilter());\r\n\t\t}\r\n\r\n\t\tif (metadata.isSeoModel) {\r\n\t\t\tthis.addDedupedFilters(getSeoSearchFilters());\r\n\t\t}\r\n\r\n\t\tif (metadata.isUserTrackedModel) {\r\n\t\t\tthis.addDedupedFilters(getUserTrackedSearchFilters());\r\n\t\t}\r\n\r\n\t\tif (metadata.isUserModel) {\r\n\t\t\tthis.addDedupedFilter(getUserSearchFilter());\r\n\t\t} else if (metadata.isNullableUserModel) {\r\n\t\t\tthis.addDedupedFilter(getNullableUserSearchFilter());\r\n\t\t}\r\n\r\n\t\tif (metadata.isHierarchy) {\r\n\t\t\tthis.addDedupedFilter(this.getParentFilter());\r\n\t\t}\r\n\r\n\t\tif (metadata.isExternalModel) {\r\n\t\t\tthis.addDedupedFilter(getExternalIdSearchFilter());\r\n\t\t}\r\n\t}\r\n\r\n\tprotected addDedupedFilters(newFilters: Filter[]) {\r\n\t\tfor (const newFilter of newFilters) {\r\n\t\t\tthis.addDedupedFilter(newFilter);\r\n\t\t}\r\n\t}\r\n\r\n\tprotected addDedupedFilter(newFilter: Filter) {\r\n\t\tif (!this.filters.find((f) => f.name.toLocaleLowerCase() === newFilter.name.toLocaleLowerCase())) {\r\n\t\t\tthis.filters.push(newFilter);\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Constructor for the entity definition\r\n\t * @param {Partial<EntityDefinition>} [init]\r\n\t * @memberof EntityDefinition\r\n\t */\r\n\tpublic constructor(init?: Partial<EntityDefinition>) {\r\n\t\tObject.assign(this, init);\r\n\r\n\t\tthis.initializeServerSideProperties(init || {});\r\n\r\n\t\tregisterEntityDefinition(this);\r\n\t}\r\n}\r\n\r\nexport interface CustomListingControlProps<T extends BaseDto> {\r\n\trecord: T;\r\n\trowIndex: number;\r\n}\r\n\r\n/**\r\n * A property that will be overridden on the entity definition with a given value during export\r\n */\r\ninterface ExportOverride {\r\n\t/**\r\n\t * The name of the entity definition property which will be overridden\r\n\t */\r\n\tentityDefinitionKey: string;\r\n\r\n\t/**\r\n\t * A function that dynamically resolves to a string value using an AutoSuggestItem. The string\r\n\t * returned by this function is the new override value.\r\n\t */\r\n\tvalueResolver: (autoSuggestItem: ExportAutoSuggestItem) => string;\r\n\r\n\t/**\r\n\t * The original value of the property before it was overridden. Used for reverting an override.\r\n\t */\r\n\toriginalValue?: string;\r\n}\r\n\r\n// we want custom listing controls to support passing react components that follow this structure\r\ntype CustomListingControl = React.ComponentType<CustomListingControlProps<BaseDto>>;\r\n\r\n// Tooltips\r\n// It's not a real feature, but this is needed for the import/export\r\n// eslint-disable-next-line\r\nconst tooltipDefinition = new EntityDefinition({\r\n\tpluralName: 'Tooltips',\r\n\tsingularName: 'Tooltip',\r\n\tbaseAjaxUrl: '/tooltips',\r\n\thideExport: false,\r\n});\r\n\r\n// Settings definition for authorized base routes\r\n// eslint-disable-next-line\r\nconst settingsDefinition = new EntityDefinition({\r\n\tpluralName: 'Settings',\r\n\tsingularName: 'Setting',\r\n\tbaseAjaxUrl: '/settings',\r\n\tbaseRoute: '/system/settings',\r\n});\r\n\r\n// Settings definition for authorized base routes\r\n// eslint-disable-next-line\r\nconst accessControlsDefinition = new EntityDefinition({\r\n\tpluralName: 'Product Security',\r\n\tsingularName: 'Product Security',\r\n\tbaseAjaxUrl: '/access-controls',\r\n\tbaseRoute: '/cms/access-controls',\r\n});\r\n","/* eslint-disable no-unused-vars */\r\nimport { AxiosError } from 'axios';\r\nimport { Location } from 'components/shared/LastLocationProvider';\r\nimport TooltipDto from 'components/shared/tooltip/types/TooltipDto';\r\nimport { FormApi } from 'final-form';\r\nimport { Moment } from 'moment';\r\nimport { SortBy } from 'shared-client/types/index';\r\nimport { ValidationErrorSource } from 'util/Misc';\r\nimport EntityDefinition from './EntityDefinition';\r\nimport BaseDto from './__models__/BaseDto';\r\nimport BasicDto from './__models__/BasicDto';\r\nimport { ModelStatus } from 'shared-client/types/model-status';\r\nimport RecordScope from './__models__/RecordScope';\r\nimport { MapRule } from '../../../Roc.SharedClientApp/types/commerce/product-details';\r\n\r\nexport { default as EntityDefinition } from './EntityDefinition';\r\n\r\n/**\r\n * Expected fields in responses from the server in listing pages\r\n */\r\nexport interface IndexResults<TModel extends BasicDto> {\r\n\tpage: number;\r\n\tpageSize: number;\r\n\ttotalPages: number;\r\n\ttotalRecords: number;\r\n\trecords: TModel[];\r\n\tparentRecords: ParentRecordDto[] | null;\r\n\tbasicSearchFields: string[];\r\n\tsortBys: SortBy[];\r\n\tappliedSortBy: SortBy;\r\n\tuniqueId: string;\r\n\tappliedSavedFilterId: string;\r\n\thasQueuedBulkDelete?: boolean;\r\n}\r\n\r\nexport interface ParentRecordDto {\r\n\tid: string;\r\n\tname: string;\r\n\tparent: ParentRecordDto;\r\n}\r\n\r\n/**\r\n * The admin edit query result object. This should match the shape of `EditQueryResultBase<T>`\r\n */\r\nexport interface QueryResponse<TDto> {\r\n\t/**\r\n\t * The entity that will populate the admin form\r\n\t */\r\n\tentity: TDto;\r\n\r\n\t/**\r\n\t * Archived versions of the entity (models that implement <see cref=\"BaseModels.IVersionableModel\"/> only)\r\n\t */\r\n\tpreviousVersions?: EntityVersion[];\r\n\r\n\t/**\r\n\t * Pending drafts for this entity (models that implement <see cref=\"BaseModels.IVersionableModel\"/> only)\r\n\t */\r\n\tpendingVersions?: EntityVersion[];\r\n\r\n\t/**\r\n\t * Scheduled changes for this entity (models that implement <see cref=\"BaseModels.IVersionableModel\"/> only)\r\n\t */\r\n\tscheduledVersions?: EntityVersion[];\r\n\r\n\t/**\r\n\t * The status for the current version, which is the one that you go to when clicking on a listing on a listing\r\n\t * page (models that implement <see cref=\"BaseModels.IVersionableModel\"/> only)\r\n\t */\r\n\tcurrentVersionStatus: ModelStatus;\r\n}\r\n\r\n/**\r\n * Represents the state of an admin edit form.\r\n * @template TDto The dto object representing the entity being edited or created\r\n * @template TQueryResponse The dto response object sent from the backend\r\n */\r\nexport interface EditContextState<TDto = any, TQueryResponse extends QueryResponse<TDto> = QueryResponse<TDto>> {\r\n\tvalues: TDto | undefined;\r\n\tresponse: TQueryResponse | undefined;\r\n\teditSessionUniqueKey: string;\r\n\tentityDefinition: EntityDefinition;\r\n\r\n\tprimaryCulture?: string;\r\n\tcurrentCulture?: string;\r\n\tredirectCulture?: string;\r\n\tcurrentScope?: RecordScope;\r\n\r\n\t/**\r\n\t * The error when trying to save or send data to the server.\r\n\t */\r\n\taxiosError: AxiosError | null;\r\n\r\n\t/**\r\n\t * If true, there was an error trying to save data on the server that couldn't be handled properly.\r\n\t * (typically a timeout or internal server error)\r\n\t */\r\n\terrorOnSave: boolean;\r\n\r\n\t/**\r\n\t * If true, there was an error trying to save data on the server because the data failed\r\n\t * validation (eg the user sent bad data to the server)\r\n\t */\r\n\tvalidationError: boolean;\r\n\r\n\t/**\r\n\t * The source of any validation errors.\r\n\t */\r\n\tvalidationErrorSource: ValidationErrorSource;\r\n\r\n\t/**\r\n\t * Is the edit context doing an initial page load?\r\n\t */\r\n\tisLoadingInitial: boolean;\r\n\r\n\t/**\r\n\t * Is the edit context doing a post-initial page load, such as when a different version is selected?\r\n\t */\r\n\tisLoading: boolean;\r\n\r\n\t/**\r\n\t * True whenever the form is being saved.\r\n\t */\r\n\tisSaving: boolean;\r\n\r\n\t/**\r\n\t * The pathname to redirect to. For example: /cms/pages\r\n\t */\r\n\tredirectPathName: string;\r\n\r\n\t/**\r\n\t * The query string to append to the path name when redirecting. For example: q=test\r\n\t */\r\n\tredirectSearch: string;\r\n\r\n\t/**\r\n\t * True when an item is being created.\r\n\t */\r\n\tisCreateMode: boolean;\r\n\r\n\t/**\r\n\t * The ID of the item being edited, based on the route\r\n\t */\r\n\teditingId?: string;\r\n\r\n\t/**\r\n\t * Triggers a save and continue maintaining the historyId in the QueryString.\r\n\t */\r\n\tcontinueWithHistory?: boolean;\r\n\r\n\t/**\r\n\t * Whether the next edit/publish request should be forced, that is, if it should succeed even if it must\r\n\t * modify other models in the database to do so. This should only ever be set to true if the user has been\r\n\t * warned of the consequences ahead of time.\r\n\t */\r\n\tforce: boolean;\r\n\r\n\t/**\r\n\t * The previous location when the edit context was initialized. This can be used to navigate back to listing\r\n\t * pages (or whatever previous page was active).\r\n\t */\r\n\tlastLocation: Location;\r\n\r\n\t/**\r\n\t * The type of submission that the next edit form submission should be. This gets set from other components\r\n\t * that are trying to perform actions such as \"save as draft\", etc. If `null`, the next submission will not\r\n\t * change the entity's status.\r\n\t */\r\n\tnextSubmissionType: ModelStatus | null;\r\n\t/**\r\n\t * Whether or not the next edit form submission should continue by refreshing the edit form instead of\r\n\t * redirecting back to the previous page (often the listing page).\r\n\t */\r\n\tnextSubmissionContinues: boolean;\r\n\r\n\tnextSubmissionTime: Moment | null;\r\n\thasTooltipError: boolean;\r\n\ttooltipData: { [name: string]: { fieldTooltip: TooltipDto; universalTooltip: TooltipDto } };\r\n\tentityTypeId: string;\r\n\r\n\tfieldSuggestions: FieldSuggestionMap;\r\n\tscopeFieldEnabled: boolean;\r\n\tredirectTo404: boolean;\r\n\r\n\t/**\r\n\t * True if the scope was changed on the edit page\r\n\t */\r\n\tscopeChanged: boolean;\r\n\r\n\t/**\r\n\t * Contains the record original scope on the edit page\r\n\t */\r\n\toriginalScope?: RecordScope;\r\n}\r\n\r\n/**\r\n * Represents 301 redirects that should be created when deleting a published record or changing the scope of a published record.\r\n */\r\nexport interface RedirectData {\r\n\t/** The new URL to create a 301 redirect for. */\r\n\tredirectUrl: string;\r\n\t/** The guid of the site that the redirect will belong to. */\r\n\tsiteId: string;\r\n}\r\n\r\n/**\r\n * The state of the create/edit submission.\r\n */\r\nexport interface SubmissionState {\r\n\t/** The type of submission such as publishing or deactivating */\r\n\tsubmissionType: ModelStatus | null;\r\n\t/** If set, the time the create/edit action is to be performed */\r\n\tsubmissionTime: Moment | null;\r\n\t/** If true, do not redirect the user after the submission attempt. */\r\n\tdoContinue: boolean;\r\n\t/** If true, the submission will override errors if possible. This should only ever be set if the user was warned of the consequences of forcing the submission. */\r\n\tforce?: boolean;\r\n}\r\n\r\n/**\r\n * The type for a single form values transform handler function.\r\n */\r\nexport type FormValuesTransformHandler = (formValues: any) => Promise<any>;\r\n\r\n/**\r\n * Type for the entire edit context, which includes state as well as additional functions\r\n * which do not need to be state.\r\n */\r\nexport type EditContext<\r\n\tTDto = any,\r\n\tTQueryResponse extends QueryResponse<TDto> = QueryResponse<TDto>\r\n> = EditContextState<TDto, TQueryResponse> & {\r\n\t/**\r\n\t * Resets a component's EditContext to its initial state.\r\n\t */\r\n\treset(): void;\r\n\r\n\t/**\r\n\t * Informs the edit context of the kind of save that should be done when the edit form is submitted. This is used\r\n\t * for flagging certain saves such as saving as draft, inactive, etc.\r\n\t */\r\n\tsetNextSubmissionState: (nextState: SubmissionState) => Promise<void>;\r\n\r\n\t/**\r\n\t * Returns a promise that will save the form values on the server. The promise is required for\r\n\t * react-final-form to properly handle form state if something goes wrong. For example, if there's\r\n\t * validation, or a server error.\r\n\t */\r\n\tsave(values: TDto, formApi?: FormApi): Promise<void> | Record<string, any>;\r\n\r\n\t/**\r\n\t * Loads the entity being edited based on the current URL. This is called on load but can also\r\n\t * be called from other components via editContext. That method is primarily used by the versioning\r\n\t * dropdown but can be used by anything.\r\n\t */\r\n\tload(): void;\r\n\r\n\tregisterOnBeforeSaveCallback(name: string, cb: () => void);\r\n\r\n\t/**\r\n\t * Retrieves a full list of the version history within the edit context.\r\n\t */\r\n\tgetAllVersions(): EntityVersion[];\r\n\t/**\r\n\t * Returns the unique identifier (from the query string) of the current active version.\r\n\t * This may not necessarily be a version that exists.\r\n\t */\r\n\tgetActiveVersionId(): string | null;\r\n\t/**\r\n\t * Gets the current active version within the edit context, or `null` if the current\r\n\t * version is the latest version.\r\n\t */\r\n\tgetActiveVersion(): EntityVersion | null;\r\n\t/**\r\n\t * Retrieves the `EntityVersion` from the history of the edit context by id, or `null` if\r\n\t * the version could not be found.\r\n\t */\r\n\tgetVersionById(id?: string): EntityVersion | null;\r\n\t/**\r\n\t * Loads the cached tooltip data into the editContext\r\n\t */\r\n\tgetTooltipsForEntity: () => void;\r\n\r\n\t/**\r\n\t * Sets the current culture on the page\r\n\t * @param culture\r\n\t */\r\n\tsetCulture(culture: string): void;\r\n\r\n\t/**\r\n\t * Sets the continueWithHistory value. When true, the current historyId in the querystring will be maintained after\r\n\t * the Save & Continue operation.\r\n\t * @param continueWithHistory\r\n\t */\r\n\tsetContinueWithHistory(continueWithHistory: boolean): void;\r\n\r\n\t/**\r\n\t * Updates the pending field suggestions by merging the provided object with the existing state.\r\n\t * This means that field suggestions that do not match keys in the `fieldSuggestMap` will not be\r\n\t * removed. They may be overwritten if there's a match, however. Similar to how setState works.\r\n\t */\r\n\tsetFieldSuggestions: (fieldSuggestMap: FieldSuggestionMap) => void;\r\n\r\n\t/**\r\n\t * Redirects the browser back to the last location before the active edit form was mounted. This\r\n\t * is often used to redirect back to the listing page (and retain any active filters).\r\n\t */\r\n\tredirectToLastLocation: () => void;\r\n\r\n\t/**\r\n\t * Toggles whether the scope field should be enabled or disabled for a scoped entity\r\n\t */\r\n\tsetScopeFieldEnabled: (display: boolean) => void;\r\n\r\n\t/**\r\n\t * Set the culture that should be set when the form reloads.\r\n\t */\r\n\tsetRedirectCulture: (culture?: string) => void;\r\n\r\n\t/**\r\n\t * Set current scope\r\n\t */\r\n\tsetCurrentScope: (scope: RecordScope) => void;\r\n\r\n\t/**\r\n\t * Set scope changed\r\n\t */\r\n\tsetScopeChanged: (scopeChanged: boolean) => void;\r\n\r\n\t/**\r\n\t * Set the original scope\r\n\t */\r\n\tsetOriginalScope: (scope?: RecordScope) => void;\r\n\r\n\t/**\r\n\t * Adds a new form values transform handler for this edit instance.\r\n\t */\r\n\tregisterFormValuesTransformHandler: (key: string, handler: FormValuesTransformHandler) => void;\r\n};\r\n\r\n/**\r\n * Type for all maps for field suggestions.\r\n */\r\nexport interface FieldSuggestionMap {\r\n\t[index: string]: string;\r\n}\r\n\r\n/**\r\n * Represents the data of a single entity version record.\r\n */\r\nexport class EntityVersion {\r\n\t/** The unique identifier of the version record. */\r\n\tpublic id: string | null;\r\n\tpublic createDate: Moment;\r\n\tpublic modifyDate: Moment;\r\n\tpublic processTime?: Moment | null;\r\n\t/** If specified, the time that this entity version is scheduled to be applied. */\r\n\tpublic scheduledTime?: Moment | null;\r\n\tpublic status?: string;\r\n\t/** The display name of the user who created this entity version. */\r\n\tpublic createUser?: string;\r\n\t/** The display name of the user who modified this entity version. */\r\n\tpublic modifyUser?: string;\r\n\tpublic versionNo: number;\r\n\tpublic type: EntityVersionType;\r\n}\r\n\r\nexport enum EntityVersionType {\r\n\t/**\r\n\t * The current version of the entity.\r\n\t */\r\n\tCurrent,\r\n\t/**\r\n\t * A future version of the entity (such as a scheduled edit or delete).\r\n\t */\r\n\tFuture,\r\n\t/**\r\n\t * A pending draft version of the entity.\r\n\t */\r\n\tDraft,\r\n\t/**\r\n\t * A previous version of the entity.\r\n\t */\r\n\tArchived,\r\n\r\n\t// NOTE: if more version types are added, `HistoryHelper.getVersionTypeName` should be updated!\r\n}\r\n\r\n/**\r\n * Type for storing state withing listing pages\r\n */\r\n// TODO: apply TModel to `results`\r\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\r\nexport interface TreeContextState<TModel extends BasicDto> {\r\n\tresults?: any;\r\n\tentityDefinition: EntityDefinition;\r\n\tisLoading: boolean;\r\n\thasError: boolean;\r\n\theight: number;\r\n}\r\n\r\n/**\r\n * Type for the entire tree context, which includes state as well as additional functions\r\n * which do not need to be state.\r\n */\r\nexport type TreeContext<TModel extends BasicDto> = TreeContextState<TModel> & {\r\n\thandleDelete(record: BaseDto, nameField: string): void;\r\n\tupdateTree(treeData: any): void;\r\n\tonVisibilityToggle(options: any): void;\r\n};\r\n\r\n/**\r\n * Represents the various global application settings used in the admin.\r\n */\r\nexport interface AppSettings {\r\n\tisTestMode: boolean;\r\n\r\n\t/** The IANA time zone string which designates how all dates and times in the admin will display. */\r\n\ttimeZone: string;\r\n\tmaximumIdleTimeBeforeSessionExpirationCountdown: number;\r\n\tsessionExpirationFinalCountdown: number;\r\n\tsessionTimeout: number;\r\n\tisMetaKeywordVisible: boolean;\r\n\toption1Text404: string;\r\n\toption2Text404: string;\r\n\toption1Link404: string;\r\n\toption2Link404: string;\r\n\toption1Text500: string;\r\n\toption2Text500: string;\r\n\toption1Link500: string;\r\n\toption2Link500: string;\r\n\tuserRequireConfirmEmail: boolean;\r\n\tduoSecurityForLdapOnly: boolean;\r\n\ttext404: string;\r\n\ttext500: string;\r\n\tenableCKEditorInspector: boolean;\r\n\tenableCKEditorPreviewEmbeddedHtml: boolean;\r\n\tenableCKEditorSanitizeEmbeddedHtml: boolean;\r\n\taccessControlsEnabled: boolean;\r\n\t// #region Google\r\n\tga4DashboardUrl: string;\r\n\tgoogleDataStudioUrl: string;\r\n\t// #endregion\r\n\t// #region Commerce\r\n\tdefaultCurrency: string;\r\n\tenableMultipleUserOrganizations: boolean;\r\n\tenableMinimumOrderQuantities: boolean;\r\n\tmapDefaultSetting: MapRule;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * interface for the initial app config\r\n */\r\nexport interface AppConfig {\r\n\tadminUrl: string;\r\n\tapiUrl: string;\r\n\ttasksUrl: string;\r\n\tmultiSiteEnabled: boolean;\r\n\tduoSecurityEnabled: boolean;\r\n\tsettingScopePrefix: string;\r\n\tuseEmailAsUserName: boolean;\r\n\tisTestingEnvironment: boolean;\r\n\tversion: string;\r\n\tbuild: string;\r\n\thasPendingMigrations: boolean;\r\n\t// #region Commerce\r\n\tcategoryTreesEnabled: boolean;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Represents the application user's authorized routes (access to various features) and various\r\n * other permissions not specifically associated with base routes.\r\n * */\r\nexport interface AppUserPermissions {\r\n\t/** Whether the current user is a power user (has all permissions) */\r\n\tisPowerUser: boolean;\r\n\r\n\t/** A dictionary with routes as keys and a list of permissions for values. This list includes the basic permissions: [view, edit/create, delete] */\r\n\tauthorizedBaseRoutes: { [baseRoute: string]: boolean[] };\r\n\r\n\t/** Whether the user has permission to requeue emails */\r\n\thasReQueueEmailPermission: boolean;\r\n\r\n\t/** Whether the user has permission to manage jobs */\r\n\thasListTasksPermission: boolean;\r\n\r\n\t/** Whether the user can manage settings */\r\n\thasManageSettingsPermission: boolean;\r\n\r\n\t/** Whether hasImpersonationPermission user can initiate impersonation sessions */\r\n\thasImpersonationPermission: boolean;\r\n\r\n\t/** Whether the user can view the redis status page */\r\n\thasViewRedisStatusPermission: boolean;\r\n\r\n\t/** Has list permissions to any admin area. Used in the Export page, to display the create button if the user has access to view any area, as this means data could be potentially exported. */\r\n\thasAnyListPermission: boolean;\r\n\r\n\t/** Has edit permission to any admin area. Used in the Import page, to display the create button if the user has access to view any area, as this means data could be potentially imported. */\r\n\thasAnyEditPermission: boolean;\r\n\r\n\t/** If true, the user has access to reset Two-Factor Authentication of other users */\r\n\thasResetTwoFactorAuthenticatonPermission: boolean;\r\n}\r\n\r\n/**\r\n * Represents an application user (a logged in administrator)\r\n */\r\nexport interface AppUser {\r\n\t/** The unique identifier of the application user */\r\n\tid: string;\r\n\r\n\t/** The first name of the application user */\r\n\tfirstName: string;\r\n\r\n\t/** The last name of the application user */\r\n\tlastName: string;\r\n\r\n\t/** The user name of the application user (their login). */\r\n\tuserName: string;\r\n\r\n\t/** The email of the application user */\r\n\temail: string;\r\n\r\n\t/** If true, this user is an application developer and will see developer only / debug features restricted from normal administrators. */\r\n\tisDeveloper?: boolean;\r\n\r\n\t/** If true, the tooltip edit mode is on */\r\n\tisTooltipEditMode: boolean;\r\n\r\n\t/** If true, show the tooltip edit mode toggle */\r\n\tshowIsTooltipEditMode: boolean;\r\n\r\n\t/** Contains the authorized base routes for the logged in user\r\n\t * for eg.: [{'/ajax/pages': [true, true, false]}, {...}]\r\n\t * for index, createEdit and delete permissions for the pages feature\r\n\t */\r\n\tauthorizedBaseRoutesData: AppUserPermissions;\r\n\r\n\t/** If true, the user has access to upload assets */\r\n\thasUploadAssetPermission: boolean;\r\n\r\n\t// #region Commerce\r\n\t/** If true, the user has the permission to create a credit memo */\r\n\thasCreateCreditMemoPermission: boolean;\r\n\t// #endregion\r\n}\r\n\r\n/**\r\n * Represents an Asset Storage Provider in the App Context\r\n *\r\n * @export\r\n * @interface AssetStore\r\n */\r\nexport interface AssetStore {\r\n\tid: string;\r\n\tname: string;\r\n}\r\n\r\n/**\r\n * Represents an application message\r\n */\r\nexport interface AppMessage {\r\n\tmessage: string;\r\n\tlink: string;\r\n}\r\n\r\n/**\r\n * The initial front end application state sent by the server before it is transformed into other classes and structues. AppPreloadedState has a very brief life cycle.\r\n */\r\nexport interface AppPreloadedState {\r\n\tsettings: AppSettings;\r\n\tuser: AppUser;\r\n\tassetStores: AssetStore[];\r\n\tmessages: AppMessage[];\r\n}\r\n\r\nexport interface AppCulture {\r\n\tid: string;\r\n\tname: string;\r\n\tcode: string;\r\n\tisFallback: boolean;\r\n}\r\n\r\nexport interface AppSiteDto {\r\n\tid: string;\r\n\tname: string;\r\n\tisDefault: boolean;\r\n\tcultureId: string;\r\n\tsiteCollections: AppSiteCollectionSiteDto[];\r\n\thosts: AppSiteHostDto[];\r\n\tcanonicalCultureHosts: AppCanonicalCultureHostDto[];\r\n}\r\n\r\n// #region Commerce\r\nexport interface AppSiteDto {\r\n\tisOrderNotesEnabled: boolean;\r\n\tisOrderCreditMemosEnabled: boolean;\r\n}\r\n// #endregion\r\n\r\nexport interface AppSiteCollectionDto {\r\n\tid: string;\r\n\tname: string;\r\n\tsites: AppSiteCollectionSiteDto[];\r\n}\r\n\r\nexport interface AppSiteCollectionSiteDto {\r\n\tsiteId: string;\r\n\tsiteCollectionId: string;\r\n}\r\n\r\nexport interface AppSiteHostDto {\r\n\tid: string;\r\n\thost: string;\r\n\tport?: number;\r\n\tcultureId: string | null;\r\n\tsubdirectory: string | null;\r\n}\r\n\r\nexport interface AppCanonicalCultureHostDto {\r\n\tsiteId: string;\r\n\tsiteHostId: string;\r\n\tcultureId: string;\r\n}\r\n\r\n// #region Commerce\r\nexport interface SiteCategoryTreeDto {\r\n\tid: string;\r\n\tname: string;\r\n\tsiteIds: string[];\r\n}\r\n// #endregion\r\n","import * as React from 'react';\r\nimport { Alert } from 'reactstrap';\r\n\r\nexport interface FilterEditRequiredValidationProps {\r\n\tmessageOverride: string;\r\n}\r\n\r\nclass FilterEditRequiredValidation extends React.PureComponent<FilterEditRequiredValidationProps> {\r\n\tpublic static defaultProps = {\r\n\t\tmessageOverride: 'Search field is required',\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn <Alert color=\"danger\">{this.props.messageOverride}</Alert>;\r\n\t}\r\n}\r\n\r\nexport default FilterEditRequiredValidation;\r\n","import * as React from 'react';\r\nimport ModalClose from './ModalClose';\r\nimport { Button, Modal, ModalBody } from 'reactstrap';\r\nimport Spinner from './Spinner';\r\nimport ExclamationCircleSVG from './svg/ExclamationCircleSVG';\r\nimport CheckSVG from './svg/CheckSVG';\r\nimport ExclamationCircleSVG2 from './svg/ExclamationCircleSVGAlternative';\r\nimport ExclamationTriangleSVGAlternative from './svg/ExclamationTriangleSVGAlternative';\r\nimport { AlertSize } from './Alert';\r\nimport classnames from 'classnames';\r\n\r\nexport interface RenderButtonProps {\r\n\tonConfirm: () => void;\r\n\tonCancel: () => void;\r\n\tconfirmButtonText?: string;\r\n\tcancelButtonText?: string;\r\n\tcolor: ConfirmColor;\r\n\tconfirmButtonColor: ConfirmColor;\r\n\tcancelButtonColor: ConfirmColor;\r\n\tinProgress?: boolean;\r\n\tcancelTestId: string;\r\n\tconfirmTestId: string;\r\n}\r\n\r\n/*\r\n * Types of colors for confirm\r\n */\r\nexport type ConfirmColor = 'default' | 'primary' | 'success' | 'info' | 'warning' | 'danger';\r\n\r\nexport interface ConfirmProps {\r\n\tisOpen: boolean;\r\n\tonConfirm: () => void;\r\n\tonCancel: () => void;\r\n\trenderTitle: () => React.ReactNode;\r\n\trenderContents: () => React.ReactNode;\r\n\trenderButtons: (props: RenderButtonProps) => React.ReactNode;\r\n\tconfirmButtonText?: string;\r\n\tcancelButtonText?: string;\r\n\tcolor?: ConfirmColor;\r\n\tinProgress?: boolean;\r\n\tsize?: AlertSize;\r\n\tcancelTestId?: string;\r\n\tconfirmTestId?: string;\r\n}\r\n\r\nconst fancyModalSVGClass = 'fancy-modal__footer-icon-svg';\r\n\r\n/**\r\n * Reusable confirm component that replaces window confirm().\r\n *\r\n * @class Confirm\r\n * @extends {React.Component<ConfirmProps>}\r\n */\r\nclass Confirm extends React.Component<ConfirmProps> {\r\n\tpublic static defaultProps = {\r\n\t\trenderButtons: (renderButtonProps: RenderButtonProps) => (\r\n\t\t\t<>\r\n\t\t\t\t<div className=\"fancy-modal__footer-icon\">\r\n\t\t\t\t\t{renderButtonProps.color === 'default' ||\r\n\t\t\t\t\trenderButtonProps.color === 'primary' ||\r\n\t\t\t\t\trenderButtonProps.color === 'success' ? (\r\n\t\t\t\t\t\t<CheckSVG class={fancyModalSVGClass + ' fancy-modal__footer-icon-svg--success'} />\r\n\t\t\t\t\t) : renderButtonProps.color === 'info' ? (\r\n\t\t\t\t\t\t<ExclamationCircleSVG2 class={fancyModalSVGClass + ' fancy-modal__footer-icon-svg--info'} />\r\n\t\t\t\t\t) : renderButtonProps.color === 'warning' ? (\r\n\t\t\t\t\t\t<ExclamationTriangleSVGAlternative\r\n\t\t\t\t\t\t\tclass={fancyModalSVGClass + ' fancy-modal__footer-icon-svg--warning'}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t) : renderButtonProps.color === 'danger' ? (\r\n\t\t\t\t\t\t<ExclamationCircleSVG class={fancyModalSVGClass + ' fancy-modal__footer-icon-svg--danger'} />\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<ExclamationCircleSVG class={fancyModalSVGClass + ' fancy-modal__footer-icon-svg'} />\r\n\t\t\t\t\t)}\r\n\t\t\t\t</div>\r\n\t\t\t\t<div className=\"fancy-modal__footer-actions\">\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tcolor={renderButtonProps.cancelButtonColor}\r\n\t\t\t\t\t\tclassName=\"btn-inline btn-modal-action fancy-modal__cancel-btn\"\r\n\t\t\t\t\t\toutline\r\n\t\t\t\t\t\tonClick={renderButtonProps.onCancel}\r\n\t\t\t\t\t\tdata-testid={renderButtonProps.cancelTestId}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{renderButtonProps.cancelButtonText}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tcolor={renderButtonProps.confirmButtonColor}\r\n\t\t\t\t\t\tclassName=\"btn-modal-action fancy-modal__confirm-btn\"\r\n\t\t\t\t\t\toutline={renderButtonProps.color === 'primary' ? true : false}\r\n\t\t\t\t\t\tonClick={renderButtonProps.onConfirm}\r\n\t\t\t\t\t\tdisabled={renderButtonProps.inProgress}\r\n\t\t\t\t\t\tdata-testid={renderButtonProps.confirmTestId}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\t{renderButtonProps.inProgress ? (\r\n\t\t\t\t\t\t\t<Spinner centered color=\"light\" />\r\n\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\trenderButtonProps.confirmButtonText\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t</div>\r\n\t\t\t</>\r\n\t\t),\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tisOpen,\r\n\t\t\tonCancel,\r\n\t\t\tonConfirm,\r\n\t\t\trenderTitle,\r\n\t\t\trenderContents,\r\n\t\t\trenderButtons,\r\n\t\t\tcolor = 'warning',\r\n\t\t\tconfirmButtonText = 'Ok',\r\n\t\t\tcancelButtonText = 'Cancel',\r\n\t\t\tinProgress,\r\n\t\t\tsize = 'small',\r\n\t\t\tcancelTestId = 'confirm-alert-cancel',\r\n\t\t\tconfirmTestId = 'confirm-alert-confirm',\r\n\t\t} = this.props;\r\n\r\n\t\tconst confirmBaseClass = 'fancy-modal ';\r\n\t\tconst confirmColor = 'fancy-modal--' + color;\r\n\t\tconst combinedClass = confirmBaseClass + confirmColor;\r\n\r\n\t\tlet confirmButtonColor;\r\n\t\tlet cancelButtonColor;\r\n\r\n\t\t// Set the button colors based on the confirm's color.\r\n\t\tswitch (color) {\r\n\t\t\tcase 'default':\r\n\t\t\t\tconfirmButtonColor = 'primary';\r\n\t\t\t\tcancelButtonColor = 'primary-alt';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'primary':\r\n\t\t\tcase 'info':\r\n\t\t\tcase 'success':\r\n\t\t\tcase 'danger':\r\n\t\t\tcase 'warning':\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tconfirmButtonColor = 'default';\r\n\t\t\t\tcancelButtonColor = 'default';\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<Modal\r\n\t\t\t\tisOpen={isOpen}\r\n\t\t\t\ttoggle={onCancel}\r\n\t\t\t\tclassName={classnames(combinedClass, {\r\n\t\t\t\t\t'fancy-modal--extra-small': size === 'extra-small',\r\n\t\t\t\t\t'fancy-modal--small': size === 'small',\r\n\t\t\t\t\t'fancy-modal--medium': size === 'medium',\r\n\t\t\t\t\t'fancy-modal--large': size === 'large',\r\n\t\t\t\t\t'fancy-modal--extra-large': size === 'extra-large',\r\n\t\t\t\t})}\r\n\t\t\t>\r\n\t\t\t\t<ModalBody className=\"fancy-modal__body\">\r\n\t\t\t\t\t<ModalClose toggle={onCancel} />\r\n\t\t\t\t\t<h2 className=\"fancy-modal__title\">{renderTitle()}</h2>\r\n\t\t\t\t\t<div className=\"fancy-modal__content\">{renderContents()}</div>\r\n\t\t\t\t\t<div className=\"fancy-modal__footer\">\r\n\t\t\t\t\t\t{renderButtons({\r\n\t\t\t\t\t\t\tonConfirm,\r\n\t\t\t\t\t\t\tonCancel,\r\n\t\t\t\t\t\t\tconfirmButtonText,\r\n\t\t\t\t\t\t\tcancelButtonText,\r\n\t\t\t\t\t\t\tcolor,\r\n\t\t\t\t\t\t\tconfirmButtonColor,\r\n\t\t\t\t\t\t\tcancelButtonColor,\r\n\t\t\t\t\t\t\tinProgress,\r\n\t\t\t\t\t\t\tcancelTestId,\r\n\t\t\t\t\t\t\tconfirmTestId,\r\n\t\t\t\t\t\t})}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</ModalBody>\r\n\t\t\t</Modal>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Confirm;\r\n","enum LocalizeMode {\r\n\tNone = 0,\r\n\tSingleCulture = 1,\r\n\tAllCultures = 2,\r\n}\r\n\r\nexport default LocalizeMode;\r\n","import React from 'react';\r\nimport EditContext from './EditContext';\r\nimport { EditContext as EditContextType } from 'types';\r\n\r\nexport interface HasEditContext {\r\n\teditContext: EditContextType;\r\n}\r\n\r\n// https://reactjs.org/docs/context.html#consuming-context-with-a-hoc\r\nexport default function withEditContext(WrappedComponent: React.ComponentClass<HasEditContext> & any) {\r\n\tconst EditComponent: any = (props) => {\r\n\t\t// here we're simply\r\n\t\t// 1) passing down the props coming from higher components\r\n\t\t// 2) making sure that the context is being set as editContext\r\n\r\n\t\treturn (\r\n\t\t\t<EditContext.Consumer>\r\n\t\t\t\t{(value: EditContextType) => <WrappedComponent {...props} editContext={value} />}\r\n\t\t\t</EditContext.Consumer>\r\n\t\t);\r\n\t};\r\n\r\n\tconst wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';\r\n\tEditComponent.displayName = `withEditContext(${wrappedComponentName})`;\r\n\tEditComponent.WrappedComponent = WrappedComponent;\r\n\r\n\treturn EditComponent;\r\n}\r\n","import * as React from 'react';\r\nimport {\r\n\tAutoSuggestOptions,\r\n\tAutoSuggestItem,\r\n\tAutoSuggestMenuItemRenderProps,\r\n\tAutoSuggestInputProps,\r\n\tAutoSuggestRenderMenuProps,\r\n} from './Types';\r\nimport { ControllerStateAndHelpers } from 'downshift';\r\n\r\nconst AutoSuggestContext = React.createContext<Partial<AutoSuggestContextValue>>({\r\n\tautoSuggestOptions: {\r\n\t\tallowNewValues: false,\r\n\t\tbaseUrl: '',\r\n\t\tstaticData: null,\r\n\t},\r\n});\r\nexport default AutoSuggestContext;\r\n\r\nexport type AutoSuggestContextValue = AutoSuggestInputProps & {\r\n\tautoSuggestOptions: AutoSuggestOptions;\r\n\tdownshift: ControllerStateAndHelpers<AutoSuggestItem>;\r\n\trenderMenuItem: (renderInputProps: AutoSuggestMenuItemRenderProps) => React.ReactNode;\r\n\trenderMenu: (renderMenuProps: AutoSuggestRenderMenuProps) => React.ReactNode;\r\n\thideStatusIcon?: boolean;\r\n};\r\n","import * as React from 'react';\r\nimport { Modal, ModalBody, Button } from 'reactstrap';\r\nimport ModalClose from './ModalClose';\r\nimport ExclamationCircleSVG from './svg/ExclamationCircleSVG';\r\nimport ExclamationTriangleSVG from './svg/ExclamationTriangleSVG';\r\nimport InfoSVG from './svg/InfoSVG';\r\nimport CheckSVG from './svg/CheckSVG';\r\nimport classnames from 'classnames';\r\n\r\n/*\r\n * Types of colors for alert\r\n */\r\nexport type AlertColor = 'default' | 'primary' | 'success' | 'info' | 'warning' | 'danger';\r\n\r\n/*\r\n * Sizes of alert\r\n */\r\nexport type AlertSize = 'extra-small' | 'small' | 'medium' | 'large' | 'extra-large' | 'gigantic';\r\n\r\nexport interface AlertProps {\r\n\tisOpen: boolean;\r\n\tonConfirm: () => void;\r\n\r\n\t/** The title renderer. If undefined, no title is rendered. */\r\n\trenderTitle?: () => React.ReactNode;\r\n\trenderContents: () => React.ReactNode;\r\n\tconfirmButtonText?: string;\r\n\tcolor?: AlertColor;\r\n\tsize?: AlertSize;\r\n\tclassName?: string;\r\n\toverflowVisible?: boolean;\r\n\ttestId?: string;\r\n}\r\n\r\nconst fancyModalSVGClass = 'fancy-modal__footer-icon-svg';\r\n\r\n/**\r\n * Reusable alert component that replaces browser alert().\r\n *\r\n * @class RocAlert\r\n * @extends {React.Component<AlertProps>}\r\n */\r\nclass Alert extends React.Component<AlertProps> {\r\n\tpublic static defaultProps = {\r\n\t\tcolor: 'default',\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\toverflowVisible = false,\r\n\t\t\tisOpen,\r\n\t\t\tonConfirm,\r\n\t\t\trenderTitle,\r\n\t\t\trenderContents,\r\n\t\t\tcolor,\r\n\t\t\tconfirmButtonText = 'OK',\r\n\t\t\tsize = 'small',\r\n\t\t\tclassName = '',\r\n\t\t\ttestId = null,\r\n\t\t} = this.props;\r\n\r\n\t\tlet buttonColor;\r\n\r\n\t\t// Set the button colors based on the alert's color.\r\n\t\tswitch (color) {\r\n\t\t\tcase 'default':\r\n\t\t\t\tbuttonColor = 'primary';\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'primary':\r\n\r\n\t\t\tcase 'info':\r\n\r\n\t\t\tcase 'success':\r\n\r\n\t\t\tcase 'warning':\r\n\r\n\t\t\tcase 'danger':\r\n\r\n\t\t\tdefault:\r\n\t\t\t\tbuttonColor = 'default';\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<Modal\r\n\t\t\t\tisOpen={isOpen}\r\n\t\t\t\ttoggle={onConfirm}\r\n\t\t\t\tclassName={classnames('fancy-modal', 'fancy-modal--' + color, 'fancy-modal--' + size, {\r\n\t\t\t\t\t[className]: className,\r\n\t\t\t\t\t'fancy-modal--overflow-visible': overflowVisible,\r\n\t\t\t\t})}\r\n\t\t\t>\r\n\t\t\t\t<ModalBody className=\"fancy-modal__body\" data-testid={testId ?? 'modal-body'}>\r\n\t\t\t\t\t<ModalClose toggle={onConfirm} />\r\n\t\t\t\t\t{renderTitle ? <h2 className=\"fancy-modal__title\">{renderTitle()}</h2> : null}\r\n\t\t\t\t\t<div className=\"fancy-modal__content\">{renderContents()}</div>\r\n\t\t\t\t\t<div className=\"fancy-modal__footer\">\r\n\t\t\t\t\t\t<div className=\"fancy-modal__footer-actions\">\r\n\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\tcolor={buttonColor}\r\n\t\t\t\t\t\t\t\tclassName=\"btn-modal-action fancy-modal__confirm-btn\"\r\n\t\t\t\t\t\t\t\tdata-testid=\"btn-modal-action-confirm\"\r\n\t\t\t\t\t\t\t\tonClick={onConfirm}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{confirmButtonText}\r\n\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div className=\"fancy-modal__footer-icon\">\r\n\t\t\t\t\t\t\t{this.props.color === 'default' ||\r\n\t\t\t\t\t\t\tthis.props.color === 'primary' ||\r\n\t\t\t\t\t\t\tthis.props.color === 'success' ? (\r\n\t\t\t\t\t\t\t\t<CheckSVG class={fancyModalSVGClass + ' fancy-modal__footer-icon-svg--success'} />\r\n\t\t\t\t\t\t\t) : this.props.color === 'info' ? (\r\n\t\t\t\t\t\t\t\t<InfoSVG class={fancyModalSVGClass + ' fancy-modal__footer-icon-svg--info'} />\r\n\t\t\t\t\t\t\t) : this.props.color === 'warning' ? (\r\n\t\t\t\t\t\t\t\t<ExclamationTriangleSVG\r\n\t\t\t\t\t\t\t\t\tclass={fancyModalSVGClass + ' fancy-modal__footer-icon-svg--warning'}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t) : this.props.color === 'danger' ? (\r\n\t\t\t\t\t\t\t\t<ExclamationCircleSVG\r\n\t\t\t\t\t\t\t\t\tclass={fancyModalSVGClass + ' fancy-modal__footer-icon-svg--danger'}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t<ExclamationCircleSVG class={fancyModalSVGClass + ' fancy-modal__footer-icon-svg'} />\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</ModalBody>\r\n\t\t\t</Modal>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Alert;\r\n","import * as React from 'react';\r\nimport { Alert } from 'reactstrap';\r\n\r\n/**\r\n * Success Props\r\n */\r\ninterface SuccessProps {\r\n\tmessage: string;\r\n}\r\n\r\n/**\r\n * Reusable Success Alert Component used by AdminErrorBoundary and Listing/Tree base components.\r\n *\r\n * @class Success\r\n * @extends {React.Component<any, any>}\r\n */\r\nclass Success extends React.Component<SuccessProps, any> {\r\n\tconstructor(props: SuccessProps) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<Alert color=\"success\">\r\n\t\t\t\t<h4>Success!</h4>\r\n\t\t\t\t{this.props.message}\r\n\t\t\t</Alert>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Success;\r\n","module.exports = {\n\tMODE_NUMBER :\t\t1 << 0,\n\tMODE_ALPHA_NUM : \t1 << 1,\n\tMODE_8BIT_BYTE : \t1 << 2,\n\tMODE_KANJI :\t\t1 << 3\n};\n","module.exports = {\n\tL : 1,\n\tM : 0,\n\tQ : 3,\n\tH : 2\n};\n\n","var math = require('./math');\n\nfunction QRPolynomial(num, shift) {\n\n\tif (num.length == undefined) {\n\t\tthrow new Error(num.length + \"/\" + shift);\n\t}\n\n\tvar offset = 0;\n\n\twhile (offset < num.length && num[offset] == 0) {\n\t\toffset++;\n\t}\n\n\tthis.num = new Array(num.length - offset + shift);\n\tfor (var i = 0; i < num.length - offset; i++) {\n\t\tthis.num[i] = num[i + offset];\n\t}\n}\n\nQRPolynomial.prototype = {\n\n\tget : function(index) {\n\t\treturn this.num[index];\n\t},\n\t\n\tgetLength : function() {\n\t\treturn this.num.length;\n\t},\n\t\n\tmultiply : function(e) {\n\t\n\t\tvar num = new Array(this.getLength() + e.getLength() - 1);\n\t\n\t\tfor (var i = 0; i < this.getLength(); i++) {\n\t\t\tfor (var j = 0; j < e.getLength(); j++) {\n\t\t\t\tnum[i + j] ^= math.gexp(math.glog(this.get(i) ) + math.glog(e.get(j) ) );\n\t\t\t}\n\t\t}\n\t\n\t\treturn new QRPolynomial(num, 0);\n\t},\n\t\n\tmod : function(e) {\n\t\n\t\tif (this.getLength() - e.getLength() < 0) {\n\t\t\treturn this;\n\t\t}\n\t\n\t\tvar ratio = math.glog(this.get(0) ) - math.glog(e.get(0) );\n\t\n\t\tvar num = new Array(this.getLength() );\n\t\t\n\t\tfor (var i = 0; i < this.getLength(); i++) {\n\t\t\tnum[i] = this.get(i);\n\t\t}\n\t\t\n\t\tfor (var i = 0; i < e.getLength(); i++) {\n\t\t\tnum[i] ^= math.gexp(math.glog(e.get(i) ) + ratio);\n\t\t}\n\t\n\t\t// recursive call\n\t\treturn new QRPolynomial(num, 0).mod(e);\n\t}\n};\n\nmodule.exports = QRPolynomial;\n","var QRMath = {\n\n\tglog : function(n) {\n\t\n\t\tif (n < 1) {\n\t\t\tthrow new Error(\"glog(\" + n + \")\");\n\t\t}\n\t\t\n\t\treturn QRMath.LOG_TABLE[n];\n\t},\n\t\n\tgexp : function(n) {\n\t\n\t\twhile (n < 0) {\n\t\t\tn += 255;\n\t\t}\n\t\n\t\twhile (n >= 256) {\n\t\t\tn -= 255;\n\t\t}\n\t\n\t\treturn QRMath.EXP_TABLE[n];\n\t},\n\t\n\tEXP_TABLE : new Array(256),\n\t\n\tLOG_TABLE : new Array(256)\n\n};\n\t\nfor (var i = 0; i < 8; i++) {\n\tQRMath.EXP_TABLE[i] = 1 << i;\n}\nfor (var i = 8; i < 256; i++) {\n\tQRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4]\n\t\t^ QRMath.EXP_TABLE[i - 5]\n\t\t^ QRMath.EXP_TABLE[i - 6]\n\t\t^ QRMath.EXP_TABLE[i - 8];\n}\nfor (var i = 0; i < 255; i++) {\n\tQRMath.LOG_TABLE[QRMath.EXP_TABLE[i] ] = i;\n}\n\nmodule.exports = QRMath;\n","import { AxiosError, AxiosResponse } from 'axios';\r\nimport ErrorAlert from 'components/shared/ErrorAlert';\r\nimport Spinner from 'components/shared/Spinner';\r\nimport * as React from 'react';\r\nimport { useEffect, useState } from 'react';\r\nimport { Link } from 'react-router-dom';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport entityDefinition from '../../Definition';\r\n\r\n/**\r\n * Recovery codes props\r\n */\r\ninterface RecoveryCodesProps {\r\n\tgenerate: boolean;\r\n\tonCancelClick: () => void;\r\n}\r\n\r\n/**\r\n * Recovery codes DTO\r\n */\r\ninterface RecoveryCodesDto {\r\n\trecoveryCodes: string[];\r\n}\r\n\r\n/**\r\n * Recovery codes component\r\n */\r\nfunction RecoveryCodes(props: RecoveryCodesProps) {\r\n\tconst [isLoading, setIsLoading] = useState(true);\r\n\tconst [error, setError] = useState<AxiosError | null>(null);\r\n\tconst [recoveryCodes, setRecoveryCodes] = useState<RecoveryCodesDto>({ recoveryCodes: new Array<string>() });\r\n\r\n\tuseEffect(() => {\r\n\t\t(async () => {\r\n\t\t\t// Load recovery codes data on load\r\n\t\t\tAxiosHelper.post(`${entityDefinition.baseAjaxRoute}/recovery-codes`, { generate: props.generate })\r\n\t\t\t\t.then((resp: AxiosResponse<RecoveryCodesDto>) => {\r\n\t\t\t\t\tsetRecoveryCodes(resp.data);\r\n\t\t\t\t\tsetIsLoading(false);\r\n\t\t\t\t})\r\n\t\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\t\tconsole.error('Unable to load data...');\r\n\t\t\t\t\tsetError(error);\r\n\t\t\t\t});\r\n\t\t})();\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, []);\r\n\r\n\tif (error) {\r\n\t\treturn <ErrorAlert error={error} />;\r\n\t}\r\n\r\n\tif (isLoading) {\r\n\t\treturn <Spinner />;\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<h3>Recovery Codes</h3>\r\n\t\t\t<div className=\"alert alert-warning\" role=\"alert\">\r\n\t\t\t\t<p>\r\n\t\t\t\t\t<span className=\"glyphicon glyphicon-warning-sign\" />\r\n\t\t\t\t\t<strong>Put these codes in a safe place.</strong>\r\n\t\t\t\t</p>\r\n\t\t\t\t<p>\r\n\t\t\t\t\tIf you lose your device and don&apos;t have the recovery codes you will lose access to your account.\r\n\t\t\t\t</p>\r\n\t\t\t</div>\r\n\t\t\t<div className=\"row\">\r\n\t\t\t\t<div className=\"col-md-12\">\r\n\t\t\t\t\t{recoveryCodes.recoveryCodes.map((val, i) => {\r\n\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t<div key={i}>\r\n\t\t\t\t\t\t\t\t<code className=\"recovery-code\" data-testid={`recovery-code-${i}`}>\r\n\t\t\t\t\t\t\t\t\t{val}\r\n\t\t\t\t\t\t\t\t</code>\r\n\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t})}\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t\t<br />\r\n\t\t\t<Link\r\n\t\t\t\tto=\"#\"\r\n\t\t\t\tclassName=\"btn-width-medium btn btn-outline-primary-alt\"\r\n\t\t\t\tdata-testid=\"leave-recovery-codes-btn\"\r\n\t\t\t\tonClick={props.onCancelClick}\r\n\t\t\t>\r\n\t\t\t\tLeave. I have these in a safe place.\r\n\t\t\t</Link>\r\n\t\t</>\r\n\t);\r\n}\r\n\r\nexport default RecoveryCodes;\r\n","import React from 'react';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Up chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction DownChevronSVG(props: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 60 32\"\r\n\t\t\tclassName={classnames('icon icon-down-chevron', props.class)}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t>\r\n\t\t\t<path d=\"M29.976 25.56l25.562-24.482c0.937-0.92 2.436-0.92 3.373 0 0.446 0.437 0.698 1.036 0.698 1.661s-0.252 1.224-0.698 1.661l-27.243 26.844c-0.936 0.92-2.436 0.92-3.373 0l-27.243-26.844c-0.447-0.437-0.699-1.036-0.699-1.661s0.252-1.224 0.699-1.661c0.937-0.92 2.436-0.92 3.373 0l25.551 24.482z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nexport default DownChevronSVG;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Lightning Icon SVG\r\n *\r\n * @returns\r\n */\r\nfunction LightningSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 23 32\"\r\n\t\t\tclassName={'icon icon-lightning ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t>\r\n\t\t\t<path d=\"M13.26 12l2.68-10.279c0.039-0.119 0.061-0.256 0.061-0.399 0-0.728-0.588-1.319-1.315-1.322h-0c-0.002 0-0.005-0-0.007-0-0.409 0-0.773 0.189-1.011 0.485l-0.002 0.003-13.379 17.353c-0.179 0.224-0.287 0.511-0.287 0.823 0 0.001 0 0.002 0 0.003v-0c0.002 0.736 0.598 1.331 1.333 1.334h8.073l-2.68 10.279c-0.038 0.117-0.060 0.252-0.060 0.392 0 0.003 0 0.006 0 0.009v-0c0 0.73 0.592 1.322 1.322 1.322v0c0.002 0 0.005 0 0.007 0 0.409 0 0.773-0.189 1.011-0.485l0.002-0.003 13.372-17.348c0.179-0.224 0.287-0.511 0.287-0.823 0-0.004 0-0.007-0-0.011v0.001c-0.002-0.736-0.598-1.331-1.333-1.334h-8.073z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nLightningSVG.defaultProps = { class: '' };\r\n\r\nexport default LightningSVG;\r\n","import * as React from 'react';\r\n/**\r\n * Shared SVG\r\n *\r\n * @returns\r\n */\r\nfunction SharedSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg viewBox=\"0 0 24 24\" className={'icon icon-shared ' + svgProps.class} focusable=\"false\" aria-hidden=\"true\">\r\n\t\t\t<path d=\"M12 1.6c2.209 0 4 1.791 4 4l-0.006 0.157c2.853 1.455 4.806 4.421 4.806 7.843 0 0.514-0.044 1.019-0.129 1.509 1.044 0.719 1.729 1.925 1.729 3.291 0 2.209-1.791 4-4 4-0.957 0-1.836-0.336-2.525-0.897-1.169 0.575-2.484 0.897-3.875 0.897s-2.707-0.323-3.876-0.897c-0.688 0.561-1.567 0.897-2.524 0.897-2.209 0-4-1.791-4-4 0-1.366 0.685-2.572 1.729-3.293-0.085-0.488-0.129-0.992-0.129-1.507 0-3.422 1.953-6.388 4.806-7.843-0.005-0.051-0.006-0.104-0.006-0.157 0-2.209 1.791-4 4-4zM18.4 16.4c-1.105 0-2 0.895-2 2s0.895 2 2 2c1.105 0 2-0.895 2-2s-0.895-2-2-2zM5.6 16.4c-1.105 0-2 0.895-2 2s0.895 2 2 2c1.105 0 2-0.895 2-2s-0.895-2-2-2zM14.905 8.349l-0.165 0.165c-0.716 0.673-1.68 1.086-2.74 1.086-1.144 0-2.176-0.48-2.905-1.25-1.846 1.022-3.095 2.99-3.095 5.25 0 0.281 0.019 0.558 0.057 0.828 1.995 0.226 3.543 1.918 3.543 3.972 0 0.23-0.019 0.455-0.056 0.673 0.748 0.339 1.58 0.527 2.456 0.527s1.709-0.188 2.459-0.526c-0.040-0.22-0.059-0.445-0.059-0.674 0-2.054 1.548-3.746 3.541-3.974 0.040-0.269 0.059-0.545 0.059-0.826 0-2.26-1.249-4.228-3.095-5.251zM12 3.6c-1.105 0-2 0.895-2 2s0.895 2 2 2c1.105 0 2-0.895 2-2s-0.895-2-2-2z\"></path>\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nSharedSVG.defaultProps = { class: '' };\r\n\r\nexport default SharedSVG;\r\n","import React from 'react';\r\nimport classnames from 'classnames';\r\n\r\n/**\r\n * Up chevron SVG\r\n *\r\n * @returns\r\n */\r\nfunction UpChevronSVG(props: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 60 32\"\r\n\t\t\tclassName={classnames('icon icon-up-chevron ', props.class)}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t>\r\n\t\t\t<path d=\"M30.024 6.44l-25.562 24.482c-0.937 0.92-2.436 0.92-3.373 0-0.446-0.437-0.698-1.036-0.698-1.661s0.252-1.224 0.698-1.661l27.243-26.844c0.936-0.92 2.436-0.92 3.373 0l27.243 26.844c0.447 0.437 0.699 1.036 0.699 1.661s-0.252 1.224-0.699 1.661c-0.937 0.92-2.436 0.92-3.373 0l-25.551-24.482z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nexport default UpChevronSVG;\r\n","import AppState from 'AppState';\r\nimport { InputProps } from 'components/shared/edit/fields';\r\nimport ListingStatusDisplay from 'components/shared/list/ListingStatusDisplay';\r\nimport DownChevronSVG from 'components/shared/svg/DownChevronSVG';\r\nimport LightningSVG from 'components/shared/svg/LightningSVG';\r\nimport SharedSVG from 'components/shared/svg/SharedSVG';\r\nimport UpChevronSVG from 'components/shared/svg/UpChevronSVG';\r\nimport TooltipWrapper from 'components/shared/tooltip/TooltipWrapper';\r\nimport * as React from 'react';\r\nimport { Field, FieldRenderProps } from 'react-final-form';\r\nimport { Button, Label } from 'reactstrap';\r\nimport { AppCulture } from 'types';\r\nimport BaseDto from 'types/__models__/BaseDto';\r\nimport { stripHtml } from 'util/StringUtil';\r\nimport { FallbackValueDisplayMode } from '../TranslatedField';\r\nimport withEditContext, { HasEditContext } from '../withEditContext';\r\nimport RequiredFieldMarker from './RequiredFieldMarker';\r\nimport classnames from 'classnames';\r\nimport RocTitle from '../../RocTitle';\r\n\r\nexport type FieldLabelProps = FieldRenderProps<any, HTMLInputElement> &\r\n\tInputProps &\r\n\tHasEditContext & {\r\n\t\tlabel: string;\r\n\t\tname: string;\r\n\t\tid?: string;\r\n\t\tsubLabel?: string;\r\n\t\tisRequired: boolean;\r\n\t\thtmlFor?: string;\r\n\t\tchildren?: React.ReactNode;\r\n\t\tisPowerUser: boolean;\r\n\t\tforceEmptyLabel: boolean;\r\n\t\tlabelElementHidden?: boolean;\r\n\t\tlabelClassName?: string;\r\n\t\tisShared?: boolean;\r\n\t\ttranslatedFieldName?: string;\r\n\t\tprimaryCulture?: AppCulture;\r\n\t\tfallbackValueDisplayMode?: FallbackValueDisplayMode;\r\n\t\tfallbackValueOverride?: string;\r\n\t\tdto?: BaseDto;\r\n\t};\r\n\r\ninterface FieldLabelState {\r\n\tdisplayFallbackValue: boolean;\r\n}\r\n\r\n/**\r\n * Wrapper component for all field labels for ease of use.\r\n *\r\n * @class FieldLabel\r\n * @extends {React.Component<FieldRenderProps & InputProps>}\r\n */\r\nclass FieldLabel extends React.Component<FieldLabelProps, FieldLabelState> {\r\n\tprivate sharedContainerRef;\r\n\r\n\tprotected static defaultProps = {\r\n\t\tisTooltipEditMode: false,\r\n\t\thideTooltip: false,\r\n\t\tisShared: true,\r\n\t\tlabelElementHidden: false,\r\n\t\tlabelClassName: '',\r\n\t};\r\n\r\n\tprivate titleContainerRef;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.sharedContainerRef = React.createRef();\r\n\r\n\t\tthis.titleContainerRef = React.createRef();\r\n\r\n\t\tthis.state = {\r\n\t\t\tdisplayFallbackValue: false,\r\n\t\t};\r\n\t}\r\n\r\n\tpublic shouldComponentUpdate(nextProps: FieldLabelProps, nextState: FieldLabelState) {\r\n\t\tconst {\r\n\t\t\tlabel,\r\n\t\t\tisRequired,\r\n\t\t\tinput,\r\n\t\t\teditContext: { tooltipData, hasTooltipError },\r\n\t\t\thtmlFor,\r\n\t\t\tchildren,\r\n\t\t\thideTooltip,\r\n\t\t} = this.props;\r\n\r\n\t\treturn (\r\n\t\t\tnextProps.dto !== this.props.dto ||\r\n\t\t\tnextProps.label !== label ||\r\n\t\t\tnextProps.isRequired !== isRequired ||\r\n\t\t\t(nextProps.input && nextProps.input.name) !== (input && input.name) ||\r\n\t\t\tnextProps.editContext.tooltipData !== tooltipData ||\r\n\t\t\tnextProps.editContext.hasTooltipError !== hasTooltipError ||\r\n\t\t\tnextProps.htmlFor !== htmlFor ||\r\n\t\t\tnextProps.children !== children ||\r\n\t\t\tnextProps.hideTooltip !== hideTooltip ||\r\n\t\t\tnextState.displayFallbackValue !== this.state.displayFallbackValue\r\n\t\t);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tlabel,\r\n\t\t\tname,\r\n\t\t\tsubLabel,\r\n\t\t\tisRequired,\r\n\t\t\tinput,\r\n\t\t\teditContext: { tooltipData, hasTooltipError, entityDefinition },\r\n\t\t\thtmlFor,\r\n\t\t\tchildren,\r\n\t\t\thideTooltip,\r\n\t\t\tisPowerUser,\r\n\t\t\tforceEmptyLabel,\r\n\t\t\tlabelElementHidden,\r\n\t\t\tlabelClassName,\r\n\t\t\tisShared,\r\n\t\t\ttranslatedFieldName,\r\n\t\t\tprimaryCulture,\r\n\t\t\tfallbackValueDisplayMode = FallbackValueDisplayMode.Inline,\r\n\t\t\tfallbackValueOverride,\r\n\t\t\tdto,\r\n\t\t\tmeta,\r\n\t\t\ttranslatedFieldValue,\r\n\t\t} = this.props;\r\n\r\n\t\tif (!forceEmptyLabel && (!label || !label.trim())) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tconst isTooltipEditMode = AppState?.user?.isTooltipEditMode ?? false;\r\n\r\n\t\tlet tooltipText = '';\r\n\t\tlet nameValue = '';\r\n\r\n\t\tif (input && input.name) {\r\n\t\t\tnameValue = input.name;\r\n\t\t} else if (name) {\r\n\t\t\tnameValue = name;\r\n\t\t} else {\r\n\t\t\tnameValue = label.toLowerCase();\r\n\t\t}\r\n\r\n\t\tif (nameValue) {\r\n\t\t\tconst fieldTooltip = tooltipData && tooltipData[nameValue] && tooltipData[nameValue].fieldTooltip;\r\n\t\t\tconst universalTooltip = tooltipData && tooltipData[nameValue] && tooltipData[nameValue].universalTooltip;\r\n\t\t\ttooltipText =\r\n\t\t\t\tfieldTooltip && fieldTooltip.text ? fieldTooltip.text : universalTooltip ? universalTooltip.text : '';\r\n\t\t}\r\n\r\n\t\tconst toggleIconClass = 'translated-field__toggle-icon';\r\n\r\n\t\treturn (\r\n\t\t\t<>\r\n\t\t\t\t<Label\r\n\t\t\t\t\tclassName={classnames({\r\n\t\t\t\t\t\t'visually-hidden': labelElementHidden,\r\n\t\t\t\t\t})}\r\n\t\t\t\t\tfor={htmlFor}\r\n\t\t\t\t>\r\n\t\t\t\t\t<span className={`form-label-icon-wrapper${forceEmptyLabel ? ' visually-hidden' : ''}`}>\r\n\t\t\t\t\t\t<span\r\n\t\t\t\t\t\t\tclassName={classnames('form-label-text', {\r\n\t\t\t\t\t\t\t\t[`${labelClassName}`]: labelClassName,\r\n\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t{label}\r\n\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t{isRequired ? <RequiredFieldMarker /> : null}\r\n\t\t\t\t\t\t<div className=\"tooltip__row\">\r\n\t\t\t\t\t\t\t{dto ? (\r\n\t\t\t\t\t\t\t\t<div className=\"tooltip__item\">\r\n\t\t\t\t\t\t\t\t\t<ListingStatusDisplay entityDefinition={entityDefinition} record={dto} />\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t{isPowerUser ? (\r\n\t\t\t\t\t\t\t\t<div className=\"tooltip__item\">\r\n\t\t\t\t\t\t\t\t\t<RocTitle label=\"Power user field\">\r\n\t\t\t\t\t\t\t\t\t\t<span ref={this.titleContainerRef}>\r\n\t\t\t\t\t\t\t\t\t\t\t<LightningSVG class=\"form-label-icon\" />\r\n\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t</RocTitle>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t{isShared && entityDefinition && entityDefinition.localizeMode ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t<RocTitle label=\"Shared Field\" alignment=\"left\">\r\n\t\t\t\t\t\t\t\t\t\t<div className=\"tooltip__item\">\r\n\t\t\t\t\t\t\t\t\t\t\t<SharedSVG class=\"tooltip__edit-icon tooltip__edit-icon--big tooltip__edit-icon--primary\" />\r\n\t\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t\t</RocTitle>\r\n\r\n\t\t\t\t\t\t\t\t\t<span className=\"visually-hidden\">Shared Field</span>\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t<TooltipWrapper\r\n\t\t\t\t\t\t\t\thideTooltip={hideTooltip}\r\n\t\t\t\t\t\t\t\thasTooltipError={hasTooltipError}\r\n\t\t\t\t\t\t\t\ttooltipText={tooltipText}\r\n\t\t\t\t\t\t\t\tnameValue={nameValue}\r\n\t\t\t\t\t\t\t\tisTooltipEditMode={isTooltipEditMode}\r\n\t\t\t\t\t\t\t\ttooltipData={tooltipData}\r\n\t\t\t\t\t\t\t\tentityDefinition={entityDefinition}\r\n\t\t\t\t\t\t\t\tlabel={this.props.label}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</span>{' '}\r\n\t\t\t\t\t{subLabel && <div className=\"text-small\">{subLabel}</div>}\r\n\t\t\t\t\t{children ? children : null}\r\n\t\t\t\t</Label>\r\n\t\t\t\t{translatedFieldName && fallbackValueDisplayMode !== FallbackValueDisplayMode.Hidden ? (\r\n\t\t\t\t\tfallbackValueDisplayMode === FallbackValueDisplayMode.Inline ? (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{translatedFieldName && primaryCulture ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t\t{primaryCulture.name} ({primaryCulture.code}):{' '}\r\n\t\t\t\t\t\t\t\t\t{!translatedFieldValue && meta.dirty ? '<No Value>' : null}\r\n\t\t\t\t\t\t\t\t\t<Field name={translatedFieldName}>\r\n\t\t\t\t\t\t\t\t\t\t{({ input: { value } }) =>\r\n\t\t\t\t\t\t\t\t\t\t\tfallbackValueOverride ? <>{fallbackValueOverride}</> : <>{value}</>\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t</Field>\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t) : (\r\n\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t{/* \r\n\t\t\t\t\t\t\t  The fallback value toggle is generally used for fields with very large values. \r\n\t\t\t\t\t\t\t  Out of the box this is only WYSIWYG fields \r\n\t\t\t\t\t\t\t*/}\r\n\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\tcolor=\"link\"\r\n\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\tthis.setState((prevState) => ({\r\n\t\t\t\t\t\t\t\t\t\tdisplayFallbackValue: !prevState.displayFallbackValue,\r\n\t\t\t\t\t\t\t\t\t}));\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{this.state.displayFallbackValue ? 'Hide' : 'View'} {primaryCulture!.name} (\r\n\t\t\t\t\t\t\t\t{primaryCulture!.code}) Translation{' '}\r\n\t\t\t\t\t\t\t\t{this.state.displayFallbackValue ? (\r\n\t\t\t\t\t\t\t\t\t<UpChevronSVG class={toggleIconClass} />\r\n\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t<DownChevronSVG class={toggleIconClass} />\r\n\t\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t{this.state.displayFallbackValue && translatedFieldName ? (\r\n\t\t\t\t\t\t\t\t<div className=\"translated-field__fallback\">\r\n\t\t\t\t\t\t\t\t\t<Field name={translatedFieldName}>\r\n\t\t\t\t\t\t\t\t\t\t{({ input: { value } }) =>\r\n\t\t\t\t\t\t\t\t\t\t\tfallbackValueOverride ? (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<>{stripHtml(fallbackValueOverride)}</>\r\n\t\t\t\t\t\t\t\t\t\t\t) : (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<>{stripHtml(value)}</>\r\n\t\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t</Field>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t</>\r\n\t\t\t\t\t)\r\n\t\t\t\t) : null}\r\n\t\t\t</>\r\n\t\t);\r\n\t}\r\n}\r\n\r\n// wrapped component type needed for tests\r\nexport class FieldLabelWrapped extends FieldLabel {}\r\n\r\nexport default withEditContext(FieldLabel);\r\n","import React from 'react';\r\nimport { Button } from 'reactstrap';\r\n\r\ninterface EnableDuoButtonProps {\r\n\tsetActivated: (activated: boolean) => void;\r\n}\r\n\r\n/**\r\n * Enable Duo 2FA provider button\r\n */\r\nexport default function EnableDuoButton(props: EnableDuoButtonProps) {\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<Button\r\n\t\t\t\tcolor=\"primary\"\r\n\t\t\t\tonClick={() => {\r\n\t\t\t\t\tprops.setActivated(true);\r\n\t\t\t\t\twindow.location.href = '/duo-setup';\r\n\t\t\t\t}}\r\n\t\t\t>\r\n\t\t\t\tAdd Duo authenticator\r\n\t\t\t</Button>\r\n\t\t</>\r\n\t);\r\n}\r\n","'use strict';\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar React = require('react');\n\nvar PropTypes = require('prop-types'); // qr.js doesn't handle error level of zero (M) so we need to do it right,\n// thus the deep require.\n\n\nvar QRCodeImpl = require('qr.js/lib/QRCode');\n\nvar ErrorCorrectLevel = require('qr.js/lib/ErrorCorrectLevel'); // Convert from UTF-16, forcing the use of byte-mode encoding in our QR Code.\n// This allows us to encode Hanji, Kanji, emoji, etc. Ideally we'd do more\n// detection and not resort to byte-mode if possible, but we're trading off\n// a smaller library for a smaller amount of data we can potentially encode.\n// Based on http://jonisalonen.com/2012/from-utf-16-to-utf-8-in-javascript/\n\n\nfunction convertStr(str) {\n  var out = '';\n\n  for (var i = 0; i < str.length; i++) {\n    var charcode = str.charCodeAt(i);\n\n    if (charcode < 0x0080) {\n      out += String.fromCharCode(charcode);\n    } else if (charcode < 0x0800) {\n      out += String.fromCharCode(0xc0 | charcode >> 6);\n      out += String.fromCharCode(0x80 | charcode & 0x3f);\n    } else if (charcode < 0xd800 || charcode >= 0xe000) {\n      out += String.fromCharCode(0xe0 | charcode >> 12);\n      out += String.fromCharCode(0x80 | charcode >> 6 & 0x3f);\n      out += String.fromCharCode(0x80 | charcode & 0x3f);\n    } else {\n      // This is a surrogate pair, so we'll reconsitute the pieces and work\n      // from that\n      i++;\n      charcode = 0x10000 + ((charcode & 0x3ff) << 10 | str.charCodeAt(i) & 0x3ff);\n      out += String.fromCharCode(0xf0 | charcode >> 18);\n      out += String.fromCharCode(0x80 | charcode >> 12 & 0x3f);\n      out += String.fromCharCode(0x80 | charcode >> 6 & 0x3f);\n      out += String.fromCharCode(0x80 | charcode & 0x3f);\n    }\n  }\n\n  return out;\n}\n\nvar DEFAULT_PROPS = {\n  size: 128,\n  level: 'L',\n  bgColor: '#FFFFFF',\n  fgColor: '#000000',\n  includeMargin: false\n};\nvar PROP_TYPES = {\n  value: PropTypes.string.isRequired,\n  size: PropTypes.number,\n  level: PropTypes.oneOf(['L', 'M', 'Q', 'H']),\n  bgColor: PropTypes.string,\n  fgColor: PropTypes.string,\n  includeMargin: PropTypes.bool\n};\nvar MARGIN_SIZE = 4;\n\nfunction generatePath(modules) {\n  var margin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n  var ops = [];\n  modules.forEach(function (row, y) {\n    var start = null;\n    row.forEach(function (cell, x) {\n      if (!cell && start !== null) {\n        // M0 0h7v1H0z injects the space with the move and drops the comma,\n        // saving a char per operation\n        ops.push(\"M\".concat(start + margin, \" \").concat(y + margin, \"h\").concat(x - start, \"v1H\").concat(start + margin, \"z\"));\n        start = null;\n        return;\n      } // end of row, clean up or skip\n\n\n      if (x === row.length - 1) {\n        if (!cell) {\n          // We would have closed the op above already so this can only mean\n          // 2+ light modules in a row.\n          return;\n        }\n\n        if (start === null) {\n          // Just a single dark module.\n          ops.push(\"M\".concat(x + margin, \",\").concat(y + margin, \" h1v1H\").concat(x + margin, \"z\"));\n        } else {\n          // Otherwise finish the current line.\n          ops.push(\"M\".concat(start + margin, \",\").concat(y + margin, \" h\").concat(x + 1 - start, \"v1H\").concat(start + margin, \"z\"));\n        }\n\n        return;\n      }\n\n      if (cell && start === null) {\n        start = x;\n      }\n    });\n  });\n  return ops.join('');\n} // For canvas we're going to switch our drawing mode based on whether or not\n// the environment supports Path2D. We only need the constructor to be\n// supported, but Edge doesn't actually support the path (string) type\n// argument. Luckily it also doesn't support the addPath() method. We can\n// treat that as the same thing.\n\n\nvar SUPPORTS_PATH2D = function () {\n  try {\n    new Path2D().addPath(new Path2D());\n  } catch (e) {\n    return false;\n  }\n\n  return true;\n}();\n\nvar QRCodeCanvas =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n  _inherits(QRCodeCanvas, _React$PureComponent);\n\n  function QRCodeCanvas() {\n    var _getPrototypeOf2;\n\n    var _this;\n\n    _classCallCheck(this, QRCodeCanvas);\n\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(QRCodeCanvas)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n    _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"_canvas\", void 0);\n\n    return _this;\n  }\n\n  _createClass(QRCodeCanvas, [{\n    key: \"componentDidMount\",\n    value: function componentDidMount() {\n      this.update();\n    }\n  }, {\n    key: \"componentDidUpdate\",\n    value: function componentDidUpdate() {\n      this.update();\n    }\n  }, {\n    key: \"update\",\n    value: function update() {\n      var _this$props = this.props,\n          value = _this$props.value,\n          size = _this$props.size,\n          level = _this$props.level,\n          bgColor = _this$props.bgColor,\n          fgColor = _this$props.fgColor,\n          includeMargin = _this$props.includeMargin; // We'll use type===-1 to force QRCode to automatically pick the best type\n\n      var qrcode = new QRCodeImpl(-1, ErrorCorrectLevel[level]);\n      qrcode.addData(convertStr(value));\n      qrcode.make();\n\n      if (this._canvas != null) {\n        var canvas = this._canvas;\n        var ctx = canvas.getContext('2d');\n\n        if (!ctx) {\n          return;\n        }\n\n        var cells = qrcode.modules;\n\n        if (cells === null) {\n          return;\n        }\n\n        var margin = includeMargin ? MARGIN_SIZE : 0;\n        var numCells = cells.length + margin * 2; // We're going to scale this so that the number of drawable units\n        // matches the number of cells. This avoids rounding issues, but does\n        // result in some potentially unwanted single pixel issues between\n        // blocks, only in environments that don't support Path2D.\n\n        var pixelRatio = window.devicePixelRatio || 1;\n        canvas.height = canvas.width = size * pixelRatio;\n        var scale = size / numCells * pixelRatio;\n        ctx.scale(scale, scale); // Draw solid background, only paint dark modules.\n\n        ctx.fillStyle = bgColor;\n        ctx.fillRect(0, 0, numCells, numCells);\n        ctx.fillStyle = fgColor;\n\n        if (SUPPORTS_PATH2D) {\n          // $FlowFixMe: Path2D c'tor doesn't support args yet.\n          ctx.fill(new Path2D(generatePath(cells, margin)));\n        } else {\n          cells.forEach(function (row, rdx) {\n            row.forEach(function (cell, cdx) {\n              if (cell) {\n                ctx.fillRect(cdx + margin, rdx + margin, 1, 1);\n              }\n            });\n          });\n        }\n      }\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this2 = this;\n\n      var _this$props2 = this.props,\n          value = _this$props2.value,\n          size = _this$props2.size,\n          level = _this$props2.level,\n          bgColor = _this$props2.bgColor,\n          fgColor = _this$props2.fgColor,\n          style = _this$props2.style,\n          includeMargin = _this$props2.includeMargin,\n          otherProps = _objectWithoutProperties(_this$props2, [\"value\", \"size\", \"level\", \"bgColor\", \"fgColor\", \"style\", \"includeMargin\"]);\n\n      var canvasStyle = _objectSpread({\n        height: size,\n        width: size\n      }, style);\n\n      return React.createElement(\"canvas\", _extends({\n        style: canvasStyle,\n        height: size,\n        width: size,\n        ref: function ref(_ref) {\n          return _this2._canvas = _ref;\n        }\n      }, otherProps));\n    }\n  }]);\n\n  return QRCodeCanvas;\n}(React.PureComponent);\n\n_defineProperty(QRCodeCanvas, \"defaultProps\", DEFAULT_PROPS);\n\n_defineProperty(QRCodeCanvas, \"propTypes\", PROP_TYPES);\n\nvar QRCodeSVG =\n/*#__PURE__*/\nfunction (_React$PureComponent2) {\n  _inherits(QRCodeSVG, _React$PureComponent2);\n\n  function QRCodeSVG() {\n    _classCallCheck(this, QRCodeSVG);\n\n    return _possibleConstructorReturn(this, _getPrototypeOf(QRCodeSVG).apply(this, arguments));\n  }\n\n  _createClass(QRCodeSVG, [{\n    key: \"render\",\n    value: function render() {\n      var _this$props3 = this.props,\n          value = _this$props3.value,\n          size = _this$props3.size,\n          level = _this$props3.level,\n          bgColor = _this$props3.bgColor,\n          fgColor = _this$props3.fgColor,\n          includeMargin = _this$props3.includeMargin,\n          otherProps = _objectWithoutProperties(_this$props3, [\"value\", \"size\", \"level\", \"bgColor\", \"fgColor\", \"includeMargin\"]); // We'll use type===-1 to force QRCode to automatically pick the best type\n\n\n      var qrcode = new QRCodeImpl(-1, ErrorCorrectLevel[level]);\n      qrcode.addData(convertStr(value));\n      qrcode.make();\n      var cells = qrcode.modules;\n\n      if (cells === null) {\n        return null;\n      }\n\n      var margin = includeMargin ? MARGIN_SIZE : 0; // Drawing strategy: instead of a rect per module, we're going to create a\n      // single path for the dark modules and layer that on top of a light rect,\n      // for a total of 2 DOM nodes. We pay a bit more in string concat but that's\n      // way faster than DOM ops.\n      // For level 1, 441 nodes -> 2\n      // For level 40, 31329 -> 2\n\n      var fgPath = generatePath(cells, margin);\n      var numCells = cells.length + margin * 2;\n      return React.createElement(\"svg\", _extends({\n        shapeRendering: \"crispEdges\",\n        height: size,\n        width: size,\n        viewBox: \"0 0 \".concat(numCells, \" \").concat(numCells)\n      }, otherProps), React.createElement(\"path\", {\n        fill: bgColor,\n        d: \"M0,0 h\".concat(numCells, \"v\").concat(numCells, \"H0z\")\n      }), React.createElement(\"path\", {\n        fill: fgColor,\n        d: fgPath\n      }));\n    }\n  }]);\n\n  return QRCodeSVG;\n}(React.PureComponent);\n\n_defineProperty(QRCodeSVG, \"defaultProps\", DEFAULT_PROPS);\n\n_defineProperty(QRCodeSVG, \"propTypes\", PROP_TYPES);\n\nvar QRCode = function QRCode(props) {\n  var renderAs = props.renderAs,\n      otherProps = _objectWithoutProperties(props, [\"renderAs\"]);\n\n  var Component = renderAs === 'svg' ? QRCodeSVG : QRCodeCanvas;\n  return React.createElement(Component, otherProps);\n};\n\nQRCode.defaultProps = _objectSpread({\n  renderAs: 'canvas'\n}, DEFAULT_PROPS);\nmodule.exports = QRCode;","import { AxiosError, AxiosResponse } from 'axios';\r\nimport Confirm from 'components/shared/Confirm';\r\nimport { EditErrorOnSaveAlert } from 'components/shared/edit';\r\nimport { TextBox } from 'components/shared/edit/fields';\r\nimport ErrorAlert from 'components/shared/ErrorAlert';\r\nimport Spinner from 'components/shared/Spinner';\r\nimport Success from 'components/shared/Success';\r\nimport QRCode from 'qrcode.react';\r\nimport * as React from 'react';\r\nimport { useEffect, useState } from 'react';\r\nimport { Field, Form } from 'react-final-form';\r\nimport { Link } from 'react-router-dom';\r\nimport NavigationPrompt from 'react-router-navigation-prompt';\r\nimport { Button } from 'reactstrap';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { handleAxiosErrorWithValidation } from 'util/Misc';\r\nimport { WithTestId } from 'shared-client/types/test';\r\nimport entityDefinition from '../../Definition';\r\nimport ValidationErrorAlert, { AlertType } from '~/components/shared/edit/ValidationErrorAlert';\r\n\r\ninterface EnableAuthenticatorProps {\r\n\tafterSubmit: (generateCodes: boolean) => void;\r\n\tonCancelClick: () => void;\r\n}\r\n\r\n/**\r\n * Enable Authenticator DTO\r\n */\r\ninterface EnableAuthenticatorDto {\r\n\tsharedKey: string;\r\n\tauthenticatorUri: string;\r\n\tcode: string;\r\n\tstatusMessage: string;\r\n}\r\n\r\n/**\r\n * Component that handles setting up a TOTP authenticator app (like Google Authenticator)\r\n */\r\nfunction EnableAuthenticator(props: EnableAuthenticatorProps) {\r\n\tconst [isLoading, setIsLoading] = useState(true);\r\n\tconst [error, setError] = useState<AxiosError | null>(null);\r\n\tconst [authenticatorValues, setAuthenticatorValues] = useState<EnableAuthenticatorDto>({\r\n\t\tauthenticatorUri: '',\r\n\t\tcode: '',\r\n\t\tsharedKey: '',\r\n\t\tstatusMessage: '',\r\n\t});\r\n\r\n\tconst testId = 'enable-authenticator';\r\n\r\n\tuseEffect(() => {\r\n\t\t(async () => {\r\n\t\t\t// Load enable authenticator data\r\n\t\t\tawait AxiosHelper.get(`${entityDefinition.baseAjaxRoute}/enable-totp-authenticator`)\r\n\t\t\t\t.then((resp: AxiosResponse<EnableAuthenticatorDto>) => {\r\n\t\t\t\t\tsetAuthenticatorValues(resp.data);\r\n\t\t\t\t\tsetIsLoading(false);\r\n\t\t\t\t})\r\n\t\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\t\tsetError(error);\r\n\t\t\t\t});\r\n\t\t})();\r\n\t}, []);\r\n\r\n\t/**\r\n\t * Save enable authenticator data\r\n\t */\r\n\tconst save = (formValues: any): Promise<void | Record<string, unknown>> => {\r\n\t\tconst values = { ...formValues };\r\n\r\n\t\t// a promise must be returned for react-final-form.\r\n\t\treturn AxiosHelper.post(`${entityDefinition.baseAjaxRoute}/enable-totp-authenticator`, values)\r\n\t\t\t.then((resp: AxiosResponse<any>) => {\r\n\t\t\t\tsetError(null);\r\n\t\t\t\tprops.afterSubmit(resp.data.generateCodes);\r\n\t\t\t\treturn;\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\treturn handleAxiosErrorWithValidation(error);\r\n\t\t\t});\r\n\t};\r\n\r\n\tif (error) {\r\n\t\treturn <ErrorAlert error={error} />;\r\n\t}\r\n\r\n\tif (isLoading) {\r\n\t\treturn <Spinner />;\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{authenticatorValues.statusMessage ? <Success message={authenticatorValues.statusMessage} /> : null}\r\n\t\t\t<h3>Enable Authenticator</h3>\r\n\t\t\t<div>\r\n\t\t\t\t<p>To use an authenticator app go through the following steps:</p>\r\n\t\t\t\t<ol className=\"list\">\r\n\t\t\t\t\t<li>\r\n\t\t\t\t\t\t<p>\r\n\t\t\t\t\t\t\tDownload a two-factor authenticator app like Microsoft Authenticator for{' '}\r\n\t\t\t\t\t\t\t<a href=\"https://go.microsoft.com/fwlink/?Linkid=825071\">Windows Phone</a>,{' '}\r\n\t\t\t\t\t\t\t<a href=\"https://go.microsoft.com/fwlink/?Linkid=825072\">Android</a> and{' '}\r\n\t\t\t\t\t\t\t<a href=\"https://go.microsoft.com/fwlink/?Linkid=825073\">iOS</a> or Google Authenticator for{' '}\r\n\t\t\t\t\t\t\t<a href=\"https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&amp;hl=en\">\r\n\t\t\t\t\t\t\t\tAndroid\r\n\t\t\t\t\t\t\t</a>{' '}\r\n\t\t\t\t\t\t\tand <a href=\"https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8\">iOS</a>.\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t\t\t\t<p>\r\n\t\t\t\t\t\t\tScan the QR Code or enter this key{' '}\r\n\t\t\t\t\t\t\t<kbd data-testid={`${testId}-authenticator-key`}>{authenticatorValues.sharedKey}</kbd> into\r\n\t\t\t\t\t\t\tyour two factor authenticator app. Spaces and casing do not matter.\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t<QRCode data-testid={`${testId}-qrcode`} value={authenticatorValues.authenticatorUri} />\r\n\t\t\t\t\t</li>\r\n\t\t\t\t\t<li>\r\n\t\t\t\t\t\t<p>\r\n\t\t\t\t\t\t\tOnce you have scanned the QR code or input the key above, your two factor authentication app\r\n\t\t\t\t\t\t\twill provide you with a unique code. Enter the code in the confirmation box below.\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t<div className=\"row\">\r\n\t\t\t\t\t\t\t<div className=\"col-md-11\">\r\n\t\t\t\t\t\t\t\t<CodeEntryForm\r\n\t\t\t\t\t\t\t\t\ttestId={testId}\r\n\t\t\t\t\t\t\t\t\tauthenticatorValues={authenticatorValues}\r\n\t\t\t\t\t\t\t\t\tonSubmit={save}\r\n\t\t\t\t\t\t\t\t\tonCancelClick={props.onCancelClick}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</li>\r\n\t\t\t\t</ol>\r\n\t\t\t</div>\r\n\t\t</>\r\n\t);\r\n}\r\n\r\ninterface CodeEntryFormProps extends WithTestId {\r\n\tauthenticatorValues: EnableAuthenticatorDto;\r\n\tonSubmit: (formValues: any) => void;\r\n\tonCancelClick: () => void;\r\n}\r\n\r\n/**\r\n * Form used to handle 2FA validation code entry\r\n */\r\nfunction CodeEntryForm(props: CodeEntryFormProps) {\r\n\treturn (\r\n\t\t<Form\r\n\t\t\tinitialValues={props.authenticatorValues}\r\n\t\t\tonSubmit={props.onSubmit}\r\n\t\t\tsubscription={{\r\n\t\t\t\tdirty: true,\r\n\t\t\t\tsubmitError: true,\r\n\t\t\t\tsubmitting: true,\r\n\t\t\t\tpristine: true,\r\n\t\t\t}}\r\n\t\t\trender={(formProps: any) => {\r\n\t\t\t\tconst { handleSubmit, dirty, submitError, submitting } = formProps;\r\n\r\n\t\t\t\treturn (\r\n\t\t\t\t\t<form onSubmit={handleSubmit} autoComplete=\"off\">\r\n\t\t\t\t\t\t<NavigationPrompt when={dirty}>\r\n\t\t\t\t\t\t\t{({ isActive, onConfirm, onCancel }) => (\r\n\t\t\t\t\t\t\t\t<Confirm\r\n\t\t\t\t\t\t\t\t\tonCancel={onCancel}\r\n\t\t\t\t\t\t\t\t\tisOpen={isActive}\r\n\t\t\t\t\t\t\t\t\tonConfirm={onConfirm}\r\n\t\t\t\t\t\t\t\t\trenderTitle={() => 'Warning'}\r\n\t\t\t\t\t\t\t\t\trenderContents={() =>\r\n\t\t\t\t\t\t\t\t\t\t'Are you sure you want to leave this page? Your changes will be lost.'\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tconfirmButtonText=\"Leave\"\r\n\t\t\t\t\t\t\t\t\tcancelButtonText=\"Stay\"\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t</NavigationPrompt>\r\n\r\n\t\t\t\t\t\t<EditErrorOnSaveAlert />\r\n\t\t\t\t\t\t<ValidationErrorAlert submitError={submitError} alertType={AlertType.Edit} />\r\n\t\t\t\t\t\t<Field label=\"Code\" name=\"code\" component={TextBox} hideTooltip />\r\n\t\t\t\t\t\t<Link\r\n\t\t\t\t\t\t\tto=\"#\"\r\n\t\t\t\t\t\t\tclassName=\"btn-width-medium btn btn-outline-primary-alt\"\r\n\t\t\t\t\t\t\tonClick={props.onCancelClick}\r\n\t\t\t\t\t\t\tdata-testid={`${props.testId}-cancel`}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tCancel\r\n\t\t\t\t\t\t</Link>\r\n\t\t\t\t\t\t{'  '}\r\n\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\tdisabled={submitting}\r\n\t\t\t\t\t\t\tclassName=\"btn-width-medium\"\r\n\t\t\t\t\t\t\tdata-testid={`${props.testId}-verify`}\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\tVerify\r\n\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t);\r\n\t\t\t}}\r\n\t\t/>\r\n\t);\r\n}\r\n\r\nexport default EnableAuthenticator;\r\n","import React, { useState } from 'react';\r\nimport { Button } from 'reactstrap';\r\nimport EnableAuthenticator from './EnableAuthenticator';\r\nimport RecoveryCodes from './RecoveryCodes';\r\n\r\ninterface EnableTotpAuthenticatorProps {\r\n\tsetActivated: (active: boolean) => void;\r\n\tonFinished: () => void;\r\n}\r\n\r\n/**\r\n * Component that lets a user set up a TOTP authenticator app (like Google Authenticator)\r\n */\r\nexport default function EnableTotpAuthenticator(props: EnableTotpAuthenticatorProps) {\r\n\tconst [showEnableAuthenticator, setShowEnableAuthenticator] = useState(false);\r\n\tconst [showRecoveryCodes, setShowRecoveryCodes] = useState(false);\r\n\tconst [showAddAuthenticator, setShowAddAuthenticator] = useState(true);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{showAddAuthenticator ? (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<Button\r\n\t\t\t\t\t\tdata-testid=\"add-totp-authenticator-btn\"\r\n\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\tprops.setActivated(true);\r\n\t\t\t\t\t\t\tsetShowAddAuthenticator(false);\r\n\t\t\t\t\t\t\tsetShowEnableAuthenticator(true);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t>\r\n\t\t\t\t\t\tAdd authenticator app\r\n\t\t\t\t\t</Button>{' '}\r\n\t\t\t\t</>\r\n\t\t\t) : null}\r\n\t\t\t{showEnableAuthenticator ? (\r\n\t\t\t\t<EnableAuthenticator\r\n\t\t\t\t\tonCancelClick={() => {\r\n\t\t\t\t\t\tprops.setActivated(false);\r\n\t\t\t\t\t\tsetShowEnableAuthenticator(false);\r\n\t\t\t\t\t\tsetShowAddAuthenticator(true);\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tafterSubmit={(generateCodes) => {\r\n\t\t\t\t\t\tif (generateCodes) {\r\n\t\t\t\t\t\t\tsetShowEnableAuthenticator(false);\r\n\t\t\t\t\t\t\tsetShowRecoveryCodes(true);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tprops.onFinished();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}}\r\n\t\t\t\t/>\r\n\t\t\t) : null}\r\n\t\t\t{showRecoveryCodes ? <RecoveryCodes onCancelClick={props.onFinished} generate={true} /> : null}\r\n\t\t</>\r\n\t);\r\n}\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Pending SVG component\r\n *\r\n * @returns\r\n */\r\nfunction ExclamationCircleSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 32 32\"\r\n\t\t\tclassName={'icon icon-exclamation-circle ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t>\r\n\t\t\t<path d=\"M16 0c-8.837 0-16 7.163-16 16s7.163 16 16 16c8.837 0 16-7.163 16-16v0c0-8.837-7.163-16-16-16v0zM16 25.077c-1.019 0-1.845-0.826-1.845-1.845s0.826-1.845 1.845-1.845c1.019 0 1.845 0.826 1.845 1.845v0c0 1.019-0.826 1.845-1.845 1.845v0zM17.845 17.077c0 1.020-0.827 1.846-1.846 1.846s-1.846-0.827-1.846-1.846v0-8.617c0-1.020 0.827-1.846 1.846-1.846s1.846 0.827 1.846 1.846v0z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nExclamationCircleSVG.defaultProps = { class: '' };\r\n\r\nexport default ExclamationCircleSVG;\r\n","import * as React from 'react';\r\nimport ErrorAlert from './ErrorAlert';\r\nimport Spinner from './Spinner';\r\n\r\n/**\r\n * Error alert component that shows error information on the front end.\r\n *\r\n * @class Loading\r\n * @extends {React.Component<any>}\r\n */\r\nclass Loading extends React.Component<any> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst { error, retry, timedOut, pastDelay } = this.props;\r\n\r\n\t\tif (error) {\r\n\t\t\t// react-loadable seems to swallow these errors, which isn't great.\r\n\t\t\t// let's spit them out if there's something.\r\n\t\t\tconsole.error(error);\r\n\t\t\treturn <ErrorAlert error={(error as Error) || null} />;\r\n\t\t} else if (timedOut) {\r\n\t\t\treturn (\r\n\t\t\t\t<div>\r\n\t\t\t\t\tTaking a long time... <button onClick={retry}>Retry</button>\r\n\t\t\t\t</div>\r\n\t\t\t);\r\n\t\t} else if (pastDelay) {\r\n\t\t\treturn (\r\n\t\t\t\t<div className=\"loading\">\r\n\t\t\t\t\t<Spinner />\r\n\t\t\t\t</div>\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default Loading;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Info SVG component\r\n *\r\n * @returns\r\n */\r\nfunction InfoSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 32 32\"\r\n\t\t\tclassName={'icon icon-info ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t\tdata-testid={svgProps.testId}\r\n\t\t>\r\n\t\t\t<path d=\"M17.578 11.192v-3.23h-3.154v3.23zM17.578 24.038v-9.616h-3.154v9.616zM16.008 0c8.802 0.020 15.931 7.16 15.931 15.965 0 8.817-7.148 15.965-15.965 15.965s-15.965-7.148-15.965-15.965c0-4.409 1.787-8.4 4.676-11.289v0c2.894-2.889 6.89-4.676 11.303-4.676 0.007 0 0.015 0 0.022 0h-0.001z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nInfoSVG.defaultProps = { class: '' };\r\n\r\nexport default InfoSVG;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Check circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction CheckCircleSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 32 32\"\r\n\t\t\tclassName={'icon icon-check-circle ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t\tdata-testid={svgProps.testId}\r\n\t\t>\r\n\t\t\t<path\r\n\t\t\t\tclassName=\"icon-check-circle__path1\"\r\n\t\t\t\td=\"M32 16c0 8.837-7.163 16-16 16s-16-7.163-16-16c0-8.837 7.163-16 16-16s16 7.163 16 16z\"\r\n\t\t\t/>\r\n\t\t\t<path\r\n\t\t\t\tclassName=\"icon-check-circle__path2\"\r\n\t\t\t\td=\"M12.316 21.997l-3.565-4.619c-0.853-2.182 0.962-2.929 2.306-1.679l2.308 2.94 7.136-7.977c1.259-1.323 3.358-0.567 2.519 1.47l-8.397 9.655c-0.902 1.050-1.679 0.841-2.308 0.213z\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nCheckCircleSVG.defaultProps = { class: '' };\r\n\r\nexport default CheckCircleSVG;\r\n","import { AxiosError } from 'axios';\r\n\r\n/**\r\n * Represents an exception that occurred on the server and was passed to the client\r\n */\r\nexport interface ServerException {\r\n\t/**\r\n\t * Specifies the type of exception that occurred on the server. If this is populated it means the exception is res\r\n\t */\r\n\texceptionCode?: string;\r\n\r\n\t/**\r\n\t * The error message to display to the end user. If this is an unhandled exception, the message in general\r\n\t */\r\n\tmessage: string;\r\n\r\n\t/**\r\n\t * The detailed exception information from the server. If the server is in release mode or the exception can be handled (exceptionCode isn't null) then this field will be undefined. It should not be relied on outside of debugging.\r\n\t */\r\n\texception?: ExceptionDto;\r\n}\r\n\r\n/**\r\n * Retrieves the handleable exception from an axios error if one exists\r\n */\r\nexport function getHandleableException(error: any) {\r\n\tconst axiosError: AxiosError = error;\r\n\r\n\tconst serverException: ServerException | undefined = axiosError.response && axiosError.response.data;\r\n\r\n\tif (serverException && serverException.exceptionCode) {\r\n\t\treturn serverException;\r\n\t}\r\n\r\n\treturn undefined;\r\n}\r\n\r\n/**\r\n * The detailed exception information from the server. Only ever used when running in debug mode.\r\n */\r\nexport interface ExceptionDto {\r\n\tstackTrack: string;\r\n\tsource: string;\r\n\tmessage: string;\r\n\tinnerException?: ExceptionDto;\r\n}\r\n\r\n///////////////////////\r\n// Removal Exception //\r\n///////////////////////\r\n\r\n/**\r\n * The reason a removal request failed (eg. soft deletion, hard deletion, deactivation)\r\n */\r\nexport enum RemovalFailureReason {\r\n\tCannotForce = 'CannotForce',\r\n\tWasNotForced = 'WasNotForced',\r\n}\r\n\r\n/**\r\n * The severity of a removal request. A higher severity indicates that the user should be slowed down to stop them from shooting themselves in the foot.\r\n */\r\nexport enum RemovalSeverity {\r\n\tNormal = 'Normal',\r\n\tWarning = 'Warning',\r\n\tDanger = 'Danger',\r\n}\r\n\r\n/** Exception originiating from the server indicating that a request for a removal (soft deletion, hard deletion, or deactivation) failed. */\r\nexport interface RemovalException extends ServerException {\r\n\tfailureReason: RemovalFailureReason;\r\n\tremovalSeverity: RemovalSeverity;\r\n}\r\n","/**\r\n * The \"system user\" display name for CreateUser/ModifyUser fields when null\r\n */\r\nexport const systemUserName = 'System';\r\n\r\n/**\r\n * Message for notifying the user that an entity cannot have its status changed. This should be related to the\r\n * entity having isPermanent set to true.\r\n */\r\nexport const PERMANENT_ENTITY_DELETED_ERROR_MESSAGE = 'This record is managed by the system and cannot be deleted';\r\n","import * as React from 'react';\r\nimport { Field } from 'react-final-form';\r\nimport AutoSuggestSingle from '../../auto-suggest/AutoSuggestSingle';\r\nimport AutoSuggestInputForm from '../../auto-suggest/AutoSuggestFieldInput';\r\nimport { AutoSuggestFieldWrapperProps } from '.';\r\nimport { FormGroup } from 'reactstrap';\r\nimport { AutoSuggestRenderMenuProps } from 'components/shared/auto-suggest/Types';\r\nimport AutoSuggestMenu from 'components/shared/auto-suggest/AutoSuggestMenu';\r\nimport isEqual from 'react-fast-compare';\r\n\r\n/**\r\n * Wrapper field for AutoSuggestSingle to be used within forms\r\n *\r\n */\r\nclass AutoSuggestSingleField extends React.Component<AutoSuggestFieldWrapperProps> {\r\n\tpublic static defaultProps = {\r\n\t\trenderMenu: (props: AutoSuggestRenderMenuProps) => <AutoSuggestMenu {...props} />,\r\n\t\tisRequired: false,\r\n\t\tdisabled: false,\r\n\t\tindicateDirty: true,\r\n\t\treadOnly: false,\r\n\t\tclearable: true,\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tforceEmptyLabel,\r\n\t\t\tlabelElementHidden,\r\n\t\t\tautoSuggestOptions,\r\n\t\t\tisRequired,\r\n\t\t\tdisabled,\r\n\t\t\tindicateDirty,\r\n\t\t\treadOnly,\r\n\t\t\tprefix,\r\n\t\t\tsuffix,\r\n\t\t\tisPowerUser,\r\n\t\t\tplaceholder,\r\n\t\t\trenderMenu,\r\n\t\t\tclearable,\r\n\t\t\tinputTypeOverride,\r\n\t\t\tonChange,\r\n\t\t\ttestId,\r\n\t\t\tsetValueMapping,\r\n\t\t} = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t<Field name={name} isEqual={isEqual}>\r\n\t\t\t\t{({ input, meta }) => (\r\n\t\t\t\t\t<FormGroup className={indicateDirty && meta.dirty ? 'form-group--dirty' : ''}>\r\n\t\t\t\t\t\t<AutoSuggestSingle\r\n\t\t\t\t\t\t\ttestId={testId}\r\n\t\t\t\t\t\t\tname={input.name}\r\n\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\tvalue={input.value}\r\n\t\t\t\t\t\t\tonChange={(value) => {\r\n\t\t\t\t\t\t\t\tif (setValueMapping) {\r\n\t\t\t\t\t\t\t\t\tinput.onChange(setValueMapping(value));\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tinput.onChange(value);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (onChange) {\r\n\t\t\t\t\t\t\t\t\tonChange(value);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\tautoSuggestOptions={autoSuggestOptions}\r\n\t\t\t\t\t\t\trenderMenu={renderMenu}\r\n\t\t\t\t\t\t\tclearable={clearable}\r\n\t\t\t\t\t\t\trenderInput={() => (\r\n\t\t\t\t\t\t\t\t<AutoSuggestInputForm\r\n\t\t\t\t\t\t\t\t\ttestId={testId}\r\n\t\t\t\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\t\t\t\treadOnly={readOnly}\r\n\t\t\t\t\t\t\t\t\tindicateDirty={indicateDirty}\r\n\t\t\t\t\t\t\t\t\tmeta={meta}\r\n\t\t\t\t\t\t\t\t\tlabel={label}\r\n\t\t\t\t\t\t\t\t\tforceEmptyLabel={forceEmptyLabel}\r\n\t\t\t\t\t\t\t\t\tlabelElementHidden={labelElementHidden}\r\n\t\t\t\t\t\t\t\t\tisRequired={isRequired}\r\n\t\t\t\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\t\t\t\tallowNewValues={autoSuggestOptions.allowNewValues}\r\n\t\t\t\t\t\t\t\t\tprefix={prefix}\r\n\t\t\t\t\t\t\t\t\tsuffix={suffix}\r\n\t\t\t\t\t\t\t\t\tisPowerUser={isPowerUser}\r\n\t\t\t\t\t\t\t\t\tplaceholder={placeholder}\r\n\t\t\t\t\t\t\t\t\tinputTypeOverride={inputTypeOverride}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t)}\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t</FormGroup>\r\n\t\t\t\t)}\r\n\t\t\t</Field>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default AutoSuggestSingleField;\r\n","var BitByte = require('./8BitByte');\nvar RSBlock = require('./RSBlock');\nvar BitBuffer = require('./BitBuffer');\nvar util = require('./util');\nvar Polynomial = require('./Polynomial');\n\nfunction QRCode(typeNumber, errorCorrectLevel) {\n\tthis.typeNumber = typeNumber;\n\tthis.errorCorrectLevel = errorCorrectLevel;\n\tthis.modules = null;\n\tthis.moduleCount = 0;\n\tthis.dataCache = null;\n\tthis.dataList = [];\n}\n\n// for client side minification\nvar proto = QRCode.prototype;\n\nproto.addData = function(data) {\n\tvar newData = new BitByte(data);\n\tthis.dataList.push(newData);\n\tthis.dataCache = null;\n};\n\nproto.isDark = function(row, col) {\n\tif (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) {\n\t\tthrow new Error(row + \",\" + col);\n\t}\n\treturn this.modules[row][col];\n};\n\nproto.getModuleCount = function() {\n\treturn this.moduleCount;\n};\n\nproto.make = function() {\n\t// Calculate automatically typeNumber if provided is < 1\n\tif (this.typeNumber < 1 ){\n\t\tvar typeNumber = 1;\n\t\tfor (typeNumber = 1; typeNumber < 40; typeNumber++) {\n\t\t\tvar rsBlocks = RSBlock.getRSBlocks(typeNumber, this.errorCorrectLevel);\n\n\t\t\tvar buffer = new BitBuffer();\n\t\t\tvar totalDataCount = 0;\n\t\t\tfor (var i = 0; i < rsBlocks.length; i++) {\n\t\t\t\ttotalDataCount += rsBlocks[i].dataCount;\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < this.dataList.length; i++) {\n\t\t\t\tvar data = this.dataList[i];\n\t\t\t\tbuffer.put(data.mode, 4);\n\t\t\t\tbuffer.put(data.getLength(), util.getLengthInBits(data.mode, typeNumber) );\n\t\t\t\tdata.write(buffer);\n\t\t\t}\n\t\t\tif (buffer.getLengthInBits() <= totalDataCount * 8)\n\t\t\t\tbreak;\n\t\t}\n\t\tthis.typeNumber = typeNumber;\n\t}\n\tthis.makeImpl(false, this.getBestMaskPattern() );\n};\n\nproto.makeImpl = function(test, maskPattern) {\n\t\n\tthis.moduleCount = this.typeNumber * 4 + 17;\n\tthis.modules = new Array(this.moduleCount);\n\t\n\tfor (var row = 0; row < this.moduleCount; row++) {\n\t\t\n\t\tthis.modules[row] = new Array(this.moduleCount);\n\t\t\n\t\tfor (var col = 0; col < this.moduleCount; col++) {\n\t\t\tthis.modules[row][col] = null;//(col + row) % 3;\n\t\t}\n\t}\n\n\tthis.setupPositionProbePattern(0, 0);\n\tthis.setupPositionProbePattern(this.moduleCount - 7, 0);\n\tthis.setupPositionProbePattern(0, this.moduleCount - 7);\n\tthis.setupPositionAdjustPattern();\n\tthis.setupTimingPattern();\n\tthis.setupTypeInfo(test, maskPattern);\n\t\n\tif (this.typeNumber >= 7) {\n\t\tthis.setupTypeNumber(test);\n\t}\n\n\tif (this.dataCache == null) {\n\t\tthis.dataCache = QRCode.createData(this.typeNumber, this.errorCorrectLevel, this.dataList);\n\t}\n\n\tthis.mapData(this.dataCache, maskPattern);\n};\n\nproto.setupPositionProbePattern = function(row, col)  {\n\t\n\tfor (var r = -1; r <= 7; r++) {\n\t\t\n\t\tif (row + r <= -1 || this.moduleCount <= row + r) continue;\n\t\t\n\t\tfor (var c = -1; c <= 7; c++) {\n\t\t\t\n\t\t\tif (col + c <= -1 || this.moduleCount <= col + c) continue;\n\t\t\t\n\t\t\tif ( (0 <= r && r <= 6 && (c == 0 || c == 6) )\n\t\t\t\t\t|| (0 <= c && c <= 6 && (r == 0 || r == 6) )\n\t\t\t\t\t|| (2 <= r && r <= 4 && 2 <= c && c <= 4) ) {\n\t\t\t\tthis.modules[row + r][col + c] = true;\n\t\t\t} else {\n\t\t\t\tthis.modules[row + r][col + c] = false;\n\t\t\t}\n\t\t}\t\t\n\t}\t\t\n};\n\nproto.getBestMaskPattern = function() {\n\n\tvar minLostPoint = 0;\n\tvar pattern = 0;\n\n\tfor (var i = 0; i < 8; i++) {\n\t\t\n\t\tthis.makeImpl(true, i);\n\n\t\tvar lostPoint = util.getLostPoint(this);\n\n\t\tif (i == 0 || minLostPoint >  lostPoint) {\n\t\t\tminLostPoint = lostPoint;\n\t\t\tpattern = i;\n\t\t}\n\t}\n\n\treturn pattern;\n};\n\nproto.createMovieClip = function(target_mc, instance_name, depth) {\n\n\tvar qr_mc = target_mc.createEmptyMovieClip(instance_name, depth);\n\tvar cs = 1;\n\n\tthis.make();\n\n\tfor (var row = 0; row < this.modules.length; row++) {\n\t\t\n\t\tvar y = row * cs;\n\t\t\n\t\tfor (var col = 0; col < this.modules[row].length; col++) {\n\n\t\t\tvar x = col * cs;\n\t\t\tvar dark = this.modules[row][col];\n\t\t\n\t\t\tif (dark) {\n\t\t\t\tqr_mc.beginFill(0, 100);\n\t\t\t\tqr_mc.moveTo(x, y);\n\t\t\t\tqr_mc.lineTo(x + cs, y);\n\t\t\t\tqr_mc.lineTo(x + cs, y + cs);\n\t\t\t\tqr_mc.lineTo(x, y + cs);\n\t\t\t\tqr_mc.endFill();\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn qr_mc;\n};\n\nproto.setupTimingPattern = function() {\n\t\n\tfor (var r = 8; r < this.moduleCount - 8; r++) {\n\t\tif (this.modules[r][6] != null) {\n\t\t\tcontinue;\n\t\t}\n\t\tthis.modules[r][6] = (r % 2 == 0);\n\t}\n\n\tfor (var c = 8; c < this.moduleCount - 8; c++) {\n\t\tif (this.modules[6][c] != null) {\n\t\t\tcontinue;\n\t\t}\n\t\tthis.modules[6][c] = (c % 2 == 0);\n\t}\n};\n\nproto.setupPositionAdjustPattern = function() {\n\n\tvar pos = util.getPatternPosition(this.typeNumber);\n\t\n\tfor (var i = 0; i < pos.length; i++) {\n\t\n\t\tfor (var j = 0; j < pos.length; j++) {\n\t\t\n\t\t\tvar row = pos[i];\n\t\t\tvar col = pos[j];\n\t\t\t\n\t\t\tif (this.modules[row][col] != null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tfor (var r = -2; r <= 2; r++) {\n\t\t\t\n\t\t\t\tfor (var c = -2; c <= 2; c++) {\n\t\t\t\t\n\t\t\t\t\tif (r == -2 || r == 2 || c == -2 || c == 2\n\t\t\t\t\t\t\t|| (r == 0 && c == 0) ) {\n\t\t\t\t\t\tthis.modules[row + r][col + c] = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.modules[row + r][col + c] = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nproto.setupTypeNumber = function(test) {\n\n\tvar bits = util.getBCHTypeNumber(this.typeNumber);\n\n\tfor (var i = 0; i < 18; i++) {\n\t\tvar mod = (!test && ( (bits >> i) & 1) == 1);\n\t\tthis.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod;\n\t}\n\n\tfor (var i = 0; i < 18; i++) {\n\t\tvar mod = (!test && ( (bits >> i) & 1) == 1);\n\t\tthis.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod;\n\t}\n};\n\nproto.setupTypeInfo = function(test, maskPattern) {\n\n\tvar data = (this.errorCorrectLevel << 3) | maskPattern;\n\tvar bits = util.getBCHTypeInfo(data);\n\n\t// vertical\t\t\n\tfor (var i = 0; i < 15; i++) {\n\n\t\tvar mod = (!test && ( (bits >> i) & 1) == 1);\n\n\t\tif (i < 6) {\n\t\t\tthis.modules[i][8] = mod;\n\t\t} else if (i < 8) {\n\t\t\tthis.modules[i + 1][8] = mod;\n\t\t} else {\n\t\t\tthis.modules[this.moduleCount - 15 + i][8] = mod;\n\t\t}\n\t}\n\n\t// horizontal\n\tfor (var i = 0; i < 15; i++) {\n\n\t\tvar mod = (!test && ( (bits >> i) & 1) == 1);\n\t\t\n\t\tif (i < 8) {\n\t\t\tthis.modules[8][this.moduleCount - i - 1] = mod;\n\t\t} else if (i < 9) {\n\t\t\tthis.modules[8][15 - i - 1 + 1] = mod;\n\t\t} else {\n\t\t\tthis.modules[8][15 - i - 1] = mod;\n\t\t}\n\t}\n\n\t// fixed module\n\tthis.modules[this.moduleCount - 8][8] = (!test);\n};\n\nproto.mapData = function(data, maskPattern) {\n\t\n\tvar inc = -1;\n\tvar row = this.moduleCount - 1;\n\tvar bitIndex = 7;\n\tvar byteIndex = 0;\n\t\n\tfor (var col = this.moduleCount - 1; col > 0; col -= 2) {\n\n\t\tif (col == 6) col--;\n\n\t\twhile (true) {\n\n\t\t\tfor (var c = 0; c < 2; c++) {\n\t\t\t\t\n\t\t\t\tif (this.modules[row][col - c] == null) {\n\t\t\t\t\t\n\t\t\t\t\tvar dark = false;\n\n\t\t\t\t\tif (byteIndex < data.length) {\n\t\t\t\t\t\tdark = ( ( (data[byteIndex] >>> bitIndex) & 1) == 1);\n\t\t\t\t\t}\n\n\t\t\t\t\tvar mask = util.getMask(maskPattern, row, col - c);\n\n\t\t\t\t\tif (mask) {\n\t\t\t\t\t\tdark = !dark;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tthis.modules[row][col - c] = dark;\n\t\t\t\t\tbitIndex--;\n\n\t\t\t\t\tif (bitIndex == -1) {\n\t\t\t\t\t\tbyteIndex++;\n\t\t\t\t\t\tbitIndex = 7;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\trow += inc;\n\n\t\t\tif (row < 0 || this.moduleCount <= row) {\n\t\t\t\trow -= inc;\n\t\t\t\tinc = -inc;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n};\n\nQRCode.PAD0 = 0xEC;\nQRCode.PAD1 = 0x11;\n\nQRCode.createData = function(typeNumber, errorCorrectLevel, dataList) {\n\t\n\tvar rsBlocks = RSBlock.getRSBlocks(typeNumber, errorCorrectLevel);\n\t\n\tvar buffer = new BitBuffer();\n\t\n\tfor (var i = 0; i < dataList.length; i++) {\n\t\tvar data = dataList[i];\n\t\tbuffer.put(data.mode, 4);\n\t\tbuffer.put(data.getLength(), util.getLengthInBits(data.mode, typeNumber) );\n\t\tdata.write(buffer);\n\t}\n\n\t// calc num max data.\n\tvar totalDataCount = 0;\n\tfor (var i = 0; i < rsBlocks.length; i++) {\n\t\ttotalDataCount += rsBlocks[i].dataCount;\n\t}\n\n\tif (buffer.getLengthInBits() > totalDataCount * 8) {\n\t\tthrow new Error(\"code length overflow. (\"\n\t\t\t+ buffer.getLengthInBits()\n\t\t\t+ \">\"\n\t\t\t+  totalDataCount * 8\n\t\t\t+ \")\");\n\t}\n\n\t// end code\n\tif (buffer.getLengthInBits() + 4 <= totalDataCount * 8) {\n\t\tbuffer.put(0, 4);\n\t}\n\n\t// padding\n\twhile (buffer.getLengthInBits() % 8 != 0) {\n\t\tbuffer.putBit(false);\n\t}\n\n\t// padding\n\twhile (true) {\n\t\t\n\t\tif (buffer.getLengthInBits() >= totalDataCount * 8) {\n\t\t\tbreak;\n\t\t}\n\t\tbuffer.put(QRCode.PAD0, 8);\n\t\t\n\t\tif (buffer.getLengthInBits() >= totalDataCount * 8) {\n\t\t\tbreak;\n\t\t}\n\t\tbuffer.put(QRCode.PAD1, 8);\n\t}\n\n\treturn QRCode.createBytes(buffer, rsBlocks);\n};\n\nQRCode.createBytes = function(buffer, rsBlocks) {\n\n\tvar offset = 0;\n\t\n\tvar maxDcCount = 0;\n\tvar maxEcCount = 0;\n\t\n\tvar dcdata = new Array(rsBlocks.length);\n\tvar ecdata = new Array(rsBlocks.length);\n\t\n\tfor (var r = 0; r < rsBlocks.length; r++) {\n\n\t\tvar dcCount = rsBlocks[r].dataCount;\n\t\tvar ecCount = rsBlocks[r].totalCount - dcCount;\n\n\t\tmaxDcCount = Math.max(maxDcCount, dcCount);\n\t\tmaxEcCount = Math.max(maxEcCount, ecCount);\n\t\t\n\t\tdcdata[r] = new Array(dcCount);\n\t\t\n\t\tfor (var i = 0; i < dcdata[r].length; i++) {\n\t\t\tdcdata[r][i] = 0xff & buffer.buffer[i + offset];\n\t\t}\n\t\toffset += dcCount;\n\t\t\n\t\tvar rsPoly = util.getErrorCorrectPolynomial(ecCount);\n\t\tvar rawPoly = new Polynomial(dcdata[r], rsPoly.getLength() - 1);\n\n\t\tvar modPoly = rawPoly.mod(rsPoly);\n\t\tecdata[r] = new Array(rsPoly.getLength() - 1);\n\t\tfor (var i = 0; i < ecdata[r].length; i++) {\n            var modIndex = i + modPoly.getLength() - ecdata[r].length;\n\t\t\tecdata[r][i] = (modIndex >= 0)? modPoly.get(modIndex) : 0;\n\t\t}\n\n\t}\n\t\n\tvar totalCodeCount = 0;\n\tfor (var i = 0; i < rsBlocks.length; i++) {\n\t\ttotalCodeCount += rsBlocks[i].totalCount;\n\t}\n\n\tvar data = new Array(totalCodeCount);\n\tvar index = 0;\n\n\tfor (var i = 0; i < maxDcCount; i++) {\n\t\tfor (var r = 0; r < rsBlocks.length; r++) {\n\t\t\tif (i < dcdata[r].length) {\n\t\t\t\tdata[index++] = dcdata[r][i];\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (var i = 0; i < maxEcCount; i++) {\n\t\tfor (var r = 0; r < rsBlocks.length; r++) {\n\t\t\tif (i < ecdata[r].length) {\n\t\t\t\tdata[index++] = ecdata[r][i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn data;\n};\n\nmodule.exports = QRCode;\n\n","var mode = require('./mode');\n\nfunction QR8bitByte(data) {\n\tthis.mode = mode.MODE_8BIT_BYTE;\n\tthis.data = data;\n}\n\nQR8bitByte.prototype = {\n\n\tgetLength : function(buffer) {\n\t\treturn this.data.length;\n\t},\n\t\n\twrite : function(buffer) {\n\t\tfor (var i = 0; i < this.data.length; i++) {\n\t\t\t// not JIS ...\n\t\t\tbuffer.put(this.data.charCodeAt(i), 8);\n\t\t}\n\t}\n};\n\nmodule.exports = QR8bitByte;\n\n","// ErrorCorrectLevel\nvar ECL = require('./ErrorCorrectLevel');\n\nfunction QRRSBlock(totalCount, dataCount) {\n\tthis.totalCount = totalCount;\n\tthis.dataCount  = dataCount;\n}\n\nQRRSBlock.RS_BLOCK_TABLE = [\n\n\t// L\n\t// M\n\t// Q\n\t// H\n\n\t// 1\n\t[1, 26, 19],\n\t[1, 26, 16],\n\t[1, 26, 13],\n\t[1, 26, 9],\n\t\n\t// 2\n\t[1, 44, 34],\n\t[1, 44, 28],\n\t[1, 44, 22],\n\t[1, 44, 16],\n\n\t// 3\n\t[1, 70, 55],\n\t[1, 70, 44],\n\t[2, 35, 17],\n\t[2, 35, 13],\n\n\t// 4\t\t\n\t[1, 100, 80],\n\t[2, 50, 32],\n\t[2, 50, 24],\n\t[4, 25, 9],\n\t\n\t// 5\n\t[1, 134, 108],\n\t[2, 67, 43],\n\t[2, 33, 15, 2, 34, 16],\n\t[2, 33, 11, 2, 34, 12],\n\t\n\t// 6\n\t[2, 86, 68],\n\t[4, 43, 27],\n\t[4, 43, 19],\n\t[4, 43, 15],\n\t\n\t// 7\t\t\n\t[2, 98, 78],\n\t[4, 49, 31],\n\t[2, 32, 14, 4, 33, 15],\n\t[4, 39, 13, 1, 40, 14],\n\t\n\t// 8\n\t[2, 121, 97],\n\t[2, 60, 38, 2, 61, 39],\n\t[4, 40, 18, 2, 41, 19],\n\t[4, 40, 14, 2, 41, 15],\n\t\n\t// 9\n\t[2, 146, 116],\n\t[3, 58, 36, 2, 59, 37],\n\t[4, 36, 16, 4, 37, 17],\n\t[4, 36, 12, 4, 37, 13],\n\t\n\t// 10\t\t\n\t[2, 86, 68, 2, 87, 69],\n\t[4, 69, 43, 1, 70, 44],\n\t[6, 43, 19, 2, 44, 20],\n\t[6, 43, 15, 2, 44, 16],\n\n\t// 11\n\t[4, 101, 81],\n\t[1, 80, 50, 4, 81, 51],\n\t[4, 50, 22, 4, 51, 23],\n\t[3, 36, 12, 8, 37, 13],\n\n\t// 12\n\t[2, 116, 92, 2, 117, 93],\n\t[6, 58, 36, 2, 59, 37],\n\t[4, 46, 20, 6, 47, 21],\n\t[7, 42, 14, 4, 43, 15],\n\n\t// 13\n\t[4, 133, 107],\n\t[8, 59, 37, 1, 60, 38],\n\t[8, 44, 20, 4, 45, 21],\n\t[12, 33, 11, 4, 34, 12],\n\n\t// 14\n\t[3, 145, 115, 1, 146, 116],\n\t[4, 64, 40, 5, 65, 41],\n\t[11, 36, 16, 5, 37, 17],\n\t[11, 36, 12, 5, 37, 13],\n\n\t// 15\n\t[5, 109, 87, 1, 110, 88],\n\t[5, 65, 41, 5, 66, 42],\n\t[5, 54, 24, 7, 55, 25],\n\t[11, 36, 12],\n\n\t// 16\n\t[5, 122, 98, 1, 123, 99],\n\t[7, 73, 45, 3, 74, 46],\n\t[15, 43, 19, 2, 44, 20],\n\t[3, 45, 15, 13, 46, 16],\n\n\t// 17\n\t[1, 135, 107, 5, 136, 108],\n\t[10, 74, 46, 1, 75, 47],\n\t[1, 50, 22, 15, 51, 23],\n\t[2, 42, 14, 17, 43, 15],\n\n\t// 18\n\t[5, 150, 120, 1, 151, 121],\n\t[9, 69, 43, 4, 70, 44],\n\t[17, 50, 22, 1, 51, 23],\n\t[2, 42, 14, 19, 43, 15],\n\n\t// 19\n\t[3, 141, 113, 4, 142, 114],\n\t[3, 70, 44, 11, 71, 45],\n\t[17, 47, 21, 4, 48, 22],\n\t[9, 39, 13, 16, 40, 14],\n\n\t// 20\n\t[3, 135, 107, 5, 136, 108],\n\t[3, 67, 41, 13, 68, 42],\n\t[15, 54, 24, 5, 55, 25],\n\t[15, 43, 15, 10, 44, 16],\n\n\t// 21\n\t[4, 144, 116, 4, 145, 117],\n\t[17, 68, 42],\n\t[17, 50, 22, 6, 51, 23],\n\t[19, 46, 16, 6, 47, 17],\n\n\t// 22\n\t[2, 139, 111, 7, 140, 112],\n\t[17, 74, 46],\n\t[7, 54, 24, 16, 55, 25],\n\t[34, 37, 13],\n\n\t// 23\n\t[4, 151, 121, 5, 152, 122],\n\t[4, 75, 47, 14, 76, 48],\n\t[11, 54, 24, 14, 55, 25],\n\t[16, 45, 15, 14, 46, 16],\n\n\t// 24\n\t[6, 147, 117, 4, 148, 118],\n\t[6, 73, 45, 14, 74, 46],\n\t[11, 54, 24, 16, 55, 25],\n\t[30, 46, 16, 2, 47, 17],\n\n\t// 25\n\t[8, 132, 106, 4, 133, 107],\n\t[8, 75, 47, 13, 76, 48],\n\t[7, 54, 24, 22, 55, 25],\n\t[22, 45, 15, 13, 46, 16],\n\n\t// 26\n\t[10, 142, 114, 2, 143, 115],\n\t[19, 74, 46, 4, 75, 47],\n\t[28, 50, 22, 6, 51, 23],\n\t[33, 46, 16, 4, 47, 17],\n\n\t// 27\n\t[8, 152, 122, 4, 153, 123],\n\t[22, 73, 45, 3, 74, 46],\n\t[8, 53, 23, 26, 54, 24],\n\t[12, 45, 15, 28, 46, 16],\n\n\t// 28\n\t[3, 147, 117, 10, 148, 118],\n\t[3, 73, 45, 23, 74, 46],\n\t[4, 54, 24, 31, 55, 25],\n\t[11, 45, 15, 31, 46, 16],\n\n\t// 29\n\t[7, 146, 116, 7, 147, 117],\n\t[21, 73, 45, 7, 74, 46],\n\t[1, 53, 23, 37, 54, 24],\n\t[19, 45, 15, 26, 46, 16],\n\n\t// 30\n\t[5, 145, 115, 10, 146, 116],\n\t[19, 75, 47, 10, 76, 48],\n\t[15, 54, 24, 25, 55, 25],\n\t[23, 45, 15, 25, 46, 16],\n\n\t// 31\n\t[13, 145, 115, 3, 146, 116],\n\t[2, 74, 46, 29, 75, 47],\n\t[42, 54, 24, 1, 55, 25],\n\t[23, 45, 15, 28, 46, 16],\n\n\t// 32\n\t[17, 145, 115],\n\t[10, 74, 46, 23, 75, 47],\n\t[10, 54, 24, 35, 55, 25],\n\t[19, 45, 15, 35, 46, 16],\n\n\t// 33\n\t[17, 145, 115, 1, 146, 116],\n\t[14, 74, 46, 21, 75, 47],\n\t[29, 54, 24, 19, 55, 25],\n\t[11, 45, 15, 46, 46, 16],\n\n\t// 34\n\t[13, 145, 115, 6, 146, 116],\n\t[14, 74, 46, 23, 75, 47],\n\t[44, 54, 24, 7, 55, 25],\n\t[59, 46, 16, 1, 47, 17],\n\n\t// 35\n\t[12, 151, 121, 7, 152, 122],\n\t[12, 75, 47, 26, 76, 48],\n\t[39, 54, 24, 14, 55, 25],\n\t[22, 45, 15, 41, 46, 16],\n\n\t// 36\n\t[6, 151, 121, 14, 152, 122],\n\t[6, 75, 47, 34, 76, 48],\n\t[46, 54, 24, 10, 55, 25],\n\t[2, 45, 15, 64, 46, 16],\n\n\t// 37\n\t[17, 152, 122, 4, 153, 123],\n\t[29, 74, 46, 14, 75, 47],\n\t[49, 54, 24, 10, 55, 25],\n\t[24, 45, 15, 46, 46, 16],\n\n\t// 38\n\t[4, 152, 122, 18, 153, 123],\n\t[13, 74, 46, 32, 75, 47],\n\t[48, 54, 24, 14, 55, 25],\n\t[42, 45, 15, 32, 46, 16],\n\n\t// 39\n\t[20, 147, 117, 4, 148, 118],\n\t[40, 75, 47, 7, 76, 48],\n\t[43, 54, 24, 22, 55, 25],\n\t[10, 45, 15, 67, 46, 16],\n\n\t// 40\n\t[19, 148, 118, 6, 149, 119],\n\t[18, 75, 47, 31, 76, 48],\n\t[34, 54, 24, 34, 55, 25],\n\t[20, 45, 15, 61, 46, 16]\n];\n\nQRRSBlock.getRSBlocks = function(typeNumber, errorCorrectLevel) {\n\t\n\tvar rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel);\n\t\n\tif (rsBlock == undefined) {\n\t\tthrow new Error(\"bad rs block @ typeNumber:\" + typeNumber + \"/errorCorrectLevel:\" + errorCorrectLevel);\n\t}\n\n\tvar length = rsBlock.length / 3;\n\t\n\tvar list = new Array();\n\t\n\tfor (var i = 0; i < length; i++) {\n\n\t\tvar count = rsBlock[i * 3 + 0];\n\t\tvar totalCount = rsBlock[i * 3 + 1];\n\t\tvar dataCount  = rsBlock[i * 3 + 2];\n\n\t\tfor (var j = 0; j < count; j++) {\n\t\t\tlist.push(new QRRSBlock(totalCount, dataCount) );\t\n\t\t}\n\t}\n\t\n\treturn list;\n}\n\nQRRSBlock.getRsBlockTable = function(typeNumber, errorCorrectLevel) {\n\n\tswitch(errorCorrectLevel) {\n\tcase ECL.L :\n\t\treturn QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0];\n\tcase ECL.M :\n\t\treturn QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1];\n\tcase ECL.Q :\n\t\treturn QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2];\n\tcase ECL.H :\n\t\treturn QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3];\n\tdefault :\n\t\treturn undefined;\n\t}\n}\n\nmodule.exports = QRRSBlock;\n","function QRBitBuffer() {\n\tthis.buffer = new Array();\n\tthis.length = 0;\n}\n\nQRBitBuffer.prototype = {\n\n\tget : function(index) {\n\t\tvar bufIndex = Math.floor(index / 8);\n\t\treturn ( (this.buffer[bufIndex] >>> (7 - index % 8) ) & 1) == 1;\n\t},\n\t\n\tput : function(num, length) {\n\t\tfor (var i = 0; i < length; i++) {\n\t\t\tthis.putBit( ( (num >>> (length - i - 1) ) & 1) == 1);\n\t\t}\n\t},\n\t\n\tgetLengthInBits : function() {\n\t\treturn this.length;\n\t},\n\t\n\tputBit : function(bit) {\n\t\n\t\tvar bufIndex = Math.floor(this.length / 8);\n\t\tif (this.buffer.length <= bufIndex) {\n\t\t\tthis.buffer.push(0);\n\t\t}\n\t\n\t\tif (bit) {\n\t\t\tthis.buffer[bufIndex] |= (0x80 >>> (this.length % 8) );\n\t\t}\n\t\n\t\tthis.length++;\n\t}\n};\n\nmodule.exports = QRBitBuffer;\n","var Mode = require('./mode');\nvar Polynomial = require('./Polynomial');\nvar math = require('./math');\n\nvar QRMaskPattern = {\n\tPATTERN000 : 0,\n\tPATTERN001 : 1,\n\tPATTERN010 : 2,\n\tPATTERN011 : 3,\n\tPATTERN100 : 4,\n\tPATTERN101 : 5,\n\tPATTERN110 : 6,\n\tPATTERN111 : 7\n};\n\nvar QRUtil = {\n\n    PATTERN_POSITION_TABLE : [\n\t    [],\n\t    [6, 18],\n\t    [6, 22],\n\t    [6, 26],\n\t    [6, 30],\n\t    [6, 34],\n\t    [6, 22, 38],\n\t    [6, 24, 42],\n\t    [6, 26, 46],\n\t    [6, 28, 50],\n\t    [6, 30, 54],\t\t\n\t    [6, 32, 58],\n\t    [6, 34, 62],\n\t    [6, 26, 46, 66],\n\t    [6, 26, 48, 70],\n\t    [6, 26, 50, 74],\n\t    [6, 30, 54, 78],\n\t    [6, 30, 56, 82],\n\t    [6, 30, 58, 86],\n\t    [6, 34, 62, 90],\n\t    [6, 28, 50, 72, 94],\n\t    [6, 26, 50, 74, 98],\n\t    [6, 30, 54, 78, 102],\n\t    [6, 28, 54, 80, 106],\n\t    [6, 32, 58, 84, 110],\n\t    [6, 30, 58, 86, 114],\n\t    [6, 34, 62, 90, 118],\n\t    [6, 26, 50, 74, 98, 122],\n\t    [6, 30, 54, 78, 102, 126],\n\t    [6, 26, 52, 78, 104, 130],\n\t    [6, 30, 56, 82, 108, 134],\n\t    [6, 34, 60, 86, 112, 138],\n\t    [6, 30, 58, 86, 114, 142],\n\t    [6, 34, 62, 90, 118, 146],\n\t    [6, 30, 54, 78, 102, 126, 150],\n\t    [6, 24, 50, 76, 102, 128, 154],\n\t    [6, 28, 54, 80, 106, 132, 158],\n\t    [6, 32, 58, 84, 110, 136, 162],\n\t    [6, 26, 54, 82, 110, 138, 166],\n\t    [6, 30, 58, 86, 114, 142, 170]\n    ],\n\n    G15 : (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0),\n    G18 : (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0),\n    G15_MASK : (1 << 14) | (1 << 12) | (1 << 10)\t| (1 << 4) | (1 << 1),\n\n    getBCHTypeInfo : function(data) {\n\t    var d = data << 10;\n\t    while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) {\n\t\t    d ^= (QRUtil.G15 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) ) ); \t\n\t    }\n\t    return ( (data << 10) | d) ^ QRUtil.G15_MASK;\n    },\n\n    getBCHTypeNumber : function(data) {\n\t    var d = data << 12;\n\t    while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) {\n\t\t    d ^= (QRUtil.G18 << (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) ) ); \t\n\t    }\n\t    return (data << 12) | d;\n    },\n\n    getBCHDigit : function(data) {\n\n\t    var digit = 0;\n\n\t    while (data != 0) {\n\t\t    digit++;\n\t\t    data >>>= 1;\n\t    }\n\n\t    return digit;\n    },\n\n    getPatternPosition : function(typeNumber) {\n\t    return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1];\n    },\n\n    getMask : function(maskPattern, i, j) {\n\t    \n\t    switch (maskPattern) {\n\t\t    \n\t    case QRMaskPattern.PATTERN000 : return (i + j) % 2 == 0;\n\t    case QRMaskPattern.PATTERN001 : return i % 2 == 0;\n\t    case QRMaskPattern.PATTERN010 : return j % 3 == 0;\n\t    case QRMaskPattern.PATTERN011 : return (i + j) % 3 == 0;\n\t    case QRMaskPattern.PATTERN100 : return (Math.floor(i / 2) + Math.floor(j / 3) ) % 2 == 0;\n\t    case QRMaskPattern.PATTERN101 : return (i * j) % 2 + (i * j) % 3 == 0;\n\t    case QRMaskPattern.PATTERN110 : return ( (i * j) % 2 + (i * j) % 3) % 2 == 0;\n\t    case QRMaskPattern.PATTERN111 : return ( (i * j) % 3 + (i + j) % 2) % 2 == 0;\n\n\t    default :\n\t\t    throw new Error(\"bad maskPattern:\" + maskPattern);\n\t    }\n    },\n\n    getErrorCorrectPolynomial : function(errorCorrectLength) {\n\n\t    var a = new Polynomial([1], 0);\n\n\t    for (var i = 0; i < errorCorrectLength; i++) {\n\t\t    a = a.multiply(new Polynomial([1, math.gexp(i)], 0) );\n\t    }\n\n\t    return a;\n    },\n\n    getLengthInBits : function(mode, type) {\n\n\t    if (1 <= type && type < 10) {\n\n\t\t    // 1 - 9\n\n\t\t    switch(mode) {\n\t\t    case Mode.MODE_NUMBER \t: return 10;\n\t\t    case Mode.MODE_ALPHA_NUM \t: return 9;\n\t\t    case Mode.MODE_8BIT_BYTE\t: return 8;\n\t\t    case Mode.MODE_KANJI  \t: return 8;\n\t\t    default :\n\t\t\t    throw new Error(\"mode:\" + mode);\n\t\t    }\n\n\t    } else if (type < 27) {\n\n\t\t    // 10 - 26\n\n\t\t    switch(mode) {\n\t\t    case Mode.MODE_NUMBER \t: return 12;\n\t\t    case Mode.MODE_ALPHA_NUM \t: return 11;\n\t\t    case Mode.MODE_8BIT_BYTE\t: return 16;\n\t\t    case Mode.MODE_KANJI  \t: return 10;\n\t\t    default :\n\t\t\t    throw new Error(\"mode:\" + mode);\n\t\t    }\n\n\t    } else if (type < 41) {\n\n\t\t    // 27 - 40\n\n\t\t    switch(mode) {\n\t\t    case Mode.MODE_NUMBER \t: return 14;\n\t\t    case Mode.MODE_ALPHA_NUM\t: return 13;\n\t\t    case Mode.MODE_8BIT_BYTE\t: return 16;\n\t\t    case Mode.MODE_KANJI  \t: return 12;\n\t\t    default :\n\t\t\t    throw new Error(\"mode:\" + mode);\n\t\t    }\n\n\t    } else {\n\t\t    throw new Error(\"type:\" + type);\n\t    }\n    },\n\n    getLostPoint : function(qrCode) {\n\t    \n\t    var moduleCount = qrCode.getModuleCount();\n\t    \n\t    var lostPoint = 0;\n\t    \n\t    // LEVEL1\n\t    \n\t    for (var row = 0; row < moduleCount; row++) {\n\n\t\t    for (var col = 0; col < moduleCount; col++) {\n\n\t\t\t    var sameCount = 0;\n\t\t\t    var dark = qrCode.isDark(row, col);\n\n\t\t\t\tfor (var r = -1; r <= 1; r++) {\n\n\t\t\t\t    if (row + r < 0 || moduleCount <= row + r) {\n\t\t\t\t\t    continue;\n\t\t\t\t    }\n\n\t\t\t\t    for (var c = -1; c <= 1; c++) {\n\n\t\t\t\t\t    if (col + c < 0 || moduleCount <= col + c) {\n\t\t\t\t\t\t    continue;\n\t\t\t\t\t    }\n\n\t\t\t\t\t    if (r == 0 && c == 0) {\n\t\t\t\t\t\t    continue;\n\t\t\t\t\t    }\n\n\t\t\t\t\t    if (dark == qrCode.isDark(row + r, col + c) ) {\n\t\t\t\t\t\t    sameCount++;\n\t\t\t\t\t    }\n\t\t\t\t    }\n\t\t\t    }\n\n\t\t\t    if (sameCount > 5) {\n\t\t\t\t    lostPoint += (3 + sameCount - 5);\n\t\t\t    }\n\t\t    }\n\t    }\n\n\t    // LEVEL2\n\n\t    for (var row = 0; row < moduleCount - 1; row++) {\n\t\t    for (var col = 0; col < moduleCount - 1; col++) {\n\t\t\t    var count = 0;\n\t\t\t    if (qrCode.isDark(row,     col    ) ) count++;\n\t\t\t    if (qrCode.isDark(row + 1, col    ) ) count++;\n\t\t\t    if (qrCode.isDark(row,     col + 1) ) count++;\n\t\t\t    if (qrCode.isDark(row + 1, col + 1) ) count++;\n\t\t\t    if (count == 0 || count == 4) {\n\t\t\t\t    lostPoint += 3;\n\t\t\t    }\n\t\t    }\n\t    }\n\n\t    // LEVEL3\n\n\t    for (var row = 0; row < moduleCount; row++) {\n\t\t    for (var col = 0; col < moduleCount - 6; col++) {\n\t\t\t    if (qrCode.isDark(row, col)\n\t\t\t\t\t    && !qrCode.isDark(row, col + 1)\n\t\t\t\t\t    &&  qrCode.isDark(row, col + 2)\n\t\t\t\t\t    &&  qrCode.isDark(row, col + 3)\n\t\t\t\t\t    &&  qrCode.isDark(row, col + 4)\n\t\t\t\t\t    && !qrCode.isDark(row, col + 5)\n\t\t\t\t\t    &&  qrCode.isDark(row, col + 6) ) {\n\t\t\t\t    lostPoint += 40;\n\t\t\t    }\n\t\t    }\n\t    }\n\n\t    for (var col = 0; col < moduleCount; col++) {\n\t\t    for (var row = 0; row < moduleCount - 6; row++) {\n\t\t\t    if (qrCode.isDark(row, col)\n\t\t\t\t\t    && !qrCode.isDark(row + 1, col)\n\t\t\t\t\t    &&  qrCode.isDark(row + 2, col)\n\t\t\t\t\t    &&  qrCode.isDark(row + 3, col)\n\t\t\t\t\t    &&  qrCode.isDark(row + 4, col)\n\t\t\t\t\t    && !qrCode.isDark(row + 5, col)\n\t\t\t\t\t    &&  qrCode.isDark(row + 6, col) ) {\n\t\t\t\t    lostPoint += 40;\n\t\t\t    }\n\t\t    }\n\t    }\n\n\t    // LEVEL4\n\t    \n\t    var darkCount = 0;\n\n\t    for (var col = 0; col < moduleCount; col++) {\n\t\t    for (var row = 0; row < moduleCount; row++) {\n\t\t\t    if (qrCode.isDark(row, col) ) {\n\t\t\t\t    darkCount++;\n\t\t\t    }\n\t\t    }\n\t    }\n\t    \n\t    var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5;\n\t    lostPoint += ratio * 10;\n\n\t    return lostPoint;\t\t\n    }\n};\n\nmodule.exports = QRUtil;\n","import { AutoSuggestItem, AutoSuggestOptions } from './Types';\r\nimport { ModelStatus } from '../../../../../Roc.SharedClientApp/types/model-status';\r\n\r\n// used by Downshift to convert objects into friendly text to display to users.\r\n// can be overridden as necessary.\r\nexport const itemToString = (item: AutoSuggestItem) => {\r\n\tif (!item) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\tif (item.status && item.status !== ModelStatus.Published) {\r\n\t\treturn `${item.label} (${item.status})`;\r\n\t}\r\n\treturn item ? item.label : '';\r\n};\r\n\r\nclass AutoSuggestOptionsError extends Error {}\r\n\r\n/**\r\n * Ensures that the provided autoSuggestOptions are valid. There are some invalid configurations and this helps prevent\r\n * them from causing unexpected behavior.\r\n * @param autoSuggestOptions\r\n */\r\nexport const assertValidAutoSuggestOptions = (autoSuggestOptions: AutoSuggestOptions) => {\r\n\tif (!autoSuggestOptions) {\r\n\t\tthrow new AutoSuggestOptionsError('AutoSuggest Options are required.');\r\n\t}\r\n\r\n\tconst hasStaticDataOption =\r\n\t\tArray.isArray(autoSuggestOptions.staticData) && autoSuggestOptions.staticData.length > 0;\r\n\r\n\tif ((!autoSuggestOptions.baseUrl && !hasStaticDataOption) || (autoSuggestOptions.baseUrl && hasStaticDataOption)) {\r\n\t\tthrow new AutoSuggestOptionsError('Either provide a baseUrl or a staticData option, but not both or neither.');\r\n\t}\r\n\r\n\tif (hasStaticDataOption && autoSuggestOptions.allowNewValues) {\r\n\t\tthrow new AutoSuggestOptionsError('New values cannot be created when static data is provided.');\r\n\t}\r\n};\r\n\r\n/**\r\n * Helper function to reorder items in an array\r\n * @param list\r\n * @param startIndex\r\n * @param endIndex\r\n */\r\nexport const reorderArrayValues = <T,>(list: T[], startIndex, endIndex) => {\r\n\tconst result = Array.from(list);\r\n\tconst [removed] = result.splice(startIndex, 1);\r\n\tresult.splice(endIndex, 0, removed);\r\n\r\n\treturn result;\r\n};\r\n","import AdminTabsContext from 'components/shared/edit/tabs/AdminTabsContext';\r\nimport React, { useContext, useEffect } from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { FormFeedback } from 'reactstrap';\r\n\r\ntype ValidationMessagesProps = Pick<FieldRenderProps<any, HTMLInputElement>, 'meta'> & {\r\n\tid: string;\r\n};\r\n\r\n/**\r\n * Displays validation errors for fields\r\n *\r\n * @class ValidationMessages\r\n * @extends {React.Component<ValidationMessagesProps>}\r\n */\r\n\r\nfunction ValidationMessages(props: ValidationMessagesProps) {\r\n\tconst { meta, id } = props;\r\n\tconst { setValidationError, parentTab } = useContext(AdminTabsContext);\r\n\r\n\tuseEffect(() => {\r\n\t\tif (!setValidationError) {\r\n\t\t\t// setValidationError may not be set if we're not within a tab context.\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// if there's a validation error and there's some tab context (there won't be if you're not using tabs)\r\n\t\tif (meta.dirtySinceLastSubmit) {\r\n\t\t\tsetValidationError(parentTab, id);\r\n\t\t} else if (meta.submitError && meta.touched) {\r\n\t\t\tsetValidationError(parentTab, id, meta.submitError);\r\n\t\t}\r\n\t}, [meta.submitError, meta.touched, meta.dirtySinceLastSubmit, parentTab, id, setValidationError]);\r\n\r\n\tif (!meta) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tlet errors: string[] = [];\r\n\r\n\t/*\r\n\t all validation comes from the server, so we only need to check `submitError` despite there being `error`\r\n\t there are 3 kinds of values for submitError, string, string[] and [string|[]|object]\r\n\t the third type happens when you're using FieldArray, so we're going to filter those out and only\r\n\t take the strings if submitError is an array. this is due to a bug (possibly feature?) of final form\r\n\t where the submit errors for field array fields bubble up into the parent field.\r\n\t */\r\n\tif (meta.submitError) {\r\n\t\terrors = errors.concat(getErrorArray(meta.submitError));\r\n\r\n\t\t// for server-side validation, we need to stop showing these after any changes are made.\r\n\t\tif (meta.dirtySinceLastSubmit || meta.submitting) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t} else if (meta.error) {\r\n\t\t// sometimes we validate on the client, so we need to support these as well.\r\n\t\terrors = errors.concat(getErrorArray(meta.error));\r\n\t}\r\n\r\n\treturn (\r\n\t\t<FormFeedback id={props.id + '-feedback'} data-testid={props.id + '-validation-msg'}>\r\n\t\t\t{(meta.submitError || meta.error) &&\r\n\t\t\t\terrors.length > 0 &&\r\n\t\t\t\terrors.map((error, index) => (\r\n\t\t\t\t\t<React.Fragment key={index}>\r\n\t\t\t\t\t\t<span>{error}</span>\r\n\t\t\t\t\t\t<br />\r\n\t\t\t\t\t</React.Fragment>\r\n\t\t\t\t))}\r\n\t\t</FormFeedback>\r\n\t);\r\n}\r\n\r\n/**\r\n * Filters and return an array of error depending on the type on input\r\n * @param errorOrSubmitError\r\n */\r\nexport function getErrorArray(errorOrSubmitError) {\r\n\tlet errors: string[] = [];\r\n\tif (typeof errorOrSubmitError === 'string') {\r\n\t\terrors.push(errorOrSubmitError);\r\n\t} else if (Array.isArray(errorOrSubmitError)) {\r\n\t\terrors = errorOrSubmitError.filter((error) => !Array.isArray(error) && typeof error === 'string');\r\n\t}\r\n\r\n\treturn errors;\r\n}\r\n\r\nexport default ValidationMessages;\r\n","import React from 'react';\r\n\r\n/**\r\n * FieldSubtext props.\r\n *\r\n * @interface FieldSubtextProps\r\n */\r\ninterface FieldSubtextProps {\r\n\t/**\r\n\t * Represents the subtext.\r\n\t */\r\n\ttext: string;\r\n}\r\n\r\n/**\r\n * Component for showing text just below the form fields.\r\n *\r\n * @param {RocFieldInfoProps} props\r\n * @returns\r\n */\r\nfunction FieldSubtext(props: FieldSubtextProps) {\r\n\treturn (\r\n\t\t<small className=\"input-wrapper__subtext\">\r\n\t\t\t<em>{props.text}</em>\r\n\t\t</small>\r\n\t);\r\n}\r\n\r\nexport default FieldSubtext;\r\n","import * as React from 'react';\r\nimport ValidationMessages from './ValidationMessages';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { InputProps } from '.';\r\nimport { FormGroup, Input as ReactStrapInput } from 'reactstrap';\r\nimport FieldLabel from './FieldLabel';\r\nimport { toKebabCase } from 'util/StringUtil';\r\nimport FieldSubtext from 'components/shared/FieldSubtext';\r\nimport classnames from 'classnames';\r\n\r\nexport type FieldInputProps = FieldRenderProps<any, HTMLInputElement> & InputProps;\r\n\r\n/**\r\n * Component that renders a Reactstrap input with form group.\r\n *\r\n * @class Input\r\n * @extends {(React.Component<FieldRenderProps & InputProps>)}\r\n */\r\nfunction Input(props: FieldInputProps) {\r\n\tconst {\r\n\t\tinput: { name, onChange, value, onBlur, onFocus },\r\n\t\tmeta,\r\n\t\tclassName,\r\n\t\ttype,\r\n\t\tdisabled,\r\n\t\tautoFocus,\r\n\t\treadOnly,\r\n\t\tindicateDirty,\r\n\t\tstep,\r\n\t\tmin,\r\n\t\tmax,\r\n\t\tprefix,\r\n\t\tsuffix,\r\n\t\ttranslatedFieldValue,\r\n\t\ttranslatedFieldName,\r\n\t\trows,\r\n\t\tcols,\r\n\t\tsubtext,\r\n\t} = props;\r\n\r\n\tconst isTranslatedField = !!translatedFieldName;\r\n\tconst showTranslationPlaceholder = isTranslatedField && !value;\r\n\r\n\treturn (\r\n\t\t<FormGroup\r\n\t\t\tclassName={classnames('', {\r\n\t\t\t\t'form-group--dirty': indicateDirty && meta.dirty,\r\n\t\t\t\t[`${className}`]: className,\r\n\t\t\t})}\r\n\t\t>\r\n\t\t\t<FieldLabel {...props} meta={meta} htmlFor={name} />\r\n\r\n\t\t\t<div\r\n\t\t\t\tclassName={classnames('input-wrapper', {\r\n\t\t\t\t\t'input-wrapper__subtext-wrapper': subtext,\r\n\t\t\t\t})}\r\n\t\t\t>\r\n\t\t\t\t{prefix ? <div className=\"input-wrapper__prefix\">{prefix}</div> : null}\r\n\t\t\t\t<ReactStrapInput\r\n\t\t\t\t\tid={name}\r\n\t\t\t\t\tname={name}\r\n\t\t\t\t\ttype={type}\r\n\t\t\t\t\tvalue={value}\r\n\t\t\t\t\tonChange={onChange}\r\n\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\tautoFocus={autoFocus}\r\n\t\t\t\t\tinvalid={!meta.dirtySinceLastSubmit && meta.submitError ? true : false}\r\n\t\t\t\t\tstep={step}\r\n\t\t\t\t\tmin={min}\r\n\t\t\t\t\tmax={max}\r\n\t\t\t\t\treadOnly={readOnly}\r\n\t\t\t\t\taria-describedby={name + '-invalid'}\r\n\t\t\t\t\tplaceholder={props.placeholder ?? (showTranslationPlaceholder ? translatedFieldValue : '')}\r\n\t\t\t\t\tdata-testid={`field-${toKebabCase(name)}`}\r\n\t\t\t\t\trows={rows}\r\n\t\t\t\t\tcols={cols}\r\n\t\t\t\t/>\r\n\t\t\t\t{suffix ? <div className=\"input-wrapper__suffix\">{suffix}</div> : null}\r\n\t\t\t\t{subtext ? <FieldSubtext text={subtext} /> : null}\r\n\t\t\t</div>\r\n\r\n\t\t\t<ValidationMessages id={name + '-invalid'} meta={meta} />\r\n\t\t</FormGroup>\r\n\t);\r\n}\r\n\r\nexport default Input;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Question Mark help SVG for loading purposes\r\n *\r\n * @returns\r\n */\r\nfunction XSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg viewBox=\"0 0 32 32\" className={'icon icon-x ' + svgProps.class} focusable=\"false\" aria-hidden=\"true\">\r\n\t\t\t<path d=\"M8.469 2.824l20.702 20.702c1.56 1.56 1.56 4.088 0 5.648s-4.088 1.56-5.648 0l-20.702-20.702c-1.56-1.56-1.56-4.088 0-5.648s4.088-1.56 5.648 0z\" />\r\n\t\t\t<path d=\"M29.176 8.472l-20.702 20.702c-1.56 1.56-4.088 1.56-5.648 0l0.002 0.002c-1.56-1.56-1.56-4.088 0-5.648l20.702-20.702c1.56-1.56 4.088-1.56 5.648 0l-0.002-0.002c1.56 1.56 1.56 4.088 0 5.648z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nXSVG.defaultProps = { class: '' };\r\n\r\nexport default XSVG;\r\n","import moment, { Moment } from 'moment';\r\nimport AppState from 'AppState';\r\n\r\n/**\r\n * The default format to use when formatting times. Excludes time zone.\r\n */\r\nexport const DefaultDateFormat = 'MMMM Do YYYY';\r\n\r\n/**\r\n * The default format to use when formatting times. Includes time zone.\r\n */\r\nexport const DefaultTimeFormat = 'h:mm:ss a z';\r\n\r\n/**\r\n * The default format to use when formatting dates-times. Includes time zone.\r\n */\r\nexport const DefaultDateTimeFormat = `${DefaultDateFormat}, ${DefaultTimeFormat}`;\r\n\r\n/**\r\n * Wrapper for moment(...). Returns a moment localized to the server's time zone.\r\n * If time zone settings are configured improperly, behavior is undefined. The most likely behavior is that the client's time zone will be used.\r\n * @param inp The time input that would normally be given to moment(...).\r\n */\r\nexport function localMoment(inp?: moment.MomentInput) {\r\n\tlet t = moment(inp);\r\n\tif (AppState.settings.timeZone) {\r\n\t\tt = t.tz(AppState.settings.timeZone);\r\n\t} else {\r\n\t\tconsole.warn(\r\n\t\t\t\"The global time zone setting doesn't exist. Make sure tasks are running, and if that fails, check the Setting table for TimeZone.\",\r\n\t\t);\r\n\t}\r\n\treturn t;\r\n}\r\n\r\n/**\r\n * format local moment to GMT timezone format.\r\n */\r\nexport function timeZoneLessLocalMoment(moment: Moment) {\r\n\treturn moment.format('ddd MMM DD YYYY HH:mm:ss') + ' GMT-0000';\r\n}\r\n\r\n/**\r\n * Returns a function that returns a user friendly, server time zone localized date string when given either a date string or moment time.\r\n * @param format Overrides the format string to use for formatting the date time. Default: DefaultDateFormat\r\n */\r\nexport function formatDateTimeFunction(format?: string) {\r\n\t/** Wrapper for moment(...). Returns a moment localized to the servers time zone. */\r\n\treturn (inp?: moment.MomentInput) => {\r\n\t\treturn formatDateTime(inp, format);\r\n\t};\r\n}\r\n\r\n/**\r\n * Converts a moment or date string into a user friendly, server time zone localized date string.\r\n * @param inp The time input that would normally be given to moment(...).\r\n * @param format Overrides the format string to use for formatting the date time. Default: DefaultDateFormat\r\n */\r\nexport function formatDateTime(inp?: moment.MomentInput, format?: string): string {\r\n\tif (!inp) {\r\n\t\treturn '';\r\n\t}\r\n\r\n\treturn localMoment(inp || undefined).format(format || DefaultDateTimeFormat);\r\n}\r\n","import React from 'react';\r\nimport ListGroup from 'reactstrap/lib/ListGroup';\r\nimport ListGroupItem from 'reactstrap/lib/ListGroupItem';\r\nimport Table from 'reactstrap/lib/Table';\r\nimport Button from 'reactstrap/lib/Button';\r\n\r\ninterface TabsCategoryItemProps {\r\n\tchildren: React.ReactNode;\r\n\tkey?: string;\r\n\tonClick?: () => void;\r\n\tactive?: boolean;\r\n}\r\n\r\ninterface TabsListEmptyProps {\r\n\tmessage: string;\r\n}\r\n\r\ninterface TabsListItemNameProps {\r\n\tonClick: () => void;\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\ninterface TabsListActionsItemProps {\r\n\tonClick: () => void;\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\ninterface TabsComponentChildrenOnlyProps {\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\ninterface TabsListRowProps {\r\n\tkey: number | string;\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Component for displaying tabs with left and right column\r\n *\r\n */\r\nfunction Tabs(props: TabsComponentChildrenOnlyProps) {\r\n\treturn <div className=\"tabs\">{props.children}</div>;\r\n}\r\n\r\nexport default Tabs;\r\n\r\n/**\r\n * Component for displaying tab category column\r\n *\r\n */\r\nexport function TabsCategory(props: TabsComponentChildrenOnlyProps) {\r\n\treturn (\r\n\t\t<div className=\"tabs__categories\">\r\n\t\t\t<ListGroup className=\"tabs__cat-list\">{props.children}</ListGroup>\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\n/**\r\n * Component for displaying tab category item.\r\n *\r\n */\r\nexport function TabsCategoryItem(props: TabsCategoryItemProps) {\r\n\tconst { onClick, key, active, children } = props;\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<ListGroupItem\r\n\t\t\t\tkey={key}\r\n\t\t\t\tactive={active}\r\n\t\t\t\tonClick={onClick}\r\n\t\t\t\ttag=\"button\"\r\n\t\t\t\ttype=\"button\"\r\n\t\t\t\tfocusable=\"false\"\r\n\t\t\t\ttabIndex={-1}\r\n\t\t\t\tclassName=\"tabs__category-item\"\r\n\t\t\t>\r\n\t\t\t\t{children}\r\n\t\t\t</ListGroupItem>\r\n\t\t</>\r\n\t);\r\n}\r\n\r\n/**\r\n * Component for displaying tabs list.\r\n *\r\n */\r\nexport function TabsList(props: TabsComponentChildrenOnlyProps) {\r\n\treturn (\r\n\t\t<div className=\"tabs__list\">\r\n\t\t\t<div className=\"tabs__table-wrapper\">\r\n\t\t\t\t<Table striped responsive className=\"tabs-table\">\r\n\t\t\t\t\t<tbody>{props.children}</tbody>\r\n\t\t\t\t</Table>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\n/**\r\n * Component for displaying a tabs list actions.\r\n *\r\n */\r\nexport function TabsListActions(props: TabsComponentChildrenOnlyProps) {\r\n\treturn <div className=\"tabs-table__actions\">{props.children}</div>;\r\n}\r\n\r\n/**\r\n * Component for displaying a tabs list action item.\r\n *\r\n */\r\nexport function TabsListActionsItem(props: TabsListActionsItemProps) {\r\n\treturn (\r\n\t\t<Button className=\"tabs-table__actions-item\" color=\"link\" type=\"button\" onClick={props.onClick}>\r\n\t\t\t{props.children}\r\n\t\t</Button>\r\n\t);\r\n}\r\n\r\n/**\r\n * Component for displaying empty tab list.\r\n *\r\n */\r\nexport function TabsListEmpty(props: TabsListEmptyProps) {\r\n\treturn (\r\n\t\t<div className=\"tabs__empty\">\r\n\t\t\t<em>{props.message}</em>\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\n/**\r\n * Component for displaying a tabs list item.\r\n *\r\n */\r\nexport function TabsListItem(props: TabsComponentChildrenOnlyProps) {\r\n\treturn <td className=\"tabs-table__td\">{props.children}</td>;\r\n}\r\n\r\n/**\r\n * Component for displaying a tabs list item.\r\n *\r\n */\r\nexport function TabsListItemName(props: TabsListItemNameProps) {\r\n\treturn (\r\n\t\t<button onClick={props.onClick} className=\"tabs-table__name-btn\" type=\"button\">\r\n\t\t\t{props.children}\r\n\t\t</button>\r\n\t);\r\n}\r\n\r\n/**\r\n * Component for displaying a tabs list row.\r\n *\r\n */\r\nexport function TabsListRow(props: TabsListRowProps) {\r\n\treturn <tr key={props.key}>{props.children}</tr>;\r\n}\r\n","import AppState from 'AppState';\r\nimport React from 'react';\r\nimport { Field, FieldProps } from 'react-final-form';\r\nimport { useSortedCultures } from './CulturePicker';\r\nimport LocalizeMode from './LocalizeMode';\r\nimport withEditContext, { HasEditContext } from './withEditContext';\r\nimport classnames from 'classnames';\r\nimport { getErrorArray } from './fields/ValidationMessages';\r\nimport { toKebabCase } from '~/util/StringUtil';\r\n\r\nexport enum FallbackValueDisplayMode {\r\n\tHidden,\r\n\tInline,\r\n\tToggle,\r\n}\r\n\r\nexport interface TranslatedFieldProps extends FieldProps<any, any>, HasEditContext {\r\n\tprimaryCulture: string;\r\n\tstaticFallbackCulture?: boolean;\r\n\tstaticFallbackLabel?: string;\r\n\tfallbackValueDisplayMode?: FallbackValueDisplayMode;\r\n\ttranslatedFieldPrefix?: string;\r\n\ttranslatedFieldNameOverride?: string;\r\n\ttestId?: string;\r\n}\r\n\r\n/**\r\n * A form field wrapper that adds support to set values to different languages.\r\n * @param props\r\n */\r\nfunction TranslatedField(props: TranslatedFieldProps) {\r\n\tconst {\r\n\t\teditContext: { entityDefinition, currentCulture, primaryCulture },\r\n\t\tisRequired,\r\n\t\tautoFocus,\r\n\t\tlabel,\r\n\t\tname,\r\n\t\tstaticFallbackCulture,\r\n\t\tstaticFallbackLabel,\r\n\t\teditContext,\r\n\t\tfallbackValueDisplayMode = FallbackValueDisplayMode.Inline,\r\n\t\ttranslatedFieldPrefix,\r\n\t\ttranslatedFieldNameOverride,\r\n\t\ttestId,\r\n\t} = props;\r\n\r\n\tconst sortedCultures = useSortedCultures().map((culture) => ({ ...culture }));\r\n\tconst primaryCultureObj = AppState.cultures.find((culture) => culture.id === primaryCulture);\r\n\tconst singleCultureDisplayed = entityDefinition.localizeMode === LocalizeMode.SingleCulture;\r\n\tconst useStaticCulture = staticFallbackCulture && !singleCultureDisplayed;\r\n\r\n\tif (useStaticCulture) {\r\n\t\tconst fallback = sortedCultures.filter((c) => c.isFallback);\r\n\t\tif (fallback && fallback.length === 1) {\r\n\t\t\tsortedCultures.unshift({ ...fallback[0] });\r\n\t\t}\r\n\t}\r\n\r\n\tif (!entityDefinition.localizeMode || !currentCulture) {\r\n\t\tif (!currentCulture) {\r\n\t\t\t// console.warn('No culture defined on the record, returning wrapped field.');\r\n\t\t}\r\n\r\n\t\treturn <Field {...props} />;\r\n\t}\r\n\r\n\tconst fieldPrefix: string = translatedFieldPrefix ? translatedFieldPrefix + '.' : '';\r\n\tconst fieldOverride: string = translatedFieldNameOverride ? translatedFieldNameOverride : name;\r\n\r\n\treturn sortedCultures.map((culture, index) => {\r\n\t\tconst fieldHidden = currentCulture !== culture.id && singleCultureDisplayed;\r\n\t\tconst isStaticFallback = index === 0 && staticFallbackCulture;\r\n\t\tconst isPrimary = culture.id === primaryCulture;\r\n\t\tconst fieldIsRequired = isRequired && isPrimary;\r\n\t\tconst fieldAutoFocus = autoFocus && isPrimary;\r\n\t\tconst fieldName = isStaticFallback\r\n\t\t\t? name\r\n\t\t\t: isPrimary && !useStaticCulture\r\n\t\t\t? name\r\n\t\t\t: fieldPrefix + 'translations.' + culture.id + '.' + fieldOverride;\r\n\t\tlet labelValue = isStaticFallback ? (staticFallbackLabel ? staticFallbackLabel : label) : label;\r\n\t\tconst readOnly = isStaticFallback && !editContext.isCreateMode;\r\n\r\n\t\tif (!singleCultureDisplayed && !isStaticFallback) {\r\n\t\t\tlabelValue += ` / ${culture.name} (${culture.code})`;\r\n\t\t}\r\n\r\n\t\tif (fieldHidden) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<Field name={name} key={`${culture.id}-${index}`}>\r\n\t\t\t\t{({ input: { value }, meta }) => (\r\n\t\t\t\t\t// We need to check if the field has a value, so that we can conditionally render the 'translated-field' class on the div\r\n\t\t\t\t\t<Field name={fieldName}>\r\n\t\t\t\t\t\t{({ input: { value: translationValue } }) => {\r\n\t\t\t\t\t\t\tconst errors = getErrorArray(meta.submitError);\r\n\r\n\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t<div\r\n\t\t\t\t\t\t\t\t\tclassName={classnames({\r\n\t\t\t\t\t\t\t\t\t\t'translated-field': !translationValue && currentCulture !== primaryCulture,\r\n\t\t\t\t\t\t\t\t\t\t'translated-field--error':\r\n\t\t\t\t\t\t\t\t\t\t\tmeta.submitError &&\r\n\t\t\t\t\t\t\t\t\t\t\tmeta.touched &&\r\n\t\t\t\t\t\t\t\t\t\t\terrors.length > 0 &&\r\n\t\t\t\t\t\t\t\t\t\t\t!translationValue &&\r\n\t\t\t\t\t\t\t\t\t\t\tcurrentCulture !== primaryCulture,\r\n\t\t\t\t\t\t\t\t\t})}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\t\t\t{...props}\r\n\t\t\t\t\t\t\t\t\t\tparse={(value) => value}\r\n\t\t\t\t\t\t\t\t\t\tname={fieldName}\r\n\t\t\t\t\t\t\t\t\t\tlabel={labelValue}\r\n\t\t\t\t\t\t\t\t\t\tisRequired={fieldIsRequired}\r\n\t\t\t\t\t\t\t\t\t\tautoFocus={fieldAutoFocus}\r\n\t\t\t\t\t\t\t\t\t\treadOnly={readOnly}\r\n\t\t\t\t\t\t\t\t\t\ttranslatedFieldName={name !== fieldName ? name : undefined}\r\n\t\t\t\t\t\t\t\t\t\ttranslatedFieldValue={value}\r\n\t\t\t\t\t\t\t\t\t\tisShared={false}\r\n\t\t\t\t\t\t\t\t\t\tfallbackValueDisplayMode={fallbackValueDisplayMode}\r\n\t\t\t\t\t\t\t\t\t\tprimaryCulture={primaryCultureObj}\r\n\t\t\t\t\t\t\t\t\t\tmeta={meta}\r\n\t\t\t\t\t\t\t\t\t\tdata-testid={testId || `translated-field-${toKebabCase(name)}`}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t}}\r\n\t\t\t\t\t</Field>\r\n\t\t\t\t)}\r\n\t\t\t</Field>\r\n\t\t);\r\n\t});\r\n}\r\n\r\nexport default withEditContext(TranslatedField);\r\n","import React from 'react';\r\nimport { Button, ButtonProps } from 'reactstrap';\r\nimport XSVG from './svg/XSVG';\r\nimport classnames from 'classnames';\r\n\r\ninterface CircleButtonProps extends ButtonProps {\r\n\ticon?: React.ReactNode;\r\n\tlabel?: string;\r\n}\r\n\r\n/**\r\n * Displays an SVG inside a circular button.\r\n * @param props\r\n */\r\nfunction CircleButton(props: CircleButtonProps) {\r\n\t// eslint-disable-next-line no-unused-vars\r\n\tconst { icon, label = 'Remove', className = '', ...rest } = props;\r\n\r\n\treturn (\r\n\t\t<Button className={classnames('circle-button', { [className]: className })} {...rest}>\r\n\t\t\t{props.icon ? props.icon : <XSVG class=\"circle-button__icon\" />}\r\n\t\t\t<span className=\"visually-hidden\">{label}</span>\r\n\t\t</Button>\r\n\t);\r\n}\r\n\r\nexport default CircleButton;\r\n","/**\r\n * Returns the default font size of the document. Optionally, the parameter parent element.\r\n *\r\n * @param {*} parent Optional parent. Default value is body.\r\n * @returns\r\n */\r\nfunction getDefaultFontSize(parent?: any) {\r\n\tparent = parent || document.body;\r\n\tconst temp = document.createElement('div');\r\n\r\n\ttemp.style.cssText =\r\n\t\t'display:inline-block; padding:0; line-height:1; position:absolute; visibility:hidden; font-size:1em';\r\n\r\n\ttemp.appendChild(document.createTextNode('M'));\r\n\tparent.appendChild(temp);\r\n\tconst fontSize = temp.offsetHeight;\r\n\tparent.removeChild(temp);\r\n\treturn fontSize;\r\n}\r\n\r\nconst defaultFontSize = getDefaultFontSize();\r\n\r\nenum Breakpoints {\r\n\tXS = 35.938 * defaultFontSize,\r\n\tSM = 36 * defaultFontSize,\r\n\tMD = 48 * defaultFontSize,\r\n\tLG = 62 * defaultFontSize,\r\n\tXLG = 75 * defaultFontSize,\r\n}\r\n\r\nexport default Breakpoints;\r\n\r\nexport function slugify(text) {\r\n\treturn text\r\n\t\t.toString()\r\n\t\t.toLowerCase()\r\n\t\t.replace(/\\s+/g, '-') // Replace spaces with -\r\n\t\t.replace(/[^\\w\\-]+/g, '') // Remove all non-word chars\r\n\t\t.replace(/\\-\\-+/g, '-') // Replace multiple - with single -\r\n\t\t.replace(/^-+/, '') // Trim - from start of text\r\n\t\t.replace(/-+$/, ''); // Trim - from end of text\r\n}\r\n","import React, { useState, useEffect, useContext } from 'react';\r\nimport VisuallyHiddenAnnouncementContext, { RefElementType } from 'VisuallyHiddenAnnouncementContext';\r\n\r\ninterface VisuallyHiddenAnnouncementProps {\r\n\tchildren: React.ReactNode;\r\n}\r\n\r\n/**\r\n * Displays a page change alert for screen readers\r\n *\r\n * @param {*} props\r\n * @returns\r\n */\r\nfunction VisuallyHiddenAnnouncement(props: VisuallyHiddenAnnouncementProps) {\r\n\tconst [alert, setAlert] = useState('');\r\n\tconst [mainRef, setMainRef] = useState<RefElementType | null>(null);\r\n\r\n\treturn (\r\n\t\t<VisuallyHiddenAnnouncementContext.Provider value={{ setAlert, mainRef, setMainRef }}>\r\n\t\t\t{props.children}\r\n\t\t\t<div className=\"visually-hidden\" role=\"status\" aria-live=\"assertive\" aria-atomic=\"true\">\r\n\t\t\t\t{alert}\r\n\t\t\t</div>\r\n\t\t</VisuallyHiddenAnnouncementContext.Provider>\r\n\t);\r\n}\r\n\r\nexport default VisuallyHiddenAnnouncement;\r\n\r\ninterface VisuallyHiddenAnnouncementTriggerProps {\r\n\tmessage: string;\r\n}\r\n\r\n/**\r\n * Triggers a page change alert\r\n *\r\n * @export\r\n * @param {VisuallyHiddenAnnouncementTriggerProps} props\r\n * @returns\r\n */\r\nexport function VisuallyHiddenAnnouncementTrigger(props: VisuallyHiddenAnnouncementTriggerProps) {\r\n\tconst { setAlert, mainRef } = useContext(VisuallyHiddenAnnouncementContext);\r\n\r\n\t// on \"mount\" set the alert.\r\n\tuseEffect(() => {\r\n\t\tsetAlert(props.message);\r\n\r\n\t\tif (!mainRef || !mainRef.current) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmainRef.current.focus();\r\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\r\n\t}, [props.message]);\r\n\r\n\treturn null;\r\n}\r\n","import * as React from 'react';\r\nimport { FormGroup, Input as ReactStrapInput } from 'reactstrap';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { ValidationMessages } from 'components/shared/edit/fields';\r\nimport { InputType } from 'reactstrap/lib/Input';\r\n\r\n/**\r\n * Component that renders a Reactstrap input for login screens.\r\n *\r\n * @class Input\r\n * @extends {(React.Component<FieldRenderProps>)}\r\n */\r\nclass Input extends React.Component<FieldRenderProps<any, HTMLInputElement>> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tinput: { name, onChange, value, onBlur, onFocus, type },\r\n\t\t\tmeta,\r\n\t\t\t...rest\r\n\t\t} = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t<div className=\"input-wrapper\">\r\n\t\t\t\t\t<ReactStrapInput\r\n\t\t\t\t\t\tid={name}\r\n\t\t\t\t\t\ttype={type as InputType}\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tvalue={value}\r\n\t\t\t\t\t\tonChange={onChange}\r\n\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\t\tinvalid={!meta.dirtySinceLastSubmit && meta.submitError ? true : false}\r\n\t\t\t\t\t\taria-describedby={name + '-invalid'}\r\n\t\t\t\t\t\t{...rest}\r\n\t\t\t\t\t/>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<ValidationMessages id={name + '-invalid'} meta={meta} />\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Input;\r\n","import * as React from 'react';\r\n\r\n// components\r\nimport Input from '../shared/Input';\r\nimport { NavLink } from 'react-router-dom';\r\nimport { Alert, Button, Label } from 'reactstrap';\r\n\r\n// final form\r\nimport { Field, Form } from 'react-final-form';\r\n\r\n// networking\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport * as axios from 'axios';\r\nimport { AxiosError, AxiosResponse } from 'axios';\r\n\r\n// types\r\nimport { LoginResponse } from './types';\r\nimport Spinner from '../../../components/shared/Spinner';\r\n\r\nimport createDecorator from 'final-form-focus';\r\nimport { handleAxiosErrorWithValidation } from 'util/Misc';\r\nimport { setTenantIdToSessionAndLocalStorage } from '~/features/tenants/helpers/TenantHelper';\r\n\r\nconst focusOnErrors = createDecorator();\r\n\r\ninterface LoginState {\r\n\tshowLoginButtonLoading: boolean;\r\n\terror: AxiosError | null;\r\n\tannouncementText: string;\r\n}\r\n\r\n/**\r\n * Login component\r\n *\r\n * @class Login\r\n * @extends {React.PureComponent<any, LoginState>}\r\n */\r\nclass Login extends React.PureComponent<any, LoginState> {\r\n\tprivate cancelToken: any = null;\r\n\r\n\tconstructor(props: any) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = {\r\n\t\t\tshowLoginButtonLoading: false,\r\n\t\t\terror: null,\r\n\t\t\tannouncementText: '',\r\n\t\t};\r\n\t}\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\tif (this.cancelToken) {\r\n\t\t\tthis.cancelToken();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic submit = (formValues: any): Promise<void | Record<string, string>> => {\r\n\t\tif (this.cancelToken) {\r\n\t\t\tthis.cancelToken();\r\n\t\t}\r\n\r\n\t\tthis.setState({ showLoginButtonLoading: true, error: null });\r\n\r\n\t\tconst url = `/ajax/login/`;\r\n\r\n\t\tconst searchParams = new URLSearchParams(this.props.location ? this.props.location.search : '');\r\n\t\tconst redirectUrl = searchParams.get('ReturnUrl');\r\n\r\n\t\tthis.setState({ announcementText: 'Loading' });\r\n\r\n\t\treturn AxiosHelper.post(url, formValues, {\r\n\t\t\tcancelToken: new axios.default.CancelToken((token) => {\r\n\t\t\t\tthis.cancelToken = token;\r\n\t\t\t}),\r\n\t\t})\r\n\t\t\t.then((response: AxiosResponse<LoginResponse>) => {\r\n\t\t\t\tif (response.data.forceRedirect) {\r\n\t\t\t\t\twindow.location.href = response.data.redirectUrl;\r\n\t\t\t\t} else if (response.data.success) {\r\n\t\t\t\t\tsetTenantIdToSessionAndLocalStorage(response.data.tenantId || '');\r\n\t\t\t\t\twindow.location.href = redirectUrl ?? '/';\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (this.props.history) {\r\n\t\t\t\t\t\tthis.props.history.push(response.data.redirectUrl);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\tthis.setState({ showLoginButtonLoading: false, error });\r\n\t\t\t\treturn handleAxiosErrorWithValidation(error, 'An error occurred while logging in.');\r\n\t\t\t})\r\n\t\t\t.then((promise: any) => {\r\n\t\t\t\tthis.cancelToken = null;\r\n\t\t\t\treturn promise;\r\n\t\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"login-form-wrapper\">\r\n\t\t\t\t<div className=\"visually-hidden\" role=\"status\" aria-live=\"assertive\" aria-atomic=\"true\">\r\n\t\t\t\t\t{this.state.announcementText}\r\n\t\t\t\t</div>\r\n\t\t\t\t<Form\r\n\t\t\t\t\tonSubmit={this.submit}\r\n\t\t\t\t\tinitialValues={{\r\n\t\t\t\t\t\tusername: '',\r\n\t\t\t\t\t\tpassword: '',\r\n\t\t\t\t\t}}\r\n\t\t\t\t\tsubscription={{ submitting: true, submitError: true }}\r\n\t\t\t\t\tdecorators={[focusOnErrors]}\r\n\t\t\t\t\trender={({ handleSubmit, submitError }) => (\r\n\t\t\t\t\t\t<form onSubmit={handleSubmit} className=\"login-form\">\r\n\t\t\t\t\t\t\t{submitError ? (\r\n\t\t\t\t\t\t\t\t<div data-testid=\"login-error\">\r\n\t\t\t\t\t\t\t\t\t<Alert color=\"danger\">{submitError}</Alert>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t<Label for=\"username\">Username</Label>\r\n\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\tname=\"username\"\r\n\t\t\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\t\t\tclassName=\"login-form__text-input\"\r\n\t\t\t\t\t\t\t\tcomponent={Input}\r\n\t\t\t\t\t\t\t\tdata-testid=\"login-username\"\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t<Label for=\"password\">Password</Label>\r\n\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\tname=\"password\"\r\n\t\t\t\t\t\t\t\ttype=\"password\"\r\n\t\t\t\t\t\t\t\tclassName=\"login-form__text-input\"\r\n\t\t\t\t\t\t\t\tcomponent={Input}\r\n\t\t\t\t\t\t\t\tdata-testid=\"login-password\"\r\n\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t<div className=\"login-form__actions\">\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\t\t\tdisabled={this.state.showLoginButtonLoading}\r\n\t\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\t\tclassName=\"login-form__action login-form__submit-btn\"\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"login-submit\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t{this.state.showLoginButtonLoading ? <Spinner color=\"light\" centered /> : 'Login'}\r\n\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div className=\"login-form__footer\">\r\n\t\t\t\t\t\t\t\t<NavLink\r\n\t\t\t\t\t\t\t\t\tclassName=\"login-form__link login-form__action\"\r\n\t\t\t\t\t\t\t\t\texact\r\n\t\t\t\t\t\t\t\t\tactiveClassName=\"active\"\r\n\t\t\t\t\t\t\t\t\tto=\"/account/forgot-password\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\tForgot Password?\r\n\t\t\t\t\t\t\t\t</NavLink>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div className=\"login-form__actions\" />\r\n\t\t\t\t\t\t</form>\r\n\t\t\t\t\t)}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Login;\r\n","import * as React from 'react';\r\n\r\n// components\r\nimport Input from '../shared/Input';\r\nimport { NavLink } from 'react-router-dom';\r\nimport { Button, Alert } from 'reactstrap';\r\n\r\n// final form\r\nimport { Form, Field } from 'react-final-form';\r\n\r\n// networking\r\n\r\nimport * as axios from 'axios';\r\nimport { AxiosError } from 'axios';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport Spinner from 'components/shared/Spinner';\r\n\r\nimport createDecorator from 'final-form-focus';\r\nimport { handleAxiosErrorWithValidation } from 'util/Misc';\r\n\r\nexport interface ForgotPasswordState {\r\n\tsuccess: boolean;\r\n}\r\n\r\nconst focusOnErrors = createDecorator();\r\n\r\n/**\r\n * ForgotPassword component\r\n *\r\n * React component handling responsible for forgot password page.\r\n *\r\n * @class ForgotPassword\r\n * @extends {React.PureComponent<any, ForgotPasswordState>}\r\n */\r\nclass ForgotPassword extends React.PureComponent<any, ForgotPasswordState> {\r\n\tprivate cancelToken: any = null;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tthis.state = { success: false };\r\n\t}\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\tif (this.cancelToken) {\r\n\t\t\tthis.cancelToken();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic submit = (formValues: any): Promise<void | Record<string, string>> => {\r\n\t\tif (this.cancelToken) {\r\n\t\t\tthis.cancelToken();\r\n\t\t}\r\n\r\n\t\tconst url = '/ajax/forgot-password/';\r\n\r\n\t\treturn AxiosHelper.post(url, formValues, {\r\n\t\t\tcancelToken: new axios.default.CancelToken((token) => {\r\n\t\t\t\tthis.cancelToken = token;\r\n\t\t\t}),\r\n\t\t})\r\n\t\t\t.then(() => {\r\n\t\t\t\tthis.setState({ success: true });\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\treturn handleAxiosErrorWithValidation(error, null);\r\n\t\t\t})\r\n\t\t\t.then((promise: any) => {\r\n\t\t\t\tthis.cancelToken = null;\r\n\t\t\t\treturn promise;\r\n\t\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"login-form-wrapper\">\r\n\t\t\t\t{this.state.success ? (\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<h2 className=\"login-form-heading\">Success</h2>\r\n\t\t\t\t\t\t<p className=\"login-form-heading\">Please check your email to reset your password.</p>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<Form\r\n\t\t\t\t\t\tonSubmit={this.submit}\r\n\t\t\t\t\t\tsubscription={{ submitting: true, submitError: true }}\r\n\t\t\t\t\t\tdecorators={[focusOnErrors]}\r\n\t\t\t\t\t\trender={({ handleSubmit, submitError, submitting }) => (\r\n\t\t\t\t\t\t\t<form onSubmit={handleSubmit} className=\"login-form\">\r\n\t\t\t\t\t\t\t\t<h2 className=\"login-form-heading\">Please enter your username.</h2>\r\n\t\t\t\t\t\t\t\t{submitError ? (\r\n\t\t\t\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t\t\t\t<Alert color=\"danger\">{submitError}</Alert>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\t\tname=\"username\"\r\n\t\t\t\t\t\t\t\t\tplaceholder=\"username\"\r\n\t\t\t\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\t\t\t\tclassName=\" login-form__text-input\"\r\n\t\t\t\t\t\t\t\t\tindicateDirty={false}\r\n\t\t\t\t\t\t\t\t\tcomponent={Input}\r\n\t\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t\t<div className=\"login-form__actions \">\r\n\t\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\t\t\t\tdisabled={submitting}\r\n\t\t\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\t\t\tclassName=\"login-form__action login-form__submit-btn\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\tContinue\r\n\t\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t\t\t<div className=\"login-form__footer form-group\">\r\n\t\t\t\t\t\t\t\t\t<NavLink\r\n\t\t\t\t\t\t\t\t\t\tclassName=\"login-form__action login-form__link\"\r\n\t\t\t\t\t\t\t\t\t\texact\r\n\t\t\t\t\t\t\t\t\t\tactiveClassName=\"active\"\r\n\t\t\t\t\t\t\t\t\t\tto=\"/login\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\tCancel\r\n\t\t\t\t\t\t\t\t\t</NavLink>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<div className=\"login-form__actions form-group\">{submitting ? <Spinner /> : null}</div>\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)}\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default ForgotPassword;\r\n","import * as React from 'react';\r\nimport { NavLink } from 'react-router-dom';\r\n\r\n/**\r\n * Confirm component\r\n *\r\n * React component responsible for handling status messages for email confirmation.\r\n *\r\n * @class Confirm\r\n * @extends {React.SFC<any>}\r\n */\r\nconst Confirm: React.SFC<any> = (props) => {\r\n\tlet message: string | null = 'An error occurred while confirming your email address.';\r\n\tlet loginMessage: string | null = null;\r\n\r\n\tif (props.location && props.location.search) {\r\n\t\tconst searchParams = new URLSearchParams(props.location.search);\r\n\t\tif (searchParams.has('message')) {\r\n\t\t\tmessage = searchParams.get('message');\r\n\t\t}\r\n\t\tif (searchParams.has('loginMessage')) {\r\n\t\t\tloginMessage = searchParams.get('loginMessage');\r\n\t\t}\r\n\t}\r\n\r\n\treturn (\r\n\t\t<div>\r\n\t\t\t<h2 className=\"login-form-heading\">{message}</h2>\r\n\t\t\t{loginMessage ? (\r\n\t\t\t\t<p className=\"login-form-heading\">\r\n\t\t\t\t\t<NavLink to=\"/login\" exact className=\"text-bold\" activeClassName=\"active\">\r\n\t\t\t\t\t\t{loginMessage}\r\n\t\t\t\t\t</NavLink>\r\n\t\t\t\t</p>\r\n\t\t\t) : null}\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default Confirm;\r\n","import * as React from 'react';\r\nimport { Alert } from 'reactstrap';\r\nimport { NavLink } from 'react-router-dom';\r\n\r\n/**\r\n * Lockout component\r\n *\r\n * React component responsible for handling lockout.\r\n *\r\n * @class Lockout\r\n * @extends {React.SFC}\r\n */\r\nconst Lockout: React.SFC = () => {\r\n\treturn (\r\n\t\t<div className=\"login-form\">\r\n\t\t\t<Alert color=\"danger\">\r\n\t\t\t\tThis account has been locked out, please try again later.{' '}\r\n\t\t\t\t<NavLink to=\"/login\" exact activeClassName=\"active\">\r\n\t\t\t\t\tClick here to go back to login.\r\n\t\t\t\t</NavLink>\r\n\t\t\t</Alert>\r\n\t\t</div>\r\n\t);\r\n};\r\n\r\nexport default Lockout;\r\n","import * as React from 'react';\r\nimport { FieldRenderProps } from 'react-final-form';\r\nimport { FormGroup, Label, Input as ReactStrapInput } from 'reactstrap';\r\nimport Octicon, { Check } from '@githubprimer/octicons-react';\r\nimport { toKebabCase } from '~/util/StringUtil';\r\n\r\ntype SimpleCheckBoxProps = FieldRenderProps<string, HTMLInputElement> & {\r\n\tlabel: string;\r\n};\r\n\r\nclass SimpleCheckBox extends React.Component<SimpleCheckBoxProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tinput: { name, onChange, onBlur, onFocus, checked },\r\n\t\t\tmeta,\r\n\t\t\tlabel,\r\n\t\t\ttype = 'checkbox',\r\n\t\t\tdisabled,\r\n\t\t\tautoFocus,\r\n\t\t} = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t<FormGroup>\r\n\t\t\t\t<Label for={name} className=\"fancy-checkbox\">\r\n\t\t\t\t\t<ReactStrapInput\r\n\t\t\t\t\t\tid={name}\r\n\t\t\t\t\t\tname={name}\r\n\t\t\t\t\t\tclassName=\"fancy-checkbox__checkbox\"\r\n\t\t\t\t\t\ttype={type}\r\n\t\t\t\t\t\tchecked={checked}\r\n\t\t\t\t\t\tonChange={onChange}\r\n\t\t\t\t\t\tdisabled={disabled}\r\n\t\t\t\t\t\tautoFocus={autoFocus}\r\n\t\t\t\t\t\tinvalid={!meta.dirtySinceLastSubmit && meta.submitError ? true : false}\r\n\t\t\t\t\t\tonBlur={onBlur}\r\n\t\t\t\t\t\tonFocus={onFocus}\r\n\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t<span className=\"fancy-checkbox__box\" data-testid={`checkbox-${toKebabCase(name)}`}>\r\n\t\t\t\t\t\t{checked ? <Octicon icon={Check} ariaLabel=\"Checkmark\" /> : null}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t<span className=\"fancy-checkbox__text\" data-testid={`checkbox-${toKebabCase(label)}`}>\r\n\t\t\t\t\t\t{label}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</Label>\r\n\t\t\t</FormGroup>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default SimpleCheckBox;\r\n","import * as React from 'react';\r\n\r\n// components\r\nimport Input from '../shared/Input';\r\nimport { NavLink } from 'react-router-dom';\r\nimport { Button, Alert } from 'reactstrap';\r\n\r\nimport { Form, Field } from 'react-final-form';\r\n\r\n// networking\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport * as axios from 'axios';\r\nimport { AxiosError, AxiosResponse } from 'axios';\r\n\r\n// types\r\nimport { LoginResponse } from './types';\r\nimport Spinner from 'components/shared/Spinner';\r\nimport { handleAxiosErrorWithValidation } from 'util/Misc';\r\n\r\nimport createDecorator from 'final-form-focus';\r\nimport SimpleCheckBox from '../shared/SimpleCheckBox';\r\nconst focusOnErrors = createDecorator();\r\n\r\n/**\r\n * LoginTwoFactor component\r\n *\r\n * @class LoginTwoFactor\r\n * @extends {React.PureComponent<any>}\r\n */\r\nclass LoginTwoFactor extends React.PureComponent<any> {\r\n\tprivate cancelToken: any = null;\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\tif (this.cancelToken) {\r\n\t\t\tthis.cancelToken();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic submit = (formValues: any): Promise<void | unknown> => {\r\n\t\tif (this.cancelToken) {\r\n\t\t\tthis.cancelToken();\r\n\t\t}\r\n\r\n\t\tconst url = `/ajax/login-two-factor/`;\r\n\r\n\t\tconst searchParams = new URLSearchParams(this.props.location ? this.props.location.search : '');\r\n\t\tconst redirectUrl = searchParams.get('ReturnUrl');\r\n\r\n\t\treturn AxiosHelper.post(url, formValues, {\r\n\t\t\tcancelToken: new axios.default.CancelToken((token) => {\r\n\t\t\t\tthis.cancelToken = token;\r\n\t\t\t}),\r\n\t\t})\r\n\t\t\t.then((response: AxiosResponse<LoginResponse>) => {\r\n\t\t\t\tif (response.data.success) {\r\n\t\t\t\t\twindow.location.href = redirectUrl ? redirectUrl : '/';\r\n\t\t\t\t} else {\r\n\t\t\t\t\twindow.location.href = response.data.redirectUrl;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\treturn handleAxiosErrorWithValidation(error, null);\r\n\t\t\t})\r\n\t\t\t.then((promise: any) => {\r\n\t\t\t\tthis.cancelToken = null;\r\n\t\t\t\treturn promise;\r\n\t\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"login-form\">\r\n\t\t\t\t<div>\r\n\t\t\t\t\t<h2 className=\"login-form-heading\">\r\n\t\t\t\t\t\tYour login is protected with an authenticator app. Enter your authenticator code below.\r\n\t\t\t\t\t</h2>\r\n\t\t\t\t</div>\r\n\r\n\t\t\t\t<Form\r\n\t\t\t\t\tonSubmit={this.submit}\r\n\t\t\t\t\tdecorators={[focusOnErrors]}\r\n\t\t\t\t\tsubscription={{ submitting: true, submitError: true }}\r\n\t\t\t\t\trender={({ handleSubmit, submitError, submitting }) => (\r\n\t\t\t\t\t\t<form onSubmit={handleSubmit} className=\"login-form\">\r\n\t\t\t\t\t\t\t{submitError ? (\r\n\t\t\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t\t\t<Alert color=\"danger\">{submitError}</Alert>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\tname=\"twoFactorCode\"\r\n\t\t\t\t\t\t\t\tlabel=\"Authenticator code\"\r\n\t\t\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\t\t\tclassName=\"login-form__row login-form__text-input\"\r\n\t\t\t\t\t\t\t\tcomponent={Input}\r\n\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t<div className=\"text-center login-form-heading\">\r\n\t\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\t\tname=\"rememberThisBrowser\"\r\n\t\t\t\t\t\t\t\t\tlabel=\"Remember this browser\"\r\n\t\t\t\t\t\t\t\t\ttype=\"checkbox\"\r\n\t\t\t\t\t\t\t\t\tcomponent={SimpleCheckBox}\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t\t<div className=\"login-form__actions form-group\">\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\t\t\tdisabled={submitting}\r\n\t\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"submit-2fa-login-btn\"\r\n\t\t\t\t\t\t\t\t\tclassName=\"login-form__action login-form__submit-btn\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\tLogin\r\n\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t\t<div className=\"login-form__actions form-group\">\r\n\t\t\t\t\t\t\t\t<p className=\"text-center login-form-heading\">\r\n\t\t\t\t\t\t\t\t\tDon&apos;t have access to your authenticator device? <br />\r\n\t\t\t\t\t\t\t\t\tYou can\r\n\t\t\t\t\t\t\t\t\t<NavLink\r\n\t\t\t\t\t\t\t\t\t\tclassName=\"login-form__action login-form__link\"\r\n\t\t\t\t\t\t\t\t\t\texact\r\n\t\t\t\t\t\t\t\t\t\tactiveClassName=\"active\"\r\n\t\t\t\t\t\t\t\t\t\tto=\"/account/login-recovery\"\r\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"login-recovery-link\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\t{' '}\r\n\t\t\t\t\t\t\t\t\t\tlog in with a recovery code\r\n\t\t\t\t\t\t\t\t\t</NavLink>\r\n\t\t\t\t\t\t\t\t</p>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div className=\"login-form__actions form-group\">{submitting ? <Spinner /> : null}</div>\r\n\t\t\t\t\t\t</form>\r\n\t\t\t\t\t)}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default LoginTwoFactor;\r\n","import * as React from 'react';\r\n\r\n// components\r\nimport Input from '../shared/Input';\r\nimport { Button, Alert } from 'reactstrap';\r\n\r\n// final form\r\nimport { Form, Field } from 'react-final-form';\r\n\r\n// networking\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport * as axios from 'axios';\r\nimport { AxiosError, AxiosResponse } from 'axios';\r\n\r\n// types\r\nimport { LoginResponse } from './types';\r\nimport Spinner from 'components/shared/Spinner';\r\nimport { handleAxiosErrorWithValidation } from 'util/Misc';\r\n\r\n/**\r\n * LoginRecovery component\r\n *\r\n * @class LoginRecovery\r\n * @extends {React.PureComponent<any>}\r\n */\r\nclass LoginRecovery extends React.PureComponent<any> {\r\n\tprivate cancelToken: any = null;\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\tif (this.cancelToken) {\r\n\t\t\tthis.cancelToken();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic submit = (formValues: any): Promise<void | Record<string, string>> => {\r\n\t\tif (this.cancelToken) {\r\n\t\t\tthis.cancelToken();\r\n\t\t}\r\n\r\n\t\tconst url = `/ajax/login-recovery/`;\r\n\r\n\t\tconst searchParams = new URLSearchParams(this.props.location ? this.props.location.search : '');\r\n\t\tconst redirectUrl = searchParams.get('ReturnUrl');\r\n\r\n\t\treturn AxiosHelper.post(url, formValues, {\r\n\t\t\tcancelToken: new axios.default.CancelToken((token) => {\r\n\t\t\t\tthis.cancelToken = token;\r\n\t\t\t}),\r\n\t\t})\r\n\t\t\t.then((response: AxiosResponse<LoginResponse>) => {\r\n\t\t\t\tif (response.data.success) {\r\n\t\t\t\t\twindow.location.href = redirectUrl ? redirectUrl : '/';\r\n\t\t\t\t} else {\r\n\t\t\t\t\twindow.location.href = response.data.redirectUrl;\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\treturn handleAxiosErrorWithValidation(error, null);\r\n\t\t\t})\r\n\t\t\t.then((promise: any) => {\r\n\t\t\t\tthis.cancelToken = null;\r\n\t\t\t\treturn promise;\r\n\t\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"login-form\">\r\n\t\t\t\t<div>\r\n\t\t\t\t\t<h2 className=\"login-form-heading\">\r\n\t\t\t\t\t\tYou have requested to log in with a recovery code. This login will not be remembered until you\r\n\t\t\t\t\t\tprovide an authenticator app code at log in or disable 2FA and log in again.\r\n\t\t\t\t\t</h2>\r\n\t\t\t\t</div>\r\n\t\t\t\t<Form\r\n\t\t\t\t\tonSubmit={this.submit}\r\n\t\t\t\t\tsubscription={{ submitting: true, submitError: true }}\r\n\t\t\t\t\trender={({ handleSubmit, submitError, submitting }) => (\r\n\t\t\t\t\t\t<form onSubmit={handleSubmit} className=\"login-form\">\r\n\t\t\t\t\t\t\t{submitError ? (\r\n\t\t\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t\t\t<Alert color=\"danger\">{submitError}</Alert>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\tname=\"recoveryCode\"\r\n\t\t\t\t\t\t\t\tplaceholder=\"#123456\"\r\n\t\t\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\t\t\tclassName=\"login-form__row login-form__text-input\"\r\n\t\t\t\t\t\t\t\tindicateDirty={false}\r\n\t\t\t\t\t\t\t\tcomponent={Input}\r\n\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t<div className=\"login-form__actions form-group\">\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\t\t\tdisabled={submitting}\r\n\t\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"login-recovery-code-btn\"\r\n\t\t\t\t\t\t\t\t\tclassName=\"btn login-form__action login-form__submit-btn\"\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\tLogin\r\n\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t<div className=\"login-form__actions form-group\">{submitting ? <Spinner /> : null}</div>\r\n\t\t\t\t\t\t</form>\r\n\t\t\t\t\t)}\r\n\t\t\t\t/>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default LoginRecovery;\r\n","import * as React from 'react';\r\n\r\nimport { Button, Alert } from 'reactstrap';\r\n\r\nimport { Form, Field } from 'react-final-form';\r\n\r\n// networking\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport * as axios from 'axios';\r\nimport { AxiosError } from 'axios';\r\n\r\n// components\r\nimport Input from '../shared/Input';\r\nimport Spinner from 'components/shared/Spinner';\r\nimport { handleAxiosErrorWithValidation } from 'util/Misc';\r\nimport { NavLink } from 'react-router-dom';\r\n\r\nimport createDecorator from 'final-form-focus';\r\nconst focusOnErrors = createDecorator();\r\n\r\nexport interface ResetPasswordState {\r\n\tcode: string | null;\r\n\tsuccess: boolean;\r\n}\r\n\r\n/**\r\n * ResetPassword component\r\n *\r\n * @class ResetPassword\r\n * @extends {React.PureComponent<any>}\r\n */\r\nclass ResetPassword extends React.PureComponent<any, ResetPasswordState> {\r\n\tprivate cancelToken: any = null;\r\n\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\r\n\t\tlet code: string | null = null;\r\n\r\n\t\tif (props.location && props.location.search) {\r\n\t\t\tconst searchParams = new URLSearchParams(props.location.search);\r\n\t\t\tif (searchParams.has('code')) {\r\n\t\t\t\tcode = searchParams.get('code');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.state = {\r\n\t\t\tcode,\r\n\t\t\tsuccess: false,\r\n\t\t};\r\n\t}\r\n\r\n\tpublic componentWillUnmount() {\r\n\t\tif (this.cancelToken) {\r\n\t\t\tthis.cancelToken();\r\n\t\t}\r\n\t}\r\n\r\n\tpublic submit = (formValues: any): Promise<void | Record<string, string>> => {\r\n\t\tif (this.cancelToken) {\r\n\t\t\tthis.cancelToken();\r\n\t\t}\r\n\r\n\t\tconst url = `/ajax/reset-password/`;\r\n\r\n\t\tformValues.code = this.state.code;\r\n\r\n\t\treturn AxiosHelper.post(url, formValues, {\r\n\t\t\tcancelToken: new axios.default.CancelToken((token) => {\r\n\t\t\t\tthis.cancelToken = token;\r\n\t\t\t}),\r\n\t\t})\r\n\t\t\t.then(() => {\r\n\t\t\t\tthis.setState({ success: true });\r\n\t\t\t})\r\n\t\t\t.catch((error: AxiosError) => {\r\n\t\t\t\treturn handleAxiosErrorWithValidation(error, null);\r\n\t\t\t})\r\n\t\t\t.then((promise: any) => {\r\n\t\t\t\tthis.cancelToken = null;\r\n\t\t\t\treturn promise;\r\n\t\t\t});\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tif (this.state.success) {\r\n\t\t\treturn (\r\n\t\t\t\t<div className=\"login-form\">\r\n\t\t\t\t\t<div>\r\n\t\t\t\t\t\t<h2 className=\"login-form-heading\">Success</h2>\r\n\t\t\t\t\t\t<h2 className=\"login-form-heading\">\r\n\t\t\t\t\t\t\tYour password has been successfully reset. Now you can login using your new password.\r\n\t\t\t\t\t\t</h2>\r\n\r\n\t\t\t\t\t\t<p className=\"login-form-heading\">\r\n\t\t\t\t\t\t\t<NavLink to=\"/login\" exact className=\"text-bold\" activeClassName=\"active\">\r\n\t\t\t\t\t\t\t\tClick here to go back to the login page.\r\n\t\t\t\t\t\t\t</NavLink>{' '}\r\n\t\t\t\t\t\t</p>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t<div className=\"login-form-wrapper\">\r\n\t\t\t\t{!this.state.code ? (\r\n\t\t\t\t\t<div className=\"text-center\">\r\n\t\t\t\t\t\t<h2 className=\"login-form-heading\">Error</h2>\r\n\t\t\t\t\t\t<p className=\"login-form-heading\">Invalid reset code.</p>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<Form\r\n\t\t\t\t\t\tonSubmit={this.submit}\r\n\t\t\t\t\t\tdecorators={[focusOnErrors]}\r\n\t\t\t\t\t\tsubscription={{ submitting: true, submitError: true }}\r\n\t\t\t\t\t\trender={({ handleSubmit, submitError, submitting }) => (\r\n\t\t\t\t\t\t\t<form onSubmit={handleSubmit} className=\"login-form\">\r\n\t\t\t\t\t\t\t\t<h2 className=\"login-form-heading\">\r\n\t\t\t\t\t\t\t\t\tPlease enter your username and your new password.\r\n\t\t\t\t\t\t\t\t</h2>\r\n\t\t\t\t\t\t\t\t{submitError ? (\r\n\t\t\t\t\t\t\t\t\t<div data-testid=\"login-error\">\r\n\t\t\t\t\t\t\t\t\t\t<Alert color=\"danger\">{submitError}</Alert>\r\n\t\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\t\tname=\"username\"\r\n\t\t\t\t\t\t\t\t\tplaceholder=\"username\"\r\n\t\t\t\t\t\t\t\t\ttype=\"text\"\r\n\t\t\t\t\t\t\t\t\tautoFocus\r\n\t\t\t\t\t\t\t\t\tindicateDirty={false}\r\n\t\t\t\t\t\t\t\t\tclassName=\"login-form__row login-form__text-input\"\r\n\t\t\t\t\t\t\t\t\tcomponent={Input}\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"login-username\"\r\n\t\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\t\tname=\"password\"\r\n\t\t\t\t\t\t\t\t\tplaceholder=\"password\"\r\n\t\t\t\t\t\t\t\t\ttype=\"password\"\r\n\t\t\t\t\t\t\t\t\tindicateDirty={false}\r\n\t\t\t\t\t\t\t\t\tclassName=\"login-form__row login-form__text-input\"\r\n\t\t\t\t\t\t\t\t\tcomponent={Input}\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"login-password\"\r\n\t\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\t\t\tname=\"confirmPassword\"\r\n\t\t\t\t\t\t\t\t\tplaceholder=\"confirm password\"\r\n\t\t\t\t\t\t\t\t\ttype=\"password\"\r\n\t\t\t\t\t\t\t\t\tindicateDirty={false}\r\n\t\t\t\t\t\t\t\t\tclassName=\"login-form__row login-form__text-input\"\r\n\t\t\t\t\t\t\t\t\tcomponent={Input}\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"login-confirm-password\"\r\n\t\t\t\t\t\t\t\t/>\r\n\r\n\t\t\t\t\t\t\t\t<div className=\"login-form__actions form-group\">\r\n\t\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\t\t\t\tdisabled={submitting}\r\n\t\t\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\t\t\tclassName=\"btn login-form__action login-form__submit-btn\"\r\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"login-submit\"\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\tSet Password\r\n\t\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t\t\t<div className=\"login-form__actions form-group\">{submitting ? <Spinner /> : null}</div>\r\n\t\t\t\t\t\t\t</form>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t/>\r\n\t\t\t\t)}\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default ResetPassword;\r\n","import EnableDuoButton from 'features/admin-profile/two-factor-providers/duo-security/EnableDuoButton';\r\nimport EnableTotpAuthenticator from 'features/admin-profile/two-factor-providers/totp/EnableTotpAuthenticator';\r\nimport React, { useState } from 'react';\r\nimport { Card, CardBody } from 'reactstrap';\r\nimport Button from 'reactstrap/lib/Button';\r\nimport CardHeader from 'reactstrap/lib/CardHeader';\r\n\r\ninterface TwoFactorData {\r\n\ttwoFactorRequired: boolean;\r\n\tduoSecurityEnabled: boolean;\r\n\tduoSecurityForLdapOnly: boolean;\r\n\tisLdapUser: boolean;\r\n\tshouldShowRegistrationPage: boolean;\r\n}\r\n\r\nconst redirectToAdmin = () => window.location.replace('/');\r\nconst redirectToLicenseRegistration = () => window.location.replace('/register-installation');\r\n\r\n/**\r\n * Login Two Factor Authenticator Setup screen, shown after a user logs in but before they visit the CMS\r\n */\r\nexport default function LoginTwoFactorSetup() {\r\n\tconst [totpSetupActive, setTotpSetupActive] = useState(false);\r\n\tconst [duoSetupActive, setDuoSetupActive] = useState(false);\r\n\tconst is2faUiActive = totpSetupActive || duoSetupActive;\r\n\r\n\t// Load two-factor data from the page javascript\r\n\tconst twoFactorData: TwoFactorData = (window as any).__ROC_TWO_FACTOR_DATA__;\r\n\tconst {\r\n\t\ttwoFactorRequired,\r\n\t\tduoSecurityEnabled,\r\n\t\tduoSecurityForLdapOnly,\r\n\t\tisLdapUser,\r\n\t\tshouldShowRegistrationPage,\r\n\t} = twoFactorData;\r\n\r\n\tconst hideDuo = !duoSecurityEnabled || (duoSecurityForLdapOnly && !isLdapUser);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t<div className=\"login-2fa\">\r\n\t\t\t\t<Card>\r\n\t\t\t\t\t<CardHeader>\r\n\t\t\t\t\t\t<strong>\r\n\t\t\t\t\t\t\tTwo Factor Authentication Setup {twoFactorRequired ? '(Required)' : '(Optional)'}\r\n\t\t\t\t\t\t</strong>\r\n\t\t\t\t\t</CardHeader>\r\n\t\t\t\t\t<CardBody>\r\n\t\t\t\t\t\t{!hideDuo && (!is2faUiActive || duoSetupActive) ? (\r\n\t\t\t\t\t\t\t<EnableDuoButton setActivated={setDuoSetupActive} />\r\n\t\t\t\t\t\t) : null}{' '}\r\n\t\t\t\t\t\t{!is2faUiActive || totpSetupActive ? (\r\n\t\t\t\t\t\t\t<EnableTotpAuthenticator\r\n\t\t\t\t\t\t\t\tsetActivated={setTotpSetupActive}\r\n\t\t\t\t\t\t\t\tonFinished={() => {\r\n\t\t\t\t\t\t\t\t\tshouldShowRegistrationPage ? redirectToLicenseRegistration() : redirectToAdmin();\r\n\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t{twoFactorRequired ? null : (\r\n\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\tdata-testid=\"skip-2fa-setup\"\r\n\t\t\t\t\t\t\t\t\tonClick={() => {\r\n\t\t\t\t\t\t\t\t\t\tshouldShowRegistrationPage\r\n\t\t\t\t\t\t\t\t\t\t\t? redirectToLicenseRegistration()\r\n\t\t\t\t\t\t\t\t\t\t\t: redirectToAdmin();\r\n\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\tSkip\r\n\t\t\t\t\t\t\t\t</Button>{' '}\r\n\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t)}\r\n\t\t\t\t\t</CardBody>\r\n\t\t\t\t</Card>\r\n\t\t\t\t<br />\r\n\t\t\t</div>\r\n\t\t</>\r\n\t);\r\n}\r\n","import React from 'react';\r\nimport Alert from 'reactstrap/lib/Alert';\r\n\r\ninterface DuoErrorProps {\r\n\terrorMessage?: string;\r\n}\r\n\r\n/**\r\n * Basic component to display an error message for when an error occurs when trying to do 2FA authentication with Duo\r\n */\r\nexport default function DuoError(props?: DuoErrorProps) {\r\n\treturn (\r\n\t\t<Alert color=\"warning\">\r\n\t\t\t<strong>\r\n\t\t\t\tAn error occurred when trying to log you in using Duo.\r\n\t\t\t\t<p />\r\n\t\t\t\t{props?.errorMessage ? (\r\n\t\t\t\t\t<>\r\n\t\t\t\t\t\t{props.errorMessage}\r\n\t\t\t\t\t\t<p />\r\n\t\t\t\t\t</>\r\n\t\t\t\t) : null}\r\n\t\t\t</strong>\r\n\t\t\t<a href=\"/login\">Click here to try again.</a>\r\n\t\t</Alert>\r\n\t);\r\n}\r\n\r\n/**\r\n * Component to display the error message that Duo is unavailable.\r\n */\r\nexport const DuoOffline = () => <DuoError errorMessage=\"Duo is currently unavailable.\" />;\r\n","import { createDecorator } from 'components/shared/edit/decorators/focusOnErrorsCustom';\r\nimport EnumDropdown from 'components/shared/edit/fields/EnumDropdown';\r\nimport Spinner from 'components/shared/Spinner';\r\nimport React, { useState } from 'react';\r\nimport { Field, Form } from 'react-final-form';\r\nimport { Alert, Button } from 'reactstrap';\r\nimport AxiosHelper from 'services/AxiosHelper';\r\nimport { handleAxiosErrorWithValidation } from 'util/Misc';\r\nimport Input from '../shared/Input';\r\n\r\nconst focusOnErrors = createDecorator();\r\n\r\ninterface RegisterInstallationData {\r\n\tcanSkipRegistration: boolean;\r\n\thasKey: boolean;\r\n}\r\n\r\nenum RegistrationEnvironment {\r\n\tPreProduction = 'Pre-Production',\r\n\tProduction = 'Production',\r\n}\r\n\r\ninterface FormData {\r\n\tlicenseKey: string;\r\n\tregistrationEnvironment: RegistrationEnvironment;\r\n}\r\n\r\ninterface RegistrationResponse {\r\n\tmessage?: string;\r\n\tredirectUrl?: string;\r\n\tsuccess: boolean;\r\n}\r\n\r\nconst redirectToAdmin = () => window.location.replace('/');\r\n\r\nexport default function RegisterInstallation(props: Readonly<any>) {\r\n\tconst searchParams = new URLSearchParams(props.location ? props.location.search : '');\r\n\tconst redirectUrl = searchParams.get('ReturnUrl');\r\n\tconst [registrationWarnings, setRegistrationWarnings] = useState('');\r\n\r\n\tconst submit = async (formValues: FormData) => {\r\n\t\tconst url = `/ajax/register-installation/`;\r\n\r\n\t\ttry {\r\n\t\t\tconst response = await AxiosHelper.post<RegistrationResponse>(url, formValues);\r\n\t\t\tif (response.data.success) {\r\n\t\t\t\t// No need to show any messages if there are none\r\n\t\t\t\tif (!response.data.message?.trim()) {\r\n\t\t\t\t\twindow.location.href = redirectUrl ? redirectUrl : '/';\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tsetRegistrationWarnings(response.data.message);\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\twindow.location.href = response.data.redirectUrl ? response.data.redirectUrl : '/';\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t} catch (error) {\r\n\t\t\treturn handleAxiosErrorWithValidation(error, 'An error occurred while submitting.');\r\n\t\t}\r\n\t};\r\n\r\n\tconst registerData: RegisterInstallationData = (window as any).__ROC_INSTALLATION_DATA__;\r\n\tconst { canSkipRegistration, hasKey } = registerData;\r\n\r\n\treturn registrationWarnings ? (\r\n\t\t<div className=\"login-form\">\r\n\t\t\t<div>\r\n\t\t\t\t<Alert color=\"warning\">{registrationWarnings}</Alert>\r\n\t\t\t\t<div className=\"login-form__actions form-group\">\r\n\t\t\t\t\t<Button className=\"login-form__action\" data-testid=\"acknowledge-errors\" onClick={redirectToAdmin}>\r\n\t\t\t\t\t\tOK\r\n\t\t\t\t\t</Button>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t) : (\r\n\t\t<div className=\"login-form\">\r\n\t\t\t<div>\r\n\t\t\t\t{!hasKey ? (\r\n\t\t\t\t\t<h2 className=\"login-form-heading\">\r\n\t\t\t\t\t\tYour ROC installation needs to be registered before you can proceed. Please enter your license\r\n\t\t\t\t\t\tkey below and select your installation environment.\r\n\t\t\t\t\t</h2>\r\n\t\t\t\t) : (\r\n\t\t\t\t\t<h2 className=\"login-form-heading\">\r\n\t\t\t\t\t\tA ROC license key has already been entered. You may enter a new one below if you wish to change\r\n\t\t\t\t\t\tit.\r\n\t\t\t\t\t</h2>\r\n\t\t\t\t)}\r\n\t\t\t</div>\r\n\r\n\t\t\t<Form\r\n\t\t\t\tonSubmit={submit}\r\n\t\t\t\tdecorators={[focusOnErrors]}\r\n\t\t\t\tsubscription={{ submitting: true, submitError: true }}\r\n\t\t\t\trender={({ handleSubmit, submitError, submitting }) => (\r\n\t\t\t\t\t<form onSubmit={handleSubmit} className=\"login-form\">\r\n\t\t\t\t\t\t{submitError ? (\r\n\t\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t\t<Alert color=\"danger\">\r\n\t\t\t\t\t\t\t\t\t<strong>There was a problem registering this ROC installation:</strong>\r\n\t\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t\t{Array.isArray(submitError)\r\n\t\t\t\t\t\t\t\t\t\t? submitError.map((singleError) => (\r\n\t\t\t\t\t\t\t\t\t\t\t\t// Display all errors on their own lines\r\n\t\t\t\t\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{singleError}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t<br />\r\n\t\t\t\t\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t\t\t\t  ))\r\n\t\t\t\t\t\t\t\t\t\t: submitError}\r\n\t\t\t\t\t\t\t\t</Alert>\r\n\t\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t) : null}\r\n\r\n\t\t\t\t\t\t<Field name=\"licenseKey\" label=\"License key\" type=\"text\" autoFocus component={Input} />\r\n\t\t\t\t\t\t<Field\r\n\t\t\t\t\t\t\tname=\"registrationEnvironment\"\r\n\t\t\t\t\t\t\tcomponent={EnumDropdown}\r\n\t\t\t\t\t\t\tenumType={RegistrationEnvironment}\r\n\t\t\t\t\t\t\taddSelectOption\r\n\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t<div className=\"login-form__actions form-group\">\r\n\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\ttype=\"submit\"\r\n\t\t\t\t\t\t\t\tdisabled={submitting}\r\n\t\t\t\t\t\t\t\tcolor=\"primary\"\r\n\t\t\t\t\t\t\t\tdata-testid=\"submit-2fa-login-btn\"\r\n\t\t\t\t\t\t\t\tclassName=\"login-form__action login-form__submit-btn\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\tRegister\r\n\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t{canSkipRegistration ? (\r\n\t\t\t\t\t\t\t\t<>\r\n\t\t\t\t\t\t\t\t\t<Button\r\n\t\t\t\t\t\t\t\t\t\tclassName=\"login-form__action\"\r\n\t\t\t\t\t\t\t\t\t\tdata-testid=\"skip-register-installation-setup\"\r\n\t\t\t\t\t\t\t\t\t\tonClick={redirectToAdmin}\r\n\t\t\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t\t\tSkip\r\n\t\t\t\t\t\t\t\t\t</Button>\r\n\t\t\t\t\t\t\t\t</>\r\n\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t</div>\r\n\r\n\t\t\t\t\t\t<div className=\"login-form__actions form-group\">{submitting ? <Spinner /> : null}</div>\r\n\t\t\t\t\t</form>\r\n\t\t\t\t)}\r\n\t\t\t/>\r\n\t\t</div>\r\n\t);\r\n}\r\n","import * as React from 'react';\r\nimport { Route } from 'react-router-dom';\r\nimport Login from './Login';\r\nimport ForgotPassword from './ForgotPassword';\r\nimport Confirm from './Confirm';\r\nimport Lockout from './Lockout';\r\nimport LoginTwoFactor from './LoginTwoFactor';\r\nimport LoginRecovery from './LoginRecovery';\r\nimport ResetPassword from './ResetPassword';\r\nimport LoginTwoFactorSetup from './LoginTwoFactorSetup';\r\nimport DuoError, { DuoOffline } from './two-factor-providers/duo-security/DuoError';\r\nimport RegisterInstallation from './RegisterInstallation';\r\n\r\n/**\r\n * Routes related to the Login SPA application.\r\n */\r\nexport default (\r\n\t<>\r\n\t\t<Route exact path=\"/login\" component={Login} />\r\n\t\t<Route exact path=\"/account/forgot-password\" component={ForgotPassword} />\r\n\t\t<Route exact path=\"/account/reset-password\" component={ResetPassword} />\r\n\t\t<Route exact path=\"/account/confirm\" component={Confirm} />\r\n\t\t<Route exact path=\"/account/lockout\" component={Lockout} />\r\n\t\t<Route exact path=\"/account/login-two-factor\" component={LoginTwoFactor} />\r\n\t\t<Route exact path=\"/account/login-recovery\" component={LoginRecovery} />\r\n\t\t<Route exact path=\"/account/two-factor-setup\" component={LoginTwoFactorSetup} />\r\n\t\t<Route exact path=\"/account/duo-error\" component={DuoError} />\r\n\t\t<Route exact path=\"/account/duo-offline\" component={DuoOffline} />\r\n\t\t<Route exact path=\"/register-installation\" component={RegisterInstallation} />\r\n\t</>\r\n);\r\n","import * as React from 'react';\r\nimport Login from './components/account/Routes';\r\n\r\nexport const routes = <>{Login}</>;\r\n","import * as React from 'react';\r\nimport { Route } from 'react-router-dom';\r\nimport { Router } from 'react-router';\r\nimport PageNotFound from '../components/PageNotFound';\r\nimport FragmentSupportingSwitch from '../components/FragmentSupportingSwitch';\r\nimport * as RoutesModule from './loginRoutes';\r\nimport { createBrowserHistory } from 'history';\r\nimport VisuallyHiddenAnnouncement from 'VisuallyHiddenAnnouncement';\r\n\r\nconst routes = RoutesModule.routes;\r\nconst browserHistory = (window as any).browserHistory || createBrowserHistory();\r\n\r\nif (!(window as any).browserHistory) {\r\n\t(window as any).browserHistory = browserHistory;\r\n}\r\n\r\nclass LoginApp extends React.Component<any> {\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<Router history={browserHistory}>\r\n\t\t\t\t<VisuallyHiddenAnnouncement>\r\n\t\t\t\t\t<FragmentSupportingSwitch>\r\n\t\t\t\t\t\t{routes}\r\n\t\t\t\t\t\t<Route component={PageNotFound} />\r\n\t\t\t\t\t</FragmentSupportingSwitch>\r\n\t\t\t\t</VisuallyHiddenAnnouncement>\r\n\t\t\t</Router>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default LoginApp;\r\n","import * as React from 'react';\r\nimport * as ReactDOM from 'react-dom';\r\nimport '../styles/app.scss';\r\nimport LoginApp from './LoginApp';\r\n\r\nfunction renderApp() {\r\n\tReactDOM.render(<LoginApp />, document.getElementById('app'));\r\n}\r\n\r\nrenderApp();\r\n\r\nif ((module as any).hot) {\r\n\t(module as any).hot.accept('./LoginApp', () => {\r\n\t\trenderApp();\r\n\t});\r\n}\r\n","import isEqual from 'react-fast-compare';\r\nimport { RedirectData } from 'types';\r\n\r\ntype OutsideViewportType = {\r\n\ttop: boolean;\r\n\tleft: boolean;\r\n\tbottom: boolean;\r\n\tright: boolean;\r\n\tany: boolean;\r\n\tall: boolean;\r\n};\r\n\r\nexport function areRedirectsEqual(a: Partial<RedirectData>[], b: Partial<RedirectData>[]) {\r\n\tif (!a || !b) {\r\n\t\t// if we don't have either side, fall back to react-fact-compare's behavior\r\n\t\treturn isEqual(a, b);\r\n\t}\r\n\r\n\tif (a.length !== b.length) {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfor (let x = 0; x < a.length; ++x) {\r\n\t\tconst left = a[x];\r\n\t\tconst right = b[x];\r\n\r\n\t\t// default `redirectUrl` to an empty string if not present, which can happen if you empty out the redirect url field\r\n\t\t// in the form - which we still consider the same as the initial state which is an empty string\r\n\t\tconst leftRedirect = left.redirectUrl || '';\r\n\t\tconst rightRedirect = right.redirectUrl || '';\r\n\r\n\t\tif (leftRedirect !== rightRedirect || left.siteId !== right.siteId) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true;\r\n}\r\n\r\n/**\r\n * Takes element and returns distance from the top of the screen.\r\n *\r\n * @export\r\n * @param {*} elem\r\n * @returns\r\n */\r\nexport function getElemDistance(elem) {\r\n\tlet location = 0;\r\n\tif (elem.offsetParent) {\r\n\t\tdo {\r\n\t\t\tlocation += elem.offsetTop;\r\n\t\t\telem = elem.offsetParent;\r\n\t\t} while (elem);\r\n\t}\r\n\treturn location >= 0 ? location : 0;\r\n}\r\n\r\n/**\r\n * Takes element and returns object that outlines which edges are outside the viewport.\r\n *\r\n * @export\r\n * @param {*} elem\r\n * @returns\r\n */\r\nexport function isOutOfViewport(elem) {\r\n\tconst bounding = elem.getBoundingClientRect();\r\n\r\n\tconst top = bounding.top < 0;\r\n\tconst left = bounding.left < 0;\r\n\tconst bottom = bounding.bottom > (window.innerHeight || document.documentElement.clientHeight);\r\n\tconst right = bounding.right > (window.innerWidth || document.documentElement.clientWidth);\r\n\tconst any = top || left || bottom || right;\r\n\tconst all = top && left && bottom && right;\r\n\r\n\tconst out: OutsideViewportType = { top, left, bottom, right, any, all };\r\n\r\n\treturn out;\r\n}\r\n\r\n/**\r\n * Checks if a string is a valid GUID.\r\n */\r\nexport function isValidGuid(value: string) {\r\n\tconst regexGuid = /^(\\{){0,1}[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}(\\}){0,1}$/gi;\r\n\treturn regexGuid.test(value);\r\n}\r\n\r\nexport function isNullOrEmptyGuid(value: string) {\r\n\treturn value === null || value === '00000000-0000-0000-0000-000000000000';\r\n}\r\n\r\n/**\r\n * Checks if string parameter has a newline character.\r\n *\r\n * @export\r\n * @param {string} str\r\n * @return {*}\r\n */\r\nexport function hasNewLine(str: string) {\r\n\treturn !!/\\r|\\n/.exec(str);\r\n}\r\n","import Downshift, { ControllerStateAndHelpers } from 'downshift';\r\nimport * as React from 'react';\r\nimport { WithTestIdOptional } from 'shared-client/types/test';\r\nimport AutoSuggestBase from './AutoSuggestBase';\r\nimport AutoSuggestContext, { AutoSuggestContextValue } from './AutoSuggestContext';\r\nimport AutoSuggestData from './AutoSuggestData';\r\nimport AutoSuggestInput from './AutoSuggestInput';\r\nimport AutoSuggestMenu from './AutoSuggestMenu';\r\nimport AutoSuggestMenuItem from './AutoSuggestMenuItem';\r\nimport {\r\n\tAutoSuggestBaseProps,\r\n\tAutoSuggestItem,\r\n\tAutoSuggestMenuItemRenderProps,\r\n\tAutoSuggestRenderInputProps,\r\n\tAutoSuggestRenderMenuProps,\r\n} from './Types';\r\nimport { assertValidAutoSuggestOptions, itemToString } from './Util';\r\nimport { ToolTipDataProps } from '../tooltip/TooltipWrapper';\r\n\r\nexport type AutoSuggestSingleProps = AutoSuggestBaseProps &\r\n\tToolTipDataProps &\r\n\tWithTestIdOptional & {\r\n\t\tclearInputValueAfterSelection?: boolean;\r\n\t\tplaceholder?: string;\r\n\t\tforceEmptyLabel?: boolean;\r\n\t};\r\n\r\n/**\r\n * AutoSuggest component to select a single value\r\n *\r\n * @class AutoSuggestSingle\r\n * @extends {React.Component<AutoSuggestSingleProps>}\r\n */\r\nclass AutoSuggestSingle extends React.Component<AutoSuggestSingleProps> {\r\n\tpublic static defaultProps = {\r\n\t\trenderMenu: (props: AutoSuggestRenderMenuProps) => <AutoSuggestMenu {...props} />,\r\n\t\trenderInput: (props: AutoSuggestRenderInputProps) => <AutoSuggestInput {...props} />,\r\n\t\trenderMenuItem: (props: AutoSuggestMenuItemRenderProps) => <AutoSuggestMenuItem {...props} />,\r\n\t\tautoSuggestOptions: {\r\n\t\t\tbaseUrl: '',\r\n\t\t\tstaticData: null,\r\n\t\t},\r\n\t\tclearSelectionAfterSelection: false,\r\n\t\tclearable: true,\r\n\t};\r\n\r\n\t/**\r\n\t * Stores a reference to the function that will clear values from downshift. This is unfortunate but it's\r\n\t * a result of the render props pattern making composition tricky in some situations. They are working on a\r\n\t * hooks version but that's not currently released.\r\n\t */\r\n\tprivate clearSelection: (() => void) | null = null;\r\n\r\n\tconstructor(props: AutoSuggestSingleProps) {\r\n\t\tsuper(props);\r\n\r\n\t\tassertValidAutoSuggestOptions(props.autoSuggestOptions);\r\n\t}\r\n\r\n\t/**\r\n\t * Callback for when a value is selected from the AutoSuggest.\r\n\t *\r\n\t * @memberof AutoSuggestSingle\r\n\t */\r\n\tpublic handleSelect = (selectedValue: AutoSuggestItem) => {\r\n\t\tif (!selectedValue) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.props.onChange(selectedValue);\r\n\r\n\t\tif (this.clearSelection && this.props.clearInputValueAfterSelection) {\r\n\t\t\tthis.clearSelection();\r\n\t\t}\r\n\t};\r\n\r\n\tpublic render() {\r\n\t\tconst {\r\n\t\t\tname,\r\n\t\t\tlabel,\r\n\t\t\tvalue,\r\n\t\t\tdisabled,\r\n\t\t\tonChange,\r\n\t\t\tautoSuggestOptions,\r\n\t\t\trenderMenu,\r\n\t\t\trenderInput,\r\n\t\t\trenderMenuItem,\r\n\t\t\tplaceholder,\r\n\t\t\tforceEmptyLabel,\r\n\t\t\tclearable,\r\n\t\t\ttestId,\r\n\t\t\ttooltipText,\r\n\t\t\tnameValue,\r\n\t\t\ttooltipData,\r\n\t\t\tentityDefinition,\r\n\t\t\thasTooltipError,\r\n\t\t} = this.props;\r\n\r\n\t\treturn (\r\n\t\t\t<Downshift itemToString={itemToString} onSelect={this.handleSelect} selectedItem={value}>\r\n\t\t\t\t{(downshift: ControllerStateAndHelpers<AutoSuggestItem>) => {\r\n\t\t\t\t\tconst { isOpen, inputValue, toggleMenu } = downshift;\r\n\r\n\t\t\t\t\tthis.clearSelection = downshift.clearSelection;\r\n\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t<AutoSuggestContext.Provider\r\n\t\t\t\t\t\t\t\tvalue={\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\tname,\r\n\t\t\t\t\t\t\t\t\t\tvalue,\r\n\t\t\t\t\t\t\t\t\t\tonChange,\r\n\t\t\t\t\t\t\t\t\t\tautoSuggestOptions,\r\n\t\t\t\t\t\t\t\t\t\tdownshift,\r\n\t\t\t\t\t\t\t\t\t\trenderMenuItem,\r\n\t\t\t\t\t\t\t\t\t\trenderMenu,\r\n\t\t\t\t\t\t\t\t\t} as AutoSuggestContextValue\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t{renderInput({\r\n\t\t\t\t\t\t\t\t\tlabel,\r\n\t\t\t\t\t\t\t\t\tlabelVisible: true,\r\n\t\t\t\t\t\t\t\t\tplaceholder,\r\n\t\t\t\t\t\t\t\t\tforceEmptyLabel,\r\n\t\t\t\t\t\t\t\t\tclearable,\r\n\t\t\t\t\t\t\t\t\ttestId,\r\n\t\t\t\t\t\t\t\t\tdisabled,\r\n\t\t\t\t\t\t\t\t\ttooltipText,\r\n\t\t\t\t\t\t\t\t\tnameValue,\r\n\t\t\t\t\t\t\t\t\ttooltipData,\r\n\t\t\t\t\t\t\t\t\tentityDefinition,\r\n\t\t\t\t\t\t\t\t\thasTooltipError,\r\n\t\t\t\t\t\t\t\t})}\r\n\r\n\t\t\t\t\t\t\t\t{isOpen && !autoSuggestOptions.staticData ? (\r\n\t\t\t\t\t\t\t\t\t<AutoSuggestData query={inputValue} params={autoSuggestOptions.params}>\r\n\t\t\t\t\t\t\t\t\t\t{(dataProps) => {\r\n\t\t\t\t\t\t\t\t\t\t\tconst { createValue } = dataProps;\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tconst onCreateClick = async () => {\r\n\t\t\t\t\t\t\t\t\t\t\t\t// store new value on the server.\r\n\t\t\t\t\t\t\t\t\t\t\t\tconst newValue = await createValue(inputValue);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t// let react-final-form that something changed.\r\n\t\t\t\t\t\t\t\t\t\t\t\tonChange(newValue);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\t// if the menu is open, close it.\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (isOpen) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttoggleMenu();\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\t\t\t\t\treturn (\r\n\t\t\t\t\t\t\t\t\t\t\t\t<AutoSuggestBase\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tdata={dataProps}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tonCreateClick={onCreateClick}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\trenderMenu={renderMenu}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttestId={testId}\r\n\t\t\t\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t}}\r\n\t\t\t\t\t\t\t\t\t</AutoSuggestData>\r\n\t\t\t\t\t\t\t\t) : isOpen && autoSuggestOptions.staticData ? (\r\n\t\t\t\t\t\t\t\t\t<AutoSuggestStaticMenu\r\n\t\t\t\t\t\t\t\t\t\trenderMenu={renderMenu}\r\n\t\t\t\t\t\t\t\t\t\tstaticData={autoSuggestOptions.staticData}\r\n\t\t\t\t\t\t\t\t\t\tinputValue={inputValue}\r\n\t\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t\t\t) : null}\r\n\t\t\t\t\t\t\t</AutoSuggestContext.Provider>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t);\r\n\t\t\t\t}}\r\n\t\t\t</Downshift>\r\n\t\t);\r\n\t}\r\n}\r\n\r\ninterface AutoSuggestStaticMenuProps {\r\n\trenderMenu: (props: AutoSuggestRenderMenuProps) => React.ReactNode;\r\n\tstaticData: AutoSuggestItem[];\r\n\tinputValue: string | null;\r\n}\r\n\r\nfunction AutoSuggestStaticMenu(props: AutoSuggestStaticMenuProps) {\r\n\tconst { renderMenu, staticData, inputValue } = props;\r\n\r\n\tconst filteredResults = staticData.filter(\r\n\t\t(autoSuggestItem) =>\r\n\t\t\t!inputValue ||\r\n\t\t\tautoSuggestItem.label.toLocaleLowerCase().includes(inputValue.toLocaleLowerCase()) ||\r\n\t\t\tautoSuggestItem.value.toLocaleLowerCase().includes(inputValue.toLocaleLowerCase()),\r\n\t);\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t\t{renderMenu({\r\n\t\t\t\tdata: {\r\n\t\t\t\t\tcreateValue: () => Promise.reject(),\r\n\t\t\t\t\terrorStatus: null,\r\n\t\t\t\t\thasMore: false,\r\n\t\t\t\t\tisLoading: false,\r\n\t\t\t\t\tresults: filteredResults,\r\n\t\t\t\t},\r\n\t\t\t\tonCreateClick: () => Promise.reject(),\r\n\t\t\t})}\r\n\t\t</>\r\n\t);\r\n}\r\n\r\nexport default AutoSuggestSingle;\r\n","import * as React from 'react';\r\nimport XSVG from './svg/XSVG';\r\n\r\nexport interface ModalCloseProps {\r\n\ttoggle: () => void;\r\n}\r\n\r\n/**\r\n * Modal close component.\r\n *\r\n * @class ModalClose\r\n * @extends {React.Component<ModalCloseProps>}\r\n */\r\nclass ModalClose extends React.Component<ModalCloseProps> {\r\n\tconstructor(props) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<div className=\"modal-close\">\r\n\t\t\t\t<button className=\"modal-close__btn\" onClick={this.props.toggle} data-testid=\"btn-modal-close\">\r\n\t\t\t\t\t<span className=\"modal-close__text\">close</span>\r\n\t\t\t\t\t<span className=\"modal-close__x\">\r\n\t\t\t\t\t\t<XSVG class=\"modal-close__x-icon\" />\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</button>\r\n\t\t\t</div>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default ModalClose;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Dash circle SVG\r\n *\r\n * @returns\r\n */\r\nfunction DashCircleSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 32 32\"\r\n\t\t\tclassName={'icon icon-help-header ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t\tdata-testid={svgProps.testId}\r\n\t\t>\r\n\t\t\t<path\r\n\t\t\t\tfill=\"#5c5c5c\"\r\n\t\t\t\td=\"M16 0c8.837 0 16 7.163 16 16s-7.163 16-16 16c-8.837 0-16-7.163-16-16v0c0-8.837 7.163-16 16-16v0z\"\r\n\t\t\t/>\r\n\t\t\t<path\r\n\t\t\t\tfill=\"#fff\"\r\n\t\t\t\td=\"M21.51 17.594h-11.733c-0.884 0-1.6-0.716-1.6-1.6s0.716-1.6 1.6-1.6h11.733c0.884 0 1.6 0.716 1.6 1.6s-0.716 1.6-1.6 1.6z\"\r\n\t\t\t/>\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nDashCircleSVG.defaultProps = { class: '' };\r\n\r\nexport default DashCircleSVG;\r\n","import {\r\n\tAppSettings,\r\n\tAppUser,\r\n\tAppConfig,\r\n\tAssetStore,\r\n\tAppMessage,\r\n\tAppCulture,\r\n\tAppSiteDto,\r\n\tAppSiteCollectionDto,\r\n\t// #region Commerce\r\n\tSiteCategoryTreeDto,\r\n\t// #endregion\r\n} from 'types';\r\nimport { SettingGroupResults } from 'features/settings/__models__/Groups';\r\nimport RmsMessage from '~/features/message-center/__models__/RmsMessage';\r\n\r\n// handle the initial settings here\r\nconst initialContext: AppState = (window as any).__ROC_PRELOADED_STATE__;\r\n\r\n// This is dangerous if the state ever changes. If it is ever found out that we do change AppContextState, this export of the initial state isn't sufficient.\r\nexport default initialContext;\r\n\r\n/**\r\n * Interface for the global application context\r\n */\r\nexport interface AppState {\r\n\tsettings: AppSettings;\r\n\tconfig: AppConfig;\r\n\tuser: AppUser;\r\n\tassetStores: AssetStore[];\r\n\tdynamicEntityMetadata: DynamicEntityMetadata;\r\n\tmessages: AppMessage[];\r\n\tconfigurationUpdatedOnServerSide: boolean;\r\n\tsettingGroups: SettingGroupResults;\r\n\tcultures: AppCulture[];\r\n\tsites: AppSiteDto[];\r\n\tsiteCollections: AppSiteCollectionDto[];\r\n\tTenantId: string;\r\n\tdocumentUrls: Record<string, string>;\r\n\trmsMessages: RmsMessage[];\r\n\t// #region Commerce\r\n\tcategoryTrees: SiteCategoryTreeDto[];\r\n\tavailableCurrencies: string[];\r\n\t// #endregion\r\n\tinitialServiceStatus: ServiceStatus;\r\n}\r\n\r\n/**\r\n * Information about required Roc services\r\n */\r\ninterface ServiceStatus {\r\n\t/**\r\n\t * Whether RabbitMQ is connected for Roc.Admin\r\n\t */\r\n\trabbitMqConnected: boolean;\r\n}\r\n\r\n/**\r\n * Contains runtime defined details for all entity types in the system\r\n */\r\ninterface DynamicEntityMetadata {\r\n\t/**\r\n\t * The entity definition map.\r\n\t * Key: \"/ajax/commerce/products\"\r\n\t * Value: { singularName: \"Product\", pluralName: \"Product\", IsVersionable: true, ... }\r\n\t */\r\n\tentityDefinitionMap: Record<string, DynamicEntityDefinition>;\r\n}\r\n\r\n/**\r\n * Represents details about a Domain Entity to facilitate UI rendering\r\n */\r\ninterface DynamicEntityDefinition {\r\n\t/** The singular name of the entity (eg: Product) */\r\n\tsingularName: string;\r\n\r\n\t/** The plural name of the entity (eg: Product) */\r\n\tpluralName: string;\r\n\r\n\t/** Entity implements IVersionableModel */\r\n\tisVersionable: boolean;\r\n\r\n\t/** Entity supports Import */\r\n\tisImportable: boolean;\r\n\r\n\t/** Entity supports Export */\r\n\tisExportable: boolean;\r\n\r\n\t/** Entity supports the download tool */\r\n\tisDownloadable: boolean;\r\n\r\n\t/** Entity implements IHierarchyModel */\r\n\tisHierarchy: boolean;\r\n\r\n\t/** Entity implements INamedModel */\r\n\tisNamedModel: boolean;\r\n\r\n\t/** Entity implements IUniqueCodeModel */\r\n\tisUniqueCodeModel: boolean;\r\n\r\n\t/** Entity implements ICodeModel */\r\n\tisCodeModel: boolean;\r\n\r\n\t/** Entity implements ISortableModel */\r\n\tisSortable: boolean;\r\n\r\n\t/** Entity implements IScopedModel */\r\n\tisScoped: boolean;\r\n\r\n\t/** Entity implements ICultureModel */\r\n\tisTranslatable: boolean;\r\n\r\n\t/** Entity implements IPermanentModel */\r\n\tisPermanentModel: boolean;\r\n\r\n\t/** Entity implements ISoftDeletable */\r\n\tisSoftDeletable: boolean;\r\n\r\n\t/** Entity implements IUserTrackedModel */\r\n\tisUserTrackedModel: boolean;\r\n\r\n\t/** Entity implements IUserModel */\r\n\tisUserModel: boolean;\r\n\r\n\t/** Entity implements INullableUserModel */\r\n\tisNullableUserModel: boolean;\r\n\r\n\t/** Entity implements IBasicModel */\r\n\tisBasicModel: boolean;\r\n\r\n\t/** Entity implements IBaseModel */\r\n\tisBaseModel: boolean;\r\n\r\n\t/** Entity implements ISeoModel */\r\n\tisSeoModel: boolean;\r\n\r\n\t/** Entity implements IExternalModel */\r\n\tisExternalModel: boolean;\r\n}\r\n","export interface SortBy {\r\n\tname: string;\r\n\ttitle: string;\r\n\tdirection: SortByDirection;\r\n}\r\n\r\nexport enum SortByDirection {\r\n\tAscending = 'Ascending',\r\n\tDescending = 'Descending',\r\n}\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Pencil SVG component\r\n *\r\n * @returns\r\n */\r\nfunction PencilSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg viewBox=\"0 0 32 32\" className={'icon icon-info ' + svgProps.class} focusable=\"false\" aria-hidden=\"true\">\r\n\t\t\t<path d=\"M27.009 0c-1.133 0-2.179 0.373-3.022 1.002l0.013-0.010-2 2 7.008 7.008 2-2c0.619-0.824 0.992-1.865 0.992-2.992 0-2.76-2.233-4.998-4.99-5.008h-0.001zM2 23.015l-2 8.985 8.992-2 18.511-18.497-7.008-7.008zM22.369 11.36l-13.993 13.993-1.729-1.729 13.993-13.993z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nexport default PencilSVG;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Pending SVG component\r\n *\r\n * @returns\r\n */\r\nfunction ExclamationTriangleSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg\r\n\t\t\tviewBox=\"0 0 34 32\"\r\n\t\t\tclassName={'icon icon-exclamation-triangle ' + svgProps.class}\r\n\t\t\tfocusable=\"false\"\r\n\t\t\taria-hidden=\"true\"\r\n\t\t>\r\n\t\t\t<path d=\"M33.879 27.321l-14.123-25.762c-0.499-0.934-1.468-1.559-2.583-1.559s-2.084 0.625-2.575 1.544l-0.008 0.016-14.181 25.762c-0.265 0.449-0.422 0.989-0.422 1.565 0 1.682 1.332 3.052 2.999 3.113l0.006 0h28.304c1.672-0.061 3.005-1.432 3.005-3.113 0-0.577-0.157-1.117-0.43-1.58l0.008 0.015zM15.522 10.864c-0.004-0.040-0.006-0.088-0.006-0.135 0-0.884 0.716-1.6 1.6-1.6s1.6 0.716 1.6 1.6c0 0.048-0.002 0.095-0.006 0.141l0-0.006v7.851c0.004 0.040 0.006 0.088 0.006 0.135 0 0.884-0.716 1.6-1.6 1.6s-1.6-0.716-1.6-1.6c0-0.048 0.002-0.095 0.006-0.141l-0 0.006zM17.17 27.2c-0.023 0.001-0.050 0.002-0.078 0.002-0.927 0-1.678-0.751-1.678-1.678s0.751-1.678 1.678-1.678c0.927 0 1.678 0.751 1.678 1.678 0 0 0 0 0 0v-0c0 0.012 0 0.025 0 0.039 0 0.891-0.712 1.616-1.599 1.636l-0.002 0z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nExclamationTriangleSVG.defaultProps = { class: '' };\r\n\r\nexport default ExclamationTriangleSVG;\r\n","import * as React from 'react';\r\nimport { Alert } from 'reactstrap';\r\n\r\n/**\r\n * Warning Props\r\n */\r\ninterface WarningProps {\r\n\tmessage: string | JSX.Element;\r\n}\r\n\r\n/**\r\n * Reusable Warning Alert Component used by AdminErrorBoundary and Listing/Tree base components.\r\n *\r\n * @class Warning\r\n * @extends {React.Component<any, any>}\r\n */\r\nclass Warning extends React.Component<WarningProps, any> {\r\n\tconstructor(props: WarningProps) {\r\n\t\tsuper(props);\r\n\t}\r\n\r\n\tpublic render() {\r\n\t\treturn (\r\n\t\t\t<Alert color=\"warning\">\r\n\t\t\t\t<h2>Warning</h2>\r\n\t\t\t\t{this.props.message}\r\n\t\t\t</Alert>\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default Warning;\r\n","import * as React from 'react';\r\n\r\n/**\r\n * Garbage Can SVG\r\n *\r\n * @returns\r\n */\r\n\r\nfunction GarbageCanSVG(svgProps: SVGProps) {\r\n\treturn (\r\n\t\t<svg viewBox=\"0 0 31 32\" className={'icon icon-garbage ' + svgProps.class} focusable=\"false\" aria-hidden=\"true\">\r\n\t\t\t<path d=\"M30.932 6c-0.007-0.373-0.311-0.673-0.685-0.673-0.009 0-0.018 0-0.027 0.001l0.001-0h-6.792l-1.537-3.473c-0.552-1.080-1.64-1.815-2.904-1.856l-0.005-0h-7.032c-1.274 0.044-2.366 0.777-2.92 1.837l-0.009 0.019-1.534 3.473h-6.777c-0.008-0-0.017-0-0.026-0-0.374 0-0.678 0.3-0.685 0.672v1.328c0.002 0.372 0.303 0.673 0.676 0.673 0.012 0 0.025-0 0.037-0.001l-0.002 0h2.112v19.841c-0.006 0.084-0.010 0.182-0.010 0.281 0 2.022 1.54 3.684 3.511 3.877l0.016 0.001h18.274c1.995-0.235 3.528-1.916 3.528-3.955 0-0.106-0.004-0.212-0.012-0.316l0.001 0.014v-19.743h2.114c0.008 0 0.017 0.001 0.026 0.001 0.374 0 0.678-0.3 0.685-0.672v-0.001l-0.022-1.327zM11.629 2.896c0.095-0.108 0.22-0.187 0.363-0.224l0.005-0.001h6.967c0.145 0.046 0.269 0.123 0.368 0.224l0 0 1.048 2.432h-9.832zM24.611 29.328h-18.289c-0.437-0.337-0.716-0.862-0.716-1.451 0-0.047 0.002-0.093 0.005-0.139l-0 0.006v-19.745h19.701v19.745c0.003 0.040 0.005 0.087 0.005 0.134 0 0.587-0.275 1.11-0.702 1.447l-0.004 0.003zM10.548 12.001h-1.403c-0.008-0-0.017-0.001-0.026-0.001-0.374 0-0.678 0.3-0.685 0.672v12c0.007 0.373 0.311 0.673 0.685 0.673 0.009 0 0.018-0 0.027-0.001l-0.001 0h1.403c0.008 0 0.017 0 0.026 0 0.374 0 0.678-0.3 0.685-0.672v-12c-0.013-0.374-0.32-0.672-0.696-0.672-0.005 0-0.011 0-0.016 0h0.001zM16.177 12.001h-1.403c-0.008-0-0.017-0.001-0.026-0.001-0.374 0-0.678 0.3-0.685 0.672v12c0.007 0.373 0.311 0.673 0.685 0.673 0.009 0 0.018-0 0.027-0.001l-0.001 0h1.403c0.008 0 0.017 0 0.026 0 0.374 0 0.678-0.3 0.685-0.672v-12c-0.013-0.374-0.32-0.672-0.696-0.672-0.005 0-0.011 0-0.016 0h0.001zM21.789 12.001h-1.403c-0.008-0-0.017-0.001-0.026-0.001-0.374 0-0.678 0.3-0.685 0.672v12c0.007 0.373 0.311 0.673 0.685 0.673 0.009 0 0.018-0 0.027-0.001l-0.001 0h1.403c0.008 0 0.017 0 0.026 0 0.374 0 0.678-0.3 0.685-0.672v-12c-0.002-0.372-0.303-0.673-0.676-0.673-0.012 0-0.025 0-0.037 0.001l0.002-0z\" />\r\n\t\t</svg>\r\n\t);\r\n}\r\n\r\nGarbageCanSVG.defaultProps = { class: '' };\r\n\r\nexport default GarbageCanSVG;\r\n"],"sourceRoot":""}