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,KAAMmvJ,EAASV,EAAIR,IAAU,GAC1B,oBAAZkB,GACdnvJ,KAAKw7C,MAAK,SAASxlC,EAAOvX,GACtBslB,EAAEyqI,gBAAgBlK,KAAKtkJ,KAAMvB,EAAK0wJ,EACrC,IAGEnvJ,IACV,GAGL,IAAI2gD,EAAS,CACT,EAAM58B,EAEN,OAAW,WACP,OAAOA,EAAEypI,WAAWF,MAAMvpI,EAAE6qI,OAAOvK,UAAWD,UACjD,EAED,YAAgB,SAAS2I,GAKrB,OAJAA,EAAMA,GAAO,CAAC,EAEdhpI,EAAE8oI,QAAQE,GAEHhpI,EAAEwmC,OAAOwiG,EAAKQ,EACxB,EAED,GAAO,WACHxpI,EAAEooI,gBAAgBmB,MAAMttJ,KAAMokJ,UACjC,EAED,SAAa,SAAS2I,EAAKqC,GAIvB,OAHAA,EAAYA,IAAa,GACzBrC,EAAMA,GAAO,CAAC,GACVK,WAAagC,EAAY,WAAY,EAAGrrI,EAAE6qI,OACvC7qI,EAAEmpI,eAAeH,GAAMqC,EACjC,EAED,QAnkBU,SA0kB2BlL,EAAOr5E,UACxCA,EAAUq5E,EAAOr5E,QAAUlqB,GAE/BkqB,EAAQlqB,OAASA,CAhlBxB,G","sources":["webpack://CityGrows/./app/javascript/apis/tentative-assignments-api.js","webpack://CityGrows/./app/javascript/actions/attachment-actions.js","webpack://CityGrows/./app/javascript/apis/step-assignments-api.js","webpack://CityGrows/./app/javascript/apis/flow-step-api.js","webpack://CityGrows/./app/javascript/apis/step-assignment-group-api.js","webpack://CityGrows/./app/javascript/actions/flow-step-actions.js","webpack://CityGrows/./app/javascript/apis/survey-api.js","webpack://CityGrows/./app/javascript/actions/survey-actions.js","webpack://CityGrows/./app/javascript/actions/template-extras-actions.js","webpack://CityGrows/./app/javascript/apis/custom-id-api.js","webpack://CityGrows/./app/javascript/apis/template-category-api.js","webpack://CityGrows/./app/javascript/actions/template-manager-actions.js","webpack://CityGrows/./app/javascript/apis/master-template-authorities-api.js","webpack://CityGrows/./app/javascript/apis/membership-api.js","webpack://CityGrows/./app/javascript/actions/user-access-actions.js","webpack://CityGrows/./app/javascript/apis/attachment-api.js","webpack://CityGrows/./app/javascript/apis/document-api.js","webpack://CityGrows/./app/javascript/apis/flow-template-api.js","webpack://CityGrows/./app/javascript/apis/formula-api.js","webpack://CityGrows/./app/javascript/apis/master-template-api.js","webpack://CityGrows/./app/javascript/apis/master-template-data-import-api.js","webpack://CityGrows/./app/javascript/apis/role-api.js","webpack://CityGrows/./app/javascript/apis/search-api.js","webpack://CityGrows/./app/javascript/apis/step-data-api.js","webpack://CityGrows/./app/javascript/apis/team-api.js","webpack://CityGrows/./app/javascript/apis/helpers/csrf-reset.js","webpack://CityGrows/./app/javascript/apis/user-api.js","webpack://CityGrows/./app/javascript/appdispatcher.js","webpack://CityGrows/./app/javascript/components/hooks/use-derived-state.js","webpack://CityGrows/./app/javascript/components/hooks/use-focus-trap.js","webpack://CityGrows/./app/javascript/components/shared/advanced-label.jsx","webpack://CityGrows/./app/javascript/modules/fetch-roles.js","webpack://CityGrows/./app/javascript/components/shared/attached_people/role-search.jsx","webpack://CityGrows/./app/javascript/components/shared/attached_people/attach-person.jsx","webpack://CityGrows/./app/javascript/components/shared/attached-people.jsx","webpack://CityGrows/./app/javascript/components/shared/attached_people/attached-person.jsx","webpack://CityGrows/./app/javascript/components/shared/popup-button.jsx","webpack://CityGrows/./app/javascript/components/shared/autonomous-popup.jsx","webpack://CityGrows/./app/javascript/components/shared/close-if-outside-wrapper.jsx","webpack://CityGrows/./app/javascript/components/shared/copyable-link.jsx","webpack://CityGrows/./app/javascript/components/shared/disc-group/many-disc.jsx","webpack://CityGrows/./app/javascript/components/shared/disc-group.jsx","webpack://CityGrows/./app/javascript/components/shared/dropdown-menu.jsx","webpack://CityGrows/./app/javascript/components/shared/embedded-text-area.jsx","webpack://CityGrows/./app/javascript/components/shared/embedded-text-input.jsx","webpack://CityGrows/./app/javascript/components/shared/exports-message.jsx","webpack://CityGrows/./app/javascript/components/shared/file-input.jsx","webpack://CityGrows/./app/javascript/components/shared/flash-item.jsx","webpack://CityGrows/./app/javascript/components/shared/flash.jsx","webpack://CityGrows/./app/javascript/components/shared/inline-notification.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/money-input.jsx","webpack://CityGrows/./app/javascript/components/shared/instructions-manager.jsx","webpack://CityGrows/./app/javascript/components/shared/labelbox.jsx","webpack://CityGrows/./app/javascript/components/shared/left-menu.jsx","webpack://CityGrows/./app/javascript/components/shared/list-of-people/person.jsx","webpack://CityGrows/./app/javascript/components/shared/list-of-people.jsx","webpack://CityGrows/./app/javascript/components/shared/loading-spinner.jsx","webpack://CityGrows/./app/javascript/components/shared/logic_widget/configured-logic-condition.jsx","webpack://CityGrows/./app/javascript/modules/logic-helpers.js","webpack://CityGrows/./app/javascript/components/shared/logic_widget/logic-condition.jsx","webpack://CityGrows/./app/javascript/components/shared/logic-widget.jsx","webpack://CityGrows/./app/javascript/components/shared/logic_widget/logic-validator.jsx","webpack://CityGrows/./app/javascript/components/shared/modal.jsx","webpack://CityGrows/./app/javascript/components/shared/notif-banner.jsx","webpack://CityGrows/./app/javascript/components/shared/well.jsx","webpack://CityGrows/./app/javascript/components/shared/payment_details/fixed-payment-settings.jsx","webpack://CityGrows/./app/javascript/components/shared/payment_details/edit-payment-view.jsx","webpack://CityGrows/./app/javascript/components/shared/payment-step-details.jsx","webpack://CityGrows/./app/javascript/components/shared/person-selection.jsx","webpack://CityGrows/./app/javascript/components/shared/person-selector.jsx","webpack://CityGrows/./app/javascript/components/shared/picker.jsx","webpack://CityGrows/./app/javascript/components/shared/popdown.jsx","webpack://CityGrows/./app/javascript/components/shared/role-disc.jsx","webpack://CityGrows/./app/javascript/components/shared/select.jsx","webpack://CityGrows/./app/javascript/components/shared/side-menu.jsx","webpack://CityGrows/./app/javascript/components/shared/sliding-toggle.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/new-field-picker.jsx","webpack://CityGrows/./app/javascript/apis/multiple-choice-option-api.js","webpack://CityGrows/./app/javascript/actions/multiple-choice-option-actions.js","webpack://CityGrows/./app/javascript/components/shared/data_collector/multiple-choice-option.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/multiple-choices.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/settings/numeric-settings.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/settings/advanced-settings.jsx","webpack://CityGrows/./app/javascript/components/shared/no-negatives-input.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/settings/text-settings.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/settings/date-settings.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/settings/checkbox-settings.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/field-settings.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/step-data-collector-row.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/settings/section-settings.jsx","webpack://CityGrows/./app/javascript/components/shared/data_collector/step-data-section.jsx","webpack://CityGrows/./app/javascript/components/shared/step-data-collector.jsx","webpack://CityGrows/./app/javascript/apis/logic-config-api.js","webpack://CityGrows/./app/javascript/actions/logic-actions.js","webpack://CityGrows/./app/javascript/components/shared/step-logic.jsx","webpack://CityGrows/./app/javascript/components/shared/text-editor/mentions-manager.jsx","webpack://CityGrows/./app/javascript/components/shared/text-editor.jsx","webpack://CityGrows/./app/javascript/components/shared/text-editor/buttons.jsx","webpack://CityGrows/./app/javascript/components/shared/user-disc/user-pseudo-info.jsx","webpack://CityGrows/./app/javascript/components/shared/user-disc.jsx","webpack://CityGrows/./app/javascript/components/shared/x-close.jsx","webpack://CityGrows/./app/javascript/constants/active-step-constants.js","webpack://CityGrows/./app/javascript/constants/attached-people-constants.js","webpack://CityGrows/./app/javascript/constants/error-messages.js","webpack://CityGrows/./app/javascript/constants/initiated-flow-constants.js","webpack://CityGrows/./app/javascript/constants/logic-constants.js","webpack://CityGrows/./app/javascript/constants/multiple-choice-option-constants.js","webpack://CityGrows/./app/javascript/constants/template-manager-constants.js","webpack://CityGrows/./app/javascript/constants/user-access-constants.js","webpack://CityGrows/./app/javascript/contexts/access-manager-dispatch-context.jsx","webpack://CityGrows/./app/javascript/contexts/initiated-flow-dispatch-context.js","webpack://CityGrows/./app/javascript/components/shared/notification.jsx","webpack://CityGrows/./app/javascript/components/roles/role.jsx","webpack://CityGrows/./app/javascript/actions/role-actions.js","webpack://CityGrows/./app/javascript/components/shared/manageable-table.jsx","webpack://CityGrows/./app/javascript/components/roles/role-row.jsx","webpack://CityGrows/./app/javascript/components/admin-roles-container.jsx","webpack://CityGrows/./app/javascript/components/shared/primary-tabs.jsx","webpack://CityGrows/./app/javascript/initializers/admin-roles.js","webpack://CityGrows/./app/javascript/components/common-providers.jsx","webpack://CityGrows/./app/javascript/apis/batch-export-template-api.js","webpack://CityGrows/./app/javascript/constants/ordinal-constants.js","webpack://CityGrows/./app/javascript/components/batch-form-export-templates/export-template-row.jsx","webpack://CityGrows/./app/javascript/components/shared/multi-select.jsx","webpack://CityGrows/./app/javascript/components/batch-form-export-templates/export-template.jsx","webpack://CityGrows/./app/javascript/components/batch-form-export-templates.jsx","webpack://CityGrows/./app/javascript/initializers/batch-export-templates.js","webpack://CityGrows/./app/javascript/components/shared/finance-subnav.jsx","webpack://CityGrows/./app/javascript/initializers/charge-disputes.js","webpack://CityGrows/./app/javascript/constants/entity-configuration-constants.js","webpack://CityGrows/./app/javascript/reducers/entity-configuration-reducer.js","webpack://CityGrows/./app/javascript/contexts/entity-configuration-dispatch-context.js","webpack://CityGrows/./app/javascript/apis/custom-entities-api.js","webpack://CityGrows/./app/javascript/apis/custom-entity-fields-api.js","webpack://CityGrows/./app/javascript/actions/entity-configuration-actions.js","webpack://CityGrows/./app/javascript/components/shared/linky-button.jsx","webpack://CityGrows/./app/javascript/components/entity-configuration/custom-entity-field.jsx","webpack://CityGrows/./app/javascript/components/entity-configuration/custom-entity/title-field-selector.jsx","webpack://CityGrows/./app/javascript/components/entity-configuration/custom-entity.jsx","webpack://CityGrows/./app/javascript/components/entity-configuration/create-dialog.jsx","webpack://CityGrows/./app/javascript/components/entity-configuration.jsx","webpack://CityGrows/./app/javascript/initializers/custom-entities.js","webpack://CityGrows/./app/javascript/constants/dashboard-constants.js","webpack://CityGrows/./app/javascript/stores/dashboard-store.js","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/constants.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/context.jsx","webpack://CityGrows/./app/javascript/apis/filter-api.js","webpack://CityGrows/./app/javascript/actions/filter-actions.js","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/applicant-search.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/completed-status.jsx","webpack://CityGrows/./app/javascript/modules/date-formatter.js","webpack://CityGrows/./app/javascript/components/shared/date-selector.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/date-range.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/date-term.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/datum-field-filter.jsx","webpack://CityGrows/./app/javascript/apis/batch-initiated-flows-api.js","webpack://CityGrows/./app/javascript/apis/dashboard-api.js","webpack://CityGrows/./app/javascript/actions/dashboard-actions.js","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/form-select.jsx","webpack://CityGrows/./app/javascript/actions/dashboard/source-filter-actions.js","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/imported-select.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/minified-filter-unit.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/output-status.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/renewal-status.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/step-select.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/submission-filter.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/tag-select.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/team-select.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/toggle-option.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/filter-unit.jsx","webpack://CityGrows/./app/javascript/apis/advanced-filter-api.js","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/modals/filter-row.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/modals/load-filter-modal.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter/modals/save-filter-modal.jsx","webpack://CityGrows/./app/javascript/components/hooks/use-load-templates.jsx","webpack://CityGrows/./app/javascript/apis/tag-api.js","webpack://CityGrows/./app/javascript/components/hooks/use-load-tags.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter.jsx","webpack://CityGrows/./app/javascript/components/shared/advanced-filter-clear-button.jsx","webpack://CityGrows/./app/javascript/modules/local-storage.js","webpack://CityGrows/./app/javascript/components/shared/error-boundary.jsx","webpack://CityGrows/./app/javascript/components/dashboard/filters/filter-defaults.js","webpack://CityGrows/./app/javascript/components/shared/search-bar.jsx","webpack://CityGrows/./app/javascript/components/shared/portal.jsx","webpack://CityGrows/./app/javascript/components/shared/excerpt.jsx","webpack://CityGrows/./app/javascript/components/dashboard/master-search-results.jsx","webpack://CityGrows/./app/javascript/constants/keys.js","webpack://CityGrows/./app/javascript/components/dashboard/master-search.jsx","webpack://CityGrows/./app/javascript/components/dashboard/dashboard-cell.jsx","webpack://CityGrows/./app/javascript/components/dashboard/sorting-header-cell.jsx","webpack://CityGrows/./app/javascript/components/dashboard/main-dashboard.jsx","webpack://CityGrows/./app/javascript/apis/tagging-api.js","webpack://CityGrows/./app/javascript/actions/tag-manager-actions.js","webpack://CityGrows/./app/javascript/components/dashboard/tag-manager.jsx","webpack://CityGrows/./app/javascript/components/dashboard.jsx","webpack://CityGrows/./app/javascript/modules/truncate.js","webpack://CityGrows/./app/javascript/components/dashboard/outputs-tab/table.jsx","webpack://CityGrows/./app/javascript/components/hooks/use-load-more-outputs.js","webpack://CityGrows/./app/javascript/components/dashboard/outputs-tab.jsx","webpack://CityGrows/./app/javascript/components/dashboard-outputs.jsx","webpack://CityGrows/./app/javascript/initializers/dashboards.js","webpack://CityGrows/./app/javascript/apis/edit-suggestions-api.js","webpack://CityGrows/./app/javascript/components/edit-suggestions-request.jsx","webpack://CityGrows/./app/javascript/initializers/edit-suggestions-requests.js","webpack://CityGrows/./app/javascript/apis/entity-api.js","webpack://CityGrows/./app/javascript/actions/entity-actions.js","webpack://CityGrows/./app/javascript/components/entity-page/standard-fields.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input/map.tsx","webpack://CityGrows/./app/javascript/components/entity-page/esri-fields.jsx","webpack://CityGrows/./app/javascript/components/entity-page.jsx","webpack://CityGrows/./app/javascript/components/subnav.jsx","webpack://CityGrows/./app/javascript/initializers/directory.js","webpack://CityGrows/./app/javascript/initializers/entities.js","webpack://CityGrows/./app/javascript/components/entity-import.jsx","webpack://CityGrows/./app/javascript/initializers/entity-imports.js","webpack://CityGrows/./app/javascript/apis/exports-api.js","webpack://CityGrows/./app/javascript/components/exports.jsx","webpack://CityGrows/./app/javascript/initializers/exports.js","webpack://CityGrows/./app/javascript/apis/user-preference-api.js","webpack://CityGrows/./app/javascript/actions/user-preference-actions.js","webpack://CityGrows/./app/javascript/components/new_form/template-list.jsx","webpack://CityGrows/./app/javascript/components/new_form/new-form-container.jsx","webpack://CityGrows/./app/javascript/components/new-form.jsx","webpack://CityGrows/./app/javascript/components/forms-container/forms-list.jsx","webpack://CityGrows/./app/javascript/components/forms-container.jsx","webpack://CityGrows/./app/javascript/initializers/flow-templates.js","webpack://CityGrows/./app/javascript/apis/initiated-flow-api.js","webpack://CityGrows/./app/javascript/actions/launch-manager-actions.js","webpack://CityGrows/./app/javascript/actions/initiated-flow-actions.js","webpack://CityGrows/./app/javascript/actions/user-actions.js","webpack://CityGrows/./app/javascript/components/shared/small-flow-table.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/launch_manager/existing-processes-step.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/launch_manager/existing-account-step.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/launch_manager/email-step.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/launch_manager/launching-loader.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/launch_manager/personal-info-step.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/launch_manager/password-step.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/launch-manager.jsx","webpack://CityGrows/./app/javascript/apis/session-api.js","webpack://CityGrows/./app/javascript/modules/poll-for-login.js","webpack://CityGrows/./app/javascript/constants/survey-submission-constants.js","webpack://CityGrows/./app/javascript/constants/activity-log-constants.js","webpack://CityGrows/./app/javascript/reducers/initiated-flow-reducer.js","webpack://CityGrows/./app/javascript/constants/discussion-constants.js","webpack://CityGrows/./app/javascript/reducers/discussions-reducer.js","webpack://CityGrows/./app/javascript/apis/discussion-api.js","webpack://CityGrows/./app/javascript/apis/discussion-comment-api.js","webpack://CityGrows/./app/javascript/actions/discussion-actions.js","webpack://CityGrows/./app/javascript/apis/active-step-api.js","webpack://CityGrows/./app/javascript/contexts/discussion-dispatch-context.js","webpack://CityGrows/./app/javascript/components/shared/admin-notif.jsx","webpack://CityGrows/./app/javascript/apis/survey-submission-api.js","webpack://CityGrows/./app/javascript/apis/survey-invitations-api.js","webpack://CityGrows/./app/javascript/actions/survey-submission-actions.js","webpack://CityGrows/./app/javascript/components/hooks/use-previous.js","webpack://CityGrows/./app/javascript/apis/collected-data-api.js","webpack://CityGrows/./app/javascript/modules/json-response-message.js","webpack://CityGrows/./app/javascript/actions/collect-info-step-actions.js","webpack://CityGrows/./app/javascript/components/shared/date-range-selector.jsx","webpack://CityGrows/./app/javascript/actions/active-step-actions.js","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input/create-button.jsx","webpack://CityGrows/./app/javascript/modules/titleize.js","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input/search-result.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input/search-results.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input/entity-selector.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input/entity-field.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input/remove-entity-button.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input/selected-standard-entity.tsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input/selected-esri-entity.tsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input/new-entity.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/entity-input.jsx","webpack://CityGrows/./app/javascript/apis/address-validator-api.js","webpack://CityGrows/./app/javascript/modules/smarty-streets-client.js","webpack://CityGrows/./app/javascript/components/shared/input_fields/address_input/autocomplete-suggestions.js","webpack://CityGrows/./app/javascript/components/shared/input_fields/address_input/address-option.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/address_input/address-validator.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/address-input.jsx","webpack://CityGrows/./app/javascript/components/shared/file-dropzone.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/file-input.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/address_input/map.jsx","webpack://CityGrows/./app/javascript/components/shared/input_fields/file_input/attached-file.jsx","webpack://CityGrows/./app/javascript/components/shared/step-data-collector-input-field.jsx","webpack://CityGrows/./app/javascript/components/shared/survey/section.jsx","webpack://CityGrows/./app/javascript/components/shared/survey.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/survey-submission-admin-view.jsx","webpack://CityGrows/./app/javascript/modules/tag-resolver.js","webpack://CityGrows/./app/javascript/components/shared/informational-text.jsx","webpack://CityGrows/./app/javascript/apis/activity-api.js","webpack://CityGrows/./app/javascript/actions/activity-log-actions.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/activity.jsx","webpack://CityGrows/./app/javascript/apis/process-assignments-api.js","webpack://CityGrows/./app/javascript/actions/process-assignment-actions.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/menu/members.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/menu/access-manager.jsx","webpack://CityGrows/./app/javascript/apis/applicant-attachment-api.js","webpack://CityGrows/./app/javascript/actions/applicant-attachment-actions.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/menu/applicant-manager.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/access.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/launch-info.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/tag-manager.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/tag-list.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/header-meta.jsx","webpack://CityGrows/./app/javascript/components/hooks/use-keydown.js","webpack://CityGrows/./app/javascript/components/shared/discussions/comment.jsx","webpack://CityGrows/./app/javascript/components/shared/discussions/item.jsx","webpack://CityGrows/./app/javascript/components/shared/discussion-content.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/process-discussion.jsx","webpack://CityGrows/./app/javascript/modules/ajax-download.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/documents_and_files/file.jsx","webpack://CityGrows/./app/javascript/apis/outputs-api.js","webpack://CityGrows/./app/javascript/components/shared/backgrounded-job-link.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/documents_and_files/download-links.jsx","webpack://CityGrows/./app/javascript/components/shared/expandable-content.jsx","webpack://CityGrows/./app/javascript/contexts/request-is-gov-context.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/output/output-download-link.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/output/renewal-manager.jsx","webpack://CityGrows/./app/javascript/apis/issued-output-api.js","webpack://CityGrows/./app/javascript/actions/issued-output-actions.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/output/renewal-opt-out-link.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/output/revoke-button.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/output/output-details.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/output/output.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/documents-and-files.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/menu.jsx","webpack://CityGrows/./app/javascript/modules/active-step-validator.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/if_control_nav/addl-options.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/if_control_nav/support.jsx","webpack://CityGrows/./app/javascript/apis/signing-api.js","webpack://CityGrows/./app/javascript/actions/signature-actions.js","webpack://CityGrows/./app/javascript/components/module_views/signature-prompt.jsx","webpack://CityGrows/./app/javascript/modules/signature-prompt.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/if_control_nav/advancement-handler.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/if-control-nav.jsx","webpack://CityGrows/./app/javascript/components/shared/instructions.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/collect-info/collect-info-section.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/collect-info/signature-details.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/collect-info-step.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/assign-responsibility-step.jsx","webpack://CityGrows/./app/javascript/modules/number-round.js","webpack://CityGrows/./app/javascript/modules/fee-calculator.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/receipt.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/paid.jsx","webpack://CityGrows/./app/javascript/apis/refund-api.js","webpack://CityGrows/./app/javascript/apis/charge-api.js","webpack://CityGrows/./app/javascript/apis/payment-api.js","webpack://CityGrows/./app/javascript/actions/payment-step-actions.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/check-form.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/cash-form.jsx","webpack://CityGrows/./app/javascript/apis/payment-intents-api.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/amount.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/amount-breakdown.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/stripe-form.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/credit-card-form.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/unpaid.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/no-payment-required-view.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/action-links.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/pending.jsx","webpack://CityGrows/./app/javascript/components/shared/expanded-section.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payments/refund-widget.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/payment-step.jsx","webpack://CityGrows/./app/javascript/apis/requirement-api.js","webpack://CityGrows/./app/javascript/actions/requirement-actions.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/requirements/requirement-buttons.jsx","webpack://CityGrows/./app/javascript/apis/step-approval-api.js","webpack://CityGrows/./app/javascript/apis/review-requests-api.js","webpack://CityGrows/./app/javascript/actions/review-actions.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/reviews/third-party-review-person-selector.jsx","webpack://CityGrows/./app/javascript/modules/color-for-approval.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/reviews/previous-review.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/reviews/interface.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/reviews/submit-review-widget.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/reviews/reviewer.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/reviews/specific-people-review.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/reviews/active-review-group.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/reviews/constituent-review-info.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/require-review-step.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/requirements/requirement-description-manager.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/requirements/supplemental-requirement.jsx","webpack://CityGrows/./app/javascript/actions/initiated_flow/survey-actions.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/surveys/survey-submission-line.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/surveys/survey-submission-line-task-view.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/surveys/survey-responses.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/surveys/survey-invitation-line.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/surveys/survey-invitations.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/survey-step.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/outputs-container.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/current-step.jsx","webpack://CityGrows/./app/javascript/apis/subprocess-requirements-api.js","webpack://CityGrows/./app/javascript/actions/subprocess-requirement-actions.js","webpack://CityGrows/./app/javascript/components/initiated_flow/process/timeline/subprocess_requirement/options.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/timeline/subprocess-requirement.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/timeline/step_in_list/step-output.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/timeline/step-in-list.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/timeline.jsx","webpack://CityGrows/./app/javascript/components/shared/sliding-panel.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/active-process.jsx","webpack://CityGrows/./app/javascript/apis/my-tasks-api.js","webpack://CityGrows/./app/javascript/components/shared/collect-info-step-summary.jsx","webpack://CityGrows/./app/javascript/components/my-tasks/task-step/previous-step.jsx","webpack://CityGrows/./app/javascript/components/shared/buttons/up-down-arrow.jsx","webpack://CityGrows/./app/javascript/components/my-tasks/task-step.jsx","webpack://CityGrows/./app/javascript/components/my-tasks/tasks-main-content.jsx","webpack://CityGrows/./app/javascript/components/initiated_flow/process/steps/reviews/discussion.jsx","webpack://CityGrows/./app/javascript/components/my-tasks/tasks-sidebar.jsx","webpack://CityGrows/./app/javascript/components/initiated-flow-manager.jsx","webpack://CityGrows/./app/javascript/initializers/initiated-flows.jsx.js","webpack://CityGrows/./app/javascript/components/issued-output.jsx","webpack://CityGrows/./app/javascript/initializers/issued-outputs.js","webpack://CityGrows/./app/javascript/actions/quicklaunch-actions.jsx","webpack://CityGrows/./app/javascript/components/quicklaunch.jsx","webpack://CityGrows/./app/javascript/components/shared/user-menu.jsx","webpack://CityGrows/./app/javascript/components/shared/public-nav-menu.jsx","webpack://CityGrows/./app/javascript/components/header-disc.jsx","webpack://CityGrows/./app/javascript/components/help-links.jsx","webpack://CityGrows/./app/javascript/initializers/layout.jsx","webpack://CityGrows/./app/javascript/contexts/document-dispatch-context.js","webpack://CityGrows/./app/javascript/actions/document-manager-actions.js","webpack://CityGrows/./app/javascript/modules/document-mapping-helper.js","webpack://CityGrows/./app/javascript/components/document-config/mapping-pdf-viewer.jsx","webpack://CityGrows/./app/javascript/components/document_manager/drag-and-drop-box.jsx","webpack://CityGrows/./app/javascript/components/document_manager/mapping.jsx","webpack://CityGrows/./app/javascript/components/document_manager/document-config.jsx","webpack://CityGrows/./app/javascript/components/document-manager.jsx","webpack://CityGrows/./app/javascript/initializers/master-template-documents.js","webpack://CityGrows/./app/javascript/initializers/master-template-imports.js","webpack://CityGrows/./app/javascript/reducers/access-manager-reducer.js","webpack://CityGrows/./app/javascript/components/shared/action-button.jsx","webpack://CityGrows/./app/javascript/components/shared/version-number.jsx","webpack://CityGrows/./app/javascript/components/edit_flow/template_header/template-navbar.jsx","webpack://CityGrows/./app/javascript/components/edit_flow/template_header/launch-options.jsx","webpack://CityGrows/./app/javascript/components/edit_flow/template_header/flow-template-name.jsx","webpack://CityGrows/./app/javascript/components/edit_flow/flow-template-header.jsx","webpack://CityGrows/./app/javascript/components/shared/chart/pie.jsx","webpack://CityGrows/./app/javascript/components/shared/data-visualizer/multiple-choice-visualizer.jsx","webpack://CityGrows/./app/javascript/components/shared/data-visualizer/location-visualizer.jsx","webpack://CityGrows/./app/javascript/components/shared/data-visualizer/money-visualizer.jsx","webpack://CityGrows/./app/javascript/components/shared/data-visualizer/number-visualizer.jsx","webpack://CityGrows/./app/javascript/components/shared/data-visualizer.jsx","webpack://CityGrows/./app/javascript/components/shared/chart/bar.jsx","webpack://CityGrows/./app/javascript/components/flow_data/overview-stats.jsx","webpack://CityGrows/./app/javascript/components/flow_data/stats.jsx","webpack://CityGrows/./app/javascript/components/template_manager/unpublished-changes-banner.jsx","webpack://CityGrows/./app/javascript/components/template-manager.jsx","webpack://CityGrows/./app/javascript/initializers/master-templates.js","webpack://CityGrows/./app/javascript/components/merchant-accounts-manager.jsx","webpack://CityGrows/./app/javascript/initializers/merchant-accounts.js","webpack://CityGrows/./app/javascript/components/metrics_dashboard/data-box.jsx","webpack://CityGrows/./app/javascript/components/metrics_dashboard/top-row.jsx","webpack://CityGrows/./app/javascript/components/shared/chart/donut.jsx","webpack://CityGrows/./app/javascript/constants/chart-colors.js","webpack://CityGrows/./app/javascript/components/shared/no-data-placeholder.jsx","webpack://CityGrows/./app/javascript/components/metrics_dashboard/second-row.jsx","webpack://CityGrows/./app/javascript/components/metrics_dashboard/filters.jsx","webpack://CityGrows/./app/javascript/components/metrics_dashboard/finances/top-row.jsx","webpack://CityGrows/./app/javascript/components/metrics_dashboard/finances/second-row.jsx","webpack://CityGrows/./app/javascript/components/metrics_dashboard/finances.jsx","webpack://CityGrows/./app/javascript/apis/metrics-dashboard-api.js","webpack://CityGrows/./app/javascript/components/metrics_dashboard/submissions-table.jsx","webpack://CityGrows/./app/javascript/components/metrics-dashboard.jsx","webpack://CityGrows/./app/javascript/initializers/metrics-dashboard.js","webpack://CityGrows/./app/javascript/components/my-tasks/tasks-header-bar.jsx","webpack://CityGrows/./app/javascript/components/my-tasks/tasks-list-item.jsx","webpack://CityGrows/./app/javascript/components/my-tasks/tasks-list.jsx","webpack://CityGrows/./app/javascript/components/my-tasks-container.jsx","webpack://CityGrows/./app/javascript/initializers/my-tasks.js","webpack://CityGrows/./app/javascript/initializers/pages.js","webpack://CityGrows/./app/javascript/components/shared/org-header.jsx","webpack://CityGrows/./app/javascript/initializers/public/initiated-flows.js","webpack://CityGrows/./app/javascript/components/template-stats.jsx","webpack://CityGrows/./app/javascript/components/public/admin-step-group.jsx","webpack://CityGrows/./app/javascript/components/public/field-preview.jsx","webpack://CityGrows/./app/javascript/components/public/overview-step.jsx","webpack://CityGrows/./app/javascript/components/public/const-step-group.jsx","webpack://CityGrows/./app/javascript/components/public/step-breakdown.jsx","webpack://CityGrows/./app/javascript/components/public/overview-tabs.jsx","webpack://CityGrows/./app/javascript/components/public/overview-description-editor.jsx","webpack://CityGrows/./app/javascript/components/public-overview-header.jsx","webpack://CityGrows/./app/javascript/components/public-process-overview.jsx","webpack://CityGrows/./app/javascript/apis/search-pages-api.js","webpack://CityGrows/./app/javascript/components/shared/pagination-buttons.jsx","webpack://CityGrows/./app/javascript/components/shared/search-results.jsx","webpack://CityGrows/./app/javascript/components/public-search.jsx","webpack://CityGrows/./app/javascript/initializers/public/master-templates.js","webpack://CityGrows/./app/javascript/initializers/public/surveys.js","webpack://CityGrows/./app/javascript/initializers/public/survey-submissions.js","webpack://CityGrows/./app/javascript/components/teams/process-search.jsx","webpack://CityGrows/./app/javascript/initializers/public/teams.js","webpack://CityGrows/./app/javascript/initializers/registrations.js","webpack://CityGrows/./app/javascript/components/process-summary.jsx","webpack://CityGrows/./app/javascript/components/review-app.jsx","webpack://CityGrows/./app/javascript/initializers/review.js","webpack://CityGrows/./app/javascript/components/search-page-container.jsx","webpack://CityGrows/./app/javascript/initializers/search-pages.js","webpack://CityGrows/./app/javascript/actions/team-actions.js","webpack://CityGrows/./app/javascript/apis/team-domain-api.js","webpack://CityGrows/./app/javascript/actions/domain-manager-actions.js","webpack://CityGrows/./app/javascript/modules/domain-validator.js","webpack://CityGrows/./app/javascript/components/teams/domain-manager.jsx","webpack://CityGrows/./app/javascript/components/team_page/public-portal-header.jsx","webpack://CityGrows/./app/javascript/components/team-page.jsx","webpack://CityGrows/./app/javascript/initializers/teams.js","webpack://CityGrows/./app/javascript/apis/transactions-api.js","webpack://CityGrows/./app/javascript/components/shared/date-filters.jsx","webpack://CityGrows/./app/javascript/initializers/transactions.js","webpack://CityGrows/./app/javascript/initializers/unclaimed-processes.js","webpack://CityGrows/./app/javascript/components/user/email-setting.jsx","webpack://CityGrows/./app/javascript/apis/email-settings-api.js","webpack://CityGrows/./app/javascript/components/user/email-settings.jsx","webpack://CityGrows/./app/javascript/components/shared/editable-input.jsx","webpack://CityGrows/./app/javascript/components/user/profile.jsx","webpack://CityGrows/./app/javascript/components/user/password-manager.jsx","webpack://CityGrows/./app/javascript/components/user-container.jsx","webpack://CityGrows/./app/javascript/components/delayed-redirect.jsx","webpack://CityGrows/./app/javascript/components/unverified-email-app.jsx","webpack://CityGrows/./app/javascript/initializers/users.js","webpack://CityGrows/./app/javascript/initializers/verifications.js","webpack://CityGrows/./app/javascript/init.js","webpack://CityGrows/./app/javascript/components/module_views/alert-confirm.jsx","webpack://CityGrows/./app/javascript/modules/logger.js","webpack://CityGrows/./app/javascript/modules/alert-confirm.js","webpack://CityGrows/./app/javascript/modules/collected-data-validator.js","webpack://CityGrows/./app/javascript/modules/dnd-utils.js","webpack://CityGrows/./app/javascript/modules/email-validator.js","webpack://CityGrows/./app/javascript/modules/field-manager.js","webpack://CityGrows/./app/javascript/modules/object-patch.js","webpack://CityGrows/./app/javascript/modules/pluralize.js","webpack://CityGrows/./app/javascript/apis/jobs-api.js","webpack://CityGrows/./app/javascript/modules/pollable-job.js","webpack://CityGrows/./app/javascript/modules/renderer.js","webpack://CityGrows/./app/javascript/modules/shield.js","webpack://CityGrows/./app/javascript/modules/slug-validator.js","webpack://CityGrows/./app/javascript/modules/step-data-types.js","webpack://CityGrows/./app/javascript/modules/template-variables.js","webpack://CityGrows/./app/javascript/modules/url-generator.js","webpack://CityGrows/./app/javascript/stores/template-manager-store.js","webpack://CityGrows/./app/javascript/theme/colors.js","webpack://CityGrows/./app/javascript/theme/discs.js","webpack://CityGrows/./vendor/assets/javascripts/stapes.js"],"sourcesContent":["var TentativeAssignmentsAPI = {\n toggleAssignment: function(activeStepId, userId){\n const url = '/tentative_assignments/toggle';\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n active_step_id: activeStepId,\n user_id: userId\n }\n });\n },\n\n addPseudomember: function(email, name, activeStepId){\n const url = '/tentative_assignments/add_pseudomember';\n return $.ajax(url, {\n data: {\n email: email,\n name: name,\n active_step_id: activeStepId\n },\n method: 'POST',\n dataType: 'json'\n });\n },\n\n removeAssignment: function(id) {\n const url = `/tentative_assignments/${id}`\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json'\n })\n }\n};\n\nexport default TentativeAssignmentsAPI;\n","import API from 'apis/attachment-api';\nimport Constants from 'constants/attached-people-constants';\nimport InitiatedFlowConstants from 'constants/initiated-flow-constants';\nimport ActiveStepConstants from 'constants/active-step-constants';\nimport TentativeAssignmentsAPI from 'apis/tentative-assignments-api';\nimport RolesAPI from 'apis/role-api';\nimport { error } from 'components/shared/flash';\nimport Dispatcher from '../appdispatcher';\n\nconst AttachmentActions = {\n\n dispatchInitiatedFlowTogglePerson(dispatch, response) {\n dispatch({\n type: InitiatedFlowConstants.ASSIGNED_PEOPLE_UPDATED,\n personAttachment: response,\n });\n },\n\n dispatchTogglePersonEvent(attachableType, attachableId, response) {\n Dispatcher.dispatch({\n actionType: Constants.TOGGLE_PERSON,\n attachedPerson: response,\n attachableId,\n attachableType,\n });\n },\n\n onAssignmentToggled(dispatch, personAttachment) {\n dispatch({\n type: InitiatedFlowConstants.ASSIGNMENT_UPDATED,\n personAttachment,\n });\n },\n\n onTentativeDone(dispatch) {\n dispatch({\n type: ActiveStepConstants.CHANGES_PERSISTED,\n });\n },\n\n addPseudomemberTentative(email, name, activeStepId) {\n return TentativeAssignmentsAPI.addPseudomember(email, name, activeStepId);\n },\n\n addPseudomember(email, name, attachableType, attachableId, opts) {\n return pseudoAdd(email, name, attachableType, attachableId, opts);\n },\n\n toggleTentativePerson(activeStepId, userId) {\n return TentativeAssignmentsAPI.toggleAssignment(activeStepId, userId);\n },\n\n togglePerson(attachableId, attachableType, userId, type) {\n return toggle(attachableType, attachableId, userId, type);\n },\n\n togglePersonViaAttachedRole(attachableId, attachableType, roleId, userId) {\n return toggle('AdminRole', roleId, userId, 'User')\n .done((response) => {\n Dispatcher.dispatch({\n actionType: Constants.UPDATE_ATTACHMENT,\n attachment: response,\n roleId,\n attachableId,\n attachableType,\n });\n });\n },\n\n removeTentativePerson(personAttachmentId) {\n return TentativeAssignmentsAPI.removeAssignment(personAttachmentId);\n },\n\n removePerson(personAttachmentId) {\n return API.removeAttachment(personAttachmentId);\n },\n\n toggleAssigned(personAttachment) {\n const toggledAttachment = { ...personAttachment, assigned: !personAttachment.assigned };\n return API.update(personAttachment.attachment_id, {\n assigned: toggledAttachment.assigned,\n });\n },\n\n fetchRoles(teamId, opts) {\n return RolesAPI.search(teamId, opts);\n },\n\n toggleRole(attachableId, attachableType, roleId, opts = { userToAdd: null }) {\n return toggle(attachableType, attachableId, roleId, 'AdminRole', { userToAdd: opts.userToAdd });\n },\n};\n\nfunction toggle(attachableType, attachableId, subjectId, subjectType, opts = {}) {\n return API.toggle(attachableType, attachableId, subjectId, subjectType, opts)\n .fail(() => { error(); });\n}\n\nfunction pseudoAdd(email, name, attachableType, attachableId, opts) {\n return API.addPseudomember(email, name, attachableType, attachableId, opts);\n}\n\nexport default AttachmentActions;\n","export const create = (stepAssignmentGroupId, assigneeId, assigneeType) => {\n const url = `/step_assignment_groups/${stepAssignmentGroupId}/step_assignments`;\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n step_assignment: {\n assignee_id: assigneeId,\n assignee_type: assigneeType,\n },\n },\n });\n};\n\nexport const destroy = (stepAssignmentId) => {\n const url = `/step_assignments/${stepAssignmentId}`;\n return $.ajax(url, {\n dataType: 'json',\n method: 'DELETE',\n });\n};\n\nexport default {\n create,\n destroy,\n};\n","var FlowStepAPI = {\n add: function(flowTemplateId, type){\n const url = `/flow_templates/${flowTemplateId}/steps`;\n const request = $.ajax(url, {\n data: {\n step: { type }\n },\n method: 'POST',\n dataType: 'json'\n });\n\n return request;\n },\n\n update: function(attrs){\n var url = '/steps/' + attrs.id;\n delete attrs.id;\n var request = $.ajax(url, {\n data: {\n step: attrs\n },\n method: 'PUT',\n dataType: 'json'\n });\n\n return request;\n },\n\n reorder: function(stepId, position) {\n const url = `/steps/${stepId}/reorder`;\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n step: {\n position\n }\n }\n });\n },\n\n delete: function(stepId){\n var url = '/steps/' + stepId;\n var request = $.ajax(url, {\n dataType: 'json',\n method: 'DELETE'\n });\n\n return request;\n },\n\n duplicate: function(stepId){\n const URL = `/steps/${stepId}/duplicate`;\n\n return $.ajax(URL, {\n method: 'POST',\n dataType: 'json'\n });\n },\n\n index: function(flowTemplateId){\n var url = '/flow_templates/' + flowTemplateId + '/steps';\n var request = $.ajax(url, {\n method: 'GET'\n });\n\n return request;\n }\n};\n\nexport default FlowStepAPI;\n","export const create = (stepId, assigneeId, assigneeType) => {\n const url = `/steps/${stepId}/step_assignment_groups`;\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n step_assignment_group: {\n step_assignments_attributes: [{\n assignee_id: assigneeId,\n assignee_type: assigneeType,\n }],\n },\n },\n });\n};\n\nexport const createPrevAssignees = (stepId) => {\n // Create an empty assignment group with\n // delete_old_assignments = false. Preserves\n // assignees from the previous step.\n\n const url = `/steps/${stepId}/step_assignment_groups`;\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n step_assignment_group: {\n delete_old_assignments: false,\n },\n },\n });\n};\n\nexport const destroy = (stepAssignmentGroupId) => {\n const url = `/step_assignment_groups/${stepAssignmentGroupId}`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n};\n\nexport default {\n create,\n createPrevAssignees,\n destroy,\n};\n","import NProgress from 'nprogress';\nimport { isArray } from 'underscore';\nimport StepAssignmentAPI from 'apis/step-assignments-api';\nimport Dispatcher from '../appdispatcher';\nimport API from '../apis/flow-step-api';\nimport StepAssignmentGroupAPI from '../apis/step-assignment-group-api';\nimport StepDataAPI from '../apis/step-data-api';\nimport Constants from '../constants/template-manager-constants';\nimport AlertConfirm from '../modules/alert-confirm';\nimport Flash from '../components/shared/flash';\n\nfunction parseUpdates(attrs, response) {\n const updates = {};\n Object.keys(attrs).forEach((key) => {\n if (key === 'config_attributes') {\n updates.config = buildConfig(attrs.config_attributes, response.config);\n } else {\n updates[key] = response[key];\n }\n });\n\n return updates;\n}\n\nfunction buildConfig(attrsConfig, responseConfig) {\n const config = { ...responseConfig };\n Object.keys(attrsConfig).forEach((key) => {\n config[key] = responseConfig[key];\n });\n\n return config;\n}\n\nconst FlowStepActions = {\n addStep(flowTemplateId, stepType) {\n NProgress.start();\n\n return API.add(flowTemplateId, stepType)\n .done((newStep) => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_ADDED,\n step: newStep,\n });\n })\n .fail((res) => {\n Flash.error(res.responseJSON?.errors ? res.responseJSON.errors[0] : 'Oops, something went wrong');\n })\n .always(() => {\n NProgress.done();\n });\n },\n\n removeStep(stepId) {\n API.delete(stepId)\n .done(() => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_REMOVED,\n stepId,\n });\n })\n .fail((res) => {\n const errorMessage = res.responseJSON.errors.base[0];\n AlertConfirm.alert('Can\\'t delete this step', errorMessage);\n });\n },\n\n stepsReordered(id, position) {\n return API.reorder(id, position)\n .fail(this.onFail)\n .done((res) => {\n Dispatcher.dispatch({\n actionType: Constants.STEPS_REORDERED,\n stepPositions: res,\n });\n });\n },\n\n duplicateStep(stepId) {\n return API.duplicate(stepId)\n .done((step) => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_ADDED,\n step,\n });\n })\n .fail(() => { Flash.error(); });\n },\n\n updateStep(stepId, attrs) {\n NProgress.start();\n\n return API.update({ id: stepId, ...attrs })\n .done((res) => {\n const updates = parseUpdates(attrs, res);\n Dispatcher.dispatch({\n actionType: Constants.STEP_UPDATED,\n attrs: updates,\n stepId,\n });\n })\n .fail(() => {\n Flash.error('There was a problem updating your step settings');\n })\n .always(() => {\n NProgress.done();\n });\n },\n\n addData(sectionId, type = null) {\n NProgress.start();\n\n return StepDataAPI.add(sectionId, type)\n .done((datum) => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_DATA_ADDED,\n sectionId,\n datum,\n });\n })\n .fail((res) => {\n res?.responseJSON?.errors ? Flash.error(res.responseJSON.errors[0]) : Flash.error();\n })\n .always(() => {\n NProgress.done();\n });\n },\n\n duplicateDatum(datumId) {\n NProgress.start();\n\n StepDataAPI.duplicate(datumId)\n .done((datum) => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_DATA_ADDED,\n sectionId: datum.section_id,\n datum,\n });\n Flash.success('Field duplicated');\n })\n .fail((res) => {\n Flash.error(res.responseJSON.errors ? res.responseJSON.errors[0] : null);\n })\n .always(() => {\n NProgress.done();\n });\n },\n\n addSection(stepId) {\n NProgress.start();\n\n StepDataAPI.addSection('Step', stepId)\n .done((section) => {\n Dispatcher.dispatch({\n actionType: Constants.SECTION_ADDED,\n section,\n stepId,\n });\n })\n .always(() => {\n NProgress.done();\n })\n .fail((res) => {\n Flash.error(res.responseJSON.errors ? res.responseJSON.errors[0] : null);\n });\n },\n\n updateSection(sectionId, attrs) {\n return StepDataAPI.updateSection(sectionId, attrs)\n .done((section) => {\n Dispatcher.dispatch({\n actionType: Constants.SECTION_UPDATED,\n section,\n });\n })\n .fail((res) => {\n Flash.error(res.responseJSON.errors ? res.responseJSON.errors[0] : null);\n });\n },\n\n destroySection(sectionId) {\n AlertConfirm.confirm('Delete this section?', 'Are you sure you want to delete this section?', () => {\n StepDataAPI.destroySection(sectionId)\n .done(() => {\n Dispatcher.dispatch({\n actionType: Constants.SECTION_REMOVED,\n sectionId,\n });\n })\n .fail(this.onFail);\n });\n },\n\n moveSection(sectionId, position) {\n return StepDataAPI.reorderSection(sectionId, position)\n .done((sections) => {\n Dispatcher.dispatch({\n actionType: Constants.SECTION_MOVED,\n sections,\n });\n });\n },\n\n copySection(sectionId, stepId) {\n return StepDataAPI.copySection(sectionId)\n .done((section) => {\n Dispatcher.dispatch({\n actionType: Constants.SECTION_COPIED,\n section,\n stepId,\n });\n });\n },\n\n refreshStepData(stepDatumId) {\n return StepDataAPI.fetch(stepDatumId)\n .done((res) => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_DATA_UPDATED,\n datumAttrs: res,\n datumId: stepDatumId,\n });\n });\n },\n\n moveStepData(datumId, position, sectionId) {\n return StepDataAPI.reorder(datumId, position, sectionId)\n .done((response) => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_DATA_MOVED,\n data: response,\n });\n })\n .fail(this.onFail);\n },\n\n updateStepData(datumId, datumAttrs) {\n return StepDataAPI.update(datumId, datumAttrs)\n .done((res) => {\n const updates = parseUpdates(datumAttrs, res);\n Dispatcher.dispatch({\n actionType: Constants.STEP_DATA_UPDATED,\n datumAttrs: updates,\n datumId,\n });\n })\n .fail(this.onFail);\n },\n\n deleteStepData(stepDatumId) {\n return StepDataAPI.destroy(stepDatumId)\n .done(() => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_DATA_REMOVED,\n stepDatumId,\n });\n });\n },\n\n changeTime(stepId, attrs) {\n return API.update({ id: stepId, ...attrs })\n .done(() => {\n const message = (!attrs.time && !attrs.time_unit ? 'Timeframe removed' : 'Timeframe updated');\n Flash.success(message);\n Dispatcher.dispatch({\n actionType: Constants.STEP_UPDATED,\n attrs,\n stepId,\n });\n });\n },\n\n clearSpecificResponsibility(stepId) {\n const attrs = { id: stepId, responsibility_type: 'assigned' };\n return API.update(attrs)\n .done(() => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_UPDATED,\n attrs: { person_attachments: [] },\n stepId,\n });\n });\n },\n\n createPrevAssigneesGroup(stepId) {\n return StepAssignmentGroupAPI.createPrevAssignees(stepId)\n .done((group) => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_ASSIGNMENT_GROUP_CREATED,\n group,\n });\n })\n .fail(() => Flash.error());\n },\n\n createAssignmentGroup(stepId, assigneeId, assigneeType) {\n return StepAssignmentGroupAPI.create(stepId, assigneeId, assigneeType)\n .done((group) => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_ASSIGNMENT_GROUP_CREATED,\n group,\n });\n })\n .fail(() => Flash.error());\n },\n\n deleteAssignmentGroup(stepAssignmentGroupId) {\n return StepAssignmentGroupAPI.destroy(stepAssignmentGroupId)\n .done(() => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_ASSIGNMENT_GROUP_DELETED,\n id: stepAssignmentGroupId,\n });\n })\n .fail(() => Flash.error());\n },\n\n deleteAssignment(stepAssignmentId) {\n return StepAssignmentAPI.destroy(stepAssignmentId)\n .done(() => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_ASSIGNMENT_DELETED,\n id: stepAssignmentId,\n });\n })\n .fail(() => Flash.error());\n },\n\n createAssignment(stepAssignmentGroupId, selectionId, selectionType) {\n StepAssignmentAPI.create(stepAssignmentGroupId, selectionId, selectionType)\n .done((res) => {\n Dispatcher.dispatch({\n actionType: Constants.STEP_ASSIGNMENT_CREATED,\n stepAssignment: res,\n });\n })\n .fail(() => Flash.error());\n },\n\n onFail(res) {\n if (isArray(res.responseJSON.errors)) {\n Flash.error(res.responseJSON.errors[0]);\n } else {\n Flash.error(res.responseJSON.errors.base[0]);\n }\n },\n};\n\nexport default FlowStepActions;\n","const SurveyAPI = {\n update: function(surveyId, attrs){\n const url = '/surveys/' + surveyId;\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n survey: attrs\n }\n });\n },\n\n submit: function(surveyId, surveyToken, data){\n const url = '/surveys/' + surveyId;\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n survey_token: surveyToken,\n data\n }\n });\n }\n};\n\nexport default SurveyAPI;\n","import NProgress from 'nprogress';\nimport Dispatcher from '../appdispatcher';\nimport Flash from '../components/shared/flash';\nimport Constants from '../constants/template-manager-constants';\nimport SurveyAPI from '../apis/survey-api';\nimport StepDataAPI from '../apis/step-data-api';\n\nconst SurveyActions = {\n update(surveyId, attrs) {\n return SurveyAPI.update(surveyId, attrs)\n .done(this.dispatchSurveyUpdated)\n .fail(this.onSurveyUpdateFail);\n },\n\n addSection(surveyId, stepId) {\n NProgress.start();\n\n StepDataAPI.addSection('Survey', surveyId)\n\n .done((section) => {\n Dispatcher.dispatch({\n actionType: Constants.SURVEY_SECTION_ADDED,\n section,\n stepId,\n });\n\n NProgress.done();\n });\n },\n\n copySection(sectionId, stepId) {\n StepDataAPI.copySection(sectionId)\n .done((section) => {\n Dispatcher.dispatch({\n actionType: Constants.SURVEY_SECTION_COPIED,\n section,\n stepId,\n });\n });\n },\n\n dispatchSurveyUpdated(survey) {\n Dispatcher.dispatch({\n actionType: Constants.SURVEY_UPDATED,\n survey,\n });\n },\n\n onSurveyUpdateFail(res) {\n Flash.error(res.responseJSON.errors.base[0]);\n },\n\n updateIdentified(surveyId, newValue) {\n const request = SurveyAPI.update(surveyId, {\n identified: newValue,\n });\n\n request.done(this.dispatchSurveyUpdated)\n .fail(() => { Flash.error(); });\n },\n};\n\nexport const exportResponses = (activeStepId) => {\n const URL = `/active_steps/${activeStepId}/survey_submission/exports`;\n\n return $.ajax(URL, {\n method: 'POST',\n dataType: 'json'\n });\n};\n\nexport default SurveyActions;\n","import NProgress from 'nprogress';\nimport FlowTemplateAPI from '../apis/flow-template-api';\nimport Flash from '../components/shared/flash';\n\nconst TemplateExtrasActions = {\n cloneTemplate(templateId, teamId) {\n NProgress.start();\n\n return FlowTemplateAPI.clone(templateId, teamId)\n .fail((res) => {\n if (res.responseJSON) {\n Flash.error(res.responseJSON.errors[0]);\n } else {\n Flash.error();\n }\n })\n .always(NProgress.done());\n },\n\n duplicateTemplate(templateId, teamId, cloneOutputDocuments) {\n const data = {\n team_id: teamId,\n clone_output_documents: cloneOutputDocuments\n };\n\n return FlowTemplateAPI.duplicate(templateId, data)\n .fail((res) => {\n if (res.responseJSON) {\n Flash.error(res.responseJSON.errors[0]);\n } else {\n Flash.error();\n }\n })\n .always(NProgress.done());\n },\n};\n\nexport default TemplateExtrasActions;\n","const CustomIdAPI = {\n\n create: (masterTemplateId, pattern) => {\n const url = `/master_templates/${masterTemplateId}/custom_ids`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n custom_id: {\n pattern: pattern\n }\n }\n });\n },\n\n destroy: (customIdId) => {\n const url = `/custom_ids/${customIdId}`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'DELETE'\n });\n }\n\n};\n\nexport default CustomIdAPI;","const TemplateCategoryAPI = {\n\n create: (name) => {\n const url = '/template_categories';\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n name,\n },\n });\n },\n\n};\n\nexport default TemplateCategoryAPI;\n","\nimport NProgress from 'nprogress';\nimport Dispatcher from '../appdispatcher';\nimport Constants from '../constants/template-manager-constants';\nimport FlowTemplateAPI from '../apis/flow-template-api';\nimport MasterTemplateAPI from '../apis/master-template-api';\nimport CustomIdAPI from '../apis/custom-id-api';\nimport Flash from '../components/shared/flash';\nimport PollableJob from '../modules/pollable-job';\nimport TemplateCategoryAPI from '../apis/template-category-api';\n\n// TODO: refactor so this isn't necessary\nlet _publishTemplatePromise;\n\nconst TemplateManagerActions = {\n loadModificationStatus(masterTemplateId) {\n MasterTemplateAPI.modified(masterTemplateId)\n .done((res) => {\n Dispatcher.dispatch({\n actionType: Constants.FLOW_TEMPLATE_UPDATED,\n attrs: {\n is_modified: res.modified,\n },\n });\n });\n },\n\n fetchSearchStepDataOptions(masterTemplateId) {\n return MasterTemplateAPI.stepData(masterTemplateId);\n },\n\n fetchSubprocessOptions(teamId) {\n return MasterTemplateAPI.index(teamId);\n },\n\n setFlowTemplate(flowTemplate) {\n Dispatcher.dispatch({\n actionType: Constants.FLOW_TEMPLATE_LOADED,\n flowTemplate,\n });\n },\n\n setLaunchData(launchData) {\n Dispatcher.dispatch({\n actionType: Constants.SET_LAUNCH_DATA,\n flowTemplate: launchData,\n });\n },\n\n updateFlowTemplate(flowTemplateId, attrs) {\n return FlowTemplateAPI.update(flowTemplateId, attrs)\n .done(() => this.triggerUpdateEvent(attrs));\n },\n\n updateMasterTemplate(masterTemplateId, attrs) {\n MasterTemplateAPI.update(masterTemplateId, attrs)\n .done(this.onMasterTemplateUpdateSuccess.bind(this))\n .fail(() => {\n Flash.error('Sorry, there was a problem updating this form.');\n });\n },\n\n triggerUpdateEvent(attrs) {\n Dispatcher.dispatch({\n actionType: Constants.FLOW_TEMPLATE_UPDATED,\n attrs,\n });\n },\n\n onMasterTemplateUpdateSuccess(template) {\n this.dispatchMasterTemplateLoaded(template);\n Flash.success('Update successful');\n },\n\n changeTemplateStatus(masterTemplateId, newStatus) {\n MasterTemplateAPI.update(masterTemplateId, { status: newStatus })\n .done((masterTemplate) => {\n this.dispatchMasterTemplateLoaded(masterTemplate);\n Flash.success('Form status updated');\n })\n .fail(() => Flash.error('Form status update failed'));\n },\n\n onSlugSave(masterTemplateId, newSlug) {\n NProgress.start();\n\n return MasterTemplateAPI.update(masterTemplateId, {\n slug: newSlug,\n })\n .done(() => {\n Dispatcher.dispatch({\n actionType: Constants.SLUG_UPDATED,\n newSlug,\n });\n\n Flash.success('Form URL updated');\n })\n .fail(() => { Flash.error(); })\n .always(NProgress.done);\n },\n\n onCustomIdSave: (masterTemplateId, pattern) => {\n return CustomIdAPI.create(masterTemplateId, pattern)\n .done((customIdAttrs) => {\n if (customIdAttrs.errors.length > 0) {\n Flash.error(customIdAttrs.errors[0]);\n return;\n }\n\n Dispatcher.dispatch({\n actionType: Constants.CUSTOM_ID_CREATED,\n customIdAttrs,\n });\n })\n .fail(() => { Flash.error(); });\n },\n\n onCustomIdDelete: (masterTemplateId, pattern) => {\n return CustomIdAPI.destroy(masterTemplateId, pattern)\n .done(() => {\n Flash.success('Custom ID removed');\n\n Dispatcher.dispatch({\n actionType: Constants.CUSTOM_ID_DELETED,\n });\n })\n .fail(() => { Flash.error(); });\n },\n\n dispatchMasterTemplateLoaded(masterTemplate) {\n Dispatcher.dispatch({\n actionType: Constants.MASTER_TEMPLATE_LOADED,\n masterTemplate,\n });\n },\n\n publish(flowTemplateId) {\n NProgress.start();\n\n const jobRunner = new PollableJob(() => { return FlowTemplateAPI.publish(flowTemplateId); });\n jobRunner.run()\n .done(this.onPublishJobCompleted.bind(this))\n .fail(() => { Flash.error(); })\n .always(() => { NProgress.done(); });\n\n _publishTemplatePromise = $.Deferred();\n return _publishTemplatePromise;\n },\n\n markChanged() {\n Dispatcher.dispatch({\n actionType: Constants.MARK_FLOW_TEMPLATE_CHANGED,\n });\n },\n\n onPublishJobCompleted(response) {\n const result = JSON.parse(response);\n if (result.hasOwnProperty('template_data')) {\n this.onTemplatePublished(result.template_data);\n } else if (result.hasOwnProperty('errors')) {\n this.onTemplatePublishFailed(result.errors);\n } else {\n throw 'Publish job yielded unknown result';\n }\n },\n\n onTemplatePublished(template_data) {\n const flowTemplate = Object.assign(template_data.flow_template, { is_modified: false });\n this.setFlowTemplate(flowTemplate);\n this.dispatchMasterTemplateLoaded(template_data.master_template);\n\n Flash.success('Form has been published');\n\n _publishTemplatePromise.resolve();\n NProgress.done();\n },\n\n onTemplatePublishFailed(errors) {\n _publishTemplatePromise.reject();\n NProgress.done();\n\n Flash.error(errors[0]);\n },\n\n onTemplateCategorySave: (name) => {\n return TemplateCategoryAPI.create(name);\n },\n\n};\n\nexport default TemplateManagerActions;\n","const MasterTemplateAuthoritiesAPI = {\n create: (userId, masterTemplateId) => {\n const url = `/master_templates/${masterTemplateId}/master_template_authorities`;\n const request = $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n user_id: userId\n }\n });\n\n return request;\n },\n\n destroy: (authorityId) => {\n const url = `/master_template_authorities/${authorityId}`;\n const request = $.ajax(url, {\n dataType: 'json',\n method: 'DELETE'\n });\n\n return request;\n }\n};\n\nexport default MasterTemplateAuthoritiesAPI;\n","const MembershipAPI = {\n index(masterTemplateId) {\n const url = `/master_templates/${masterTemplateId}/master_template_memberships`;\n const request = $.ajax(url, {\n dataType: 'json',\n method: 'GET',\n });\n\n return request;\n },\n\n create(userId, masterTemplateId) {\n const url = `/master_templates/${masterTemplateId}/master_template_memberships`;\n const request = $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n membership: {\n user_id: userId,\n },\n },\n });\n\n return request;\n },\n\n sendInvite(masterTemplateId, name, email) {\n const url = `/master_templates/${masterTemplateId}/master_template_memberships/add_pseudomember`;\n const request = $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n master_template_id: masterTemplateId,\n name,\n email,\n },\n });\n\n return request;\n },\n\n resendInvite(invitationId) {\n const url = `/invitations/${invitationId}/resend_invite`;\n const request = $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n });\n\n return request;\n },\n\n update(membershipId, attrs) {\n const url = `/master_template_memberships/${membershipId}`;\n const request = $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n membership: attrs,\n },\n });\n\n return request;\n },\n\n destroy(membershipId) {\n const url = `/master_template_memberships/${membershipId}`;\n const request = $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n\n return request;\n },\n};\n\nexport default MembershipAPI;\n","import AuthoritiesAPI from 'apis/master-template-authorities-api';\nimport UserAPI from '../apis/user-api';\nimport MembershipAPI from '../apis/membership-api';\nimport { success, error } from '../components/shared/flash';\nimport UserAccessConstants from '../constants/user-access-constants';\n\nconst UserAccessActions = {\n fetchAll(flowTemplateId, dispatch) {\n return MembershipAPI.index(flowTemplateId)\n .done((res) => { dispatchMembershipList(res.memberships, dispatch); });\n },\n\n searchUsers(terms, opts) {\n return UserAPI.search(terms, opts);\n },\n\n addUser(userId, flowTemplateId, dispatch) {\n return MembershipAPI.create(userId, flowTemplateId)\n .done((membership) => { dispatchMembershipAdd(membership, dispatch); })\n .fail(() => error('There was a problem adding that user. Please try again later.'));\n },\n\n toggleAuthorityOn: (userId, flowTemplateId, dispatch) => {\n return AuthoritiesAPI.create(userId, flowTemplateId)\n .done((membership) => dispatchAuthorityAdd(membership, dispatch));\n },\n\n toggleAuthorityOff: (authorityId, dispatch) => {\n return AuthoritiesAPI.destroy(authorityId)\n .done(() => { dispatchAuthorityRemove(authorityId, dispatch); });\n },\n\n removeUser: (membershipId, dispatch) => {\n return MembershipAPI.destroy(membershipId)\n .done(() => dispatchMembershipRemove(membershipId, dispatch))\n .fail((res) => {\n error(res.responseJSON.errors.base[0]);\n });\n },\n\n updateUserPermission(membershipId, newPermissionId, dispatch) {\n onPermissionUpdated(membershipId, newPermissionId, dispatch);\n MembershipAPI.update(membershipId, {\n permission_level_id: newPermissionId,\n }).fail((r) => onPermissionUpdateFailed(r, dispatch))\n .done(() => success('Permission level updated'));\n },\n\n sendInvite(email, name, flowTemplateId, dispatch) {\n MembershipAPI.sendInvite(flowTemplateId, name, email)\n .done((res) => {\n dispatchMembershipAdd(res, dispatch);\n });\n },\n\n resendInvite(invitationId) {\n MembershipAPI.resendInvite(invitationId)\n .done(() => {\n success('Reminder sent');\n })\n .error(() => {\n error();\n });\n },\n\n};\n\nfunction dispatchMembershipRemove(membershipId, dispatch) {\n dispatch({\n type: UserAccessConstants.MEMBERSHIP_REMOVED,\n membershipId,\n });\n}\n\nfunction dispatchMembershipAdd(membership, dispatch) {\n dispatch({\n type: UserAccessConstants.MEMBERSHIP_ADDED,\n membership,\n });\n}\n\nfunction dispatchMembershipList(memberships, dispatch) {\n dispatch({\n type: UserAccessConstants.MEMBERSHIP_LIST,\n memberships,\n });\n}\n\nfunction dispatchAuthorityAdd(membership, dispatch) {\n dispatch({\n type: UserAccessConstants.AUTHORITY_ADDED,\n membership,\n });\n}\n\nfunction dispatchAuthorityRemove(authorityId, dispatch) {\n dispatch({\n type: UserAccessConstants.AUTHORITY_REMOVED,\n authorityId,\n });\n}\n\nfunction onPermissionUpdated(membershipId, permissionLevelId, dispatch) {\n dispatch({\n type: UserAccessConstants.PERMISSION_CHANGED,\n membershipId,\n permissionLevelId,\n });\n}\n\nfunction onPermissionUpdateFailed(res, dispatch) {\n const membership = res.responseJSON;\n\n dispatch({\n type: UserAccessConstants.PERMISSION_CHANGED,\n membershipId: membership.id,\n permissionLevelId: membership.permission_level_id_was,\n });\n\n error(membership.errors ? membership.errors[0] : null);\n}\n\nexport default UserAccessActions;\n","const AttachmentAPI = {\n toggle(attachableType, attachableId, subjectId, subjectType, opts) {\n const url = '/attachments/toggle';\n return $.ajax(url, {\n data: {\n subject_id: subjectId,\n subject_type: subjectType,\n attachable_id: attachableId,\n attachable_type: attachableType,\n user_to_add: opts.userToAdd,\n },\n method: 'POST',\n dataType: 'json',\n });\n },\n\n update(id, attrs) {\n const url = `/attachments/${id}`;\n return $.ajax(url, {\n data: {\n attachment: attrs,\n },\n method: 'PUT',\n dataType: 'json',\n });\n },\n\n removeAttachment(attachmentId) {\n const url = `/attachments/${attachmentId}`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n },\n\n addPseudomember(email, name, attachableType, attachableId, opts) {\n const url = '/attachments/add_pseudomember';\n return $.ajax(url, {\n data: {\n email,\n name,\n attachable_type: attachableType,\n attachable_id: attachableId,\n role_id: opts.roleId,\n },\n method: 'POST',\n dataType: 'json',\n });\n },\n\n fetchAttachments(attachableType, attachableId) {\n const url = '/attachments/fetch_attachments';\n return $.ajax(url, {\n data: {\n attachable_type: attachableType,\n attachable_id: attachableId\n },\n method: 'GET',\n dataType: 'json'\n })\n },\n};\n\nexport default AttachmentAPI;\n","export const create = (masterTemplateId, formData) => {\n const url = `/master_templates/${masterTemplateId}/documents`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: formData,\n processData: false,\n cache: false,\n contentType: false\n });\n};\n\nexport const update = (id, masterTemplateId, formData) => {\n const url = `/master_templates/${masterTemplateId}/documents/${id}`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'PUT',\n data: formData,\n processData: false,\n cache: false,\n contentType: false\n });\n};\n\nexport const replace = (id, masterTemplateId, formData) => {\n const url = `/master_templates/${masterTemplateId}/documents/${id}/replace`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'PUT',\n data: formData,\n processData: false,\n cache: false,\n contentType: false\n });\n};\n\nexport const destroy = (slug, id) => {\n const url = `/master_templates/${slug}/documents/${id}`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'DELETE',\n });\n};\n\nexport const publish = (masterTemplateId, id) => {\n const url = `/master_templates/${masterTemplateId}/documents/${id}/publish`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST'\n });\n};\n\nexport const unpublish = (masterTemplateId, id) => {\n const url = `/master_templates/${masterTemplateId}/documents/${id}/unpublish`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST'\n });\n};\n\nexport const fetchMappables = (masterTemplateId, documentId, query) => {\n const url = `/master_templates/${masterTemplateId}/documents/${documentId}/fetch_mappables`;\n\n return $.get(url, {\n query,\n });\n};\n\nexport default {\n create,\n update,\n destroy,\n fetchMappables\n};\n","const FlowTemplateAPI = {\n update(id, attrs){\n const url = '/flow_templates/' + id;\n\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n flow_template: attrs\n }\n });\n },\n\n publish(flowTemplateId){\n const url = '/flow_templates/' + flowTemplateId + '/publish';\n\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n });\n },\n\n clone(flowTemplateId, teamId){\n const url = '//' + window.location.host + '/flow_templates/' + flowTemplateId + '/clone';\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n team_id: teamId\n }\n });\n },\n\n duplicate(flowTemplateId, data){\n const url = '//' + window.location.host + '/flow_templates/' + flowTemplateId + '/duplicate';\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: data\n });\n }\n};\n\nexport default FlowTemplateAPI;\n","const FormulaAPI = {\n create: function(attrs){\n const url = '/formulas/';\n\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n formula: attrs\n }\n });\n },\n\n update: function(formulaId, attrs){\n const url = '/formulas/' + formulaId;\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n formula: attrs\n }\n });\n },\n\n delete: function(formulaId){\n const url = '/formulas/' + formulaId;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json'\n });\n },\n\n availableForStep: function(stepId){\n const url = `/steps/${stepId}/available_formulas`;\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json'\n });\n }\n\n};\n\nexport default FormulaAPI;\n","const MasterTemplateAPI = {\n checkSlugAvailable(masterTemplateId, slug){\n const url = '/workflows/check_slug_available';\n return $.ajax(url, {\n dataType: 'json',\n method: 'get',\n data: {\n slug: slug,\n master_template_id: masterTemplateId\n }\n });\n },\n\n update: function(id, attrs){\n const url = '/master_templates/' + id;\n\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n master_template: attrs\n }\n });\n },\n\n index: function(teamId){\n const url = `/teams/${teamId}/master_templates`;\n\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json',\n data: {\n only_published: true\n }\n });\n },\n\n stepData: function(id){\n const url = `/master_templates/${id}/step_data`;\n\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json'\n });\n },\n\n versions: function(id){\n const url = `/workflows/${id}/versions`;\n\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json'\n });\n },\n\n modified: function(id){\n const url = `/workflows/${id}/modified`;\n\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json'\n });\n }\n\n};\n\nexport default MasterTemplateAPI;\n","import Flash from '../components/shared/flash';\n\nvar MasterTemplateDataImportAPI = {\n submitCSV: function(masterTemplateId, file) {\n const url = `/workflows/${masterTemplateId}/data_imports`;\n let formData = new FormData();\n formData.append('upload', file);\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: formData,\n processData: false,\n contentType: false\n });\n },\n\n\tindex: function(){\n\t\tconst url = '/master_template_data_imports';\n\n\t\tvar request = $.ajax(url, {\n\t\t\tdataType: 'json',\n\t\t\tmethod: 'GET'\n\t\t})\n\t\t.fail(() => { Flash.error(); });\n\n\t\treturn request;\n\t},\n\n\tqueueImport: function(masterTemplateDataImportId, dataMapping){\n\t\tconst URL = `/data_imports/${masterTemplateDataImportId}/queue_import`;\n\n\t\tvar request = $.ajax(URL, {\n\t\t\tmethod: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata: {\n\t\t\t\tmappings: {\n\t\t\t\t\tinitiated_flow: dataMapping.initiatedFlow,\n\t\t\t\t\tstep_data: dataMapping.stepData,\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t.fail(() => { Flash.error(); });\n\n\t\treturn request;\n\t},\n\n\tqueueTest: function(masterTemplateDataImportId, dataMapping){\n\t\tconst URL = `/data_imports/${masterTemplateDataImportId}/queue_test`;\n\n\t\tvar request = $.ajax(URL, {\n\t\t\tmethod: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata: {\n\t\t\t\tmappings: {\n\t\t\t\t\tinitiated_flow: dataMapping.initiatedFlow,\n\t\t\t\t\tstep_data: dataMapping.stepData,\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t.fail(() => { Flash.error(); });\n\n\t\treturn request;\n\t}\n};\n\nexport default MasterTemplateDataImportAPI;\n","const RoleAPI = {\n show(roleId) {\n const url = `/roles/${roleId}`;\n\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json',\n });\n },\n\n create(role, teamId, addUserToRole) {\n const url = `/teams/${teamId}/roles`;\n\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n role,\n add_user_to_role: addUserToRole,\n },\n });\n },\n\n update(role, teamId, addUserToRole) {\n const url = `/teams/${teamId}/roles/${role.id}`;\n\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n role,\n addUserToRole,\n },\n });\n },\n\n destroy(roleId, teamId) {\n const url = `/teams/${teamId}/roles/${roleId}`;\n\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n },\n\n attach(attachableId, attachableType, roleId) {\n const url = '/attachments/toggle';\n\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'JSON',\n data: {\n attachableId,\n attachableType,\n attachmentId: roleId,\n attachmentType: 'Role',\n },\n });\n },\n\n search(teamId, opts) {\n const url = `/teams/${teamId}/roles/search`;\n\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json',\n data: {\n search_term: opts.searchTerm,\n user_id: opts.userId,\n },\n });\n },\n};\n\nexport default RoleAPI;\n","const SearchAPI = {\n searchApplicants(terms, searchAll = false) {\n const url = '/search/applicants';\n return $.ajax(url, {\n dataType: 'json',\n method: 'GET',\n data: {\n terms,\n search_all: searchAll,\n },\n });\n },\n\n searchThirdPartyReviewers(terms, initiatedFlowId) {\n const url = '/search/third_party_reviewers';\n return $.ajax(url, {\n dataType: 'json',\n method: 'GET',\n data: {\n terms,\n initiated_flow_id: initiatedFlowId,\n },\n });\n },\n\n searchSupportContacts(terms, masterTemplateId) {\n const url = '/search/support_contacts';\n return $.ajax(url, {\n dataType: 'json',\n method: 'GET',\n data: {\n terms,\n id: masterTemplateId,\n },\n });\n },\n\n usersAndRoles(terms, teamId) {\n const url = '/search/users_and_roles';\n return $.ajax(url, {\n dataMethod: 'GET',\n data: {\n terms,\n team_id: teamId,\n },\n });\n }\n};\n\nexport default SearchAPI;\n","const StepDataAPI = {\n addSection(sectionableType, sectionableId) {\n const url = '/step_datum/sections';\n const request = $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n section: {\n sectionable_type: sectionableType,\n sectionable_id: sectionableId,\n },\n },\n });\n\n return request;\n },\n\n copySection(sectionId) {\n const url = `/step_datum/sections/${sectionId}/duplicate`;\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n });\n },\n\n updateSection(sectionId, attrs) {\n const url = `/step_datum/sections/${sectionId}`;\n const request = $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n section: attrs,\n },\n });\n\n return request;\n },\n\n reorderSection(sectionId, position) {\n const url = `/step_datum/sections/${sectionId}/reorder`;\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n section: {\n position,\n },\n },\n });\n },\n\n destroySection(sectionId) {\n const url = `/step_datum/sections/${sectionId}`;\n const request = $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n\n return request;\n },\n\n add(sectionId, type) {\n const url = `/step_datum/sections/${sectionId}/step_data`;\n const data = type ? { type } : {};\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data,\n });\n },\n\n duplicate(datumId) {\n const url = `/step_data/${datumId}/duplicate`;\n const request = $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n },\n });\n\n return request;\n },\n\n update(datumId, attrs) {\n const {\n name,\n date_type,\n data_type,\n required,\n position,\n redacted,\n section_id,\n entity_createable,\n lock_on_renewal,\n autofill_on_renewal,\n min_num_checks,\n max_length,\n min_value,\n max_value,\n date_range_start_label,\n date_range_end_label,\n } = attrs;\n\n const url = `/step_data/${datumId}`;\n const request = $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n step_datum: {\n name,\n date_config_attributes: {\n date_type,\n range_end_label: date_range_end_label,\n range_start_label: date_range_start_label\n },\n data_type,\n lock_on_renewal,\n autofill_on_renewal,\n required,\n position,\n redacted,\n default: attrs.default,\n section_id,\n entity_config_attributes: {\n entity_createable,\n },\n min_num_checks,\n max_length,\n min_value,\n max_value,\n },\n },\n });\n\n return request;\n },\n\n reorder(datumId, position, sectionId) {\n const url = `/step_data/${datumId}/reorder`;\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n step_datum: {\n position,\n section_id: sectionId,\n },\n },\n });\n },\n\n fetch(stepDatumId) {\n const url = `/step_data/${stepDatumId}`;\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json',\n });\n },\n\n destroy(stepDatumId) {\n const url = `/step_data/${stepDatumId}`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n },\n\n availableForSectionConfig(sectionId) {\n const url = `/step_datum/sections/${sectionId}/step_data/available_for_section_config`;\n const request = $.ajax(url, {\n method: 'GET',\n dataType: 'json',\n });\n\n return request;\n },\n};\n\nexport default StepDataAPI;\n","const TeamAPI = {\n update(teamId, attrs) {\n const url = `/teams/${teamId}`;\n\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n team: attrs,\n },\n });\n },\n\n checkSlugAvailable(teamId, slug) {\n const url = '/teams/check_slug_available';\n return $.ajax(url, {\n dataType: 'json',\n method: 'get',\n data: {\n slug,\n team_id: teamId,\n },\n });\n },\n\n checkChargesEnabled(initiatedFlowId) {\n const url = `/teams/check_charges_enabled`;\n return $.ajax(url, {\n dataType: 'JSON',\n method: 'GET',\n data: {\n initiated_flow_id: initiatedFlowId,\n },\n });\n },\n\n processListing(teamId, query) {\n const url = `/${teamId}/process_listing`;\n return $.ajax(url, {\n dataType: 'JSON',\n method: 'GET',\n data: {\n q: query,\n },\n });\n },\n};\n\nexport default TeamAPI\n","var csrfReset = function(data, status, xhr) {\n var csrfParam = xhr.getResponseHeader('X-CSRF-Param');\n var csrfToken = xhr.getResponseHeader('X-CSRF-Token');\n\n if (csrfParam) {\n $('meta[name=\"csrf-param\"]').attr('content', csrfParam);\n }\n if (csrfToken) {\n $('meta[name=\"csrf-token\"]').attr('content', csrfToken);\n }\n};\n\nexport default csrfReset;\n","import csrfReset from './helpers/csrf-reset';\n\nconst UserAPI = {\n search(terms, opts = {}) {\n const url = '/users/search';\n const request = $.ajax(url, {\n data: {\n q: terms,\n initiated_flow_id: opts.initiatedFlowId,\n gov_only: opts.govOnly,\n },\n method: 'GET',\n dataType: 'json',\n });\n\n return request;\n },\n\n exists(email) {\n const url = '/users/exists';\n const request = $.ajax(url, {\n data: {\n q: email,\n },\n method: 'GET',\n dataType: 'json',\n });\n\n return request;\n },\n\n login(email, password) {\n const url = '/users/sign_in';\n const request = $.ajax(url, {\n data: {\n user: {\n email,\n password,\n },\n },\n method: 'POST',\n dataType: 'json',\n success: csrfReset,\n });\n\n return request;\n },\n\n signup(email, password, name, accountType) {\n const url = '/users';\n const request = $.ajax(url, {\n data: {\n user: {\n email,\n password,\n name,\n account_type: accountType,\n },\n },\n method: 'POST',\n dataType: 'json',\n });\n\n return request;\n },\n\n update(user) {\n const url = '/users/update';\n return $.ajax(url, {\n dataType: 'json',\n method: 'PATCH',\n data: {\n user,\n },\n });\n },\n\n updateAuthMetaData(data) {\n const url = '/auth/update';\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n data,\n },\n });\n },\n\n uploadAvatar(file) {\n const formData = new FormData();\n formData.append('avatar', file);\n const url = '/users/update';\n return $.ajax(url, {\n dataType: 'json',\n method: 'PATCH',\n data: formData,\n processData: false,\n contentType: false,\n });\n },\n\n sendVerificationEmail() {\n const url = '/users/send_verification_email';\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n });\n },\n};\n\nexport default UserAPI;\n","import { Dispatcher } from 'flux';\n\nexport default new Dispatcher();\n","import { useState } from 'react';\n\nconst useDerivedState = (propValue) => {\n const [prevPropValue, setPrevPropValue] = useState(null);\n const [stateValue, setStateValue] = useState(propValue);\n\n if (propValue !== prevPropValue) {\n // NOTE: setting state directly in the render cycle looks\n // weird, but this is from the react docs:\n // https://reactjs.org/docs/hooks-faq.html#how-do-i-implement-getderivedstatefromprops\n setStateValue(propValue);\n setPrevPropValue(propValue);\n }\n return [stateValue, setStateValue];\n};\n\nexport default useDerivedState;\n","import { useEffect, useRef } from 'react';\n\nconst KEYCODE_TAB = 9;\nconst KEYCODE_ESC = 27;\n\nfunction useFocusTrap(onClose) {\n const elRef = useRef(null);\n\n function focusableEls(el) {\n return el.current?.querySelectorAll(\n 'a[href], button, textarea, input[type=\"text\"], input[type=\"radio\"], input[type=\"checkbox\"], select',\n ) || [];\n }\n\n function handleFocus(e) {\n const focusable = focusableEls(elRef)\n const firstFocusableEl = focusable[0]\n const lastFocusableEl = focusable[focusable.length - 1];\n\n const isTabPressed = e.key === 'Tab' || e.keyCode === KEYCODE_TAB;\n const isESCPressed = e.key === 'Escape' || e.keyCode === KEYCODE_ESC\n\n if (isESCPressed) { return onClose(e); }\n\n if (!isTabPressed) {\n return;\n }\n\n if (e.shiftKey) {\n /* shift + tab */ if (document.activeElement === firstFocusableEl) {\n lastFocusableEl.focus();\n e.preventDefault();\n }\n } /* tab */ else {\n if (document.activeElement === lastFocusableEl) {\n firstFocusableEl.focus();\n e.preventDefault();\n }\n }\n }\n\n useEffect(() => {\n elRef.current.addEventListener('keydown', handleFocus);\n setTimeout(() => {focusableEls(elRef)[0]?.focus()}, 300)\n\n return () => {\n elRef.current?.removeEventListener('keydown', handleFocus);\n };\n }, []);\n\n return elRef;\n}\n\nexport default useFocusTrap;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\n\nconst AdvancedLabel = (props) => {\n return (\n <div className='advancedlabel'>\n <span className='advancedlabel-name'>{props.label}</span>\n {props.required && <span className='advancedlabel-required'>*</span>}\n {props.helperText && (\n <FontAwesomeIcon\n icon={icon({ name: 'circle-question', style: 'regular' })}\n className='advancedlabel-help margin-left'\n title={props.helperText}\n />\n )}\n </div>\n );\n};\n\nAdvancedLabel.propTypes = {\n required: PropTypes.bool,\n label: PropTypes.string.isRequired,\n helperText: PropTypes.string,\n};\n\nexport default AdvancedLabel;\n","import AttachmentActions from 'actions/attachment-actions';\n\nfunction fetchRoles(teamId, opts = {}) {\n return AttachmentActions.fetchRoles(teamId, { searchTerm: opts.searchTerm, userId: opts.userId });\n}\n\nexport default fetchRoles;\n","import React, { useState, useEffect, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport fetchRoles from 'modules/fetch-roles';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport { reject, contains, debounce } from 'underscore';\n\nconst RoleSearch = (props) => {\n const [active, setActive] = useState(false);\n const [roles, setRoles] = useState([]);\n const [loading, setLoading] = useState(false);\n const [searchTerm, setSearchTerm] = useState('');\n\n const loadRoles = useCallback(debounce((newSearchTerm) => {\n setLoading(true);\n fetchRoles(props.teamId, { searchTerm: newSearchTerm, userId: props.userId })\n .done((response) => {\n setLoading(false);\n setRoles(response.roles);\n });\n }, 500), []);\n\n useEffect(() => {\n loadRoles(searchTerm);\n }, [searchTerm, loadRoles]);\n\n function onClose() {\n setActive(false);\n }\n\n function onRolesSearchChange(e) {\n setSearchTerm(e.currentTarget.value);\n }\n\n function rolesToDisplay() {\n const attachedRoleIds = props.rolesToFilter.map((r) => { return r.id; });\n return reject(roles, (role) => { return contains(attachedRoleIds, role.id); });\n }\n\n function renderRoles() {\n if (loading) {\n return <div className='text-center'><LoadingSpinner size='small' className='vmiddle' /></div>;\n }\n\n if (roles.length > 0 && rolesToDisplay().length > 0) {\n return (\n <div className='attachedpeople-manager search-results'>\n <ul className='attachedpeople-manager-rolelist'>\n {rolesToDisplay().map(renderRole)}\n </ul>\n </div>\n );\n }\n\n const referrerLink = `/teams/${props.teamSlug}/roles/new?referrer_type=${props.referrer.type}&referrer_id=${props.referrer.id}`;\n return (\n <div className='attachedpeople-manager no-results'>\n No matching roles found. Clear your search and try again or <a href={referrerLink}>create a new role</a>\n </div>\n );\n }\n\n function renderRole(role) {\n const label = props.userId ? `(${role.label})` : null;\n return (\n <li key={role.id} onClick={(e) => { e.preventDefault(); props.toggleRole(role); }}>\n {role.name}\n <span className='margin-left'>\n {label}\n </span>\n </li>\n );\n }\n\n return (\n <div>\n <CloseIfOutsideWrapper onClose={onClose}>\n <input\n className='search people nomargin-bottom'\n type='text'\n onChange={onRolesSearchChange}\n placeholder='Type a role name to search available roles'\n onFocus={() => { setActive(true); }}\n />\n <div className='margin-top'>{active && renderRoles()}</div>\n </CloseIfOutsideWrapper>\n </div>\n );\n};\n\nRoleSearch.propTypes = {\n toggleRole: PropTypes.func.isRequired,\n teamId: PropTypes.number.isRequired,\n userId: PropTypes.number,\n rolesToFilter: PropTypes.array,\n teamSlug: PropTypes.string.isRequired,\n referrer: PropTypes.shape({\n type: PropTypes.string.isRequired,\n id: PropTypes.number.isRequired,\n }).isRequired,\n};\n\nexport default RoleSearch;\n","import React, { useState, useContext } from 'react';\nimport { contains } from 'underscore';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport PersonSelector from 'components/shared/person-selector';\nimport UserAccessActions from 'actions/user-access-actions';\nimport AttachmentActions from 'actions/attachment-actions';\nimport RoleSearch from './role-search';\n\nconst AttachPerson = (props) => {\n const [person, setPerson] = useState();\n const [viaRole, setViaRole] = useState(false);\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n function onSendInviteButtonClicked(email, name, role) {\n props.togglePerson({\n email, name, isPseudo: true, role, type: 'User',\n });\n }\n\n function handlePersonSelect(selectedPerson) {\n if (props.canAttachRoles) {\n setPerson(selectedPerson);\n } else {\n toggleAttachment(selectedPerson);\n }\n }\n\n function toggleAttachment(prsn) {\n const attachment = { isPseudo: false, ...prsn, type: 'User' };\n\n props.togglePerson(attachment)\n .done(() => {\n setPerson();\n setViaRole(true);\n });\n }\n\n function onToggleOff(removedPerson) {\n if (props.tentativeAssignment) {\n return AttachmentActions.removeTentativePerson(removedPerson.attachment_id)\n .done((res) => {\n AttachmentActions.onTentativeDone(dispatch);\n onAttachedPeopleChange(res);\n });\n }\n\n return AttachmentActions.removePerson(removedPerson.attachment_id)\n .done(onAttachedPeopleChange);\n }\n\n function attachViaRole(role) {\n const attachment = { isPseudo: false, ...person, type: 'User' };\n\n attachment.role = role;\n props.togglePersonViaRole(attachment);\n }\n\n function doSearch(terms) {\n return UserAccessActions.searchUsers(terms, props.searchOpts);\n }\n\n function toggleViaRoleOff() {\n setViaRole(false);\n }\n\n function onAttachedPeopleChange(data) {\n // onChange prop is optional\n if (props.onChange) {\n props.onChange(data);\n }\n\n setPerson();\n setViaRole(true);\n }\n\n function personAttachedViaRole() {\n return props.attachedRoles.find((r) => { return contains(r.user_ids, person.id); });\n }\n\n function reset(e) {\n e.preventDefault();\n setPerson();\n setViaRole(true);\n }\n\n function renderConfirmButton() {\n return (\n <button\n className='margin-right btn-primary'\n type='button'\n onClick={() => { toggleAttachment(person); }}\n >\n Attach\n </button>\n );\n }\n\n function renderPersonStepTwo() {\n if (personAttachedViaRole()) {\n return (\n <div className='margin-bottom'>\n <span>\n This user is already attached through the {personAttachedViaRole().name} role\n </span>\n <a className='margin-left' href='#' onClick={reset}>Go Back</a>\n </div>\n );\n }\n\n return (\n <div className='well margin-bottom'>\n <div className='padding-bottom'>\n Adding <strong>{person.name}</strong>\n </div>\n {/* <form className='margin-bottom'>\n <div className='radiotoggle'>\n <label>\n <input type='radio' checked={!viaRole} onChange={toggleViaRoleOff} />\n <span>Assign this person directly</span>\n </label>\n <label>\n <input type='radio' checked={viaRole} onChange={() => { setViaRole(true); }} />\n <span>Assign them through a role</span>\n </label>\n </div>\n </form>\n {viaRole && (\n <RoleSearch\n teamId={props.teamId}\n teamSlug={props.teamSlug}\n referrer={props.referrer}\n toggleRole={attachViaRole}\n userId={person.id}\n rolesToFilter={[]}\n />\n )} */}\n <div className='margin-top'>\n {renderConfirmButton()}\n <button className='btn-link' onClick={reset}>Cancel</button>\n </div>\n </div>\n );\n }\n\n function renderSearchManager() {\n return (\n <div className='attachedpeople-inputcontainer'>\n <PersonSelector\n doSearch={doSearch}\n onSelect={handlePersonSelect}\n onInvite={onSendInviteButtonClicked}\n allowPseudo={props.allowPseudo}\n allowToggle={props.allowToggle}\n teamId={props.teamId}\n onToggleOff={onToggleOff}\n memberUsers={props.people}\n attachableType={props.attachableType}\n hideExternal={props.hideExternal}\n idForInput={props.idForInput}\n />\n </div>\n );\n }\n\n if (person && props.canAttachRoles) {\n return renderPersonStepTwo();\n }\n\n return renderSearchManager();\n};\n\nAttachPerson.propTypes = {\n canAttachRoles: PropTypes.bool.isRequired,\n searchOpts: PropTypes.shape({}),\n};\n\nAttachPerson.defaultProps = {\n idForInput: '',\n searchOpts: {},\n};\n\nexport default AttachPerson;\n","import PropTypes from 'prop-types';\nimport {\n contains, isEmpty, filter, findWhere, any, intersection,\n} from 'underscore';\nimport React, {\n useState, useCallback, useContext,\n} from 'react';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport AttachmentActions from 'actions/attachment-actions';\nimport { error } from 'components/shared/flash';\nimport AttachedPerson from './attached_people/attached-person';\nimport AttachPerson from './attached_people/attach-person';\nimport RoleSearch from './attached_people/role-search';\n\nconst NO_USERS_ADDED_CONTENT = <div className='well text-center'>No users added</div>;\nconst NO_ROLES_ADDED_CONTENT = <div className='well text-center'>No roles added</div>;\n\nconst AttachedPeople = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const attachedPeople = useCallback(() => {\n return filter(props.people, (attachment) => { return attachment.type === 'User'; });\n }, [props.people]);\n\n const attachedRoles = useCallback(() => {\n return filter(props.people, (a) => { return a.type === 'AdminRole'; });\n }, [props.people]);\n\n const [attachment, setAttachment] = useState();\n const [legacyPersonAddOpen, setLegacyPersonAddOpen] = useState(any(attachedPeople()));\n\n const onToggleEvent = useCallback((res) => {\n if (!contains(['Step', 'ReviewGroup'], props.attachableType)) { return; }\n\n AttachmentActions.dispatchTogglePersonEvent(props.attachableType, props.attachableId, res);\n }, [props.attachableId, props.attachableType]);\n\n const onAttachmentPersisted = useCallback((data) => {\n setAttachment();\n\n if (props.onChange) {\n props.onChange(data);\n }\n }, [props]);\n\n const onPersonAttachmentPersisted = useCallback((data) => {\n onToggleEvent(data);\n\n if (props.onChange) {\n props.onChange(data);\n }\n }, [props]);\n\n const roleIsAttached = useCallback((id) => {\n return findWhere(attachedRoles(), { id });\n }, [attachedRoles]);\n\n function roleUsersAlreadyAttached() {\n const roleUserIds = attachment.users.map((u) => { return u.id; });\n const directAttachedUserIds = props.people.map((p) => {\n if (p.type === 'User') {\n return p.id;\n }\n\n return null;\n });\n\n return intersection(roleUserIds, directAttachedUserIds);\n }\n\n const attachViaRole = useCallback(() => {\n if (roleIsAttached(attachment.role.id)) {\n return AttachmentActions\n .togglePersonViaAttachedRole(\n props.attachableId,\n props.attachableType,\n attachment.role.id,\n attachment.id,\n )\n .done(onAttachmentPersisted);\n }\n\n return AttachmentActions.toggleRole(\n props.attachableId,\n props.attachableType,\n attachment.role.id,\n attachment.id,\n { userToAdd: props.tentativeAssignment },\n )\n .done((res) => {\n onToggleEvent(res);\n onAttachmentPersisted(res);\n });\n }, [\n attachment?.id,\n attachment?.role?.id,\n onAttachmentPersisted,\n onToggleEvent,\n props.attachableId,\n props.attachableType,\n props.tentativeAssignment,\n roleIsAttached,\n ]);\n\n const attachPersonHandler = useCallback((userAttachment) => {\n if (userAttachment.isPseudo) {\n if (props.tentativeAssignment) {\n return AttachmentActions\n .addPseudomemberTentative(userAttachment.email, userAttachment.name, props.attachableId)\n .done((res) => {\n AttachmentActions.onTentativeDone(dispatch);\n onAttachmentPersisted(res);\n });\n }\n\n const roleId = userAttachment.role ? userAttachment.role.id : null;\n const options = { roleId };\n\n return AttachmentActions\n .addPseudomember(userAttachment.email, userAttachment.name, props.attachableType, props.attachableId, options)\n .done(onPersonAttachmentPersisted);\n }\n\n if (userAttachment.role) {\n return attachViaRole();\n }\n\n if (props.tentativeAssignment) {\n return AttachmentActions.toggleTentativePerson(props.attachableId, userAttachment.id)\n .done(() => AttachmentActions.onTentativeDone(dispatch));\n }\n\n return AttachmentActions\n .togglePerson(props.attachableId, props.attachableType, userAttachment.id, 'User')\n .done(onPersonAttachmentPersisted);\n }, [\n attachViaRole,\n dispatch,\n onAttachmentPersisted,\n onPersonAttachmentPersisted,\n onToggleEvent,\n props.attachableId,\n props.attachableType,\n props.tentativeAssignment,\n ]);\n\n const togglePerson = useCallback((newPerson) => {\n return attachPersonHandler(newPerson);\n }, [attachPersonHandler]);\n\n function togglePersonRoleAttachment(newAttachment) {\n setAttachment(newAttachment);\n }\n\n function cleanUpDuplicates(duplicateAttachments) {\n duplicateAttachments.forEach((userId) => {\n AttachmentActions\n .dispatchTogglePersonEvent(props.attachableType, props.attachableId, {\n id: userId, persisted: false,\n });\n });\n }\n\n function attach() {\n switch (attachment.type) {\n case 'AdminRole': {\n const duplicateAttachments = roleUsersAlreadyAttached();\n return AttachmentActions.toggleRole(props.attachableId, props.attachableType, attachment.id)\n .done((res) => {\n onToggleEvent(res);\n cleanUpDuplicates(duplicateAttachments);\n onAttachmentPersisted(res);\n });\n }\n case 'User':\n return attachPersonHandler(attachment);\n default:\n throw new Error(`Unhandled attachmentType: '${attachment.type}'`);\n }\n }\n\n const onToggleOff = useCallback((attchmnt) => {\n if (props.tentativeAssignment) {\n AttachmentActions\n .removeTentativePerson(attchmnt.attachment_id)\n .done((res) => {\n AttachmentActions.onTentativeDone(dispatch);\n props.onChange(res);\n })\n .fail((res) => {\n error(res.responseJSON.error);\n });\n } else {\n AttachmentActions.removePerson(attchmnt.attachment_id, props.attachableType)\n .done((res) => {\n onToggleEvent(res);\n props.onChange(res);\n })\n .fail((res) => {\n error(res.responseJSON.error);\n });\n }\n }, [onToggleEvent, props]);\n\n function buildPerson(attchmnt) {\n const isDisabled = props.disabled || contains(props.lockedUserIds, attchmnt.id);\n let { showEmail } = props;\n\n if (attchmnt.type === 'AdminRole') {\n showEmail = false;\n }\n\n return (\n <AttachedPerson\n key={attchmnt.id}\n person={attchmnt}\n showEmail={showEmail}\n onDeleteClick={onToggleOff}\n disabled={isDisabled}\n />\n );\n }\n\n function renderPersonAdd() {\n return (\n <AttachPerson\n attachableId={props.attachableId}\n attachableType={props.attachableType}\n pseudoNeedsRole={props.pseudoNeedsRole}\n referrer={props.referrer}\n allowPseudo={props.allowPseudo}\n tentativeAssignment={props.tentativeAssignment}\n attachedRoles={attachedRoles()}\n togglePerson={togglePerson}\n togglePersonViaRole={togglePersonRoleAttachment}\n canAttachRoles={props.canAttachRoles}\n hideExternal={props.hideExternal}\n teamSlug={props.teamSlug}\n teamId={props.teamId}\n idForInput={props.idForInput}\n searchOpts={props.searchOpts}\n />\n );\n }\n\n function renderPeopleList() {\n if (any(attachedPeople())) {\n const people = attachedPeople().map(buildPerson);\n return (\n <ul className='attachedpeople-list'>\n {people}\n </ul>\n );\n }\n\n return NO_USERS_ADDED_CONTENT;\n }\n\n function renderRolesList() {\n const roles = attachedRoles();\n if (isEmpty(roles)) {\n return NO_ROLES_ADDED_CONTENT;\n }\n\n const rolesList = roles.map(buildPerson);\n\n return (\n <div>\n <ul className='attachedpeople-list'>\n {rolesList}\n </ul>\n </div>\n );\n }\n\n function displayRoleUser(user) {\n return <li>{user.name} - {user.email}</li>;\n }\n\n function roleUsers() {\n if (attachment.users.length === 0) { return 'This role has no users'; }\n const willRemoveDirectAttachments = roleUsersAlreadyAttached().length > 0;\n\n return (\n <div className='margin-bottom'>\n {willRemoveDirectAttachments && (\n <>\n <div className='padding-bottom-less'><span className='bold'>Note:</span>\n Some of this role&aposs users are already directly assigned as reviewers. Attaching this role will replace their direct assignment.\n </div>\n <br />\n </>\n )}\n This will attach the following users:\n <ul className='attachedpeople-list margin-top'>\n {attachment.users.map(displayRoleUser)}\n </ul>\n </div>\n );\n }\n\n function userConfirmation() {\n const actionText = attachment.isPseudo ? 'Inviting and attaching' : 'Attaching';\n if (attachment.role && (roleIsAttached(attachment.role.id) || attachment.role.users.length == 0)) {\n return (\n <div className='margin-bottom'>\n {actionText} {attachment.name}({attachment.email}) via {attachment.role.name} role\n </div>\n );\n }\n\n if (attachment.role && attachment.role.users.length > 0) {\n return (\n <div className='margin-bottom'>\n <div className='margin-bottom'>\n {actionText} {attachment.name}({attachment.email}) via {attachment.role.name} role.\n This will also attach the following users:\n </div>\n\n <ul className='attachedpeople-list'>\n {attachment.role.users.map(displayRoleUser)}\n </ul>\n </div>\n );\n }\n\n const email = attachment.type === 'User' ? ` (${attachment.email})` : '';\n return (\n <div className='margin-bottom'>\n {actionText} {attachment.name}{email}\n </div>\n );\n }\n\n function confirmAttachmentText() {\n switch (attachment.type) {\n case 'AdminRole':\n return (\n <div className='well'>\n <span className='strong'>Attaching {attachment.name} Role</span>\n <div className='padding-top'>\n {roleUsers()}\n </div>\n </div>\n );\n case 'User':\n return userConfirmation();\n default:\n throw new Error(`Unrecognized attachment type ${attachment.type}`);\n }\n }\n\n function confirmAttachment() {\n return (\n <>\n {confirmAttachmentText()}\n <div className='margin-top'>\n <button type='button' id='attach' className='btn-primary margin-right' onClick={attach}>Attach</button>\n <button type='button' className='btn-link' onClick={() => { return setAttachment(); }}>Cancel</button>\n </div>\n </>\n );\n }\n\n function renderLegacyPersonAdd() {\n if (legacyPersonAddOpen) {\n return (\n <>\n <div className='linebreak' />\n <div>\n <label className='inline-block bold'>Add people</label>\n {renderPersonAdd()}\n </div>\n\n <div>\n {renderPeopleList()}\n </div>\n </>\n );\n }\n\n return <button className='btn-link margin-top-more' onClick={() => { return setLegacyPersonAddOpen(true); }}>Need to add an individual person?</button>;\n }\n\n function renderRoleSelector() {\n return (\n <div>\n <label className='bold'>Add roles (Recommended)</label>\n <RoleSearch\n teamId={props.teamId}\n teamSlug={props.teamSlug}\n toggleRole={(role) => { return setAttachment({ ...role, type: 'AdminRole' }); }}\n referrer={props.referrer}\n rolesToFilter={attachedRoles()}\n />\n </div>\n );\n }\n\n function renderRolesWidget() {\n return (\n <>\n {!props.disabled && renderRoleSelector()}\n {renderRolesList()}\n {!props.disabled && renderLegacyPersonAdd()}\n </>\n );\n }\n\n function renderPersonOnlyWidget() {\n return (\n <>\n {!props.disabled && renderPersonAdd()}\n {renderPeopleList()}\n </>\n );\n }\n\n function renderMainContent() {\n if (attachment) { return confirmAttachment(); }\n\n if (props.canAttachRoles) { return renderRolesWidget(); }\n\n return renderPersonOnlyWidget();\n }\n\n return (\n <div className='attachedpeople'>\n {renderMainContent()}\n </div>\n );\n};\n\nAttachedPeople.propTypes = {\n allowPseudo: PropTypes.bool,\n attachableId: PropTypes.number.isRequired,\n attachableType: PropTypes.string.isRequired,\n canAttachRoles: PropTypes.bool,\n disabled: PropTypes.bool,\n hideExternal: PropTypes.bool,\n idForInput: PropTypes.string,\n lockedUserIds: PropTypes.arrayOf(PropTypes.number),\n onChange: PropTypes.func,\n people: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n pseudoNeedsRole: PropTypes.bool,\n referrer: PropTypes.shape({}).isRequired,\n searchOpts: PropTypes.shape({}),\n showEmail: PropTypes.bool,\n teamId: PropTypes.number,\n teamSlug: PropTypes.string.isRequired,\n tentativeAssignment: PropTypes.bool,\n};\n\nAttachedPeople.defaultProps = {\n lockedUserIds: [],\n hideExternal: true,\n tentativeAssignment: false,\n searchOpts: { govOnly: true },\n disabled: false,\n canAttachRoles: false,\n onChange: () => {},\n idForInput: '',\n};\n\nexport default AttachedPeople;\n","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport UserDisc from 'components/shared/user-disc';\nimport RoleDisc from 'components/shared/role-disc';\nimport XClose from 'components/shared/x-close';\n\nclass AttachedPerson extends Component {\n render() {\n return (\n <li className={this.props.disabled ? 'disabled' : ''}>\n { this.props.person.type === 'User' ? (\n <UserDisc\n user={this.props.person.user}\n options={{\n showName: true,\n showEmail: this.props.showEmail,\n }}\n />\n ) : (\n <RoleDisc\n role={this.props.person}\n />\n )}\n <XClose\n onClick={this.props.disabled ? null : () => this.props.onDeleteClick(this.props.person)}\n id={`delete-${this.props.person.id}`}\n label='Remove person'\n />\n </li>\n );\n }\n}\n\nAttachedPerson.propTypes = {\n showEmail: PropTypes.bool,\n disabled: PropTypes.bool,\n onDeleteClick: PropTypes.func.isRequired,\n\n person: PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string.isRequired,\n email: PropTypes.string,\n pseudo: PropTypes.bool,\n }).isRequired,\n};\n\nAttachedPerson.defaultProps = {\n showEmail: false,\n};\n\nexport default AttachedPerson;\n","// Don't use this anymore. Use popdown instead.\n\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\n\nclass PopupButton extends React.Component {\n onClose = () => {\n this.props.onClose();\n };\n\n onClick = (e) => {\n e.stopPropagation();\n if (!this.props.disabled) {\n this.props.onToggle();\n }\n };\n\n buttonClassName = () => {\n return `${(this.props.buttonClassName || '')\n + (this.props.open ? ' active' : '')\n + (this.props.disabled ? ' disabled' : '')\n } popupbutton`;\n };\n\n wrapperClassName = () => {\n return `${(this.props.wrapperClassname || '') + (this.props.open ? ' active' : '')} popupbuttonwrapper`;\n };\n\n popupNubClassName() {\n return `popup-nub${this.props.nubDirection ? `-${this.props.nubDirection} popup-nub` : ''}`;\n }\n\n renderPopup() {\n return (\n <CloseIfOutsideWrapper onClose={this.onClose} wrapperIgnoreClass={this.props.wrapperIgnoreClass}>\n <div className='popup smallpadding' onClick={this.props.closeOnPopupClick ? this.props.onClose : null}>\n <div className={this.popupNubClassName()} />\n {this.props.children}\n </div>\n </CloseIfOutsideWrapper>\n );\n }\n\n render() {\n return (\n <div className={this.wrapperClassName()}>\n <div className={this.buttonClassName()} onClick={this.onClick}>{this.props.buttonHtml}</div>\n {this.props.open && this.renderPopup()}\n </div>\n );\n }\n}\n\nPopupButton.propTypes = {\n nubDirection: PropTypes.oneOf(['left', 'right', 'up', 'down']),\n buttonClassName: PropTypes.string,\n wrapperClassname: PropTypes.string,\n closeOnPopupClick: PropTypes.bool,\n disabled: PropTypes.bool,\n open: PropTypes.bool.isRequired,\n onToggle: PropTypes.func.isRequired,\n onClose: PropTypes.func,\n buttonHtml: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.element,\n ]),\n children: PropTypes.node.isRequired,\n wrapperIgnoreClass: PropTypes.arrayOf(PropTypes.string),\n};\n\nPopupButton.defaultProps = {\n nubDirection: 'up',\n};\n\nexport default PopupButton;\n","// Don't use this anymore. Use popdown.jsx instead.\n\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport PopupButton from 'components/shared/popup-button';\n\nclass AutonomousPopup extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n open: false,\n };\n }\n\n onToggle = () => {\n this.setState({\n open: !this.state.open,\n });\n };\n\n onClose = () => {\n if (this.props.onClose) {\n this.props.onClose();\n }\n\n this.setState({\n open: false,\n });\n };\n\n render() {\n return (\n <PopupButton {...this.props} open={this.state.open} onToggle={this.onToggle} onClose={this.onClose} />\n );\n }\n}\n\nAutonomousPopup.propTypes = {\n nubDirection: PropTypes.oneOf(['left', 'right', 'up', 'down']),\n buttonClassName: PropTypes.string,\n wrapperClassname: PropTypes.string,\n closeOnPopupClick: PropTypes.bool,\n buttonHtml: PropTypes.node,\n onClose: PropTypes.func,\n wrapperIgnoreClass: PropTypes.arrayOf(PropTypes.string),\n};\n\nexport default AutonomousPopup;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport useOnclickOutside from 'react-cool-onclickoutside';\n\nconst CloseIfOutsideWrapper = (props) => {\n const ref = useOnclickOutside(\n props.onClose,\n {\n ignoreClass: props.wrapperIgnoreClass,\n },\n );\n\n return (\n <div ref={ref} className='contents inherit-height'>\n {props.children}\n </div>\n );\n};\n\nCloseIfOutsideWrapper.propTypes = {\n onClose: PropTypes.func.isRequired,\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node,\n ]),\n wrapperIgnoreClass: PropTypes.oneOfType([\n PropTypes.string,\n PropTypes.arrayOf(PropTypes.string),\n ]),\n};\n\nexport default CloseIfOutsideWrapper;\n","import PropTypes from 'prop-types';\nimport React, { useRef } from 'react';\nimport ClipboardButton from 'react-clipboard.js';\nimport Flash from 'components/shared/flash';\n\nconst CopyableLink = (props) => {\n const linkField = useRef();\n\n const selectURL = () => {\n linkField.current.select();\n };\n\n const onCopy = () => {\n if (!props.copyEnabled) { return; }\n\n selectURL();\n\n Flash.success(props.successMsg);\n };\n\n return (\n <div className='copyablelink'>\n <input id={props.inputId} ref={linkField} onClick={props.copyEnabled && selectURL} type='text' readOnly value={props.linkURL} />\n <ClipboardButton\n onSuccess={onCopy}\n component='a'\n data-clipboard-text={props.linkURL}\n className={props.copyEnabled ? '' : 'disabled'}\n >\n <i className='icon-copy' />\n </ClipboardButton>\n </div>\n );\n};\n\nCopyableLink.propTypes = {\n linkURL: PropTypes.string.isRequired,\n copyEnabled: PropTypes.bool,\n successMsg: PropTypes.string,\n};\n\nCopyableLink.defaultProps = {\n copyEnabled: true,\n successMsg: 'URL copied',\n};\n\nexport default CopyableLink;\n","import React, { useState, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { css } from '@emotion/react';\n\nimport { colorBackground, colorTextMedium } from 'theme/colors';\nimport { disc as discStyle } from 'theme/discs';\nimport Popdown from 'components/shared/popdown';\nimport ListOfPeople from 'components/shared/list-of-people';\nimport useOnclickOutside from 'react-cool-onclickoutside';\nimport { NUM_TO_SHOW } from '../disc-group';\n\nconst ManyDisc = ({ groupMembers }) => {\n const count = groupMembers.length;\n const [showMembers, setShowMembers] = useState(false);\n const membersContentRef = useRef();\n const elForAnchor = useRef();\n\n useOnclickOutside(() => {\n setShowMembers(false);\n }, { refs: [elForAnchor] });\n\n const onShowMoreClick = () => {\n setShowMembers(true);\n };\n\n return (\n <span\n onClick={onShowMoreClick}\n ref={elForAnchor}\n css={css`\n ${discStyle}\n background-color: ${colorBackground};\n color: ${colorTextMedium};\n border:2px solid #fff;\n margin-left:-15px;\n\n &:hover {\n cursor: pointer;\n text-decoration: underline;\n }\n `}\n >\n {count - NUM_TO_SHOW}\n\n { showMembers && (\n <Popdown anchorRef={elForAnchor}>\n <div className='margins' ref={membersContentRef}>\n <ListOfPeople users={groupMembers} />\n </div>\n </Popdown>\n )}\n </span>\n );\n};\n\nexport default ManyDisc;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport UserDisc from 'components/shared/user-disc';\nimport { css } from '@emotion/react';\nimport ManyDisc from './disc-group/many-disc';\n// import RoleDisc from 'components/shared/role-disc';\n\nexport const NUM_TO_SHOW = 3;\n\nconst DiscGroup = ({ groupMembers }) => {\n const count = groupMembers.length;\n\n const baseStyle = css`\n border:2px solid #fff;\n `;\n\n const stackedStyle = css`\n border:2px solid #fff;\n margin-left:-15px;\n `;\n\n const renderFirst3 = () => {\n return groupMembers.slice(0, NUM_TO_SHOW).map((member, i) => {\n return (\n <span\n key={i}\n style={{\n position: 'relative',\n zIndex: count - i,\n }}\n >\n <UserDisc\n user={member}\n css={css`\n ${baseStyle}\n ${i !== 0 && stackedStyle}\n `}\n options={{\n showPseudo: false,\n }}\n />\n </span>\n );\n });\n };\n\n const renderEveryoneElse = () => {\n if (count <= 3) { return; }\n\n return (\n <ManyDisc\n groupMembers={groupMembers}\n />\n );\n };\n\n return (\n <>\n {renderFirst3()}\n {renderEveryoneElse()}\n </>\n );\n};\n\nexport default DiscGroup;\n","import React, { useState, useRef } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport PropTypes from 'prop-types';\nimport Popdown from 'components/shared/popdown';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\n\nconst DropdownMenu = (props) => {\n const [isOpen, setIsOpen] = useState(false);\n const menuAnchorRef = useRef();\n\n const onMenuOpen = (e) => {\n e.stopPropagation();\n e.preventDefault();\n setIsOpen(!isOpen);\n };\n\n return (\n <div className='dropdownmenu'>\n <span onClick={onMenuOpen} ref={menuAnchorRef} className='dropdownmenu-button'>\n <FontAwesomeIcon\n icon={icon({ name: 'ellipsis' })}\n style={{ color: props.iconColor }}\n />\n </span>\n { isOpen && (\n <Popdown\n anchorRef={menuAnchorRef}\n justify={props.justify}\n >\n <CloseIfOutsideWrapper onClose={onMenuOpen}>\n <div className='contents inherit-height'>\n <div className='dropdownmenu-body' onClick={onMenuOpen}>\n {props.children}\n </div>\n </div>\n </CloseIfOutsideWrapper>\n </Popdown>\n )}\n </div>\n );\n};\n\nDropdownMenu.propTypes = {\n iconColor: PropTypes.string,\n justify: PropTypes.string,\n};\n\nDropdownMenu.defaultProps = {\n iconColor: '#0463B7',\n justify: 'right',\n};\n\nexport default DropdownMenu;\n","/*\n Embedded is probably the wrong word for this class.\n It's pretty much just a text area that submits\n debounced changes while typing. It's also styled\n (at time of writing) without a border or background\n so it's sort of 'embedded' in the page.\n*/\n\nimport PropTypes from 'prop-types';\nimport React, { useState } from 'react';\nimport Textarea from 'react-textarea-autosize';\n\nconst EmbeddedTextarea = ({\n defaultValue, placeholder, className, disabled, onChange,\n}) => {\n const [value, setValue] = useState(defaultValue);\n const submitChange = (e) => {\n const { value: newValue } = e.target;\n setValue(newValue);\n onChange(newValue);\n };\n\n return (\n <div className={`embeddedtextarea${className ? ` ${className}` : ''}`}>\n <Textarea\n readOnly={disabled}\n onChange={submitChange}\n value={value}\n placeholder={placeholder}\n />\n </div>\n );\n};\n\nEmbeddedTextarea.propTypes = {\n defaultValue: PropTypes.string,\n placeholder: PropTypes.string,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n};\n\nexport default EmbeddedTextarea;\n","import PropTypes from 'prop-types';\nimport React, { useRef, useLayoutEffect } from 'react';\n\nconst EmbeddedTextInput = (props) => {\n const input = useRef();\n const measure = useRef();\n\n const onChange = () => {\n resize();\n props.onChange(input.current.value);\n };\n\n useLayoutEffect(() => {\n if (!props.disabled) {\n resize();\n }\n });\n\n const onKeyPress = (e) => {\n const keynum = e.which;\n if (keynum === 13) {\n input.current.blur();\n }\n };\n\n const resize = () => {\n const fontSize = window.getComputedStyle(input.current, null).getPropertyValue('font-size');\n const fontWeight = window.getComputedStyle(input.current, null).getPropertyValue('font-weight');\n let paddingLeft = window.getComputedStyle(input.current, null).getPropertyValue('padding-left').split('px')[0];\n paddingLeft = paddingLeft ? parseFloat(paddingLeft) : 5;\n let paddingRight = window.getComputedStyle(input.current, null).getPropertyValue('padding-right').split('px')[0];\n paddingRight = paddingRight ? parseFloat(paddingRight) : 5;\n measure.current.style.fontSize = fontSize;\n measure.current.style.fontWeight = fontWeight;\n measure.current.innerHTML = (input.current.value || props.placeholder).replace(/\\s/g, ' ');\n // Adding 5 px extra spacing\n const width = measure.current.clientWidth + paddingLeft + paddingRight + 5;\n const newWidth = (props.maxWidth && (width > props.maxWidth))\n ? props.maxWidth\n : width;\n\n input.current.style.width = `${newWidth}px`;\n };\n\n const className = () => {\n const klass = props.className;\n return `embeddedtextinput ${classForSize()}${klass ? ` ${klass}` : ''}`;\n };\n\n const classForSize = () => {\n switch (props.size) {\n case 'small':\n return 'smaller';\n default:\n return '';\n }\n };\n\n const renderEditIcon = () => {\n if (!props.disabled) {\n return (\n <span\n className='icon icon-pencil-grey clickable'\n onClick={() => { input.current.select(); }}\n />\n );\n }\n };\n\n const renderContent = () => {\n if (props.disabled) {\n return <h1>{props.disabledValue}</h1>;\n }\n return (\n <span>\n <input\n type='text'\n defaultValue={props.defaultValue || ''}\n placeholder={props.placeholder || ''}\n onChange={onChange}\n ref={input}\n onKeyDown={onKeyPress}\n id={props.idName}\n />\n\n {renderEditIcon()}\n\n <span\n className='embeddedtextinput-measure'\n ref={measure}\n />\n </span>\n );\n };\n\n return (\n <div tabIndex={props.tabindex} className={className()}>\n {renderContent()}\n </div>\n );\n};\n\nEmbeddedTextInput.propTypes = {\n className: PropTypes.string,\n defaultValue: PropTypes.string,\n disabled: PropTypes.bool,\n disabledValue: PropTypes.string,\n idName: PropTypes.string,\n maxWidth: PropTypes.number,\n onChange: PropTypes.func.isRequired,\n placeholder: PropTypes.string.isRequired,\n size: PropTypes.string,\n};\n\nEmbeddedTextInput.defaultProps = {\n idName: false,\n className: '',\n size: '',\n maxWidth: null,\n placeholder: 'Start typing...',\n};\n\nexport default EmbeddedTextInput;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ExportsMessage = (props) => {\n return (\n <div className={`fullwidthnotif success export ${props.className}`}>\n <span>Export queued. You will be emailed when your export completes. Finished exports can be found on the <a href='/exports'>Exports</a> page.</span>\n </div>\n );\n};\n\nExportsMessage.propTypes = {\n className: PropTypes.string,\n};\n\nExportsMessage.defaultProps = {\n className: '',\n};\n\nexport default ExportsMessage;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { isFunction } from 'underscore';\n\nclass FileInput extends React.Component {\n handleChange = (e) => {\n const returnValue = this.props.onChange(e);\n\n if (isFunction(returnValue)) {\n returnValue.done(this.resetFileInput);\n }\n };\n\n resetFileInput = () => {\n this.input.value = null;\n };\n\n triggerFileBrowse = (e) => {\n e.preventDefault();\n this.input.click();\n };\n\n render() {\n return (\n <div className={`fileinput ${this.props.className}`}>\n <input className='hidden' ref={(el) => this.input = el} type='file' accept={this.props.fileType} onChange={this.handleChange} disabled={this.props.disabled} />\n <button\n type='button'\n className={`btn-link secondary${this.props.disabled ? ' disabled' : ''}`}\n onClick={this.triggerFileBrowse.bind(this)}\n >\n {this.props.label}\n </button>\n </div>\n );\n }\n}\n\nFileInput.defaultProps = {\n fileType: '',\n disabled: false,\n label: 'Upload CSV',\n};\n\nFileInput.propTypes = {\n fileType: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n label: PropTypes.string,\n};\n\nexport default FileInput;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst FlashItem = ({ position = 0, type, message }) => {\n const pixelOffset = position * 6;\n\n return (\n <div\n style={{ bottom: `${pixelOffset}em` }}\n role='alert'\n className={`flash-${type}`}\n dangerouslySetInnerHTML={{ __html: message }}\n />\n );\n};\n\nFlashItem.propTypes = {\n position: PropTypes.number,\n type: PropTypes.string,\n message: PropTypes.string,\n};\n\nexport default FlashItem;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport renderer from 'modules/renderer';\nimport { TransitionGroup, CSSTransition } from 'react-transition-group';\nimport _ from 'underscore';\nimport ErrorMessages from 'constants/error-messages';\nimport FlashItem from './flash-item';\n\nconst MESSAGE_DURATION = 4500;\n\n// TODO: refactor this so that we're not reaching in and modifying\n// this component from outside the component\nclass Flash extends React.Component {\n state = {\n items: [],\n };\n\n render() {\n const { items } = this.state;\n return (\n <TransitionGroup>\n {items.map((item, index) => (\n <CSSTransition\n classNames='flash'\n timeout={600}\n key={item.content.message}\n >\n <FlashItem\n position={index}\n type={item.content.type}\n message={item.content.message}\n />\n </CSSTransition>\n ))}\n </TransitionGroup>\n );\n }\n}\n\nlet _component = null;\nconst _queue = [];\n\nexport function render(input) {\n if (_.isEmpty(input)) { return; }\n\n if (!_component) {\n renderComponent();\n }\n\n addItem(input);\n}\n\nexport function success(message) {\n render({ type: 'success', message });\n}\n\nexport const error = (message = ErrorMessages.flash.actionFailed) => {\n render({ type: 'error', message });\n};\n\nexport const notice = (message = ErrorMessages.flash.actionFailed) => {\n render({ type: 'notice', message });\n};\n\nfunction expireOldest() {\n _queue.shift();\n setComponentState();\n}\n\nfunction setComponentState() {\n _component.setState({\n items: _queue,\n });\n}\n\nfunction addItem(item) {\n const matchingItem = _.find(_queue, (potentialMatch) => {\n return potentialMatch.content.message === item.message;\n });\n\n if (!matchingItem) {\n const timer = setTimeout(expireOldest, MESSAGE_DURATION);\n _queue.push({ content: item, timer });\n\n setComponentState();\n }\n}\n\nfunction renderComponent() {\n _component = ReactDOM.render(\n <Flash />,\n document.getElementById('flash'),\n );\n}\n\nexport default {\n render,\n success,\n notice,\n error,\n};\n","import React, { memo } from 'react';\nimport PropTypes from 'prop-types';\n\nconst InlineNotification = memo((props) => {\n const renderChildren = () => {\n if (React.isValidElement(props.children)) {\n return <span>{props.children}</span>;\n }\n\n return <span dangerouslySetInnerHTML={{ __html: props.children }} />;\n };\n\n const classForType = () => {\n switch (props.type) {\n case 'notice':\n return 'inlinenotification-notice';\n default:\n }\n };\n\n const renderIcon = () => {\n switch (props.type) {\n case 'notice':\n return <i className='icon-exclaim-white' />;\n default:\n return <i className='icon-exclaim' />;\n }\n };\n\n return (\n <div className={`inlinenotification ${classForType()} ${props.className}`}>\n {renderIcon()}\n {renderChildren()}\n </div>\n );\n});\n\nInlineNotification.propTypes = {\n type: PropTypes.string,\n};\n\nInlineNotification.defaultProps = {\n type: 'error',\n};\n\nexport default InlineNotification;\n","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\n\nclass MoneyInput extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n value: this.props.defaultValue || '',\n };\n }\n\n handleChange = (e) => {\n const { value } = e.currentTarget;\n if (isFinite(value)) {\n this.setState({ value: e.currentTarget.value });\n this.props.onChange(e, e.currentTarget.value);\n }\n };\n\n render() {\n return (\n <div className='moneyinput'>\n <input\n ref={this.props.innerRef}\n id={this.props.id}\n type='text'\n onBlur={this.props.onBlur}\n onChange={this.handleChange}\n value={this.state.value}\n disabled={this.props.disabled}\n aria-required={this.props.required}\n />\n <i />\n </div>\n );\n }\n}\n\nMoneyInput.propTypes = {\n defaultValue: PropTypes.string,\n onChange: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n onBlur: PropTypes.func,\n id: PropTypes.string,\n required: PropTypes.bool,\n};\n\nexport default MoneyInput;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport TextEditor from 'components/shared/text-editor';\nimport TextEditorButtons from 'components/shared/text-editor/buttons';\n\nclass InstructionsManager extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n instructions: this.props.instructions,\n };\n }\n\n onSave = () => {\n // Because blank Quill editor still has tags in it\n //\n\n const newInstructions = (this.state.instructions === '<p><br></p>' ? null : this.state.instructions);\n\n this.props.onSave(newInstructions);\n };\n\n onChange = (instructions) => {\n this.setState({ instructions });\n };\n\n render() {\n return (\n <>\n <TextEditor\n className='instructions'\n onChange={this.onChange}\n content={this.state.instructions || ''}\n formattedMentionData={this.props.templateVariables}\n referenceKey='identity'\n {...!this.props.isActive && { toolbar: [] }}\n />\n\n {this.props.isActive && <TextEditorButtons onSave={this.onSave} onClose={this.props.onClose} type='Instructions' />}\n </>\n );\n }\n}\n\nInstructionsManager.propTypes = {\n instructions: PropTypes.string,\n onSave: PropTypes.func.isRequired,\n templateVariables: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n onClose: PropTypes.func,\n isActive: PropTypes.bool,\n};\n\nInstructionsManager.defaultProps = {\n onClose: () => {},\n isActive: true,\n};\n\nexport default InstructionsManager;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst Labelbox = (props) => {\n const themeClass = () => {\n switch (props.theme) {\n case 'alert':\n return 'alert';\n break;\n case 'default':\n return '';\n break;\n default:\n return '';\n }\n };\n\n return (\n <div className={`labelbox margin-top ${themeClass()}`}>\n <span className='labelbox-label'>{props.label}</span>\n <div className='labelbox-box'>\n {props.children}\n </div>\n </div>\n );\n};\n\nLabelbox.propTypes = {\n theme: PropTypes.string,\n label: PropTypes.string.isRequired,\n};\n\nexport default Labelbox;\n","import React from 'react';\n\nconst LeftMenu = (props) => {\n return (\n <div className='config-left'>\n <ul>\n {props.children}\n </ul>\n </div>\n );\n};\n\nexport default LeftMenu;\n","import React from 'react';\nimport UserDisc from 'components/shared/user-disc';\n\nclass ListOfPeoplePerson extends React.Component {\n onClick = () => {\n this.props.onSelect(this.props.person);\n };\n\n render() {\n return (\n <li onClick={this.onClick}>\n <UserDisc\n user={this.props.person}\n className='margin-right'\n options={{\n showName: true,\n }}\n />\n </li>\n );\n }\n}\n\nexport default ListOfPeoplePerson;\n","import React, { useMemo, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { filter, isEmpty } from 'underscore';\nimport ListOfPeoplePerson from './list-of-people/person';\n\nconst ListOfPeople = (props) => {\n const [showExternal, setShowExternal] = useState(false);\n\n const buildPerson = (person) => {\n return (\n <ListOfPeoplePerson\n person={person}\n onSelect={onPersonSelect}\n key={person.id}\n />\n );\n };\n\n const filteredInternalPeople = useMemo(() => {\n if (!props.hideExternal) { return props.users; }\n\n const filterFunc = (user) => {\n // This group should include those who are internal _as well as_\n // those who are already attached to the process.\n return user.internal === true;\n };\n\n return filter(props.users, filterFunc);\n }, [props.hideExternal, props.users]);\n\n const filteredExternalPeople = useMemo(() => {\n if (!props.hideExternal) { return []; }\n\n const filterFunc = (user) => {\n return user.internal === false;\n };\n\n return filter(props.users, filterFunc);\n }, [props.hideExternal, props.users]);\n\n const onPersonSelect = (person) => {\n props.onSelect(person, 'User');\n };\n\n const renderInternalPeople = () => {\n if (!isEmpty(filteredInternalPeople)) {\n return filteredInternalPeople.map(buildPerson);\n }\n return (\n <div className='margin-left margin-top margin-bottom'>No results within your teams</div>\n );\n };\n\n const renderExternalPeople = () => {\n if (!isEmpty(filteredExternalPeople)) {\n if (showExternal) {\n return (\n <>\n <div className='attachedpeople-manager-resultlabel'>External results</div>\n <ul className='attachedpeople-manager-peoplelist'>\n {filteredExternalPeople.map(buildPerson)}\n </ul>\n </>\n );\n }\n return (\n <button onClick={() => { setShowExternal(true); }}>Show {filteredExternalPeople.length} matches from outside your teams</button>\n );\n }\n };\n\n const externalClassMargin = () => {\n return showExternal ? 'margin-top-less' : '';\n };\n\n return (\n <div>\n <div className='attachedpeople-manager-internalresults'>\n <ul className='attachedpeople-manager-peoplelist'>\n {renderInternalPeople()}\n </ul>\n </div>\n\n <div className={`attachedpeople-manager-externalresults ${externalClassMargin()}`}>\n {renderExternalPeople()}\n </div>\n </div>\n );\n};\n\nListOfPeople.propTypes = {\n hideExternal: PropTypes.bool.isRequired,\n onSelect: PropTypes.func.isRequired,\n users: PropTypes.shape({}).isRequired,\n};\n\nListOfPeople.defaultProps = {\n hideExternal: false,\n onSelect() {},\n users: [],\n};\n\nexport default ListOfPeople;\n","import React, { memo } from 'react';\nimport PropTypes from 'prop-types';\n\nconst LoadingSpinner = memo((props) => {\n const displayName = () => {\n switch (props.size) {\n case 'tiny':\n return 'smallest';\n case 'small':\n return 'smaller';\n case 'medium':\n return 'small';\n case 'large':\n return '';\n case 'xlarge':\n return 'large';\n default:\n return '';\n }\n };\n\n const colorScheme = () => {\n switch (props.colorScheme) {\n case 'dark':\n return 'dark';\n default:\n return '';\n }\n };\n\n return <div className={`progress ${colorScheme()} ${displayName()} ${props.className}`}><div>Loading</div></div>;\n});\n\nLoadingSpinner.displayName = 'LoadingSpinner';\n\nLoadingSpinner.propTypes = {\n size: PropTypes.string,\n colorScheme: PropTypes.string,\n className: PropTypes.string,\n center: PropTypes.bool,\n};\n\nLoadingSpinner.defaultProps = {\n size: 'small',\n};\n\nexport default LoadingSpinner;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { ALL_COMPARATORS } from 'constants/logic-constants';\nimport nameForConnective from 'modules/logic-helpers';\nimport truncate from 'truncate';\n\nconst ConfiguredLogicCondition = ({ sourceField, condition, multipleChoiceMatchValue }) => {\n const isNumeric = ['float', 'integer'].includes(sourceField.data_type);\n const matchValue = isNumeric ? condition.match_value : multipleChoiceMatchValue;\n const { connective } = condition;\n\n return (\n <>\n <div className='logicconfig-configuredcond'>\n <strong className='margin-right-less' title={sourceField.name}>{truncate(sourceField.name, 50)}</strong>\n <span className='margin-right-less'>{ALL_COMPARATORS.find(({ value }) => value === condition.comparator).label}</span>\n <strong className='margin-right-less' title={matchValue}>{truncate(matchValue, 50)}</strong>\n </div>\n {connective && (\n <div className='inline-block vmiddle'>{nameForConnective(connective)} </div>\n )}\n </>\n );\n};\n\nConfiguredLogicCondition.propTypes = {\n condition: PropTypes.object,\n sourceField: PropTypes.object,\n multipleChoiceMatchValue: PropTypes.string,\n};\n\nexport default ConfiguredLogicCondition;\n","import { CONNECTIVES } from '../constants/logic-constants';\n\n// NOTE: This logic expects CONNECTIVES to be in the react-select format.\nexport default (connectiveId) => {\n const connective = CONNECTIVES.find(({ value }) => value === connectiveId);\n\n if (!connective) { throw Error('Connective not found'); }\n\n return connective.label;\n};\n","import React, { useState, useMemo, useEffect } from 'react';\n\nimport PropTypes from 'prop-types';\n\nimport Select from 'components/shared/select';\nimport {\n STANDARD_COMPARATORS, CHECKBOX_COMPARATORS, CONNECTIVES, DEFAULT_CONNECTIVE, NUMERIC_COMPARATORS,\n} from 'constants/logic-constants';\nimport {css} from \"@emotion/react\";\nimport {icon} from \"@fortawesome/fontawesome-svg-core/import.macro\";\nimport {FontAwesomeIcon} from \"@fortawesome/react-fontawesome\";\n\n// NOTE: this is a cumbersome function, but it works better as something that happens in\n// response to events, rather than making it an effect (because of the fact that it both\n// depends on the logicConfig and modifies the logicConfig). It's difficult to prevent\n// it from looping otherwise.\n// A better way to approach this might be to do partial updates and only update the bits\n// that are changing in each handler.\n// Validation logic makes that a bit harder.\nconst sendChange = ({\n onChange,\n selectedFieldId,\n comparator,\n matchValue,\n connective,\n index,\n}) => {\n if (onChange) {\n // This is causing problems. A valid configuration doesn't start as valid.\n // The useEffect used to take care of that, but it's no longer using it.\n onChange({\n source_id: Number(selectedFieldId),\n comparator,\n match_value: matchValue,\n connective,\n }, index);\n }\n};\n\nconst LogicCondition = ({\n condition, index, onChange, availableFields, disabled, isLast, onRemoveClick,\n}) => {\n const initialConnective = () => {\n if (isLast) { return null; }\n\n return condition.connective || DEFAULT_CONNECTIVE;\n };\n\n const [selectedFieldId, setSelectedFieldId] = useState(condition.source_id);\n const [comparator, setComparator] = useState(condition.comparator);\n const [matchValue, setMatchValue] = useState(condition.match_value);\n\n const [connective, setConnective] = useState(initialConnective);\n\n const selectedField = useMemo(\n () => availableFields.find(({ id }) => id === Number(selectedFieldId)),\n [availableFields, selectedFieldId],\n );\n const selectedFieldType = selectedField ? selectedField.data_type : null;\n\n const onConnectiveChange = ({ value }) => {\n setConnective(value);\n sendChange({\n onChange,\n selectedFieldId,\n comparator,\n matchValue,\n connective: value,\n index,\n });\n };\n\n useEffect(() => {\n if (!isLast && !connective) {\n onConnectiveChange({ value: DEFAULT_CONNECTIVE });\n }\n }, [isLast, connective, onConnectiveChange]);\n\n const comparatorsForFieldType = (fieldType) => {\n switch (fieldType) {\n case 'integer':\n case 'float':\n return NUMERIC_COMPARATORS;\n case 'multiple_choice':\n return STANDARD_COMPARATORS;\n case 'checkboxes':\n return CHECKBOX_COMPARATORS;\n default:\n return [];\n }\n };\n\n const defaultComparitorForFieldType = (fieldType) => {\n const comparators = comparatorsForFieldType(fieldType);\n\n if (comparators.length) {\n return comparators[0].value;\n }\n\n return null;\n };\n\n const comparatorOptions = comparatorsForFieldType(selectedFieldType);\n\n const matchOptions = selectedFieldId\n ? selectedField.multiple_choice_options.map((option) => ({\n value: option.id,\n label: option.name,\n }))\n : [];\n\n const onSelectedFieldChange = ({ value }) => {\n const fieldId = value;\n // NOTE: duplicating this here for now.\n // This lookup needs to happen because the selectedField is changing,\n // so we can't just use the selectedField that we already have in the\n // component.\n const type = availableFields?.find(({ id }) => id === Number(fieldId))?.data_type ?? null;\n const newComparator = defaultComparitorForFieldType(type);\n const newMatchValue = '';\n\n setSelectedFieldId(fieldId);\n setComparator(newComparator);\n setMatchValue(newMatchValue);\n\n sendChange({\n onChange,\n selectedFieldId: fieldId,\n comparator: newComparator,\n matchValue: newMatchValue,\n connective,\n index,\n });\n };\n\n const onComparatorChange = ({ value }) => {\n setComparator(value);\n sendChange({\n onChange,\n selectedFieldId,\n comparator: value,\n matchValue,\n connective,\n index,\n });\n };\n\n const onMatchValueChange = (value) => {\n setMatchValue(value);\n sendChange({\n onChange,\n selectedFieldId,\n comparator,\n matchValue: value,\n connective,\n index,\n });\n };\n\n const onInputMatchValueChange = (e) => onMatchValueChange(e.target.value);\n const onSelectMatchValueChange = ({ value }) => onMatchValueChange(value);\n\n function renderMatchValue() {\n const isNumeric = ['float', 'integer'].includes(selectedFieldType);\n if (isNumeric) {\n return (\n <input\n name='matchvalue'\n type='text'\n value={matchValue}\n onChange={onInputMatchValueChange}\n placeholder='Type a number'\n />\n );\n }\n\n return (\n <Select\n // Number cast is here because even if matchValue is a numeric ID (matching\n // the structure of multiple_choice_options), it comes from the backend as a string.\n // This ensures that it's picked up correctly.\n value={matchOptions.find(({ value }) => value === Number(matchValue)) ?? null}\n onChange={onSelectMatchValueChange}\n options={matchOptions}\n disabled={disabled}\n name='matchvalue'\n styles={{\n container: (provided) => ({\n ...provided,\n width: '100%',\n maxWidth: '100%',\n display: 'inline-block',\n verticalAlign: 'middle',\n }),\n }}\n />\n );\n }\n\n const onRemove = () => {\n if (onRemoveClick) {\n onRemoveClick(index);\n }\n };\n\n const availableFieldOptions = availableFields\n .map((field) => ({ value: field.id, label: field.name }));\n\n return (\n <>\n <div className='logicconfig-condition'>\n <div>\n <Select\n options={availableFieldOptions}\n onChange={onSelectedFieldChange}\n disabled={disabled}\n value={availableFieldOptions.find(({ value }) => value === selectedFieldId)}\n menuShouldScrollIntoView={false}\n menuPosition='fixed'\n styles={{\n container: (provided) => ({\n ...provided,\n width: '100%',\n maxWidth: '100%',\n display: 'inline-block',\n verticalAlign: 'middle',\n }),\n }}\n name='source'\n />\n </div>\n\n <div>\n <Select\n value={comparatorOptions.find(({ value }) => value === comparator) ?? null}\n onChange={onComparatorChange}\n options={comparatorOptions}\n disabled={disabled}\n isSearchable={false}\n menuShouldScrollIntoView={false}\n menuPosition='fixed'\n styles={{\n container: (provided) => ({\n ...provided,\n width: '100%',\n maxWidth: '100%',\n display: 'inline-block',\n verticalAlign: 'middle',\n }),\n }}\n name='comparator'\n />\n </div>\n\n <div>\n {renderMatchValue()}\n </div>\n <FontAwesomeIcon\n css={css`\n opacity:0.5;\n color: #7C8285;\n &:hover {\n opacity:1;\n }\n `}\n icon={icon({ name: 'trash' })}\n className='clickable'\n title='Remove'\n onClick={onRemove}\n />\n </div>\n\n {!isLast && (\n <div className='logicconfig-connective'>\n <Select\n options={CONNECTIVES}\n onChange={onConnectiveChange}\n disabled={disabled}\n value={CONNECTIVES.find(({ value }) => value === connective) ?? null}\n isSearchable={false}\n menuShouldScrollIntoView={false}\n menuPosition='fixed'\n styles={{\n container: (provided) => ({\n ...provided,\n width: 'auto',\n display: 'inline-block',\n verticalAlign: 'middle',\n }),\n control: (provided) => ({\n ...provided,\n background: 'inherit !important',\n }),\n singleValue: (provided) => ({\n ...provided,\n color: '#00b9ad',\n textTransform: 'uppercase',\n fontWeight: 'bold',\n fontSize: '0.83rem',\n }),\n dropdownIndicator: (provided) => ({\n ...provided,\n color: '#00b9ad',\n }),\n }}\n name='connective'\n />\n </div>\n )}\n\n </>\n );\n};\n\nLogicCondition.propTypes = {\n condition: PropTypes.object,\n index: PropTypes.number,\n onChange: PropTypes.func,\n disabled: PropTypes.bool,\n onRemoveClick: PropTypes.func,\n isLast: PropTypes.bool,\n availableFields: PropTypes.array,\n};\n\nexport default LogicCondition;\n","import React, { useMemo, useCallback } from 'react';\nimport { uniqueId } from 'underscore';\nimport PropTypes from 'prop-types';\nimport { css } from '@emotion/react';\n\nimport Select from 'components/shared/select';\nimport { LOGICABLE_TYPES, actionsForLogicableType } from 'constants/logic-constants';\nimport FieldManager from 'modules/field-manager';\nimport AdvancedLabel from 'components/shared/advanced-label';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { confirm } from 'modules/alert-confirm';\nimport NotifBanner from 'components/shared/notif-banner';\nimport ConfiguredLogicCondition from './logic_widget/configured-logic-condition';\nimport LogicCondition from './logic_widget/logic-condition';\n\nconst LogicWidget = (props) => {\n const availableFields = useMemo(\n () => (\n props.flowTemplate\n ? new FieldManager(props.flowTemplate.steps).availableLogicFields()\n : []\n ),\n [props.flowTemplate],\n );\n const { setLogicConfig, logicConfig } = props;\n const onActionChanged = useCallback(\n ({ value }) => {\n setLogicConfig((prevConfig) => ({ ...prevConfig, action: value }));\n },\n [setLogicConfig],\n );\n\n const updateCondition = useCallback((conditionAttrs, index) => {\n const conditions = [...logicConfig.conditions];\n const condition = {\n ...conditions[index],\n ...conditionAttrs,\n };\n conditions[index] = condition;\n\n setLogicConfig((prevConfig) => ({ ...prevConfig, conditions }));\n }, [setLogicConfig, logicConfig.conditions]);\n\n const onRemoveClick = (conditionIndex) => {\n const conditions = [...props.logicConfig.conditions];\n conditions.splice(conditionIndex, 1);\n\n sendConditions(conditions);\n };\n\n const onAddConditionClick = (e) => {\n e.preventDefault();\n\n const conditions = [\n ...props.logicConfig.conditions,\n { tempId: uniqueId() },\n ];\n sendConditions(conditions);\n };\n\n function sendConditions(conditions) {\n props.setLogicConfig({ ...props.logicConfig, conditions });\n }\n\n function renderEditView() {\n const options = actionsForLogicableType(props.logicableType);\n return (\n <table>\n <tbody>\n <tr>\n <td>\n <AdvancedLabel\n label='Outcome'\n required\n />\n </td>\n <td>\n <div className='logicconfig-section'>\n <Select\n value={options.find(({ value }) => value === props.logicConfig.action)}\n options={options}\n onChange={onActionChanged}\n disabled={props.disabled}\n isSearchable={false}\n menuShouldScrollIntoView={false}\n menuPosition='fixed'\n styles={{\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n verticalAlign: 'middle',\n width: '100%',\n }),\n }}\n />\n </div>\n </td>\n </tr>\n <tr>\n <td>\n <AdvancedLabel\n label='Conditions'\n required\n />\n </td>\n <td>\n <div className='logicconfig-section'>\n <div className='logicconfig-conditionwrap'>\n {renderConditions()}\n\n <div className='logicconfig-addcondition'>\n <button\n onClick={onAddConditionClick}\n type='button'\n className='btn-link'\n >\n + Add condition\n </button>\n </div>\n </div>\n </div>\n </td>\n </tr>\n <tr>\n <td colSpan='2'>\n {props.children}\n </td>\n </tr>\n </tbody>\n </table>\n );\n }\n\n function renderConditions() {\n return props.logicConfig.conditions.map((condition, index, array) => {\n const isLast = index === (array.length - 1);\n const id = condition.tempId ?? condition.id;\n return (\n <LogicCondition\n key={id}\n condition={condition}\n isLast={isLast}\n index={index}\n availableFields={availableFields}\n disabled={props.disabled}\n onChange={updateCondition}\n onRemoveClick={onRemoveClick}\n />\n );\n });\n }\n\n function renderConfiguredView() {\n return (\n <div className='logicconfig-configuredwrap'>\n <div className='logicconfig-configuredwrap-conditions'>\n <span className='margin-right-less'>{actionsForLogicableType(props.logicableType).find(({ value }) => value === props.logicConfig.action).label}</span>\n <span className='margin-right-less'>if</span>\n {renderConfiguredConditions()}\n </div>\n <div className='logicconfig-configuredwrap-actions'>\n {renderEditButton()}\n {renderXButton()}\n </div>\n </div>\n );\n }\n\n function renderConfiguredConditions() {\n return props.logicConfig.conditions.map((condition) => {\n const sourceField = availableFields.find(({ id }) => id === condition.source_id);\n const multipleChoiceMatchValue = sourceField.multiple_choice_options\n .find(({ id }) => id === Number(condition.match_value))?.name;\n\n return (\n <ConfiguredLogicCondition\n condition={condition}\n sourceField={sourceField}\n multipleChoiceMatchValue={multipleChoiceMatchValue}\n key={condition.id}\n />\n );\n });\n }\n\n function renderXButton() {\n if (props.logicableType === LOGICABLE_TYPES.subprocess) { return; }\n\n return (\n <FontAwesomeIcon\n icon={icon({ name: 'trash' })}\n className='clickable'\n onClick={onDelete}\n title='Remove logic configuration'\n />\n );\n }\n\n function onDelete() {\n confirm('Delete this logic configuration?', 'Are you sure you want to delete this logic configuration?', () => {\n props.onDelete();\n }, null, 'deletelogicconfig');\n }\n\n function renderEditButton() {\n if (props.editing) { return; }\n if (props.logicConfig.tempId) { return; }\n if (props.logicableType === 'Subprocess') { return; }\n\n return (\n <FontAwesomeIcon\n icon={icon({ name: 'pencil' })}\n className='clickable'\n title='Edit logic configuration'\n onClick={() => { props.setEditing(true); }}\n />\n );\n }\n\n return (\n <dl style={{ width: '100%' }}>\n {props.showTitle && (\n <dt>\n <span\n className='icon icon-pathsplit-cyan margin-right-less'\n css={css`\n top:-3px;\n width:18px;\n position:relative;\n `}\n />\n <span>Logic</span>\n </dt>\n )}\n <dd>\n {props.error && (\n <NotifBanner style='alert'>{props.error}</NotifBanner>\n )}\n {props.editing ? renderEditView() : renderConfiguredView()}\n </dd>\n </dl>\n );\n};\n\nLogicWidget.propTypes = {\n logicConfig: PropTypes.shape({\n id: PropTypes.number,\n tempId: PropTypes.string,\n conditions: PropTypes.arrayOf(PropTypes.shape({})),\n }),\n setEditing: PropTypes.func,\n flowTemplate: PropTypes.shape({}).isRequired,\n disabled: PropTypes.bool.isRequired,\n logicableType: PropTypes.string,\n setLogicConfig: PropTypes.func,\n editing: PropTypes.bool,\n error: PropTypes.node,\n onDelete: PropTypes.func,\n children: PropTypes.node,\n showTitle: PropTypes.string,\n};\n\nLogicWidget.defaultProps = {\n setEditing: () => {},\n};\n\nexport default LogicWidget;\n","class LogicValidator {\n constructor(action, conditions) {\n this.action = action;\n this.conditions = conditions;\n }\n\n validateConfig() {\n return this.action && this.allConditionsValid();\n }\n\n allConditionsValid() {\n return this.conditions.length\n && this.conditions.every(\n (condition) => (\n condition.source_id && condition.comparator && condition.match_value\n ),\n );\n }\n}\n\nexport default LogicValidator;\n","import Shield from 'modules/shield';\nimport PropTypes from 'prop-types';\nimport React, { useEffect } from 'react';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\nimport useFocusTrap from 'components/hooks/use-focus-trap';\nimport XClose from 'components/shared/x-close';\n\nconst Modal = (props) => {\n const focusEl = useFocusTrap(onClose);\n\n useEffect(() => {\n Shield.on();\n\n return () => {\n Shield.off();\n };\n }, []);\n\n function onClose() {\n if (props.onOutsideClick) {\n props.onOutsideClick();\n }\n }\n\n function className() {\n const classes = ['centered'];\n\n if (props.className) {\n classes.push(props.className);\n }\n\n if (!props.scroll) {\n classes.push('modal-noscroll');\n }\n\n return classes.join(' ');\n }\n\n function renderMain() {\n return (\n <div id='modal' className={className()} ref={focusEl}>\n <XClose onClick={onClose} buttonClass='float-right' label='Close invite modal'/>\n {props.children}\n </div>\n )\n }\n\n if (props.enableCloseIfOutside) {\n return (\n <CloseIfOutsideWrapper onClose={onClose}>\n {renderMain()}\n </CloseIfOutsideWrapper>\n );\n }\n\n return renderMain()\n};\n\nModal.propTypes = {\n children: PropTypes.node.isRequired,\n onOutsideClick: PropTypes.func,\n className: PropTypes.string,\n scroll: PropTypes.bool,\n enableCloseIfOutside: PropTypes.bool,\n};\n\nModal.defaultProps = {\n scroll: true,\n enableCloseIfOutside: true,\n};\n\nexport default Modal;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst styles = {\n default: '',\n alert: 'flowbanner-alert',\n warning: 'flowbanner-warning',\n notice: 'flowbanner-notice',\n};\n\nconst NotifBanner = (props) => {\n const styleClass = () => {\n return styles[props.style || 'default'];\n };\n\n return (\n <div className={`flowbanner ${styleClass()} ${props.className ? props.className : ''}`}>\n {props.children}\n </div>\n );\n};\n\nNotifBanner.propTypes = {\n className: PropTypes.string,\n};\n\nexport default NotifBanner;\n","import React from 'react';\n\nconst Well = (props) => {\n return (\n <div className={`well morepadding margin-bottom-more stepoptions ${props.className}`}>\n {props.children}\n </div>\n );\n};\n\nexport default Well;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { debounce, isNull } from 'underscore';\n\nimport FlowStepActions from 'actions/flow-step-actions';\nimport FormulaAPI from 'apis/formula-api';\nimport MoneyInput from 'components/shared/input_fields/money-input';\nimport Select from 'components/shared/select';\nimport SlidingToggle from 'components/shared/sliding-toggle';\n\nclass FixedPaymentSettings extends React.Component {\n constructor(props) {\n super(props);\n\n this.calculated = React.createRef();\n this.fixed = React.createRef();\n this.debouncedAmountChanged = debounce(this.amountChanged, 500);\n\n this.state = {\n availableFormulas: (this.props.step.type === 'PaymentRequirement' ? [] : null),\n formulaLoadError: false,\n };\n }\n\n componentDidMount() {\n this.loadAvailableFormulas();\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.step.type === 'PaymentRequirement') { return; }\n\n if (prevProps.step.position === this.props.step.position) { return; }\n\n this.loadAvailableFormulas();\n }\n\n onAutoadvanceToggle = () => {\n FlowStepActions.updateStep(this.props.step.id, {\n autoadvance: !this.props.step.autoadvance,\n });\n };\n\n loadAvailableFormulas = () => {\n // TODO: This is a crap workaround. This component needs its\n // presentation extracted for happier sharing between\n // Payment requirements and template editor usage\n\n if (this.props.step.type !== 'PaymentRequirement') {\n FormulaAPI.availableForStep(this.props.step.id)\n .done(this.onFormulaLoadComplete)\n .fail(this.onFormulaLoadFailed);\n }\n };\n\n onFormulaLoadComplete = (res) => {\n this.setState({\n availableFormulas: res,\n });\n };\n\n onFormulaLoadFailed = () => {\n this.setState({\n formulaLoadError: true,\n });\n };\n\n onCalculatedChanged = () => {\n this.updateConfig('calculated', this.calculated.current.checked);\n };\n\n onFormulaChanged = ({ value }) => {\n this.updateConfig('formula_id', value);\n };\n\n amountChanged = (_e, newAmount) => {\n this.updateConfig('amount', newAmount);\n };\n\n updateConfig = (attrName, value) => {\n const attrs = {\n config_attributes: {\n [attrName]: value,\n },\n };\n\n return this.props.updateAttrs(this.props.step.id, attrs);\n };\n\n renderAmountOption = () => {\n const { config, disabled, step } = this.props;\n\n return (\n <div className={`stepoptions-settinggroup${disabled ? ' disabled' : ''}`}>\n <label>\n <span>Enter amount</span>\n <MoneyInput\n onChange={this.debouncedAmountChanged}\n disabled={config.calculated}\n defaultValue={config.amount}\n key={step.id}\n id='paymentamountinput'\n />\n </label>\n </div>\n );\n };\n\n loadingFormulaOptions = () => {\n return isNull(this.state.availableFormulas) && !this.state.formulaLoadError;\n };\n\n noFormulasAvailable = () => {\n const formulas = this.state.availableFormulas;\n return !isNull(formulas) && formulas.length === 0;\n };\n\n defaultFormulaOptionText = () => {\n if (this.state.formulaLoadError) {\n return 'Error loading formulas';\n }\n if (isNull(this.state.availableFormulas)) {\n return 'Loading formulas...';\n }\n if (this.noFormulasAvailable()) {\n return 'No available formulas';\n }\n return 'Choose a formula';\n };\n\n getFormulaOptions = () => {\n const defaultOptions = [\n { value: null, label: this.defaultFormulaOptionText() },\n ];\n if (!isNull(this.state.availableFormulas)) {\n return [\n ...defaultOptions,\n ...this.state.availableFormulas.map((formula) => ({\n value: formula.id,\n label: formula.name,\n })),\n ];\n }\n return defaultOptions;\n };\n\n renderCalcValueOption = () => {\n const disabled = !this.props.config.calculated\n || this.loadingFormulaOptions()\n || this.noFormulasAvailable()\n || this.state.formulaLoadError;\n const formulaOptions = this.getFormulaOptions();\n return (\n <div className={`stepoptions-settinggroup${this.props.disabled ? ' disabled' : ''}`}>\n\n <label>\n <span>Formula <a href={`${this.props.masterTemplateId}#/powerups/formulas/editor`}>Create a formula</a></span>\n\n <Select\n value={formulaOptions.find(({ value }) => value === this.props.config.formula_id)}\n options={formulaOptions}\n isDisabled={disabled}\n onChange={this.onFormulaChanged}\n styles={{\n container: (provided) => ({\n ...provided,\n maxWidth: '15rem',\n }),\n }}\n />\n\n </label>\n </div>\n );\n };\n\n supportsAutoadvance = () => {\n // SupplementalRequirements don't \"advance\"\n return this.props.step.generic_type !== 'SupplementalRequirement';\n };\n\n renderAutoadvanceToggle = () => {\n if (!this.supportsAutoadvance()) { return; }\n\n return (\n <div className='stepoptions-nestedoption'>\n <SlidingToggle\n description='Automatically complete this step if payment amount is $0'\n disabled={this.props.disabled}\n onToggle={this.onAutoadvanceToggle}\n on={this.props.step.autoadvance}\n label='Auto-advance'\n />\n </div>\n );\n };\n\n render() {\n return (\n <>\n <div className='stepoptions-nestedoption stepoptions-fixedpayment'>\n {!this.props.config.calculated && this.renderAmountOption()}\n {this.props.config.calculated && this.renderCalcValueOption()}\n </div>\n\n {this.renderAutoadvanceToggle()}\n </>\n );\n }\n}\n\nFixedPaymentSettings.propTypes = {\n disabled: PropTypes.bool.isRequired,\n config: PropTypes.shape({\n formula_id: PropTypes.number,\n calculated: PropTypes.bool.isRequired,\n amount: PropTypes.string.isRequired,\n payable_id: PropTypes.number,\n }).isRequired,\n\n step: PropTypes.shape({\n id: PropTypes.number.isRequired,\n type: PropTypes.string,\n position: PropTypes.number,\n autoadvance: PropTypes.bool,\n generic_type: PropTypes.string,\n }).isRequired,\n updateAttrs: PropTypes.func,\n};\n\nexport default FixedPaymentSettings;\n","import React, { useRef } from 'react';\nimport Well from 'components/shared/well';\nimport FixedPaymentSettings from './fixed-payment-settings';\n\nconst EditPaymentView = (props) => {\n const flatRef = useRef();\n const calculatedRef = useRef();\n const cashAllowedCheckbox = useRef();\n const checkAllowedCheckbox = useRef();\n const constituentFeeCheckbox = useRef();\n\n function configChanged() {\n // calculated ref does not exist when this is being used for supplemental payment\n const fixed = !!(flatRef.current.checked || (calculatedRef.current && calculatedRef.current.checked));\n\n const calculated = (calculatedRef.current && calculatedRef.current.checked);\n props.updateAttrs(props.step.id, {\n config_attributes: {\n accepts_cash: cashAllowedCheckbox.current.checked,\n accepts_checks: checkAllowedCheckbox.current.checked,\n constituent_pays_fee: constituentFeeCheckbox.current.checked,\n fixed,\n calculated,\n },\n });\n }\n\n function renderCheckDetails() {\n if (props.config.accepts_checks) {\n return (\n <textarea\n defaultValue={props.config.check_instructions}\n placeholder='Add instructions for how to pay by check...'\n onBlur={props.checkInstructionsBlurred}\n className='bg-white margin-top-less margin-bottom'\n />\n );\n }\n }\n\n function renderCashDetails() {\n if (props.config.accepts_cash) {\n return (\n <textarea\n defaultValue={props.config.cash_instructions}\n placeholder='Add instructions for how to pay with cash...'\n onBlur={props.cashInstructionsBlurred}\n className='bg-white margin-top-less margin-bottom'\n />\n );\n }\n }\n\n function renderPaymentSettings() {\n return (\n <section>\n <h3 className='stepcreator-sectiontitle'>Payment settings</h3>\n\n <Well>\n <label>\n <input\n disabled={props.disabled}\n ref={cashAllowedCheckbox}\n type='checkbox'\n defaultChecked={props.config.accepts_cash}\n onChange={configChanged}\n id='cashpaymentcheckbox'\n />\n Allow cash payment\n </label>\n\n {renderCashDetails()}\n\n <label>\n <input\n disabled={props.disabled}\n ref={checkAllowedCheckbox}\n type='checkbox'\n defaultChecked={props.config.accepts_checks}\n onChange={configChanged}\n id='checkpaymentcheckbox'\n />\n Allow payment by check\n </label>\n\n {renderCheckDetails()}\n\n <label>\n <input\n disabled={props.disabled}\n ref={constituentFeeCheckbox}\n type='checkbox'\n defaultChecked={!!props.config.constituent_pays_fee}\n onChange={configChanged}\n />\n Pass transaction fee on to constituent\n </label>\n </Well>\n </section>\n );\n }\n\n function renderFixedPaymentSettings() {\n if (props.config.fixed) {\n return (\n <FixedPaymentSettings\n disabled={props.disabled}\n config={props.config}\n calculated={props.config.calculated}\n step={props.step}\n masterTemplateId={props.masterTemplateId}\n updateAttrs={props.updateAttrs}\n />\n );\n }\n }\n\n function renderCalculateOption() {\n if (props.step.type === 'PaymentRequirement') { return; }\n\n const calculated = props.config.fixed && props.config.calculated;\n\n return (\n <div className='stepoptions-settinggroup margin-bottom'>\n <input\n disabled={props.disabled || props.step.type === 'PaymentRequirement'}\n key={`${props.step.id}-calculated`}\n type='radio'\n name='amount'\n defaultChecked={calculated}\n onChange={configChanged}\n ref={calculatedRef}\n id='calculatedoption'\n />\n\n <dl className='optionselect'>\n <dt><label htmlFor='fixedoption'>Calculated</label></dt>\n <dd><label htmlFor='fixedoption'>Payer will pay an amount calculated by a formula</label></dd>\n </dl>\n\n {calculated && renderFixedPaymentSettings()}\n </div>\n );\n }\n\n function renderPaymentAmount() {\n const flat = props.config.fixed && !props.config.calculated;\n\n return (\n <section>\n <h3 className='stepcreator-sectiontitle'>Payment amount</h3>\n\n <Well>\n <div className='stepoptions-settinggroup margin-bottom'>\n <input\n disabled={props.disabled}\n key={`${props.step.id}-flat`}\n type='radio'\n name='amount'\n defaultChecked={flat}\n onChange={configChanged}\n ref={flatRef}\n id='flatoption'\n />\n <dl className='optionselect'>\n <dt><label htmlFor='fixedoption'>Flat</label></dt>\n <dd><label htmlFor='fixedoption'>Payer will pay a flat amount</label></dd>\n </dl>\n\n {flat && renderFixedPaymentSettings()}\n </div>\n {renderCalculateOption()}\n\n <div className='stepoptions-settinggroup'>\n <input\n disabled={props.disabled}\n key={`${props.step.id}-variable`}\n type='radio'\n name='amount'\n defaultChecked={!props.config.fixed}\n onChange={configChanged}\n id='variableoption'\n />\n\n <dl className='optionselect'>\n <dt><label htmlFor='variableoption'>Payer determined</label></dt>\n <dd><label htmlFor='variableoption'>Payer will choose the amount they pay</label></dd>\n </dl>\n\n </div>\n </Well>\n </section>\n );\n }\n\n return (\n <div className='stepoptions'>\n <p>Applicant will be prompted to submit a payment.</p>\n\n {renderPaymentAmount()}\n {renderPaymentSettings()}\n </div>\n );\n};\n\nexport default EditPaymentView;\n","import React from 'react';\nimport Flash from 'components/shared/flash';\nimport EditPaymentView from './payment_details/edit-payment-view';\n\nclass PaymentStepDetails extends React.Component {\n checkInstructionsBlurred = (e) => {\n const newInstructions = e.currentTarget.value;\n const { id, config } = this.props.step;\n\n if (config.check_instructions === newInstructions) { return; }\n\n this.props.updateAttrs(id, {\n config_attributes: {\n check_instructions: newInstructions,\n },\n })\n .done(() => { Flash.success('Check instructions updated'); });\n };\n\n cashInstructionsBlurred = (e) => {\n const newInstructions = e.currentTarget.value;\n const { id, config } = this.props.step;\n\n if (config.cash_instructions === newInstructions) { return; }\n\n this.props.updateAttrs(id, {\n config_attributes: {\n cash_instructions: newInstructions,\n },\n })\n .done(() => { Flash.success('Cash instructions updated'); });\n };\n\n render() {\n return (\n <EditPaymentView\n configChanged={this.configChanged}\n updateAttrs={this.props.updateAttrs}\n checkInstructionsBlurred={this.checkInstructionsBlurred}\n cashInstructionsBlurred={this.cashInstructionsBlurred}\n masterTemplateId={this.props.masterTemplateId}\n config={this.props.step.config}\n disabled={this.props.disabled}\n step={this.props.step}\n />\n );\n }\n}\n\nexport default PaymentStepDetails;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport UserDisc from './user-disc';\nimport XClose from './x-close';\n\nconst Selection = (props) => {\n const renderRemoveLink = () => {\n if (props.disableRemoval) {\n return;\n }\n\n if (props.removeLinkText) {\n return (\n <span onClick={props.onRemove} className='personselection-custom-remove-link clickable'>{props.removeLinkText}</span>\n );\n }\n\n return (\n <XClose onClick={props.onRemove} buttonClass='margin-left inline-block' label='Remove person'/>\n );\n };\n\n return (\n <div className='personselection'>\n <UserDisc\n user={props.selection}\n className='margin-right'\n options={{\n showName: true,\n showAsCurrent: props.showAsCurrentUser,\n smallerAvatar: props.smallerAvatar,\n }}\n />\n\n {renderRemoveLink()}\n </div>\n );\n};\n\nSelection.propTypes = {\n selection: PropTypes.shape({}),\n showAsCurrentUser: PropTypes.bool,\n removeLinkText: PropTypes.string,\n disableRemoval: PropTypes.bool,\n smallerAvatar: PropTypes.bool,\n onRemove: PropTypes.func.isRequired,\n};\n\nexport default Selection;\n","import React, { useState, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport Flash from 'components/shared/flash';\nimport EmailValidator from 'modules/email-validator';\nimport ListOfPeople from 'components/shared/list-of-people';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\nimport { isEmpty, findWhere, debounce } from 'underscore';\n\nconst PersonSelector = (props) => {\n const [active, setActive] = useState(false);\n const [searchInput, setSearchInput] = useState('');\n const [searching, setSearching] = useState(false);\n const [searchResults, setSearchResults] = useState([]);\n const [inviteeName, setInviteeName] = useState('');\n\n function onClose() {\n setInviteeName('');\n setActive(false);\n }\n\n function onSendInvite() {\n if (inviteeName.length < 1) {\n Flash.error('Please enter a name');\n return;\n }\n\n sendInvite();\n }\n\n function sendInvite() {\n const email = searchInput;\n props.onInvite(email, inviteeName);\n\n onClose();\n }\n\n function onInviteeNameChanged(e) {\n setInviteeName(e.currentTarget.value);\n }\n\n function onInputChanged(e) {\n const newTerms = e.currentTarget.value;\n setSearchInput(newTerms);\n setSearching(true);\n\n if (isEmpty(newTerms) || newTerms.length < 2) {\n onClose();\n return;\n }\n\n setActive(true);\n\n search(newTerms);\n }\n\n const search = useCallback(debounce((newTerms) => {\n props.doSearch(newTerms)\n .done((r) => {\n setSearchResults(r);\n setSearching(false);\n })\n .fail(() => { Flash.error('Something went wrong.'); });\n }, 333), []);\n\n function existingMember(person) {\n if (props.attachableType == 'MasterTemplateMembership') {\n return findWhere(props.memberUsers, { user_id: person.id });\n }\n\n return findWhere(props.memberUsers, { id: person.id });\n }\n\n function onPersonSelect(person) {\n const existingAttachment = existingMember(person);\n if (!props.allowToggle && existingAttachment) {\n Flash.error('Member already added.');\n return;\n } if (existingAttachment) {\n props.onToggleOff(existingAttachment);\n } else {\n props.onSelect(person);\n }\n\n onClose();\n }\n\n function renderContent() {\n return (\n <CloseIfOutsideWrapper onClose={onClose}>\n <div id={props.id}>\n {renderSearchInput()}\n {active && renderSearchResults()}\n </div>\n </CloseIfOutsideWrapper>\n );\n }\n\n function renderSearchInput() {\n return (\n <input\n onFocus={onInputChanged}\n autoComplete='chrome-off'\n onChange={onInputChanged}\n style={props.inputStyle}\n className='search people margin-bottom'\n type='text'\n placeholder={props.placeholder}\n id={props.idForInput}\n />\n );\n }\n\n function renderSearchResults() {\n let content;\n if (searchResults.length > 0) {\n content = (\n <ListOfPeople\n users={searchResults}\n onSelect={onPersonSelect}\n hideExternal={props.hideExternal}\n />\n );\n } else if (searching) {\n content = 'Searching...';\n } else if (EmailValidator.validate(searchInput) && props.allowPseudo) {\n content = invitePrompt();\n } else {\n content = props.personNoFoundText || 'Nothing matches those search terms';\n }\n\n return (\n <div className='attachedpeople-manager search-results'>\n {content}\n </div>\n );\n }\n\n function invitePrompt() {\n return (\n <div>\n <p>We can't find that email address in our system. Add a name and we'll send them an invite.</p>\n <label>Name</label>\n <input type='text' value={inviteeName} onChange={onInviteeNameChanged} />\n <div className='btn-primary' onClick={onSendInvite}>\n Send invite to {inviteeName}\n </div>\n </div>\n );\n }\n\n return renderContent();\n};\n\nPersonSelector.propTypes = {\n hideExternal: PropTypes.bool.isRequired,\n allowPseudo: PropTypes.bool.isRequired,\n memberUsers: PropTypes.array,\n allowToggle: PropTypes.bool,\n onToggleOff: PropTypes.func,\n onClose: PropTypes.func,\n onInvite: PropTypes.func,\n placeholder: PropTypes.string,\n inputStyle: PropTypes.object,\n id: PropTypes.string,\n personNoFoundText: PropTypes.string,\n};\n\nPersonSelector.defaultProps = {\n placeholder: 'Type or paste an email, name or ClearForms username',\n};\n\nexport default PersonSelector;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { isNull } from 'underscore';\nimport Modal from './modal';\n\nconst Picker = (props) => {\n const [selected, setSelected] = useState(null);\n const [saving, setSaving] = useState(false);\n\n const onSelect = (id) => {\n setSelected(id);\n props.onSelect(id);\n };\n\n const isSelected = (id) => {\n return id === selected;\n };\n\n const getClassName = (id) => {\n return `icon-container ${isSelected(id) ? 'selected' : ''}`;\n };\n\n const getColumnClassName = () => {\n if (!props.columns || (props.columns < 2 || props.columns > 6)) {\n return 'picker-2';\n }\n return `picker-${props.columns}`;\n };\n\n const renderText = (item) => {\n if (item.description) {\n return (\n <dd>\n <strong>{item.title}</strong>\n <p>{item.description}</p>\n </dd>\n );\n }\n return (\n <dd>\n <span>{item.title}</span>\n </dd>\n );\n };\n\n const onSave = () => {\n setSaving(true);\n props.onSave().always(() => setSaving(false));\n };\n\n return (\n <Modal className={`picker ${getColumnClassName()} nopadding`} onOutsideClick={props.onClose}>\n <div className='picker-container'>\n <div className='picker-container-header'>\n <div className='title'>\n <h1>{props.title}</h1>\n </div>\n </div>\n <div className='picker-container-body'>\n <ul>\n {props.items.map((item) => {\n return (\n <li\n onClick={() => onSelect(item.id)}\n >\n <dl>\n <dt>\n <div className={getClassName(item.id)}>\n {item.icon}\n {isSelected(item.id) && (\n <div className='selectionbox'>\n <label className='checkbox'>\n <input value='true' type='checkbox' name='selected' checked={isSelected(item.id)} />\n <span />\n </label>\n </div>\n )}\n </div>\n </dt>\n {renderText(item)}\n </dl>\n </li>\n );\n })}\n </ul>\n </div>\n <div className='picker-container-footer'>\n <button type='button' onClick={props.onClose} className='btn-secondary'>Cancel</button>\n <button\n className={`btn-primary ${isNull(selected) ? 'disabled' : ''}`}\n disabled={(isNull(selected) || saving)}\n onClick={onSave}\n >\n {saving ? 'Working...' : props.saveTitle}\n </button>\n </div>\n </div>\n </Modal>\n );\n};\n\nPicker.propTypes = {\n title: PropTypes.string.isRequired,\n saveTitle: PropTypes.string.isRequired,\n onSelect: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n items: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.string.isRequired,\n title: PropTypes.string.isRequired,\n description: PropTypes.string,\n icon: PropTypes.shape({}).isRequired,\n })),\n columns: PropTypes.number,\n};\n\nexport default Picker;\n","/*\n Note January 2021\n\n This component replaces the older and crappier popup-button.jsx\n*/\n\nimport { useMemo, useEffect, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport { createPortal } from 'react-dom';\n\nconst Popdown = ({\n anchorRef,\n justify,\n className,\n scrollableElementId,\n scrollAgainstWindow,\n stretchAgainstAnchor,\n topOffset,\n children,\n}) => {\n const el = useMemo(() => {\n return document.createElement('div');\n }, []);\n\n const setPosition = useCallback(() => {\n // TODO: rename to anchorRef?\n const coords = anchorRef.current.getBoundingClientRect();\n el.style.top = `${coords.top + coords.height + topOffset}px`;\n\n let offset;\n switch (justify) {\n case 'left':\n offset = coords.left;\n break;\n case 'right':\n offset = window.innerWidth - coords.right;\n break;\n default:\n throw Error('Justify must be either left or right');\n }\n\n if (stretchAgainstAnchor) {\n el.style.width = `${coords.width}px`;\n }\n\n el.style[justify] = `${offset}px`;\n }, [anchorRef, el, justify]);\n\n const scrollableElement = useMemo(() => {\n if (!scrollableElementId) { return null; }\n return document.getElementById(scrollableElementId);\n }, [scrollableElementId]);\n\n useEffect(() => {\n window.addEventListener('resize', setPosition);\n\n if (scrollAgainstWindow) {\n window.addEventListener('scroll', setPosition);\n }\n\n if (scrollableElement) {\n scrollableElement.addEventListener('scroll', setPosition);\n }\n\n setPosition();\n\n return () => {\n window.removeEventListener('resize', setPosition);\n\n if (scrollAgainstWindow) {\n window.removeEventListener('scroll', setPosition);\n }\n\n if (scrollableElement) {\n scrollableElement.removeEventListener('scroll', setPosition);\n }\n };\n }, [setPosition]);\n\n useEffect(() => {\n el.classList.add('popdown');\n if (className) {\n className.split(' ').forEach((fragment) => { el.classList.add(fragment); });\n }\n }, [el, className]);\n\n useEffect(() => {\n if (!document.body.contains(el)) {\n document.body.appendChild(el);\n }\n return () => {\n // TODO: does this just remove it from the DOM,\n // or does this also destroy the element?\n // This might need to be a ref.\n el.remove();\n };\n }, [el]);\n\n return createPortal(children, el);\n};\n\nPopdown.propTypes = {\n anchorRef: PropTypes.shape({}).isRequired,\n className: PropTypes.string,\n justify: PropTypes.string,\n children: PropTypes.node,\n scrollableElementId: PropTypes.string,\n scrollAgainstWindow: PropTypes.bool,\n stretchAgainstAnchor: PropTypes.bool,\n topOffset: PropTypes.number,\n};\n\nPopdown.defaultProps = {\n justify: 'left',\n topOffset: 10,\n};\n\nexport default Popdown;\n","import React, { useMemo, useState, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { error as flashError } from 'components/shared/flash';\nimport pluralize from 'modules/pluralize';\nimport { disc as discStyle } from 'theme/discs';\nimport randomcolor from 'randomcolor';\nimport { isNull } from 'underscore';\nimport Popdown from 'components/shared/popdown';\nimport RoleAPI from 'apis/role-api';\nimport ListOfPeople from 'components/shared/list-of-people';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport { css } from '@emotion/react';\nimport useOnclickOutside from 'react-cool-onclickoutside';\n\nconst RoleDisc = ({ role }) => {\n const [showMembers, setShowMembers] = useState(false);\n const [roleMembers, setRoleMembers] = useState(null);\n\n const backgroundStyle = useMemo(() => {\n return {\n backgroundColor: randomcolor({\n hue: 'random',\n seed: role.id * 4,\n luminosity: 'dark',\n }),\n };\n }, [role.id]);\n\n const onMembersClick = () => {\n setShowMembers(!showMembers);\n\n if (!isNull(roleMembers)) { return; }\n\n RoleAPI.show(role.id)\n .done((loadedRole) => {\n setRoleMembers(loadedRole.users.map((attachment) => { return attachment.user; }));\n })\n .fail(() => {\n flashError();\n });\n };\n\n const membersContentRef = useRef();\n const elForAnchor = useRef();\n\n useOnclickOutside(() => {\n setShowMembers(false);\n }, { refs: [elForAnchor] });\n\n const renderMembersContent = () => {\n if (isNull(roleMembers)) {\n return <LoadingSpinner size='small' />;\n }\n\n return (\n <ListOfPeople users={roleMembers} />\n );\n };\n\n return (\n <div\n css={css`\n display:flex;\n align-items:center;\n `}\n >\n <div>\n <span\n css={discStyle}\n style={backgroundStyle}\n >\n {role.initials}\n </span>\n </div>\n\n <div className='margin-left-less'>\n <div>{role.name}</div>\n\n <div>\n <button\n className='btn-link'\n type='button'\n onClick={onMembersClick}\n ref={elForAnchor}\n >\n {role.user_count} role {pluralize('member', role.user_count)}\n </button>\n\n { showMembers && (\n <Popdown anchorRef={elForAnchor}>\n <div className='margins' ref={membersContentRef}>\n {renderMembersContent()}\n </div>\n </Popdown>\n )}\n </div>\n </div>\n </div>\n );\n};\n\nRoleDisc.propTypes = {\n role: PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string.isRequired,\n initials: PropTypes.string.isRequired,\n user_count: PropTypes.number.isRequired,\n }).isRequired,\n};\n\nexport default RoleDisc;\n","/*\n * This component provides a wrapper around react-select\n * that provides props that allow for our styling of the\n * component to take precedence.\n*/\nimport React from 'react';\nimport ReactSelect from 'react-select';\n\nconst noop = () => null;\nconst defaultComponents = { IndicatorSeparator: noop };\nconst Select = (props) => (\n <ReactSelect\n // You need both of these for things to work -\n // the className applies to the root, and the\n // prefix applies to all child stuff.\n classNamePrefix='react-select'\n className='react-select'\n components={ props.components || defaultComponents }\n ref={props.innerRef}\n inputId={props.id}\n {...props}\n styles={{\n control: (baseStyles) => ({\n ...baseStyles,\n borderColor: '#CBCECF',\n }),\n dropdownIndicator: (provided) => ({\n ...provided,\n color: '#0463B7',\n }),\n placeholder: (baseStyles) => ({\n ...baseStyles,\n color: '#727779',\n }),\n ...props.styles,\n }}\n isDisabled={props.disabled}\n />\n);\n\nexport default Select;\n","import React, { useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\nimport Shield from 'modules/shield';\n\nconst SideMenu = (props) => {\n useEffect(() => {\n Shield.on();\n }, []);\n\n const onClose = () => {\n if (props.onClose) {\n Shield.off();\n props.onClose();\n }\n };\n return (\n <CloseIfOutsideWrapper\n onClose={onClose}\n wrapperIgnoreClass={props.wrapperIgnoreClass}\n >\n <div className='sidemenu' ref={props.transitionRef}>\n <div className={`sidemenu-container ${props.position}`}>\n <div className='sidemenu-header'>\n <FontAwesomeIcon\n className='clickable margin-right'\n icon={icon({ name: 'xmark' })}\n style={{ color: '#0463B7', height: '1rem' }}\n onClick={onClose}\n />\n <h1>{props.title}</h1>\n </div>\n <div className='sidemenu-body'>\n {props.children}\n </div>\n <div className='sidemenu-footer'>\n <button type='button' className='btn-primary' onClick={onClose}>Close</button>\n </div>\n </div>\n </div>\n </CloseIfOutsideWrapper>\n );\n};\n\nSideMenu.propTypes = {\n title: PropTypes.string.isRequired,\n position: PropTypes.string,\n onClose: PropTypes.func.isRequired,\n wrapperIgnoreClass: PropTypes.arrayOf(PropTypes.string),\n transitionRef: PropTypes.shape({}),\n};\n\nSideMenu.defaultProps = {\n position: 'right',\n};\n\nexport default SideMenu;\n","import PropTypes from 'prop-types';\nimport React, { memo } from 'react';\nimport _ from 'underscore';\n\nconst SlidingToggle = memo((props) => {\n const DEFAULT_OPTIONS = {\n size: 'normal',\n };\n\n const options = _.extend(DEFAULT_OPTIONS, props.options);\n\n const handleClick = () => {\n if (!props.disabled) {\n props.onToggle();\n }\n };\n\n const labelClass = () => {\n return props.on ? 'on' : '';\n };\n\n const renderDescription = () => {\n if (!props.description) { return; }\n\n return (\n <div className='slidingtoggle-description'>\n {props.description}\n </div>\n );\n };\n\n const classes = () => {\n let classes = 'slidingtoggle cf';\n\n if (props.on) {\n classes += ' on';\n }\n\n if (props.disabled) {\n classes += ' disabled';\n }\n\n return classes;\n };\n\n const renderNestedContent = () => {\n if (!props.on || !props.children) { return; }\n\n return (\n <div className='stepoptions-nestedoption'>\n {props.children}\n </div>\n );\n };\n\n return (\n <>\n <label className={`slidingtoggle-wrap inline-block ${props.className} ${labelClass()}`}>\n <div>\n <span id={props.id} onClick={handleClick} className={`${props.disabled ? '' : 'clickable'} slidingtoggle-label`}>{props.label}</span>\n <span onClick={handleClick} className={classes()}>\n <span />\n </span>\n {renderDescription()}\n </div>\n </label>\n\n {renderNestedContent()}\n </>\n );\n});\n\nSlidingToggle.displayName = 'SlidingToggle';\n\nSlidingToggle.defaultProps = {\n disabled: false,\n label: '',\n className: '',\n id: '',\n};\n\nSlidingToggle.propTypes = {\n disabled: PropTypes.bool.isRequired,\n onToggle: PropTypes.func.isRequired,\n on: PropTypes.bool.isRequired,\n className: PropTypes.string,\n id: PropTypes.string,\n label: PropTypes.string,\n description: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),\n options: PropTypes.shape({\n size: PropTypes.string,\n }),\n};\n\nexport default SlidingToggle;\n","import React, { useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { icon as i } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport Picker from 'components/shared/picker';\nimport FlowStepActions from 'actions/flow-step-actions';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { getDataTypes } from 'modules/step-data-types';\nimport { isNull } from 'underscore';\n\nconst FIELD_ICONS = {\n string: <FontAwesomeIcon icon={i({ name: 'input-text' })} />,\n text: <FontAwesomeIcon icon={i({ name: 'align-left' })} />,\n email: <FontAwesomeIcon icon={i({ name: 'at' })} />,\n integer: <FontAwesomeIcon icon={i({ name: 'input-pipe' })} />,\n float: <FontAwesomeIcon icon={i({ name: 'input-numeric' })} />,\n money: <FontAwesomeIcon icon={i({ name: 'money-check-dollar' })} />,\n address: <FontAwesomeIcon icon={i({ name: 'map-pin' })} />,\n date_range: <FontAwesomeIcon icon={i({ name: 'calendar-days' })} />,\n date: <FontAwesomeIcon icon={i({ name: 'clock' })} />,\n multiple_choice: <FontAwesomeIcon icon={i({ name: 'list-check' })} />,\n checkboxes: <FontAwesomeIcon icon={i({ name: 'list-radio' })} />,\n file: <FontAwesomeIcon icon={i({ name: 'cloud-arrow-up' })} />,\n phone: <FontAwesomeIcon icon={i({ name: 'phone-office' })} />,\n entity: <FontAwesomeIcon icon={i({ name: 'brackets-curly' })} />,\n};\n\nconst NewFieldPicker = (props) => {\n const [fieldType, setFieldType] = useState(null);\n const items = useMemo(() => {\n if (isNull(props.stepType)) { return []; }\n return getDataTypes(props.stepType, { customEntities: props.customEntities })\n .map((dataType) => {\n const icon = FIELD_ICONS[dataType.type.split('-')[0]];\n return {\n id: dataType.type,\n title: dataType.name,\n icon,\n };\n });\n }, [props.customEntities, props.stepType]);\n const onFieldCreate = () => {\n return FlowStepActions.addData(props.sectionId, fieldType)\n .done(() => props.onClose());\n };\n\n return (\n <Picker\n title='Add Field'\n items={items}\n onSave={onFieldCreate}\n onSelect={setFieldType}\n onClose={props.onClose}\n columns={4}\n saveTitle='Add Field'\n />\n );\n};\n\nNewFieldPicker.propTypes = {\n sectionId: PropTypes.number.isRequired,\n stepType: PropTypes.string.isRequired,\n onClose: PropTypes.func.isRequired,\n customEntities: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n};\n\nexport default NewFieldPicker;\n","var MultipleChoiceOptionAPI = {\n create: function(stepDatumId){\n var url = '/step_data/' + stepDatumId + '/step_datum/multiple_choice_options';\n var request = $.ajax(url, {\n method: 'POST',\n dataType: 'json'\n });\n\n return request;\n },\n\n destroy: function(optionId){\n var url = '/step_datum/multiple_choice_options/' + optionId;\n var request = $.ajax(url, {\n method: 'DELETE',\n dataType: 'json'\n });\n\n return request;\n },\n\n destroyAll: (stepDatumId) => {\n const url = `/step_data/${stepDatumId}/multiple_choice_options/batch/`;\n const request = $.ajax(url, {\n method: 'DELETE',\n dataType: 'json'\n });\n\n return request;\n },\n\n update: function(optionId, optionAttrs){\n var url = '/step_datum/multiple_choice_options/' + optionId;\n var request = $.ajax(url, {\n data: {\n multiple_choice_option: optionAttrs\n },\n dataType: 'json',\n method: 'PUT'\n });\n\n return request;\n },\n\n reorder: function(optionId, position) {\n const url = `/step_datum/multiple_choice_options/${optionId}/reorder`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'PUT',\n data: {\n multiple_choice_option: {\n position\n }\n }\n });\n },\n\n upload: function(stepDatumId, optionFile){\n let url = `/step_data/${stepDatumId}/multiple_choice_options/batch/`;\n let formData = new FormData();\n\n formData.append('upload', optionFile, optionFile.name);\n\n let request = $.ajax(url, {\n data: formData,\n dataType: 'json',\n method: 'POST',\n contentType: false,\n processData: false\n });\n\n return request;\n }\n};\n\nexport default MultipleChoiceOptionAPI;\n","import NProgress from 'nprogress';\nimport Dispatcher from '../appdispatcher';\nimport API from '../apis/multiple-choice-option-api';\nimport Constants from '../constants/multiple-choice-option-constants';\nimport FlowStepActions from './flow-step-actions';\nimport Flash from '../components/shared/flash';\nimport AlertConfirm from '../modules/alert-confirm';\n\nfunction dispatchOptionAdd(stepDatumId, optionAttrs) {\n Dispatcher.dispatch({\n actionType: Constants.ADDED,\n stepDatumId,\n optionAttrs,\n });\n}\n\nfunction dispatchOptionDestroy(optionId) {\n Dispatcher.dispatch({\n actionType: Constants.DESTROYED,\n optionId,\n });\n}\n\nfunction dispatchOptionUpdate(optionId, optionAttrs) {\n Dispatcher.dispatch({\n actionType: Constants.UPDATED,\n optionId,\n optionAttrs,\n });\n}\n\nconst MultipleChoiceOptionActions = {\n\n addOption(stepDatumId) {\n return API.create(stepDatumId)\n .done((res) => dispatchOptionAdd(stepDatumId, res));\n },\n\n removeOption(optionId) {\n return API.destroy(optionId)\n .done(() => dispatchOptionDestroy(optionId));\n },\n\n updateOption(optionId, optionAttrs) {\n NProgress.start();\n\n return API.update(optionId, optionAttrs)\n .done(() => dispatchOptionUpdate(optionId, optionAttrs))\n .fail((response) => { Flash.error(response.responseJSON.error); })\n .always(() => { NProgress.done(); });\n },\n\n reorderOption(optionId, newPos) {\n return API.reorder(optionId, newPos)\n .done((res) => {\n Dispatcher.dispatch({\n actionType: Constants.MOVED,\n options: res,\n });\n })\n .fail(() => { Flash.error(); });\n },\n\n destroyAll(stepDatumId) {\n NProgress.start();\n\n AlertConfirm.confirm('Delete all options', 'Are you sure you want to delete all multiple choice options for this field?', () => {\n return API.destroyAll(stepDatumId)\n .done(() => {\n FlowStepActions.refreshStepData(stepDatumId).done(NProgress.done);\n })\n .fail(() => { Flash.error(); });\n });\n },\n\n uploadOptions(stepDatumId, optionFile) {\n NProgress.start();\n\n return API.upload(stepDatumId, optionFile)\n .done((res) => {\n Flash.success(`Successfully added ${res.length} options`);\n FlowStepActions.refreshStepData(stepDatumId).done(NProgress.done);\n })\n .fail(() => {\n AlertConfirm.alert('Upload Failed', 'We were unable to process your upload. Click <a target=\"__blank\" href=\"https://support.cleargov.com/hc/en-us/articles/20914284325651-Uploading-a-CSV-file-of-Multiple-Choice-Options-in-a-Collect-Record-Information-Step-\">here</a> to learn how to properly format your CSV file.');\n NProgress.done();\n });\n },\n};\n\nexport default MultipleChoiceOptionActions;\n","import PropTypes from 'prop-types';\nimport React, {\n useRef, useMemo, useState, useEffect,\n} from 'react';\nimport { Draggable } from 'react-beautiful-dnd';\nimport { debounce } from 'underscore';\n\nimport Actions from 'actions/multiple-choice-option-actions';\n\nconst MultipleChoiceOption = ({\n option,\n optionNumber,\n shouldFocus,\n formulaValuesEnabled,\n onOptionChange,\n onDeleteFail,\n canDelete,\n disabled,\n index,\n}) => {\n const displayValueInputRef = useRef();\n const [displayValue, setDisplayValue] = useState(option.name || '');\n const [numericValue, setNumericValue] = useState(option.numeric_value ?? '');\n\n const debouncedSendValueUpdate = useMemo(\n () => debounce((id, attrs) => {\n onOptionChange(id, attrs).fail(() => setDisplayValue(option.name || ''));\n }, 500),\n [option, onOptionChange],\n );\n const debouncedSendNumericUpdate = useMemo(\n () => debounce((id, attrs) => {\n onOptionChange(id, attrs).fail(() => setNumericValue(option.numeric_value ?? ''));\n }, 500),\n [option, onOptionChange],\n );\n\n useEffect(() => {\n if (shouldFocus) {\n displayValueInputRef.current.focus();\n }\n }, [shouldFocus]);\n\n useEffect(() => {\n // TODO: this might flap\n setNumericValue(option.numeric_value ?? '');\n }, [option]);\n\n const deleteClicked = () => {\n Actions.removeOption(option.id)\n .fail(onDeleteFail);\n };\n\n const onDisplayValueChange = (e) => {\n const { value } = e.target;\n setDisplayValue(value);\n debouncedSendValueUpdate(option.id, { name: value });\n };\n\n const onNumericValueChange = (e) => {\n const { value } = e.target;\n setNumericValue(value);\n debouncedSendNumericUpdate(option.id, { numeric_value: value });\n };\n\n return (\n <Draggable draggableId={`option-${option.id}`} index={index}>\n {({ innerRef, draggableProps, dragHandleProps }) => (\n <div className='fieldmanager-inputwrap' ref={innerRef} {...draggableProps}>\n <div className='fieldmanager-multiplechoice-left'>\n <input\n type='text'\n ref={displayValueInputRef}\n onChange={onDisplayValueChange}\n value={displayValue}\n disabled={disabled}\n placeholder={`Option ${optionNumber}`}\n name={`option-${option.id}`}\n />\n </div>\n <div className='fieldmanager-multiplechoice-right flex'>\n {formulaValuesEnabled && (\n <div className='fieldmanager-numericvalue'>\n <input\n value={numericValue}\n onChange={onNumericValueChange}\n disabled={disabled}\n type='number'\n />\n </div>\n )}\n <div className='fieldmanager-choicetools'>\n <a className='fieldmanager-mcoption-sort' {...dragHandleProps} />\n {canDelete && (\n <a className='fieldmanager-mcoption-delete' onClick={deleteClicked} />\n )}\n </div>\n </div>\n </div>\n )}\n </Draggable>\n );\n};\n\nMultipleChoiceOption.propTypes = {\n onDeleteFail: PropTypes.func.isRequired,\n canDelete: PropTypes.bool.isRequired,\n option: PropTypes.object.isRequired,\n disabled: PropTypes.bool.isRequired,\n optionNumber: PropTypes.number.isRequired,\n shouldFocus: PropTypes.bool.isRequired,\n onOptionChange: PropTypes.func.isRequired,\n formulaValuesEnabled: PropTypes.bool.isRequired,\n index: PropTypes.number.isRequired,\n};\n\nexport default MultipleChoiceOption;\n","import React, { useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { DragDropContext, Droppable } from 'react-beautiful-dnd';\n\nimport Actions from 'actions/multiple-choice-option-actions';\nimport useDerivedState from 'components/hooks/use-derived-state';\nimport { reorder } from 'modules/dnd-utils';\nimport FileInput from 'components/shared/file-input';\nimport MultipleChoiceOption from './multiple-choice-option';\n\n// This component is used for both Multiple Choice and Checkboxes\nconst MultipleChoices = ({\n options, disabled, onOptionChange, stepDatum, onDeleteFail,\n}) => {\n const [newElements, setNewElements] = useState(false);\n const [formulaValuesEnabled, setFormulaValuesEnabled] = useState(\n options.some((option) => option.numeric_value !== null),\n );\n const sortedOptionsFromProps = useMemo(\n () => options.sort((a, b) => (a.position - b.position)),\n [options],\n );\n const [orderedOptions, setOrderedOptions] = useDerivedState(sortedOptionsFromProps);\n\n // need to find the first option that has a non numeric display value that is not null\n const findTestOption = () => options.find((option) => (option.name && Number.isNaN(option.name)));\n\n // This is a weird way of doing this.\n const removeNumericValues = () => {\n options.forEach((option) => {\n onOptionChange(option.id, { numeric_value: null });\n });\n };\n\n const onDragEnd = ({ source, destination }) => {\n if (!destination) {\n return;\n }\n if (destination.index === source.index) {\n return;\n }\n setOrderedOptions((oldOptions) => reorder(\n oldOptions,\n source.index,\n destination.index,\n ));\n const draggedOptionId = orderedOptions[source.index].id;\n const newPosition = destination.index + 1;\n Actions.reorderOption(draggedOptionId, newPosition)\n .fail(() => setOrderedOptions(orderedOptions));\n };\n\n const clearMultipleChoiceOptions = (e) => {\n e.preventDefault();\n Actions.destroyAll(stepDatum.id);\n };\n\n const uploadMultipleChoices = (e) => (\n Actions.uploadOptions(stepDatum.id, e.currentTarget.files[0])\n );\n\n const removeFormulaValues = (e) => {\n e.preventDefault();\n setFormulaValuesEnabled(false);\n // first test that disabling formula values won't break a formula\n const testOption = findTestOption();\n if (testOption) {\n onOptionChange(testOption.id, { numeric_value: null })\n // on success remove all the numeric values\n .done(removeNumericValues)\n // on failure, reenable the formula values component\n .fail(() => setFormulaValuesEnabled(true));\n } else {\n // if there is no testOption, then all the display values are numeric or null\n // and the numeric values can be safely removed\n removeNumericValues();\n }\n };\n\n // Basically undoing the sort, and without something\n // telling you the position on the object.\n const indexOfOption = (option) => {\n return options.indexOf(option) + 1;\n };\n\n const canDelete = useMemo(() => {\n if (disabled) { return false; }\n\n switch (stepDatum.data_type) {\n case 'multiple_choice':\n return options.length > 2;\n case 'checkboxes':\n return options.length > 1;\n default:\n throw new Error(`Unhandled data_type ${stepDatum.data_type}`);\n }\n }, [stepDatum.data_type, options.length]);\n\n // There's probably a better way to do this.\n // It's really just saying \"focus the last thing\"\n const optionNeedsFocus = (option) => {\n return (option.id === options.slice(-1)[0].id) && newElements;\n };\n\n const fakeActionClicked = () => {\n setNewElements(true);\n Actions.addOption(stepDatum.id);\n };\n\n const inputsClass = formulaValuesEnabled ? 'fullwidth' : 'fieldmanager-multiplechoice-left';\n return (\n <div className='fieldmanager-multiplechoices'>\n {formulaValuesEnabled && (\n <div className='fieldmanager-multiplechoicelabels'>\n <span className='fieldmanager-multiplechoice-left'>\n <label>Display value</label>\n </span>\n\n <span className='fieldmanager-multiplechoice-right'>\n <label>Numeric value</label>\n </span>\n </div>\n )}\n <div className='fieldmanager-multiplechoices-maincontent'>\n\n <DragDropContext\n onDragEnd={onDragEnd}\n >\n <Droppable droppableId={`multipleChoiceDroppable-${stepDatum.id}`}>\n {({ innerRef, droppableProps, placeholder }) => (\n <div className={inputsClass} ref={innerRef} {...droppableProps}>\n <span>\n {orderedOptions.map((optionData, index) => (\n <MultipleChoiceOption\n key={optionData.id}\n index={index}\n option={optionData}\n optionNumber={indexOfOption(optionData)}\n canDelete={canDelete}\n shouldFocus={optionNeedsFocus(optionData)}\n onOptionChange={onOptionChange}\n onDeleteFail={onDeleteFail}\n disabled={disabled}\n formulaValuesEnabled={formulaValuesEnabled}\n dataType={stepDatum.data_type}\n />\n ))}\n {placeholder}\n </span>\n {!disabled && (\n <div onFocus={fakeActionClicked} className='fieldmanager-inputwrap fake'>\n {/* TODO: there should be a way to do this \"click for new option\"\n concept without focus manipulation, and in a way that preserves\n the input so that the user's focus isn't jumping. */}\n <input\n name='newoption'\n key={`Option ${options.length + 1}`}\n readOnly\n type='text'\n value={`Option ${options.length + 1}`}\n />\n </div>\n )}\n </div>\n )}\n </Droppable>\n </DragDropContext>\n {!formulaValuesEnabled && (\n <div className='fieldmanager-multiplechoice-right align-center'>\n <a\n className='secondary fieldmanager-formulavaluelink'\n href='#'\n onClick={(e) => {\n e.preventDefault();\n setFormulaValuesEnabled(true);\n }}\n >Set Formula Values\n </a>\n </div>\n )}\n </div>\n <div className='align-left' style={{ display: 'inline-flex' }}>\n <a\n href='#'\n className={`margin-right-less secondary${disabled ? ' disabled' : ''}`}\n onClick={clearMultipleChoiceOptions}\n >\n Clear all\n </a>\n\n <FileInput onChange={uploadMultipleChoices} disabled={disabled} fileType='text/csv' />\n </div>\n {formulaValuesEnabled && (\n <div className='align-right'>\n <a className='secondary' href='#' onClick={removeFormulaValues}>Remove Formula Values</a>\n </div>\n )}\n </div>\n );\n};\n\nMultipleChoices.propTypes = {\n options: PropTypes.array.isRequired,\n disabled: PropTypes.bool.isRequired,\n stepDatum: PropTypes.object.isRequired,\n onDeleteFail: PropTypes.func.isRequired,\n onOptionChange: PropTypes.func.isRequired,\n};\n\nexport default MultipleChoices;\n","import React, { useState, useEffect } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport PropTypes from 'prop-types';\nimport { validateNumberFormat } from 'modules/collected-data-validator';\nimport AdvancedLabel from 'components/shared/advanced-label';\nimport { debounce as d } from 'underscore';\n\nconst NumericSettings = ({\n stepDatum,\n onDataChanged,\n onLimitChanged,\n}) => {\n const [minValue, setMinValue] = useState(stepDatum.min_value || '');\n const [maxValue, setMaxValue] = useState(stepDatum.max_value || '');\n const debouncedOnDataChanged = d(onDataChanged, 500);\n\n useEffect(() => {\n if (stepDatum.min_value !== minValue) {\n if (validateMinValue(minValue)) {\n updateValue({ min_value: minValue }, true);\n }\n }\n }, [maxValue]);\n\n useEffect(() => {\n if (stepDatum.max_value !== maxValue) {\n if (validateMaxValue(maxValue)) {\n updateValue({ max_value: maxValue }, true);\n }\n }\n }, [minValue]);\n\n const validateMinValue = (value = minValue) => {\n let min = value;\n let max = maxValue;\n if (min === '') { return true; }\n if (!validateNumberFormat(min, stepDatum)) { return false; }\n if (!validateNumberFormat(max, stepDatum)) { return true; }\n min = parseFloat(min);\n max = parseFloat(max);\n return min <= max;\n };\n\n const validateMaxValue = (value = maxValue) => {\n let min = minValue;\n let max = value;\n if (max === '') { return true; }\n if (!validateNumberFormat(max, stepDatum)) { return false; }\n if (!validateNumberFormat(min, stepDatum)) { return true; }\n min = parseFloat(min);\n max = parseFloat(max);\n return min <= max;\n };\n\n const updateValue = (attrs, debounce = false) => {\n const call = debounce ? debouncedOnDataChanged : onDataChanged;\n call(\n attrs,\n () => {\n onLimitChanged();\n },\n );\n };\n\n const onMinValueChanged = (e) => {\n const { value } = e.target;\n setMinValue(value);\n\n if (validateMinValue(value)) {\n updateValue({ min_value: value }, true);\n }\n };\n\n const onMinValueClear = (e) => {\n e.preventDefault();\n setMinValue('');\n updateValue({ min_value: '' });\n };\n\n const onMaxValueChanged = (e) => {\n const { value } = e.target;\n setMaxValue(value);\n if (validateMaxValue(value)) {\n updateValue({ max_value: value }, true);\n }\n };\n\n const onMaxValueClear = (e) => {\n e.preventDefault();\n setMaxValue('');\n updateValue({ max_value: '' });\n };\n\n return (\n <>\n <tr>\n <td>\n <AdvancedLabel\n label='Min Value'\n />\n </td>\n <td>\n <div className='inline-block'>\n <input\n id='minvalue'\n className={`fieldmanager-minvalue ${!validateMinValue() ? 'invalid' : ''}`}\n type='text'\n name='minvalue'\n value={minValue}\n onChange={onMinValueChanged}\n placeholder='Add a minimum'\n />\n </div>\n <FontAwesomeIcon\n icon={icon({ name: 'trash' })}\n className='clear-button margin-left'\n onClick={onMinValueClear}\n title='Clear Min Value'\n />\n { !validateMinValue() && (\n <div className='fieldmanager-invalidfield'>\n Invalid min value\n </div>\n )}\n </td>\n </tr>\n <tr>\n <td>\n <AdvancedLabel\n label='Max Value'\n />\n </td>\n <td>\n <div className='inline-block'>\n <input\n id='maxvalue'\n className={`fieldmanager-maxvalue ${!validateMaxValue() ? 'invalid' : ''}`}\n type='text'\n name='maxvalue'\n value={maxValue}\n onChange={onMaxValueChanged}\n placeholder='Add a maximum'\n />\n </div>\n <FontAwesomeIcon\n icon={icon({ name: 'trash' })}\n className='clear-button margin-left'\n onClick={onMaxValueClear}\n title='Clear Max Value'\n />\n { !validateMaxValue() && (\n <div className='fieldmanager-invalidfield'>\n Invalid max value\n </div>\n )}\n </td>\n </tr>\n </>\n );\n};\n\nNumericSettings.propTypes = {\n stepDatum: PropTypes.shape({\n min_value: PropTypes.string.isRequired,\n max_value: PropTypes.string.isRequired,\n }),\n onDataChanged: PropTypes.func.isRequired,\n onLimitChanged: PropTypes.func.isRequired,\n};\n\nexport default NumericSettings;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport AdvancedLabel from 'components/shared/advanced-label';\nimport SlidingToggle from 'components/shared/sliding-toggle';\n\nconst AdvancedSettings = ({\n required,\n redacted,\n lockOnRenewal,\n autofillEnabled,\n autofillOnRenewal,\n onDataChanged,\n}) => {\n const onRequiredChange = () => {\n onDataChanged({ required: !required });\n };\n\n const onRedactedChange = () => {\n onDataChanged({ redacted: !redacted });\n };\n\n const onToggleLockOnRenewal = () => {\n onDataChanged({ lock_on_renewal: !lockOnRenewal });\n };\n\n const onToggleAutofillOnRenewal = () => {\n onDataChanged({ autofill_on_renewal: !autofillOnRenewal });\n };\n\n const renderLockOnRenewal = () => {\n return (\n <div className='fieldmanager-advancedsettings-lockonrenewal'>\n <SlidingToggle\n onToggle={onToggleLockOnRenewal}\n on={lockOnRenewal}\n label='Lock when renewal'\n className='margin-right'\n />\n </div>\n );\n };\n\n const renderAutofillOnRenewal = () => {\n const toggleValue = autofillEnabled ? autofillOnRenewal : false;\n const title = 'To enable this setting, turn on Renewal autofilling in the Outputs settings';\n return (\n <div className='fieldmanager-advancedsettings-autofillonrenewal padding-top' {...!autofillEnabled && { title }}>\n <SlidingToggle\n onToggle={onToggleAutofillOnRenewal}\n on={toggleValue}\n label='Autofill when renewal'\n className='margin-right'\n disabled={!autofillEnabled}\n />\n </div>\n );\n };\n\n return (\n <>\n <tr>\n <td>\n <AdvancedLabel\n label='Required'\n />\n </td>\n <td>\n <SlidingToggle\n onToggle={onRequiredChange}\n on={required}\n label='Applicant is required to enter information'\n className='margin-right'\n />\n </td>\n </tr>\n <tr>\n <td>\n <AdvancedLabel\n label='Open Data'\n required\n helperText='Defines if the field is visible to the public in your open data portal'\n />\n </td>\n <td>\n <SlidingToggle\n onToggle={onRedactedChange}\n on={!redacted}\n label='Included in public Open Data'\n />\n </td>\n </tr>\n <tr className='with-divider'>\n <td>\n <AdvancedLabel\n label='Renewals'\n />\n </td>\n <td>\n {renderLockOnRenewal()}\n {renderAutofillOnRenewal()}\n </td>\n </tr>\n </>\n );\n};\n\nAdvancedSettings.propTypes = {\n redacted: PropTypes.bool.isRequired,\n required: PropTypes.bool.isRequired,\n lockOnRenewal: PropTypes.bool.isRequired,\n autofillEnabled: PropTypes.bool.isRequired,\n autofillOnRenewal: PropTypes.bool,\n onDataChanged: PropTypes.func.isRequired,\n};\n\nexport default AdvancedSettings;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst NoNegativesInput = (props) => {\n const {\n onChange, id, style, value, name, klass, allowZero,\n } = props;\n\n const onInputChange = (e) => {\n // Prevent negatives\n let { value } = e.target;\n if (!!e.target.value && Math.abs(e.target.value) >= 1) {\n value = Math.abs(e.target.value);\n } else if (!!e.target.value && e.target.value == 0) {\n value = 0;\n } else {\n value = '';\n }\n\n onChange(value);\n };\n\n return (\n <input\n type='number'\n className={klass}\n min={`${allowZero ? 0 : 1}`}\n value={value}\n style={style}\n id={id}\n onChange={onInputChange}\n name={name}\n />\n );\n};\n\nNoNegativesInput.propTypes = {\n onChange: PropTypes.func.isRequired,\n id: PropTypes.string,\n style: PropTypes.shape({}),\n value: PropTypes.oneOfType([\n PropTypes.number,\n PropTypes.string,\n ]),\n name: PropTypes.string,\n klass: PropTypes.string,\n allowZero: PropTypes.bool,\n};\n\nNoNegativesInput.defaultProps = {\n id: '',\n style: {},\n value: '',\n klass: '',\n};\n\nexport default NoNegativesInput;\n","import React, { useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport PropTypes from 'prop-types';\nimport AdvancedLabel from 'components/shared/advanced-label';\nimport NoNegativesInput from 'components/shared/no-negatives-input';\n\nconst TextSettings = ({ maxLength, onDataChanged }) => {\n const [maxLengthValue, setMaxLengthValue] = useState(maxLength);\n\n const onMaxLengthChanged = (value) => {\n setMaxLengthValue(value);\n // If its 0 we dont want to send it because we assume they are editing and it shouldnt be saved\n if (value === 0) { return; }\n onDataChanged({ max_length: value });\n };\n\n const onMaxLengthClear = (e) => {\n e.preventDefault();\n setMaxLengthValue('');\n onDataChanged({ max_length: '' });\n };\n\n return (\n <tr>\n <td>\n <AdvancedLabel\n label='Max Length'\n />\n </td>\n <td>\n <div className='inline-block'>\n <NoNegativesInput\n type='number'\n min='1'\n klass='fieldmanager-maxlength'\n onChange={onMaxLengthChanged}\n value={maxLengthValue}\n name='maxlength'\n />\n </div>\n <FontAwesomeIcon\n icon={icon({ name: 'trash' })}\n className='clear-button margin-left'\n onClick={onMaxLengthClear}\n title='Clear Max Length'\n />\n </td>\n </tr>\n );\n};\n\nTextSettings.propTypes = {\n maxLength: PropTypes.number,\n onDataChanged: PropTypes.func.isRequired,\n};\n\nexport default TextSettings;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport AdvancedLabel from 'components/shared/advanced-label';\nimport Select from 'components/shared/select';\n\nconst dateFormatOptions = [\n { value: 'date', label: 'Date Only' },\n { value: 'date_time', label: 'Time & Date' },\n { value: 'time', label: 'Time Only' },\n];\n\nconst dateRangeFormatOptions = [\n { value: 'date', label: 'Date Only' },\n { value: 'time', label: 'Time Only' },\n];\n\nconst DateSettings = ({\n dateRangeStartLabel,\n dateRangeEndLabel,\n dataType,\n dateType,\n onDataChanged,\n}) => {\n const isRange = dataType === 'date_range';\n const options = isRange ? dateRangeFormatOptions : dateFormatOptions;\n const onDateFormatChange = ({ value }) => {\n onDataChanged({ date_type: value });\n };\n\n const onStartDateLabelChange = (e) => {\n onDataChanged({ date_range_start_label: e.currentTarget.value });\n };\n\n const onEndDateLabelChange = (e) => {\n onDataChanged({ date_range_end_label: e.currentTarget.value });\n };\n\n const renderDateRangeLabels = () => {\n return (\n <>\n <tr>\n <td>\n <AdvancedLabel\n label='Start Date Label'\n required\n />\n </td>\n <td>\n <div className='inline-block'>\n <input\n id='start_date'\n name='start_date'\n type='text'\n defaultValue={dateRangeStartLabel || 'Start Date'}\n className='fieldmanager-dateinput'\n onChange={onStartDateLabelChange}\n />\n </div>\n </td>\n </tr>\n <tr>\n <td>\n <AdvancedLabel\n label='End Date Label'\n required\n />\n </td>\n <td>\n <div className='inline-block'>\n <input\n id='start_date'\n name='start_date'\n type='text'\n defaultValue={dateRangeEndLabel || 'End Date'}\n className='fieldmanager-dateinput'\n onChange={onEndDateLabelChange}\n />\n </div>\n </td>\n </tr>\n </>\n );\n };\n\n return (\n <>\n <tr>\n <td>\n <AdvancedLabel\n label='Format'\n required\n />\n </td>\n <td>\n <div className='inline-block'>\n <Select\n value={options.find(({ value }) => value === dateType)}\n options={options}\n onChange={onDateFormatChange}\n styles={{\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n }),\n }}\n />\n </div>\n </td>\n </tr>\n {isRange && renderDateRangeLabels() }\n </>\n );\n};\n\nDateSettings.propTypes = {\n dateRangeStartLabel: PropTypes.string,\n dateRangeEndLabel: PropTypes.string,\n dataType: PropTypes.string.isRequired,\n dateType: PropTypes.string.isRequired,\n onDataChanged: PropTypes.func.isRequired,\n};\n\nexport default DateSettings;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport AdvancedLabel from 'components/shared/advanced-label';\nimport NoNegativesInput from 'components/shared/no-negatives-input';\n\nconst CheckboxSettings = ({ numberOfOptions, minNumberOfChecks, onDataChanged }) => {\n const [minNumChecks, setMinNumChecks] = useState(minNumberOfChecks);\n\n const onMinChecksChange = (value) => {\n setMinNumChecks(value);\n if (value <= numberOfOptions) {\n onDataChanged({ min_num_checks: value });\n }\n };\n\n const validateMinNumChecks = () => {\n return minNumChecks <= numberOfOptions;\n };\n\n return (\n <tr>\n <td>\n <AdvancedLabel\n label='Minimum Number Of Selections'\n required\n />\n </td>\n <td>\n <NoNegativesInput\n type='number'\n onChange={onMinChecksChange}\n klass={`${!validateMinNumChecks() ? 'invalid' : ''}`}\n value={minNumChecks}\n name='minchecks'\n allowZero\n />\n {!validateMinNumChecks() && (\n <div className='fieldmanager-invalidfield'>\n Cannot be greater than the number of available selections\n </div>\n )}\n </td>\n </tr>\n );\n};\n\nCheckboxSettings.propTypes = {\n numberOfOptions: PropTypes.number.isRequired,\n minNumberOfChecks: PropTypes.number.isRequired,\n onDataChanged: PropTypes.func.isRequired,\n};\n\nexport default CheckboxSettings;\n","import React, {\n useState, useMemo,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport { success } from 'components/shared/flash';\nimport MultipleChoiceOptionActions from 'actions/multiple-choice-option-actions';\nimport Select from 'components/shared/select';\nimport { validate } from 'modules/collected-data-validator';\nimport SlidingToggle from 'components/shared/sliding-toggle';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport AdvancedLabel from 'components/shared/advanced-label';\nimport { debounce } from 'underscore';\nimport NumericSettings from './settings/numeric-settings';\nimport AdvancedSettings from './settings/advanced-settings';\nimport TextSettings from './settings/text-settings';\nimport DateSettings from './settings/date-settings';\nimport CheckboxSettings from './settings/checkbox-settings';\n\nconst TYPES_WITH_DEFAULTS = [\n 'string',\n 'integer',\n 'float',\n 'email',\n 'phone',\n 'money',\n 'multiple_choice',\n];\n\nconst TYPES_WITH_TYPE_SPECIFIC_SETTINGS = [\n 'string',\n 'text',\n 'checkboxes',\n 'integer',\n 'float',\n 'money',\n 'date',\n 'date_range',\n];\n\nconst FieldSettings = ({\n stepDatum,\n onDataChanged,\n multipleChoiceOptions,\n fieldName,\n autofillEnabled,\n children,\n}) => {\n const canConfigureDefault = TYPES_WITH_DEFAULTS.includes(stepDatum.data_type);\n const hasTypeSpecificSettings = TYPES_WITH_TYPE_SPECIFIC_SETTINGS.includes(stepDatum.data_type);\n\n const [defaultValue, setDefaultValue] = useState(stepDatum.default || '');\n const [defaultOptionId, setDefaultOptionId] = useState(multipleChoiceOptions\n .find((option) => option.is_default === true)?.id || null);\n const [entityCreateable, setEntityCreateable] = useState(stepDatum.entity_createable);\n const [open, setOpen] = useState(false);\n\n const canAllowNewEntity = useMemo(() => {\n return stepDatum.data_type.startsWith('entity')\n && stepDatum.custom_entity\n && stepDatum.custom_entity.type !== 'EsriCustomEntity';\n }, [stepDatum.data_type, stepDatum.custom_entity]);\n\n const debouncedOnDataChanged = debounce(onDataChanged, 500);\n\n const validateDefault = () => {\n if ([null, ''].includes(defaultValue)) { return true; }\n return validate(defaultValue, stepDatum);\n };\n\n const defaultInput = () => {\n const options = multipleChoiceOptions\n .map(({ id, name }) => ({ value: id, label: name }));\n const input = (stepDatum.data_type === 'multiple_choice')\n ? (\n <Select\n id='default'\n options={options}\n // the || null here lets it be clearable.\n value={options.find(({ value }) => value === defaultOptionId) || null}\n onChange={onDefaultSelect}\n placeholder='Select default option'\n styles={{\n container: (provided) => ({\n ...provided,\n minWidth: '12rem',\n }),\n }}\n />\n )\n : (\n <input\n id='default'\n className={`fieldmanager-defaultfield ${!validateDefault() ? 'invalid' : ''}`}\n type={getDefaultInputType()}\n name='default'\n value={defaultValue}\n placeholder='Add a default'\n onChange={onDefaultChange}\n />\n );\n\n return (\n <>\n <div className='inline-block'>{input}</div>\n <FontAwesomeIcon\n icon={icon({ name: 'trash' })}\n className='clear-button margin-left'\n onClick={onDefaultClear}\n title='Clear Default'\n />\n </>\n );\n };\n\n const toggleAdvancedSettings = () => {\n setOpen(!open);\n };\n\n const onDefaultChange = (e) => {\n const { value } = e.currentTarget;\n setDefaultValue(value);\n debouncedOnDataChanged({ default: value });\n };\n\n const onDefaultClear = (e) => {\n e.preventDefault();\n\n // Multiple choice fields don't use the same\n // database info to determine defaults\n\n if (stepDatum.data_type === 'multiple_choice') {\n if (!defaultOptionId) { return; }\n\n MultipleChoiceOptionActions.updateOption(Number(defaultOptionId), {\n is_default: false,\n }).done(() => {\n setDefaultOptionId(null);\n success('Default option cleared');\n });\n } else {\n setDefaultValue('');\n onDataChanged({ default: '' });\n }\n };\n\n const getDefaultInputType = () => {\n switch (stepDatum.data_type) {\n case 'email':\n return 'email';\n case 'phone':\n return 'tel';\n default:\n return 'text';\n }\n };\n\n const onDefaultSelect = ({ value }) => {\n MultipleChoiceOptionActions.updateOption(Number(value), {\n is_default: true,\n }).done(() => {\n setDefaultOptionId(multipleChoiceOptions\n .find((option) => option.id === value).id);\n success('Default option updated');\n });\n };\n const renderDefaultIsInvalidWarning = () => {\n if (!validateDefault()) {\n return (\n <div className='fieldmanager-invalidfield'>\n Invalid default value\n </div>\n );\n }\n };\n\n const onEntityCreatableChanged = () => {\n onDataChanged(\n { entity_createable: !entityCreateable },\n () => {\n setEntityCreateable(!entityCreateable);\n },\n );\n };\n\n const renderTypeSpecificSettings = () => {\n switch (stepDatum.data_type) {\n case 'text':\n case 'string':\n return (\n <TextSettings\n maxLength={stepDatum.max_length || ''}\n onDataChanged={debouncedOnDataChanged}\n />\n );\n case 'checkboxes':\n return (\n <CheckboxSettings\n numberOfOptions={multipleChoiceOptions.length}\n minNumberOfChecks={stepDatum.min_num_checks}\n onDataChanged={onDataChanged}\n />\n );\n case 'integer':\n case 'float':\n case 'money':\n return (\n <NumericSettings\n stepDatum={stepDatum}\n onDataChanged={onDataChanged}\n onLimitChanged={validateDefault}\n />\n );\n case 'date':\n case 'date_range':\n return (\n <DateSettings\n dateRangeStartLabel={stepDatum.date_range_start_label}\n dateRangeEndLabel={stepDatum.date_range_end_label}\n dateType={stepDatum.date_type}\n dataType={stepDatum.data_type}\n onDataChanged={onDataChanged}\n />\n );\n default:\n throw Error(`Unhandled data type ${stepDatum.data_type}`);\n }\n };\n const renderCustomEntitySettings = () => {\n return (\n <tr>\n <td>\n <AdvancedLabel\n label='Custom Entity'\n />\n </td>\n <td>\n <div className='margin-top'>\n <SlidingToggle\n onToggle={onEntityCreatableChanged}\n on={entityCreateable}\n label={`Allow applicant to create a new ${fieldName}`}\n />\n </div>\n </td>\n </tr>\n );\n };\n\n function renderToggle () {\n const iconClass = open ? 'flip-y' : '';\n\n return (\n <div className='fieldmanager-advancedsettingstoggle'>\n <button\n onClick={toggleAdvancedSettings}\n type='button'\n className='btn-link strong'\n >\n Advanced Settings\n <span className={`${iconClass} icon icon-arrow-down small color2 margin-left-less`} />\n </button>\n </div>\n );\n };\n\n function renderAdvancedSettings () {\n return (\n <div className='fieldmanager-advancedsettings'>\n <table>\n <tbody>\n {canConfigureDefault && (\n <tr>\n <td>\n <AdvancedLabel\n label='Default Value'\n />\n </td>\n <td>\n {defaultInput()}\n {renderDefaultIsInvalidWarning()}\n </td>\n </tr>\n )}\n {(hasTypeSpecificSettings) && renderTypeSpecificSettings()}\n {canAllowNewEntity && renderCustomEntitySettings()}\n <AdvancedSettings\n redacted={stepDatum.redacted}\n required={stepDatum.required}\n lockOnRenewal={stepDatum.lock_on_renewal}\n autofillEnabled={autofillEnabled}\n autofillOnRenewal={stepDatum.autofill_on_renewal}\n onDataChanged={onDataChanged}\n />\n </tbody>\n </table>\n </div>\n )\n }\n\n return (\n <div className='cf'>\n {children}\n {renderToggle()}\n {open && renderAdvancedSettings()}\n </div>\n );\n};\n\nFieldSettings.displayName = 'FieldSettings';\n\nFieldSettings.propTypes = {\n stepDatum: PropTypes.shape({\n data_type: PropTypes.string.isRequired,\n default: PropTypes.string,\n min_num_checks: PropTypes.number.isRequired,\n id: PropTypes.number,\n max_length: PropTypes.number,\n min_value: PropTypes.string,\n max_value: PropTypes.string,\n custom_entity: PropTypes.shape({\n type: PropTypes.string,\n }),\n required: PropTypes.bool,\n redacted: PropTypes.bool,\n date_type: PropTypes.string,\n date_range_start_label: PropTypes.string,\n date_range_end_label: PropTypes.string,\n autofill_on_renewal: PropTypes.bool,\n lock_on_renewal: PropTypes.bool,\n entity_creatable: PropTypes.bool,\n }).isRequired,\n multipleChoiceOptions: PropTypes.arrayOf(PropTypes.shape({})),\n autofillEnabled: PropTypes.bool.isRequired,\n onDataChanged: PropTypes.func.isRequired,\n fieldName: PropTypes.string,\n transitionRef: PropTypes.shape({}),\n};\n\nexport default FieldSettings;\n","import React, {\n useState, useCallback, useMemo, useEffect,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport { isArray, debounce } from 'underscore';\nimport truncate from 'truncate';\nimport { Draggable } from 'react-beautiful-dnd';\n\nimport InlineNotification from 'components/shared/inline-notification';\nimport Select from 'components/shared/select';\nimport { getDataTypes, fieldNameForType } from 'modules/step-data-types';\nimport { confirm } from 'modules/alert-confirm';\nimport FlowStepActions from 'actions/flow-step-actions';\nimport MultipleChoiceOptionActions from 'actions/multiple-choice-option-actions';\nimport { error as err } from 'components/shared/flash';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport MultipleChoices from './multiple-choices';\nimport FieldSettings from './field-settings';\nimport DropdownMenu from '../dropdown-menu';\n\nconst StepDataCollectorRow = ({\n datum, stepType, disabled, onClick, active, index, customEntities, autofillEnabledOnTemplate,\n}) => {\n const [error, setError] = useState();\n const [nameValue, setNameValue] = useState(datum.name === 'Untitled field' ? '' : datum.name);\n\n const onDataChanged = useCallback((attrs, onSuccess = null, onFail = null) => {\n return FlowStepActions.updateStepData(datum.id, attrs)\n .done((res) => {\n if (onSuccess) {\n onSuccess(res);\n }\n })\n .fail((res) => {\n if (onFail) {\n onFail();\n }\n handleError(res);\n });\n }, [datum]);\n\n const debouncedOnDataChanged = useMemo(() => debounce(onDataChanged, 500), [onDataChanged]);\n\n const [prevType, setPrevType] = useState(datum.data_type);\n useEffect(() => {\n if (prevType !== datum.data_type) {\n setPrevType(datum.data_type);\n }\n }, [datum, prevType]);\n\n const onTypeChange = ({ value }) => {\n onDataChanged({\n data_type: value, default: '', multiple_choice_options: null, custom_entity_id: null, custom_entity: null,\n });\n };\n\n const onDeleteButtonClick = (e) => {\n e.preventDefault();\n\n confirm('Are you sure?', `Are you sure you want to delete ${datum.name}?`, () => {\n FlowStepActions.deleteStepData(datum.id)\n .fail(handleError);\n });\n };\n\n const onMultipleChoiceOptionChange = (id, attrs) => (\n MultipleChoiceOptionActions.updateOption(id, attrs)\n .fail(handleError)\n .done(() => setError(null))\n );\n\n const handleError = (res) => {\n if (!res.responseJSON.errors) {\n err();\n } else if (isArray(res.responseJSON.errors)) {\n err(res.responseJSON.errors[0]);\n } else {\n setError(res.responseJSON.errors.base[0]);\n }\n };\n\n const dataTypeOptions = getDataTypes(stepType, { customEntities })\n .map((dataType) => ({ value: dataType.type, label: dataType.name }));\n\n const isDataTypeWithOptions = ['multiple_choice', 'checkboxes'].includes(datum.data_type);\n\n const onRowClick = () => {\n if (onClick) {\n onClick(datum.id);\n }\n };\n\n const onDuplicateButtonClick = () => {\n FlowStepActions.duplicateDatum(datum.id);\n };\n\n const renderMenu = () => {\n return (\n <DropdownMenu>\n <ul>\n <li onClick={onDuplicateButtonClick}>\n <FontAwesomeIcon\n icon={icon({ name: 'clone' })}\n style={{ color: '#0463B7' }}\n />\n <span>Clone Field</span>\n </li>\n <li onClick={onDeleteButtonClick}>\n <FontAwesomeIcon\n icon={icon({ name: 'trash' })}\n style={{ color: '#0463B7' }}\n />\n <span>Delete Field</span>\n </li>\n </ul>\n </DropdownMenu>\n );\n };\n\n return (\n <Draggable draggableId={`datum-${datum.id}`} index={index}>\n {({ innerRef, draggableProps, dragHandleProps }) => {\n // This is here because it needs a reference to the draggable props\n const options = (\n <div className='fieldmanager-actions'>\n <div\n title='Sort'\n className='fieldmanager-order grabbable'\n {...dragHandleProps}\n >\n <FontAwesomeIcon\n icon={icon({ name: 'arrow-down-arrow-up' })}\n style={{ color: '#0463B7' }}\n />\n </div>\n {renderMenu()}\n </div>\n );\n\n return (\n <div\n ref={innerRef}\n {...draggableProps}\n >\n <div id={datum.id}>\n {disabled || !active ? (\n <div onClick={onRowClick} className='fieldmanager collapsed'>\n <input type='text' className='fieldmanager-input' disabled value={truncate(datum.name, 60)} />\n <div className='fieldmanager-type'>\n {fieldNameForType(datum.data_type, { customEntities, customEntityId: datum.custom_entity_id })}\n </div>\n <div className='fieldmanager-configcue'>\n <FontAwesomeIcon\n title={datum.required ? 'This field is required' : 'This field is optional'}\n icon={icon({ name: 'lock' })}\n style={{ opacity: datum.required ? '1' : '0.3' }}\n />\n <FontAwesomeIcon\n title={datum.redacted ? 'This field is NOT visible to the public in your open data portal' : 'This field is visible to the public in your open data portal'}\n icon={icon({ name: 'eye' })}\n style={{ opacity: datum.redacted ? '0.3' : '1' }}\n />\n </div>\n {options}\n </div>\n ) : (\n <div className={`${error ? ' error' : ''} fieldmanager`}>\n <div>\n <div className='cf fieldmanager-namewrap'>\n <input\n className='fieldmanager-nameinput'\n onChange={(e) => {\n const { value } = e.target;\n setNameValue(value);\n debouncedOnDataChanged({ name: value });\n }}\n value={nameValue}\n name='fieldname'\n placeholder='Add field title'\n type='text'\n />\n\n <Select\n value={dataTypeOptions.find(({ value }) => value === (datum.data_type === 'entity' ? `entity-${datum.custom_entity_id}` : datum.data_type))}\n options={dataTypeOptions}\n onChange={onTypeChange}\n disabled={disabled}\n styles={{\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n // Approximately 0.95 - 1/phi\n width: '33%',\n }),\n }}\n />\n </div>\n\n {(isDataTypeWithOptions) && (\n <span>\n <MultipleChoices\n key={datum.id}\n options={datum.multiple_choice_options}\n stepDatum={datum}\n disabled={disabled}\n onDeleteFail={handleError}\n onOptionChange={onMultipleChoiceOptionChange}\n />\n <br />\n </span>\n )}\n </div>\n\n {error && <InlineNotification className='margin-top'>{error}</InlineNotification>}\n <FieldSettings\n stepDatum={datum}\n multipleChoiceOptions={datum.multiple_choice_options}\n autofillEnabled={autofillEnabledOnTemplate}\n onDataChanged={onDataChanged}\n disabled={disabled}\n fieldName={fieldNameForType(datum.data_type, { customEntities, customEntityId: datum.custom_entity_id })}\n >\n {options}\n </FieldSettings>\n </div>\n )}\n </div>\n </div>\n );\n }}\n </Draggable>\n );\n};\n\nStepDataCollectorRow.propTypes = {\n active: PropTypes.bool.isRequired,\n allowedStepDatumTypes: PropTypes.array.isRequired,\n customEntities: PropTypes.array,\n datum: PropTypes.shape({\n data_type: PropTypes.string.isRequired,\n default: PropTypes.string,\n entity_createable: PropTypes.bool,\n id: PropTypes.number.isRequired,\n min_num_checks: PropTypes.number.isRequired,\n multiple_choice_options: PropTypes.array.isRequired,\n name: PropTypes.string,\n redacted: PropTypes.bool.isRequired,\n required: PropTypes.bool.isRequired,\n }).isRequired,\n disabled: PropTypes.bool.isRequired,\n onClick: PropTypes.func,\n stepType: PropTypes.string.isRequired,\n index: PropTypes.number,\n autofillEnabledOnTemplate: PropTypes.bool.isRequired,\n};\n\nexport default StepDataCollectorRow;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport InstructionsManager from 'components/shared/instructions-manager';\nimport StepLogic from 'components/shared/step-logic';\nimport TemplateManagerStore from 'stores/template-manager-store';\nimport getTemplateVariables from 'modules/template-variables';\nimport FlowStepActions from 'actions/flow-step-actions';\nimport AdvancedLabel from 'components/shared/advanced-label';\n\nconst SectionSettings = ({\n section,\n flowTemplate,\n disabled,\n logicDisabled,\n}) => {\n const hasLogic = ['Step'].includes(section.sectionable_type);\n const [isEditorActive, setIsEditorActive] = useState(false);\n const [addingLogic, setAddingLogic] = useState(false);\n const onInstructionsSave = (value) => {\n FlowStepActions.updateSection(section.id, { instructions: value })\n .done(() => {\n setIsEditorActive(false);\n });\n };\n\n const onClose = (e) => {\n e.stopPropagation();\n setIsEditorActive(false);\n };\n\n const renderInstructions = () => {\n let content = (\n <div className='instruction-container' onClick={() => setIsEditorActive(true)}>\n <InstructionsManager\n instructions={section.instructions}\n templateVariables={templateVariables()}\n isActive={false}\n key='inactive-intruction-manager'\n />\n </div>\n );\n if (disabled) {\n if (section.instructions) {\n content = (\n <span className='simplerich' dangerouslySetInnerHTML={{ __html: section.instructions }} />\n );\n } else {\n content = (\n <strong>\n Instructions disabled.\n </strong>\n );\n }\n } else if (isEditorActive) {\n content = (\n <div className='instruction-container'>\n <InstructionsManager\n onClose={onClose}\n onSave={onInstructionsSave}\n instructions={section.instructions}\n templateVariables={templateVariables()}\n isActive\n key='active-intruction-manager'\n />\n </div>\n );\n }\n return (\n\n <tr>\n <td>\n <AdvancedLabel\n label='Instructions'\n />\n </td>\n <td>\n {content}\n </td>\n </tr>\n );\n };\n\n const renderLogicConfig = () => {\n if (!hasLogic) { return; }\n let content = (\n <button\n type='button'\n className='flex btn-link secondary'\n onClick={() => setAddingLogic(true)}\n >\n Add logic\n </button>\n );\n if (logicDisabled) {\n content = (\n <span>\n Logic is disabled. This section cannot be conditional because a field in this section is used in a formula.\n </span>\n );\n } else if (section.logic_config || addingLogic) {\n content = (\n <StepLogic\n logicConfig={section.logic_config}\n disabled={disabled}\n logicableId={section.id}\n logicableType='StepDatum::Section'\n flowTemplate={flowTemplate}\n onLogicOff={() => setAddingLogic(false)}\n showTitle={false}\n />\n );\n }\n return (\n <tr className='with-divider'>\n <td>\n <AdvancedLabel\n label='Logic'\n />\n </td>\n <td>\n {content}\n </td>\n </tr>\n );\n };\n\n const templateVariables = () => {\n if (section.sectionable_type === 'Step') {\n return getTemplateVariables(flowTemplate.formulas, TemplateManagerStore.getStepData(), 'Instructions');\n }\n\n // Not allowing variables to be used in Surveys or Supplemental DataCollection\n return [];\n };\n return (\n <div className='sectionsettings'>\n <table>\n <tbody>\n {renderInstructions()}\n {renderLogicConfig()}\n </tbody>\n </table>\n </div>\n );\n};\n\nSectionSettings.propTypes = {\n section: PropTypes.shape({\n id: PropTypes.number.isRequired,\n sectionable_type: PropTypes.string.isRequired,\n logic_config: PropTypes.shape({}),\n instructions: PropTypes.string,\n }).isRequired,\n flowTemplate: PropTypes.shape({\n formulas: PropTypes.arrayOf(PropTypes.shape({})),\n }).isRequired,\n disabled: PropTypes.bool,\n logicDisabled: PropTypes.bool,\n hasLogic: PropTypes.bool.isRequired,\n};\n\nexport default SectionSettings;\n","import React, { useState, useMemo, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { debounce } from 'underscore';\nimport { Draggable, Droppable } from 'react-beautiful-dnd';\n\nimport FlowStepActions from 'actions/flow-step-actions';\nimport SurveyActions from 'actions/survey-actions';\nimport { STEP_ROW } from 'constants/template-manager-constants';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport DropdownMenu from 'components/shared/dropdown-menu';\nimport SideMenu from 'components/shared/side-menu';\nimport NotifBanner from 'components/shared/notif-banner';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\nimport NewFieldPicker from './new-field-picker';\nimport StepDataCollectorRow from './step-data-collector-row';\nimport SectionSettings from './settings/section-settings';\n\nconst STEP_TYPE_MAP = {\n Step: 'CollectInfoStep',\n Survey: 'SurveyStep',\n};\nconst StepDataSection = ({\n section,\n disabled,\n sectionableId,\n sectionableType,\n stepId,\n flowTemplate,\n stepData,\n onDatumClick,\n index,\n activeDatumId,\n allowedStepDatumTypes,\n}) => {\n const [showSectionSettings, setShowSectionSettings] = useState(false);\n const [sectionName, setSectionName] = useState(section.name);\n const [showFieldMenu, setShowFieldMenu] = useState(false);\n const sidemenuRef = useRef(null);\n\n const isLogicDisabled = section.sectionable_type !== 'Step' || stepData.some((s) => { return s.used_in_formula; })\n\n const sectionNameChanged = useMemo(\n () => debounce((name) => FlowStepActions.updateSection(section.id, { name }), 500),\n [section],\n );\n\n const copy = () => {\n switch (sectionableType) {\n case 'Step':\n FlowStepActions.copySection(section.id, sectionableId);\n break;\n\n case 'Survey':\n SurveyActions.copySection(section.id, stepId);\n break;\n\n default:\n throw Error(`Invalid sectionableType ${sectionableType}`);\n }\n };\n\n const destroySectionClicked = () => {\n FlowStepActions.destroySection(section.id);\n };\n\n const autofillEnabledOnTemplate = flowTemplate?.configured_outputs?.[0]?.autofill;\n\n const renderBannerLogic = () => {\n return (\n <div style={{ margin: '1rem' }}>\n <NotifBanner className='advanced' style='warning'>\n <div style={{ display: 'flex', justifyContent: 'space-between' }}>\n <div style={{ display: 'inline-flex' }}>\n <div style={{ marginRight: '1rem', display: 'flex', alignItems: 'center' }}>\n <FontAwesomeIcon icon={icon({ name: 'square-info' })} />\n </div>\n <div style={{ display: 'flex', alignItems: 'center' }}>\n <span>\n Conditional logic has been applied to this section. \n </span>\n <button\n type='button'\n onClick={() => setShowSectionSettings(true)}\n className='btn-link'\n >\n View conditional logic\n </button>\n </div>\n </div>\n </div>\n </NotifBanner>\n </div>\n );\n };\n\n const renderSectionSettings = () => {\n return (\n <SideMenu\n title='Section Configuration'\n onClose={() => setShowSectionSettings(false)}\n transitionRef={sidemenuRef}\n >\n <SectionSettings\n section={section}\n flowTemplate={flowTemplate}\n disabled={disabled}\n logicDisabled={isLogicDisabled}\n />\n </SideMenu>\n );\n };\n\n const renderMenu = () => {\n return (\n <DropdownMenu iconColor='#fff'>\n <ul>\n <li onClick={() => setShowSectionSettings(true)}>\n <FontAwesomeIcon\n icon={icon({ name: 'gear' })}\n style={{ color: '#0463B7' }}\n />\n Configuration\n </li>\n {!disabled && (\n <>\n <li onClick={copy}>\n <FontAwesomeIcon\n icon={icon({ name: 'clone' })}\n style={{ color: '#0463B7' }}\n />\n Clone Section\n </li>\n <li onClick={destroySectionClicked}>\n <FontAwesomeIcon\n icon={icon({ name: 'trash' })}\n style={{ color: '#0463B7' }}\n />\n Delete Section\n </li>\n </>\n )}\n </ul>\n </DropdownMenu>\n );\n };\n\n return (\n <>\n <Draggable draggableId={`section-${section.id}`} index={index}>\n {({ innerRef, draggableProps, dragHandleProps }) => (\n <div className='stepdatagroup' ref={innerRef} {...draggableProps}>\n <div className='stepdatagroup-header'>\n <input\n className='stepdatagroup-header-title'\n type='text'\n placeholder='Untitled section'\n value={sectionName}\n onChange={(e) => {\n const { value } = e.target;\n setSectionName(value);\n sectionNameChanged(value);\n }}\n disabled={disabled}\n />\n\n <div className='stepdatagroup-actions'>\n {!disabled && (\n <>\n <div\n className='sorthandle grabbable'\n {...dragHandleProps}\n >\n <FontAwesomeIcon\n icon={icon({ name: 'arrow-down-arrow-up' })}\n style={{ color: '#fff', marginRight: '0.5rem' }}\n className='action'\n />\n </div>\n {renderMenu()}\n </>\n )}\n </div>\n </div>\n\n {!!section.logic_config && renderBannerLogic()}\n\n <Droppable\n droppableId={`datum-droppable-${section.id}`}\n type={STEP_ROW}\n >\n {({ innerRef: datumInnerRef, droppableProps, placeholder }) => (\n <div\n ref={datumInnerRef}\n {...droppableProps}\n className='stepdatagroup-rowswrap grouped-sort'\n data-cy={`fields-${index}`}\n >\n {stepData.map((datum, rowIndex) => (\n <StepDataCollectorRow\n key={datum.id}\n index={rowIndex}\n datum={datum}\n stepType={STEP_TYPE_MAP[section.sectionable_type]}\n allowedStepDatumTypes={allowedStepDatumTypes}\n disabled={disabled}\n active={datum.id === activeDatumId}\n onClick={onDatumClick}\n customEntities={flowTemplate?.team?.custom_entities}\n autofillEnabledOnTemplate={autofillEnabledOnTemplate}\n />\n ))}\n {placeholder}\n </div>\n )}\n </Droppable>\n\n {!disabled && (\n <div className='padded'>\n <button type='button' onClick={() => setShowFieldMenu(true)} className='stepdatagroup-adddata'>\n + Add new field\n </button>\n </div>\n )}\n {showFieldMenu && (\n <NewFieldPicker\n sectionId={section.id}\n stepType={STEP_TYPE_MAP[section.sectionable_type]}\n onClose={() => setShowFieldMenu(false)}\n customEntities={flowTemplate?.team?.custom_entities}\n />\n )}\n </div>\n )}\n </Draggable>\n <TransitionGroup>\n { showSectionSettings && (\n <CSSTransition\n classNames='sidemenu'\n timeout={250}\n nodeRef={sidemenuRef}\n >\n {renderSectionSettings()}\n </CSSTransition>\n )}\n </TransitionGroup>\n </>\n );\n};\n\nStepDataSection.propTypes = {\n disabled: PropTypes.bool.isRequired,\n index: PropTypes.number.isRequired,\n section: PropTypes.object.isRequired,\n allowedStepDatumTypes: PropTypes.array.isRequired,\n activeDatumId: PropTypes.number,\n onDatumClick: PropTypes.func,\n flowTemplate: PropTypes.object,\n stepData: PropTypes.array,\n sectionableId: PropTypes.number,\n sectionableType: PropTypes.string.isRequired,\n stepId: PropTypes.number,\n};\n\nexport default StepDataSection;\n","import PropTypes from 'prop-types';\nimport React, {\n useRef, useState, useEffect, useMemo,\n} from 'react';\nimport { DragDropContext, Droppable } from 'react-beautiful-dnd';\nimport { TransitionGroup, CSSTransition } from 'react-transition-group';\n\nimport FlowStepActions from 'actions/flow-step-actions';\nimport SurveyActions from 'actions/survey-actions';\nimport { reorder } from 'modules/dnd-utils';\nimport { STEP_ROW, STEP_SECTION } from 'constants/template-manager-constants';\nimport StepDataSection from './data_collector/step-data-section';\nimport useDerivedState from '../hooks/use-derived-state';\n\nconst positionSort = (a, b) => a.position - b.position;\nconst transformStepData = (stepData, sections) => (\n Object.fromEntries(Object.entries(stepData.reduce(\n // This is kind of janky, but it basically takes an array and fans it out into an object\n // keyed by step_id\n (acc, datum) => ({\n ...acc,\n [datum.section_id]: [...acc[datum.section_id], datum],\n }),\n Object.fromEntries(sections.map((section) => [section.id, []])),\n )).map(([datumStepId, datumArray]) => [datumStepId, datumArray.sort(positionSort)]))\n);\n\nconst getSectionId = (droppable) => (\n Number(droppable.droppableId.split('-')[2])\n);\n\nconst StepDataCollector = ({\n disabled,\n sectionableType,\n sectionableId,\n stepId,\n flowTemplate,\n allowedStepDatumTypes,\n sections,\n stepData,\n}) => {\n const sectionsBottomRef = useRef();\n const [activeDatumId, setActiveDatumId] = useState(null);\n\n // NOTE: we use `useMemo` here so that if sections is a stable reference, so\n // is the sorted section, which makes it play nicely with `useDerivedState`\n const sortedSectionsFromProps = useMemo(() => sections.sort(positionSort), [sections]);\n const [orderedSections, setOrderedSections] = useDerivedState(sortedSectionsFromProps);\n\n // NOTE: stepData aren't associated with sections directly\n // - they're not properties, but rather their own array\n const sortedStepDatFromProps = useMemo(\n () => transformStepData(stepData, sections),\n [stepData, sections],\n );\n const [orderedStepData, setOrderedStepData] = useDerivedState(sortedStepDatFromProps);\n\n const [prevLength, setPrevLength] = useState(sections.length);\n useEffect(() => {\n if (sections.length !== prevLength) {\n if (sections.length > prevLength) {\n // If we're removing a section, we don't want to\n // jump them to the bottom.\n sectionsBottomRef.current.scrollIntoView();\n }\n setPrevLength(sections.length);\n }\n }, [sections, prevLength]);\n\n const addSectionClicked = () => {\n switch (sectionableType) {\n case 'Step':\n return FlowStepActions.addSection(sectionableId);\n case 'Survey':\n return SurveyActions.addSection(sectionableId, stepId);\n default:\n return null;\n }\n };\n\n const onDragEnd = ({\n source, destination, type, draggableId,\n }) => {\n // We didn't drop in the draggable\n if (!destination) {\n return;\n }\n // We dropped it in the same place\n if (destination.index === source.index\n && source.droppableId === destination.droppableId) {\n return;\n }\n if (type === STEP_SECTION) {\n setOrderedSections((oldSections) => reorder(\n oldSections,\n source.index,\n destination.index,\n ));\n const draggedSectionId = orderedSections[source.index].id;\n const newPosition = destination.index + 1;\n FlowStepActions.moveSection(draggedSectionId, newPosition)\n .fail(() => setOrderedSections(orderedSections));\n }\n if (type === STEP_ROW) {\n // TODO: this is kind of magical. It'd probably be better to do this without\n // string manipulation.\n const sourceSectionId = getSectionId(source);\n const destSectionId = getSectionId(destination);\n if (sourceSectionId === destSectionId) {\n // They're in the same list and we'll reorder\n // that list\n setOrderedStepData((oldStepData) => ({\n ...oldStepData,\n [sourceSectionId]: reorder(oldStepData[sourceSectionId], source.index, destination.index),\n }));\n } else {\n const draggedDatum = orderedStepData[sourceSectionId][source.index];\n setOrderedStepData((oldStepData) => {\n // TODO: there's gotta be a better way to do this\n const sourceArray = [...oldStepData[sourceSectionId]];\n sourceArray.splice(source.index, 1);\n const destArray = [...oldStepData[destSectionId]];\n destArray.splice(destination.index, 0, draggedDatum);\n return {\n ...oldStepData,\n [sourceSectionId]: sourceArray,\n [destSectionId]: destArray,\n };\n });\n }\n // TODO: also magical\n const datumId = Number(draggableId.split('-')[1]);\n const newPosition = destination.index + 1;\n FlowStepActions.moveStepData(datumId, newPosition, destSectionId)\n .fail(() => setOrderedStepData(orderedStepData));\n }\n };\n return (\n <div>\n <DragDropContext\n onDragEnd={onDragEnd}\n >\n <Droppable\n droppableId='section-droppable'\n type={STEP_SECTION}\n >\n {({ innerRef, droppableProps, placeholder }) => (\n <div ref={innerRef} {...droppableProps}>\n <TransitionGroup>\n {orderedSections.map((section, index) => {\n return (\n <CSSTransition\n classNames='zoom-in'\n timeout={300}\n key={section.id}\n >\n <StepDataSection\n index={index}\n section={section}\n sectionableType={sectionableType}\n sectionableId={sectionableId}\n stepId={stepId}\n stepData={orderedStepData[section.id]}\n allowedStepDatumTypes={allowedStepDatumTypes}\n disabled={disabled}\n activeDatumId={activeDatumId}\n onDatumClick={setActiveDatumId}\n flowTemplate={flowTemplate}\n />\n </CSSTransition>\n );\n })}\n </TransitionGroup>\n {placeholder}\n </div>\n )}\n </Droppable>\n </DragDropContext>\n <div ref={sectionsBottomRef} />\n {!disabled && (\n <div className='stepcreator-addnewsection'>\n <button type='button' id='addsectionbutton' className='btn-secondary fullwidth' onClick={addSectionClicked}>+ Add new section</button>\n </div>\n )}\n </div>\n );\n};\n\nStepDataCollector.propTypes = {\n sections: PropTypes.array.isRequired,\n stepId: PropTypes.number.isRequired,\n sectionableId: PropTypes.number.isRequired,\n disabled: PropTypes.bool.isRequired,\n flowTemplate: PropTypes.object,\n allowedStepDatumTypes: PropTypes.array.isRequired,\n sectionableType: PropTypes.string.isRequired,\n stepData: PropTypes.array,\n};\n\nexport default StepDataCollector;\n","var LogicConfigAPI = {\n\tcreate(logicableId, logicableType, action, conditions){\n\t\tconst url = `/logic_configs`;\n\n\t\treturn $.ajax(url, {\n\t\t\tmethod: 'POST',\n\t\t\tdataType: 'json',\n\t\t\tdata: {\n\t\t\t\tlogic_config: {\n\t\t\t\t\tlogicable_id: logicableId,\n\t\t\t\t\tlogicable_type: logicableType,\n\t\t\t\t\taction,\n\t\t\t\t\tlogic_conditions_attributes: conditions\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t},\n\n update(id, action, conditions){\n const url = `/logic_configs/${id}`;\n\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n logic_config: {\n action,\n logic_conditions_attributes: conditions\n }\n }\n });\n },\n\n\tdestroy(logicConfigId){\n\t\tconst url = `/logic_configs/${logicConfigId}`;\n\n\t\treturn $.ajax(url, {\n\t\t\tmethod: 'DELETE',\n\t\t\tdataType: 'json'\n\t\t});\n\t},\n};\n\nexport default LogicConfigAPI;\n","import StepDataAPI from '../apis/step-data-api';\nimport LogicConfigAPI from '../apis/logic-config-api';\nimport Flash from '../components/shared/flash';\nimport Dispatcher from '../appdispatcher';\nimport FlowStepConstants from '../constants/template-manager-constants';\n\nfunction onLogicConfigSaved(logicConfig) {\n Dispatcher.dispatch({\n actionType: FlowStepConstants.LOGIC_CONFIG_ADDED,\n logicConfig,\n });\n}\n\nfunction onLogicConfigDestroy(res) {\n const logicConfig = res.logic_config;\n const newStepAssignmentGroups = res?.new_groups;\n\n Dispatcher.dispatch({\n actionType: FlowStepConstants.LOGIC_CONFIG_DESTROYED,\n logicConfig,\n newStepAssignmentGroups,\n });\n}\n\nfunction formatConditions(conditions) {\n return conditions.map((c, index) => {\n return {\n source_id: c.source_id,\n source_type: 'StepDatum',\n comparator: c.comparator,\n match_value: c.match_value,\n connective: (index === conditions.length - 1) ? null : c.connective, // Last condition has no connective\n };\n });\n}\n\nconst LogicActions = {\n fetchAvailableFields(sectionId) {\n return StepDataAPI.availableForSectionConfig(sectionId)\n\t\t\t\t\t\t\t\t\t\t\t.fail(() => { Flash.error(); });\n },\n\n create(logicableId, logicableType, action, conditions) {\n return LogicConfigAPI.create(logicableId, logicableType, action, formatConditions(conditions))\n\t\t\t\t\t\t\t\t\t.done(onLogicConfigSaved)\n\t\t\t\t\t\t\t\t\t.fail(() => { Flash.error(); });\n },\n\n update(logicConfigId, action, conditions) {\n return LogicConfigAPI.update(logicConfigId, action, formatConditions(conditions))\n .done(onLogicConfigSaved)\n .fail(() => { Flash.error(); });\n },\n\n destroy(logicConfigId) {\n return LogicConfigAPI.destroy(logicConfigId)\n\t\t\t\t\t\t\t\t\t\t\t\t .done(onLogicConfigDestroy);\n },\n};\n\nexport default LogicActions;\n","import React, { useState, useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { uniqueId } from 'underscore';\n\nimport LogicActions from 'actions/logic-actions';\nimport { actionsForLogicableType } from 'constants/logic-constants';\nimport LogicWidget from './logic-widget';\nimport LogicValidator from './logic_widget/logic-validator';\n\nconst StepLogic = (props) => {\n const initialLogicConfig = () => {\n // Note that this shape matches react-select's option shape\n // TODO: Having this defined this far from where it's used is\n // potentially a problem.\n const defaultAction = actionsForLogicableType(props.logicableType)[0].value;\n return (\n props.logicConfig\n || {\n action: defaultAction,\n conditions: [{ tempId: uniqueId() }],\n }\n );\n };\n\n const [editing, setEditing] = useState(!props.logicConfig);\n const [logicConfig, setLogicConfig] = useState(initialLogicConfig);\n const [error, setError] = useState(null);\n\n const didMountRef = useRef(false);\n\n useEffect(() => {\n if (didMountRef.current) {\n setLogicConfig(initialLogicConfig());\n setEditing(false);\n } else {\n didMountRef.current = true;\n }\n }, [props.logicConfig]);\n\n const onDelete = () => {\n if (props.logicConfig) {\n LogicActions\n .destroy(props.logicConfig.id)\n .done(() => {\n if (props.onLogicOff) {\n props.onLogicOff();\n }\n });\n }\n };\n\n function saveLogic() {\n let promise;\n if (logicConfig.id) {\n promise = LogicActions.update(logicConfig.id, logicConfig.action, logicConfig.conditions);\n } else {\n promise = LogicActions.create(\n props.logicableId,\n props.logicableType,\n logicConfig.action,\n logicConfig.conditions,\n );\n }\n if (props.onLogicSave) {\n promise.done((res) => props.onLogicSave(res));\n }\n }\n\n const onCancel = () => {\n setEditing(false);\n setLogicConfig(initialLogicConfig());\n\n if (props.onLogicOff) {\n props.onLogicOff();\n }\n };\n\n const onSave = (e) => {\n e.preventDefault();\n\n setError(null);\n const validator = new LogicValidator(logicConfig.action, logicConfig.conditions);\n\n if (validator.validateConfig()) {\n saveLogic();\n } else {\n setError('Invalid logic configuration');\n }\n };\n\n return (\n <div className='stepdatagroup-configgroup'>\n <LogicWidget\n flowTemplate={props.flowTemplate}\n logicableType={props.logicableType}\n logicableId={props.logicableId}\n logicConfig={logicConfig}\n editing={editing}\n setEditing={setEditing}\n setLogicConfig={setLogicConfig}\n onDelete={onDelete}\n disabled={props.disabled}\n error={error}\n showTitle={props.showTitle}\n >\n <div className='float-right'>\n <button type='button' onClick={onCancel} className='btn-thirdary margin-right-less'>\n Cancel\n </button>\n <button type='button' onClick={onSave} className='btn-primary'>\n Save logic configuration\n </button>\n </div>\n </LogicWidget>\n </div>\n );\n};\n\nStepLogic.propTypes = {\n flowTemplate: PropTypes.shape({}).isRequired,\n logicableType: PropTypes.string,\n logicableId: PropTypes.number,\n logicConfig: PropTypes.shape({\n id: PropTypes.number,\n }),\n disabled: PropTypes.bool,\n onLogicOff: PropTypes.func,\n onLogicSave: PropTypes.func,\n showTitle: PropTypes.bool,\n};\n\nStepLogic.defaultProps = {\n disabled: false,\n showTitle: true,\n};\nexport default StepLogic;\n","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport keyboard from 'keyboardjs';\nimport _ from 'underscore';\nimport RegexEscape from 'regex-escape';\n\nconst TAG_MARKER = '@';\n\nclass MentionsManager extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n mentionStarted: false,\n suggestions: [],\n selectionIdx: 0,\n searchQueries: this.getSearchQueries(props),\n };\n }\n\n componentDidMount() {\n this.inputElement = this.props.getInputElement();\n\n // scope events to inputElement\n keyboard.watch(this.inputElement);\n\n keyboard.on('up', this.prevSuggestion);\n keyboard.on('down', this.nextSuggestion);\n\n // keydown event needs to use the useCapture option\n document.addEventListener('keydown', this.handleKeydown, true);\n }\n\n componentWillUnmount() {\n keyboard.stop(this.inputElement);\n keyboard.off('up', this.prevSuggestion);\n keyboard.off('down', this.nextSuggestion);\n document.removeEventListener('keydown', this.handleKeydown, true);\n }\n\n componentDidUpdate(prevProps) {\n if (this.props.html === prevProps.html) return;\n\n this.handleTagSearch(this.props);\n }\n\n handleKeydown = (e) => {\n if (e.keyCode === 13 && this.state.suggestions.length) {\n // if enter is pressed prevent input element from receiving event\n e.stopPropagation();\n e.preventDefault();\n\n this.selectSuggestion(e);\n }\n };\n\n handleDefaultKeyEvents = (e) => {\n if (this.state.suggestions.length) {\n e.preventDefault();\n }\n };\n\n nextSuggestion = (e) => {\n this.handleDefaultKeyEvents(e);\n\n if (!this.state.suggestions.length) return;\n\n this.setState({\n selectionIdx: (this.state.selectionIdx + 1) % this.state.suggestions.length,\n });\n };\n\n prevSuggestion = (e) => {\n this.handleDefaultKeyEvents(e);\n\n if (!this.state.suggestions.length) return;\n\n let newIndex;\n if ((this.state.selectionIdx - 1) < 0) {\n // wrap around if already on first selection\n newIndex = this.state.suggestions.length - 1;\n } else {\n newIndex = this.state.selectionIdx - 1;\n }\n\n this.setState({ selectionIdx: newIndex });\n };\n\n selectSuggestion = (e) => {\n this.handleDefaultKeyEvents(e);\n\n const selectedTag = this.state.suggestions[this.state.selectionIdx];\n this.insertTag(selectedTag);\n };\n\n resetSuggestions = () => {\n this.setState({\n selectionIdx: 0,\n suggestions: [],\n });\n };\n\n mentionNames = () => {\n return this.props.data.map((mention) => this.normalizeName(mention.displayName));\n };\n\n normalizeName(name) {\n return name.toLowerCase().split(' ').join('-');\n }\n\n handleTagSearch = (newProps) => {\n const newQueries = this.getSearchQueries(newProps);\n const newActiveQuery = this.getActiveQuery(newQueries);\n\n // the html changing but the active query staying the same\n // means the change was made outside of the query and\n // the query should no longer be active\n const queryInactive = _.isEqual(newActiveQuery, this.state.activeQuery) && (this.props.html !== newProps.html);\n\n if (typeof newActiveQuery === 'undefined' || queryInactive) {\n this.resetSuggestions();\n } else {\n this.updateSuggestedMentions(newActiveQuery);\n }\n\n this.setState({\n searchQueries: newQueries,\n activeQuery: newActiveQuery,\n });\n };\n\n getActiveQuery(newQueries) {\n let activeQuery;\n newQueries.forEach((newQuery, idx) => {\n const oldQuery = this.state.searchQueries[idx];\n\n if ((typeof oldQuery === 'undefined') || (newQuery !== oldQuery)) {\n activeQuery = newQuery;\n }\n });\n\n return activeQuery;\n }\n\n updateSuggestedMentions = (queryStr) => {\n const suggestions = this.props.data.filter((datum) => {\n const escapedQuery = RegexEscape(queryStr);\n return this.normalizeName(datum.name).match(new RegExp(`^${escapedQuery}`));\n });\n\n // only show three suggestions\n this.setState({ suggestions: suggestions.slice(0, 3) });\n };\n\n getSearchQueries = ({ html }) => {\n const allPossibleQueries = [];\n\n let mentionBeginningIdx;\n for (let i = 0; i < html.length; i++) {\n const char = html[i];\n if (char === TAG_MARKER) {\n // if char matches, mark beginning of possible mention position\n mentionBeginningIdx = i;\n } else if ((char === '<' || char === ' ') && mentionBeginningIdx) {\n // if possible mention substring has ended add pair of indices to output array\n allPossibleQueries.push(html.slice(mentionBeginningIdx + 1, i));\n\n mentionBeginningIdx = null;\n }\n }\n\n return allPossibleQueries;\n };\n\n insertTag(mention) {\n this.props.onMentionInsert(mention.mentionType, mention.id, mention.name);\n this.resetSuggestions();\n }\n\n renderSuggestedTag = (mention, idx) => {\n const isSelected = this.state.selectionIdx === idx;\n return (\n <li\n className={isSelected ? 'selected' : ''}\n key={mention.id}\n onClick={() => this.insertTag(mention)}\n >\n\n <i className={isSelected ? mention.selectedIconClass : mention.iconClass} />\n {this.normalizeName(mention.displayName)}\n </li>\n );\n };\n\n renderSuggestedMentions = () => {\n return this.state.suggestions.map(this.renderSuggestedTag);\n };\n\n render() {\n return (\n <ul className='inlinementioner'>{this.renderSuggestedMentions()}</ul>\n );\n }\n}\n\nMentionsManager.propTypes = {\n onMentionInsert: PropTypes.func.isRequired,\n html: PropTypes.string,\n data: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string.isRequired,\n mentionType: PropTypes.string.isRequired,\n iconClass: PropTypes.string.isRequired,\n selectedIconClass: PropTypes.string.isRequired,\n }),\n ).isRequired,\n getInputElement: PropTypes.func.isRequired,\n};\n\nexport default MentionsManager;\n","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport ReactQuill, { Quill } from 'react-quill';\nimport MentionsManager from './text-editor/mentions-manager';\n\n/// / mentions setup\n\nconst Embed = Quill.import('blots/embed');\n\nclass Mention extends Embed {\n static create(value) {\n const node = super.create();\n node.setAttribute('data-id', value.id);\n node.setAttribute('data-object-type', value.type);\n node.textContent = value.text;\n\n return node;\n }\n\n static value(domNode) {\n return {\n id: domNode.dataset.id,\n type: domNode.dataset.objectType,\n text: domNode.textContent,\n };\n }\n}\n\nMention.blotName = 'mention';\nMention.tagName = 'span';\nMention.className = 'mention';\n\nQuill.register(Mention);\n\n/// ////////////////////////////////////\n\nconst DEFAULT_QUILL_TOOLBAR = ['bold', 'italic', 'strike', 'underline', 'link', { list: 'ordered' }, { list: 'bullet' }, { color: [] }, { background: [] }];\nconst DEFAULT_QUILL_FORMATS = ['bold', 'italic', 'strike', 'underline', 'link', 'color', 'background', 'list', 'mention'];\n\nclass TextEditor extends Component {\n constructor(props) {\n super(props);\n\n this.formats = props.formats;\n\n this.modules = {\n toolbar: this.props.toolbar,\n };\n\n this.state = {\n content: '',\n cursorPos: null,\n };\n }\n\n get quillEditor() {\n return this.quill.getEditor();\n }\n\n onChange = (content) => {\n if (!this.quill) return;\n\n this.props.onChange(content);\n\n const selection = this.quillEditor.getSelection();\n\n this.setState({\n cursorPos: selection ? selection.index : this.state.cursorPos,\n content,\n });\n };\n\n onMentionInsert = (type, id, text) => {\n // find position of query text\n let pos = this.state.cursorPos;\n while (this.quillEditor.getText(pos, 1) !== '@') pos--;\n\n // delete the query text\n this.quillEditor.deleteText(pos, ((this.state.cursorPos - pos) || 1));\n\n // insert mention\n this.quillEditor.insertEmbed(pos, 'mention', { type, text, id });\n\n // place cursor after mention\n this.quillEditor.setSelection(pos + 1, 0);\n };\n\n getInputElement = () => {\n return $(this.quill.refs.editor).find('.ql-editor')[0];\n };\n\n render() {\n return (\n <div className='texteditor'>\n\n <ReactQuill\n ref={(el) => { this.quill = el; }}\n defaultValue={this.props.content}\n theme='snow'\n formats={this.formats}\n modules={this.modules}\n onChange={this.onChange}\n />\n\n <MentionsManager\n data={this.props.formattedMentionData}\n onMentionInsert={this.onMentionInsert}\n html={this.props.content || ''}\n getInputElement={this.getInputElement}\n />\n\n </div>\n );\n }\n}\n\nTextEditor.defaultProps = {\n formattedMentionData: [],\n onChange: () => {},\n toolbar: DEFAULT_QUILL_TOOLBAR,\n formats: DEFAULT_QUILL_FORMATS,\n};\n\nTextEditor.propTypes = {\n className: PropTypes.string,\n content: PropTypes.string,\n formattedMentionData: PropTypes.array,\n onChange: PropTypes.func,\n toolbar: PropTypes.array,\n formats: PropTypes.formats,\n};\n\nexport default TextEditor;\n","import React from 'react';\n\nconst TextEditorButtons = (props) => {\n function renderCancelButton() {\n return (\n <button onClick={props.onClose} className='btn-thirdary'>\n Cancel\n </button>\n );\n }\n\n return (\n <div className='texteditor-buttons'>\n {props.onClose && renderCancelButton()}\n <button onClick={props.onSave} disabled={props.saveDisabled} className={`btn-primary ${props.saveDisabled ? 'disabled' : ''}`}>\n Save {props.type}\n </button>\n </div>\n );\n};\n\nTextEditorButtons.defaultProps = {\n saveDisabled: false,\n};\n\nexport default TextEditorButtons;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport UserAccessActions from 'actions/user-access-actions';\nimport AutonomousPopup from 'components/shared/autonomous-popup';\n\nclass MemberUserPseudoInfo extends React.Component {\n onResendInviteClick = (e) => {\n e.preventDefault();\n UserAccessActions.resendInvite(this.props.invitationId);\n };\n\n render() {\n return (\n <span className='useraccess-pseudo'>\n <em> (Invited)</em>\n\n <AutonomousPopup closeOnPopupClick buttonClassName='ellipsispopup-grey' nubDirection='left'>\n <ul className='popup-listmenu'>\n <li>\n <a onClick={this.onResendInviteClick} href='#'>Resend invite</a>\n </li>\n </ul>\n </AutonomousPopup>\n </span>\n );\n }\n}\n\nMemberUserPseudoInfo.propTypes = {\n invitationId: PropTypes.number.isRequired,\n};\n\nexport default MemberUserPseudoInfo;\n","import React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport randomcolor from 'randomcolor';\nimport truncate from 'truncate';\nimport { disc as discStyle, buildDisc } from 'theme/discs';\nimport { css } from '@emotion/react';\nimport UserPseudoInfo from './user-disc/user-pseudo-info';\n\nconst UserDisc = ({ user, className, options }) => {\n const backgroundStyle = useMemo(() => {\n if (user.avatar_url) {\n return {\n backgroundImage: `url('${user.avatar_url}')`,\n backgroundSize: 'cover',\n };\n }\n\n return {\n backgroundColor: randomcolor({\n hue: 'random',\n seed: user.id * 4,\n luminosity: 'dark',\n }),\n };\n }, [user.avatar_url, user.id]);\n\n return (\n <div className='inline-block'>\n <span\n title={user.name}\n css={options.smallerAvatar ? buildDisc(25) :discStyle}\n className={className}\n style={backgroundStyle}\n >\n <span>{user.avatar_url ? null : truncate(user.initials, 2, { ellipsis: null })}</span>\n </span>\n\n { options.showName && (\n <span\n css={css`\n text-transform: capitalize;\n `}\n >\n {user.name} {options.showAsCurrent && '(You)'}\n </span>\n )}\n\n { options.showEmail && (\n <span className='margin-left color-text-medium'>{user.email}</span>\n )}\n\n { options.showPseudo && user.pseudo && user.invitation.id && (\n <UserPseudoInfo\n invitationId={user.invitation.id}\n />\n )}\n </div>\n );\n};\n\nUserDisc.propTypes = {\n options: PropTypes.shape({\n showName: PropTypes.bool,\n showEmail: PropTypes.bool,\n showPseudo: PropTypes.bool,\n showAsCurrent: PropTypes.bool,\n smallerAvatar: PropTypes.bool,\n }),\n className: PropTypes.string,\n user: PropTypes.shape({\n id: PropTypes.number.isRequired,\n avatar_url: PropTypes.string,\n email: PropTypes.string.isRequired,\n pseudo: PropTypes.bool.isRequired,\n invitation: PropTypes.shape({\n id: PropTypes.number.isRequired,\n }),\n name: PropTypes.string.isRequired,\n initials: PropTypes.string.isRequired,\n }).isRequired,\n};\n\nUserDisc.defaultProps = {\n className: '',\n options: {\n showName: false,\n showEmail: false,\n showPseudo: true,\n },\n};\n\nexport default UserDisc;\n","import React from 'react';\n\nconst XClose = ({label, onClick, buttonClass, id}) => {\n return (\n <button type='button' className={`btn-link close ${buttonClass}`} onClick={onClick} id={id}>\n <i title={label} className='icon-x' />\n <span className='hidden'>Close</span>\n </button>\n );\n};\n\n\nexport default XClose;\n","import keyMirror from 'keymirror';\n\nexport default keyMirror({\n CHANGES_PERSISTED: null,\n CURRENT_ACTIVE_STEP_UPDATED: null,\n SYNC_ACTIVE_STEP: null,\n UPDATED: null,\n}, 'ACTIVE_STEP');\n","import keyMirror from 'keymirror';\n\nexport default keyMirror({\n TOGGLE_PERSON: null,\n UPDATE_ATTACHMENT: null\n}, 'ATTACHED_PEOPLE');\n","import { isNaN } from 'underscore';\n\nconst numberErrorMessage = (keys) => {\n if (!('minValue' in keys) && !('maxValue' in keys)) {\n switch (keys.numberType) {\n case 'integer':\n return 'must be an integer';\n case 'float':\n return 'must be a number e.g. 1.0, 2, 0.5';\n case 'money':\n return 'must be a number e.g. 1.00, 2, 0.50';\n }\n }\n\n const minValue = parseFloat(keys.minValue);\n const maxValue = parseFloat(keys.maxValue);\n\n if (!isNaN(minValue) && !isNaN(maxValue)) {\n return ` must be between ${keys.minValue} and ${keys.maxValue}`;\n }\n\n if (!isNaN(minValue)) {\n return ` must be greater than or equal to ${keys.minValue}`;\n }\n\n if (!isNaN(maxValue)) {\n return ` must be less than or equal to ${keys.maxValue}`;\n }\n};\n\nconst ErrorMessages = {\n flash: {\n actionFailed: 'Oops, that didn\\'t work.',\n },\n\n formValidation: {\n string: 'cannot be left blank',\n text: 'cannot be left blank',\n address: 'cannot be left blank',\n integer: numberErrorMessage({ numberType: 'integer' }),\n float: numberErrorMessage({ numberType: 'float' }),\n money: numberErrorMessage({ numberType: 'money' }),\n number: (keys) => { return numberErrorMessage(keys); },\n entity: 'cannot be left blank',\n email: 'must look like an email',\n phone: 'must be a valid phone number with an area code',\n multiple_choice: 'must be a valid option',\n checkboxes: (keys) => { return `must check at least ${keys.minNumChecks} boxes`; },\n date: 'must be a valid date',\n file: 'must be a valid file',\n },\n};\n\nexport default ErrorMessages;\n","import keyMirror from 'keymirror';\n\nexport default keyMirror({\n ADVANCE_ATTEMPTED: null,\n ACTIVE_STEP_LOADED: null,\n ACTIVE_STEP_UPDATED: null,\n APPROVAL_CHANGED: null,\n ASSIGNED_PEOPLE_UPDATED: null,\n ASSIGNMENT_UPDATED: null,\n COLLECTED_DATA_CHANGED: null,\n COLLECTED_DATA_ERROR: null,\n COLLECTED_DATA_WILL_CHANGE: null,\n DELETE_ATTACHED_FILE: null,\n ENTITY_LOADED: null,\n HALTED: null,\n LOADED: null,\n OUTPUT_UPDATED: null,\n PAYMENT_MADE: null,\n PAYMENT_UPDATED: null,\n SET_ATTACHMENTS_REFRESHED: null,\n SET_REFRESHED: null,\n SUBPROCESS_REQUIREMENT_UPDATED: null,\n SYNC_ATTACHMENTS: null,\n REQUIREMENT_DELETED: null,\n REQUIREMENT_UPDATED: null,\n STEP_APPROVAL_CHANGED: null,\n STEP_LOADED: null,\n TAG_ADDED: null,\n TAG_REMOVED: null,\n TAG_DELETED: null,\n TAG_UPDATED: null,\n APPLICANT_LIST_UPDATED: null,\n PRIMARY_APPLICANT_CHANGED: null,\n}, 'INITIATED_FLOW');\n","// NOTE: all of these are formatted according to the format of a\n// react-select option.\nexport const STEP_ASSIGNMENT_GROUP_ACTIONS = [\n { value: 'show', label: 'Add this assignee' },\n { value: 'hide', label: 'Do not add this assignee' },\n];\n\nexport const FORM_ACTIONS = [\n { value: 'show', label: 'Show this section' },\n { value: 'hide', label: 'Hide this section' },\n];\n\nexport const REVIEW_ACTIONS = [\n { value: 'show', label: 'Require this review' },\n { value: 'hide', label: 'Don\\'t require this review' },\n];\n\nexport const SUBPROCESS_ACTIONS = [\n { value: 'show', label: 'Require this sub-submission' },\n { value: 'hide', label: 'Don\\'t require this sub-submission' },\n];\n\nexport const LOGICABLE_TYPES = {\n section: 'StepDatum::Section',\n reviewGroup: 'ReviewGroup',\n subprocess: 'Subprocess',\n stepAssignmentGroup: 'StepAssignmentGroup',\n};\n\nexport const STANDARD_COMPARATORS = [\n { value: 'is', label: 'is' },\n { value: 'is_not', label: 'is not' },\n];\n\nexport const NUMERIC_COMPARATORS = [\n { value: 'is', label: 'is' },\n { value: 'is_not', label: 'is not' },\n { value: 'gt', label: 'is greater than' },\n { value: 'lt', label: 'is less than' },\n { value: 'gte', label: 'is equal or greater than' },\n { value: 'lte', label: 'is equal or less than' },\n];\n\nexport const CHECKBOX_COMPARATORS = [\n { value: 'contains', label: 'includes' },\n { value: 'excludes', label: 'does not include' },\n];\n\nexport const ALL_COMPARATORS = STANDARD_COMPARATORS.concat(NUMERIC_COMPARATORS)\n .concat(CHECKBOX_COMPARATORS);\n\nexport const CONNECTIVES = [\n { value: 'and', label: 'and' },\n { value: 'or', label: 'or' },\n];\n\nexport const DEFAULT_CONNECTIVE = CONNECTIVES[0].value;\n\nexport function actionsForLogicableType(type) {\n switch (type) {\n case LOGICABLE_TYPES.stepAssignmentGroup:\n return STEP_ASSIGNMENT_GROUP_ACTIONS;\n case LOGICABLE_TYPES.section:\n return FORM_ACTIONS;\n case LOGICABLE_TYPES.reviewGroup:\n return REVIEW_ACTIONS;\n case LOGICABLE_TYPES.subprocess:\n return SUBPROCESS_ACTIONS;\n }\n}\n","import keyMirror from 'keymirror';\n\nexport default keyMirror({\n ADDED: null,\n DESTROYED: null,\n UPDATED: null,\n MOVED: null\n}, 'MULTIPLE_CHOICE_OPTION');\n","import keyMirror from 'keymirror';\n\n// These are used by the step data collector\n// drag-and-drop components\nexport const STEP_ROW = 'STEP_ROW';\nexport const STEP_SECTION = 'STEP_SECTION';\n\nexport default keyMirror({\n CUSTOM_ID_CREATED: null,\n CUSTOM_ID_DELETED: null,\n EMAIL_NOTIFICATION_ADDED: null,\n EMAIL_NOTIFICATION_DESTROYED: null,\n EMAIL_NOTIFICATION_UPDATED: null,\n FAQ_CREATED: null,\n FAQ_DESTROYED: null,\n FAQ_UPDATED: null,\n FLOW_TEMPLATE_LOADED: null,\n FLOW_TEMPLATE_UPDATED: null,\n FORMULA_DESTROYED: null,\n FORMULA_LOADED: null,\n LOGIC_CONFIG_ADDED: null,\n LOGIC_CONFIG_DESTROYED: null,\n MARK_FLOW_TEMPLATE_CHANGED: null,\n MASTER_TEMPLATE_LOADED: null,\n OUTPUT_UPDATED: null,\n RENEWAL_REMINDER_CREATED: null,\n RENEWAL_REMINDER_UPDATED: null,\n RENEWAL_REMINDER_DELETED: null,\n REVIEW_GROUP_ADDED: null,\n REVIEW_GROUP_DELETED: null,\n REVIEW_GROUP_REMOVED: null,\n REVIEW_GROUP_UPDATED: null,\n SEARCH_CONFIG_ADDED: null,\n SEARCH_CONFIG_DELETED: null,\n SEARCH_CONFIG_UPDATED: null,\n SECTION_ADDED: null,\n SECTION_COPIED: null,\n SECTION_MOVED: null,\n SECTION_REMOVED: null,\n SECTION_UPDATED: null,\n SLUG_UPDATED: null,\n STEP_ADDED: null,\n STEP_ASSIGNMENT_GROUP_CREATED: null,\n STEP_ASSIGNMENT_GROUP_DELETED: null,\n STEP_ASSIGNMENT_CREATED: null,\n STEP_ASSIGNMENT_DELETED: null,\n STEP_DATA_ADDED: null,\n STEP_DATA_MOVED: null,\n STEP_DATA_REMOVED: null,\n STEP_DATA_UPDATED: null,\n STEP_REMOVED: null,\n STEP_UPDATED: null,\n STEPS_REORDERED: null,\n SUBPROCESS_CONFIG_ADDED: null,\n SUBPROCESS_CONFIG_DELETED: null,\n SUBPROCESS_CONFIG_UPDATED: null,\n SURVEY_SECTION_ADDED: null,\n SURVEY_SECTION_COPIED: null,\n SURVEY_UPDATED: null,\n TEAM_DATA_LOADED: null,\n}, 'TEMPLATE_MANAGER');\n","import keyMirror from 'keymirror'\n\nexport default keyMirror({\n MANAGER_LOADED: null,\n SEARCH_RESULTS_CHANGED: null,\n MEMBERSHIP_REMOVED: null,\n MEMBERSHIP_ADDED: null,\n MEMBERSHIP_LIST: null,\n AUTHORITY_ADDED: null,\n AUTHORITY_REMOVED: null,\n PERMISSION_CHANGED: null,\n}, 'USER_ACCESS');\n","import { createContext } from 'react';\n\nconst AccessManagerDispatchContext = createContext();\n\nexport default AccessManagerDispatchContext;\n","import { createContext } from 'react';\n\nconst InitiatedFlowDispatchContext = createContext();\n\nexport default InitiatedFlowDispatchContext;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { isFunction } from 'underscore';\nimport XClose from './x-close';\n\nclass Notification extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n open: true,\n };\n }\n\n onClose = (e) => {\n e.preventDefault();\n this.setState({ open: false });\n if (isFunction(this.props.onClose)) {\n this.props.onClose();\n }\n };\n\n renderDetails() {\n if (this.props.notification.details && this.props.notification.details.length > 0) {\n return (\n <ul>\n {this.props.notification.details.map((detail, index) => {\n return <li key={index}>{detail}</li>;\n })}\n </ul>\n );\n }\n }\n\n render() {\n if (this.state.open) {\n return (\n <div className={`fullwidthnotif ${this.props.notificationType} ${this.props.extraClasses}`}>\n <div className='fullwidthnotif-close'>\n <XClose label='close notification' onClick={this.onClose} />\n </div>\n <div className='fullwidthnotif-content'>\n <span>{this.props.notification.title}</span>\n {this.renderDetails()}\n </div>\n </div>\n );\n }\n\n return null;\n }\n}\n\nNotification.propTypes = {\n notification: PropTypes.object.isRequired,\n notificationType: PropTypes.string.isRequired,\n extraClasses: PropTypes.string,\n};\n\nexport default Notification;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport AttachedPeople from 'components/shared/attached-people';\nimport SlidingToggle from 'components/shared/sliding-toggle';\nimport { confirm } from 'modules/alert-confirm';\nimport Notification from 'components/shared/notification';\nimport EmbeddedTextInput from 'components/shared/embedded-text-input';\nimport Select from 'components/shared/select';\n\nimport { some } from 'underscore';\n\nconst Role = (props) => {\n const [role, setRole] = useState(props.role);\n const [newRole, setNewRole] = useState(props.newRole);\n const [tab, setTab] = useState('settings');\n const [addToRole, setAddToRole] = useState(false);\n const [notification, setNotification] = useState({});\n\n function onSave() {\n if (role.member_mgmt_level === 'members' && !userIsOwnerOrWillBeAdded()) {\n confirm('Added to Role', 'Because this role\\'s edit abilities is set to \\'Role Members and & Owners\\', you will be automatically added to this role to maintain your editing abilities.', () => {\n setAddToRole(true);\n sendSave();\n });\n } else {\n sendSave();\n }\n }\n\n // function onDelete () {\n // props.onDelete(props.role.id)\n // .fail((e) => {setError(e.responseJSON.errors)})\n // }\n\n function sendSave() {\n props.onSave(role, addToRole)\n .done((r) => {\n setRole(r);\n if (newRole) {\n setNewRole(false);\n setTab('users');\n setNotification({ type: 'success', message: 'Role created. Next, add some users.' });\n } else {\n setNotification({ type: 'success', message: 'Role updated' });\n props.onCancel();\n }\n });\n }\n\n function onRoleChange(change) {\n setNotification({});\n setRole({ ...role, ...change });\n }\n\n function userIsOwnerOrWillBeAdded() {\n return props.userIsOwner || addToRole;\n }\n\n function allowedToEdit() {\n switch (role.member_mgmt_level) {\n case 'anyone':\n return true;\n case 'members':\n return props.userIsOwner || userIsAMember();\n case 'owners':\n return props.userIsOwner;\n default:\n throw new Error(`Unhandled management level ${role.member_mgmt_level}`);\n }\n }\n\n function userIsAMember() {\n return some(role.users, (user) => { return user.id === CityGrows.Server.currentUserId; });\n }\n\n function renderNonOwnerPermissions() {\n const can = <span><i className='icon-check-green smaller' /> Can</span>;\n const cannot = <span><i className='icon-x-red smaller' /> Cannot</span>;\n const workflowCreatorPermission = role.workflow_creator ? can : cannot;\n const teamSettingsPermission = role.team_manager ? can : cannot;\n const financeManagerPermission = role.finance_manager ? can : cannot;\n const financeMemberPermission = role.finance_member ? can : cannot;\n return (\n <div>\n <label htmlFor='permissions-list'>Permissions (Only editable by team owners)</label>\n <ul id='permissions-list'>\n <li>\n {workflowCreatorPermission} create new team workflows\n </li>\n <li>\n {teamSettingsPermission} manage team settings\n </li>\n <li>\n {financeManagerPermission} manage team finances and banking details\n </li>\n {!role.finance_manager && (\n <li>\n {financeMemberPermission} view transaction history and manage charge disputes\n </li>\n )}\n </ul>\n </div>\n );\n }\n\n function renderPermissions() {\n if (props.userIsOwner) {\n return (\n <div className='role-section'>\n <label>\n Role permissions\n <div style={{ display: 'grid' }}>\n <SlidingToggle\n onToggle={() => { onRoleChange({ workflow_creator: !role.workflow_creator }); }}\n on={role.workflow_creator}\n label='Team Form Creator'\n description='When on, role members will be able to create new team forms.'\n className='margin-top margin-bottom'\n />\n <SlidingToggle\n onToggle={() => { onRoleChange({ team_manager: !role.team_manager }); }}\n on={role.team_manager}\n label='Team Settings Manager'\n description=\"When on, role members will be able to manage the team's settings, roles, and members.\"\n className='margin-top margin-bottom'\n />\n <SlidingToggle\n onToggle={() => { onRoleChange({ finance_manager: !role.finance_manager }); }}\n on={role.finance_manager}\n label='Team Finance Manager'\n description='When on, role members will be able to access and manage team finance settings.'\n className='margin-top margin-bottom'\n />\n <SlidingToggle\n onToggle={() => { onRoleChange({ finance_member: !role.finance_member }); }}\n on={role.finance_member}\n label='Team Finance Member'\n description=\"When on, role members will be able to access team's transaction history and manage charges disputes.\"\n className='margin-top margin-bottom'\n />\n </div>\n </label>\n\n <div className='role-instruction'>\n Note that only team owners can manage these settings\n </div>\n </div>\n );\n }\n\n return renderNonOwnerPermissions();\n }\n\n function userPermissionLevelSelect() {\n let membersDisabled = !(props.userIsOwner || userIsAMember());\n\n // If new role, then this isnt disabled, it just forces the user to be added to the role\n if (newRole) {\n membersDisabled = false;\n }\n\n const options = [\n { value: 'anyone', label: 'Team Members' },\n { value: 'members', label: 'Role Members & Team Owners', disabled: membersDisabled },\n { value: 'owners', label: 'Team Owners', disabled: !props.userIsOwner },\n ];\n\n return (\n <Select\n options={options}\n value={options.find(({ value }) => value === role.member_mgmt_level)}\n onChange={({ value }) => { onRoleChange({ member_mgmt_level: value }); }}\n styles={{\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n verticalAlign: 'middle',\n }),\n }}\n />\n );\n }\n\n function renderButtons() {\n const disabled = role.name.length === 0;\n return (\n <div className='role-section'>\n <button type='button' className='btn-primary margin-right' onClick={onSave} disabled={disabled}>Save</button>\n <button type='button' className='btn-secondary' onClick={props.onCancel}>Cancel</button>\n </div>\n );\n }\n\n function renderUsers() {\n let lockedUserIds = [];\n let additionalText = '';\n if (role.role_type === 'owner') {\n additionalText = '(must have at least one member)';\n lockedUserIds = role.users.length === 1 ? [role.users[0].id] : [];\n }\n\n return (\n <div className='role-section'>\n <label htmlFor='rolemembersinput'>Role Members {additionalText}</label>\n\n <AttachedPeople\n people={role.users}\n attachableId={role.id}\n attachableType='AdminRole'\n allowPseudo\n canAttachRoles={false}\n hideExternal\n lockedUserIds={lockedUserIds}\n disabled={!allowedToEdit()}\n pseudoNeedsRole={false}\n onChange={(res) => { props.onAttachedPeopleChange(res, role.id); }}\n idForInput='rolemembersinput'\n />\n\n <div className='role-instruction'>\n Only add users who need access to the role's permissions\n or who will be completing the actions assigned to the role\n <br />\n <br />\n <strong>\n Ex: On a reviewer role, add the people who will be\n completing the reviews that get assigned to that role\n </strong>\n </div>\n </div>\n );\n }\n\n function renderAddMeToRole() {\n return (\n <div className='role-section'>\n <label>\n <input type='checkbox' checked={addToRole} onChange={() => { setAddToRole(!addToRole); }} />\n Add me to the role\n </label>\n </div>\n );\n }\n\n function renderPermissionLevelSelect() {\n if (role.role_type !== 'custom') { return; }\n\n return (\n <div className='role-section'>\n Who can edit this role: {userPermissionLevelSelect()}\n <div className='role-instruction'>\n Options that would exclude you from being able to edit this role are disabled.\n </div>\n </div>\n );\n }\n\n function renderEditSettings() {\n return (\n <div>\n <div className='role-section'>\n <label className='inline-block'>Name\n <EmbeddedTextInput\n defaultValue={role.name}\n placeholder='Role name'\n onChange={(value) => { onRoleChange({ name: value }); }}\n idName='rolename'\n />\n </label>\n <div className='role-instruction'>\n Choose a name that your teammates will recognize.\n <br />\n <br />\n <strong>Ex: Finance manager, WTOP reviewer</strong>\n </div>\n </div>\n {renderPermissions()}\n {renderPermissionLevelSelect()}\n {newRole && renderAddMeToRole()}\n\n {renderButtons()}\n </div>\n );\n }\n\n function renderNotifications() {\n if (notification === {}) { return; }\n\n if (notification.type === 'success') {\n return <Notification notification={{ title: notification.message }} notificationType='success' onClose={() => { setNotification({}); }} />;\n }\n }\n\n const renderTabs = () => {\n return (\n <div className='tabnav'>\n <ul>\n <li className={tab === 'settings' ? 'selected' : ''}>\n <a\n href='#'\n onClick={(e) => { e.preventDefault(); setTab('settings'); }}\n >Settings\n </a>\n </li>\n <li className={tab === 'users' ? 'selected' : ''}>\n <a\n href='#'\n onClick={(e) => { e.preventDefault(); setTab('users'); }}\n >Users\n </a>\n </li>\n </ul>\n </div>\n );\n };\n\n const title = newRole ? 'Create a new role' : <span>Editing role: <strong>{role.name}</strong></span>;\n\n return (\n <div className='role-manager'>\n {renderNotifications()}\n <div className='margin-top margin-left-less'>\n <button className='btn-link' type='button' onClick={() => { props.onCancel(); }}>{'< Roles overview'}</button>\n <h2>{title}</h2>\n </div>\n\n <div className='role-editor raised bg-white'>\n {!newRole && renderTabs()}\n {tab === 'settings' && renderEditSettings()}\n {tab === 'users' && renderUsers()}\n </div>\n </div>\n );\n};\n\nRole.propTypes = {\n onAttachedPeopleChange: PropTypes.func,\n onCancel: PropTypes.func,\n onSave: PropTypes.func,\n userIsOwner: PropTypes.bool.isRequired,\n role: PropTypes.object,\n newRole: PropTypes.object,\n};\n\nRole.defaultProps = {\n onAttachedPeopleChange: () => {},\n onCancel: () => {},\n onSave: () => {},\n};\n\nexport default Role;\n","import API from 'apis/role-api';\n\nexport const create = (role, teamId, addUserToRole) => {\n return API.create(role, teamId, addUserToRole);\n};\n\nexport const update = (role, teamId, addUserToRole) => {\n return API.update(role, teamId, addUserToRole);\n};\n\nexport const destroy = (roleId, teamId) => {\n return API.destroy(roleId, teamId);\n};\n\nexport const toggleAttachment = (attachmentId, attachmentType, roleId) => {\n return API.toggleAttachment(attachmentId, attachmentType, roleId);\n};\n\nexport default {\n create,\n update,\n destroy,\n toggleAttachment,\n};\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\n\nexport const ManageableTable = ({ children }) => {\n return (\n <div className='manageabletable minimalcontentcontainer nopadding bg-white'>\n <div>\n {children}\n </div>\n </div>\n );\n};\n\nexport const THead = ({ children }) => {\n return (\n <div className='manageabletable-rowheader'>\n {children}\n <TH />\n </div>\n );\n};\n\nexport const TH = ({ id, children }) => {\n return (\n <div id={id}>\n {children}\n </div>\n );\n};\n\nexport const TBody = ({ children }) => {\n return (\n <ul>\n {children}\n </ul>\n );\n};\n\nexport const TD = (props) => {\n return (\n <div {...props} className={['manageabletable-rowdata', props.className].join(' ')}>\n {props.children}\n </div>\n );\n};\n\nexport const TR = ({ children, onClick, expandedContent }) => {\n const [expanded, setExpanded] = useState(false);\n\n function rowClass() {\n let classes = 'manageabletable-row';\n\n if (false/* props.isLast */) {\n classes += ' last';\n }\n\n if (expanded) {\n classes += ' open';\n } else {\n classes += ' clickable';\n }\n\n return classes;\n }\n\n function closeExpansion(e) {\n e.stopPropagation();\n setExpanded(false);\n }\n\n function renderButton() {\n if (expanded) {\n return <span onClick={closeExpansion} className='icon flip-y icon-arrow-down open thin clickable' />;\n }\n\n return <span className='icon icon-arrow-down thin' />;\n }\n\n const renderExpandedContent = () => {\n return (\n <ExpandedSection>\n {expandedContent}\n </ExpandedSection>\n );\n };\n\n return (\n <li onClick={() => { setExpanded(true); }} className={rowClass()}>\n {children}\n\n <div className='manageabletable-rowdata align-right'>\n {renderButton()}\n </div>\n\n { expanded\n && renderExpandedContent()}\n </li>\n );\n};\n\nconst ExpandedSection = ({ children }) => {\n return (\n <div className='manageabletable-expandedsection'>\n {children}\n </div>\n );\n};\n\nexport default ManageableTable;\n","import React from 'react';\nimport AttachedPeople from 'components/shared/attached-people';\nimport { some } from 'underscore';\nimport { TR, TD } from 'components/shared/manageable-table';\n\nconst RoleRow = (props) => {\n function allowedToEdit() {\n switch (props.role.member_mgmt_level) {\n case 'anyone':\n return true;\n case 'members':\n return props.userIsOwner || userIsAMember();\n case 'owners':\n return props.userIsOwner;\n default:\n throw new Error(`unhandled managment level: ${props.role.member_mgmt_level}`);\n }\n }\n\n function userIsAMember() {\n return some(props.role.users, (user) => { return user.id === CityGrows.Server.currentUserId; });\n }\n\n function renderRoleRow() {\n return (\n <TR expandedContent={renderExpandedSection()}>\n <TD className='name' aria-labelledby='role-name'>{props.role.name}</TD>\n <TD className='' aria-labelledby='role-members'>{props.role.users.length} Members</TD>\n <TD className='permissions' aria-labelledby='role-permissions'>\n {renderPermissions()}\n </TD>\n </TR>\n );\n }\n\n function renderEditLink() {\n if (['owner', 'member'].includes(props.role.role_type) || !allowedToEdit()) {\n return <span className='float-right'>Uneditable</span>;\n }\n\n return (\n <button className='float-right btn-link strong' type='button' onClick={() => { props.onEdit(); }}>\n <span className='icon icon-pencil-grey' style={{ position: 'relative', top: '-4px', marginRight: '5px' }} />\n Edit Role Details\n </button>\n );\n }\n\n function renderExpandedSection() {\n return (\n <>\n {renderEditLink()}\n {renderUsers()}\n </>\n );\n }\n\n function renderUsers() {\n let lockedUserIds = [];\n const additionalText = '';\n if (props.role.role_type === 'owner') {\n // additionalText = '(must have at least one member)';\n // lockedUserIds = props.role.users.length === 1 ? [props.role.users[0].id] : [];\n lockedUserIds = [props.role.team_creator_id];\n }\n\n const labelId = `membersinput-${props.role.id}`;\n\n return (\n <div>\n <label htmlFor={labelId}>Role Members {additionalText}</label>\n <AttachedPeople\n people={props.role.users}\n attachableId={props.role.id}\n attachableType='AdminRole'\n allowPseudo\n canAttachRoles={false}\n hideExternal\n lockedUserIds={lockedUserIds}\n disabled={!allowedToEdit()}\n pseudoNeedsRole={false}\n onChange={(res) => { props.onAttachedPeopleChange(res, props.role.id); }}\n idForInput={labelId}\n />\n </div>\n );\n }\n\n function renderPermissions() {\n return (\n <ul>\n {props.role.finance_manager && <li>Manage team finances and banking details</li>}\n {!props.role.finance_manager && props.role.finance_member && <li>View Transactions and Manage Charge Disputes</li>}\n {props.role.workflow_creator && <li>Create Forms</li>}\n {props.role.team_manager && <li>Manage Team Settings</li>}\n {props.role.role_type === 'owner' && <li>Edit Roles</li>}\n </ul>\n );\n }\n\n return (\n renderRoleRow(props.role)\n );\n};\n\nexport default RoleRow;\n","import React, { useState, useEffect } from 'react';\nimport Role from 'components/roles/role';\nimport RoleActions from 'actions/role-actions';\nimport {\n findIndex, reject, findWhere, some,\n} from 'underscore';\nimport RoleRow from 'components/roles/role-row';\nimport ManageableTable, { THead, TH, TBody } from 'components/shared/manageable-table';\nimport { HashRouter, Route, useHistory } from 'react-router-dom';\nimport { Switch } from 'react-router';\n\nconst RolesRouter = (props) => {\n const renderer = (routerProps) => {\n let prps = { ...props };\n if (routerProps.match.params.id) {\n const roleId = routerProps.match.params.id;\n const role = findWhere(props.roles, { id: parseInt(roleId) });\n prps = { ...prps, role };\n }\n\n return (<RolesContainer {...routerProps} {...prps} />);\n };\n\n return (\n <HashRouter>\n <Switch>\n <Route exact path='/' render={renderer} />\n <Route path='/:id/edit' render={renderer} />\n <Route path='/new' render={renderer} />\n </Switch>\n </HashRouter>\n );\n};\n\nconst RolesContainer = (props) => {\n const [roles, setRoles] = useState(props.roles);\n const [defaultName, setDefaultName] = useState(props.roleName ? props.roleName : '');\n const [role, setRole] = useState(props.role ? props.role : null);\n\n const history = useHistory();\n\n useEffect(() => {\n // On first load, if there's a refferal link, it goes to new\n // but if there's a referal link and they've gone to edit a different role, and refreshed, dont do anything\n if (props.referrerLink && !props.role) {\n history.replace('/new');\n }\n }, []);\n\n const newRole = {\n name: defaultName,\n team_manager: false,\n finance_manager: false,\n finance_member: false,\n workflow_creator: false,\n member_mgmt_level: 'anyone',\n role_type: 'custom',\n };\n\n function userIsOwner() {\n const ownerRole = findWhere(roles, { role_type: 'owner' });\n\n return some(ownerRole.users, (user) => {\n return user.id === props.currentUserId;\n });\n }\n\n function onAttachedPeopleChange(attachment, roleId) {\n const updatedRoles = [...roles];\n const roleIndex = findIndex(updatedRoles, (r) => { return r.id == roleId; });\n\n updatedRoles[roleIndex].users = updateAttachedPeople(attachment, updatedRoles[roleIndex].users);\n setRoles(updatedRoles);\n }\n\n function updateAttachedPeople(changedPerson, attachments) {\n if (changedPerson.persisted) {\n attachments.push(changedPerson);\n return attachments;\n }\n\n return reject(attachments, (p) => {\n return p.id === changedPerson.id;\n });\n }\n\n function onRoleCreate(createdRole) {\n setRoles([createdRole, ...roles]);\n\n return createdRole;\n }\n\n function onRoleUpdate(updatedRole) {\n const updatedRoles = [...roles];\n\n const roleToUpdate = findIndex(updatedRoles, (r) => { return updatedRole.id == r.id; });\n updatedRoles[roleToUpdate] = updatedRole;\n\n setRoles(updatedRoles);\n\n return updatedRole;\n }\n\n function onSave(savedRole, addUserToRole) {\n if (savedRole.id) {\n return RoleActions.update(savedRole, props.teamId, addUserToRole)\n .done((response) => { onRoleUpdate(response); });\n }\n\n return RoleActions.create(savedRole, props.teamId, addUserToRole)\n .done((response) => { onRoleCreate(response); });\n }\n\n function onCancel() {\n setRole(null);\n history.push('/');\n }\n\n function onNewClick() {\n setDefaultName('');\n history.push('/new');\n }\n\n function onEdit(r) {\n setRole(r);\n history.push(`/${r.id}/edit`);\n }\n\n function renderRole() {\n const addingNew = !role;\n const key = addingNew ? 'new' : role.id;\n return (\n <Role\n key={key}\n newRole={addingNew}\n role={addingNew ? newRole : role}\n userIsOwner={userIsOwner()}\n onAttachedPeopleChange={onAttachedPeopleChange}\n onSave={onSave}\n onNewClosed={() => { setAddingNew(false); }}\n onCancel={onCancel}\n />\n );\n }\n\n function renderRolesList() {\n return roles.map((r, i) => {\n const isLast = roles.length - 1 === i;\n return (\n <RoleRow\n role={r}\n key={r.id}\n onEdit={() => { onEdit(r); }}\n referrerLink={props.referrerLink}\n userIsOwner={userIsOwner()}\n isLast={isLast}\n onAttachedPeopleChange={onAttachedPeopleChange}\n />\n );\n });\n }\n\n function renderRefererLink() {\n return <div className='fullwidth align-center padded'><a className='btn-secondary' href={props.referrerLink}>{'< Back to what I was working on'}</a></div>;\n }\n\n function renderRolesIndex() {\n return (\n <ManageableTable>\n <div className='role-indexheader'>\n <h2 className='inline-block nomargin-bottom'>Roles</h2>\n <a target='__blank' href='https://help.citygrows.com/en/articles/5655275-how-can-i-manage-administrative-access-for-individuals-and-groups-on-citygrows' className='secondary margin-left'> Learn about roles</a>\n <button type='button' onClick={onNewClick} className='btn-link strong float-right'>+ Add New Role</button>\n </div>\n <THead>\n <TH id='role-name'>\n Role Name\n </TH>\n <TH id='role-members'>\n Members\n </TH>\n <TH id='role-permissions'>\n Permissions\n </TH>\n </THead>\n\n <TBody>\n {renderRolesList()}\n </TBody>\n </ManageableTable>\n );\n }\n\n function renderMainContent() {\n return (\n <Switch>\n <Route exact path='/' render={() => renderRolesIndex()} />\n <Route path={['/:id/edit', '/new']} render={() => renderRole()} />\n </Switch>\n );\n }\n\n return (\n <>\n {props.referrerLink && renderRefererLink()}\n {renderMainContent()}\n </>\n );\n};\n\nexport default RolesRouter;\n","import React from 'react';\n\n/**\n * OG content\n <li><NavLink to='/'\n activeClassName={'active'}\n exact\n id='processestab'\n tabIndex='1'>Form submissions</NavLink></li>\n <li><a href='#'>Form reviews</a></li>\n <li><NavLink to='/outputs'\n activeClassName={'active'}\n isActive={(_, location) => { return location.pathname.match(/^\\/outputs/); }}\n id='outputstab'\n tabIndex='1'>Form outputs</NavLink></li>\n */\n\nconst PrimaryTabs = () => {\n const activeTab = () => {\n const path = window.location.pathname;\n\n if (path.match(/^\\/(workflows|master_templates).*/)) { return 'workflows'; }\n if ((path.match(/^\\/processes.*/)) ||\n (path.match(/^\\/initiated_flows\\/?.*/) && !path.match(/.+review.+/))) {\n return 'processes';\n }\n if (path === '/' || path.match(/^\\/metrics/)) { return 'metrics'; }\n if (path.match(/^\\/outputs.*/)) { return 'outputs'}\n if (path.match(/^\\/exports|^\\/batch_export_templates/)) { return 'exports'; }\n if (path.match(/^\\/teams\\/?([a-zA-Z0-9-_]+)\\/(people|entities)$/)) { return 'directory'; }\n if (path.match(/^\\/teams\\/?([a-zA-Z0-9-_]+)?(\\/(custom_entities|master_templates|roles|merchant_accounts|transactions|transactions\\/cash_and_checks|charge_disputes)\\/?)?()$/)) {\n return 'teams';\n }\n if (path.match(/\\/review\\//)) { return 'review'; }\n if (path.match(/^\\/my_tasks.*/)) { return 'tasks'; }\n\n return '';\n };\n\n const tab = activeTab();\n\n return (\n <>\n <div id='cflogo'></div>\n <div className='tabheader'>\n <ul>\n <li>\n <a href='/metrics'\n className={`${tab === 'metrics' ? 'active' : ''}`}\n >\n Dashboard\n </a>\n </li>\n <li>\n <a\n href='/workflows'\n className={`${tab === 'workflows' ? 'active' : ''}`}\n >\n Forms Manager\n </a>\n </li>\n <li>\n <a href='/processes'\n id='processestab'\n tabIndex='1'\n className={`${tab === 'processes' ? 'active' : ''}`}\n >\n Form Submissions\n </a>\n </li>\n <li>\n <a href='/my_tasks'\n id='taskstab'\n tabIndex='1'\n className={`${tab === 'tasks' ? 'active' : ''}`}\n >\n My Tasks\n </a>\n </li>\n <li>\n <a\n href='/reviews'\n className={`${tab === 'review' ? 'active' : ''}`}\n >\n Form Reviews\n </a>\n </li>\n <li>\n <a\n href='/outputs'\n id='outputstab'\n tabIndex='1'\n className={`${tab === 'outputs' ? 'active' : ''}`}\n >\n Form Outputs\n </a>\n </li>\n <li>\n <a\n href='/teams'\n id='teamstab'\n tabIndex='1'\n className={`${tab === 'teams' ? 'active' : ''}`}\n >\n Teams\n </a>\n </li>\n <li>\n <a\n href='/teams/directory'\n className={`${tab === 'directory' ? 'active' : ''}`}\n >\n Directory\n </a>\n </li>\n <li>\n <a\n href='/exports'\n className={`${tab === 'exports' ? 'active' : ''}`}\n >\n Exports Manager\n </a>\n </li>\n </ul>\n </div>\n </>\n );\n};\n\nexport default PrimaryTabs;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport AdminRolesContainer from 'components/admin-roles-container';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nfunction index() {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n renderer(<AdminRolesContainer roles={CityGrows.Server.roles}\n workflows={CityGrows.Server.workflows}\n teamId={CityGrows.Server.teamId}\n currentUserId={CityGrows.Server.currentUserId}/>, document.getElementById('roles'));\n}\n\nfunction knew() {\n renderer(<AdminRolesContainer roles={CityGrows.Server.roles}\n workflows={CityGrows.Server.workflows}\n teamId={CityGrows.Server.teamId}\n roleName={CityGrows.Server.roleName}\n referrerLink={CityGrows.Server.referrerLink}\n currentUserId={CityGrows.Server.currentUserId}/>, document.getElementById('roles'));\n}\n\nfunction show() {\n renderer(<AdminRolesContainer roles={CityGrows.Server.roles}\n workflows={CityGrows.Server.workflows}\n teamId={CityGrows.Server.teamId}\n role={CityGrows.Server.role}\n currentUserId={CityGrows.Server.currentUserId}/>, document.getElementById('roles'));\n}\n\nexport default {\n index: index,\n new: knew,\n show: show\n};\n","import React, { StrictMode } from 'react';\nimport PropTypes from 'prop-types';\n\nconst CommonProviders = ({ children }) => (\n <StrictMode>\n {children}\n </StrictMode>\n);\n\nCommonProviders.propTypes = {\n children: PropTypes.node.isRequired,\n};\n\nexport default CommonProviders;\n","const BatchExportTemplateAPI = {\n create: (attrs) => {\n return $.ajax('/batch_export_templates', {\n dataType: 'json',\n method: 'POST',\n data: {\n batch_export_template: attrs,\n },\n });\n },\n update: (id, attrs) => {\n return $.ajax(`/batch_export_templates/${id}`, {\n dataType: 'json',\n method: 'PUT',\n data: {\n batch_export_template: attrs,\n },\n });\n },\n remove: (id) => {\n return $.ajax(`/batch_export_templates/${id}`, {\n method: 'DELETE',\n dataType: 'json',\n });\n },\n\n export: (id) => {\n return $.ajax(`/batch_export_templates/${id}/export`, {\n method: 'POST',\n dataType: 'json',\n });\n },\n};\n\nexport default BatchExportTemplateAPI;\n","const DAYS = [\n '1st',\n '2nd',\n '3rd',\n '4th',\n '5th',\n '6th',\n '7th',\n '8th',\n '9th',\n '10th',\n '11th',\n '12th',\n '13th',\n '14th',\n '15th',\n '16th',\n '17th',\n '18th',\n '19th',\n '20th',\n '21st',\n '22nd',\n '23rd',\n '24th',\n '25th',\n '26th',\n '27th',\n '28th',\n];\n\nexport default DAYS;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { confirm } from 'modules/alert-confirm';\nimport { success, error } from 'components/shared/flash';\nimport DAYS from 'constants/ordinal-constants';\n\nconst ExportTemplateRow = ({\n exportTemplate,\n onExport,\n onEdit,\n onDelete,\n}) => {\n\n const onDeleteExport = () => {\n confirm('Delete Bulk Form Export?', 'Are you sure you want to delete this Bulk Form Export?', () => {\n onDelete()\n .done(() => {\n success('Bulk Form Export deleted');\n })\n .fail(() => error());\n });\n };\n\n const onExportingExport = () => {\n onExport()\n .done(() => {\n success('Export queued. You will be emailed when your export completes');\n })\n .fail(() => error());\n };\n\n const renderForms = () => {\n return (\n <ul className='exporttemplate-exportrow'>\n {exportTemplate.items.map((i) => <li>{i.name}</li>)}\n </ul>\n );\n };\n\n const renderScheduledText = () => {\n return (\n <p className='margin-left nomargin-bottom inline-block italic'>- Scheduled to run on the {DAYS[exportTemplate.scheduled_day - 1]} of every month</p>\n )\n }\n\n return (\n <div className='margin-bottom-more'>\n <div className='exporttemplates-list-header'>\n <h2>{exportTemplate.name}</h2>\n {!!exportTemplate.scheduled_day && renderScheduledText()}\n <div className='exporttemplates-list-actions'>\n <FontAwesomeIcon\n icon={icon({ name: 'pencil' })}\n onClick={onEdit}\n title='Edit'\n />\n <FontAwesomeIcon\n icon={icon({ name: 'trash' })}\n onClick={onDeleteExport}\n title='Delete'\n />\n </div>\n </div>\n <div className=\"linebreak\"></div>\n {renderForms()}\n <button className='btn-primary inline-block' onClick={onExportingExport}>Run Export</button>\n </div>\n );\n};\nExportTemplateRow.propTypes = {\n exportTemplate: PropTypes.shape({\n name: PropTypes.string.isRequired,\n items: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string.isRequired,\n })),\n }).isRequired,\n onExport: PropTypes.func.isRequired,\n onEdit: PropTypes.func.isRequired,\n onDelete: PropTypes.func.isRequired,\n};\n\nexport default ExportTemplateRow;\n","import React, { useState, useMemo, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { reject, isNull, findIndex, isEmpty, filter } from 'underscore';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nconst MultiSelect = (props) => {\n const [options, setOptions] = useState(props.options ?? []);\n const [activeSelection, setActiveSelection] = useState(null);\n const [filterTerm, setFilterTerm] = useState('');\n\n const availableOptions = useMemo(() => {\n return filter(options, (option) => {\n let matchName = true;\n if (!isEmpty(filterTerm)) {\n matchName = option.label.toLowerCase().includes(filterTerm.toLowerCase());\n }\n return matchName && !option.selected;\n });\n }, [options, filterTerm]);\n\n const selectedOptions = useMemo(() => {\n return reject(options, (option) => {\n return !option.selected;\n });\n }, [options]);\n\n useEffect(() => {\n if (props.onSelect) {\n props.onSelect(selectedOptions.map((s) => s.value));\n }\n }, [selectedOptions]);\n\n const toggleSelect = () => {\n const dupOption = { ...activeSelection };\n dupOption.selected = !dupOption.selected;\n const dupOptions = [...options];\n const index = findIndex(dupOptions, (o) => { return o.value === dupOption.value; });\n dupOptions[index] = dupOption;\n setActiveSelection(null);\n setOptions(dupOptions);\n };\n\n const selectAll = () => {\n const dupOptions = [...options];\n dupOptions.map((option) => {\n const dupOption = option;\n dupOption.selected = true;\n return dupOption;\n });\n setOptions(dupOptions);\n };\n\n const clearAll = () => {\n const dupOptions = [...options];\n dupOptions.map((option) => {\n const dupOption = option;\n dupOption.selected = false;\n return dupOption;\n });\n setOptions(dupOptions);\n };\n\n const onFilterTermChange = (e) => {\n setFilterTerm(e.currentTarget.value);\n };\n\n const renderOption = (option) => {\n return (\n <li\n key={`option-${option.value}`}\n className={`${option.value === activeSelection?.value ? 'selected' : ''}`}\n onClick={() => setActiveSelection(option)}\n >\n {option.label}\n </li>\n );\n };\n return (\n <div className='multiselect'>\n <div className='multiselect-searchbar'>\n <input onChange={(e) => { setFilterTerm(e.target.value); }} value={filterTerm} type='text' placeholder='Search...' />\n </div>\n <div className='multiselect-list'>\n <div>\n <ul>\n {availableOptions.map(renderOption)}\n </ul>\n <button type='button' onClick={selectAll} className='btn-link'>Select All</button>\n </div>\n <div className='multiselect-controls'>\n <FontAwesomeIcon\n icon={icon({ name: 'circle-arrow-right' })}\n disabled={isNull(activeSelection) || activeSelection.selected}\n style={{ color: '#0463B7', height: '1rem' }}\n size='2xl'\n onClick={toggleSelect}\n />\n <FontAwesomeIcon\n icon={icon({ name: 'circle-arrow-left' })}\n disabled={isNull(activeSelection) || !activeSelection.selected}\n style={{ color: '#0463B7', height: '1rem' }}\n size='2xl'\n onClick={toggleSelect}\n />\n </div>\n <div>\n <ul>\n {selectedOptions.map(renderOption)}\n </ul>\n <button type='button' onClick={clearAll} className='btn-link'>Clear All</button>\n </div>\n </div>\n </div>\n );\n};\n\nMultiSelect.propTypes = {\n options: PropTypes.arrayOf(PropTypes.shape({\n value: PropTypes.number.isRequired,\n label: PropTypes.string.isRequired,\n selected: PropTypes.bool.isRequired,\n })),\n onSelect: PropTypes.func.isRequired,\n};\n\nexport default MultiSelect;\n","import React, { useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport MultiSelect from 'components/shared/multi-select';\nimport Select from 'components/shared/select';\nimport { isEmpty, isNull } from 'underscore';\nimport { success, error } from 'components/shared/flash';\nimport SlidingToggle from 'components/shared/sliding-toggle';\nimport DAYS from 'constants/ordinal-constants';\n\nconst ExportTemplate = (props) => {\n const [exportTemplate, setExportTemplate] = useState(props.exportTemplate);\n const [scheduled, setScheduled] = useState(!!props.exportTemplate.scheduled_day);\n const [monthLimited, setMonthLimited] = useState(!!props.exportTemplate.prior_months_limit);\n const days = (Array.from(Array(28).keys())).map((index) => ({\n value: index + 1,\n label: DAYS[index],\n }));\n const options = useMemo(() => {\n if (!props.flowTemplates || !exportTemplate) { return []; }\n return props.flowTemplates.map((flowTemplate) => {\n const selected = exportTemplate.item_ids.includes(flowTemplate.id);\n return { value: flowTemplate.id, label: flowTemplate.name || 'Untitled form', selected };\n });\n }, [props.flowTemplates, exportTemplate]);\n\n const toggleScheduling = () => {\n if(scheduled) {\n onExportTemplateChange({ scheduled_day: null });\n }\n setScheduled(!scheduled);\n }\n\n const toggleMonthLimited = () => {\n if(monthLimited) {\n onExportTemplateChange({ prior_months_limit: null, prior_months_type: null });\n }\n setMonthLimited(!monthLimited);\n }\n\n const isNewExportTemplate = () => {\n return isNull(exportTemplate.id);\n };\n\n const onSave = () => {\n props.onSave(exportTemplate)\n .done((r) => {\n setExportTemplate(r);\n if (isNewExportTemplate()) {\n success('Bulk Form Export created');\n } else {\n success('Bulk Form Export updated');\n props.onCancel();\n }\n })\n .fail(() => error());\n };\n\n const onSelect = (ids) => {\n const dupTemplate = { ...exportTemplate };\n dupTemplate.item_ids = ids;\n setExportTemplate(dupTemplate);\n };\n\n const onExportTemplateChange = (change) => {\n setExportTemplate({ ...exportTemplate, ...change });\n };\n\n const renderButtons = () => {\n const disabled = isEmpty(exportTemplate.name) || isEmpty(exportTemplate.item_ids);\n return (\n <div>\n <button type='button' className='btn-primary margin-right' onClick={onSave} disabled={disabled}>Save</button>\n <button type='button' className='btn-secondary' onClick={props.onCancel}>Cancel</button>\n </div>\n );\n };\n\n const renderScheduledOption = () => {\n return (\n <div className='padding-left'>\n <label>\n Scheduled Day\n <Select\n options={days}\n disabled={!scheduled}\n value={days.find(({ value }) => value === exportTemplate.scheduled_day)}\n onChange={({ value }) => onExportTemplateChange({ scheduled_day: value })}\n styles={{\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n width: '300px',\n }),\n }}\n />\n </label>\n </div>\n );\n }\n\n const renderDateLimit = () => {\n const types = [{ value: 'launched', label: 'Launched' }, { value: 'completion', label: 'Completed' }];\n return (\n <div className='padding-left'>\n <label>\n Date Limit Type\n <Select\n options={types}\n disabled={!monthLimited}\n value={types.find(({ value }) => value === exportTemplate.prior_months_type)}\n onChange={({ value }) => onExportTemplateChange({ prior_months_type: value })}\n styles={{\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n width: '300px',\n }),\n }}\n />\n </label>\n <label htmlFor='month-limit'>\n Months Prior Limit\n </label>\n <input\n type='number'\n id='month-limit'\n disabled={!monthLimited}\n value={exportTemplate.prior_months_limit}\n onChange={(e) => onExportTemplateChange({ prior_months_limit: e.target.value })}\n />\n <p className='inline'> months ago</p>\n </div>\n )\n }\n\n const renderEditSettings = () => {\n return (\n <div className='exporttemplate'>\n <label className='border-bottom padding-bottom'>\n Name\n <input\n type='text'\n value={exportTemplate.name}\n id='exporttemplatename'\n placeholder='Bulk Form Export name'\n onChange={(e) => onExportTemplateChange({ name: e.target.value })}\n style={{ width: '300px' }}\n />\n </label>\n <div className='border-bottom padding-bottom' >\n <SlidingToggle\n onToggle={toggleScheduling}\n on={scheduled}\n label='Schedule Export'\n description='When on, export will automatically generate each month on day specified'\n className='margin-top margin-bottom'\n />\n {scheduled && renderScheduledOption()}\n </div>\n <div className='border-bottom padding-bottom' >\n <SlidingToggle\n onToggle={toggleMonthLimited}\n on={monthLimited}\n label='Limit Export by Months Prior'\n description='When on, export will only include submissions that were created or finished within the past specified number of months'\n className='margin-top margin-bottom'\n />\n {monthLimited && renderDateLimit()}\n </div>\n <div className='border-bottom padding-bottom' >\n <SlidingToggle\n onToggle={() => onExportTemplateChange({ include_legacy: !exportTemplate.include_legacy })}\n on={exportTemplate.include_legacy}\n label='Include Legacy Fields'\n description='When on, export will include legacy data from deleted fields'\n className='margin-top'\n />\n </div>\n <div className='padding-bottom padding-top'>\n <label>\n Forms\n <MultiSelect\n options={options}\n onSelect={onSelect}\n />\n </label>\n\n </div>\n {renderButtons()}\n </div>\n );\n };\n\n const title = isNewExportTemplate ? 'New Bulk Form Export' : <span>Editing bulk form export: <strong>{exportTemplate.name}</strong></span>;\n\n return (\n <div className='margin-bottom-more subprocessconfig-edit'>\n <h1>{title}</h1>\n {renderEditSettings()}\n </div>\n );\n};\n\nExportTemplate.propTypes = {\n onCancel: PropTypes.func,\n onSave: PropTypes.func,\n exportTemplate: PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string.isRequired,\n item_ids: PropTypes.arrayOf(PropTypes.number.isRequired).isRequired,\n }),\n flowTemplates: PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string.isRequired,\n }).isRequired,\n};\n\nExportTemplate.defaultProps = {\n onCancel: () => {},\n onSave: () => {},\n};\n\nexport default ExportTemplate;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty, isNull, findIndex, reject } from 'underscore';\nimport BatchExportTemplateAPI from 'apis/batch-export-template-api';\nimport ExportTemplateRow from './batch-form-export-templates/export-template-row';\nimport ExportTemplate from './batch-form-export-templates/export-template';\n\nconst BatchFormExportTemplates = (props) => {\n const [exportTemplates, setExportTemplates] = useState(props.exportTemplates);\n const [exportTemplate, setExportTemplate] = useState(null);\n\n const onSave = (template) => {\n if (template.id) {\n return BatchExportTemplateAPI.update(template.id, template)\n .done((res) => {\n setExportTemplate(null);\n const dupTemplates = [...exportTemplates];\n const index = findIndex(dupTemplates, (t) => { return t.id === template.id; });\n dupTemplates[index] = res;\n setExportTemplates(dupTemplates);\n });\n }\n\n return BatchExportTemplateAPI.create(template)\n .done((res) => {\n setExportTemplate(null);\n setExportTemplates([...exportTemplates, res]);\n });\n };\n\n const onDelete = (template) => {\n return BatchExportTemplateAPI.remove(template.id)\n .done((res) => {\n const dupTemplates = reject(exportTemplates, { id: res.id });\n setExportTemplates(dupTemplates);\n });\n };\n\n const onExport = (template) => {\n return BatchExportTemplateAPI.export(template.id);\n };\n\n const onCancel = () => {\n setExportTemplate(null);\n };\n\n const onNewClick = () => {\n setExportTemplate({ name: '', item_ids: [] });\n };\n\n const onEdit = (template) => {\n setExportTemplate(template);\n };\n\n const renderExportTemplateRow = (template) => {\n return (\n <ExportTemplateRow\n exportTemplate={template}\n onEdit={() => onEdit(template)}\n onDelete={() => onDelete(template)}\n onExport={() => onExport(template)}\n />\n );\n };\n\n const renderNewExportTemplate = () => {\n return (\n <ExportTemplate\n key={isNull(exportTemplate.id) ? 'new' : exportTemplate.id}\n newExportTemplate={isNull(exportTemplate.id)}\n exportTemplate={exportTemplate}\n onSave={onSave}\n onCancel={onCancel}\n flowTemplates={props.flowTemplates}\n />\n );\n };\n\n const renderExportTemplates = () => {\n if (!isNull(exportTemplate)) {\n return renderNewExportTemplate();\n }\n let content = (\n <p>This is where export templates that you create are shown.</p>\n );\n if (!isEmpty(exportTemplates)) {\n content = exportTemplates.map((template) => renderExportTemplateRow(template));\n }\n return (\n <div>\n <button\n type='button'\n className='btn-primary margin-bottom'\n onClick={onNewClick}\n id='createnewtemplate'\n >\n + Create new Bulk Form Export\n </button>\n <div>\n {content}\n </div>\n </div>\n );\n };\n\n return renderExportTemplates();\n};\n\nBatchFormExportTemplates.propTypes = {\n exportTemplates: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n flowTemplates: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n};\n\nexport default BatchFormExportTemplates;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport CommonProviders from 'components/common-providers';\nimport BatchFormExportTemplates from '../components/batch-form-export-templates';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nfunction index() {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n renderer(\n (\n <CommonProviders>\n <BatchFormExportTemplates\n exportTemplates={CityGrows.Server.exportTemplatesData}\n flowTemplates={CityGrows.Server.flowTemplates}\n />\n </CommonProviders>\n ), document.getElementById('exporttemplates'),\n );\n}\n\nexport default {\n index,\n};\n","import React from 'react';\nimport LeftMenu from 'components/shared/left-menu';\n\nconst FinanceSubnav = (props) => {\n function renderManager() {\n return (\n <li>\n <a\n href={`/teams/${props.teamSlug}/merchant_accounts/manage`}\n className={props.activeLink === 'manage' ? 'active' : ''}\n >\n Payment Processors\n </a>\n </li>\n );\n }\n\n function renderPayoutPreferences() {\n return (\n <li>\n <a\n href={`/teams/${props.teamSlug}/merchant_accounts`}\n className={props.activeLink === 'payouts' ? 'active' : ''}\n >\n Payout Preferences\n </a>\n </li>\n );\n }\n\n return (\n <div className='finance-leftnav'>\n <LeftMenu>\n {false && renderManager()}\n {window.CityGrows.Server.isFinanceManager === true && renderPayoutPreferences()}\n <li>\n <a\n href={`/teams/${props.teamSlug}/transactions`}\n className={props.activeLink === 'transactions' ? 'active' : ''}\n >\n Transactions\n </a>\n </li>\n <li>\n <a\n href={`/teams/${props.teamSlug}/transactions/cash_and_checks`}\n className={props.activeLink === 'cash_and_checks' ? 'active' : ''}\n >\n Cash & Checks\n </a>\n </li>\n <li>\n <a\n href={`/teams/${props.teamSlug}/charge_disputes`}\n className={props.activeLink === 'disputes' ? 'active' : ''}\n >\n Charge Disputes\n </a>\n </li>\n </LeftMenu>\n </div>\n );\n};\n\nexport default FinanceSubnav;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport FinanceSubnav from '../components/shared/finance-subnav';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nconst index = () => {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n renderer(\n (\n <FinanceSubnav teamSlug={CityGrows.Server.teamId} activeLink='disputes'/>\n ), document.getElementById('finance-left-nav')\n );\n\n};\n\nconst show = () => {\n renderer(\n (\n <FinanceSubnav teamSlug={CityGrows.Server.teamId} activeLink='disputes' />\n ), document.getElementById('finance-left-nav')\n );\n\n};\n\nexport default {\n index,\n show,\n};","import keyMirror from 'keymirror'\n\nexport default keyMirror({\n ENTITY_UPDATED: null,\n CUSTOM_ADDED: null,\n CUSTOM_UPDATED: null,\n CUSTOM_REMOVED: null,\n CUSTOM_ENTITY_CREATED: null,\n CUSTOM_ENTITY_ARCHIVED: null,\n}, 'ENTITY_CONFIGURATION');\n","import { findWhere, without, filter, each } from 'underscore';\nimport invariant from 'invariant';\nimport Constants from 'constants/entity-configuration-constants';\n\nfunction entityConfigurationReducer(state, action) {\n let entity = null;\n switch (action.type) {\n case Constants.CUSTOM_ADDED:\n entity = findWhere(state.customEntities, { id: action.field.custom_entity_id });\n invariant(entity, 'Unable to find expected entity');\n\n entity.custom_entity_fields.push(action.field);\n return { ...state };\n case Constants.ENTITY_UPDATED:\n entity = findWhere(state.customEntities, { id: action.entityId });\n invariant(entity, 'Unable to find expected entity');\n Object.assign(entity, action.attrs);\n return { ...state };\n case Constants.CUSTOM_UPDATED:\n entity = findWhere(state.customEntities, { id: action.field.custom_entity_id });\n invariant(entity, 'Unable to find expected entity');\n\n let fieldToUpdate = findWhere(entity.custom_entity_fields, { id: action.field.id });\n Object.assign(fieldToUpdate, action.field);\n return { ...state };\n case Constants.CUSTOM_REMOVED:\n each(state.customEntities, (customEntity) => {\n const field = findWhere(customEntity.custom_entity_fields, { id: action.fieldId });\n if (field) {\n customEntity.custom_entity_fields = without(customEntity.custom_entity_fields, field);\n }\n });\n return { ...state };\n case Constants.CUSTOM_ENTITY_CREATED:\n return { ...state, customEntities: [...state.customEntities, action.newCustomEntity] };\n case Constants.CUSTOM_ENTITY_ARCHIVED:\n return { ...state, customEntities: filter(state.customEntities, (e) => e.id !== action.customEntityId) };\n default:\n throw new Error();\n }\n}\n\nexport default entityConfigurationReducer\n","import { createContext } from 'react';\n\nconst EntityConfigurationDispatchContext = createContext();\n\nexport default EntityConfigurationDispatchContext;\n","export const create = (teamId, isESRI, serviceURL) => {\n const url = `/teams/${teamId}/custom_entities/`;\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n custom_entity: {\n name: 'Untitled entity',\n esri_service_url: serviceURL,\n },\n is_esri: isESRI,\n }\n });\n};\n\nexport const update = (customEntityId, attrs) => {\n const url = `/custom_entities/${customEntityId}`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'PUT',\n data: {\n custom_entity: attrs,\n },\n });\n};\n\nexport const destroy = (customEntityId) => {\n const url = `/custom_entities/${customEntityId}`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'DELETE',\n });\n};\n\nexport default {\n update,\n create,\n destroy,\n};\n","const CustomEntityFieldsAPI = {\n create(customEntityId, attrs){\n const url = `/custom_entities/${customEntityId}/custom_entity_fields`;\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n custom_entity_field: attrs\n }\n });\n },\n\n delete(fieldId){\n const url = `/custom_entity_fields/${fieldId}`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n },\n\n update(fieldId, attrs){\n const url = `/custom_entity_fields/${fieldId}`;\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n custom_entity_field: attrs\n }\n });\n }\n\n\n};\n\nexport default CustomEntityFieldsAPI;\n","import NProgress from 'nprogress';\nimport CustomEntitiesAPI from 'apis/custom-entities-api';\nimport API from 'apis/custom-entity-fields-api';\nimport Constants from '../constants/entity-configuration-constants';\nimport { success, error } from '../components/shared/flash';\nimport { alert } from 'modules/alert-confirm';\n\nconst EntityConfigurationActions = {\n createEntity(teamId, isESRI, serviceURL, dispatch) {\n return CustomEntitiesAPI.create(teamId, isESRI, serviceURL)\n .done((customEntity) => {\n dispatch({\n type: Constants.CUSTOM_ENTITY_CREATED,\n newCustomEntity: customEntity,\n });\n\n success('Entity created');\n })\n .fail((res) => {\n error(res.responseJSON.errors[0]);\n });\n },\n\n updateEntity(customEntityId, attrs, dispatch) {\n return CustomEntitiesAPI.update(customEntityId, attrs)\n .done(() => {\n dispatch({\n type: Constants.ENTITY_UPDATED,\n entityId: customEntityId,\n attrs,\n });\n })\n .fail((res) => { error(res.responseText); })\n .always(() => { NProgress.done(); });\n },\n\n addField(customEntityId, attrs, dispatch) {\n NProgress.start();\n\n return API.create(customEntityId, attrs)\n .done((res) => {\n dispatch({\n type: Constants.CUSTOM_ADDED,\n field: res,\n });\n })\n .fail((res) => { error(res.responseText); })\n .always(() => { NProgress.done(); });\n },\n\n removeField(fieldId, dispatch) {\n return API.delete(fieldId)\n .done(() => {\n dispatch({\n type: Constants.CUSTOM_REMOVED,\n fieldId,\n });\n })\n .fail(() => { error(); })\n .always(() => { NProgress.done(); });\n },\n\n updateField(fieldId, attrs, dispatch) {\n return API.update(fieldId, attrs)\n .done((res) => {\n dispatch({\n type: Constants.CUSTOM_UPDATED,\n field: res,\n });\n })\n .fail(() => { error(); })\n .always(() => { NProgress.done(); });\n },\n\n archive(customEntityId, dispatch) {\n NProgress.start();\n\n return CustomEntitiesAPI.destroy(customEntityId)\n .done(() => {\n dispatch({\n type: Constants.CUSTOM_ENTITY_ARCHIVED,\n customEntityId,\n });\n\n success('Entity archived');\n })\n .fail((res) => {\n if (res.status === 422) {\n alert(\"Entity in-use\", res.responseJSON.errors[0]);\n } else {\n error();\n }\n })\n .always(() => { NProgress.done(); });\n },\n};\n\nexport default EntityConfigurationActions;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst LinkyButton = ({ className, ...restProps }) => (\n <button type='button' className={`btn-link ${className}`} {...restProps} />\n);\n\nLinkyButton.propTypes = {\n className: PropTypes.string,\n};\n\nLinkyButton.defaultProps = {\n className: '',\n};\n\nexport default LinkyButton;\n","import React, { useState, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport EntityConfigurationActions from 'actions/entity-configuration-actions';\nimport SlidingToggle from 'components/shared/sliding-toggle';\nimport EntityConfigurationDispatchContext from 'contexts/entity-configuration-dispatch-context';\nimport { error } from 'components/shared/flash';\nimport { confirm } from 'modules/alert-confirm';\n\nconst CustomEntityField = (props) => {\n const dispatch = useContext(EntityConfigurationDispatchContext);\n const [viewable, setViewable] = useState(props.field.viewable);\n const [name, setName] = useState(props.field.name);\n const [editSuggestable, setEditSuggestable] = useState(props.field.edit_suggestable);\n const [editingName, setEditingName] = useState(false);\n\n const nameBlank = () => {\n if (name === '') {\n error('Name can\\'t be blank');\n return true;\n }\n\n return false;\n };\n\n const updateName = (e) => {\n setName(e.target.value);\n };\n\n const saveNewEntity = () => {\n if (nameBlank()) { return; }\n\n const attrs = {\n name,\n viewable,\n edit_suggestable: editSuggestable,\n data_type: 'string',\n };\n\n EntityConfigurationActions.addField(props.customEntityId, attrs, dispatch)\n .done(props.onNewFieldAdded);\n };\n\n const saveName = () => {\n if (nameBlank()) { return; }\n\n if (props.field.name === name) {\n setEditingName(false);\n return;\n }\n\n updateField('name', name)\n .done(() => { setEditingName(false); });\n };\n\n const editName = (e) => {\n e.preventDefault();\n setEditingName(true);\n };\n\n const deleteField = (e) => {\n e.preventDefault();\n\n if (props.field.data_count > 0) {\n confirm('Delete this field?', 'This will also delete each organization\\'s data associated with this field.', () => {\n EntityConfigurationActions.removeField(props.field.id, dispatch);\n });\n } else {\n EntityConfigurationActions.removeField(props.field.id, dispatch);\n }\n };\n\n const onViewableChanged = () => {\n if (!props.new) {\n updateField('viewable', !props.field.viewable);\n }\n\n setViewable(!props.field.viewable);\n };\n\n const onEditableChanged = () => {\n if (!props.new) {\n updateField('edit_suggestable', !props.field.edit_suggestable);\n }\n\n setEditSuggestable(!props.field.edit_suggestable);\n };\n\n const updateField = (key, value = e) => {\n const attrs = { };\n attrs[`${key}`] = value;\n\n return EntityConfigurationActions.updateField(props.field.id, attrs, dispatch);\n };\n\n const viewToggle = () => {\n return (\n <SlidingToggle\n onToggle={onViewableChanged}\n on={viewable}\n label='View'\n disabled={props.disabled}\n className='margin-right'\n />\n );\n };\n\n const editToggle = () => {\n if (!viewable || props.isEsri) { return ''; }\n\n return (\n <SlidingToggle\n onToggle={onEditableChanged}\n on={editSuggestable}\n disabled={props.disabled}\n label='Suggest edits'\n className='margin-right'\n />\n );\n };\n\n const deleteButton = () => {\n return (\n <i title='Delete field' onClick={deleteField} className='icon-trash-grey bigger clickable' />\n );\n };\n\n const nameField = () => {\n const readOnly = !props.new && !editingName;\n const editable = !props.new && !props.disabled && !props.isEsri;\n return (\n <div>\n <div className='entityconfiguration-name custom'>\n <input\n type='text'\n autoComplete='off'\n className={`custom-entity-field-input ${readOnly ? 'readOnly' : ''}`}\n name='name'\n placeholder='Add field name'\n readOnly={readOnly}\n onChange={updateName}\n value={name}\n />\n {editable && editNameAction()}\n </div>\n\n {props.disabled && (\n <span className='float-right'>Uneditable</span>\n )}\n </div>\n );\n };\n\n const editNameAction = () => {\n if (props.isEsri) { return; }\n \n if (editingName) {\n return <button type='button' onClick={saveName}>Save</button>;\n }\n\n return <a href='#' className='secondary' onClick={editName}>Edit</a>;\n };\n\n function actionButtons() {\n return (\n <div className='float-right padding-top'>\n <button type='button' className='btn-link' onClick={props.cancelNewField}>Cancel</button>\n <button type='button' className='margin-left btn-primary' onClick={saveNewEntity}>Save Field</button>\n </div>\n );\n }\n\n const showDelete = !props.new && !props.disabled && !props.isEsri;\n\n return (\n <li>\n <div>\n {nameField()}\n </div>\n\n <div className='entityconfiguration-field-options'>\n Constituents can:\n <span className='entityconfiguration-field- margin-right-less margin-left'>\n {viewToggle()}\n {!props.isEsri && editToggle()}\n </span>\n {showDelete && deleteButton()}\n </div>\n \n {props.new && actionButtons()}\n </li>\n );\n};\n\nCustomEntityField.propTypes = {\n new: PropTypes.bool,\n disabled: PropTypes.bool,\n field: PropTypes.object,\n customEntityId: PropTypes.number,\n onNewFieldAdded: PropTypes.func,\n cancelNewField: PropTypes.func,\n isEsri: PropTypes.bool.isRequired,\n};\n\nexport default CustomEntityField;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport Select from 'components/shared/select';\nimport EntityConfigurationActions from 'actions/entity-configuration-actions';\nimport { success } from '../../shared/flash';\n\nconst TitleFieldSelector = ({ customEntity, dispatch }) => {\n const optionsForSelect = () => {\n return customEntity.custom_entity_fields.map((f) => ({ label: f.name, value: f.id }));\n };\n\n const selectedNameField = () => {\n return optionsForSelect().find(f => f.value === customEntity.name_field_id);\n };\n\n const onChange = (newVal) => {\n const { value } = newVal;\n EntityConfigurationActions.updateEntity(customEntity.id, { name_field_id: value }, dispatch)\n .done(() => { success('Name field updated'); });\n };\n\n return (\n <div className='well'>\n <p>Select a field to use to as the entity name</p>\n <Select\n id='sort-select'\n options={optionsForSelect()}\n value={selectedNameField()}\n onChange={onChange}\n />\n </div>\n );\n};\n\nexport default TitleFieldSelector;\n","import React, { useState, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n TR, TD,\n} from 'components/shared/manageable-table';\nimport EmbeddedTextInput from 'components/shared/embedded-text-input';\nimport EntityConfigurationActions from 'actions/entity-configuration-actions';\nimport { debounce } from 'underscore';\nimport EntityConfigurationDispatchContext from 'contexts/entity-configuration-dispatch-context';\nimport LinkyButton from 'components/shared/linky-button';\nimport CustomEntityField from './custom-entity-field';\nimport { confirm } from '../../modules/alert-confirm';\nimport TitleFieldSelector from './custom-entity/title-field-selector';\n\nconst CustomEntity = (props) => {\n const dispatch = useContext(EntityConfigurationDispatchContext);\n const [newField, setNewField] = useState(false);\n\n const nameField = () => {\n const field = {\n viewable: true,\n edit_suggestable: true,\n name: 'Name',\n };\n\n return (\n <CustomEntityField\n key='name'\n new={false} \n field={field}\n isEsri={isEsri()}\n disabled\n />\n );\n };\n\n const customFields = (customEntity) => {\n return customEntity.custom_entity_fields.map((field) => {\n return (\n <CustomEntityField\n key={field.id}\n new={false}\n field={field}\n isEsri={isEsri()}\n />\n );\n });\n };\n\n const newFieldSection = () => {\n const customEntity = props.customEntity;\n\n if (newField) {\n const field = {\n name: '', data_type: 'string', viewable: false, edit_suggestable: false,\n };\n\n return (\n <CustomEntityField\n key='new'\n field={field}\n new\n customEntityId={customEntity.id}\n isEsri={isEsri()}\n cancelNewField={() => { setNewField(false); }}\n onNewFieldAdded={() => { setNewField(false); }}\n />\n );\n }\n\n return newFieldButton();\n };\n\n const newFieldButton = () => {\n return (\n <li className='entityconfiguration-add-field'>\n <button\n type='button'\n onClick={() => { setNewField(true); }}\n id='addfieldbutton'\n >\n + Add field\n </button>\n </li>\n );\n };\n\n const onEntityNameChanged = debounce((newName) => {\n EntityConfigurationActions.updateEntity(props.customEntity.id, {\n name: newName,\n }, dispatch);\n }, 500);\n\n const onArchiveClick = () => {\n confirm(`Archive ${props.customEntity.name}?`, 'Are you sure you want to archive this entity?', () => {\n EntityConfigurationActions.archive(props.customEntity.id, dispatch);\n });\n };\n\n const isEsri = () => {\n return props.customEntity.type === 'EsriCustomEntity';\n };\n \n const renderEntityTypeInfo = () => {\n if (isEsri()) {\n return \"ESRI\";\n }\n };\n \n const expandedContent = (\n <>\n {isEsri() && (\n <TitleFieldSelector\n customEntity={props.customEntity}\n dispatch={dispatch}\n />\n )}\n <ul className='entityconfiguration'>\n {nameField()}\n {customFields(props.customEntity)}\n {!isEsri() && (\n newFieldSection()\n )}\n </ul>\n <>\n <div className='linebreak' />\n <LinkyButton\n className='text-alert'\n onClick={onArchiveClick}\n >\n Archive this entity\n </LinkyButton>\n </>\n </>\n );\n\n return (\n <TR expandedContent={expandedContent}>\n <TD>\n <EmbeddedTextInput\n onChange={onEntityNameChanged}\n defaultValue={props.customEntity.name}\n size='small'\n placeholder='Entity name'\n />\n <span\n className='vmiddle bold margin-left color-text-medium typelabel'\n >\n {renderEntityTypeInfo()}\n </span>\n </TD>\n </TR>\n );\n};\n\nCustomEntity.propTypes = {\n customEntity: PropTypes.shape({}).isRequired,\n};\n\nexport default CustomEntity;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport Select from 'components/shared/select';\nimport EntityConfigurationActions from 'actions/entity-configuration-actions';\n\n\nconst CreateDialog = ({\n teamId,\n dispatch,\n onEntityCreated,\n esriIsEnabled,\n}) => {\n\n let options = [\n {\n value: false,\n label: 'Standard entity',\n }\n ];\n \n if (esriIsEnabled) {\n options.push({\n value: true,\n label: 'ESRI entity',\n });\n }\n\n const [isESRI, setIsESRI] = useState(false);\n const [serviceURL, setServiceURL] = useState();\n\n const onClick = () => {\n EntityConfigurationActions.createEntity(teamId, isESRI, serviceURL, dispatch)\n .done(onEntityCreated);\n };\n\n return (\n <div\n className='well padded margins nomargin-top margin-bottom-more'\n >\n <Select\n defaultValue={options[0]}\n allow\n options={options}\n onChange={(newVal) => setIsESRI(newVal.value)}\n />\n {isESRI && (\n <input\n type='text'\n id='serviceurl'\n placeholder='ESRI service URL'\n onChange={(e) => { setServiceURL(e.currentTarget.value) }}\n value={serviceURL}\n />\n )}\n <button\n type='button'\n className='btn-primary margin-top'\n id='createbutton'\n onClick={onClick}\n >\n Create\n </button>\n </div>\n );\n};\n\nCreateDialog.propTypes = {\n onEntityCreated: PropTypes.func,\n dispatch: PropTypes.func.isRequired,\n teamId: PropTypes.number.isRequired,\n esriIsEnabled: PropTypes.bool.isRequired,\n};\n\nCreateDialog.defaultProps = {\n onEntityCreated: () => {},\n}\n\nexport default CreateDialog;\n","import React, { useReducer, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport entityConfigurationReducer from 'reducers/entity-configuration-reducer';\nimport EntityConfigurationDispatchContext from 'contexts/entity-configuration-dispatch-context';\nimport ManageableTable, {\n THead, TH, TBody,\n} from 'components/shared/manageable-table';\nimport CustomEntity from './entity-configuration/custom-entity';\nimport CreateDialog from './entity-configuration/create-dialog';\n\nconst EntityConfiguration = ({\n customEntities,\n teamId,\n esriIsEnabled,\n}) => {\n const [entityConfigurationState, entityConfigurationDispatch] = useReducer(entityConfigurationReducer, { customEntities });\n const [creatingNewEntity, setCreatingNewEntity] = useState(false);\n\n const renderCustomEntity = (customEntity) => {\n return (\n <CustomEntity key={customEntity.id} customEntity={customEntity} />\n );\n };\n\n const renderCustomEntities = () => {\n return entityConfigurationState.customEntities.map(renderCustomEntity);\n };\n\n const onCreateEntityClick = () => {\n setCreatingNewEntity(true);\n };\n\n return (\n <ManageableTable>\n <div className='role-indexheader'>\n <h2 className='inline-block nomargin-bottom'>Entities</h2>\n <a target='__blank' href='https://support.cleargov.com/hc/en-us/articles/14699585627923-All-about-Entities-' className='secondary margin-left'>Learn about entities</a>\n <button\n type='button'\n className='btn-link strong float-right'\n onClick={onCreateEntityClick}\n id='createnewentity'\n >\n + Create new entity\n </button>\n </div>\n { creatingNewEntity && (\n <CreateDialog\n teamId={teamId}\n dispatch={entityConfigurationDispatch}\n onEntityCreated={() => { setCreatingNewEntity(false); }}\n esriIsEnabled={esriIsEnabled}\n />\n )}\n <THead>\n <TH>\n Entity name\n </TH>\n </THead>\n\n <TBody>\n <EntityConfigurationDispatchContext.Provider value={entityConfigurationDispatch}>\n {renderCustomEntities()}\n </EntityConfigurationDispatchContext.Provider>\n </TBody>\n </ManageableTable>\n );\n};\n\nEntityConfiguration.propTypes = {\n teamId: PropTypes.number.isRequired,\n customEntities: PropTypes.arrayOf(PropTypes.shape({\n custom_entity_fields: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n id: PropTypes.number.isRequired,\n })),\n esriIsEnabled: PropTypes.bool.isRequired,\n};\n\nexport default EntityConfiguration;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport CommonProviders from 'components/common-providers';\nimport EntityConfiguration from '../components/entity-configuration';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nfunction index() {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n renderer(\n (\n <CommonProviders>\n <EntityConfiguration\n customEntities={CityGrows.Server.custom_entity_data}\n teamId={CityGrows.Server.team.id}\n esriIsEnabled={CityGrows.Server.esriIsEnabled}\n />\n </CommonProviders>\n ), document.getElementById('entity_configuration'),\n );\n}\n\nexport default {\n index,\n};\n","import keyMirror from 'keymirror';\n\nexport const FILTER_NAMES = {\n APPLICANT: 'applicant',\n LAUNCHED_AT: 'launchedAt',\n CURRENT_STEP_TIME: 'currentStepTime',\n COMPLETION_DATE: 'completionDate',\n COMPLETION_STATUS: 'completionStatus',\n IMPORTED: 'imported',\n ISSUED_AT: 'issuedAt',\n TAG: 'tag',\n OUTPUT_STATUS: 'outputStatus',\n RENEWAL: 'renewal',\n CUSTOM_ID: 'customId',\n CURRENT_STEP: 'currentStepId',\n WORKFLOW_STATUS: 'workflowStatus',\n};\n\nexport default keyMirror({\n ITEMS_LOADED: null,\n MORE_ITEMS_LOADED: null,\n STEP_DATA_LOADED: null,\n ITEMS_LOADING: null,\n LOAD_FAILED: null,\n}, 'DASHBOARD');\n","import Stapes from 'stapes';\nimport Dispatcher from '../appdispatcher';\nimport DashboardConstants from '../constants/dashboard-constants';\n\nlet _initiatedFlows = [];\nlet _totalCount = 0;\nlet _currentTemplateStepData = null;\nlet _currentPosition = 0;\nlet _batchSize = 0;\nlet _totalLoadedCount = 0;\n\nconst DashboardStore = Stapes.subclass({\n getInitiatedFlows() {\n return _initiatedFlows;\n },\n\n getTotalInitiatedFlowCount() {\n return _totalCount;\n },\n\n getTotalLoadedInitiatedFlowCount() {\n return _totalLoadedCount;\n },\n\n getStepData() {\n return _currentTemplateStepData;\n },\n\n getNextBatchSize() {\n if (_totalCount === 0) return 0;\n _currentPosition += _batchSize;\n const difference = _totalCount - _totalLoadedCount;\n return difference < _batchSize ? difference : _batchSize;\n },\n\n});\nconst store = new DashboardStore();\n\nconst addNewItems = (items, position) => {\n // Sometimes more items get loaded right after we go\n // into loading state and _initiatedFlows gets cleared.\n\n if (_initiatedFlows) {\n _initiatedFlows.splice(position, items.length, ...items);\n _batchSize = items.length;\n _totalLoadedCount += items.length;\n }\n};\n\nDispatcher.register((action) => {\n switch (action.actionType) {\n case DashboardConstants.ITEMS_LOADED:\n _initiatedFlows = new Array(action.total_count);\n _totalCount = action.total_count;\n addNewItems(action.items, 0);\n store.emit('change');\n break;\n case DashboardConstants.MORE_ITEMS_LOADED:\n addNewItems(action.items, action.index);\n store.emit('loadmore');\n break;\n case DashboardConstants.ITEMS_LOADING:\n _initiatedFlows = null;\n _batchSize = 0;\n _totalLoadedCount = 0;\n store.emit('change');\n break;\n case DashboardConstants.STEP_DATA_LOADED:\n _currentTemplateStepData = action.stepData;\n store.emit('change');\n break;\n case DashboardConstants.LOAD_FAILED:\n _initiatedFlows = [];\n _batchSize = 0;\n _totalLoadedCount = 0;\n store.emit('change');\n break;\n default:\n break;\n }\n});\n\nexport default store;\n","import { sortBy } from 'underscore';\n\nconst OPERATOR_IS = { id: 'is', label: 'Is' };\nconst OPERATOR_IS_NOT = { id: 'is_not', label: 'Is not' };\nconst OPERATOR_RANGE = { id: 'range', label: 'Between' };\nconst OPERATOR_LESS = { id: 'less', label: 'Less than' };\nconst OPERATOR_LONGER = { id: 'longer', label: 'Longer than' };\n\nexport const WORKFLOW_STATUSES = [\n { id: 'all', label: 'All' },\n { id: 'published', label: 'Published' },\n { id: 'unpublished', label: 'Unpublished' },\n { id: 'closed', label: 'Closed' },\n { id: 'archived', label: 'Archived' },\n];\n\nexport const COMPLETION_STATUSES = [\n { id: 'active', label: 'Active' },\n { id: 'completed', label: 'Completed' },\n { id: 'halted', label: 'Halted' },\n { id: 'all', label: 'All' },\n];\n\nexport const DATE_TERMS = [\n { id: 'minutes', label: 'Minutes' },\n { id: 'hours', label: 'Hours' },\n { id: 'days', label: 'Days' },\n];\n\nexport const IMPORTED_OPTIONS = [\n { id: 'all', label: 'All' },\n { id: 'not_imported', label: 'Not imported' },\n { id: 'imported', label: 'Imported' },\n { id: 'specific_import', label: 'Specific import' },\n];\n\nexport const OUTPUT_STATUSES = [\n { id: 'all', label: 'All' },\n { id: 'issued', label: 'Issued' },\n { id: 'expired', label: 'Expired' },\n { id: 'unissued', label: 'Unissued' },\n { id: 'revoked', label: 'Revoked' },\n];\n\nexport const RENEWAL_STATUSES = [\n { id: 'all', label: 'All' },\n { id: 'renewal', label: 'Is renewal' },\n { id: 'not_renewal', label: 'Not renewal' },\n];\n\nconst TEAM_SELECT = {\n id: 'team',\n label: 'Team',\n type: 'teamSelect',\n filterGroup: 'main',\n defaults: {\n value: [],\n operator: OPERATOR_IS.id\n },\n operators: [\n OPERATOR_IS,\n OPERATOR_IS_NOT,\n ]\n};\n\nconst FORM_SELECT = {\n id: 'form',\n label: 'Form',\n type: 'formSelect',\n filterGroup: 'main',\n defaults: {\n value: [],\n operator: OPERATOR_IS.id,\n options: {\n status: 'all'\n }\n },\n operators: [\n OPERATOR_IS,\n OPERATOR_IS_NOT,\n ]\n};\n\nconst OUTPUT_STATUS_SELECT = {\n id: 'output_status',\n label: 'Output status',\n type: 'outputStatus',\n filterGroup: 'main',\n defaults: {\n value: 'issued',\n operator: OPERATOR_IS.id,\n },\n operators: [\n OPERATOR_IS\n ]\n};\n\nconst RENEWAL_STATUS_SELECT = {\n id: 'renewal_status',\n label: 'Renewal',\n type: 'renewalStatus',\n filterGroup: 'main',\n defaults: {\n value: 'all',\n operator: OPERATOR_IS.id,\n },\n operators: [\n OPERATOR_IS\n ]\n};\n\nexport const CURRENT_STEP_SELECT = {\n id: 'current_step',\n label: 'Current step',\n type: 'currentStep',\n filterGroup: 'formFields',\n defaults: {\n operator: OPERATOR_IS.id\n },\n operators: [\n OPERATOR_IS,\n OPERATOR_IS_NOT,\n ]\n};\n\nexport const DIMENSIONS = [\n TEAM_SELECT,\n FORM_SELECT,\n {\n id: 'assigned_to_me',\n label: 'Only assigned to me',\n type: 'assignedToggle',\n filterGroup: 'main',\n defaults: {\n value: true\n },\n operators: []\n },\n {\n id: 'applicant',\n label: 'Applicant',\n type: 'applicantSearch',\n filterGroup: 'main',\n defaults: {\n operator: OPERATOR_IS.id,\n options: {\n applicant: null\n },\n },\n operators: [\n OPERATOR_IS,\n OPERATOR_IS_NOT,\n ]\n },\n {\n id: 'launched_at',\n label: 'Launched at',\n type: 'launchedAt',\n filterGroup: 'main',\n defaults: {\n value: [null, null],\n operator: OPERATOR_RANGE.id\n },\n operators: [\n OPERATOR_RANGE,\n ]\n },\n {\n id: 'current_step_time',\n label: 'Time in current step',\n type: 'currentStepTime',\n filterGroup: 'main',\n defaults: {\n value: 1,\n operator: OPERATOR_LONGER.id,\n options: {\n term: 'days'\n }\n },\n operators: [\n OPERATOR_LONGER,\n OPERATOR_LESS\n ]\n },\n {\n id: 'completed_date',\n label: 'Completion date',\n type: 'completedDate',\n filterGroup: 'main',\n defaults: {\n value: [null, null],\n operator: OPERATOR_RANGE.id\n },\n operators: [\n OPERATOR_RANGE,\n ]\n },\n {\n id: 'completed_status',\n label: 'Completion status',\n type: 'completedStatus',\n filterGroup: 'main',\n defaults: {\n value: 'active',\n operator: OPERATOR_IS.id\n },\n operators: [\n OPERATOR_IS,\n OPERATOR_IS_NOT,\n ]\n },\n {\n id: 'imported',\n label: 'Imported',\n type: 'importedSelect',\n filterGroup: 'main',\n defaults: {\n value: 'all',\n operator: OPERATOR_IS.id,\n options: {\n source_id: 'all'\n }\n },\n operators: [\n OPERATOR_IS\n ]\n },\n {\n id: 'tag',\n label: 'Tag',\n type: 'tagSelect',\n filterGroup: 'main',\n defaults: {\n operator: OPERATOR_IS.id,\n value: [],\n },\n operators: [\n OPERATOR_IS,\n OPERATOR_IS_NOT\n ]\n },\n OUTPUT_STATUS_SELECT,\n RENEWAL_STATUS_SELECT,\n {\n id: 'submission',\n label: 'Submission ID',\n type: 'submission',\n filterGroup: 'main',\n defaults: {\n operator: OPERATOR_IS.id,\n },\n operators: [\n OPERATOR_IS\n ]\n },\n];\n\nexport const getSubmissionDimensions = () => {\n const options = sortBy(DIMENSIONS, 'label');\n return [{ id: 'main', options }];\n};\n\nexport const getOutputDimensions = () => {\n const options = [\n TEAM_SELECT,\n FORM_SELECT,\n OUTPUT_STATUS_SELECT,\n {\n id: 'output_issued',\n label: 'Issued date',\n type: 'outputIssued',\n filterGroup: 'main',\n defaults: {\n value: [null, null],\n operator: OPERATOR_RANGE.id\n },\n operators: [\n OPERATOR_RANGE,\n ]\n },\n RENEWAL_STATUS_SELECT,\n {\n id: 'output_renewals_enabled',\n label: 'Renewals enabled',\n type: 'outputRenewalsEnabled',\n filterGroup: 'main',\n defaults: {\n value: 'true'\n },\n operators: []\n },\n ];\n return [{ id: 'main', options: sortBy(options, 'label') }];\n};\n","import React, { createContext, useContext, useReducer } from 'react';\nimport { contains, flatten, map, reject, sortBy, findIndex } from 'underscore';\n\nimport DashboardStore from 'stores/dashboard-store';\nimport { CURRENT_STEP_SELECT, getSubmissionDimensions } from './constants';\n\nconst AdvancedFilterContext = createContext({\n activeFilters: [],\n availableFilters: [],\n currentFilter: {},\n savedFilters: [],\n triggerRefresh: 1,\n defaultFilters: [],\n});\nconst AdvancedFilterDispatchContext = createContext(null);\n\nexport const AdvancedFilterProvider = ({\n initial,\n children\n}) => {\n const [state, dispatch] = useReducer(advancedFilterReducer, initial);\n\n return (\n <AdvancedFilterContext.Provider value={state}>\n <AdvancedFilterDispatchContext.Provider value={dispatch}>\n {children}\n </AdvancedFilterDispatchContext.Provider>\n </AdvancedFilterContext.Provider>\n );\n};\n\nexport const useAdvancedFilterContext = () => {\n return useContext(AdvancedFilterContext);\n};\n\nexport const useAdvancedFilterDispatchContext = () => {\n return useContext(AdvancedFilterDispatchContext);\n};\n\nconst buildDatumField = (field, groupName, sectionName) => {\n return {\n id: field.identity,\n label: `${sectionName}: ${field.name}`,\n type: 'datumField',\n filterGroup: groupName,\n fieldType: field.data_type,\n multipleChoiceOptions: field.multiple_choice_options,\n operators: [],\n }\n};\n\nconst addToFiltersGroup = (filters, item) => {\n return map(filters, (group) => {\n if (group.id === item.filterGroup) {\n group.options = sortBy([...group.options, item], 'label');\n }\n return group;\n });\n};\n\nconst removeFromFiltersGroup = (filters, item) => {\n return map(filters, (group) => {\n if (group.id == item.filterGroup) {\n group.options = reject(group.options, (filter) => filter.id === item.id);\n }\n return group;\n });\n}\n\nfunction loadFilter (state, savedFilter) {\n const { filters, step_data_for_search } = savedFilter;\n\n if (!filters) { return state };\n\n const filterIds = Object.keys(filters);\n\n const datumFiltersIds = filters.datum_fields\n ? Object.entries(filters.datum_fields.value).map(([id, _]) => id)\n : [];\n // Current step is counted as datum field\n if (filters.current_step) {\n datumFiltersIds.push('current_step');\n }\n\n let filtersGroups = getSubmissionDimensions();\n\n if (step_data_for_search) {\n let datumFields = Object.entries(step_data_for_search.data).map(([sectionName, fields]) => {\n return fields.map(field => buildDatumField(field, 'formFields', sectionName));\n });\n\n let legacyDatumFields = Object.entries(step_data_for_search.legacy_data).map(([sectionName, fields]) => {\n return fields.map(field => buildDatumField(field, 'legacyFormFields', sectionName));\n });\n\n const formFields = {\n id: 'formFields',\n label: 'Form Fields',\n options: [CURRENT_STEP_SELECT, ...flatten(datumFields)]\n };\n\n const legacyFormFields = {\n id: 'legacyFormFields',\n label: 'Legacy Fields',\n options: [...flatten(legacyDatumFields)]\n };\n\n filtersGroups = [...filtersGroups, formFields, legacyFormFields];\n }\n\n let availableFilters = map(filtersGroups, (group) => {\n if (group.id == 'main') {\n return {\n ...group,\n options: group.options.filter((filter) => !contains(filterIds, filter.id)),\n };\n }\n if (group.id == 'formFields') {\n return {\n ...group,\n options: group.options.filter((filter) => !contains(datumFiltersIds, filter.id)),\n };\n }\n if (group.id == 'legacyFormFields') {\n return {\n ...group,\n options: group.options.filter((filter) => !contains(datumFiltersIds, filter.id)),\n };\n }\n return group;\n });\n\n const activeFilters = flatten(map(filtersGroups, (group) => {\n if (group.id == 'main') {\n return group.options.filter((filter) => contains(filterIds, filter.id))\n }\n if (group.id == 'formFields') {\n return group.options.filter((filter) => contains(datumFiltersIds, filter.id))\n }\n if (group.id == 'legacyFormFields') {\n return group.options.filter((filter) => contains(datumFiltersIds, filter.id))\n }\n return [];\n }));\n\n return {\n ...state,\n activeFilters,\n availableFilters,\n currentFilter: filters,\n stepDataForSearch: savedFilter.step_data_for_search,\n triggerRefresh: state.triggerRefresh + 1,\n isDefault: false,\n };\n}\n\nconst advancedFilterReducer = (state, action) => {\n switch (action.type) {\n case 'addFilter': {\n const newState = {\n ...state,\n activeFilters: [...state.activeFilters, action.value],\n availableFilters: removeFromFiltersGroup(state.availableFilters, action.value),\n };\n\n if (action.value.type === 'datumField') {\n return {\n ...newState,\n triggerRefresh: state.triggerRefresh + 1,\n currentFilter: {\n ...newState.currentFilter,\n 'datum_fields': newState.currentFilter.datum_fields || {}\n },\n }\n }\n\n return {\n ...newState,\n triggerRefresh: state.triggerRefresh + 1,\n isDefault: false,\n currentFilter: {\n ...newState.currentFilter,\n [action.value.id]: { ...action.value.defaults }\n },\n };\n }\n\n case 'changeFilterOperator': {\n let currentFilter = state.currentFilter;\n currentFilter[action.filter.id].operator = action.operator.id;\n\n return {\n ...state,\n currentFilter: currentFilter,\n triggerRefresh: state.triggerRefresh + 1,\n isDefault: false,\n };\n }\n\n case 'changeFilterValue': {\n let currentFilter = state.currentFilter;\n currentFilter[action.filter.id].value = action.value;\n\n return {\n ...state,\n currentFilter: currentFilter,\n triggerRefresh: state.triggerRefresh + 1,\n isDefault: false,\n };\n }\n\n case 'changeFilterValueOptions': {\n let currentFilter = state.currentFilter;\n currentFilter[action.filter.id].options = action.value;\n\n return {\n ...state,\n currentFilter: currentFilter,\n triggerRefresh: state.triggerRefresh + 1,\n isDefault: false,\n };\n }\n\n case 'deleteFilter': {\n const newState = {\n ...state,\n activeFilters: reject(state.activeFilters, (filter) => filter.id == action.value.id),\n availableFilters: addToFiltersGroup(state.availableFilters, action.value),\n };\n\n if (action.value.type == 'datumField') {\n let datumFields = {...newState.currentFilter.datum_fields.value};\n delete datumFields[action.value.id];\n\n return {\n ...newState,\n triggerRefresh: state.triggerRefresh + 1,\n currentFilter: {\n ...newState.currentFilter,\n 'datum_fields': {\n value: datumFields\n }\n },\n }\n }\n\n let currentFilter = newState.currentFilter;\n delete currentFilter[action.value.id];\n\n return {\n ...newState,\n currentFilter: currentFilter,\n isDefault: false,\n triggerRefresh: state.triggerRefresh + 1,\n };\n }\n\n case 'disableStepDataFilters': {\n const inDatumFields = id => contains(['formFields', 'legacyFormFields'], id);\n\n return {\n ...state,\n activeFilters: reject(state.activeFilters, filter => inDatumFields(filter.filterGroup)),\n availableFilters: reject(state.availableFilters, group => inDatumFields(group.id)),\n currentFilter: {\n ...state.currentFilter,\n 'current_step': null,\n 'datum_fields': null,\n },\n stepDataForSearch: null,\n };\n }\n\n case 'enableStepDataFilters': {\n let datumFields = Object.entries(DashboardStore.getStepData().data).map(([sectionName, fields]) => {\n return fields.map(field => buildDatumField(field, 'formFields', sectionName));\n });\n\n let legacyDatumFields = Object.entries(DashboardStore.getStepData().legacy_data).map(([sectionName, fields]) => {\n return fields.map(field => buildDatumField(field, 'legacyFormFields', sectionName));\n });\n\n const formFields = {\n id: 'formFields',\n label: 'Form Fields',\n options: [CURRENT_STEP_SELECT, ...flatten(datumFields)]\n };\n\n const legacyFormFields = {\n id: 'legacyFormFields',\n label: 'Legacy Fields',\n options: [...flatten(legacyDatumFields)]\n };\n\n return {\n ...state,\n availableFilters: [...state.availableFilters, formFields, legacyFormFields],\n stepDataForSearch: null,\n }\n }\n\n case 'loadFilter': {\n const savedFilter = JSON.parse(JSON.stringify(state.savedFilters.find(filter => filter.id === action.value)));\n\n return {\n ...loadFilter(state, savedFilter),\n loadedFilter: {\n id: savedFilter.id,\n name: savedFilter.name,\n default: savedFilter.default,\n }\n }\n }\n\n case 'loadState': {\n // When loading the state we dont want to overwrite the saved filters with potentially cached and outdated data\n return { ...action.value, savedFilters: [...state.savedFilters] }\n }\n\n case 'loadDefault': {\n const groups = getSubmissionDimensions();\n\n const mainGroup = groups.find(group => group.id == 'main');\n let currentFilters = {}\n \n state.defaultFilters.forEach((filterId) => {\n const filter = mainGroup.options.find(item => item.id == filterId);\n if (filter) {\n currentFilters[filterId] = { ...filter.defaults };\n }\n });\n\n return {\n ...state,\n activeFilters: flatten(map(groups, (group) => {\n if (group.id == 'main') {\n return group.options.filter((filter) => contains(state.defaultFilters, filter.id))\n }\n return [];\n })),\n\n availableFilters: map(groups, (group) => {\n if (group.id == 'main') {\n return {\n ...group,\n options: group.options.filter((filter) => !contains(state.defaultFilters, filter.id)),\n };\n }\n return group;\n }),\n currentFilter: currentFilters,\n loadedFilter: null,\n triggerRefresh: state.triggerRefresh + 1,\n isDefault: true,\n };\n }\n\n case 'addSavedFilter': {\n let updatedSaved = [...state.savedFilters]\n\n if (action.value.default) {\n updatedSaved = state.savedFilters.map((filter) => { \n if (filter.default) {\n return {...filter, default: false}\n }\n\n return { ...filter }\n })\n }\n\n return {\n ...loadFilter(state, action.value),\n savedFilters: [...updatedSaved, action.value],\n loadedFilter: {\n id: action.value.id,\n name: action.value.name,\n default: action.value.default,\n }\n }\n }\n\n case 'updateSavedFilter': {\n const updatedSaved = state.savedFilters.map((filter) => { \n if (filter.id === action.value.id) {\n return { ...action.value }\n }\n\n if (filter.default && action.value.default) {\n return { ...filter, default: false }\n }\n\n return { ...filter }\n })\n\n if (state.loadedFilter?.id === action.value.id) {\n return {...state, savedFilters: updatedSaved, loadedFilter: {...action.value} }\n }\n\n return { ...state, savedFilters: updatedSaved };\n }\n\n case 'deleteSavedFilter': {\n const isCurrentlyLoaded = action.value.id === state.loadedFilter?.id \n const loaded = isCurrentlyLoaded ? null : state.loadedFilter\n \n return { ...state, savedFilters: state.savedFilters.filter(e => e.id !== action.value.id), loadedFilter: loaded};\n } \n\n case 'cacheAndLoadFilter': {\n const index = findIndex(state.savedFilters, { id: action.value.id });\n const savedFilters = [...state.savedFilters.slice(0, index), action.value, ...state.savedFilters.slice(index + 1)]\n return {\n ...loadFilter(state, action.value),\n savedFilters,\n loadedFilter: {\n id: action.value.id,\n name: action.value.name,\n default: action.value.default,\n }\n }\n }\n\n case 'loadFilters': {\n return loadFilter(state, action.value)\n }\n\n default: {\n return state;\n }\n }\n}\n","const FilterAPI = {\n save(filter, dfault) {\n const url = '/filters';\n return $.ajax(url, {\n method: 'POST',\n dataType: 'JSON',\n data: {\n filter: filter,\n default: dfault\n }\n });\n },\n\n update(id, filter, dfault) {\n const url = `/filters/${id}`;\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'JSON',\n data: {\n filter: filter,\n default: dfault\n }\n });\n },\n\n remove(id) {\n const url = `/filters/${id}`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'JSON'\n });\n },\n\n toggleDefault(id) {\n const url = '/filters/toggle_default';\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'JSON',\n data: {id: id}\n });\n },\n\n templates() {\n const url = '/filters/templates';\n\n return $.ajax(url, {\n method: 'GET',\n dataType: 'JSON'\n });\n }\n};\n\nexport default FilterAPI;\n","import FilterAPI from 'apis/filter-api';\nimport SearchAPI from 'apis/search-api';\nimport Flash from 'components/shared/flash';\n\nconst FilterActions = {\n save: (filter, dfault) => {\n return FilterAPI.save(filter, dfault);\n },\n\n update: (id, filter, dfault) => {\n return FilterAPI.update(id, filter, dfault);\n },\n\n remove: (id) => {\n return FilterAPI.remove(id);\n },\n\n toggleDefault: (id) => {\n return FilterAPI.toggleDefault(id);\n },\n\n searchApplicants(terms) {\n return SearchAPI.searchApplicants(terms, true);\n },\n\n loadTemplates: () => {\n return FilterAPI.templates()\n .fail(() => {\n Flash.error('There was a problem loading forms for filters.');\n });\n },\n};\n\nexport default FilterActions;\n","import React, { useState, useEffect } from \"react\";\nimport useOnclickOutside from 'react-cool-onclickoutside';\nimport { isEmpty, debounce } from 'underscore';\n\nimport FilterActions from \"actions/filter-actions\"\nimport ListOfPeople from \"../list-of-people\";\nimport UserDisc from 'components/shared/user-disc';\nimport Selection from 'components/shared/person-selection';\n\n\nconst ApplicantSearch = ({\n changeFilterValue,\n changeFilterValueOptions,\n filterState,\n minify,\n}) => {\n const [showPeopleList, setShowPeopleList] = useState(false);\n const [peopleList, setPeopleList] = useState([]);\n const [applicant, setApplicant] = useState(filterState.options.applicant);\n const hidePeopleList = () => setShowPeopleList(false);\n\n const ref = useOnclickOutside(hidePeopleList);\n\n useEffect(() => {\n changeFilterValueOptions({\n applicant: applicant\n });\n }, [applicant]);\n\n const searchPerson = debounce(\n (search) => {\n if (isEmpty(search) || search.length < 2) {\n return;\n }\n\n FilterActions.searchApplicants(search).\n done((r) => setPeopleList(r)).\n fail(() => Flash.error('Something went wrong.'));\n },\n 333\n );\n\n const onInputChanged = (e) => {\n const newTerms = e.currentTarget.value;\n setShowPeopleList(true);\n searchPerson(newTerms);\n };\n\n const onPersonSelect = (value) => {\n setApplicant(value);\n changeFilterValue(value.id);\n hidePeopleList();\n };\n\n const onPersonRemove = () => {\n setApplicant(null);\n changeFilterValue(null);\n };\n\n const renderPeopleList = () => {\n return (\n <div ref={ref} className='applicant-search-list'>\n <ListOfPeople\n users={peopleList}\n onSelect={onPersonSelect}\n />\n </div>\n );\n };\n\n const renderSearch = () => {\n return <input\n onFocus={onInputChanged}\n autoComplete='chrome-off'\n onChange={onInputChanged}\n className='search people'\n type='text'\n placeholder='Search people'\n />\n };\n\n const renderApplicant = () => {\n return <Selection\n selection={applicant}\n onRemove={onPersonRemove}\n smallerAvatar\n />\n };\n\n const renderMainContent = () => {\n return (\n <div className='metricsdashboard-filterselect'>\n {applicant ? renderApplicant() : renderSearch()}\n {showPeopleList && renderPeopleList()}\n </div>\n );\n };\n\n const renderMinify = () => {\n if (!applicant) { return null; }\n\n return <UserDisc\n user={applicant}\n className='margin-right'\n options={{\n showName: true,\n }}\n />;\n };\n\n return minify ? renderMinify() : renderMainContent();\n};\n\nexport default ApplicantSearch;\n","import React from \"react\";\n\nimport Select from \"../select\";\nimport { COMPLETION_STATUSES } from \"./constants\";\n\n\nconst CompletedStatus = ({\n changeFilterValue,\n filterState,\n minify,\n}) => {\n const defaultStatus = COMPLETION_STATUSES.find((opt) => opt.id == filterState.value);\n\n const onStatusChange = (value) => {\n changeFilterValue(value.id);\n };\n\n return (\n <div className='metricsdashboard-filterselect'>\n <Select\n options={COMPLETION_STATUSES}\n onChange={onStatusChange}\n getOptionValue={(opt) => opt.id}\n value={defaultStatus}\n className='react-select-metrics advanced-filter'\n />\n </div>\n );\n};\n\nexport default CompletedStatus;\n","import dayjs from 'dayjs';\n\nexport const formatIncoming = (value, type) => {\n if (!value) { return null; }\n\n if (type === 'time') {\n return dayjs(value, 'HH-mm').toDate();\n }\n\n if (type === 'date_time') {\n return dayjs(value, 'YYYY-MM-DD-HH-mm').toDate();\n }\n\n return dayjs(value, 'YYYY-MM-DD').toDate();\n};\n\nexport const formatOutgoing = (date, type) => {\n if (!date) { return ''; }\n\n let format = 'YYYY-MM-DD';\n if (type === 'date_time') {\n format = 'YYYY-MM-DD HH:mm';\n } else if (type === 'time') {\n format = 'HH:mm';\n }\n\n return dayjs(date).format(format);\n};\n\nexport const dateFormats = (type) => {\n switch (type) {\n case 'date':\n return ['yyyy-MM-dd', 'yyyy-M-d', 'M/d/yyyy', 'M-d-yyyy'];\n case 'date_time':\n return ['yyyy-MM-dd h:mm aa', 'yyyy-M-d h:mm aa', 'M/d/yyyy h:mm aa', 'M-d-yyyy h:mm aa'];\n case 'time':\n return ['h:mm aa'];\n }\n};\n","import React from 'react';\nimport DatePicker from 'react-datepicker';\nimport { formatIncoming, formatOutgoing, dateFormats } from 'modules/date-formatter';\nimport { isFunction } from 'underscore';\n\nconst DateSelector = (props) => {\n const onSelect = (date) => {\n props.onDateChange(formatOutgoing(date, props.type));\n };\n\n const handleOnBlur = () => {\n if (isFunction(props.onBlur)) {\n props.onBlur();\n }\n };\n\n return (\n <DatePicker\n ref={props.innerRef}\n id={props.id}\n onBlur={handleOnBlur}\n selected={formatIncoming(props.value, props.type)}\n className={props.className}\n onChange={onSelect}\n dateFormat={dateFormats(props.type)}\n placeholderText={props.placeholderText}\n showTimeSelect={props.type !== 'date'}\n showTimeSelectOnly={props.type === 'time'}\n timeIntervals={15}\n showMonthDropdown\n showYearDropdown\n dropdownMode='select'\n withPortal={props.withPortal}\n />\n );\n};\n\nexport default DateSelector;\n","import React, { useState } from \"react\";\nimport DateSelector from 'components/shared/date-selector';\n\n\nconst DateRange = ({\n changeFilterValue,\n fromToValues,\n minify,\n}) => {\n const [from, setFrom] = useState(fromToValues[0]);\n const [to, setTo] = useState(fromToValues[1]);\n\n const updateFrom = (value) => {\n setFrom(value);\n changeFilterValue([value, to]);\n };\n\n const updateTo = (value) => {\n setTo(value);\n changeFilterValue([from, value]);\n };\n\n const renderMainContent = () => {\n return (\n <>\n <div className='metricsdashboard-datepicker advanced'>\n <DateSelector\n value={from}\n onDateChange={updateFrom}\n type='date'\n placeholderText='from...'\n withPortal={false}\n />\n </div>\n <span>and</span>\n <div className='metricsdashboard-datepicker advanced'>\n <DateSelector\n value={to}\n onDateChange={updateTo}\n type='date'\n placeholderText='to...'\n withPortal={false}\n />\n </div>\n </>\n );\n };\n\n const renderMinify = () => {\n return (\n <>\n <span>\n {from || '...'}\n </span>\n <span className=\"margin-left margin-right\">to</span>\n <span>\n {to || '...'}\n </span>\n </>\n );\n };\n\n return minify ? renderMinify() : renderMainContent();\n};\n\nexport default DateRange;\n","import React from \"react\";\n\nimport Select from \"../select\";\nimport { DATE_TERMS } from \"./constants\";\n\n\nconst DateTerm = ({\n changeFilterValue,\n changeFilterValueOptions,\n filterState,\n minify,\n}) => {\n const defaultTerm = DATE_TERMS.find((opt) => opt.id == filterState.options.term);\n\n const onValueChange = (e) => {\n changeFilterValue(e.target.value);\n };\n\n const onTermChange = (value) => {\n changeFilterValueOptions({\n term: value.id\n });\n };\n\n return (\n <>\n <div className='metricsdashboard-filterselect'>\n <input\n className='number-field'\n type='number'\n onChange={onValueChange}\n value={filterState.value}\n />\n </div>\n <div className='metricsdashboard-filterselect'>\n <Select\n options={DATE_TERMS}\n onChange={onTermChange}\n getOptionValue={(opt) => opt.id}\n value={defaultTerm}\n className='react-select-metrics advanced-filter'\n />\n </div>\n </>\n );\n};\n\nexport default DateTerm;\n","import React, { useEffect, useState } from \"react\";\nimport { contains } from \"underscore\";\n\nimport Select from \"../select\";\nimport SlidingToggle from \"../sliding-toggle\";\nimport DateRange from \"./date-range\";\n\nconst SingleCheckboxToggle = ({\n opt,\n onToggleFallback,\n on,\n}) => {\n const [toggle, setToggle] = useState(on);\n\n useEffect(() => {\n onToggleFallback(opt.identity, toggle);\n }, [toggle]);\n\n return (\n <div\n className='filter-unit-datum-single-checkbox'\n style={{ display: 'inline-block', margin: '6px 0 0 12px' }}\n >\n <span key={opt.identity}>{opt.name}</span>\n <SlidingToggle\n on={toggle}\n onToggle={() => setToggle(!toggle)}\n />\n </div>\n )\n};\n\nconst CheckboxesSelect = ({\n options,\n onDatumFieldsChange,\n terms,\n}) => {\n const [activeOptions, setActiveOptions] = useState([]);\n const [toggleValues, setToggleValues] = useState({});\n\n useEffect(() => {\n if (terms) {\n const termIds = Object.keys(terms);\n setActiveOptions(\n options.filter(item => contains(termIds, item.identity))\n );\n setToggleValues(terms);\n }\n }, []);\n\n useEffect(() => {\n onDatumFieldsChange(toggleValues);\n }, [toggleValues]);\n\n const onSelect = (value) => {\n setActiveOptions(value);\n\n let newTerm = {};\n value.forEach((val) => {\n if (toggleValues[val.identity] != undefined) {\n newTerm[val.identity] = toggleValues[val.identity];\n } else {\n newTerm[val.identity] = true;\n }\n });\n\n setToggleValues(newTerm);\n };\n\n const onToggleFallback = (identity, toggle) => {\n setToggleValues({\n ...toggleValues,\n [identity]: toggle\n });\n };\n\n const renderOption = (opt) => {\n return <SingleCheckboxToggle\n key={opt.identity}\n opt={opt}\n onToggleFallback={onToggleFallback}\n on={toggleValues[opt.identity] === true || toggleValues[opt.identity] === 'true'}\n />;\n };\n\n return (\n <>\n <div className='metricsdashboard-filterselect'>\n <Select\n isMulti\n options={options}\n onChange={onSelect}\n placeholder='Select a value'\n getOptionValue={(opt) => opt.identity}\n getOptionLabel={(opt) => opt.name}\n className='react-select-metrics advanced-filter'\n value={activeOptions}\n />\n </div>\n <div style={{ display: 'inline-block', maxWidth: '50%', verticalAlign: 'top' }}>\n { activeOptions.map(renderOption) }\n </div>\n </>\n );\n};\n\n\nconst DatumFieldFilter = ({\n onDatumFieldsChange,\n fieldType,\n multipleChoiceOptions,\n datumFields,\n datumId,\n}) => {\n const onInputChange = (e) => {\n onDatumFieldsChange(e.target.value);\n };\n\n const onMultipleChoiceChange = (value) => {\n onDatumFieldsChange(value.name);\n }\n\n const fetchFilterValue = () => {\n if (!datumFields.value) { return null; }\n\n return datumFields.value[datumId];\n };\n\n const renderDefaultInput = () => {\n return (\n <div className='metricsdashboard-filterselect'>\n <input\n autoComplete='chrome-off'\n onChange={onInputChange}\n type='text'\n placeholder='Type...'\n style={{ margin: '3px 0 0 3px' }}\n value={fetchFilterValue()}\n />\n </div>\n );\n };\n\n const renderCheckboxesSelect = () => {\n return <CheckboxesSelect\n options={multipleChoiceOptions}\n onDatumFieldsChange={onDatumFieldsChange}\n terms={fetchFilterValue()}\n />;\n };\n\n const renderMultipleChoiceSelect = () => {\n const filterValue = fetchFilterValue();\n const defaultValue = multipleChoiceOptions.find(item => item.name === filterValue);\n\n return (\n <div className='metricsdashboard-filterselect'>\n <Select\n options={multipleChoiceOptions}\n onChange={onMultipleChoiceChange}\n placeholder='Select a value'\n getOptionValue={(opt) => opt.name}\n getOptionLabel={(opt) => opt.name}\n className='react-select-metrics advanced-filter'\n value={defaultValue}\n />\n </div>\n );\n };\n\n switch (fieldType) {\n case 'checkboxes': {\n return renderCheckboxesSelect();\n }\n\n case 'date': {\n const fromTo = datumFields.value && datumFields.value[datumId];\n return <DateRange\n changeFilterValue={onDatumFieldsChange}\n fromToValues={fromTo || [null, null]}\n />\n }\n\n case 'multiple_choice': {\n return renderMultipleChoiceSelect();\n }\n\n default: {\n return renderDefaultInput();\n }\n }\n};\n\nexport default DatumFieldFilter;\n","const BatchInitiatedFlowsAPI = {\n halt(initiatedFlowIds) {\n const url = '/initiated_flows/batch/halt';\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n initiated_flow_ids: initiatedFlowIds,\n },\n });\n },\n\n delete(items) {\n const url = '/initiated_flows/batch/delete';\n return $.ajax(url, {\n dataType: 'json',\n method: 'DELETE',\n data: {\n items,\n },\n });\n },\n\n export(items) {\n const url = '/initiated_flows/batch/export';\n return $.ajax(url, {\n dataType: 'json',\n method: 'GET',\n data: {\n items,\n },\n });\n },\n\n assign(initiatedFlowIds) {\n const url = 'initiated_flows/batch/assign';\n return $.ajax(url, {\n dataType: 'JSON',\n method: 'POST',\n data: {\n initiated_flow_ids: initiatedFlowIds,\n },\n });\n },\n\n unassign(initiatedFlowIds) {\n const url = 'initiated_flows/batch/unassign';\n return $.ajax(url, {\n dataType: 'JSON',\n method: 'POST',\n data: {\n initiated_flow_ids: initiatedFlowIds,\n },\n });\n },\n};\n\nexport default BatchInitiatedFlowsAPI;\n","import { extend } from 'underscore';\n\nconst DashboardAPI = {\n fetch: function(params){\n const URL = '/dashboard/fetch';\n\n return $.ajax(URL, {\n method: 'GET',\n dataType: 'json',\n data: params\n });\n },\n\n fetchAssigned: function(filters){\n return $.ajax('/dashboard/fetch_assigned', {\n method: 'GET',\n dataType: 'json',\n data: filters\n })\n },\n\n fetchOutputs: function(params){\n const URL = '/dashboard/fetch_outputs';\n\n return $.ajax(URL, {\n method: 'GET',\n dataType: 'json',\n data: params\n });\n },\n\n delete: function(params, confirmCount){\n const URL = '/dashboard/delete';\n\n params = extend(params, { confirm_count: confirmCount });\n\n return $.ajax(URL, {\n method: 'DELETE',\n dataType: 'json',\n data: params\n });\n },\n\n export: function(params){\n const URL = '/dashboard/export';\n return $.ajax(URL, {\n method: 'GET',\n dataType: 'json',\n data: params\n });\n },\n\n exportOutputs: function(params){\n const URL = '/dashboard/export_outputs';\n return $.ajax(URL, {\n method: 'GET',\n dataType: 'json',\n data: params\n });\n },\n};\n\nexport default DashboardAPI;\n","import {\n extend,\n contains,\n isEmpty,\n chain,\n} from 'underscore';\nimport { success as flashSuccess, error as flashError } from 'components/shared/flash';\nimport Dispatcher from '../appdispatcher';\nimport DashboardConstants from '../constants/dashboard-constants';\nimport { alert } from '../modules/alert-confirm';\nimport BatchInitiatedFlowsAPI from '../apis/batch-initiated-flows-api';\nimport DashboardAPI from '../apis/dashboard-api';\n\nlet _mostRecentQueryParams = null;\nlet _pagesRequested = [];\nconst _pageSize = 20;\nlet _mostRecentRequest;\nlet _loadingNewPage = false;\n\nconst filteredSearch = (params) => {\n _pagesRequested = [1];\n\n if (!params) {\n params = (extend({}, _mostRecentQueryParams));\n } else {\n _mostRecentQueryParams = params;\n }\n\n setLoading();\n\n _mostRecentRequest = DashboardAPI.fetch(params)\n .done((res, textStatus, jqXHR) => {\n if (_mostRecentRequest !== jqXHR) { return; }\n Dispatcher.dispatch({\n actionType: DashboardConstants.ITEMS_LOADED,\n items: res.initiated_flows,\n total_count: res.total_count,\n });\n })\n .fail(onLoadFailed);\n\n return _mostRecentRequest;\n};\n\n// Exports flows for the most recent query. Will not work\n// until the dashboard content has been fetched at least once.\n//\nconst filteredExport = () => {\n return DashboardAPI.export(_mostRecentQueryParams).fail(() => { flashError(); });\n};\n\nconst exportSpecific = (items) => {\n return BatchInitiatedFlowsAPI.export(items).fail(() => { flashError(); });\n};\n\nconst nullCellRequested = (index) => {\n const page = Math.floor(index / _pageSize) + 1;\n if (_loadingNewPage || contains(_pagesRequested, page)) {\n return;\n }\n\n _pagesRequested.push(page);\n\n return loadMoreItems(page);\n};\n\nconst loadMoreItems = (page) => {\n const requestParams = extend({}, _mostRecentQueryParams, { page, include_count: false });\n _loadingNewPage = true;\n return DashboardAPI.fetch(requestParams)\n .done((res) => {\n Dispatcher.dispatch({\n actionType: DashboardConstants.MORE_ITEMS_LOADED,\n items: res.initiated_flows,\n index: (page - 1) * _pageSize,\n });\n })\n .fail(onLoadFailed)\n .always(() => {\n _loadingNewPage = false;\n });\n};\n\nconst onLoadFailed = () => {\n alert('Can\\'t load submissions', 'We\\'re having trouble loading your submissions. Please try again in a few moments.');\n\n Dispatcher.dispatch({\n actionType: DashboardConstants.LOAD_FAILED,\n });\n};\n\nconst setLoading = () => {\n Dispatcher.dispatch({\n actionType: DashboardConstants.ITEMS_LOADING,\n });\n};\n\nconst loadStepData = (flowTemplateId) => {\n const url = `/flow_templates/${flowTemplateId}/step_data_for_search`;\n const request = window.$.ajax(url, {\n dataType: 'json',\n method: 'GET',\n });\n\n return request.done((res) => {\n Dispatcher.dispatch({\n actionType: DashboardConstants.STEP_DATA_LOADED,\n stepData: res,\n });\n });\n};\n\nconst selectInitiatedFlowDashboardIds = (items) => {\n return chain(items).where({ type: 'InitiatedFlow' })\n .map((f) => { return f.id; })\n .value();\n};\n\nconst assignFlows = (items) => {\n const dashboardIds = selectInitiatedFlowDashboardIds(items);\n\n return BatchInitiatedFlowsAPI.assign(dashboardIds);\n};\n\nconst unassignFlows = (items) => {\n const dashboardIds = selectInitiatedFlowDashboardIds(items);\n\n return BatchInitiatedFlowsAPI.unassign(dashboardIds);\n};\n\nconst haltFlows = (items) => {\n const dashboardIds = selectInitiatedFlowDashboardIds(items);\n\n BatchInitiatedFlowsAPI.halt(dashboardIds)\n .done(onSuccessfulHalt.bind(null, dashboardIds))\n .fail(onFailedHalt);\n};\n\nconst deleteFlows = (items) => {\n BatchInitiatedFlowsAPI.delete(items)\n .done(onSuccessfulDelete.bind(null, items))\n .fail(onFailedDelete);\n};\n\n// Deletes everything that matches the previous search query\n// As a safety check, confirm count must match the number\n// of returned results\n\nconst deleteMatchingFlows = (confirmCount) => {\n DashboardAPI.delete(_mostRecentQueryParams, confirmCount)\n .done(() => { flashSuccess(`${confirmCount} submissions are being deleted. This may take some time.`); })\n .fail(() => { flashError(); });\n};\n\nconst onFailedHalt = () => {\n alert('Something went wrong', 'We weren\\'t able to halt those submissions. Please try again later, or if the issue persists, contact support using the chat icon the in the lower right hand corner of the screen.');\n};\n\nconst onFailedDelete = () => {\n alert('Something went wrong', 'We weren\\'t able to delete those submissions. Please try again later, or if the issue persists, contact support using the chat icon the in the lower right hand corner of the screen.');\n};\n\nconst onSuccessfulHalt = (initiatedFlowIds) => {\n const count = initiatedFlowIds.length;\n flashSuccess(`${count} submissions were halted successfully.`);\n\n filteredSearch();\n};\n\nconst onSuccessfulDelete = (initiatedFlowIds) => {\n const count = initiatedFlowIds.length;\n flashSuccess(`${count} submissions were deleted successfully.`);\n\n filteredSearch();\n};\n\nconst runSearch = (terms, type) => {\n const URL = `/dashboard/search/${terms}`;\n\n const request = window.$.ajax(URL, {\n method: 'GET',\n dataType: 'json',\n data: {\n search_type: type,\n },\n })\n .fail((req) => {\n if (req.statusText === 'abort') { return; }\n flashError();\n });\n\n return request;\n};\n\nexport default {\n filteredSearch,\n filteredExport,\n exportSpecific,\n nullCellRequested,\n loadStepData,\n assignFlows,\n unassignFlows,\n haltFlows,\n deleteFlows,\n deleteMatchingFlows,\n runSearch,\n};\n","import React from \"react\";\nimport { contains } from \"underscore\";\n\nimport DashboardActions from 'actions/dashboard-actions';\nimport Select from \"../select\";\nimport { WORKFLOW_STATUSES } from \"./constants\";\n\n\nconst templatesBySelectedStatus = (templates, status) => {\n if (status == 'all') {\n return templates;\n }\n\n return templates.filter(form => form.status == status);\n};\n\nconst FormSelect = ({\n changeFilterValue,\n changeFilterValueOptions,\n disableStepDataFilters,\n enableStepDataFilters,\n filterState,\n teamFilter,\n formTemplates,\n}) => {\n let templates = templatesBySelectedStatus(formTemplates, filterState.options.status);\n\n if (teamFilter) {\n templates = templates.filter((form) => {\n return teamFilter.operator == 'is'\n ? contains(teamFilter.value, form.teamId)\n : !contains(teamFilter.value, form.teamId)\n });\n }\n\n const defaultStatusValue = WORKFLOW_STATUSES.find((opt) => opt.id == filterState.options.status);\n\n const formNumberIds = filterState.value ? filterState.value.map((id) => Number(id)) : [];\n const defaultSelectedFormsValue = templates.filter((form) => contains(formNumberIds, form.master_template_id));\n\n const onStatusChange = (value) => {\n changeFilterValueOptions({\n status: value.id\n });\n };\n\n const onFormsChange = (value) => {\n changeFilterValue(value.map(form => form.master_template_id));\n\n if (value.length == 1) {\n const template = value[0];\n DashboardActions.loadStepData(template.id).\n done(() => enableStepDataFilters(template.name_or_default));\n } else {\n disableStepDataFilters();\n }\n };\n\n return (\n <>\n <div className='metricsdashboard-filterselect'>\n <Select\n options={WORKFLOW_STATUSES}\n onChange={onStatusChange}\n getOptionValue={(opt) => opt.id}\n value={defaultStatusValue}\n className='react-select-metrics advanced-filter'\n />\n </div>\n <div className='metricsdashboard-filterselect'>\n <Select\n options={templates}\n isMulti\n onChange={onFormsChange}\n getOptionValue={(opt) => opt.master_template_id}\n getOptionLabel={(opt) => opt.name_or_default}\n value={defaultSelectedFormsValue}\n className='react-select-metrics advanced-filter'\n styles={{\n multiValue: (provided) => ({\n ...provided,\n maxWidth: '310px',\n })\n }}\n />\n </div>\n </>\n );\n};\n\nexport default FormSelect;\n","import DataImportAPI from '../../apis/master-template-data-import-api';\n\nconst SourceFilterActions = {\n loadSources() {\n return DataImportAPI.index();\n },\n};\n\nexport default SourceFilterActions;\n","import React, { useEffect, useState } from \"react\";\n\nimport SourceFilterActions from 'actions/dashboard/source-filter-actions';\nimport Select from \"../select\";\nimport { IMPORTED_OPTIONS } from \"./constants\";\n\nconst DEFAULT_OPTION = { id: 'all', label: 'All' };\n\n\nconst ImportedSelect = ({\n changeFilterValue,\n changeFilterValueOptions,\n filterState,\n minify,\n}) => {\n const [dataImports, setDataImports] = useState(null);\n const optionValue = IMPORTED_OPTIONS.find((opt) => opt.id === filterState.value);\n\n useEffect(() => {\n SourceFilterActions.loadSources()\n .done(setDataImports);\n }, []);\n\n const formattedSources = dataImports\n ? [\n DEFAULT_OPTION,\n ...dataImports.map(({ id, name }) => ({\n id: id,\n label: name,\n })),\n ]\n : [DEFAULT_OPTION];\n\n const onImportSelectChange = (value) => {\n changeFilterValue(value.id);\n };\n\n const onImportedSourceChange = (value) => {\n changeFilterValueOptions({\n source_id: value.id\n });\n };\n\n const renderImportedSourceSelect = () => {\n return (\n <div className='metricsdashboard-filterselect'>\n <Select\n options={formattedSources}\n onChange={onImportedSourceChange}\n getOptionValue={(opt) => opt.id}\n value={formattedSources.find((opt) => opt.id === Number(filterState.options.source_id))}\n className='react-select-metrics advanced-filter'\n />\n </div>\n );\n }\n\n return (\n <>\n <div className='metricsdashboard-filterselect'>\n <Select\n options={IMPORTED_OPTIONS}\n onChange={onImportSelectChange}\n getOptionValue={(opt) => opt.id}\n defaultValue={optionValue}\n className='react-select-metrics advanced-filter'\n />\n </div>\n {(filterState.value == 'specific_import') && renderImportedSourceSelect()}\n </>\n );\n};\n\nexport default ImportedSelect;\n","import React from \"react\";\nimport { contains } from \"underscore\";\n\nimport {\n COMPLETION_STATUSES,\n DATE_TERMS,\n IMPORTED_OPTIONS,\n OUTPUT_STATUSES,\n RENEWAL_STATUSES,\n WORKFLOW_STATUSES\n} from \"./constants\";\nimport DashboardStore from 'stores/dashboard-store';\nimport SlidingToggle from \"../sliding-toggle\";\nimport UserDisc from 'components/shared/user-disc';\n\n\nconst MinifiedFilterUnit = ({\n filterType,\n filterState,\n formTemplates,\n tags,\n stepDataForSearch,\n}) => {\n switch (filterType) {\n case 'applicantSearch': {\n const applicant = filterState.options.applicant;\n\n if (!applicant) { return null; }\n\n return <UserDisc\n user={applicant}\n className='margin-right'\n options={{\n showName: true,\n }}\n />;\n }\n\n case 'assignedToggle':\n case 'outputRenewalsEnabled': {\n const toggledOn = filterState.value === 'true' || filterState.value === true;\n\n return (\n <SlidingToggle\n on={toggledOn}\n disabled\n />\n );\n }\n\n case 'completedDate':\n case 'launchedAt':\n case 'outputIssued': {\n const [from, to] = filterState.value;\n return (\n <>\n <span>{from || '...'}</span>\n <span className=\"margin-left margin-right\">to</span>\n <span>{to || '...'}</span>\n </>\n );\n }\n\n case 'currentStepTime': {\n const defaultTerm = DATE_TERMS.find((opt) => opt.id == filterState.options.term);\n return <span>{`${filterState.value} ${defaultTerm.label}`}</span>\n }\n\n case 'importedSelect': {\n const importedSelect = IMPORTED_OPTIONS.find((opt) => opt.id == filterState.value);\n return <span>{importedSelect.label}</span>\n }\n\n case 'currentStep': {\n const currentStepOptions = stepDataForSearch ? stepDataForSearch.steps : DashboardStore.getStepData().steps;\n const currentStep = currentStepOptions.find(opt => opt.id == Number(filterState.value));\n\n return <span>{currentStep?.name}</span>\n }\n\n case 'tagSelect': {\n const tagOptions = tags || [];\n const tagNumberIds = filterState.value.map((id) => Number(id));\n const defaultSelectedTagsValue = tagOptions.filter((tag) => contains(tagNumberIds, tag.id));\n const tagsContent = defaultSelectedTagsValue.map(tag => tag.name).join(', ');\n return <span>{tagsContent}</span>\n }\n\n case 'completedStatus': {\n const completedStatus = COMPLETION_STATUSES.find((opt) => opt.id == filterState.value);\n return <span>{completedStatus.label}</span>\n }\n\n case 'outputStatus': {\n const outputStatus = OUTPUT_STATUSES.find((opt) => opt.id == filterState.value);\n return <span>{outputStatus.label}</span>\n }\n\n case 'renewalStatus': {\n const renewalStatus = RENEWAL_STATUSES.find((opt) => opt.id == filterState.value);\n return <span>{renewalStatus.label}</span>\n }\n\n case 'submission': {\n const submissionText = filterState.value ? `#${filterState.value}` : null;\n return <span>{submissionText}</span>\n }\n\n case 'teamSelect': {\n const teams = CityGrows.Server.teams;\n\n const teamNumberIds = filterState.value.map((id) => Number(id));\n const defaultSelectedTeamsValue = teams.filter((team) => contains(teamNumberIds, team.id));\n\n const teamsContent = defaultSelectedTeamsValue.map(team => team.name).join(', ');\n return <span>{teamsContent}</span>\n }\n\n case 'formSelect': {\n const defaultStatusValue = WORKFLOW_STATUSES.find((opt) => opt.id == filterState.options.status);\n\n const formNumberIds = filterState.value ? filterState.value.map((id) => Number(id)) : [];\n const defaultSelectedFormsValue = formTemplates.filter((form) => contains(formNumberIds, form.master_template_id));\n\n const content = defaultSelectedFormsValue.length\n ? defaultSelectedFormsValue.map(form => form.name_or_default).join(', ')\n : defaultStatusValue.label\n\n return <span>{content}</span>\n }\n\n default:\n return null;\n }\n};\n\nexport default MinifiedFilterUnit;\n","import React from \"react\";\n\nimport Select from \"../select\";\nimport { OUTPUT_STATUSES } from \"./constants\";\n\nconst OutputStatus = ({\n changeFilterValue,\n filterState,\n}) => {\n const onStatusChange = (value) => {\n changeFilterValue(value.id);\n };\n\n return (\n <div className='metricsdashboard-filterselect'>\n <Select\n options={OUTPUT_STATUSES}\n onChange={onStatusChange}\n getOptionValue={(opt) => opt.id}\n value={OUTPUT_STATUSES.find((opt) => opt.id === filterState.value)}\n className='react-select-metrics advanced-filter'\n />\n </div>\n );\n};\n\nexport default OutputStatus;\n","import React from \"react\";\n\nimport Select from \"../select\";\nimport { RENEWAL_STATUSES } from \"./constants\";\n\nconst RenewalStatus = ({\n changeFilterValue,\n filterState,\n}) => {\n const onStatusChange = (value) => {\n changeFilterValue(value.id);\n };\n\n return (\n <div className='metricsdashboard-filterselect'>\n <Select\n options={RENEWAL_STATUSES}\n onChange={onStatusChange}\n getOptionValue={(opt) => opt.id}\n value={RENEWAL_STATUSES.find((opt) => opt.id === filterState.value)}\n className='react-select-metrics advanced-filter'\n />\n </div>\n );\n};\n\nexport default RenewalStatus;\n","import React from \"react\";\n\nimport DashboardStore from 'stores/dashboard-store';\nimport Select from \"../select\";\n\nconst StepSelect = ({\n changeFilterValue,\n filterState,\n stepDataForSearch,\n}) => {\n const onStatusChange = (value) => {\n changeFilterValue(value.id);\n };\n\n const options = stepDataForSearch ? stepDataForSearch.steps : DashboardStore.getStepData().steps;\n const defaultOptionValue = options.find(opt => opt.id == Number(filterState.value));\n\n return (\n <div className='metricsdashboard-filterselect'>\n <Select\n options={options}\n onChange={onStatusChange}\n getOptionValue={(opt) => opt.id}\n getOptionLabel={(opt) => opt.name}\n className='react-select-metrics advanced-filter'\n value={options.find(opt => opt.id === Number(filterState.value))}\n />\n </div>\n );\n};\n\nexport default StepSelect;\n","import React from \"react\";\n\n\nconst SubmissionFilter = ({\n changeFilterValue,\n filterState,\n}) => {\n const onValueChange = (e) => {\n changeFilterValue(e.target.value);\n };\n\n return (\n <div className='metricsdashboard-filterselect'>\n <input\n className='number-field'\n type='number'\n onChange={onValueChange}\n placeholder='ID'\n value={filterState.value}\n />\n </div>\n );\n};\n\nexport default SubmissionFilter;\n","import React from \"react\";\nimport { contains } from \"underscore\";\n\nimport Select from \"../select\";\n\n\nconst TagSelect = ({\n changeFilterValue,\n filterState,\n tags,\n}) => {\n const tagOptions = tags || [];\n\n const tagNumberIds = filterState.value.map((id) => Number(id));\n\n const onTagChange = (value) => {\n changeFilterValue(value.map(tag => tag.id));\n };\n\n return (\n <div className='metricsdashboard-filterselect' style={{ minWidth: '80px' }}>\n <Select\n isMulti\n options={tags}\n onChange={onTagChange}\n getOptionValue={(opt) => opt.id}\n getOptionLabel={(opt) => opt.name}\n className='react-select-metrics advanced-filter'\n components={{ DropdownIndicator: () => null, IndicatorSeparator: () => null }}\n placeholder='Search tag'\n value={tagOptions.filter((tag) => contains(tagNumberIds, tag.id))}\n />\n </div>\n );\n};\n\nexport default TagSelect;\n","import React from \"react\";\nimport { contains } from \"underscore\";\n\nimport Select from \"../select\";\n\nconst TeamSelect = ({\n changeFilterValue,\n filterState,\n}) => {\n const { teams } = CityGrows.Server;\n\n const teamNumberIds = filterState.value.map((id) => Number(id));\n\n const onChangeTeams = (value) => {\n changeFilterValue(value.map(team => team.id));\n };\n\n return (\n <div className='metricsdashboard-filterselect'>\n <Select\n options={teams}\n isMulti\n onChange={onChangeTeams}\n getOptionValue={(opt) => opt.id}\n getOptionLabel={(opt) => opt.name}\n value={teams.filter((team) => contains(teamNumberIds, team.id))}\n className='react-select-metrics advanced-filter'\n />\n </div>\n );\n};\n\nexport default TeamSelect;\n","import React from \"react\";\n\nimport SlidingToggle from \"../sliding-toggle\";\n\n\nconst ToggleOption = ({\n on,\n changeFilterValue,\n}) => {\n const toggledOn = on === 'true' || on === true;\n\n return (\n <SlidingToggle\n on={toggledOn}\n onToggle={() => changeFilterValue(!toggledOn)}\n />\n );\n};\n\nexport default ToggleOption;\n","import React from \"react\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport truncate from 'truncate';\n\nimport Select from \"../select\";\nimport ApplicantSearch from \"./applicant-search\";\nimport CompletedStatus from \"./completed-status\";\nimport DateRange from \"./date-range\";\nimport DateTerm from \"./date-term\";\nimport DatumFieldFilter from \"./datum-field-filter\";\nimport FormSelect from \"./form-select\";\nimport ImportedSelect from \"./imported-select\";\nimport MinifiedFilterUnit from \"./minified-filter-unit\";\nimport OutputStatus from \"./output-status\";\nimport RenewalStatus from \"./renewal-status\";\nimport StepSelect from \"./step-select\";\nimport SubmissionFilter from \"./submission-filter\";\nimport TagSelect from \"./tag-select\";\nimport TeamSelect from \"./team-select\";\nimport ToggleOption from \"./toggle-option\";\n\nconst FilterUnit = ({\n filter,\n state,\n dispatch,\n formTemplates,\n tags,\n minify,\n}) => {\n const onDatumFieldsChange = (value) => {\n let datumFields = state.currentFilter['datum_fields'].value || {};\n datumFields[filter.id] = value;\n\n dispatch({\n type: 'changeFilterValue',\n filter: { id: 'datum_fields' },\n value: datumFields,\n });\n };\n\n const onFilterDelete = () => {\n dispatch({\n type: 'deleteFilter',\n value: filter,\n });\n };\n\n const onOperatorChange = (value) => {\n dispatch({\n type: 'changeFilterOperator',\n filter: filter,\n operator: value,\n });\n };\n\n const onFilterValueChange = (value) => {\n dispatch({\n type: 'changeFilterValue',\n filter: filter,\n value: value,\n });\n };\n\n const onFilterValueOptionsChange = (value) => {\n dispatch({\n type: 'changeFilterValueOptions',\n filter: filter,\n value: value,\n });\n };\n\n const enableStepDataFilters = (value) => {\n dispatch({\n type: 'enableStepDataFilters'\n });\n };\n\n const disableStepDataFilters = () => {\n dispatch({\n type: 'disableStepDataFilters'\n });\n };\n\n const label = () => {\n return truncate(filter.label, 26);\n }\n\n const renderSubUnit = (minified) => {\n switch (filter.type) {\n case 'applicantSearch': {\n return (\n <ApplicantSearch\n changeFilterValue={onFilterValueChange}\n changeFilterValueOptions={onFilterValueOptionsChange}\n filterState={state.currentFilter[filter.id]}\n minify={minified}\n />\n );\n }\n\n case 'assignedToggle':\n case 'outputRenewalsEnabled': {\n return (\n <div style={{ display: 'inline-block', marginTop: '8px' }}>\n <ToggleOption\n changeFilterValue={onFilterValueChange}\n on={state.currentFilter[filter.id].value}\n />\n </div>\n );\n }\n\n case 'completedStatus': {\n return <CompletedStatus\n changeFilterValue={onFilterValueChange}\n filterState={state.currentFilter[filter.id]}\n minify={minified}\n />\n }\n\n case 'currentStep': {\n return <StepSelect\n changeFilterValue={onFilterValueChange}\n filterState={state.currentFilter[filter.id]}\n stepDataForSearch={state.stepDataForSearch}\n minify={minified}\n />\n }\n\n case 'currentStepTime': {\n return <DateTerm\n changeFilterValue={onFilterValueChange}\n changeFilterValueOptions={onFilterValueOptionsChange}\n filterState={state.currentFilter[filter.id]}\n minify={minified}\n />\n }\n\n case 'datumField': {\n if (minified) {\n return null;\n } else {\n return <DatumFieldFilter\n onDatumFieldsChange={onDatumFieldsChange}\n fieldType={filter.fieldType}\n multipleChoiceOptions={filter.multipleChoiceOptions}\n datumFields={state.currentFilter.datum_fields}\n datumId={filter.id}\n />\n }\n }\n\n case 'formSelect': {\n return <FormSelect\n changeFilterValue={onFilterValueChange}\n changeFilterValueOptions={onFilterValueOptionsChange}\n disableStepDataFilters={disableStepDataFilters}\n enableStepDataFilters={enableStepDataFilters}\n filterState={state.currentFilter[filter.id]}\n teamFilter={state.currentFilter['team']}\n formTemplates={formTemplates}\n />\n }\n\n case 'importedSelect': {\n return <ImportedSelect\n changeFilterValue={onFilterValueChange}\n changeFilterValueOptions={onFilterValueOptionsChange}\n filterState={state.currentFilter[filter.id]}\n minify={minified}\n />\n }\n\n case 'completedDate':\n case 'launchedAt':\n case 'outputIssued': {\n return <DateRange\n changeFilterValue={onFilterValueChange}\n fromToValues={state.currentFilter[filter.id].value}\n minify={minified}\n />\n }\n\n case 'outputStatus': {\n return <OutputStatus\n changeFilterValue={onFilterValueChange}\n filterState={state.currentFilter[filter.id]}\n minify={minified}\n />\n }\n\n case 'renewalStatus': {\n return <RenewalStatus\n changeFilterValue={onFilterValueChange}\n filterState={state.currentFilter[filter.id]}\n minify={minified}\n />\n }\n\n case 'submission': {\n return <SubmissionFilter\n changeFilterValue={onFilterValueChange}\n filterState={state.currentFilter[filter.id]}\n minify={minified}\n />\n }\n\n case 'tagSelect': {\n return <TagSelect\n changeFilterValue={onFilterValueChange}\n filterState={state.currentFilter[filter.id]}\n tags={tags}\n />\n }\n\n case 'teamSelect': {\n return <TeamSelect\n changeFilterValue={onFilterValueChange}\n filterState={state.currentFilter[filter.id]}\n minify={minified}\n />\n }\n\n default:\n return null;\n }\n };\n\n const renderOperatorSelect = () => {\n return (\n <div className='metricsdashboard-filterselect'>\n <Select\n options={filter.operators}\n onChange={onOperatorChange}\n getOptionValue={(opt) => opt.id}\n value={filter.operators.find((opt) => opt.id == state.currentFilter[filter.id].operator)}\n className='react-select-metrics advanced-filter'\n />\n </div>\n );\n };\n\n const renderMainContent = () => {\n const unitId = `filter-unit-${filter.id}`;\n return (\n <div key={filter.id} className='metricsdashboard-filter-unit' id={unitId}>\n <div\n className='metricsdashboard-filterlabel margin-left bold'\n title={filter.label}\n >\n {label()}\n </div>\n {!!filter.operators.length && renderOperatorSelect()}\n {renderSubUnit()}\n <FontAwesomeIcon\n id='cancel-filter-icon'\n className='margin-right padding'\n style={{ color: '#cc1010', cursor: 'pointer', marginLeft: '8px' }}\n icon={icon({ name: 'xmark' })}\n onClick={onFilterDelete}\n />\n </div>\n );\n };\n\n const renderMinified = () => {\n return (\n <>\n <div className='metricsdashboard-filterlabel margin-right bold' title={filter.label}>{label()}</div>\n <MinifiedFilterUnit\n filterType={filter.type}\n filterState={state.currentFilter[filter.id]}\n formTemplates={formTemplates}\n tags={tags}\n stepDataForSearch={state.stepDataForSearch}\n />\n </>\n );\n };\n\n return minify ? renderMinified() : renderMainContent();\n};\n\nexport default FilterUnit;\n","const AdvancedFilterAPI = {\n index(kind) {\n const url = '/advanced_filters';\n return $.ajax(url, {\n method: 'GET',\n dataType: 'JSON',\n data: { kind }\n });\n },\n\n get(id) {\n const url = `/advanced_filters/${id}`;\n return $.ajax(url, {\n method: 'GET',\n dataType: 'JSON',\n });\n },\n\n loadDefault(kind) {\n const url = '/advanced_filters/load_default';\n return $.ajax(url, {\n method: 'GET',\n dataType: 'JSON',\n data: { kind }\n });\n },\n\n create(name, kind, filters, isDefault) {\n const url = '/advanced_filters';\n return $.ajax(url, {\n method: 'POST',\n dataType: 'JSON',\n data: {\n filter: {\n name,\n filters,\n kind,\n default: isDefault,\n }\n }\n });\n },\n\n update(id, kind, filters, isDefault) {\n const url = `/advanced_filters/${id}`;\n return $.ajax(url, {\n method: 'PATCH',\n dataType: 'JSON',\n data: {\n filter: {\n filters,\n kind,\n default: isDefault,\n }\n }\n });\n },\n\n rename(id, name) {\n const url = `/advanced_filters/${id}`;\n return $.ajax(url, {\n method: 'PATCH',\n dataType: 'JSON',\n data: {\n filter: { name }\n }\n });\n },\n\n delete(id) {\n const url = `/advanced_filters/${id}`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'JSON',\n });\n },\n};\n\nexport default AdvancedFilterAPI;\n","import React, { useEffect, useState } from 'react';\nimport dayjs from 'dayjs';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { solid } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport AdvancedFilterAPI from 'apis/advanced-filter-api';\n\nconst FilterRow = ({\n filter,\n onRowClick,\n onDeleteClick,\n isActiveRow,\n dispatch,\n}) => {\n const [editMode, setEditMode] = useState(false);\n const [deleteMode, setDeleteMode] = useState(false);\n const [displayName, setDisplayName] = useState(filter.name);\n const [newName, setNewName] = useState('');\n const rowClass = `load-filter-table-row ${isActiveRow ? 'active' : undefined}`;\n const showEditMode = isActiveRow && editMode;\n\n useEffect(() => {\n if (!isActiveRow) {\n setEditMode(false);\n }\n }, [isActiveRow]);\n\n const OnNameEdit = (e) => {\n const value = e.target.value;\n setNewName(value);\n };\n\n const ApplyNameEdit = () => {\n if (newName.length > 2) {\n AdvancedFilterAPI.rename(filter.id, newName)\n .done((res) => {\n dispatch({\n type: 'updateSavedFilter',\n value: res.filter,\n });\n setDisplayName(newName);\n })\n }\n\n setEditMode(false);\n };\n\n const renderFilterName = () => {\n return (\n <>\n {displayName}\n {filter.default && <em style={{ marginLeft: '4px' }}>(default)</em>}\n <FontAwesomeIcon\n className='load-filter-active-icon'\n icon={solid('pencil')}\n size='lg'\n onClick={() => setEditMode(true)}\n />\n </>\n );\n };\n\n const renderFilterNameEditMode = () => {\n return (\n <>\n <input type='text' defaultValue={displayName} onChange={OnNameEdit}/>\n <FontAwesomeIcon\n className='load-filter-active-icon'\n icon={solid('circle-check')}\n size='lg'\n onClick={ApplyNameEdit}\n />\n </>\n );\n };\n\n const renderDeleteConfirmation = () => {\n return (\n <>\n <div className='load-filter-table-cell' style={{ flexGrow: 1 }}>\n {`Are you sure you want to delete \"${filter.name}\" saved filter?`}\n </div>\n <div className='load-filter-table-cell' style={{ minWidth: '140px' }}>\n <button className='btn-secondary x-small' onClick={() => setDeleteMode(false)}>Cancel</button>\n <button className='btn-primary x-small margin-left' onClick={() => onDeleteClick(filter)}>Okay</button>\n </div>\n </>\n );\n };\n\n const renderMainContent = () => {\n return (\n <>\n <div className='load-filter-table-cell' style={{ flexGrow: 1 }}>\n {showEditMode ? renderFilterNameEditMode() : renderFilterName()}\n </div>\n <div className='load-filter-table-cell' style={{ flexBasis: '160px' }}>\n {dayjs(filter.created_at).format('MM/DD/YYYY hh:mm a')}\n </div>\n <div className='load-filter-table-cell' style={{ flexBasis: '65px' }}>\n <FontAwesomeIcon\n className='load-filter-active-icon'\n icon={solid('trash')}\n size='lg'\n onClick={() => setDeleteMode(true)}\n />\n </div>\n </>\n );\n };\n\n\n return (\n <div className={rowClass} onClick={() => onRowClick(filter)}>\n {deleteMode ? renderDeleteConfirmation() : renderMainContent()}\n </div>\n );\n};\n\nexport default FilterRow;","import React, { useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { solid } from '@fortawesome/fontawesome-svg-core/import.macro';\n\nimport AdvancedFilterAPI from 'apis/advanced-filter-api';\nimport Modal from 'components/shared/modal';\nimport FilterRow from './filter-row';\n\nconst LoadFilterModal = ({\n onClose,\n onLoad,\n dispatch,\n filters,\n}) => {\n const [activeFilterId, setActiveFilterId] = useState(null);\n\n const onRowClick = (item) => {\n setActiveFilterId(item.id);\n };\n\n const onLoadFilter = () => {\n if (!activeFilterId) { return null; }\n\n onLoad(activeFilterId)\n };\n\n const onDeleteFilter = (filter) => {\n AdvancedFilterAPI.delete(filter.id).\n done(() => {\n dispatch({\n type: 'deleteSavedFilter',\n value: filter\n });\n });\n };\n\n const renderFilters = () => {\n return filters.map((filter) =>\n <FilterRow\n key={filter.id}\n filter={filter}\n onRowClick={onRowClick}\n onDeleteClick={onDeleteFilter}\n isActiveRow={activeFilterId === filter.id}\n dispatch={dispatch}\n />\n );\n };\n\n const loadFilterButtonClass = `btn-primary ${activeFilterId ? undefined : 'disabled'}`;\n\n return (\n <Modal\n className='manage-filter-modal'\n onOutsideClick={onClose}\n >\n <div className='manage-filter-modal-header'>\n <h1>Manage Saved Filters</h1>\n </div>\n <div>\n <p>\n When you choose a filter, its rules and conditions are quickly used to sort through your data.\n This helps you narrow down the information to just what you need, making your analysis more focused.\n You can also rename or delete previously created filters.\n </p>\n </div>\n <div className='manage-filter-modal-form'>\n <div className='load-filter-table'>\n <div className='load-filter-table-header'>\n <div className='load-filter-table-header-cell' style={{ flexGrow: 1 }}>Filter Name</div>\n <div className='load-filter-table-header-cell' style={{ flexBasis: '140px' }}>Created On</div>\n <div className='load-filter-table-header-cell' style={{ flexBasis: '70px' }}>Action</div>\n </div>\n {renderFilters()}\n </div>\n </div>\n <div className='manage-filter-modal-footer'>\n <button onClick={onClose} className='btn-secondary'>Cancel</button>\n <button id='load-filter-button' onClick={onLoadFilter} className={loadFilterButtonClass}>Load Filter</button>\n </div>\n </Modal>\n );\n};\n\nexport default LoadFilterModal;\n","import React, { useEffect, useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { solid } from '@fortawesome/fontawesome-svg-core/import.macro';\n\nimport AdvancedFilterAPI from 'apis/advanced-filter-api';\nimport flash from 'components/shared/flash';\nimport Modal from 'components/shared/modal';\nimport SlidingToggle from 'components/shared/sliding-toggle';\n\n\nconst SaveFilterModal = ({\n filters,\n onClose,\n kind,\n loadedFilter,\n dispatch,\n}) => {\n const [filterName, setFilterName] = useState('');\n const [error, setError] = useState(false);\n const [saveAsOn, setSaveAsOn] = useState(false);\n const [saveAsDefaultOn, setSaveAsDefaultOn] = useState(false);\n\n useEffect(() => {\n if (saveAsOn && loadedFilter.default) {\n setSaveAsDefaultOn(true);\n }\n }, [saveAsOn]);\n\n const onSaveFilter = () => {\n if (saveAsOn) {\n AdvancedFilterAPI.update(loadedFilter.id, kind, filters, saveAsDefaultOn)\n .done((res) => {\n flash.success('Filter saved.');\n dispatch({\n type: 'updateSavedFilter',\n value: res.filter,\n });\n })\n .fail(() => flash.error('Could not save the filter.'))\n .always(() => onClose());\n } else {\n if (filterName.length) {\n AdvancedFilterAPI.create(filterName, kind, filters, saveAsDefaultOn)\n .done((res) => { \n flash.success('Filter saved.');\n dispatch({\n type: 'addSavedFilter',\n value: res.filter,\n });\n })\n .fail(() => flash.error('Could not save the filter.'))\n .always(() => onClose());\n } else {\n setError(true);\n };\n }\n };\n\n const onFilterNameChange = (e) => {\n if (error) { setError(false); }\n\n setFilterName(e.target.value);\n };\n\n const renderSaveAsDefault = () => {\n return (\n <div style={{ marginTop: '1rem' }}>\n <SlidingToggle\n label={`Save as Default`}\n on={saveAsDefaultOn}\n onToggle={() => setSaveAsDefaultOn(!saveAsDefaultOn)}\n />\n </div>\n );\n };\n\n const renderSaveAsCurrent = () => {\n if (!loadedFilter) { return null; }\n\n return (\n <div style={{ marginTop: '1rem' }}>\n <SlidingToggle\n id='save-as-current-filter'\n label={`Save as \"${loadedFilter.name}\"`}\n on={saveAsOn}\n onToggle={() => setSaveAsOn(!saveAsOn)}\n />\n </div>\n );\n };\n\n return (\n <Modal\n className='manage-filter-modal'\n onOutsideClick={onClose}\n >\n <div className='manage-filter-modal-header'>\n <h1>Save Filter</h1>\n </div>\n <div>\n <p>\n Saved filters empower you to easily access the information you need.\n By storing your custom filter settings, you can retrieve them later with just a click.\n No more recreating filters from scratch.\n </p>\n </div>\n <div className='manage-filter-modal-form'>\n <span>Filter Name</span>\n <input\n type='text'\n id='save-filter-name-input'\n onChange={onFilterNameChange}\n className={error ? 'error' : undefined}\n placeholder='Enter filter name'\n style={{ width: '300px' }}\n disabled={saveAsOn}\n />\n {renderSaveAsCurrent()}\n {renderSaveAsDefault()}\n </div>\n <div className='manage-filter-modal-footer'>\n <button onClick={onClose} className='btn-secondary'>Cancel</button>\n <button id='save-filter-button' onClick={onSaveFilter} className='btn-primary'>Save Filter</button>\n </div>\n </Modal>\n );\n};\n\nexport default SaveFilterModal;\n","import { useState, useEffect } from 'react';\n\nimport FilterActions from 'actions/filter-actions';\n\nconst useLoadTemplates = () => {\n const [templates, setTemplates] = useState([]);\n\n useEffect(() => {\n FilterActions.loadTemplates()\n .done((data) => {\n setTemplates(data)\n });\n }, []);\n\n return templates;\n}\n\nexport default useLoadTemplates;\n","const TagAPI = {\n index() {\n var url = '/tags';\n var request = $.ajax(url, {\n dataType: 'JSON',\n method: 'GET',\n });\n\n return request;\n },\n\n destroy(tagId) {\n const url = `/tags/${tagId}`;\n const request = $.ajax(url, {\n dataType: 'JSON',\n method: 'DELETE',\n });\n\n return request;\n },\n\n update(tagId, tagName) {\n const url = `/tags/${tagId}`;\n const request = $.ajax(url, {\n dataType: 'JSON',\n method: 'PUT',\n data: {\n name: tagName,\n },\n });\n\n return request;\n },\n};\n\nexport default TagAPI;\n","import { useState, useEffect } from 'react';\n\nimport TagAPI from 'apis/tag-api';\n\nconst useLoadTags = () => {\n const [tags, setTags] = useState([]);\n\n useEffect(() => {\n TagAPI.index().\n done((res) => setTags(res.tags));\n }, []);\n\n return tags;\n};\n\nexport default useLoadTags;\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { isEmpty, findWhere } from 'underscore';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { solid } from '@fortawesome/fontawesome-svg-core/import.macro';\n\nimport { useAdvancedFilterContext, useAdvancedFilterDispatchContext } from './advanced-filter/context';\nimport FilterUnit from './advanced-filter/filter-unit';\nimport LoadFilterModal from './advanced-filter/modals/load-filter-modal';\nimport SaveFilterModal from './advanced-filter/modals/save-filter-modal';\nimport Select from 'components/shared/select';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\nimport Popdown from 'components/shared/popdown';\nimport AdvancedFilterAPI from 'apis/advanced-filter-api';\nimport { error } from 'components/shared/flash'\nimport useLoadTemplates from \"components/hooks/use-load-templates\";\nimport useLoadTags from \"components/hooks/use-load-tags\";\n\nconst AdvancedFilter = ({\n onFilterApply,\n menuAvailable,\n kind,\n defaultFilter,\n previousState,\n filterParams,\n}) => {\n const state = useAdvancedFilterContext();\n const dispatch = useAdvancedFilterDispatchContext();\n const {\n activeFilters,\n availableFilters,\n currentFilter,\n loadedFilter,\n savedFilters,\n triggerRefresh,\n } = state;\n\n const [showMenuOptions, setShowMenuOptions] = useState(false);\n const [showLoadFilter, setShowLoadFilter] = useState(false);\n const [showSaveFilter, setShowSaveFilter] = useState(false);\n const [minify, setMinify] = useState(false);\n const menuAnchor = useRef(null);\n\n const formTemplates = useLoadTemplates();\n const tags = useLoadTags();\n\n useEffect(() => {\n if (filterParams && Object.keys(filterParams).length > 0) {\n const filters = {\n completed_status: { value: filterParams['completedStatus'] },\n imported: {value: filterParams['importType'], operator: 'is', options: {source_id: filterParams['importId']} }\n }\n\n return dispatch({\n type: 'loadFilters',\n value: { filters },\n })\n }\n\n if (previousState && previousState.availableFilters) {\n return dispatch({\n type: 'loadState',\n value: previousState,\n })\n }\n\n if (defaultFilter) {\n return dispatch({\n type: 'cacheAndLoadFilter',\n value: defaultFilter,\n });\n }\n\n return dispatch({\n type: 'loadDefault'\n })\n }, []);\n\n useEffect(() => {\n if (triggerRefresh > 0) { \n applyFilters(); \n }\n }, [triggerRefresh])\n\n function applyFilters () {\n onFilterApply(currentFilter, { ...state })\n }\n \n const addActiveFilter = (value) => {\n if (!isEmpty(value)) {\n dispatch({\n type: 'addFilter',\n value,\n });\n }\n };\n\n const openLoadFilterModal = () => {\n setShowMenuOptions(false);\n setShowLoadFilter(true);\n };\n\n const openSaveFilterModal = () => {\n setShowMenuOptions(false);\n setShowSaveFilter(true);\n };\n\n function onLoadFilter (filterId) {\n const filter = findWhere(savedFilters, { id: filterId })\n\n if (filter.filters) {\n dispatch({\n type: 'cacheAndLoadFilter',\n value: filter,\n });\n setShowLoadFilter(false);\n return null;\n }\n\n AdvancedFilterAPI.get(filterId)\n .done((res) => {\n dispatch({\n type: 'cacheAndLoadFilter',\n value: res.filter,\n });\n })\n .fail(() => error('Could not load the filter.'));\n setShowLoadFilter(false);\n }\n\n const renderFilterSelect = useCallback(() => {\n return (\n <div className='metricsdashboard-filterselect add-filter'>\n <Select\n options={availableFilters}\n onChange={addActiveFilter}\n value={null}\n className='react-select-metrics advanced-filter'\n placeholder='+ Add filter'\n />\n </div>\n );\n }, [availableFilters]);\n\n const renderActiveFilters = () => {\n const joiningAndSpan = (\n <span className='bold margin-left muted'>And</span>\n );\n\n const filters = activeFilters.map((filter, idx) => {\n const prependJoiningAnd = idx > 0;\n\n return (\n <>\n {prependJoiningAnd && joiningAndSpan}\n <FilterUnit\n key={filter.id}\n filter={filter}\n state={state}\n dispatch={dispatch}\n formTemplates={formTemplates}\n tags={tags}\n />\n </>\n );\n });\n\n return (\n <>\n {filters}\n {renderFilterSelect()}\n </>\n );\n };\n\n const renderMinified = () => {\n const joiningAndSpan = (\n <span className='margin-left margin-right muted'>|</span>\n );\n const filters = activeFilters.map((filter, idx) => {\n const prependJoiningAnd = idx > 0;\n\n return (\n <>\n {prependJoiningAnd && joiningAndSpan}\n <FilterUnit\n key={filter.id}\n filter={filter}\n state={state}\n dispatch={dispatch}\n formTemplates={formTemplates}\n tags={tags}\n minify\n />\n </>\n );\n });\n\n return (\n <div className='margin-left' style={{ marginTop: '4px' }}>\n {filters}\n </div>\n );\n };\n\n const renderLoadFilter = () => {\n return (\n <LoadFilterModal\n onLoad={onLoadFilter}\n onClose={() => {setShowLoadFilter(false)}}\n kind={kind}\n dispatch={dispatch}\n filters={savedFilters}\n />\n );\n };\n\n const renderSaveFilter = () => {\n return (\n <SaveFilterModal\n filters={currentFilter}\n kind={kind}\n onClose={() => setShowSaveFilter(false)}\n loadedFilter={loadedFilter}\n dispatch={dispatch}\n />\n );\n };\n\n const renderMenu = () => {\n return (\n <span\n ref={menuAnchor}\n className='filter-menu-options'\n id='filter-menu-options'\n onClick={() => setShowMenuOptions(true)}\n >\n <FontAwesomeIcon icon={solid('ellipsis')} size='lg' style={{ color: '#0463B7' }} />\n </span>\n );\n };\n\n const minifyOption = () => {\n if (minify) {\n return (\n <li onClick={() => {setMinify(false)}}>\n <FontAwesomeIcon icon={solid('eye')} size='lg' style={{ color: '#0463B7' }} />\n <span>Show filters</span>\n </li>\n )\n }\n\n return (\n <li onClick={() => {setMinify(true)}}>\n <FontAwesomeIcon icon={solid('eye-slash')} size='lg' style={{ color: '#0463B7' }} />\n <span>Hide filters</span>\n </li>\n )\n }\n\n const renderMenuOptions = () => {\n return (\n <Popdown anchorRef={menuAnchor} justify='right'>\n <CloseIfOutsideWrapper onClose={() => setShowMenuOptions(false)}>\n <div className='filter-menu-options-popdown'>\n <ul>\n <li onClick={openSaveFilterModal}>\n <FontAwesomeIcon icon={solid('floppy-disk')} size='lg' style={{ color: '#0463B7' }} />\n <span>Save current filter</span>\n </li>\n <li onClick={openLoadFilterModal}>\n <FontAwesomeIcon icon={solid('list')} size='lg' style={{ color: '#0463B7' }} />\n <span>Manage saved filters</span>\n </li>\n {minifyOption()}\n </ul>\n </div>\n </CloseIfOutsideWrapper>\n </Popdown>\n );\n };\n\n const filterOptions = () => {\n return savedFilters.map(({ id, name }) => ({\n value: id,\n label: name,\n }))\n }\n\n const renderFastFilters = () => {\n return (\n <div className='border-right' style={{ padding: '5px 10px 0 0' }}>\n <Select\n options={filterOptions()}\n onChange={(e) => { onLoadFilter(e.value) }}\n value={filterOptions().find(({ value }) => value === loadedFilter?.id) ?? null}\n className='react-select-metrics'\n placeholder='Saved Filters'\n styles={{\n singleValue: (provided) => ({\n ...provided,\n fontWeight: 'bold',\n })\n }}\n />\n </div>\n );\n };\n\n return (\n <>\n <div className='dashboard-filters'>\n <div className='metricsdashboard-fastfilter'>\n {renderFastFilters()}\n </div>\n <div style={{ flex: 1 }}>\n {minify ? renderMinified() : renderActiveFilters()}\n </div>\n <div style={{ marginLeft: 'auto' }}>\n {menuAvailable && renderMenu()}\n </div>\n </div>\n {showMenuOptions && renderMenuOptions()}\n {showLoadFilter && renderLoadFilter()}\n {showSaveFilter && renderSaveFilter()}\n </>\n );\n};\n\nexport default AdvancedFilter;\n","import React from 'react';\n\nimport { useAdvancedFilterContext, useAdvancedFilterDispatchContext } from 'components/shared/advanced-filter/context';\n\nconst AdvancedFilterClearButton = ({\n className,\n children,\n}) => {\n const state = useAdvancedFilterContext();\n const dispatch = useAdvancedFilterDispatchContext();\n\n const onClick = () => {\n dispatch({\n type: 'loadDefault',\n });\n };\n\n if (state.isDefault) { return null; }\n\n return (\n <button type='button'\n className={className}\n onClick={onClick}\n >\n {children}\n </button>\n );\n};\n\nexport default AdvancedFilterClearButton;\n","import React from 'react';\nimport warn from 'warning';\n\nlet hasLocalStorage = true;\nconst testKey = 'react-localstorage.mixin.test-key';\nlet ls;\ntry {\n // Access to global `localStorage` property must be guarded as it\n // fails under iOS private session mode.\n ls = global.localStorage;\n ls.setItem(testKey, 'foo');\n ls.removeItem(testKey);\n} catch (e) {\n hasLocalStorage = false;\n}\n\nfunction fetchStateFromLocalStorage(key) {\n if (!hasLocalStorage) return;\n if (key === false) return;\n try {\n const storedState = JSON.parse(ls.getItem(key));\n if (storedState) {\n return storedState;\n }\n } catch (e) {\n // eslint-disable-next-line no-console\n if (console) console.warn(e);\n }\n}\n\nfunction saveStateToLocalStorage(key, saveState) {\n if (!hasLocalStorage) return;\n if (key === false) return;\n ls.setItem(key, JSON.stringify(saveState));\n}\n\nexport default {\n fetch: fetchStateFromLocalStorage,\n save: saveStateToLocalStorage,\n exists: hasLocalStorage,\n};\n","import React from 'react';\n\nclass ErrorBoundary extends React.Component {\n constructor(props) {\n super(props);\n this.state = { hasError: false };\n }\n\n componentDidCatch(error, info) {\n this.setState({ hasError: true });\n\n if (CityGrows.Server.env == 'development') {\n console.log(error);\n } else {\n Rollbar.error(error, info);\n }\n }\n\n render() {\n if (this.state.hasError) {\n return (\n <div className='error-boundary fullheight'>\n <img src='/images/500.png' alt='It looks like something went wrong' />\n </div>\n );\n }\n\n return this.props.children;\n }\n}\n\nexport default ErrorBoundary;\n","// NOTE: The format in this array matches the\n// react-select options format.\nconst CURRENT_STEP_TERMS = [\n { value: 'minutes', label: 'Minutes' },\n { value: 'hours', label: 'Hours' },\n { value: 'days', label: 'Days' },\n];\n\nconst CURRENT_STEP_OPERATORS = [\n { value: 'less', label: 'Less' },\n { value: 'longer', label: 'Longer' },\n];\n\nconst STATUSES = [\n { value: 'active', label: 'Active' },\n { value: 'completed', label: 'Completed' },\n { value: 'halted', label: 'Halted' },\n { value: 'all', label: 'All' },\n];\n\nconst SORTS = [\n { value: 'last_active', label: 'Recent activity' },\n { value: 'date_launched', label: 'Date launched' },\n];\n\n// All of these other ones match react-select2-wrapper\nconst SOURCES = [\n { id: 'all', text: 'All' },\n { id: 'not_imported', text: 'Not imported' },\n { id: 'imported', text: 'Imported' },\n { id: 'specific_import', text: 'Specific import' },\n];\n\nconst OUTPUT_STATUSES = [\n { id: 'all', text: 'All' },\n { id: 'issued', text: 'Issued' },\n { id: 'expired', text: 'Expired' },\n { id: 'unissued', text: 'Unissued' },\n { id: 'revoked', text: 'Revoked' },\n];\n\nexport const RENEWAL_STATUSES = [\n { id: 'all', text: 'All' },\n { id: 'renewal', text: 'Is renewal' },\n { id: 'not_renewal', text: 'Not renewal' },\n];\n\nexport { OUTPUT_STATUSES as OutputStatuses };\n\nconst DEFAULT_CURRENT_STEP_TIME_VALUES = {\n value: null,\n currentStepTimeTerm: CURRENT_STEP_TERMS[2],\n currentStepTimeOperator: CURRENT_STEP_OPERATORS[1],\n}\n\nconst DEFAULT_LAUNCHED_AT = {\n from: '',\n to: '',\n};\n\nconst DEFAULT_APPLICANT = {\n id: null,\n};\n\nconst STATE_FILTER_KEYS = [\n 'completedFrom',\n 'completedTo',\n 'currentStepId',\n 'currentStepTimeTerm',\n 'currentStepTimeOperator',\n 'customId',\n 'dataFilters',\n 'launchedFrom',\n 'launchedTo',\n 'applicant',\n 'applicantId',\n 'onlyAssigned',\n 'output',\n 'renewal',\n 'workflow_status',\n 'processId',\n 'sourceId',\n 'sourceType',\n 'status',\n 'stepData',\n 'tags',\n 'teamId',\n 'templateId',\n];\n\nconst WORKFLOW_STATUSES = [\n { id: 'all', text: 'All' },\n { id: 'published', text: 'Published' },\n { id: 'unpublished', text: 'Unpublished' },\n { id: 'closed', text: 'Closed' },\n { id: 'archived', text: 'Archived' },\n];\n\nfunction defaultStatus() {\n return STATUSES[3].value;\n}\n\nfunction defaultSources() {\n return SOURCES[0].id;\n}\n\nconst FilterDefaults = {\n CURRENT_STEP_TERMS,\n CURRENT_STEP_OPERATORS,\n STATE_FILTER_KEYS,\n DEFAULT_LAUNCHED_AT,\n DEFAULT_APPLICANT,\n DEFAULT_CURRENT_STEP_TIME_VALUES,\n STATUSES,\n SORTS,\n defaultStatus,\n defaultSources,\n WORKFLOW_STATUSES,\n};\n\nexport default FilterDefaults;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Select from 'components/shared/select';\nimport useOnclickOutside from 'react-cool-onclickoutside';\n\nconst SEARCH_TYPES = [\n { value: 'exact', label: 'Exact Match' },\n { value: 'contains', label: 'Contains' },\n];\n\nconst SearchBar = ({\n onOutsideClick, isActive, children, onFocus, searchTypeChanged, searchType, search, searchButtonId,\n}) => {\n const wrapperRef = useOnclickOutside(onOutsideClick);\n\n const focusedClass = isActive ? 'active' : null;\n\n return (\n <div ref={wrapperRef} className={`searchbox cf ${focusedClass}`}>\n {children}\n {isActive && (\n <Select\n options={SEARCH_TYPES}\n onFocus={onFocus}\n onChange={searchTypeChanged}\n value={SEARCH_TYPES.find(({ value }) => value === searchType)}\n isSearchable={false}\n menuPosition='fixed'\n aria-label='Search Method'\n styles={{\n container: (provided) => ({\n ...provided,\n '@media (max-width: 480px)': {\n position: 'absolute',\n right: '0px',\n top: '5px',\n },\n 'min-width': '110px',\n }),\n control: (provided) => ({\n ...provided,\n lineHeight: '3rem',\n height: '3rem',\n // This is to override the __control styles\n border: 'none',\n backgroundColor: 'inherit !important',\n }),\n // The styling for the value\n singleValue: (provided) => ({\n ...provided,\n color: '#597A91',\n // This is one modular scale bigger but we don't have\n // a direct reference to that here\n fontSize: '1.2rem',\n }),\n }}\n />\n )}\n <button\n type='button'\n className='btn-primary'\n onClick={search}\n id={searchButtonId}\n >\n Search\n </button>\n </div>\n );\n};\n\nSearchBar.propTypes = {\n children: PropTypes.node,\n isActive: PropTypes.bool,\n onOutsideClick: PropTypes.func,\n onFocus: PropTypes.func,\n search: PropTypes.func,\n searchType: PropTypes.string,\n searchTypeChanged: PropTypes.func,\n searchButtonId: PropTypes.string,\n};\n\nSearchBar.defaultProps = {\n // Setting this as a defaultProp ensures that the selector shows\n // up on the search bar on the public search page\n isActive: true,\n onOutsideClick: () => {},\n searchButtonId: '',\n};\n\nexport default SearchBar;\n","/*\n * Adapted from react-minimalist-portal by Léo Pradel\n*/\nimport { useRef, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { createPortal } from 'react-dom';\n\nconst Portal = ({ children }) => {\n const containerRef = useRef(document.createElement('div'));\n useEffect(() => {\n // This copy is recommended by eslint rules to prevent\n // a stale reference to `current` in the cleanup logic.\n // It's unlikely a problem here (the ref shouldn't change),\n // but it's good form.\n const div = containerRef.current;\n document.body.appendChild(div);\n return () => {\n document.body.removeChild(div);\n };\n });\n\n return createPortal(children, containerRef.current);\n};\n\nPortal.propTypes = {\n children: PropTypes.node,\n};\n\nexport default Portal;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst DEFAULT_OPTIONS = {\n paddingChars: 15,\n};\n\nconst TRUNCATION_SYMBOL = '...';\n\nconst Excerpt = ({ input, phrase, options }) => {\n const lowerInput = input.toLowerCase();\n const lowerPhrase = phrase.toLowerCase();\n\n const config = {\n ...DEFAULT_OPTIONS,\n ...options,\n };\n\n const phrasePos = lowerInput.indexOf(lowerPhrase);\n if (phrasePos === -1) {\n return null;\n }\n\n const startPos = (phrasePos > config.paddingChars) ? (phrasePos - config.paddingChars) : 0;\n const startCap = startPos > 0 ? TRUNCATION_SYMBOL : '';\n const startChunk = lowerInput.slice(startPos, phrasePos);\n\n const candidateEndPos = phrasePos + lowerPhrase.length + config.paddingChars;\n const endPos = (candidateEndPos < input.length - 1) ? candidateEndPos : input.length;\n\n const endCap = (candidateEndPos < input.length - 1) ? TRUNCATION_SYMBOL : '';\n const endChunk = lowerInput.slice(phrasePos + lowerPhrase.length, endPos);\n\n return <>{startCap}{startChunk}<strong>{phrase}</strong>{endChunk}{endCap}</>;\n};\n\nExcerpt.propTypes = {\n input: PropTypes.string.isRequired,\n phrase: PropTypes.string.isRequired,\n options: PropTypes.object,\n};\n\nexport default Excerpt;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty } from 'underscore';\n\nimport Portal from 'components/shared/portal';\nimport Excerpt from 'components/shared/excerpt';\n\nconst typeToUrlSegment = {\n InitiatedFlow: 'initiated_flows',\n ImportedFlow: 'imported_flows',\n};\n\nconst urlForItem = (item) => `/${typeToUrlSegment[item.dashboardable_type]}/${item.dashboardable_id}`;\n\nconst getPopupPosition = (anchorRef) => {\n if (!anchorRef.current) {\n return {};\n }\n const { left, top } = window.$(anchorRef.current).offset();\n return { left, top: top + 50 };\n};\nconst MasterSearchResults = ({ results, searchTerms, anchorRef }) => {\n const { top, left } = getPopupPosition(anchorRef);\n\n let resultsHTML;\n\n if (!results) {\n resultsHTML = <div className='empty'>Searching</div>;\n } else if (isEmpty(results)) {\n resultsHTML = <div className='empty'>No results</div>;\n } else {\n resultsHTML = results.map((item) => (\n <a\n href={urlForItem(item)}\n key={item.dashboardable_id + item.dashboardable_type + item.collected_datum_id}\n className='dashboard-mastersearchresult'\n >\n\n <div>{`${item.template_name} #${item.scoped_id || '---'}`}</div>\n {item.identifier && <div>{item.identifier}</div>}\n <sub>\n <Excerpt\n input={item.match}\n phrase={searchTerms}\n options={{ paddingChars: 25 }}\n />\n </sub>\n </a>\n ));\n }\n\n return (\n <Portal>\n <ul style={{ top, left }} className='dashboard-filters-searchresults raised bg-white'>\n {resultsHTML}\n </ul>\n </Portal>\n );\n};\n\nMasterSearchResults.propTypes = {\n results: PropTypes.array,\n anchorRef: PropTypes.object,\n searchTerms: PropTypes.string,\n};\n\nexport default MasterSearchResults;\n","const KEYS = {\n ENTER_KEY: 13,\n};\n\nexport default KEYS;\n","import React, { useState, useMemo, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport Chip from '@material-ui/core/Chip';\nimport { isEmpty, debounce } from 'underscore';\nimport truncate from 'truncate';\n\nimport DashboardActions from 'actions/dashboard-actions';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\nimport SearchBar from 'components/shared/search-bar';\nimport MasterSearchResults from './master-search-results';\nimport KEYS from '../../constants/keys';\n\nconst MasterSearch = ({ onChange }) => {\n const [masterSearchResults, setMasterSearchResults] = useState([]);\n const [masterSearchTerms, setMasterSearchTerms] = useState('');\n const [open, setOpen] = useState(false);\n const [chipPresent, setChipPresent] = useState(false);\n const [searchBarInFocus, setSearchBarInFocus] = useState(false);\n const [typeInFocus, setTypeInFocus] = useState(false);\n const [searchType, setSearchType] = useState('contains');\n\n const currentSearchRef = useRef();\n const masterSearchRef = useRef();\n\n const debouncedMasterSearchChanged = useMemo(\n () => debounce(\n (terms, type) => {\n setMasterSearchResults([]);\n setOpen(!isEmpty(terms));\n\n if (isEmpty(terms)) { return; }\n\n if (currentSearchRef.current) { currentSearchRef.current.abort(); }\n currentSearchRef.current = DashboardActions\n .runSearch(terms, type)\n .done((res) => setMasterSearchResults(res.items));\n },\n 333,\n ),\n [],\n );\n\n const shouldShowSearchResults = open && !isEmpty(masterSearchTerms);\n\n const updateTerms = (e) => {\n const { value } = e.currentTarget;\n setMasterSearchTerms(value);\n debouncedMasterSearchChanged(value, searchType);\n };\n\n const onEnterPressed = () => {\n setChipPresent(true);\n setOpen(false);\n sendSearch(masterSearchTerms, searchType);\n };\n\n const sendSearch = (term, type) => {\n if (onChange) {\n onChange(term, type);\n }\n };\n\n const onInputKeyUp = (e) => {\n if (e.keyCode === KEYS.ENTER_KEY) {\n e.preventDefault();\n onEnterPressed();\n }\n };\n\n const onSearchTypeChange = ({ value }) => {\n setSearchType(value);\n if (chipPresent) {\n sendSearch(masterSearchTerms, value);\n } else {\n debouncedMasterSearchChanged(masterSearchTerms, value);\n }\n };\n\n const onDeleteClick = () => {\n onChange(null);\n setMasterSearchTerms('');\n setChipPresent(false);\n };\n\n const onChipClick = () => {\n setChipPresent(false);\n };\n\n const onSearchBarBlur = () => {\n if (isEmpty(masterSearchTerms)) {\n setSearchBarInFocus(false);\n }\n };\n\n const onOutsideClick = () => {\n if (isEmpty(masterSearchTerms)) {\n setSearchBarInFocus(false);\n setTypeInFocus(false);\n }\n };\n\n return (\n <CloseIfOutsideWrapper\n onClose={() => setOpen(false)}\n wrapperIgnoreClass='dashboard-mastersearchresult'\n >\n <div className='dashboard-filters-searchwrap'>\n <SearchBar\n searchTypeChanged={onSearchTypeChange}\n onFocus={() => setTypeInFocus(true)}\n searchType={searchType}\n search={onEnterPressed}\n isActive={searchBarInFocus || typeInFocus}\n onOutsideClick={onOutsideClick}\n >\n {chipPresent\n ? (\n <div className='dashboard-search-chipcontainer'>\n <Chip\n clickable\n label={truncate(masterSearchTerms, 15)}\n onDelete={onDeleteClick}\n onClick={onChipClick}\n />\n </div>\n )\n : (\n <>\n <input\n onKeyUp={onInputKeyUp}\n type='text'\n ref={masterSearchRef}\n onChange={updateTerms}\n value={masterSearchTerms}\n onFocus={() => setSearchBarInFocus(true)}\n onBlur={onSearchBarBlur}\n placeholder='Search'\n />\n {shouldShowSearchResults && (\n <MasterSearchResults\n searchTerms={masterSearchTerms}\n anchorRef={masterSearchRef}\n results={masterSearchResults}\n />\n )}\n </>\n )}\n </SearchBar>\n </div>\n </CloseIfOutsideWrapper>\n );\n};\n\nMasterSearch.propTypes = {\n onChange: PropTypes.func,\n};\n\nexport default MasterSearch;\n","import React from 'react';\nimport truncate from 'truncate';\nimport dayjs from 'dayjs';\nimport DiscGroup from 'components/shared/disc-group';\nimport { findWhere } from 'underscore';\n\nconst { Cell } = require('fixed-data-table-2');\n\nconst DashboardCell = ({\n item, cellName, onFlowBoxClick, selectedItems,\n}) => {\n function urlForItem() {\n switch (item.dashboardable_type) {\n case 'InitiatedFlow':\n return `/initiated_flows/${item.dashboardable_id}`;\n case 'ImportedFlow':\n return `/imported_flows/${item.dashboardable_id}`;\n default:\n throw new Error(`Unrecognized dashboardable type ${item.dashboardable_type}`);\n }\n }\n\n function buildId() {\n const id = item.dashboardable_type === 'InitiatedFlow'\n ? `#${item.scoped_id}`\n : '–';\n\n return (\n <Cell>\n <a\n href={urlForItem()}\n className='vmiddle'\n dangerouslySetInnerHTML={{ __html: id }}\n />\n </Cell>\n );\n }\n\n function buildRenewal() {\n if (!item.is_renewal) { return null; }\n\n return (\n <Cell>\n <span title='Renewal' className='tag tag-icon small inline'><div className='icon icon-renew' /></span>\n </Cell>\n );\n }\n\n function buildIdentifier() {\n return (\n <Cell>\n <span dangerouslySetInnerHTML={{ __html: truncate(item.identifier, 13) }} />\n </Cell>\n );\n }\n\n function buildCheckbox() {\n return (\n <input\n type='checkbox'\n checked={!!findWhere(selectedItems, { id: item.dashboardable_id, type: item.dashboardable_type })}\n onChange={(e) => { onFlowBoxClick(item, e); }}\n />\n );\n }\n\n function buildTemplateName() {\n return (\n <Cell className='flowtemplatename' title={item.template_name}>\n {truncate(item.template_name, 25)}\n </Cell>\n );\n }\n\n function buildApplicant() {\n const applicantName = item.dashboardable_type === 'InitiatedFlow'\n ? item.applicant\n : '(Imported)';\n\n return (\n <Cell>\n <span className='dashboard-applicant' dangerouslySetInnerHTML={{ __html: applicantName }} />\n </Cell>\n );\n }\n\n function buildAction() {\n return (\n <Cell>\n <span className='dashboard-actionlink' dangerouslySetInnerHTML={{ __html: item.action }} />\n </Cell>\n );\n }\n\n function buildLaunched() {\n return (\n <Cell>\n {dayjs(item.created_at).format('l')}\n </Cell>\n );\n }\n\n function buildStatus() {\n return (\n <Cell>\n <span dangerouslySetInnerHTML={{ __html: item.status }} />\n </Cell>\n );\n }\n\n function buildCurrentStep() {\n return (\n <Cell>\n <div className='cellCurrentStep'>\n {truncate(item.current_step_name, 25)}\n <div dangerouslySetInnerHTML={{ __html: item.current_step_elapsed_time_string }} />\n </div>\n </Cell>\n );\n }\n\n function buildResponsible() {\n return (\n <Cell>\n <DiscGroup groupMembers={item.assigned} />\n </Cell>\n );\n }\n\n function buildLastEdited() {\n return (\n <Cell>\n {dayjs(item.last_edited).format('LLL')}\n </Cell>\n )\n }\n\n function buildLastActivity() {\n return (\n <Cell>\n {dayjs(item.last_activity_at).format('l')}\n </Cell>\n );\n }\n\n switch (cellName) {\n case 'id':\n return buildId();\n case 'renewal':\n return buildRenewal();\n case 'identifier':\n return buildIdentifier();\n case 'checkbox':\n return buildCheckbox();\n case 'template_name':\n return buildTemplateName();\n case 'applicant':\n return buildApplicant();\n case 'action':\n return buildAction();\n case 'launched_at':\n return buildLaunched();\n case 'status':\n return buildStatus();\n case 'current_step':\n return buildCurrentStep();\n case 'responsible':\n return buildResponsible();\n case 'last_edited':\n return buildLastEdited();\n case 'last_activity':\n return buildLastActivity();\n default:\n throw new Error(`Unhandled cell name ${cellName}`);\n }\n};\n\nexport default DashboardCell;\n","import React, { useCallback } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { isString } from 'underscore';\n\nconst { Cell } = require('fixed-data-table-2');\n\nimport { useAdvancedFilterContext } from 'components/shared/advanced-filter/context';\n\n\nconst SortingHeaderCell = ({\n title,\n columnId,\n activeOrder,\n onSorting,\n}) => {\n const { currentFilter } = useAdvancedFilterContext();\n const isActive = activeOrder?.by === columnId;\n const order = activeOrder?.order;\n\n const nextOrder = () => {\n if (!isActive) { return 'desc'; }\n if (isString(order)) {\n return (order === 'desc') ? 'asc' : 'desc';\n }\n return 'desc';\n };\n\n const sortByColumn = useCallback(() => {\n onSorting({ ...currentFilter, sort: { by: columnId, order: nextOrder() } });\n }, [currentFilter]);\n\n const renderIcon = () => {\n const iconClass = `sorting-header-icon ${isActive ? 'active' : ''}`;\n\n if (!isActive || order === 'desc') {\n return <FontAwesomeIcon className={iconClass} icon={icon({ name: 'arrow-down-wide-short' })} />\n } else {\n return <FontAwesomeIcon className={iconClass} icon={icon({ name: 'arrow-up-wide-short' })} />\n }\n };\n\n return (\n <Cell className='sorting-header-cell' onClick={sortByColumn}>\n {title}\n {renderIcon()}\n </Cell>\n );\n};\n\nexport default SortingHeaderCell;\n\n","import React, { useState, useRef, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport DashboardActions from 'actions/dashboard-actions';\nimport { debounce } from 'underscore';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport DashboardCell from './dashboard-cell';\nimport SortingHeaderCell from './sorting-header-cell'\n\nconst { Table } = require('fixed-data-table-2');\nconst { Column } = require('fixed-data-table-2');\nconst { Cell } = require('fixed-data-table-2');\n\nconst MainDashboard = ({\n resizeCount,\n initiatedFlows,\n selectedItems,\n onFlowBoxClick,\n rowsCount,\n hasTemplates,\n noTeams,\n activeOrder,\n sortingFn,\n}) => {\n const dashboardElement = useRef();\n\n const [tableWidth, setTableWidth] = useState(0);\n const [tableHeight, setTableHeight] = useState(0);\n\n const onResize = debounce(() => {\n setTableHeight(contentHeight());\n setTableWidth(contentWidth);\n }, 100);\n\n useEffect(() => {\n window.addEventListener('resize', onResize);\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [onResize]);\n\n useEffect(() => {\n onResize();\n }, [resizeCount, onResize]);\n\n function dashboardHasContent() {\n return (initiatedFlows !== null\n && initiatedFlows.length > 0);\n }\n\n function isLoading() {\n return initiatedFlows === null;\n }\n\n function buildCell(cellName, columnAttrs) {\n const initiatedFlow = initiatedFlows[columnAttrs.rowIndex];\n\n if (!initiatedFlow) {\n DashboardActions.nullCellRequested(columnAttrs.rowIndex);\n return (\n <Cell key='dashboardloadingcell'>\n <div className='dashboard-loadingcell' />\n </Cell>\n );\n }\n\n return (\n <DashboardCell\n item={initiatedFlow}\n cellName={cellName}\n selectedItems={selectedItems}\n onFlowBoxClick={onFlowBoxClick}\n />\n );\n }\n\n function contentWidth() {\n return dashboardElement.current.offsetWidth;\n }\n\n function contentHeight() {\n return dashboardElement.current.offsetHeight;\n }\n\n function rowResponsibilityClass(rowIndex) {\n if (!initiatedFlows[rowIndex]) { return; }\n\n const initiatedFlow = initiatedFlows[rowIndex];\n if (initiatedFlow.current_user_responsible) {\n return 'responsible';\n }\n }\n\n function renderGetStartedLink() {\n if (noTeams) {\n return <a className='btn-primary' href='/teams/new' data-method='get'>Create your first team</a>;\n }\n\n return <a className='btn-primary' href='/flow_templates' data-method='post'>Create your first form</a>;\n }\n\n function renderContent() {\n if (isLoading()) {\n return (\n <div className='dashboard-loading'>\n <LoadingSpinner size='large' />\n </div>\n );\n }\n\n if (dashboardHasContent()) {\n return (\n <Table\n rowsCount={rowsCount}\n rowHeight={50}\n headerHeight={35}\n width={tableWidth}\n height={tableHeight}\n rowClassNameGetter={rowResponsibilityClass}\n >\n\n <Column\n header={<Cell />}\n cell={(columnAttrs) => {\n return buildCell('checkbox', columnAttrs);\n }}\n width={35}\n cellClassName='dashboard-processcheckbox'\n />\n\n <Column\n header={<Cell />}\n cell={(columnAttrs) => {\n return buildCell('renewal', columnAttrs);\n }}\n width={35}\n cellClassName='dashboard-renewal'\n />\n\n <Column\n header={<SortingHeaderCell title='ID' columnId='process_id' activeOrder={activeOrder} onSorting={sortingFn} />}\n cell={(columnAttrs) => {\n return buildCell('id', columnAttrs);\n }}\n width={70}\n cellClassName='dashboard-processid'\n />\n\n <Column\n header={<Cell>Identifier</Cell>}\n cell={(columnAttrs) => {\n return buildCell('identifier', columnAttrs);\n }}\n width={150}\n />\n\n <Column\n header={<Cell>Form</Cell>}\n cell={(columnAttrs) => {\n return buildCell('template_name', columnAttrs);\n }}\n width={225}\n />\n\n <Column\n header={<Cell>Applicant</Cell>}\n cell={(columnAttrs) => {\n return buildCell('applicant', columnAttrs);\n }}\n width={200}\n flexGrow={1}\n />\n\n <Column\n header={<Cell>Action</Cell>}\n cell={(columnAttrs) => {\n return buildCell('action', columnAttrs);\n }}\n width={150}\n />\n\n <Column\n header={<SortingHeaderCell title='Launched' columnId='date_launched' activeOrder={activeOrder} onSorting={sortingFn} />}\n cell={(columnAttrs) => {\n return buildCell('launched_at', columnAttrs);\n }}\n width={120}\n />\n\n <Column\n header={<Cell>Status</Cell>}\n cell={(columnAttrs) => {\n return buildCell('status', columnAttrs);\n }}\n width={100}\n />\n\n <Column\n header={<SortingHeaderCell title='Last activity' columnId='last_activity' activeOrder={activeOrder} onSorting={sortingFn} />}\n cell={(columnAttrs) => {\n return buildCell('last_activity', columnAttrs);\n }}\n width={140}\n />\n\n <Column\n header={<SortingHeaderCell title='Current step' columnId='current_step_since' activeOrder={activeOrder} onSorting={sortingFn} />}\n cell={(columnAttrs) => {\n return buildCell('current_step', columnAttrs);\n }}\n width={225}\n />\n\n <Column\n header={<Cell>Assignees</Cell>}\n cell={(columnAttrs) => {\n return buildCell('responsible', columnAttrs);\n }}\n width={195}\n flexGrow={1}\n />\n\n </Table>\n );\n }\n\n if (!hasTemplates) {\n return (\n <div className='dashboard-message relative'>\n <h1>Welcome to ClearForms</h1>\n <p>There’s nothing here yet. Ready to get started?</p>\n {renderGetStartedLink()}<br />\n <p className='margin-top'>or check out our <a target='_blank' href='https://help.citygrows.com/en/collections/1543432-i-work-for-a-government-and-want-to-set-up-citygrows-for-permitting-licensing-or-internal-workflows' rel='noreferrer'>getting started guide</a>.</p>\n </div>\n );\n }\n }\n\n return (\n <div ref={dashboardElement} className='dashboard-maincontent-rowwrap overflow-x-auto'>\n {renderContent()}\n </div>\n );\n};\n\nMainDashboard.propTypes = {\n resizeCount: PropTypes.number.isRequired,\n selectedItems: PropTypes.arrayOf(PropTypes.number),\n initiatedFlows: PropTypes.arrayOf(PropTypes.shape({\n current_user_responsible: PropTypes.bool,\n })),\n hasTemplates: PropTypes.bool.isRequired,\n totalInitiatedFlowCount: PropTypes.number,\n rowsCount: PropTypes.number,\n};\n\nMainDashboard.defaultProps = {\n selectedItems: [],\n};\n\nexport default MainDashboard;\n","const TaggingAPI = {\n create(taggableType, taggableId, tagAttrs) {\n const url = '/taggings';\n const mergedAttrs = {\n ...tagAttrs,\n taggable_type: taggableType,\n taggable_id: taggableId,\n };\n const request = $.ajax(url, {\n dataType: 'JSON',\n method: 'POST',\n data: {\n tagging: mergedAttrs,\n },\n });\n\n return request;\n },\n\n createInBatch(taggingsAttrs) {\n const url = '/taggings/create_in_batch';\n\n const request = $.ajax(url, {\n dataType: 'JSON',\n method: 'POST',\n data: {\n taggings: JSON.stringify(taggingsAttrs),\n },\n });\n\n return request;\n },\n\n destroy(taggingId) {\n const url = `/taggings/${taggingId}`;\n const request = $.ajax(url, {\n dataType: 'JSON',\n method: 'DELETE',\n });\n\n return request;\n },\n\n destroyInBatch(taggingsAttrs) {\n const url = '/taggings/destroy_in_batch';\n\n const request = $.ajax(url, {\n dataType: 'JSON',\n method: 'DELETE',\n data: {\n taggings: JSON.stringify(taggingsAttrs),\n },\n });\n\n return request;\n },\n};\n\nexport default TaggingAPI;\n","import TaggingAPI from '../apis/tagging-api';\nimport { error } from '../components/shared/flash';\nimport InitiatedFlowConstants from '../constants/initiated-flow-constants';\nimport TagAPI from '../apis/tag-api';\n\nconst TagManagerActions = {\n createTag(dispatch, taggableType, taggableId, tagName) {\n TaggingAPI.create(taggableType, taggableId, {\n new_tag_name: tagName,\n })\n .done((tagging) => { this.onTagAdded(dispatch, tagging); })\n .fail(() => { error(); });\n },\n\n addTagging(dispatch, taggableType, taggableId, tagId) {\n TaggingAPI.create(taggableType, taggableId, {\n tag_id: tagId,\n })\n .done((tagging) => { this.onTagAdded(dispatch, tagging); })\n .fail(() => { error(); });\n },\n\n addTaggingInBulk(taggingsAttrs) {\n return TaggingAPI.createInBatch(taggingsAttrs);\n },\n\n removeTagging(dispatch, taggingId) {\n TaggingAPI.destroy(taggingId)\n .done(() => { this.onTaggingRemoved(dispatch, taggingId); })\n .fail(() => { error(); });\n },\n\n removeTaggingInBulk(taggingsAttrs) {\n return TaggingAPI.destroyInBatch(taggingsAttrs);\n },\n\n updateTag(dispatch, tagId, tagName) {\n return TagAPI.update(tagId, tagName)\n .done((tag) => { this.onTagUpdated(dispatch, tag); })\n .fail(() => { error(); });\n },\n destroyTag(dispatch, tagId) {\n TagAPI.destroy(tagId)\n .done((tag) => { this.onTagDeleted(dispatch, tag.id); })\n .fail(() => { error(); });\n },\n\n onTagAdded(dispatch, tagging) {\n dispatch({\n type: InitiatedFlowConstants.TAG_ADDED,\n tagging,\n });\n },\n\n onTaggingRemoved(dispatch, taggingId) {\n dispatch({\n type: InitiatedFlowConstants.TAG_REMOVED,\n taggingId,\n });\n },\n\n onTagDeleted(dispatch, tagId) {\n dispatch({\n type: InitiatedFlowConstants.TAG_DELETED,\n tagId,\n });\n },\n\n onTagUpdated(dispatch, tag) {\n dispatch({\n type: InitiatedFlowConstants.TAG_UPDATED,\n tag,\n });\n },\n};\n\nexport default TagManagerActions;\n","import React, { useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { filter, isEmpty, reject } from 'underscore';\nimport truncate from 'truncate';\nimport TagManagerActions from 'actions/tag-manager-actions';\nimport pluralize from 'modules/pluralize';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport Modal from '../shared/modal';\nimport { error, success } from '../shared/flash';\n\nconst TagManager = (props) => {\n const reservedTagNames = ['renewal'];\n const [tagNames, setTagNames] = useState(props.tagNames);\n const [selectedTags, setSelectedTags] = useState([]);\n const [tagTerm, setTagTerm] = useState('');\n const [isWorking, setIsWorking] = useState(false);\n\n const filteredTags = useMemo(() => {\n if (tagTerm === '') return tagNames;\n return filter(tagNames, (tagName) => {\n return tagName.match(tagTerm);\n });\n }, [tagNames, tagTerm]);\n\n const onTagToggle = (tag) => {\n if (isTagSelected(tag)) {\n const filtered = reject(selectedTags, (selectedTag) => {\n return selectedTag === tag;\n });\n setSelectedTags([...filtered]);\n } else {\n setSelectedTags([...selectedTags, tag]);\n }\n };\n\n const onTagTermChange = (e) => {\n setTagTerm(e.currentTarget.value.toLowerCase().trim());\n };\n\n const onSubmitClick = () => {\n const data = selectedTags.map((tag) => {\n return props.selectedItems.map((item) => {\n return {\n tag_name: tag,\n taggable_type: 'InitiatedFlow',\n taggable_id: item.id,\n };\n });\n });\n\n setIsWorking(true);\n\n if (props.deleteMode) {\n TagManagerActions.removeTaggingInBulk([].concat(...data))\n .done(() => {\n setSelectedTags([]);\n success('Tags removed');\n })\n .fail(() => error())\n .always(() => setIsWorking(false));\n } else {\n TagManagerActions.addTaggingInBulk([].concat(...data))\n .done(() => {\n props.onTagCreate(tagNames);\n setSelectedTags([]);\n success('Tags added');\n })\n .fail(() => error())\n .always(() => setIsWorking(false));\n }\n };\n\n const onNewTagAdd = (tagName) => {\n setSelectedTags([...selectedTags, tagName]);\n setTagNames([...tagNames, tagName]);\n };\n\n const isTagSelected = (tag) => {\n return selectedTags.includes(tag);\n };\n\n const renderAddTagLink = () => {\n if (tagTerm === '' || reservedTagNames.includes(tagTerm)) return;\n\n if (!props.deleteMode && !tagNames.includes(tagTerm)) {\n return (\n <li\n onClick={() => onNewTagAdd(tagTerm)}\n key={`tag-${tagTerm}`}\n >\n Add new tag {tagTerm}\n </li>\n );\n }\n };\n\n const renderSelectedIcon = (isSelected) => {\n if (isSelected) {\n if (props.deleteMode) {\n return (\n <FontAwesomeIcon\n icon={icon({ name: 'xmark' })}\n style={{ color: '#B90202', height: '1rem' }}\n />\n );\n }\n return (\n <FontAwesomeIcon\n icon={icon({ name: 'check' })}\n style={{ color: '#74A943', height: '1rem' }}\n />\n );\n }\n };\n\n const renderTags = () => {\n return (\n <ul className='tagmanager-suggestions scroll'>\n {filteredTags.map((name) => {\n return (\n <li\n onClick={() => onTagToggle(name)}\n key={`tag-${name}`}\n >\n {truncate(name, 50)}\n {renderSelectedIcon(isTagSelected(name))}\n </li>\n );\n })}\n {renderAddTagLink()}\n </ul>\n );\n };\n\n const renderHeaderTitle = () => {\n const submissionCount = props.selectedItems.length;\n const actionText = props.deleteMode ? 'Untag' : 'Tag';\n return (\n <div className='tagmanager-header-container'>\n <h1>\n {`${actionText} ${submissionCount > 1 ? 'these' : 'this'} ${submissionCount} ${pluralize('submission', submissionCount)}`}\n </h1>\n </div>\n );\n };\n\n return (\n <Modal onOutsideClick={() => { if (!isWorking) props.onClose(); }}>\n {renderHeaderTitle()}\n <div className='searchbar'>\n <label key='search'>\n Search Tags\n </label>\n <input type='text' onChange={onTagTermChange} />\n </div>\n {renderTags()}\n <div className='align-right'>\n <button\n type='button'\n className={`btn-secondary margin-right ${isWorking ? 'disabled' : ''}`}\n disabled={isWorking}\n onClick={props.onClose}\n >\n Cancel\n </button>\n <button\n type='button'\n className={`btn-primary ${(isWorking || isEmpty(selectedTags)) ? 'disabled' : ''}`}\n disabled={isWorking || isEmpty(selectedTags)}\n onClick={onSubmitClick}\n >\n {isWorking ? 'Working...' : `${props.deleteMode ? 'Untag' : 'Tag'} ${pluralize('submission', props.selectedItems.length)}`}\n </button>\n </div>\n </Modal>\n );\n};\n\nTagManager.propTypes = {\n selectedItems: PropTypes.arrayOf(PropTypes.shape({})),\n onClose: PropTypes.func.isRequired,\n tagNames: PropTypes.arrayOf(PropTypes.shape({})),\n deleteMode: PropTypes.bool,\n onTagCreate: PropTypes.func.isRequired,\n};\n\nexport default TagManager;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport {\n isEmpty, isEqual, debounce, pick, extend, reject,\n} from 'underscore';\nimport MediaQuery from 'react-responsive';\nimport PropTypes from 'prop-types';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\n\nimport AdvancedFilter from './shared/advanced-filter';\nimport AdvancedFilterSortBy from './shared/advanced-filter-sort-by';\nimport AdvancedFilterClearButton from './shared/advanced-filter-clear-button';\nimport { AdvancedFilterProvider } from './shared/advanced-filter/context';\nimport { getSubmissionDimensions } from './shared/advanced-filter/constants';\nimport LocalStorage from 'modules/local-storage';\nimport DashboardActions from 'actions/dashboard-actions';\nimport DashboardStore from 'stores/dashboard-store';\nimport AlertConfirm, { alert, confirm } from 'modules/alert-confirm';\nimport ErrorBoundary from 'components/shared/error-boundary';\nimport { parse, stringify } from 'query-string';\nimport FilterDefaults from './dashboard/filters/filter-defaults';\nimport MasterSearch from './dashboard/master-search';\nimport MainDashboard from './dashboard/main-dashboard';\nimport PrimaryTabs from './shared/primary-tabs';\nimport TagManager from './dashboard/tag-manager';\n\n// this is used when you import to show you the files you just imported\nconst VALID_URL_PARAMS = [\n 'importType',\n 'importId',\n 'completedStatus',\n];\n\nfunction fetchStateFromURL() {\n const updatedURLParams = pick(parse(window.location.search.substr(1)), ['key']);\n window.history.replaceState({}, 'Dashboard', `/processes?${stringify(updatedURLParams)}${window.location.hash}`);\n}\n\nclass Dashboard extends React.Component {\n constructor(props) {\n super(props);\n\n this.loadItems = debounce(this.loadItems, 333);\n\n this.state = {\n // NULL state should only ever persist when\n // flows have not yet been loaded.\n currentFilterId: null,\n dashboardResizeCount: 0,\n filters: {},\n cachedState: {},\n initiatedFlows: null,\n masterSearchTerms: '',\n savedFilters: this.props.savedFilters,\n searchType: null,\n selectedItems: [],\n // Note that this matches the shape of react-select options\n sort: null,\n totalInitiatedFlowCount: null,\n rowsCount: null,\n showTagManager: false,\n tagManagerDeleteMode: false,\n tagNames: this.props.tagNames,\n };\n }\n\n componentDidMount() {\n if (this.props.defaultWasInaccessible) {\n alert('Default filter removed', 'Your default saved filter used a form that you no longer have permission to view. We have removed it as your default.');\n }\n\n // Bind first\n this.bindToUnload();\n this.bindToStore();\n\n fetchStateFromURL();\n }\n\n componentWillUnmount() {\n this.unBindToStore();\n LocalStorage.save(this.getLocalStorageKey(), this.getSyncState());\n\n // Remove beforeunload handler if it exists.\n if (this.__react_localstorage_beforeunload) {\n global.removeEventListener('beforeunload', this.__react_localstorage_beforeunload);\n }\n }\n\n bindToUnload = () => {\n // We won't get a componentWillUnmount event if we close the tab or refresh, so add a listener\n // and synchronously populate LS.\n\n if (LocalStorage.exists && global.addEventListener) {\n this.__react_localstorage_beforeunload = this.componentWillUnmount.bind(this);\n global.addEventListener('beforeunload', this.__react_localstorage_beforeunload);\n }\n };\n\n getSyncState = (inputState) => {\n const state = inputState || this.state;\n return { sort: state.sort, cachedState: state.cachedState };\n };\n\n changeCurrentFilter = (id) => {\n const [filters, currentFilterId] = loadSavedFilterState(id, this.state.savedFilters);\n const filtersOpen = getOpenState(filters);\n this.setState({ filters, currentFilterId, filtersOpen });\n if (filters.templateId) { DashboardActions.loadStepData(filters.templateId); }\n this.loadItems();\n };\n\n getLocalStorageKey = () => {\n // If local storage doesn't work...\n if (!window.localStorage) { return ''; }\n\n const params = parse(window.location.search.substr(1));\n if (params.key) { return params.key; }\n\n return this.createLocalStorageKey(params);\n };\n\n createLocalStorageKey = (params) => {\n const key = Date.now();\n const newParams = extend(params, { key });\n const paramString = stringify(newParams);\n window.history.replaceState({}, 'Dashboard', `/?${paramString}${window.location.hash}`);\n return key;\n };\n\n loadItems = () => {\n // This function is debounced on mount\n //\n const searchParams = {\n master_search_terms: this.state.masterSearchTerms,\n master_search_type: this.state.searchType,\n };\n DashboardActions.filteredSearch({ ...this.state.filters, ...searchParams });\n };\n\n cacheAndApplyAdvancedFilter = (filter, state) => {\n this.setState({ cachedState: state })\n return this.applyAdvancedFilter(filter)\n }\n\n applyAdvancedFilter = (filter) => {\n this.setState({filters: filter})\n return DashboardActions.filteredSearch(filter);\n };\n\n bindToStore = () => {\n DashboardStore.on('change', this.onStoreChange);\n DashboardStore.on('loadmore', this.onLoadMore);\n };\n\n unBindToStore = () => {\n DashboardStore.off('change', this.onStoreChange);\n DashboardStore.off('loadmore', this.onLoadMore);\n };\n\n onLoadMore = () => {\n const initiatedFlows = DashboardStore.getInitiatedFlows();\n const rowsCount = DashboardStore.getTotalLoadedInitiatedFlowCount() + DashboardStore.getNextBatchSize();\n this.setState({\n initiatedFlows,\n totalInitiatedFlowCount: DashboardStore.getTotalInitiatedFlowCount(),\n rowsCount,\n });\n };\n\n onStoreChange = () => {\n const initiatedFlows = DashboardStore.getInitiatedFlows();\n const rowsCount = DashboardStore.getTotalLoadedInitiatedFlowCount() + DashboardStore.getNextBatchSize();\n this.setState({\n initiatedFlows,\n totalInitiatedFlowCount: DashboardStore.getTotalInitiatedFlowCount(),\n rowsCount,\n selectedItems: [],\n });\n\n if (this.state.filters.templateId) {\n const stepData = DashboardStore.getStepData();\n\n // The store doesn't have the template data\n // when the page first loads. Don't unset it\n // from the component.\n //\n // This is only an issue because the template\n // state doesn't fully integrate with the store,\n // which should be fixed.\n //\n if (isEmpty(stepData)) {\n return;\n }\n\n if (stepData !== this.state.filters.stepData) {\n this.setState(({ filters }) => ({ filters: { ...filters, stepData } }));\n }\n }\n };\n\n masterSearchChanged = (newTerms, type) => {\n this.setState({\n masterSearchTerms: newTerms,\n searchType: type,\n }, this.loadItems);\n };\n\n flowBoxClicked = (item, e) => {\n const isOn = e.currentTarget.checked;\n\n this.setState(({ selectedItems }) => {\n let currentSelectedItems = [...selectedItems];\n if (isOn) {\n currentSelectedItems.push({\n id: item.dashboardable_id,\n type: item.dashboardable_type,\n unique_id: item.unique_id,\n master_template_id: item.master_template_id,\n });\n } else {\n currentSelectedItems = reject(currentSelectedItems, (i) => {\n return (i.id === item.dashboardable_id\n && i.type === item.dashboardable_type);\n });\n }\n return ({\n selectedItems: currentSelectedItems,\n });\n });\n };\n\n visibleItemsForAction = () => {\n const visibleItems = [];\n this.state.initiatedFlows.forEach((i) => {\n if (i !== null) {\n visibleItems.push(\n {\n id: i.dashboardable_id,\n type: i.dashboardable_type,\n master_template_id: i.master_template_id,\n },\n );\n }\n });\n\n return visibleItems;\n };\n\n handleHalt = () => {\n // Operate on all processes if none checked.\n // Otherwise operate on checked.\n //\n if (this.state.selectedItems.length === 0) {\n const items = this.visibleItemsForAction();\n\n confirm(`Halt ${items.length} processes?`, `Are you sure you want to halt these ${items.length} matching submissions?`, () => {\n DashboardActions.haltFlows(items);\n });\n } else {\n DashboardActions.haltFlows(this.state.selectedItems);\n }\n };\n\n handleDelete = () => {\n if (this.state.selectedItems.length === 0) {\n this.deleteMatching();\n } else {\n this.deleteSpecific();\n }\n };\n\n confirmDelete = (itemCount) => {\n const d = $.Deferred();\n\n const title = `Delete ${itemCount} submissions?`;\n const body = (\n <span>\n <span className='color-alert bold'>Warning: </span>\n Deleting a submission makes it unavailable to all users. This is not recommended.\n </span>\n );\n const challengeResponse = itemCount;\n const challenge = 'Type the number of submissions you\\'re about to delete:';\n\n AlertConfirm.strongConfirm(title, body, challenge, challengeResponse)\n .done(d.resolve);\n\n return d;\n };\n\n deleteSpecific = () => {\n const items = this.state.selectedItems;\n this.confirmDelete(items.length)\n .done(() => { DashboardActions.deleteFlows(items); });\n };\n\n deleteMatching = () => {\n const items = this.state.initiatedFlows;\n this.confirmDelete(items.length)\n .done(() => { DashboardActions.deleteMatchingFlows(items.length); });\n };\n\n onActionClicked = (action) => {\n if (!this.state.initiatedFlows) { return; }\n\n if (this.state.totalInitiatedFlowCount === 0) {\n alert(`Nothing to ${action}`, 'No submissions match your search criteria. Try changing the filters.');\n return;\n }\n\n switch (action) {\n case 'assign':\n return this.handleAssign();\n case 'unassign':\n return this.handleUnassign();\n case 'halt':\n return this.handleHalt();\n case 'delete':\n return this.handleDelete();\n case 'export':\n return this.handleExport();\n case 'add tag':\n return this.handleAddTag();\n case 'remove tag':\n return this.handleRemoveTag();\n default:\n throw new Error(`Unexpected action ${action}`);\n }\n };\n\n handleAssign = () => {\n if (this.state.selectedItems.length === 0) {\n const items = this.visibleItemsForAction();\n\n confirm(`Self assign ${items.length} submissions?`, `Are you sure you want to self assign these ${items.length} matching submissions?`, () => {\n DashboardActions.assignFlows(items)\n .done(this.loadItems);\n });\n } else {\n DashboardActions.assignFlows(this.state.selectedItems)\n .done(this.loadItems);\n }\n };\n\n handleUnassign = () => {\n if (this.state.selectedItems.length === 0) {\n const items = this.visibleItemsForAction();\n\n confirm(`Unassign ${items.length} submissions?`, `Are you sure you want to unassign these ${items.length} matching submissions?`, () => {\n DashboardActions.unassignFlows(items)\n .done(this.loadItems);\n });\n } else {\n DashboardActions.unassignFlows(this.state.selectedItems)\n .done(this.loadItems);\n }\n };\n\n handleExport = () => {\n if (this.state.selectedItems.length === 0) {\n DashboardActions.filteredExport()\n .done(() => { AlertConfirm.alert('Export queued.', \"You will be emailed when your export completes. Finished exports can be found on the <a href='/exports'>Exports</a> page.\"); });\n } else {\n DashboardActions.exportSpecific(this.state.selectedItems)\n .done(() => { AlertConfirm.alert('Export queued.', \"You will be emailed when your export completes. Finished exports can be found on the <a href='/exports'>Exports</a> page.\"); });\n }\n };\n\n toggleTagManager = () => {\n this.setState(({ showTagManager }) => ({\n showTagManager: !showTagManager,\n }));\n };\n\n handleAddTag = () => {\n this.setState(() => ({\n tagManagerDeleteMode: false,\n }));\n this.toggleTagManager();\n };\n\n handleRemoveTag = () => {\n this.setState(() => ({\n tagManagerDeleteMode: true,\n }));\n this.toggleTagManager();\n };\n\n ontagNamesUpdate = (tagNames) => {\n this.setState({ tagNames });\n };\n\n sortChanged = (filters) => {\n this.applyAdvancedFilter(filters);\n };\n\n renderSelectedProcessesMessage() {\n if (this.state.initiatedFlows === null) {\n return 'Loading...';\n }\n\n if (this.state.selectedItems.length === 0) {\n return `(${this.state.totalInitiatedFlowCount} matching)`;\n }\n\n return `(${this.state.selectedItems.length} selected)`;\n }\n\n renderTagManager() {\n if (this.state.showTagManager) {\n const items = this.state.selectedItems.length === 0 ? this.visibleItemsForAction() : this.state.selectedItems;\n return (\n <TagManager\n selectedItems={items}\n onTagCreate={this.ontagNamesUpdate}\n onClose={this.toggleTagManager}\n tagNames={this.state.tagNames}\n deleteMode={this.state.tagManagerDeleteMode}\n />\n );\n }\n }\n\n renderProcessesTab() {\n const storedState = LocalStorage.fetch(this.getLocalStorageKey()) || {};\n const filterParams = pick(CityGrows.Server.params, VALID_URL_PARAMS);\n return (\n <ErrorBoundary>\n <MasterSearchWrapper>\n <MasterSearch onChange={this.masterSearchChanged} />\n </MasterSearchWrapper>\n\n <AdvancedFilterProvider initial={{ availableFilters: getSubmissionDimensions(), activeFilters: [], currentFilter: {}, savedFilters: this.props.savedFilters, defaultFilters: ['assigned_to_me', 'completed_status'], triggerRefresh: 0 }}>\n <div className='padded border-bottom'>\n <AdvancedFilter\n onFilterApply={this.cacheAndApplyAdvancedFilter}\n kind='submission'\n menuAvailable\n defaultFilter={this.props.defaultFilter}\n previousState={ storedState?.cachedState }\n filterParams={filterParams}\n />\n </div>\n\n <div className='dashboard-maincontent'>\n <div className='dashboard-actionbar cf'>\n <div className='left'>\n <h1>Submissions</h1> <span className='dashboard-processcount'>{this.renderSelectedProcessesMessage()}</span>\n <AdvancedFilterClearButton\n className='margin-left-less btn-thirdary inverted'\n defaultFilterIds={['assigned_to_me', 'completed_status']}\n >\n <span className='icon icon-x-white smaller margin-right' />Clear Filters\n </AdvancedFilterClearButton>\n </div>\n\n <div className='right'>\n <ul>\n <li>\n <button type='button' className='unstyled' onClick={() => { this.onActionClicked('add tag'); }}>\n <FontAwesomeIcon icon={icon({ name: 'tags' })} />\n <span>Add tags</span>\n </button>\n </li>\n <li>\n <button type='button' className='unstyled' onClick={() => { this.onActionClicked('remove tag'); }}>\n <FontAwesomeIcon icon={icon({ name: 'tag', style: 'regular' })} />\n <span>Remove tags</span>\n </button>\n </li>\n <li>\n <button type='button' className='unstyled' onClick={() => { this.onActionClicked('export'); }}>\n <FontAwesomeIcon icon={icon({ name: 'file-export' })} />\n <span>Export</span>\n </button>\n </li>\n <li>\n <button type='button' className='unstyled' onClick={() => { this.onActionClicked('assign'); }}>\n <FontAwesomeIcon icon={icon({ name: 'user-plus' })} />\n <span>Self assign</span>\n </button>\n </li>\n <li>\n <button type='button' className='unstyled' onClick={() => { this.onActionClicked('unassign'); }}>\n <FontAwesomeIcon icon={icon({ name: 'user-minus' })} />\n <span>Unassign</span>\n </button>\n </li>\n <li>\n <button type='button' className='unstyled' onClick={() => { this.onActionClicked('halt'); }}>\n <FontAwesomeIcon icon={icon({ name: 'hand' })} />\n <span>Halt</span>\n </button>\n </li>\n <li>\n <button type='button' className='unstyled' onClick={() => { this.onActionClicked('delete'); }}>\n <FontAwesomeIcon icon={icon({ name: 'trash' })} />\n <span>Delete</span>\n </button>\n </li>\n </ul>\n </div>\n </div>\n <MainDashboard\n hasTemplates={this.props.hasTemplates}\n initiatedFlows={this.state.initiatedFlows}\n rowsCount={this.state.rowsCount}\n onFlowBoxClick={this.flowBoxClicked}\n selectedItems={this.state.selectedItems}\n resizeCount={this.state.dashboardResizeCount}\n noTeams={this.props.teams.length === 0}\n activeOrder={this.state.filters.sort}\n sortingFn={this.sortChanged}\n />\n </div>\n </AdvancedFilterProvider>\n </ErrorBoundary>\n );\n }\n\n render() {\n return (\n <>\n <PrimaryTabs />\n <div id='tabheader-body' className='dashboard-borderwrap'>\n {this.renderProcessesTab()}\n </div>\n {this.renderTagManager()}\n </>\n );\n }\n}\n\nDashboard.propTypes = {\n defaultFilterId: PropTypes.number,\n defaultWasInaccessible: PropTypes.bool,\n hasTemplates: PropTypes.bool.isRequired,\n savedFilters: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n teams: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n userId: PropTypes.number.isRequired,\n tagNames: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n};\n\nDashboard.defaultProps = {\n defaultWasInaccessible: false,\n};\n\nconst MasterSearchWrapper = ({ children }) => (\n <MediaQuery minWidth={769}>\n {(matches) => {\n return (\n matches\n ? ReactDOM.createPortal(children, document.getElementById('search-box'))\n : ReactDOM.createPortal(\n <div>\n {children}\n </div>,\n document.getElementById('search-box-mobile'),\n )\n );\n }}\n </MediaQuery>\n);\n\nMasterSearchWrapper.propTypes = {\n children: PropTypes.node,\n};\n\nexport default Dashboard;\n","const truncate = (string, maxlength) => {\n if (!string || string === '' || maxlength < 0) {\n return '';\n }\n if (string.length <= maxlength) return string;\n const substring = string.substring(0, maxlength);\n return `${substring}...`;\n};\n\nexport default truncate;\n","import React, { useState, useEffect, useRef } from 'react';\nimport { debounce } from 'underscore';\nimport dayjs from 'dayjs';\nimport truncate from 'modules/truncate';\n\nimport SortingHeaderCell from '../sorting-header-cell';\n\nconst { Table } = require('fixed-data-table-2');\nconst { Column } = require('fixed-data-table-2');\nconst { Cell } = require('fixed-data-table-2');\n\nconst OutputsTable = (props) => {\n const wrapperElement = useRef();\n\n const [tableWidth, setTableWidth] = useState(0);\n const [tableHeight, setTableHeight] = useState(0);\n\n const outputs = props.outputs;\n\n const onResize = debounce(() => {\n setTableHeight(contentHeight);\n setTableWidth(contentWidth);\n }, 100);\n\n useEffect(() => {\n window.addEventListener('resize', onResize);\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [onResize]);\n\n useEffect(() => {\n onResize();\n }, [onResize]);\n\n const contentWidth = () => {\n return wrapperElement.current.offsetWidth;\n }\n\n const contentHeight = () => {\n return wrapperElement.current.offsetHeight;\n }\n\n const buildCell = (rowIndex, type) => {\n const output = outputs[rowIndex];\n\n if (!output) {\n props.loadMoreItems(rowIndex);\n return (\n <Cell key='dashboardloadingcell'>\n <div className='dashboard-loadingcell' />\n </Cell>\n );\n }\n\n const processHref = `/initiated_flows/${output.initiated_flow_id}`;\n\n return (\n <Cell>\n {buildCellContent(type, output)}\n <a className='spanlink' href={processHref} />\n </Cell>\n );\n }\n\n const buildCellContent = (type, output) => {\n switch (type) {\n case 'applicant':\n return (\n <div className='primaryApplicant'>\n <span>{truncate(output.primary_applicant.name, 30)}</span>\n <div className='color-text-medium text-smaller'>{truncate(output.primary_applicant.email, 30)}</div>\n </div>\n );\n case 'expire':\n const expire_value = output.expires_at ? dayjs(output.expires_at).format('l') : 'N/A';\n return (<span>{expire_value}</span>);\n case 'issued':\n const issued_value = output.issued_at ? dayjs(output.issued_at).format('l') : 'N/A';\n return (<span>{issued_value}</span>);\n case 'name':\n return (<span>{output.name}</span>);\n case 'pid':\n return (<span>{`#${output.initiated_flow_scoped_id}`}</span>);\n case 'status':\n return (<span>{output.status}</span>);\n case 'template_name':\n return (\n <span style={{ color: (`#${output.flow_template_color}`) }}>\n {output.flow_template_name}\n </span>\n );\n default:\n throw new Error(`Unhandled cell name ${type}`);\n };\n }\n\n return (\n <div ref={wrapperElement} className='dashboard-maincontent-rowwrap overflow-x-auto'>\n <Table\n rowsCount={props.totalCount}\n rowHeight={50}\n headerHeight={35}\n width={tableWidth}\n height={tableHeight}\n >\n <Column\n header={<Cell />}\n cell={(_) => null }\n width={65}\n />\n <Column\n header={<Cell>Document</Cell>}\n cell={(columnAttrs) => {\n return buildCell(columnAttrs.rowIndex, 'name');\n }}\n width={250}\n />\n <Column\n header={<Cell>Form</Cell>}\n cell={(columnAttrs) => {\n return buildCell(columnAttrs.rowIndex, 'template_name');\n }}\n width={250}\n cellClassName='flowtemplatename'\n />\n <Column\n header={<Cell>Submission ID</Cell>}\n cell={(columnAttrs) => {\n return buildCell(columnAttrs.rowIndex, 'pid');\n }}\n width={110}\n cellClassName='dashboard-processid'\n />\n <Column\n header={<SortingHeaderCell title='Issued' columnId='date_issued' activeOrder={props.activeOrder} onSorting={props.sortingFn} />}\n cell={(columnAttrs) => {\n return buildCell(columnAttrs.rowIndex, 'issued');\n }}\n width={120}\n />\n <Column\n header={<SortingHeaderCell title='Expiration date' columnId='date_expire' activeOrder={props.activeOrder} onSorting={props.sortingFn} />}\n cell={(columnAttrs) => {\n return buildCell(columnAttrs.rowIndex, 'expire');\n }}\n width={150}\n />\n <Column\n header={<Cell>Status</Cell>}\n cell={(columnAttrs) => {\n return buildCell(columnAttrs.rowIndex, 'status');\n }}\n width={100}\n cellClassName='capitalize'\n />\n <Column\n header={<Cell>Primary applicant</Cell>}\n cell={(columnAttrs) => {\n return buildCell(columnAttrs.rowIndex, 'applicant');\n }}\n width={250}\n />\n </Table>\n </div>\n );\n};\n\nexport default OutputsTable;\n","import DashboardAPI from 'apis/dashboard-api';\n\nconst _pageSize = 20;\nlet _isLoading = false;\n\nconst useLoadMoreOutputs = (index, query, addItems) => {\n if (_isLoading) { return; }\n\n _isLoading = true;\n const page = Math.floor(index / _pageSize) + 1;\n let params = {\n ...query,\n next_page: page\n }\n\n DashboardAPI.fetchOutputs(params).done((res) => {\n _isLoading = false;\n addItems(res.outputs);\n });\n}\n\nexport default useLoadMoreOutputs;\n","import React, { useEffect, useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\n\nimport AdvancedFilter from '../shared/advanced-filter';\nimport { AdvancedFilterProvider } from '../shared/advanced-filter/context';\nimport { getOutputDimensions } from '../shared/advanced-filter/constants';\nimport DashboardAPI from 'apis/dashboard-api';\nimport ErrorBoundary from 'components/shared/error-boundary';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport OutputsTable from './outputs-tab/table';\nimport useLoadMoreOutputs from '../hooks/use-load-more-outputs';\nimport AlertConfirm, { alert } from 'modules/alert-confirm';\n\nconst OUTPUTS_SORTS = [\n { value: 'date_issued_asc', label: 'Date issued (ascending)' },\n { value: 'date_issued_desc', label: 'Date issued (descending)' },\n { value: 'date_expire_asc', label: 'Expiration date (ascending)' },\n { value: 'date_expire_desc', label: 'Expiration date (descending)' },\n];\n\nconst OutputsTab = (props) => {\n const [lastFilters, setLastFilters] = useState({});\n const [outputs, setOutputs] = useState([]);\n const [totalCount, setTotalCount] = useState(0);\n const [isLoading, setIsLoading] = useState(false);\n\n const onSortChange = (filters) => {\n applyFilter(filters);\n };\n\n const loadMore = (rowIndex) => {\n const addItems = (newItems) => {\n setOutputs([...outputs, ...newItems]);\n }\n\n useLoadMoreOutputs(rowIndex, lastFilters, addItems);\n };\n\n const applyFilter = (filters) => {\n setIsLoading(true);\n return DashboardAPI.fetchOutputs(filters).done((res) => {\n setTotalCount(res.total_count);\n setOutputs(res.outputs);\n }).fail(() => {\n alert('Can\\'t load dashboard content', 'We\\'re having trouble loading your dashboard content. Please try again in a few moments.');\n }).always(() => {\n setLastFilters(filters);\n setIsLoading(false);\n });\n };\n\n const onActionClicked = (action) => {\n if (totalCount === 0) {\n alert(`Nothing to ${action}`, 'No outputs match your search criteria. Try changing the filters.');\n return;\n }\n\n switch(action) {\n case 'export':\n return handleExport();\n default:\n return null;\n }\n };\n\n const handleExport = () => {\n DashboardAPI.exportOutputs(lastFilters).\n done(() => { AlertConfirm.alert('Export queued.', \"You will be emailed when your export completes. Finished exports can be found on the <a href='/exports'>Exports</a> page.\"); });\n };\n\n const renderSelectedDocumentsMessage = () => {\n return (\n <span className='margin-right'>\n {isLoading\n ? 'Loading...'\n : <>{totalCount} matching</>\n }\n </span>\n );\n };\n\n const renderMainContent = () => {\n if (isLoading) {\n return (\n <div className='dashboard-loading'>\n <LoadingSpinner size='large' />\n </div>\n );\n }\n\n if (totalCount > 0) {\n return (\n <OutputsTable\n outputs={outputs}\n totalCount={totalCount}\n loadMoreItems={loadMore}\n activeOrder={lastFilters.sort}\n sortingFn={onSortChange}\n />\n );\n }\n }\n\n return (\n <ErrorBoundary>\n <AdvancedFilterProvider initial={{ availableFilters: getOutputDimensions(), activeFilters: [], currentFilter: {}, savedFilters: props.savedFilters, defaultFilters: ['output_status'], triggerRefresh: 0 }}>\n <div className='padded border-bottom'>\n <AdvancedFilter\n onFilterApply={applyFilter}\n kind='output'\n menuAvailable\n defaultFilterIds={['output_status']}\n defaultFilter={props.defaultFilter}\n />\n </div>\n\n <div className='dashboard-maincontent'>\n <div className='dashboard-actionbar cf'>\n <div className='left'>\n <h1>Outputs</h1> <span className='dashboard-processcount'>{renderSelectedDocumentsMessage()}</span>\n </div>\n\n <div className='right'>\n <ul>\n <li>\n <button type='button' className='unstyled' onClick={() => onActionClicked('export')}>\n <FontAwesomeIcon icon={icon({ name: 'file-export' })} />\n <span>Export</span>\n </button>\n </li>\n </ul>\n </div>\n </div>\n\n {renderMainContent()}\n </div>\n </AdvancedFilterProvider>\n </ErrorBoundary>\n );\n}\n\nexport default OutputsTab;\n","import React from \"react\";\n\nimport PrimaryTabs from \"./shared/primary-tabs\";\nimport OutputsTab from \"components/dashboard/outputs-tab\";\n\nconst DashboardOutputs = (props) => {\n return (\n <>\n <PrimaryTabs />\n <div id='tabheader-body' className='dashboard-borderwrap'>\n <OutputsTab {...props} />\n </div>\n </>\n );\n};\n\nexport default DashboardOutputs;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport Dashboard from 'components/dashboard';\nimport CommonProviders from 'components/common-providers';\nimport DashboardOutputs from 'components/dashboard-outputs';\n\nfunction index() {\n renderer(\n (\n <CommonProviders>\n <Dashboard\n savedFilters={CityGrows.Server.savedFilters}\n defaultWasInaccessible={CityGrows.Server.defaultWasInaccessible}\n defaultFilter={CityGrows.Server.defaultFilter}\n userId={CityGrows.Server.userId}\n teams={CityGrows.Server.teams}\n hasTemplates={CityGrows.Server.hasTemplates}\n tagNames={CityGrows.Server.tagNames}\n />\n </CommonProviders>\n ), document.getElementById('dashboard'),\n );\n}\n\nfunction outputs() {\n renderer(\n (\n <CommonProviders>\n <DashboardOutputs\n savedFilters={CityGrows.Server.savedFilters}\n defaultFilter={CityGrows.Server.defaultFilter}\n />\n </CommonProviders>\n ), document.getElementById('dashboard'),\n );\n}\n\nexport default {\n index,\n outputs\n};\n","const EditSuggestionsRequestAPI = {\n rejectSuggestion(editSuggestionsRequestId, suggestionId){\n const url = `/edit_suggestions_requests/${editSuggestionsRequestId}/reject_suggestion`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n data: {\n suggestion_id: suggestionId\n }\n });\n },\n\n suggest(entityId, suggestions){\n const url = '/edit_suggestions_requests';\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n entity_id: entityId,\n suggestions: suggestions\n }\n });\n }\n};\n\nexport default EditSuggestionsRequestAPI;\n","import React from 'react';\nimport EditSuggestionsAPI from 'apis/edit-suggestions-api';\n\nclass EditSuggestionsRequest extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n addingPOC: false,\n updating: false,\n suggestions: this.props.request.suggestions,\n };\n }\n\n authToken() {\n return $('meta[name=csrf-token]').attr('content');\n }\n\n toggleAddPOC = () => {\n this.setState({ addingPOC: !this.state.addingPOC });\n };\n\n rejectChange = (e) => {\n this.setState({ updating: true });\n EditSuggestionsAPI.rejectSuggestion(this.props.request.id, e.currentTarget.dataset.id)\n .done((res) => this.setState({ suggestions: res }))\n .always(() => { this.setState({ updating: false }); });\n };\n\n cancel = (e) => {\n e.preventDefault();\n this.props.deSelectRequest();\n };\n\n renderSuggestion(suggestion) {\n return (\n <li className='editsuggestionsrequest-suggestion' key={suggestion.id}>\n <div className='editsuggestionsrequest-fieldname'>\n {suggestion.field.replace(/_/g, ' ')}\n </div>\n <div className='editsuggestionsrequest-suggestioncontent'>\n\n <div>\n <div className='flex'>\n <div className='editsuggestionsrequest-label suggested'>Suggested</div>\n <div className='editsuggestionsrequest-value suggested'>{suggestion.new_content}</div>\n </div>\n\n <div className='flex'>\n <div className='editsuggestionsrequest-label current'>Previous value</div>\n <div className='editsuggestionsrequest-value current'>{suggestion.current_content}</div>\n </div>\n </div>\n\n </div>\n\n <div className='editsuggestionsrequest-rejectsuggestion'>\n <button className='btn-link alert' data-id={suggestion.id} onClick={this.rejectChange}>Reject this change</button>\n </div>\n\n </li>\n );\n }\n\n renderChanges() {\n return (\n <ul>\n {this.state.suggestions.map((suggestion) => {\n return this.renderSuggestion(suggestion);\n })}\n </ul>\n );\n }\n\n renderPocAdd() {\n return (\n <>\n <input id='poc' type='checkbox' checked={this.state.addingPOC} onChange={this.toggleAddPOC} />\n <label className='inline-block' htmlFor='poc'>Add {this.props.request.user.name} ({this.props.request.user.email}) as a point of contact for {this.props.request.entity_name}</label>\n </>\n );\n }\n\n render() {\n if (this.state.suggestions.length == 0) {\n return (\n <div className='align-center'>\n <p>All suggestions on this request have been resolved.</p>\n <a className='btn btn-secondary' href={`/teams/${this.props.teamId}/edit_suggestions_requests`}>Go Back</a>\n </div>\n );\n }\n return (\n <div className='margin-top'>\n <p>{this.props.request.user.name} wants to make the following changes to <span className='bold'>{this.props.request.entity_name}</span>:</p>\n <div className='border-top'>\n {this.renderChanges()}\n </div>\n <div className='margin-top-more'>\n {!this.props.request.user.is_poc && this.renderPocAdd() }\n </div>\n <div className='align-center padding-top'>\n <form id='form'>\n <input type='hidden' name='adding_poc' value={this.state.addingPOC} />\n <input type='hidden' name='authenticity_token' value={this.authToken()} />\n </form>\n <button className='btn-link alert margin-right-more' type='submit' form='form' formMethod='POST' formAction={`/edit_suggestions_requests/${this.props.request.id}/reject_request`}>Reject all changes</button>\n <button\n className='btn-primary'\n type='submit'\n form='form'\n formMethod='POST'\n formAction={`/edit_suggestions_requests/${this.props.request.id}/accept_request`}\n >\n Accept all changes\n </button>\n </div>\n </div>\n );\n }\n}\n\nexport default EditSuggestionsRequest;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport CommonProviders from 'components/common-providers';\nimport EditSuggestionsRequest from '../components/edit-suggestions-request';\n\nfunction show() {\n renderer(\n (\n <CommonProviders>\n <EditSuggestionsRequest\n teamId={CityGrows.Server.teamId}\n request={CityGrows.Server.request}\n />\n </CommonProviders>\n ), document.getElementById('edit_suggestions_request'),\n );\n}\n\nexport default {\n show,\n};\n","const EntityAPI = {\n create(attrs, initiatedFlowId, stepDatumId) {\n const url = '/entities';\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n entity: attrs,\n initiated_flow_id: initiatedFlowId,\n step_datum_id: stepDatumId,\n },\n });\n },\n\n createEsri(esriUniqueId, initiatedFlowId, stepDatumId) {\n const url = '/entities';\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n entity: {\n esri_unique_id: esriUniqueId,\n },\n initiated_flow_id: initiatedFlowId,\n step_datum_id: stepDatumId,\n },\n });\n },\n\n search(initiatedFlowId, stepDatumId, terms) {\n const url = '/entities/search';\n\n return $.ajax(url, {\n data: {\n initiated_flow_id: initiatedFlowId,\n step_datum_id: stepDatumId,\n terms,\n },\n method: 'get',\n dataType: 'json',\n });\n },\n\n fetchSuggested(userId, flowTemplateId) {\n const url = '/entities/suggested';\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json',\n data: {\n user_id: userId,\n flow_template_id: flowTemplateId,\n },\n });\n },\n\n update(id, attrs) {\n const url = `/entities/${id}`;\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n entity: attrs,\n },\n });\n },\n\n getEntity(entityId, initiatedFlowId) {\n const url = `/entities/${entityId}`;\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json',\n data: {\n initiated_flow_id: initiatedFlowId,\n },\n });\n },\n\n toggleDestroyed(entityId) {\n const url = `/entities/${entityId}/toggle_destroyed`;\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n });\n },\n};\n\nexport default EntityAPI;\n","import EntityAPI from '../apis/entity-api';\nimport EditSuggestionsAPI from '../apis/edit-suggestions-api';\nimport {\n error as flashError,\n success as flashSuccess,\n} from '../components/shared/flash';\n\nconst EntityActions = {\n createEntity(attrs, initiatedFlowId, stepDatumId) {\n const req = EntityAPI.create(attrs, initiatedFlowId, stepDatumId);\n\n req.fail(() => flashError());\n\n return req;\n },\n\n createEsriEntity(esriUniqueId, initiatedFlowId, stepDatumId) {\n const req = EntityAPI.createEsri(esriUniqueId, initiatedFlowId, stepDatumId);\n\n req.fail(() => flashError());\n\n return req;\n },\n\n fetchSuggested(userId, flowTemplateId) {\n return EntityAPI.fetchSuggested(userId, flowTemplateId);\n },\n\n getEntity(entityId, initiatedFlowId) {\n return EntityAPI.getEntity(entityId, initiatedFlowId);\n },\n\n search(initiatedFlowId, stepDatumId, terms) {\n return EntityAPI.search(initiatedFlowId, stepDatumId, terms);\n },\n\n toggleDestroyed(entityId) {\n return EntityAPI.toggleDestroyed(entityId)\n .fail(() => flashError());\n },\n\n update(id, attrs) {\n return EntityAPI.update(id, attrs)\n .done((res) => {\n flashSuccess('Update successful');\n return res;\n })\n .fail(() => flashError());\n },\n\n suggestEdits(id, attrs) {\n const req = EditSuggestionsAPI.suggest(id, attrs);\n\n req.done(() => {\n flashSuccess('Edits submitted');\n });\n\n req.fail(() => flashError('Something went wrong'));\n\n return req;\n },\n};\n\nexport default EntityActions;\n","import React, { useCallback, useMemo, createRef, } from 'react';\nimport { debounce, each, map } from 'underscore';\n\nconst StandardFields = ({\n entity,\n updateEntity,\n onNoteChange,\n}) => {\n const customFieldValues = () => {\n const values = {};\n\n each(fields, (fieldRef, key) => {\n values[key] = fieldRef.value;\n });\n\n return values;\n };\n\n const fields = useMemo(() => {\n return entity.fields.reduce((output, field) => {\n output[field.slug] = createRef();\n return output;\n }, {});\n }, []);\n\n const onFormChange = useCallback(debounce(() => {\n updateEntity({ custom_entity_field_values: customFieldValues() });\n }, 500), []);\n\n const renderField = (field) => {\n const fieldName = field.name.replace(/_/g, ' ');\n return (\n <label key={field.slug}>\n <span>{fieldName}</span>\n <input type='text' ref={(ref) => { fields[field.slug] = ref; }} defaultValue={field.value} placeholder={`Add ${fieldName}`} onChange={onFormChange} />\n </label>\n );\n };\n\n return (\n <>\n {map(entity.fields, renderField)}\n <textarea\n defaultValue={entity.note}\n placeholder='Notes...'\n onChange={(e) => onNoteChange(e.currentTarget.value)}\n />\n </>\n );\n};\n\nexport default StandardFields;","import React, { useRef, useEffect, useMemo } from 'react';\n\ntype MapTypes = {\n feature: {\n geometry: object;\n }\n}\n\ndeclare const L: { mapbox: {\n featureLayer: (layer: object) => any;\n map: any;\n} }\n\nconst Map = ({\n feature,\n}: MapTypes) => {\n \n const mapContainerRef: React.RefObject<null> = useRef();\n const mapRef: any = useRef();\n\n useEffect(() => {\n if(!feature) { return }\n\n mapRef.current = L.mapbox.map(mapContainerRef.current, 'mapbox.streets', {\n zoom: 15,\n attributionControl: { compact: false },\n });\n\n const marker = L.mapbox.featureLayer({\n type: 'Feature',\n geometry: feature.geometry,\n }).addTo(mapRef.current);\n \n mapRef.current.invalidateSize();\n \n mapRef.current.fitBounds(marker.getBounds());\n }, [])\n\n if (!feature) {\n return <span>Feature data not found</span>;\n }\n \n return (\n <div className={`map-wrap`}>\n <div className='map' ref={mapContainerRef} />\n </div>\n );\n}\n\nexport default Map;\n","import React from 'react';\nimport Map from 'components/shared/input_fields/entity-input/map';\nimport InlineNotification from 'components/shared/inline-notification';\n\nconst EsriFields = ({\n entity,\n}) => {\n const renderFields = () => {\n return Object.entries(entity.field_data).map(([key, val]) => {\n return (\n <label>\n {key}\n <input type='text' value={val} disabled />\n </label>\n );\n });\n };\n\n if (!entity.field_data) {\n return (\n <InlineNotification>\n Remote entity not found.\n </InlineNotification>\n );\n }\n\n return (\n <div>\n <Map\n feature={entity.feature}\n />\n {renderFields()}\n </div>\n );\n};\n\nexport default EsriFields;","import React, {\n useState, useCallback,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport EntityActions from 'actions/entity-actions';\nimport AttachedPeople from 'components/shared/attached-people';\nimport EmbeddedTextInput from 'components/shared/embedded-text-input';\nimport AutonomousPopup from 'components/shared/autonomous-popup';\nimport StandardFields from './entity-page/standard-fields';\nimport EsriFields from './entity-page/esri-fields';\nimport {\n debounce, reject, isEmpty,\n} from 'underscore';\nimport truncate from 'truncate';\nimport dayjs from 'dayjs';\n\nconst EntityPage = ({\n teamSlug,\n entity: entityFromProps,\n}) => {\n const [entity, setEntity] = useState(entityFromProps);\n const [contacts, setContacts] = useState(entity.contacts);\n\n const updateContacts = (contact) => {\n let updatedContacts = [...contacts];\n if (contact.persisted) {\n updatedContacts.push(contact);\n } else {\n updatedContacts = reject(updatedContacts, (c) => {\n return c.id === contact.id;\n });\n }\n setContacts(updatedContacts);\n };\n\n const updateEntity = (attrs) => {\n EntityActions.update(entity.id, attrs)\n .done((res) => { setEntity(res); });\n };\n\n const onNameChange = useCallback(debounce((newName) => {\n updateEntity({ name: newName });\n }, 500), []);\n\n const onNoteChange = useCallback(debounce((newNote) => {\n updateEntity({ note: newNote });\n }, 500), []);\n\n const toggleEntityDestroyed = () => {\n return EntityActions.toggleDestroyed(entity.id)\n .done(setEntity);\n };\n\n const renderEntityFields = () => {\n if (entity.is_esri) {\n return (\n <EsriFields\n entity={entity}\n />\n );\n } else {\n return (\n <StandardFields\n entity={entity}\n updateEntity={updateEntity}\n onNoteChange={onNoteChange}\n />\n );\n }\n };\n\n const renderEditForm = () => {\n const searchOpts = { govOnly: false };\n return (\n <form className='raised bg-white'>\n <section className='entitypage-contacts'>\n <h3>Point of contact</h3>\n\n <AttachedPeople\n people={contacts}\n showEmail\n hideExternal={false}\n allowPseudo={false}\n attachableType='Entity'\n onChange={updateContacts}\n attachableId={entity.id}\n searchOpts={searchOpts}\n />\n </section>\n\n <section>\n <h3>{entity.custom_entity_name} info</h3>\n {renderEntityFields()}\n </section>\n </form>\n );\n };\n\n const renderFlow = (flow, idx) => {\n return (\n <tr key={idx} className='activeflowline cf'>\n <td style={{ color: (`#${flow.template_color}`) }} title={flow.template_name} className='flowtemplatename nowrap'>\n <a className='spanlink' href={`/initiated_flows/manager/${flow.id}`} />\n {truncate(flow.template_name, 25)} #{flow.scoped_id}\n </td>\n <td>\n {dayjs(flow.created_at).format('LLL')}\n <a className='spanlink' href={`/initiated_flows/manager/${flow.id}`} />\n </td>\n <td>\n <span dangerouslySetInnerHTML={{ __html: flow.launched_by }} />\n <a className='spanlink' href={`/initiated_flows/manager/${flow.id}`} />\n </td>\n <td className='nowrap'>\n <a className='spanlink' href={`/initiated_flows/manager/${flow.id}`} />\n <span dangerouslySetInnerHTML={{ __html: flow.status }} />\n </td>\n </tr>\n );\n };\n\n const renderFlows = () => {\n if (!isEmpty(entity.initiated_flows)) {\n return (\n <table>\n <tbody>\n {entity.initiated_flows.map(renderFlow)}\n </tbody>\n </table>\n );\n }\n return (\n <div>\n This {entity.custom_entity_name} does not have any associated submissions.\n </div>\n );\n };\n\n const renderFlowTable = () => {\n return (\n <div className='entitypage-flowtablewrap goldenwidth'>\n <h2>Submissions</h2>\n {renderFlows()}\n </div>\n );\n };\n\n const renderExtras = () => {\n // ESRI entities can't be archived (because they would still exist on remote)\n if (entity.is_esri) { return; }\n \n return (\n <AutonomousPopup closeOnPopupClick buttonClassName='ellipsispopup-grey' nubDirection='up'>\n <ul className='popup-listmenu'>\n <li>\n <a onClick={toggleEntityDestroyed} href='#'>{entity.deleted_at ? 'Unarchive' : 'Archive'}</a>\n </li>\n </ul>\n </AutonomousPopup>\n );\n };\n\n const renderArchivedMessage = () => {\n return (\n <span className='entitypage-archived vertical-align-absolute'>Archived</span>\n );\n };\n\n return (\n <div className='entitypage'>\n <header>\n <div className='entity-name'>{entity.custom_entity_name}<span className='margin-left-less relative' style={{ top: '1px' }}>{renderExtras()}</span></div>\n <div className='viewall-container entitypage-name'>\n <EmbeddedTextInput\n className='entitypage-name'\n onChange={onNameChange}\n defaultValue={entity.name}\n disabled={entity.is_esri}\n disabledValue={entity.name}\n />\n {entity.deleted_at ? renderArchivedMessage() : ''}\n | <a href={`/teams/${teamSlug}/entities`}>View All Entities</a>\n </div>\n </header>\n\n <main className='cf'>\n {renderEditForm()}\n {renderFlowTable()}\n </main>\n </div>\n );\n};\n\nEntityPage.propTypes = {\n teamSlug: PropTypes.string.isRequired,\n entity: PropTypes.shape({}).isRequired,\n};\n\nexport default EntityPage;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport LinkyButton from 'components/shared/linky-button';\nimport Select from 'components/shared/select';\n\n// NOTE: peopleSelected refers to whether we're on the people page\n// or the organizations page\n// TODO: make this pair of pages into a single page and then\n// make this component use Links and history instead of <a>s and\n// document.location.\n// This will require refactoring this entire page to be react.\nconst SubNav = ({\n teamsForSelect, peopleSelected, teamSlug,\n}) => {\n const [exported, setExported] = useState(false);\n const [exporting, setExporting] = useState(false);\n const onSelectChange = ({ value: slug }) => {\n const page = peopleSelected ? 'people' : 'entities';\n document.location = `/teams/${slug}/${page}`;\n };\n\n const onExportClick = () => {\n if (exporting) {\n return;\n }\n\n const exportType = peopleSelected ? 'people' : 'entities';\n // TODO: replace with apiFetch\n setExporting(true);\n window.$.ajax(\n `/teams/${teamSlug}/${exportType}/exports`,\n {\n method: 'POST',\n },\n ).done(() => setExported(true))\n .always(() => setExporting(false));\n };\n\n const options = teamsForSelect.map(([value, label]) => ({ value, label }));\n\n return (\n <>\n {exported && (\n <div className='fullwidthnotif success'>You will be emailed when your export completes. Finished exports can be found on the <a href='/exports'>Exports</a> page.</div>\n )}\n <div className='tabnav cf'>\n <ul>\n <li className={peopleSelected ? 'selected' : ''}>\n <a href={`/teams/${teamSlug}/people`}>People</a>\n </li>\n <li className={peopleSelected ? '' : 'selected'}>\n <a href={`/teams/${teamSlug}/entities`}>Entities</a>\n </li>\n </ul>\n <div className='right'>\n {!peopleSelected && <a id='addorglink' className='inline-block margin-right secondary' href={`/teams/${teamSlug}/entities/new`}>+ Create new entity</a>}\n <LinkyButton className='inline-block margin-right' disabled={exporting} onClick={onExportClick}>Export</LinkyButton>\n <Select\n id='teamselect'\n defaultValue={options.find(({ value }) => value === teamSlug)}\n options={options}\n onChange={onSelectChange}\n styles={{\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n 'margin-bottom': '1rem',\n 'margin-left': '1rem',\n 'vertical-align': 'middle',\n }),\n }}\n isSearchable={false}\n />\n </div>\n </div>\n </>\n );\n};\n\nSubNav.propTypes = {\n teamsForSelect: PropTypes.array,\n teamSlug: PropTypes.string,\n peopleSelected: PropTypes.bool,\n};\n\nexport default SubNav;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport CommonProviders from 'components/common-providers';\nimport SubNav from '../components/subnav';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nfunction init() {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n renderer(\n (\n <CommonProviders>\n <SubNav\n teamSlug={CityGrows.Server.teamSlug}\n peopleSelected={CityGrows.Server.peopleSelected}\n teamsForSelect={CityGrows.Server.teamsForSelect}\n entityTabLabel={CityGrows.Server.entityTabLabel}\n />\n </CommonProviders>\n ), document.getElementById('directory-subnav'),\n );\n}\n\nexport default {\n init,\n};\n","import React from 'react';\nimport renderer from 'modules/renderer';\n\nimport 'select2';\n\nimport CommonProviders from 'components/common-providers';\nimport EntityPage from '../components/entity-page';\nimport Directory from './directory';\n\nfunction show() {\n renderer(\n (\n <CommonProviders>\n <EntityPage\n entity={CityGrows.Server.entityData}\n teamSlug={CityGrows.Server.teamSlug}\n />\n </CommonProviders>\n ), document.getElementById('entity'),\n );\n}\n\nfunction index() {\n Directory.init();\n\n $('#orgstatusselect, #customentityselect').select2({\n minimumResultsForSearch: -1,\n style: 'width',\n });\n}\n\nexport default {\n show,\n index,\n};\n","import React, { useState } from 'react';\nimport Select from 'components/shared/select';\nimport { findWhere} from 'underscore';\n\nconst EntityImport = ({options}) => {\n const [entity, setEntity] = useState(null);\n\n function optionsForSelect () {\n return options.map((option) => { return {value: option.id, label: option.name } })\n }\n\n function onValueChange ({ value }) {\n setEntity(value)\n }\n return (\n <div>\n <Select \n options={optionsForSelect()}\n onChange={onValueChange}\n value={findWhere(optionsForSelect(), { value: entity })}\n />\n {entity && <a className='btn-primary margin-top' href={`entity_imports/new?entity=${entity}`}>Next</a> }\n </div>\n )\n}\n\nexport default EntityImport","import React from 'react';\nimport renderer from 'modules/renderer';\nimport EntityImport from 'components/entity-import';\nimport CommonProviders from 'components/common-providers';\n\nfunction index() {\n renderer(\n (\n <CommonProviders>\n <EntityImport options={CityGrows.Server.entityOptions} />\n </CommonProviders>\n ), document.getElementById('entity-select'),\n );\n}\n\nexport default {\n index,\n};","const ExportsAPI = {\n fetch(){\n return $.ajax('/exports', {\n method: 'GET',\n dataType: 'json'\n });\n },\n\n remove(id){\n return $.ajax(`/exports/${id}`, {\n method: 'DELETE',\n dataType: 'json'\n });\n }\n};\n\nexport default ExportsAPI;\n","import React from 'react';\nimport { isEmpty } from 'underscore';\nimport ExportsAPI from 'apis/exports-api';\nimport TimeAgo from 'react-timeago';\nimport XClose from 'components/shared/x-close';\n\nclass Exports extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = { exports: this.props.exports };\n }\n\n componentDidMount() {\n this.interval = setInterval(this.fetchUpdates, 30000);\n }\n\n componentWillUnmount() {\n clearInterval(this.interval);\n }\n\n loadExports(exports) {\n this.setState({ exports });\n }\n\n fetchUpdates = () => {\n ExportsAPI.fetch().done((res) => { this.loadExports(res.exports); });\n };\n\n getFileLink(id, status) {\n if (status == 'finished') {\n return (\n <a className='btn-primary' href={`exports/${id}`}>Download</a>\n );\n }\n\n return '-';\n }\n\n statusColor(status) {\n switch (status) {\n case 'running':\n return 'text-semialert';\n case 'finished':\n return 'text-success';\n case 'failed':\n return 'text-alert';\n }\n }\n\n renderExportRow = (xport) => {\n return (\n <tr key={xport.id}>\n <td>{xport.export_type}</td>\n <td scope='row'>{xport.name}</td>\n <td>{this.getFileLink(xport.id, xport.status)}</td>\n <td className={`${this.statusColor(xport.status)} bold`}>{xport.status}</td>\n <td><TimeAgo date={xport.created_at} /></td>\n </tr>\n );\n };\n\n remove = (id) => {\n ExportsAPI.remove(id).done(this.fetchUpdates);\n };\n\n // Not being used for now, but might be used for a removal column later\n removalLink(status, id) {\n if (status == 'running') {\n return '';\n }\n\n return <XClose onClick={() => { this.remove(id); }} label='remove' />\n }\n\n renderExportsTable(exports) {\n if (exports) {\n return (\n <table className='datatable middle'>\n <thead>\n <tr>\n <th width='115' scope='col'>Export type</th>\n <th scope='col'>Name</th>\n <th scope='col'>File</th>\n <th scope='col'>Status</th>\n <th scope='col'>Date</th>\n </tr>\n </thead>\n <tbody>\n {exports.map(this.renderExportRow)}\n </tbody>\n </table>\n );\n }\n }\n\n renderExportTables() {\n if (isEmpty(this.state.exports)) {\n return (\n <div>\n <p>This is where data export files that you create are stored.</p>\n </div>\n );\n }\n\n return this.renderExportsTable(this.state.exports);\n }\n\n render() {\n return (\n <div style={{ padding: '2rem' }}>\n {this.renderExportTables()}\n </div>\n );\n }\n}\n\nexport default Exports;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport CommonProviders from 'components/common-providers';\nimport Exports from '../components/exports';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nfunction index() {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n renderer(\n (\n <CommonProviders>\n <Exports exports={CityGrows.Server.exportsData} />\n </CommonProviders>\n ), document.getElementById('exports'),\n );\n}\n\nexport default {\n index,\n};\n","const UserPreferenceAPI = {\n starForm(masterTemplateId) {\n const url = '/user_preferences/star_form';\n return $.ajax(url, {\n data: {\n master_template_id: masterTemplateId,\n },\n method: 'POST',\n dataType: 'json',\n });\n },\n\n unstarForm(masterTemplateId) {\n const url = '/user_preferences/unstar_form';\n return $.ajax(url, {\n data: {\n master_template_id: masterTemplateId,\n },\n method: 'POST',\n dataType: 'json',\n });\n },\n};\n\nexport default UserPreferenceAPI;\n","import API from 'apis/user-preference-api';\nimport { error } from 'components/shared/flash';\n\nconst UserPreferenceActions = {\n starForm(masterTemplateId) {\n return API.starForm(masterTemplateId)\n .fail(() => {\n error();\n });\n },\n\n unstarForm(masterTemplateId) {\n return API.unstarForm(masterTemplateId)\n .fail(() => {\n error();\n });\n },\n};\n\nexport default UserPreferenceActions;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nconst TemplateList = (props) => {\n const renderIcon = (template) => {\n if (template.icon === 'fa-file') {\n return <FontAwesomeIcon icon={icon({ name: 'file' })} size='4x' style={{ color: '#0463B7' }} />;\n }\n return (\n <img src={template.icon} width='60' height='60' alt='' />\n );\n };\n return (\n <ul className='flowtemplatebox-wrap'>\n {props.templateList.map((template) => {\n const selected = template.id === props.templateId;\n return (\n <li className='templatebox' onClick={() => { props.onTemplateChange(template); }}>\n <div className='container'>\n <div className='iconcontainer'>\n {renderIcon(template)}\n </div>\n {selected && (\n <div className='selectionbox'>\n <label className='checkbox'>\n <input value='true' type='checkbox' name='selected' checked={selected} />\n <span />\n </label>\n </div>\n )}\n </div>\n <div className='templatename'>\n <span>{template.name}</span>\n </div>\n </li>\n );\n })}\n </ul>\n );\n};\n\nTemplateList.propTypes = {\n onTemplateChange: PropTypes.func.isRequired,\n templateId: PropTypes.number,\n templateList: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.number.isRequired,\n })),\n onShowTemplateModal: PropTypes.func.isRequired,\n};\n\nexport default TemplateList;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nconst NewFormContainer = (props) => {\n return (\n <div className={`newform-container ${props.fullSize ? 'fullsize' : ''}`} ref={props.transitionRef}>\n <div className='newform-container-header'>\n <div className='title'>\n <h1>{props.title}</h1>\n <FontAwesomeIcon\n className='clickable'\n icon={icon({ name: 'x' })}\n style={{ color: '#0463B7', height: '1rem' }}\n onClick={props.onClose}\n />\n </div>\n </div>\n <div className='newform-container-body'>\n {props.children}\n </div>\n </div>\n );\n};\n\nNewFormContainer.propTypes = {\n title: PropTypes.string.isRequired,\n onClose: PropTypes.func.isRequired,\n fullSize: PropTypes.bool,\n transitionRef: PropTypes.shape({}).isRequired,\n};\n\nexport default NewFormContainer;\n","import React, { useState, useMemo, useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport { filter, isEmpty, isNull, sortBy, find } from 'underscore';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\nimport ReactDOM from 'react-dom';\nimport TemplateList from './new_form/template-list';\nimport NewFormContainer from './new_form/new-form-container';\nimport NotifBanner from 'components/shared/notif-banner';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon as i } from '@fortawesome/fontawesome-svg-core/import.macro';\n\nconst NewForm = (props) => {\n const noId = -1;\n const templates = [\n {\n id: noId,\n name: 'Blank Form',\n icon: 'fa-file',\n description: 'Start a blank form',\n stepNames: [],\n },\n ...sortBy(CityGrows.Server.templates, (template) => template.name).map(({\n name,\n icon,\n masterTemplateId,\n templateCategoryId,\n description,\n stepNames,\n }) => ({\n id: masterTemplateId,\n name,\n icon,\n categoryId: templateCategoryId,\n description,\n stepNames,\n })),\n ];\n\n const templateCategories = [\n { id: noId, name: 'All Templates' },\n ...sortBy(CityGrows.Server.templateCategories, (category) => category.name),\n ];\n\n const [template, setTemplate] = useState(templates[0]);\n const [categoryId, setCategoryId] = useState(noId);\n const [filterTerm, setFilterTerm] = useState('');\n const [showContent, setShowContent] = useState(false);\n const [isLaunching, setIsLaunching] = useState(false);\n\n const transitionRef = useRef(null);\n\n const launchUrl = useMemo(() => {\n if (isNull(template)) {\n return null;\n }\n\n if (template.id === noId) {\n return `/flow_templates?team_id=${props.teamId}`;\n }\n\n return `/master_templates/${template.id}/imports?team_id=${props.teamId}`;\n }, [props.teamId, template]);\n\n const filteredTemplates = useMemo(() => {\n if (categoryId === noId && isEmpty(filterTerm)) {\n return templates;\n }\n\n const results = filter(templates, (tmpl) => {\n const matchCategory = categoryId === noId\n ? true\n : tmpl.categoryId === categoryId;\n let matchName = true;\n if (!isEmpty(filterTerm)) {\n matchName = tmpl.name.toLowerCase().includes(filterTerm.toLowerCase());\n }\n return matchCategory && matchName;\n });\n\n if (!find(results, (tmpl) => tmpl.id === template?.id)) {\n setTemplate(null);\n }\n\n return results;\n }, [categoryId, filterTerm]);\n\n useEffect(() => {\n // to run transition\n setTimeout(() => setShowContent(true));\n }, []);\n\n const onCategoryIdChange = (id) => {\n setCategoryId(id);\n };\n\n const onTemplateChange = (tmpl) => {\n setTemplate(tmpl);\n };\n\n const onShowTemplateModal = (tmpl) => {\n onTemplateChange(tmpl);\n };\n\n const closeMainContainer = () => {\n setShowContent(false);\n setTimeout(() => {\n ReactDOM.unmountComponentAtNode(document.getElementById('newformcontainer'));\n }, 1500);\n };\n\n const renderTemplateInformation = () => {\n const bigger = isEmpty(template.description);\n let icon;\n if (template.icon === 'fa-file') {\n icon = <FontAwesomeIcon icon={i({ name: 'file' })} size='4x' style={{ color: '#0463B7' }} />;\n } else {\n icon = (\n <div className={`iconcontainer ${bigger ? 'bigger' : ''}`}>\n <img src={template.icon} width={bigger ? '100' : '60'} height={bigger ? '100' : '60'} alt='' />\n </div>\n );\n }\n return (\n <div className='informationcontainer'>\n <div style={{ display: 'flex' }}>\n {icon}\n <div className='margin-left'>\n <div>\n <strong>{template.name}</strong>\n {!isEmpty(template.description) && (\n <p>{template.description}</p>\n )}\n </div>\n {!isEmpty(template.stepNames) && (\n <div>\n <strong>Form Steps</strong>\n <p>\n {template.stepNames.map((step, it) => {\n return `${it + 1}. ${step} ${it < template.stepNames.length - 1 ? ' -> ' : ''}`;\n })}\n </p>\n </div>\n )}\n </div>\n </div>\n <div className='informationcontainer-actions'>\n <button type='button' onClick={closeMainContainer} className='btn-secondary'>Cancel</button>\n {renderLaunchButton()}\n </div>\n </div>\n );\n };\n\n const renderMenuBar = () => {\n return (\n <div className='menutab'>\n <ul className='categorylist'>\n {templateCategories.map((category) => {\n return (\n <li className={`clickable ${category.id === categoryId ? 'active' : ''}`} onClick={() => { onCategoryIdChange(category.id); }}>\n <span>{category.name}</span>\n </li>\n );\n })}\n </ul>\n <NotifBanner className='advanced' style='notice'>\n <div style={{ display: 'flex', justifyContent: 'space-between' }}>\n <div style={{ display: 'inline-flex' }}>\n <div style={{ marginRight: '1rem', display: 'flex', alignItems: 'top' }}>\n <FontAwesomeIcon icon={i({ name: 'square-info' })} />\n </div>\n <div>\n <strong>Save time and simplify your experience with ClearForms using our pre-built form templates</strong>\n <p>Designed to help kickstart your form building process, these templates provide foundations for common local government processes.</p>\n <p>Simply select a template, and you'll have a fully functional form at your fingertips. Customize and edit to fit your specific needs, making it your own in a just a few clicks.</p>\n </div>\n </div>\n </div>\n </NotifBanner>\n </div>\n );\n };\n\n const renderLaunchButton = () => {\n if (isLaunching) {\n return (\n <button\n className='btn-primary disabled margin-left'\n type='button'\n disabled\n >\n Launching...\n </button>\n );\n }\n return (\n <a\n className='btn-primary'\n href={launchUrl}\n data-method='post'\n onClick={() => setIsLaunching(true)}\n >\n Create New Form\n </a>\n );\n };\n\n return (\n <div className='newform'>\n <TransitionGroup>\n { showContent && (\n <CSSTransition\n classNames='anim'\n timeout={250}\n nodeRef={transitionRef}\n >\n <NewFormContainer\n title='Create New Form'\n onClose={closeMainContainer}\n fullSize\n transitionRef={transitionRef}\n >\n <div className='newform-header'>\n {renderMenuBar()}\n <div className='searchbar'>\n <label key='search'>\n Search Templates\n </label>\n <input onChange={(e) => { setFilterTerm(e.target.value); }} value={filterTerm} type='text' />\n </div>\n {template && renderTemplateInformation()}\n </div>\n <div className='newform-body'>\n <TemplateList\n templateId={template?.id}\n templateList={filteredTemplates}\n onTemplateChange={onTemplateChange}\n onShowTemplateModal={onShowTemplateModal}\n />\n </div>\n </NewFormContainer>\n </CSSTransition>\n )}\n </TransitionGroup>\n </div>\n );\n};\n\nNewForm.propTypes = {\n teamId: PropTypes.string.isRequired,\n};\n\nexport default NewForm;\n","import React, { useState, useMemo } from 'react';\nimport ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport UserPreferenceActions from 'actions/user-preference-actions';\nimport { isEmpty } from 'underscore';\nimport NewForm from '../new-form';\n\nconst FormsList = (props) => {\n const [starredFormIds, setStarredFormIds] = useState(props.starredFormIds);\n\n const starredForms = useMemo(() => {\n return props.masterTemplates.filter((template) => {\n return starredFormIds.includes(template.id);\n });\n }, [starredFormIds, props.masterTemplates]);\n\n const forms = useMemo(() => {\n const tmp = props.masterTemplates.filter((template) => {\n return !starredFormIds.includes(template.id);\n });\n if (props.formsPagination) {\n return tmp.slice(0, props.formsPagination);\n }\n\n return tmp;\n }, [starredFormIds, props.masterTemplates, props.formsPagination]);\n\n const showViewAllLink = useMemo(() => {\n return props.formsPagination\n && props.teamFriendlyId\n && (props.masterTemplates.length - starredForms.length) > props.formsPagination;\n }, [starredForms, props.masterTemplates, props.formsPagination, props.teamFriendlyId]);\n\n const starForm = (id) => {\n UserPreferenceActions.starForm(id)\n .done((res) => {\n setStarredFormIds(res.starred_master_template_ids);\n });\n };\n\n const unstarForm = (id) => {\n UserPreferenceActions.unstarForm(id)\n .done((res) => {\n setStarredFormIds(res.starred_master_template_ids);\n });\n };\n\n const renderCreateNewForm = (e, teamId) => {\n e.preventDefault();\n e.stopPropagation();\n const newFormContainer = document.getElementById('newformcontainer');\n ReactDOM.render(<NewForm teamId={teamId} unmountOnExit />, newFormContainer);\n };\n\n const renderFormItem = (form, isStarred) => {\n let starIcon;\n\n if (isStarred) {\n starIcon = (\n <FontAwesomeIcon\n icon={icon({ name: 'star', style: 'solid' })}\n onClick={() => unstarForm(form.id)}\n className='staricon starred'\n size='lg'\n title='Click to unstar this form'\n />\n );\n } else {\n starIcon = (\n <FontAwesomeIcon\n icon={icon({ name: 'star', style: 'regular' })}\n onClick={() => starForm(form.id)}\n className='staricon'\n size='lg'\n title='Click to star this form'\n />\n );\n }\n return (\n <li className='flowtemplatebox' key={`li-${form.id}`}>\n <a href={`/workflows/${form.id}`}>\n <div className='spanlink' />\n </a>\n <div className='flowtemplatebox-contentwrap'>\n <div className='flowtemplatebox-title'>{form.name}</div>\n <div className={`flowtemplatebox-status ${form.status === 'Published' ? 'published' : ''}`}>{form.status}</div>\n {starIcon}\n </div>\n </li>\n );\n };\n\n const renderList = () => {\n const canCreateForms = props.teamFriendlyId && props.enableFormCreation;\n if (!isEmpty(forms) || canCreateForms) {\n return (\n <>\n {!isEmpty(starredForms) && <div className='formlisttitle margin-top'>Your forms</div>}\n <ul className='flowtemplatebox-wrap'>\n {forms.map((form) => {\n return renderFormItem(form, false);\n })}\n\n {canCreateForms && (\n <li className='newform flowtemplatebox create' key='li-new'>\n <div className='spanlink' onClick={(e) => renderCreateNewForm(e, props.teamFriendlyId)} />\n <div className='flowtemplatebox-contentwrap'>\n <FontAwesomeIcon icon={icon({ name: 'circle-plus' })} size='2x' />\n <a href=''>Create new form</a>\n </div>\n </li>\n )}\n </ul>\n </>\n );\n }\n\n if (isEmpty(starredForms)) {\n return (\n <div className='margin-top margin-left'>No forms to show</div>\n );\n }\n };\n\n const renderTitle = () => {\n if (props.teamName) {\n if (props.teamFriendlyId) {\n return <a href={`/teams/${props.teamFriendlyId}/master_templates`} className='subtitle'>{props.teamName}</a>;\n }\n return <div><div className='subtitle'>{props.teamName}</div></div>;\n }\n };\n\n return (\n <div className='padding-top margin-bottom-more'>\n {renderTitle()}\n {!isEmpty(starredForms) && (\n <>\n <div className='formlisttitle'>Starred forms</div>\n <ul className='flowtemplatebox-wrap'>\n {starredForms.map((form) => {\n return renderFormItem(form, true);\n })}\n </ul>\n </>\n )}\n {renderList()}\n {showViewAllLink && (\n <div className='margin-left'>\n <a href={`/teams/${props.teamFriendlyId}/master_templates`}>{`View all ${props.masterTemplates.length} forms for this team`}</a>\n </div>\n )}\n </div>\n );\n};\n\nFormsList.propTypes = {\n teamFriendlyId: PropTypes.string.isRequired,\n teamName: PropTypes.string.isRequired,\n masterTemplates: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string.isRequired,\n status: PropTypes.string.isRequired,\n })).isRequired,\n starredFormIds: PropTypes.arrayOf(PropTypes.number).isRequired,\n enableFormCreation: PropTypes.bool.isRequired,\n formsPagination: PropTypes.number,\n};\n\nexport default FormsList;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty } from 'underscore';\nimport FormsList from './forms-container/forms-list';\n\nconst FormsContainer = ({ teams, starredFormIds, teamlessForms, archivedMode }) => {\n const renderForms = () => {\n if (isEmpty(teams) && archivedMode) {\n return <div className='margin-top'>No archived forms</div>;\n }\n\n if (isEmpty(teams) && isEmpty(teamlessForms)) {\n return (\n <>\n <div className='minimalcontentcontainer'>\n You dont belong to any teams. Ask a coworker to invite you to a team, or \n <a href='/teams/new'>create a new one.</a>\n </div>\n <br />\n You must belong to a team in order to create new forms.\n </>\n );\n }\n\n return (\n <>\n {teams.map((team) => {\n return (\n <FormsList\n teamName={team.name}\n teamFriendlyId={team.friendly_id}\n starredFormIds={starredFormIds}\n masterTemplates={team.master_templates}\n enableFormCreation={team.enable_form_creation}\n formsPagination={7}\n />\n );\n })}\n {!isEmpty(teamlessForms) && (\n <div className='cf padding-top'>\n <FormsList\n teamName='Other forms'\n masterTemplates={teamlessForms}\n starredFormIds={starredFormIds}\n enableFormCreation={false}\n />\n </div>\n )}\n </>\n );\n };\n return renderForms();\n};\n\nFormsContainer.propTypes = {\n teams: PropTypes.arrayOf(PropTypes.shape({\n friendly_id: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n master_templates: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string.isRequired,\n })).isRequired,\n enable_form_creation: PropTypes.bool.isRequired,\n })),\n archivedMode: PropTypes.bool.isRequired,\n starredFormIds: PropTypes.arrayOf(PropTypes.number).isRequired,\n};\n\nexport default FormsContainer;\n","import 'select2';\nimport React from 'react';\nimport renderer from 'modules/renderer';\nimport PrimaryTabs from '../components/shared/primary-tabs';\nimport FormsContainer from '../components/forms-container';\nimport CommonProviders from '../components/common-providers';\n\nconst index = () => {\n $('select').select2({\n minimumResultsForSearch: -1,\n width: 'style',\n });\n\n $('#templateselect').change((e) => {\n document.location = `?status=${e.currentTarget.value}`;\n });\n\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n renderer(\n (\n <CommonProviders>\n <FormsContainer\n teams={CityGrows.Server.teams}\n archivedMode={CityGrows.Server.archivedMode}\n starredFormIds={CityGrows.Server.starredFormIds}\n teamlessForms={CityGrows.Server.teamlessForms}\n />\n </CommonProviders>\n ), document.getElementById('formscontainer'),\n );\n};\n\nexport default {\n index,\n};\n","var InitiatedFlowAPI = {\n launchProcess: function (flowTemplateId, opts) {\n const URL = '/initiated_flows/';\n\n return $.ajax(URL, {\n method: 'POST',\n data: {\n initiated_flow: {\n flow_template_id: flowTemplateId,\n },\n primary_applicant_id: opts.primaryApplicantId,\n secondary_applicant_ids: opts.secondaryApplicantIds,\n subprocess_requirement_id: opts.subprocessRequirementId,\n },\n dataType: 'json',\n });\n },\n\n previouslyLaunched: function (masterTemplateId) {\n const URL = `/initiated_flows/previously_launched/${masterTemplateId}`;\n\n return $.ajax(URL, {\n method: 'GET',\n dataType: 'json'\n });\n },\n\n update: function (id, attrs) {\n const URL = `/initiated_flows/${id}`;\n\n return $.ajax(URL, {\n method: 'PUT',\n data: {\n initiated_flow: attrs\n },\n dataType: 'json'\n });\n },\n\n destroyProcess: function (id) {\n const URL = `/initiated_flows/${id}`;\n\n return $.ajax(URL, {\n method: 'DELETE',\n dataType: 'json'\n });\n },\n\n parseVariableText: function (textType, textContainerId, id) {\n const URL = `/initiated_flows/${id}/parse_text`;\n\n return $.ajax(URL, {\n method: 'GET',\n data: {\n text_type: textType,\n text_container_id: textContainerId\n },\n dataType: 'json'\n });\n },\n\n documentsAndFiles: function (id) {\n const URL = `/initiated_flows/${id}/documents_and_files`;\n\n return $.ajax(URL, {\n method: 'GET',\n dataType: 'json'\n });\n },\n\n uploadRepoFile: function (id, file) {\n const URL = `/initiated_flows/${id}/upload_repo_file`;\n\n const data = new FormData();\n data.append('file', file);\n\n return $.ajax(URL, {\n method: 'POST',\n processData: false,\n contentType: false,\n data: data,\n });\n },\n\n deleteRepoFile: function (id, fileId) {\n return $.ajax(`/initiated_flows/${id}/delete_repo_file`, {\n method: 'DELETE',\n dataType: 'json',\n data: {\n file_id: fileId\n }\n });\n },\n\n show: function (id) {\n return $.ajax(`/initiated_flows/${id}`, {\n method: 'GET',\n dataType: 'JSON',\n })\n },\n\n doNextStep: function (id, stepId) {\n return $.ajax(`/initiated_flows/${id}/do_next_step`, {\n method: 'POST',\n dataType: 'json',\n data: {\n step_id: stepId,\n },\n })\n },\n};\n\nexport default InitiatedFlowAPI;\n","import UserAPI from '../apis/user-api';\nimport InitiatedFlowAPI from '../apis/initiated-flow-api';\n\nconst LaunchManagerActions = {\n checkIfAccountExists(email) {\n return UserAPI.exists(email);\n },\n\n previouslyLaunched(masterTemplateId) {\n return InitiatedFlowAPI.previouslyLaunched(masterTemplateId);\n },\n};\n\nexport default LaunchManagerActions;\n","import Dispatcher from '../appdispatcher';\nimport Constants from '../constants/initiated-flow-constants';\nimport API from '../apis/initiated-flow-api';\nimport Flash from '../components/shared/flash';\nimport SearchAPI from '../apis/search-api';\n\nconst InitiatedFlowActions = {\n receiveInitiatedFlow(initiatedFlow) {\n Dispatcher.dispatch({\n actionType: Constants.LOADED,\n initiatedFlow,\n });\n },\n\n receiveStep(step) {\n Dispatcher.dispatch({\n actionType: Constants.STEP_LOADED,\n step,\n });\n },\n\n receiveActiveStep(activeStep) {\n Dispatcher.dispatch({\n actionType: Constants.ACTIVE_STEP_LOADED,\n activeStep,\n });\n },\n\n update(id, attrs) {\n const req = API.update(id, attrs);\n\n req.done(this.receiveInitiatedFlow);\n\n return req;\n },\n\n launchProcess(flowTemplateId, opts = {}) {\n const req = API.launchProcess(flowTemplateId, opts);\n\n req.done((data) => {\n window.location.replace(`/initiated_flows/manager/${data.id}`);\n })\n .fail(() => { Flash.error('There was a problem launching the submission.'); });\n\n return req;\n },\n\n deleteProcess(initiatedFlowId) {\n API.destroyProcess(initiatedFlowId)\n .done(() => {\n window.location = '/';\n })\n .fail(() => { Flash.error('There was a problem deleting the submission.'); });\n },\n\n searchApplicants(terms) {\n return SearchAPI.searchApplicants(terms, true);\n },\n};\n\nexport default InitiatedFlowActions;\n","import UserAPI from '../apis/user-api';\nimport Flash from '../components/shared/flash';\n\nconst UserActions = {\n login(email, password) {\n return UserAPI.login(email, password)\n .fail((res) => {\n Flash.error(res.responseJSON.error);\n });\n },\n\n signup(email, password, name, accountType) {\n return UserAPI.signup(email, password, name, accountType)\n .fail((res) => {\n Flash.error(res.responseText);\n });\n },\n};\n\nexport default UserActions;\n","import React from 'react';\nimport dayjs from 'dayjs';\n\nconst SmallFlowTable = ({ initiatedFlows, subprocessRequirementId }) => {\n const renderRow = (flow) => {\n const params = subprocessRequirementId ? `?subprocess_requirement_id=${subprocessRequirementId}` : '';\n\n const processURL = `/initiated_flows/manager/${flow.id}${params}`;\n\n return (\n <tr key={flow.id}>\n <td>\n <a\n href={processURL}\n title\n >\n #{flow.scoped_id}\n </a>\n </td>\n <td>\n <span>{flow.identifier_field}</span>\n </td>\n <td>\n {dayjs(flow.created_at).format('LLL')}\n </td>\n <td className='strong'>\n <span dangerouslySetInnerHTML={{ __html: flow.status }} />\n { flow.is_renewable\n && (\n <button\n onClick={() => { document.location = processURL; }}\n type='button'\n className='nomargin inline-block margin-left-more'\n >\n Renew\n </button>\n )}\n </td>\n </tr>\n );\n };\n\n const renderRows = () => {\n return initiatedFlows.map(renderRow);\n };\n\n return (\n <table className='datatable highlightable margin-bottom middle fullwidth'>\n <thead>\n <tr>\n <th>ID</th>\n <th>Identifier</th>\n <th>Started</th>\n <th>Status</th>\n </tr>\n </thead>\n <tbody>\n {renderRows()}\n </tbody>\n </table>\n );\n};\n\nexport default SmallFlowTable;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport SmallFlowTable from 'components/shared/small-flow-table';\n\nconst ExistingProcessesStep = (props) => {\n return (\n <div className='launchmanager-processes'>\n <h1>Looking for a submission you already started?</h1>\n <span>Choose one of the following submissions to renew or pick up where you left off.</span>\n\n <div className='launchmanager-processes-tablewrap'>\n <SmallFlowTable initiatedFlows={props.initiatedFlows} subprocessRequirementId={props.subprocessRequirementId} />\n </div>\n\n <nav className='margin-top'>\n <button id='forrealbutton' type='button' className='btn-primary' onClick={props.onNextClick}>Nope, I really want to start another one</button>\n </nav>\n </div>\n );\n};\n\nExistingProcessesStep.propTypes = {\n initiatedFlows: PropTypes.arrayOf(PropTypes.shape({})),\n onNextClick: PropTypes.func.isRequired,\n subprocessRequirementId: PropTypes.number,\n};\n\nExistingProcessesStep.defaultProps = {\n initiatedFlows: [],\n};\n\nexport default ExistingProcessesStep;\n","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\n\nclass ExistingAccountStep extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n password: '',\n };\n }\n\n getInitialState() {\n return {\n password: '',\n };\n }\n\n isIncomplete = () => {\n return !this.state.password;\n };\n\n onChange = (e) => {\n this.setState({\n password: e.currentTarget.value,\n });\n };\n\n onSubmit = (e) => {\n e.preventDefault();\n this.props.onSubmit(this.refs.password.value);\n };\n\n render() {\n return (\n <div>\n <h1>We found an existing account for that email</h1>\n <span>Please enter your password for <strong>{this.props.email}</strong></span>\n\n <form className='center' onSubmit={this.onSubmit}>\n <label>Password\n <input onChange={this.onChange} autoFocus ref='password' type='password' />\n </label>\n\n <button className='btn-primary'>Launch submission</button>\n\n <a href='/users/password/new'>I forgot my password</a>\n </form>\n </div>\n );\n }\n}\n\nExistingAccountStep.propTypes = {\n email: PropTypes.string.isRequired,\n onSubmit: PropTypes.func.isRequired,\n};\n\nexport default ExistingAccountStep;\n","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport EmailValidator from 'modules/email-validator';\n\nclass EmailStep extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n email: this.props.defaultValue,\n };\n }\n\n emailValid = () => {\n return EmailValidator.validate(this.state.email);\n };\n\n onSubmit = (e) => {\n e.preventDefault();\n\n this.props.onSubmit(this.refs.input.value.trim());\n };\n\n onEmailChange = (e) => {\n this.setState({\n email: e.currentTarget.value,\n });\n };\n\n render() {\n return (\n <div>\n <h1>Let's get started</h1>\n <span className='launchmanager-instruction'>First things first, what's a good email address for us to contact you at?</span>\n\n <form className='center' onSubmit={this.onSubmit}>\n <label>Email\n <input type='email' name='email' ref='input' autoFocus defaultValue={this.state.email} onChange={this.onEmailChange} placeholder='example@email.com' />\n </label>\n\n <button className='btn-primary' type='submit' disabled={!this.emailValid()}>{'Next >'}</button>\n </form>\n\n <a href='/users/sign_in'>Want to resume a submission you already started?</a>\n </div>\n );\n }\n}\n\nEmailStep.propTypes = {\n onSubmit: PropTypes.func.isRequired,\n defaultValue: PropTypes.string.isRequired,\n};\n\nexport default EmailStep;\n","import PropTypes from 'prop-types';\nimport React from 'react';\n\nconst LaunchingLoader = ({ flowTemplate }) => {\n return (\n <div>\n <h3 className='strong'>Launching</h3>\n <h2>{flowTemplate.name}</h2>\n\n <div className='progress'><div /></div>\n </div>\n );\n};\n\nLaunchingLoader.propTypes = {\n flowTemplate: PropTypes.object.isRequired,\n};\n\nexport default LaunchingLoader;\n","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\n\nclass PersonalInfoStep extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n name: this.props.defaultNameValue,\n };\n }\n\n isIncomplete = () => {\n return !this.state.name;\n };\n\n onSubmit = (e) => {\n e.preventDefault();\n\n const formData = {\n name: this.refs.name.value,\n };\n\n this.props.onSubmit(formData);\n };\n\n onBackClick = (e) => {\n e.preventDefault();\n this.props.history.goBack();\n };\n\n onChange = () => {\n this.setState({\n name: this.refs.name.value,\n });\n };\n\n render() {\n return (\n <div>\n <h1><i className='icon-person-dark' /> Personal Info</h1>\n\n <form onChange={this.onChange}>\n <label>Name\n <input type='text' ref='name' autoFocus value={this.state.name} />\n </label>\n\n <nav>\n <a href='#' onClick={this.props.onBackClick}>{'< Go back'}</a>\n <button className='btn-primary' disabled={this.isIncomplete()} onClick={this.onSubmit}>{'Next >'}</button>\n </nav>\n </form>\n </div>\n );\n }\n}\n\nPersonalInfoStep.propTypes = {\n onBackClick: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n defaultNameValue: PropTypes.string.isRequired,\n};\n\nexport default PersonalInfoStep;\n","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\n\nclass PasswordStep extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n password: '',\n };\n }\n\n componentDidMount() {\n this.refs.password.focus();\n }\n\n isIncomplete = () => {\n return !this.state.password || this.state.password.length < 8;\n };\n\n onChange = (e) => {\n this.setState({\n password: e.currentTarget.value,\n });\n };\n\n onSubmit = (e) => {\n e.preventDefault();\n this.props.onSubmit(this.refs.password.value);\n };\n\n buttonText = () => {\n if (this.isIncomplete()) {\n return 'Password too short';\n }\n\n return 'Launch submission >';\n };\n\n render() {\n return (\n <div>\n <h1>Choose a password</h1>\n <span>Use your password to return to your submission at any time.</span>\n\n <form className='center' onSubmit={this.onSubmit}>\n <label>Password\n <input value={this.state.password} autoFocus onChange={this.onChange} ref='password' type='password' />\n </label>\n\n <nav>\n <a href='#' onClick={this.props.onBackClick}>{'< Go back'}</a>\n <button className='btn-primary' disabled={this.isIncomplete()} type='submit'>{this.buttonText()}</button>\n </nav>\n </form>\n </div>\n );\n }\n}\n\nPasswordStep.propTypes = {\n onBackClick: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n};\n\nexport default PasswordStep;\n","import PropTypes from 'prop-types';\nimport React, { useState, useEffect } from 'react';\nimport { Route, HashRouter as Router, useHistory } from 'react-router-dom';\nimport { Switch } from 'react-router';\nimport LaunchManagerActions from 'actions/launch-manager-actions';\nimport InitiatedFlowActions from 'actions/initiated-flow-actions';\nimport UserActions from 'actions/user-actions';\nimport NotifBanner from 'components/shared/notif-banner';\nimport ErrorBoundary from 'components/shared/error-boundary';\nimport ExistingProcessesStep from './launch_manager/existing-processes-step';\nimport ExistingAccountStep from './launch_manager/existing-account-step';\nimport EmailStep from './launch_manager/email-step';\nimport LaunchingLoader from './launch_manager/launching-loader';\nimport PersonalInfoStep from './launch_manager/personal-info-step';\nimport PasswordStep from './launch_manager/password-step';\n\nconst LaunchManager = (props) => {\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [name, setName] = useState('');\n const [existingAccount, setExistingAccount] = useState(null);\n const [currentUser, setCurrentUser] = useState(props.currentUser);\n const [existingProcesses, setExistingProcesses] = useState();\n\n const history = useHistory();\n\n useEffect(() => {\n if (currentUser) {\n existingProcessCheck();\n } else {\n history.replace('/email');\n }\n }, []);\n\n useEffect(() => {\n if (!email) { return; }\n\n checkEmailAndRedirect();\n }, [email]);\n\n useEffect(() => {\n if (!password) { return; }\n\n authenticateUser().done(existingProcessCheck);\n }, [password]);\n\n const redirectTo = (path) => {\n history.push(path);\n };\n\n const onBackClick = (e) => {\n e.preventDefault();\n history.goBack();\n };\n\n const checkEmailAndRedirect = () => {\n LaunchManagerActions.checkIfAccountExists(email)\n .done(handleEmailCheckResponse);\n };\n\n const handleEmailCheckResponse = (accountExists) => {\n if (accountExists) {\n setExistingAccount(true);\n redirectTo('/existing');\n } else {\n redirectTo('/personal-info');\n }\n };\n\n const onEmailSubmit = (newEmail) => {\n setEmail(newEmail);\n };\n\n const onPersonalInfoSubmit = (info) => {\n setName(info.name);\n redirectTo('/password');\n };\n\n const onPasswordSubmit = (newPassword) => {\n setPassword(newPassword);\n };\n\n const authenticateUser = () => {\n let authRequest;\n\n if (currentUser || existingAccount) {\n authRequest = UserActions.login(email, password);\n } else {\n authRequest = UserActions.signup(email, password, name, 'citizen');\n }\n\n return authRequest.done(setCurrentUser);\n };\n\n const existingProcessCheck = () => {\n LaunchManagerActions.previouslyLaunched(props.masterTemplateId).done((existing) => {\n if (canUseExistingProcesses() && existing.length) {\n setExistingProcesses(existing);\n redirectTo('/processes');\n } else {\n redirectTo('/launching');\n launchChain();\n }\n });\n };\n\n const canUseExistingProcesses = () => {\n if (props.subprocessRequirement && !props.subprocessRequirement.allow_link_existing) { return false; }\n\n return true;\n };\n\n const postAuth = () => {\n onLaunchFlowComplete();\n };\n\n const onLaunchFlowComplete = () => {\n redirectTo('/launching');\n launchChain();\n };\n\n const launchChain = () => {\n const opts = {\n subprocessRequirementId: props.subprocessRequirement?.id,\n primaryApplicantId: props.primaryApplicant?.id,\n secondaryApplicantIds: props.secondaryApplicantIds,\n };\n InitiatedFlowActions.launchProcess(props.flowTemplate.id, opts)\n .fail(history.goBack);\n };\n\n const emailStepRenderer = () => {\n return (\n <EmailStep defaultValue={email} onSubmit={onEmailSubmit} />\n );\n };\n\n const existingAccountStepRenderer = () => {\n return (\n <ExistingAccountStep\n onSubmit={onPasswordSubmit}\n email={email}\n />\n );\n };\n\n const personalInfoStepRenderer = () => {\n return (\n <PersonalInfoStep\n defaultNameValue={name}\n onBackClick={onBackClick}\n onSubmit={onPersonalInfoSubmit}\n />\n );\n };\n\n const passwordStepRenderer = () => {\n return (\n <PasswordStep\n onBackClick={onBackClick}\n onSubmit={onPasswordSubmit}\n />\n );\n };\n\n const existingProcessStepRenderer = () => {\n return (\n <ExistingProcessesStep\n initiatedFlows={existingProcesses}\n subprocessRequirementId={props.subprocessRequirement?.id}\n onNextClick={postAuth}\n />\n );\n };\n\n const launchingLoaderRenderer = () => {\n return (\n <LaunchingLoader flowTemplate={props.flowTemplate} />\n );\n };\n\n return (\n <>\n <div>\n <NotifBanner>\n You are starting <strong>{props.flowTemplate.name}</strong>\n </NotifBanner>\n <div className='launchmanager-maincontent'>\n <div className='minimalcontentcontainer launchmanager'>\n <Switch>\n <Route path='/email' render={emailStepRenderer} />\n <Route path='/existing' render={existingAccountStepRenderer} />\n <Route path='/personal-info' render={personalInfoStepRenderer} />\n <Route path='/password' render={passwordStepRenderer} />\n <Route path='/launching' render={launchingLoaderRenderer} />\n <Route path='/processes' render={existingProcessStepRenderer} />\n <Route render={() => <div className='progress' />} />\n </Switch>\n </div>\n </div>\n </div>\n <div className='decorativefooter' />\n </>\n );\n};\n\nconst withRouter = (props) => {\n return (\n <Router>\n <ErrorBoundary>\n <LaunchManager {...props} />\n </ErrorBoundary>\n </Router>\n );\n};\n\nLaunchManager.propTypes = {\n currentUser: PropTypes.object,\n flowTemplate: PropTypes.shape({\n name: PropTypes.string.isRequired,\n id: PropTypes.number.isRequired,\n }).isRequired,\n masterTemplateId: PropTypes.number.isRequired,\n match: PropTypes.object.isRequired,\n subprocessRequirement: PropTypes.shape({\n id: PropTypes.number.isRequired,\n allow_link_existing: PropTypes.bool.isRequired,\n }).isRequired,\n primaryApplicant: PropTypes.shape({\n id: PropTypes.number.isRequired,\n }).isRequired,\n secondaryApplicantIds: PropTypes.arrayOf(PropTypes.number),\n};\n\nexport default withRouter;\n","export const isLoggedIn = () => {\n const url = '/sessions/is_logged_in';\n\n return window.$.ajax(url, {\n method: 'GET',\n dataType: 'json',\n });\n};\n\nexport default isLoggedIn;\n","import { isLoggedIn } from 'apis/session-api';\nimport { throttle } from 'underscore';\n\nexport const checkForLogin = throttle(() => {\n const req = isLoggedIn();\n req.done((res) => {\n if (!res.isLoggedIn) {\n alert('You are not currently logged in');\n window.location.replace('/users/sign_in');\n }\n });\n}, 5000, { trailing: false });\n\nexport const pollForLogin = () => {\n window.$(window).focus('focus', checkForLogin);\n};\n\nexport default pollForLogin;\n","import keyMirror from 'keymirror'\n\nexport default keyMirror({\n INVITES_ADDED: null,\n DESTROYED: null,\n}, 'SURVEY_SUBMISSION');\n","import keyMirror from 'keymirror'\n\nexport default keyMirror({\n\t'LOADED': null\n}, 'ACTIVITY_LOG');\n","import Constants from 'constants/initiated-flow-constants';\nimport ActiveStepConstants from 'constants/active-step-constants';\nimport SurveySubmissionConstants from 'constants/survey-submission-constants';\nimport ActivityLogConstants from 'constants/activity-log-constants';\nimport { findWhere, reject, findIndex, map } from 'underscore';\n\nfunction initiatedFlowReducer(state, action) {\n let step = {};\n let datum = {};\n let index = null;\n let reqsDupe = null;\n\n switch (action.type) {\n case Constants.SET_REFRESHED:\n return { ...state, refreshing: false };\n case Constants.REQUIREMENT_UPDATED:\n index = findIndex(state.initiatedFlow.requirements, { id: action.requirement.id });\n let reqDupe = { ...state.initiatedFlow.requirements[index], ...action.requirement };\n reqsDupe = [\n ...state.initiatedFlow.requirements.slice(0, index),\n reqDupe,\n ...state.initiatedFlow.requirements.slice(index + 1),\n ];\n\n return { ...state, initiatedFlow: { ...state.initiatedFlow, requirements: reqsDupe }, step: reqDupe };\n case Constants.PAYMENT_UPDATED:\n step = { ...state.step, payment: action.payment, completed: action.payment.completed };\n index = findIndex(state.initiatedFlow.requirements, { id: action.payment.payable_id });\n reqsDupe = [\n ...state.initiatedFlow.requirements.slice(0, index),\n { ...state.initiatedFlow.requirements[index], payment: action.payment, completed: action.payment.completed },\n ...state.initiatedFlow.requirements.slice(index + 1),\n ];\n return { ...state, step, initiatedFlow: { ...state.initiatedFlow, requirements: reqsDupe } };\n case Constants.PAYMENT_MADE:\n step = { ...state.step, completed: action.completed, payment: { ...state.step.payment, completed: action.completed, charges: [...state.step.payment.charges, action.charge] } };\n index = findIndex(state.initiatedFlow.requirements, (requirement) => { return requirement.payment.id === action.charge.chargeable_id; });\n reqDupe = { ...state.initiatedFlow.requirements[index] };\n reqsDupe = [\n ...state.initiatedFlow.requirements.slice(0, index),\n { ...reqDupe, payment: { ...reqDupe.payment, completed: action.completed, charges: [...reqDupe.payment.charges, action.charge] }, completed: action.completed },\n ...state.initiatedFlow.requirements.slice(index + 1),\n ];\n\n return { ...state, step, initiatedFlow: { ...state.initiatedFlow, requirements: reqsDupe } };\n case Constants.COLLECTED_DATA_CHANGED:\n datum = findWhere(state.activeStep.collected_data, { step_datum_id: action.stepDatumId });\n if (!datum) {\n datum = { step_datum_id: action.stepDatumId, content: action.newValue };\n state.activeStep.collected_data.push(datum);\n } else {\n datum.content = action.newValue;\n }\n\n return { ...state, outstandingSaveRequests: state.outstandingSaveRequests + 1, changePending: false };\n case Constants.COLLECTED_DATA_WILL_CHANGE:\n return { ...state, changePending: true };\n case Constants.DELETE_ATTACHED_FILE:\n datum = findWhere(state.activeStep.collected_data, { step_datum_id: action.stepDatumId });\n datum.files = reject(datum.files, { id: action.fileId });\n return { ...state, refreshing: true };\n case ActiveStepConstants.SYNC_ACTIVE_STEP:\n return { ...state, activeStep: action.activeStep };\n case ActiveStepConstants.CURRENT_ACTIVE_STEP_UPDATED:\n return { ...state, activeStep: { ...state.activeStep, ...action.attrs }, refreshingAttachments: true };\n case ActiveStepConstants.UPDATED:\n const activeStepIndex = findIndex(state.initiatedFlow.active_steps, { id: action.activeStepId });\n const activeStepDupe = { ...state.initiatedFlow.active_steps[activeStepIndex], ...action.attrs };\n let currentActiveStep = { ...state.activeStep };\n if (state.activeStep.id === action.activeStepId) {\n currentActiveStep = { ...currentActiveStep, ...action.attrs };\n }\n return {\n ...state,\n activeStep: currentActiveStep,\n initiatedFlow: {\n ...state.initiatedFlow,\n active_steps: [\n ...state.initiatedFlow.active_steps.slice(0, activeStepIndex),\n activeStepDupe,\n ...state.initiatedFlow.active_steps.slice(activeStepIndex + 1),\n ],\n },\n };\n case ActiveStepConstants.CHANGES_PERSISTED:\n return {\n ...state,\n outstandingSaveRequests: state.outstandingSaveRequests - 1,\n refreshing: true, refreshingAttachments: true,\n reviewSubmitted: action.reviewSubmitted,\n };\n case Constants.COLLECTED_DATA_ERROR:\n const stepDatum = findWhere(state.activeStep.collected_data, {\n step_datum_id: action.stepDatumId,\n });\n\n if (stepDatum.data_type === 'file') {\n stepDatum.content = null;\n }\n return { ...state, outstandingSaveRequests: null };\n case SurveySubmissionConstants.INVITES_ADDED:\n return { ...state, activeStep: { ...state.activeStep, survey_invitations: state.activeStep.survey_invitations.concat(action.invites) } };\n case SurveySubmissionConstants.DESTROYED:\n return { ...state, activeStep: { ...state.activeStep, survey_submissions: reject(state.activeStep.survey_submissions, { id: action.id }) } };\n case ActivityLogConstants.LOADED:\n return { ...state, activities: action.activities };\n case Constants.TAG_ADDED: {\n // This tag already exists. At time of writing,\n // this only occurs when attempting to add a\n // renewal tag to a process that already has it.\n\n if (findWhere(state.initiatedFlow.taggings, { tag_name: action.tagging.tag_name })) {\n return;\n }\n\n const taggingsDupe = [...state.initiatedFlow.taggings, action.tagging];\n let suggestedTags = [...state.initiatedFlow.suggested_tags];\n if (!findWhere(state.initiatedFlow.suggested_tags, { id: action.tagging.tag_id })) {\n const { tag } = action.tagging;\n tag.tagging_count = 1;\n suggestedTags = [...suggestedTags, tag];\n } else {\n const tagToUpdate = findWhere(state.initiatedFlow.suggested_tags, { id: action.tagging.tag_id });\n tagToUpdate.tagging_count += 1;\n const otherSuggestedTags = reject(state.initiatedFlow.suggested_tags, { id: action.tagging.tag_id });\n suggestedTags = [...otherSuggestedTags, tagToUpdate];\n }\n\n return {\n ...state,\n initiatedFlow: {\n ...state.initiatedFlow,\n taggings: taggingsDupe,\n suggested_tags: suggestedTags,\n },\n };\n }\n case Constants.TAG_UPDATED: {\n const otherSuggestedTags = reject(state.initiatedFlow.suggested_tags, { id: action.tag.id });\n\n const taggingToUpdate = findWhere(state.initiatedFlow.taggings, { tag_id: action.tag.id });\n const otherTaggings = taggingToUpdate ? reject(state.initiatedFlow.taggings, taggingToUpdate) : state.initiatedFlow.taggings;\n\n if (taggingToUpdate) {\n taggingToUpdate.tag_name = action.tag.name;\n taggingToUpdate.tag.name = action.tag.name;\n }\n\n const updatedTaggings = taggingToUpdate ? [...otherTaggings, taggingToUpdate] : otherTaggings;\n\n return {\n ...state,\n initiatedFlow: {\n ...state.initiatedFlow,\n taggings: updatedTaggings,\n suggested_tags: [...otherSuggestedTags, action.tag],\n },\n };\n }\n case Constants.TAG_REMOVED: {\n const taggingToRemove = findWhere(state.initiatedFlow.taggings, { id: action.taggingId });\n const updatedTaggings = reject(state.initiatedFlow.taggings, { id: action.taggingId });\n const tagToUpdate = findWhere(state.initiatedFlow.suggested_tags, { id: taggingToRemove.tag_id });\n tagToUpdate.tagging_count -= 1;\n const otherSuggestedTags = reject(state.initiatedFlow.suggested_tags, { id: taggingToRemove.tag_id });\n const suggestedTags = [...otherSuggestedTags, tagToUpdate];\n\n return { ...state, initiatedFlow: { ...state.initiatedFlow, taggings: updatedTaggings, suggested_tags: suggestedTags } };\n }\n case Constants.TAG_DELETED: {\n const updatedTaggings = reject(state.initiatedFlow.taggings, { tag_id: action.tagId });\n const updatedTags = reject(state.initiatedFlow.suggested_tags, { id: action.tagId });\n return { ...state, initiatedFlow: { ...state.initiatedFlow, taggings: updatedTaggings, suggested_tags: updatedTags } };\n }\n case Constants.ASSIGNED_PEOPLE_UPDATED:\n if (action.personAttachment.persisted) {\n state.initiatedFlow.person_attachments.push(action.personAttachment);\n } else {\n state.initiatedFlow.person_attachments = reject(state.initiatedFlow.person_attachments, { id: action.personAttachment.id, type: action.personAttachment.type });\n }\n return { ...state };\n case Constants.ASSIGNMENT_UPDATED:\n index = findIndex(state.initiatedFlow.person_attachments, { id: action.personAttachment.id, type: action.personAttachment.type });\n const attachmentsDup = [\n ...state.initiatedFlow.person_attachments.slice(0, index),\n { ...state.initiatedFlow.person_attachments[index], ...action.personAttachment },\n ...state.initiatedFlow.person_attachments.slice(index + 1),\n ];\n return { ...state, initiatedFlow: { ...state.initiatedFlow, person_attachments: attachmentsDup } };\n case Constants.HALTED:\n return { ...state, initiatedFlow: { ...state.initiatedFlow, halted: true } };\n case Constants.OUTPUT_UPDATED:\n index = findIndex(state.initiatedFlow.issued_outputs, { id: action.attrs.id });\n const outputsDupe = [\n ...state.initiatedFlow.issued_outputs.slice(0, index),\n { ...state.initiatedFlow.issued_outputs[index], ...action.attrs },\n ...state.initiatedFlow.issued_outputs.slice(index + 1),\n ];\n return { ...state, initiatedFlow: { ...state.initiatedFlow, issued_outputs: outputsDupe } };\n case Constants.SUBPROCESS_REQUIREMENT_UPDATED:\n index = findIndex(state.initiatedFlow.subprocess_requirements, { id: action.attrs.id });\n const subprocessReqDupe = [\n ...state.initiatedFlow.subprocess_requirements.slice(0, index),\n { ...state.initiatedFlow.subprocess_requirements[index], ...action.attrs },\n ...state.initiatedFlow.subprocess_requirements.slice(index + 1),\n ];\n return { ...state, initiatedFlow: { ...state.initiatedFlow, subprocess_requirements: subprocessReqDupe } };\n case Constants.ADVANCE_ATTEMPTED:\n return { ...state, attemptedAdvance: true };\n case Constants.SYNC_ATTACHMENTS:\n return { ...state, initiatedFlow: { ...state.initiatedFlow, person_attachments: action.attachments }}\n case Constants.SET_ATTACHMENTS_REFRESHED:\n return { ...state, refreshingAttachments: false, reviewSubmitted: false };\n case Constants.APPLICANT_LIST_UPDATED:\n if (action.saved) {\n state.initiatedFlow.applicant_attachments.push(action.applicant);\n } else {\n state.initiatedFlow.applicant_attachments = reject(state.initiatedFlow.applicant_attachments, { id: action.applicant.id });\n }\n return { ...state };\n case Constants.PRIMARY_APPLICANT_CHANGED:\n state.initiatedFlow.applicant_attachments = map(state.initiatedFlow.applicant_attachments, (applicant) => {\n const a = { ...applicant };\n a.is_primary = a.id === action.applicant.id;\n return a;\n });\n return { ...state };\n default:\n throw new Error(`${action.type}`);\n }\n}\n\nexport default initiatedFlowReducer;\n","import keyMirror from 'keymirror'\n\nexport default keyMirror({\n\t'LOADED': null,\n\t'UPDATED': null,\n\t'CREATED': null,\n\t'DESTROYED': null,\n\t'COMMENT_ADDED': null,\n\t'COMMENT_DELETED': null,\n}, 'DISCUSSION');\n","import DiscussionConstants from 'constants/discussion-constants';\nimport { findIndex, reject } from 'underscore';\n\nfunction discussionReducer(state, action) {\n let index = null;\n\n switch (action.type) {\n case DiscussionConstants.LOADED:\n return { discussions: action.discussions };\n case DiscussionConstants.CREATED:\n return { discussions: [...state.discussions, action.discussion] };\n case DiscussionConstants.UPDATED:\n index = findIndex(state.discussions, { id: action.discussion.id });\n return {\n discussions: [\n ...state.discussions.slice(0, index),\n { ...state.discussions[index], ...action.discussion },\n ...state.discussions.slice(index + 1),\n ],\n };\n case DiscussionConstants.DESTROYED:\n const discussionsDupe = [...state.discussions];\n return { discussions: reject(discussionsDupe, { id: action.discussion.id }) }\n case DiscussionConstants.COMMENT_ADDED:\n index = findIndex(state.discussions, { id: action.discussionComment.discussion_id });\n return {\n discussions: [\n ...state.discussions.slice(0, index),\n { ...state.discussions[index], discussion_comments: [ ...state.discussions[index].discussion_comments, action.discussionComment ] },\n ...state.discussions.slice(index + 1)\n ],\n };\n case DiscussionConstants.COMMENT_DELETED:\n index = findIndex(state.discussions, (d) => {\n return findIndex(d.discussion_comments, { id: action.discussionCommentId }) !== -1;\n });\n const discussionCommentsDupe = [...state.discussions[index].discussion_comments];\n\n return {\n discussions: [\n ...state.discussions.slice(0, index),\n {\n ...state.discussions[index],\n discussion_comments: reject(discussionCommentsDupe, { id: action.DiscussionCommentId }),\n },\n ...state.discussions.slice(index + 1),\n ],\n };\n default:\n throw new Error();\n }\n}\n\nexport default discussionReducer;\n","var DiscussionAPI = {\n\tindex(initiatedFlowId){\n\t\tconst url = '/initiated_flows/' + initiatedFlowId + '/discussions';\n\t\tvar request = $.ajax(url, {\n\t\t\tdataType: 'json',\n\t\t\tmethod: 'GET'\n\t\t});\n\n\t\treturn request;\n\t},\n\n\tcreate(initiatedFlowId, attrs){\n\t\tconst url = '/initiated_flows/' + initiatedFlowId + '/discussions';\n\t\t\n\t\treturn $.ajax(url, {\n\t\t\tdata: {\n\t\t\t\tdiscussion: attrs\n\t\t\t},\n\t\t\tdataType: 'json',\n\t\t\tmethod: 'POST'\n\t\t});\n\t},\n\n\tupdate(discussionId, attrs){\n\t\tconst url = '/discussions/' + discussionId;\n\t\treturn $.ajax(url, {\n\t\t\tdata: {\n\t\t\t\tdiscussion: attrs\n\t\t\t},\n\t\t\tdataType: 'json',\n\t\t\tmethod: 'PUT'\n\t\t});\n\t},\n\n\tresolve(discussionId, resolved){\n\t\tconst url = `/discussions/${discussionId}/resolve`;\n\t\treturn $.ajax(url, {\n\t\t\tdata: {\n\t\t\t\tdiscussion: {\n\t\t\t\t\tresolved: resolved\n\t\t\t\t}\n\t\t\t},\n\t\t\tdataType: 'json',\n\t\t\tmethod: 'POST'\n\t\t});\n\t},\n\n\tdestroy(discussionId){\n\t\tconst url = '/discussions/' + discussionId;\n\n\t\treturn $.ajax(url, {\n\t\t\tmethod: 'DELETE',\n\t\t\tdataType: 'json'\n\t\t});\n\t}\n};\n\nexport default DiscussionAPI;","var DiscussionCommentAPI = {\n\tcreate(discussionId, attrs){\n\t\tconst url = '/discussions/' + discussionId + '/discussion_comments';\n\n\t\treturn $.ajax(url, {\n\t\t\tdataType: 'json',\n\t\t\tmethod: 'POST',\n\t\t\tdata: {\n\t\t\t\tdiscussion_comment: attrs\n\t\t\t}\n\t\t});\n\t},\n\n\tdestroy(disucssionCommentId){\n\t\tconst url = '/discussion_comments/' + disucssionCommentId;\n\n\t\treturn $.ajax(url, {\n\t\t\tdataType: 'json',\n\t\t\tmethod: 'DELETE'\n\t\t});\n\t}\n};\n\nexport default DiscussionCommentAPI;","import NProgress from 'nprogress';\nimport DiscussionConstants from '../constants/discussion-constants';\nimport DiscussionAPI from '../apis/discussion-api';\nimport DiscussionCommentAPI from '../apis/discussion-comment-api';\nimport { success, error } from '../components/shared/flash';\n\nfunction onDiscussionDeleted(dispatch, discussion) {\n success('Discussion deleted');\n\n dispatch({\n type: DiscussionConstants.DESTROYED,\n discussion,\n });\n}\n\nfunction onDiscussionUpdated(dispatch, discussionAttrs) {\n dispatch({\n type: DiscussionConstants.UPDATED,\n discussion: discussionAttrs,\n });\n}\n\nconst DiscussionActions = {\n\n onDiscussionCreate(dispatch, discussion) {\n dispatch({\n type: DiscussionConstants.CREATED,\n discussion,\n });\n },\n\n startDiscussion(dispatch, initiatedFlowId, discussionAttrs) {\n NProgress.start();\n\n return DiscussionAPI.create(initiatedFlowId, discussionAttrs)\n .done((res) => { this.onDiscussionCreate(dispatch, res); })\n .fail(() => { error(); })\n .always(() => { NProgress.done(); });\n },\n\n saveDiscussionComment(dispatch, discussionId, commentBody) {\n const commentAttrs = { body: commentBody };\n return DiscussionCommentAPI.create(discussionId, commentAttrs)\n .done((comment) => {\n dispatch({\n type: DiscussionConstants.COMMENT_ADDED,\n discussionComment: comment,\n });\n })\n .fail(() => { error(); });\n },\n\n deleteDiscussionComment(dispatch, discussionCommentId) {\n return DiscussionCommentAPI.destroy(discussionCommentId)\n .done(() => {\n dispatch({\n type: DiscussionConstants.COMMENT_DELETED,\n discussionCommentId,\n });\n })\n .fail(() => { error(); });\n },\n\n update(dispatch, discussionId, attrs) {\n // Update immediately\n dispatch({\n type: DiscussionConstants.UPDATED,\n discussion: { ...attrs, id: discussionId },\n });\n\n return DiscussionAPI.update(discussionId, attrs)\n .done((res) => { onDiscussionUpdated(dispatch, res); })\n .fail(() => { error(); });\n },\n\n resolve(dispatch, discussionId, resolved) {\n // Update immediately\n dispatch({\n type: DiscussionConstants.UPDATED,\n discussion: {\n id: discussionId,\n resolved,\n },\n });\n\n return DiscussionAPI.resolve(discussionId, resolved)\n .done((res) => { onDiscussionUpdated(dispatch, res); })\n .fail(() => { error(); });\n },\n\n loadDiscussions(initiatedFlowId, dispatch) {\n DiscussionAPI.index(initiatedFlowId)\n .done((res) => {\n dispatch({\n type: DiscussionConstants.LOADED,\n discussions: res,\n });\n })\n .fail(() => { error('Unable to load discussions'); });\n },\n\n deleteDiscussion(dispatch, discussionId) {\n DiscussionAPI.destroy(discussionId)\n .done((res) => { onDiscussionDeleted(dispatch, res); })\n .fail(() => { error(); });\n },\n};\n\nexport default DiscussionActions;\n","\nvar ActiveStepAPI = {\n show(id) {\n const url = `/active_steps/${id}`\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json'\n })\n },\n\n update(id, attrs){\n const url = `/active_steps/${id}`\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n active_step: attrs\n }\n });\n },\n\n waivePayment(id){\n var url = '/active_steps/' + id + '/waive_payment';\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json'\n });\n },\n\n unwaivePayment(id){\n var url = '/active_steps/' + id + '/unwaive_payment';\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json'\n });\n },\n\n receiveCheck(id, paymentAttrs){\n var url = '/active_steps/' + id + '/receive_check';\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n check_paid_amount: paymentAttrs.amount,\n check_number: paymentAttrs.checkNumber\n }\n });\n },\n\n receiveCash(id, amount){\n var url = '/active_steps/' + id + '/receive_cash';\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n cash_paid_amount: amount\n }\n });\n },\n\n removeCheckPayment(id){\n var url = '/active_steps/' + id + '/remove_check_payment';\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json'\n });\n },\n\n removeCashPayment(id){\n var url = '/active_steps/' + id + '/remove_cash_payment';\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json'\n });\n }\n};\n\nexport default ActiveStepAPI;\n","import { createContext } from 'react';\n\nconst DiscussionDispatchContext = createContext();\n\nexport default DiscussionDispatchContext;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { isFunction } from 'underscore';\nimport { CSSTransition } from 'react-transition-group';\nimport XClose from 'components/shared/x-close';\n\nclass AdminNotif extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n open: true,\n };\n }\n\n onCloseClick = () => {\n if (isFunction(this.props.onCloseClick)) {\n this.props.onCloseClick();\n } else {\n this.setState({\n open: false,\n });\n }\n };\n\n render() {\n const { children } = this.props;\n const { open } = this.state;\n\n return (\n <CSSTransition\n classNames='adminnotif'\n timeout={250}\n in={open}\n mountOnEnter\n unmountOnExit\n >\n <div className={`adminnotif ${this.props.type}`}>\n {children}\n <XClose label='Close notification' onClick={this.onCloseClick} />\n </div>\n </CSSTransition>\n );\n }\n}\n\nAdminNotif.propTypes = {\n children: PropTypes.node,\n onCloseClick: PropTypes.func,\n type: PropTypes.string,\n};\n\nAdminNotif.defaultProps = {\n type: '',\n};\n\nexport default AdminNotif;\n","const SurveySubmissionAPI = {\n create: function(surveyId, surveyToken, data){\n const URL = '/survey_submissions';\n\n return $.ajax(URL, {\n method: 'POST',\n dataType: 'json',\n data: {\n survey_token: surveyToken,\n survey_submission: {\n survey_id: surveyId,\n collected_data_attributes: data.collectedDataAttrs,\n email: data.email\n }\n }\n });\n },\n\n update: function(submissionToken, data){\n const URL = `/survey_submissions/${submissionToken}`;\n\n return $.ajax(URL, {\n method: 'PUT',\n dataType: 'json',\n data: {\n survey_submission: {\n collected_data_attributes: data.collectedDataAttrs,\n email: data.email\n }\n }\n });\n },\n\n fetchData(surveySubmissionId){\n const url = `/survey_submissions/${surveySubmissionId}/fetch_data`;\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json'\n });\n },\n\n destroy: function(id){\n const url = `/survey_submissions/${id}`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n }\n};\n\nexport default SurveySubmissionAPI;\n","function postData(emailsOrFile, message){\n let formData = new FormData();\n\n formData.append('message', message);\n\n switch(typeof emailsOrFile){\n case 'string': {\n let emails = emailsOrFile;\n formData.append('emails', emails);\n break;\n }\n\n case 'object': {\n let file = emailsOrFile;\n formData.append('upload', file, file.name);\n break;\n }\n\n default:\n throw `Unhandled input type ${typeof emailsOrFile}`;\n }\n\n return formData;\n}\n\nconst SurveyInvitationsAPI = {\n doSend: function(surveyToken, emails, message){\n const URL = `/survey_invitations/${surveyToken}/do_send`;\n\n return $.ajax(URL, {\n method: 'POST',\n contentType: false,\n processData: false,\n data: postData(emails, message)\n });\n },\n\n remind: function(surveyInvitationId){\n const URL = `/survey_invitations/${surveyInvitationId}/remind`;\n\n return $.ajax(URL, {\n method: 'post',\n dataType: 'json'\n });\n },\n\n remindAll: function(activeStepId){\n const URL = `/active_steps/${activeStepId}/survey_invitations/remind_all`;\n\n return $.ajax(URL, {\n method: 'post',\n dataType: 'json'\n });\n }\n};\n\nexport default SurveyInvitationsAPI;\n","import { error, success } from '../components/shared/flash';\nimport Constants from '../constants/survey-submission-constants';\nimport { alert } from '../modules/alert-confirm';\nimport SurveySubmissionAPI from '../apis/survey-submission-api';\nimport SurveyInvitationsAPI from '../apis/survey-invitations-api';\n\nconst SurveySubmissionActions = {\n submit(surveyId, surveyToken, data) {\n return SurveySubmissionAPI.create(surveyId, surveyToken, data)\n .done(() => { success('Your response has been submitted'); })\n .fail(() => { error(); });\n },\n\n update(submissionToken, data) {\n return SurveySubmissionAPI.update(submissionToken, data)\n .done(() => { success('Your response has been updated'); })\n .fail(() => { error(); });\n },\n\n destroy(submissionId) {\n const p = $.Deferred();\n\n SurveySubmissionAPI.destroy(submissionId)\n .done(() => {\n p.resolve();\n success('Survey submission deleted');\n })\n\n .fail(() => {\n this.onFail();\n p.reject();\n });\n\n return p;\n },\n\n sendReminder(surveyInvitationId) {\n return SurveyInvitationsAPI.remind(surveyInvitationId)\n .done(() => { success('Reminder sent successfully.'); })\n .fail(() => { error(); });\n },\n\n sendAllReminder(activeStepId) {\n return SurveyInvitationsAPI.remindAll(activeStepId)\n .done(this.onRemindAllComplete)\n .fail(() => { error(); });\n },\n\n onRemindAllComplete() {\n alert('Reminder sent successfully.', 'A reminder was sent to all outstanding invitations. Note that we will not send more than one reminder to a contact every 6 hours.');\n },\n\n dispatchSubmissionDestroyed(dispatch, id) {\n dispatch({\n type: Constants.DESTROYED,\n id,\n });\n },\n};\n\nexport default SurveySubmissionActions;\n","import { useEffect, useRef } from 'react';\n\nfunction usePrevious(value) {\n const ref = useRef();\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref.current;\n}\n\nexport default usePrevious;\n","import FormData from 'form-data';\nimport { isObject } from 'underscore';\nimport AlertConfirm from 'modules/alert-confirm';\nimport { checkForLogin } from 'modules/poll-for-login';\n\nvar CollectedDataAPI = {\n update: function(initiatedFlowId, stepDatumId, newValue, version){\n const url = `/initiated_flows/${initiatedFlowId}/collected_data/create_or_update`;\n const formData = new FormData();\n formData.append('step_datum_id', stepDatumId);\n formData.append('version', version);\n\n if(isObject(newValue)){\n newValue = JSON.stringify(newValue);\n }\n\n formData.append('content', newValue);\n\n const request = $.ajax(url, {\n data: formData,\n dataType: 'json',\n method: 'POST',\n processData: false,\n cache: false,\n contentType: false\n })\n .fail(checkForLogin);\n\n return request;\n },\n\n visualizationData: function(stepDatumId){\n var url = '/step_data/' + stepDatumId + '/collected_data/visualizable';\n var request = $.ajax(url, {\n dataType: 'json',\n method: 'GET'\n });\n\n return request;\n },\n\n deleteAttachedFile: function(fileId){\n var url = '/collected_datum/datum_files/' + fileId;\n var request = $.ajax(url, {\n dataType: 'json',\n method: 'DELETE'\n });\n\n return request;\n },\n\n s3Preauth: function(){\n var url = '/collected_datum/s3_preauth';\n var request = $.ajax(url, {\n dataType: 'json',\n method: 'POST'\n });\n\n return request;\n }\n};\n\nexport default CollectedDataAPI;\n","const jsonResponseMessage = function (response) {\n return response.responseJSON ? response.responseJSON : response.statusText;\n};\n\nexport default jsonResponseMessage;\n","import FlowConstants from '../constants/initiated-flow-constants';\nimport CollectedDataAPI from '../apis/collected-data-api';\nimport ActiveStepConstants from '../constants/active-step-constants';\nimport { error } from '../components/shared/flash';\nimport jsonResponseMessage from '../modules/json-response-message';\n\nconst CollectInfoStepActions = {\n dataChanged(dispatch, stepDatumId, initiatedFlowId, newValue, version) {\n dispatch({\n type: FlowConstants.COLLECTED_DATA_CHANGED,\n stepDatumId,\n newValue,\n });\n\n this.sync(dispatch, stepDatumId, initiatedFlowId, newValue, version);\n },\n\n sync(dispatch, stepDatumId, initiatedFlowId, newValue, version) {\n const ajaxRequest = CollectedDataAPI.update(initiatedFlowId, stepDatumId, newValue, version);\n ajaxRequest.done(() => {\n dispatch({\n type: ActiveStepConstants.CHANGES_PERSISTED,\n });\n });\n\n ajaxRequest.fail((response) => {\n dispatch({\n type: FlowConstants.COLLECTED_DATA_ERROR,\n stepDatumId,\n });\n\n const message = jsonResponseMessage(response);\n\n error(message);\n });\n },\n\n dispatchDataWillChange(dispatch) {\n dispatch({\n type: FlowConstants.COLLECTED_DATA_WILL_CHANGE,\n });\n },\n\n dispatchFileDeleted(dispatch, stepDatumId, fileId) {\n dispatch({\n type: FlowConstants.DELETE_ATTACHED_FILE,\n stepDatumId,\n fileId,\n });\n },\n\n deleteAttachedFile(fileId) {\n return CollectedDataAPI.deleteAttachedFile(fileId)\n .fail((response) => {\n const message = jsonResponseMessage(response);\n\n error(message);\n });\n },\n};\n\nexport default CollectInfoStepActions;\n","import React, { useState } from 'react';\nimport DatePicker from 'react-datepicker';\nimport { formatIncoming, formatOutgoing, dateFormats } from 'modules/date-formatter';\nimport { isFunction } from 'underscore';\n\nconst DateRangeSelector = (props) => {\n const startDate = formatIncoming(props.startDate);\n const endDate = formatIncoming(props.endDate);\n\n const [ignoreClose, setIgnoreClose] = useState(!props.isStart);\n\n const onSelect = (date) => {\n props.onDateChange(formatOutgoing(date, props.type));\n };\n\n const handleOnBlur = () => {\n if (isFunction(props.onBlur)) {\n props.onBlur();\n }\n };\n\n const onClose = () => {\n if (!ignoreClose) {\n document.getElementById(props.endId).focus();\n }\n\n setIgnoreClose(!props.isStart);\n };\n\n const onClickOutside = () => {\n setIgnoreClose(true);\n };\n\n return (\n <DatePicker\n ref={props.innerRef}\n id={props.id}\n onBlur={handleOnBlur}\n selected={formatIncoming(props.value, props.type)}\n selectsStart={props.isStart}\n selectsEnd={!props.isStart}\n className={props.className}\n onCalendarClose={onClose}\n onClickOutside={onClickOutside}\n onChange={onSelect}\n dateFormat={dateFormats(props.type)}\n placeholderText='All Dates'\n showTimeSelect={props.type !== 'date'}\n showTimeSelectOnly={props.type === 'time'}\n timeIntervals={15}\n showMonthDropdown\n showYearDropdown\n dropdownMode='select'\n startDate={props.type === 'time' ? null : startDate}\n endDate={props.type === 'time' ? null : endDate}\n />\n );\n};\n\nexport default DateRangeSelector;\n","import API from '../apis/active-step-api';\nimport Constants from '../constants/active-step-constants';\n\nconst ActiveStepActions = {\n updateCurrentActiveStep(dispatch, activeStepId, attrs) {\n dispatch({\n type: Constants.CURRENT_ACTIVE_STEP_UPDATED,\n attrs,\n });\n\n return API.update(activeStepId, attrs)\n .done((res) => {\n dispatch({\n type: Constants.CURRENT_ACTIVE_STEP_UPDATED,\n attrs: res,\n });\n });\n },\n\n update(dispatch, activeStepId, attrs) {\n const attrsForDispatch = { ...attrs };\n if (attrsForDispatch.locked_fields) {\n attrsForDispatch.locked_fields = JSON.parse(attrs.locked_fields);\n }\n\n dispatch({\n type: Constants.UPDATED,\n activeStepId,\n attrs: attrsForDispatch,\n });\n\n return API.update(activeStepId, attrs)\n .done((res) => {\n dispatch({\n type: Constants.UPDATED,\n activeStepId,\n attrs: res,\n });\n });\n },\n};\n\nexport default ActiveStepActions;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst CreateButton = ({\n customEntity, createNewEntity,\n}) => {\n return (\n <div className='border-top padding-top text-center'>\n or <a className='secondary clickable' href='#' onClick={createNewEntity}>Create a new {customEntity.name}</a>\n </div>\n );\n};\n\nCreateButton.propTypes = {\n customEntity: PropTypes.shape({}).isRequired,\n createNewEntity: PropTypes.func,\n};\n\nCreateButton.defaultProps = {\n createNewEntity: () => {},\n};\n\nexport default CreateButton;\n","const titleize = (value) => {\n if (!value) { return ''; }\n\n return value.replace(/_/g, ' ');\n};\n\nexport default titleize;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { map } from 'underscore';\nimport titleize from '../../../../modules/titleize';\n\nconst SearchResult = ({\n result,\n onSelectEntityClick,\n isEsri,\n}) => {\n const renderEsriRestult = () => {\n return map(result, (val, key) => {\n return (\n <li>\n <span className='strong'>{titleize(key)}: </span>\n <span className='entityinput-resultvalue'>{val}</span>\n </li>\n );\n });\n };\n\n const renderStandardResult = () => {\n return (\n <>\n <li>\n <span className='strong'>{result.name}</span>\n </li>\n {result.fields.map((field) => {\n return (\n <li key={field.slug}>\n <span className='strong'>{titleize(field.name)}: </span>\n <span id={field.slug} className='entityinput-resultvalue'>{field.value}</span>\n </li>\n );\n })}\n </>\n );\n };\n\n return (\n <li key={result.id} className='border-bottom padding-bottom margin-bottom'>\n <button className='entityinput-button' onClick={onSelectEntityClick(result.id)} type='button'>\n <ul>\n {isEsri ? renderEsriRestult() : renderStandardResult()}\n </ul>\n </button>\n </li>\n );\n};\n\nSearchResult.propTypes = {\n result: PropTypes.shape({\n id: PropTypes.string.isRequired,\n fields: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n }).isRequired,\n searchTerm: PropTypes.string.isRequired,\n onSelectEntityClick: PropTypes.func.isRequired,\n};\n\nexport default SearchResult;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport SearchResult from './search-result';\n\nconst SearchResults = ({\n searchResults,\n customEntity,\n onSelectEntityClick,\n searchTerm,\n}) => {\n if (!searchResults) {\n return (\n <div className='padding-top-less padding-bottom-less color-alert'>Sorry, no {customEntity.name} matches.</div>\n );\n }\n\n return (\n <ul className='entityinput-searchresults padding-top'>\n {searchResults.map((result) => {\n return (\n <SearchResult\n result={result}\n resultType={customEntity.type}\n onSelectEntityClick={onSelectEntityClick}\n searchTerm={searchTerm}\n isEsri={customEntity.type === 'EsriCustomEntity'}\n />\n );\n })}\n </ul>\n );\n};\n\nSearchResults.propTypes = {\n searchResults: PropTypes.arrayOf(PropTypes.shape({})),\n customEntity: PropTypes.shape({\n type: PropTypes.string.isRequired,\n }).isRequired,\n onSelectEntityClick: PropTypes.func,\n searchTerm: PropTypes.string,\n};\n\nSearchResults.defaultProps = {\n onSelectEntityClick: () => {},\n};\n\nexport default SearchResults;\n","import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport EntityActions from 'actions/entity-actions';\nimport CreateButton from './create-button';\nimport SearchResults from './search-results';\nimport { error } from '../../flash';\n\nconst EntitySelector = ({\n customEntity,\n required,\n stepDatumId,\n canCreateNewEntity,\n onSelectEntityClick,\n createNewEntity,\n initiatedFlowId,\n fieldValue,\n disabled\n}) => {\n const [searchResults, setSearchResults] = useState(null);\n const [searchTerm, setSearchTerm] = useState();\n\n useEffect(() => {\n setSearchResults([]);\n }, [fieldValue]);\n\n function enterSearch(e) {\n if (e.key === 'Enter' || e.keycode === 13) { \n fetchEntities();\n }\n }\n\n const fetchEntities = () => {\n setSearchResults([]);\n EntityActions.search(initiatedFlowId, stepDatumId, searchTerm)\n .done((results) => {\n setSearchResults(results.length !== 0 ? results : null);\n })\n .fail(() => {\n error('Unable to fetch entities. If this problem persists, please open a discussion.');\n });\n };\n\n return (\n <div className='entityinput-search raised margin-bottom padded'>\n <div className='margin-bottom color-text-medium' id={`entity-search-label-${stepDatumId}`}>{`Search for an existing ${customEntity.name}`}</div>\n <div>\n <input\n placeholder={`Type a ${customEntity.name} name or identifier...`}\n type='text'\n aria-labelledby={`entity-search-label-${stepDatumId}`}\n aria-required={required}\n value={searchTerm}\n onKeyUp={enterSearch}\n onChange={(e) => { return setSearchTerm(e.target.value); }}\n className='box'\n name='entitysearch'\n disabled={disabled}\n />\n <button\n name='entitysearch'\n type='button'\n className='fullwidth btn-secondary'\n onClick={fetchEntities}\n disabled={disabled}\n >\n Search\n </button>\n </div>\n <SearchResults\n customEntity={customEntity}\n searchResults={searchResults}\n onSelectEntityClick={onSelectEntityClick}\n searchTerm={searchTerm}\n />\n {!disabled && canCreateNewEntity && (\n <CreateButton\n customEntity={customEntity}\n createNewEntity={createNewEntity}\n />\n )}\n </div>\n );\n};\n\nEntitySelector.propTypes = {\n customEntity: PropTypes.shape({\n name: PropTypes.string,\n }).isRequired,\n required: PropTypes.bool.isRequired,\n stepDatumId: PropTypes.number.isRequired,\n canCreateNewEntity: PropTypes.bool.isRequired,\n onSelectEntityClick: PropTypes.func.isRequired,\n createNewEntity: PropTypes.func.isRequired,\n initiatedFlowId: PropTypes.number.isRequired,\n fieldValue: PropTypes.string.isRequired,\n};\n\nexport default EntitySelector;\n","import React from 'react';\nimport titleize from 'modules/titleize';\n\nconst EntityField = ({\n field,\n newEntity,\n editing,\n entity,\n fieldState,\n dispatch,\n}) => {\n return (\n <li key={field.slug}>\n <label>\n {titleize(field.name)}\n {(newEntity || (editing && (entity.admin || field.edit_suggestable))) ? (\n <input\n key={`edit_${field.slug}`}\n type='text'\n value={fieldState[field.slug]}\n onChange={(e) => {\n dispatch({ type: 'update', field: field.slug, value: e.target.value });\n }}\n name={`entity-${field.slug}`}\n />\n )\n : (\n <input\n key={`read_${field.slug}`}\n type='text'\n readOnly\n tabIndex='-1'\n value={field.value}\n />\n )}\n </label>\n </li>\n );\n};\n\nexport default EntityField;\n","import React from 'react';\n\nconst RemoveEntityButton = (props) => {\n return (\n <button className='btn-link float-right' title={`Remove ${props.name}`} onClick={props.removeEntity}>\n <span className='icon icon-trash-grey bigger' />\n </button>\n )\n}\n\nexport default RemoveEntityButton;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport EntityField from './entity-field';\nimport RemoveEntityButton from './remove-entity-button'\n\nconst SelectedStandardEntity = ({\n entity,\n editing,\n entityName,\n setEntityName,\n customEntity,\n dispatch,\n removeEntity,\n cancelEdit,\n updateEntity,\n suggestEdits,\n edit,\n fieldState,\n disabled,\n}) => {\n const anyEditable: boolean = entity && (entity.admin\n || entity.fields.some((field: { edit_suggestable: boolean }) => { return field.edit_suggestable; }));\n\n const renderEntityField = (field: object): EntityField => {\n return (\n <EntityField\n field={field}\n newEntity={false}\n editing={editing}\n entity={entity}\n fieldState={fieldState}\n dispatch={dispatch}\n />\n );\n };\n\n const renderEntityName = () => {\n if (entity.editable && editing) {\n return (\n <label> \n {`${customEntity.name} Name`}\n <input\n type='text'\n value={entityName}\n onChange={(e) => setEntityName(e.target.value)}\n />\n </label>\n );\n }\n\n return (\n <span>{entity.name}</span>\n );\n };\n\n const renderEditButton = () => {\n if (anyEditable && editing) {\n return (\n <>\n <button\n type='button'\n className='btn-link secondary clickable margin-right-less'\n onClick={cancelEdit}\n >\n Cancel\n </button>\n\n {entity.editable\n ? (\n <button type='button' className='btn-primary margin-left' onClick={updateEntity}>Update</button>\n )\n : (\n <button type='button' onClick={suggestEdits} className='btn-primary margin-left'>Suggest edits</button>\n )}\n </>\n );\n }\n\n return (\n <button\n className='btn-link secondary clickable'\n type='button'\n onClick={edit}\n >\n Edit\n </button>\n );\n };\n\n return (\n <div className='entityinput raised'>\n <div className='entityinput-name'>\n {renderEntityName()}\n {!disabled && <RemoveEntityButton name={customEntity.name} removeEntity={removeEntity} />}\n </div>\n <ul>\n {entity.fields.map(renderEntityField)}\n </ul>\n <div className='align-right'>\n {renderEditButton()}\n </div>\n </div>\n );\n};\n\nSelectedStandardEntity.propTypes = {\n entity: PropTypes.shape({\n fields: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n admin: PropTypes.bool.isRequired,\n editable: PropTypes.bool.isRequired,\n name: PropTypes.string,\n }).isRequired,\n editing: PropTypes.bool.isRequired,\n entityName: PropTypes.string.isRequired,\n setEntityName: PropTypes.func.isRequired,\n customEntity: PropTypes.shape({\n name: PropTypes.string,\n }).isRequired,\n removeEntity: PropTypes.func.isRequired,\n cancelEdit: PropTypes.func.isRequired,\n updateEntity: PropTypes.func.isRequired,\n suggestEdits: PropTypes.func.isRequired,\n edit: PropTypes.func.isRequired,\n fieldState: PropTypes.shape({}).isRequired,\n disabled: PropTypes.bool,\n};\n\nexport default SelectedStandardEntity;\n","import React, { FunctionComponent } from 'react';\nimport Map from './map';\nimport InlineNotification from '../../inline-notification';\nimport RemoveEntityButton from './remove-entity-button';\n\ntype SelectedEsriEntityProps = {\n entity: {\n field_data: object;\n feature: {\n geometry: any;\n };\n esri_unique_id: string;\n };\n removeEntity: () => void;\n customEntity: {\n name: string;\n };\n disabled: any;\n}\n\nconst SelectedEsriEntity: FunctionComponent<SelectedEsriEntityProps> = ({\n entity,\n removeEntity,\n customEntity,\n disabled,\n}: SelectedEsriEntityProps) => {\n const renderEsriFields = () => {\n return Object.entries(entity.field_data).map(([key, val]) => {\n return (\n <li>\n <label>\n {key}\n </label>\n {val}\n </li>\n );\n });\n };\n\n return (\n <div className='entityinput raised'>\n <div className='entityinput-name'>\n {!disabled && <RemoveEntityButton name={customEntity.name} removeEntity={removeEntity} />}\n </div>\n\n {!!entity.field_data ? (\n <>\n <ul>\n {renderEsriFields()}\n </ul>\n <Map feature={entity.feature} />\n </>\n ) : (\n <InlineNotification>\n {`Remote entity (${customEntity.name} ${entity.esri_unique_id}) not found. It may have been deleted, or there may be an issue connecting to ESRI.`}\n </InlineNotification>\n )}\n\n </div>\n );\n};\n\nexport default SelectedEsriEntity;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport EntityField from './entity-field';\n\nconst NewEntity = ({\n setEntityName,\n entityName,\n customEntity,\n entityTemplateFields,\n cancelNewEntity,\n createEntity,\n creatingEntity,\n fieldState,\n dispatch,\n}) => {\n const renderEntityField = (field) => {\n return (\n <EntityField\n field={field}\n newEntity\n editing={false}\n fieldState={fieldState}\n dispatch={dispatch}\n />\n );\n };\n\n return (\n <div className='entityinput raised'>\n <label> Name\n <input type='text' onChange={(e) => setEntityName(e.target.value)} value={entityName} placeholder={`Enter ${customEntity.name} name`} />\n </label>\n <ul>\n {entityTemplateFields.map(renderEntityField)}\n </ul>\n <div className='align-right'>\n <button type='button' className='btn-link margin-right' onClick={cancelNewEntity}>Cancel</button>\n <button type='button' name='saveentity' onClick={createEntity} disabled={creatingEntity}>Save {customEntity.name}</button>\n </div>\n </div>\n );\n};\n\nNewEntity.propTypes = {\n setEntityName: PropTypes.func.isRequired,\n entityName: PropTypes.string,\n customEntity: PropTypes.shape({\n name: PropTypes.string,\n }).isRequired,\n entityTemplateFields: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n cancelNewEntity: PropTypes.func.isRequired,\n createEntity: PropTypes.func.isRequired,\n creatingEntity: PropTypes.bool.isRequired,\n fieldState: PropTypes.shape({}).isRequired,\n};\n\nexport default NewEntity;\n","import React, { useState, useEffect, useReducer, useMemo } from 'react';\nimport EntityActions from 'actions/entity-actions';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport PropTypes from 'prop-types';\nimport { error as flashError } from 'components/shared/flash';\nimport EntitySelector from './entity-input/entity-selector';\nimport SelectedStandardEntity from './entity-input/selected-standard-entity';\nimport SelectedEsriEntity from './entity-input/selected-esri-entity';\nimport NewEntity from './entity-input/new-entity';\n\n\nconst fieldReducer = (state, action) => {\n switch (action.type) {\n case 'update':\n return { ...state, [action.field]: action.value };\n case 'reset':\n return action.newState;\n default:\n return state;\n }\n};\n\nconst getEntityFields = (entity) => Object.fromEntries(\n entity.fields.map((field) => [field.slug, field.value]),\n);\n\n\nconst EntityInput = ({\n fieldValue, initiatedFlowId, onChange,\n stepDatumId, entityTemplateFields, canCreateNewEntity, required, customEntity, disabled\n}) => {\n const [fetchingEntity, setFetchingEntity] = useState(false);\n const [editing, setEditing] = useState(false);\n const [entityName, setEntityName] = useState();\n const [entity, setEntity] = useState();\n const [creatingNewEntity, setCreatingNewEntity] = useState(false);\n const [fieldState, dispatch] = useReducer(fieldReducer, {});\n const [creatingEntity, setCreatingEntity] = useState(false);\n\n useEffect(() => {\n const fieldValueAbsent = !fieldValue || fieldValue === '';\n if (!fieldValueAbsent) {\n setFetchingEntity(true);\n EntityActions.getEntity(fieldValue, initiatedFlowId)\n .done(setEntity)\n .fail(() => { flashError('Cannot load entity information. Refreshing may help.'); })\n .always(() => {\n setFetchingEntity(false);\n });\n } else {\n setEntity(null);\n dispatch({ type: 'reset', newState: {} });\n }\n setCreatingNewEntity(false);\n setEditing(false);\n }, [fieldValue]);\n\n // Update the entity name when the entity changes\n useEffect(() => {\n if (entity && !entityIsEsri) {\n // Might push this up into the above.\n setEntityName(entity.name);\n dispatch({ type: 'reset', newState: getEntityFields(entity) });\n }\n }, [entity, customEntity.type]);\n\n const entityIsEsri = useMemo(() => {\n return customEntity.type === 'EsriCustomEntity';\n }, [customEntity.type]);\n\n const onSelectEntityClick = (resultId) => (e) => {\n e.preventDefault();\n if (entityIsEsri) {\n doCreateNewEsriEntity(resultId);\n } else {\n onChange(resultId);\n }\n };\n\n const removeEntity = () => {\n onChange('');\n };\n\n const entityValues = () => {\n return {\n name: entityName,\n custom_entity_field_values: fieldState,\n };\n };\n\n const updateEntity = () => {\n EntityActions.update(entity.id, entityValues()).done((thisEntity) => {\n setEditing(false);\n setEntity(thisEntity);\n });\n };\n\n const doCreateNewEsriEntity = (esriUniqueId) => {\n EntityActions.createEsriEntity(esriUniqueId,\n initiatedFlowId,\n stepDatumId)\n .done((res) => { return onChange(res.id); });\n };\n\n const doCreateNewEntity = () => {\n setCreatingEntity(true);\n EntityActions.createEntity(entityValues(), initiatedFlowId, stepDatumId)\n .done((res) => { return onChange(res.id); })\n .always(() => setCreatingEntity(false));\n };\n\n const suggestEdits = () => {\n const entityFieldMap = Object.fromEntries(\n entity.fields.map((field) => { return [field.slug, field]; }),\n );\n const suggestions = Object.entries(fieldState)\n // Filter out the values that haven't changed\n .filter(([slug, value]) => { return value !== entityFieldMap[slug].value; })\n .map(([slug, value]) => { return { field_id: entityFieldMap[slug].id, content: value }; });\n\n if (suggestions.length === 0) { return; }\n\n EntityActions.suggestEdits(entity.id, suggestions)\n .done(() => { return setEditing(false); });\n };\n\n const onCreateNewEntityClick = (e) => {\n e.preventDefault();\n\n setCreatingNewEntity(true);\n };\n\n const cancelNewEntity = () => {\n setCreatingNewEntity(false);\n };\n\n const edit = (e) => {\n e.preventDefault();\n\n setEditing(true);\n };\n\n const cancelEdit = (e) => {\n e.preventDefault();\n\n setEditing(false);\n };\n\n if (fetchingEntity) {\n return <LoadingSpinner size='medium' />;\n }\n\n if (entity) {\n if (entityIsEsri) {\n return (\n <SelectedEsriEntity\n entity={entity}\n removeEntity={removeEntity}\n customEntity={customEntity}\n disabled={disabled}\n />\n );\n }\n\n return (\n <SelectedStandardEntity\n entity={entity}\n editing={editing}\n entityName={entityName}\n setEntityName={setEntityName}\n customEntity={customEntity}\n removeEntity={removeEntity}\n cancelEdit={cancelEdit}\n updateEntity={updateEntity}\n suggestEdits={suggestEdits}\n edit={edit}\n fieldState={fieldState}\n dispatch={dispatch}\n disabled={disabled}\n />\n );\n }\n\n if (creatingNewEntity) {\n return (\n <NewEntity\n setEntityName={setEntityName}\n entityName={entityName}\n customEntity={customEntity}\n entityTemplateFields={entityTemplateFields}\n cancelNewEntity={cancelNewEntity}\n createEntity={doCreateNewEntity}\n creatingEntity={creatingEntity}\n fieldState={fieldState}\n dispatch={dispatch}\n />\n );\n }\n\n return (\n <EntitySelector\n disabled={disabled}\n initiatedFlowId={initiatedFlowId}\n customEntity={customEntity}\n onSelectEntityClick={onSelectEntityClick}\n required={required}\n stepDatumId={stepDatumId}\n canCreateNewEntity={canCreateNewEntity}\n createNewEntity={onCreateNewEntityClick}\n fieldValue={fieldValue}\n doCreateNewEntity={doCreateNewEntity}\n />\n );\n};\n\nEntityInput.propTypes = {\n canCreateNewEntity: PropTypes.bool,\n customEntity: PropTypes.shape({\n type: PropTypes.string.isRequired,\n esri_unique_id: PropTypes.string,\n }),\n entityTemplateFields: PropTypes.arrayOf(PropTypes.shape({})),\n fieldValue: PropTypes.string,\n initiatedFlowId: PropTypes.number.isRequired,\n onChange: PropTypes.func.isRequired,\n required: PropTypes.bool.isRequired,\n stepDatumId: PropTypes.number.isRequired,\n};\n\nexport default EntityInput;\n","const AddressValidatorAPI = {\n validateAddress(address) {\n const url = '/address/validate';\n const request = $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n address\n }\n });\n\n return request;\n }\n};\n\nexport default AddressValidatorAPI;\n","import SmartyStreetsSDK from 'smartystreets-javascript-sdk';\n\nconst SmartyStreetsCore = SmartyStreetsSDK.core;\nconst { Lookup } = SmartyStreetsSDK.usAutocompletePro;\n\nclass SmartyStreetsClient {\n constructor() {\n if (!CityGrows.Server.websiteKey) {\n throw 'Smarty streets website key missing';\n }\n\n const credentials = new SmartyStreetsCore.SharedCredentials(CityGrows.Server.websiteKey);\n let clientBuilder = new SmartyStreetsCore.ClientBuilder(credentials).withLicenses([\"us-autocomplete-pro-cloud\"])\n\n this.client = clientBuilder.buildUsAutocompleteProClient();\n }\n\n getSuggestions(address) {\n if (address.length < 1) {\n const response = $.Deferred();\n return response.resolve({ result: [] });\n }\n\n const lookup = new Lookup(address);\n lookup.source = 'all';\n return this.client.send(lookup);\n }\n}\n\nexport default SmartyStreetsClient;\n","import React from 'react';\n\nconst AutocompleteSuggestions = props => {\n if (props.userInput.length > 0) {\n return (\n <ul className={[props.className, 'optionlist'].join(' ')}>\n {props.suggestions.map((suggestion, index) => (\n <li key={index}>\n <a\n className=\"block\"\n tabIndex=\"0\"\n onKeyPress={e => props.onKeyPress(e.key, suggestion)}\n onClick={() => props.onClick(suggestion)}\n >\n {suggestion}\n </a>\n </li>\n ))}\n\t\t\t\t<li className='addressinput-usecustom' key='userInput'>\n\t\t\t\t\t<a className=\"block\"\n\t\t\t\t\t\t tabIndex=\"0\"\n\t\t\t\t\t\t onKeyPress={e => props.onKeyPress(e.key, props.userInput)}\n\t\t\t\t\t\t onClick={() => props.onClick(props.userInput)}>\n\n\t\t\t\t\t\tUse {props.userInput}\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n </ul>\n );\n } else {\n return null;\n }\n};\n\nexport default AutocompleteSuggestions;\n","import React from 'react';\n\nclass AddressOption extends React.Component {\n render() {\n let buttonClass = 'btn-thirdary';\n let buttonText = 'Use Submitted Address';\n let labelText = 'Submitted Address:';\n\n if (this.props.suggested) {\n buttonClass = 'btn-primary';\n buttonText = 'Use Suggested Address';\n labelText = 'Suggested Address:';\n }\n\n return (\n <div className='addressinput-option border-bottom'>\n <div className='addressinput-text'>\n <div className='bold'>\n {labelText}\n </div>\n <div>\n {this.props.value}\n </div>\n </div>\n <div className='addressinput-button align-right padded-less'>\n <button onClick={(e) => this.props.onSelect(this.props.value)} className={`${buttonClass} btn-medium`}>\n {buttonText}\n </button>\n </div>\n </div>\n );\n }\n}\n\nexport default AddressOption;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport AddressValidatorAPI from 'apis/address-validator-api';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\nimport SmartyStreetsClient from 'modules/smarty-streets-client';\nimport _ from 'underscore';\nimport AutocompleteSuggestions from './autocomplete-suggestions';\nimport AddressOption from './address-option';\n\nclass AddressValidator extends React.Component {\n constructor(props) {\n super(props);\n\n this.input = React.createRef();\n\n this.getSuggestions = _.debounce(this.getSuggestions, 250);\n\n this.state = {\n addressSuggestions: [],\n validatedAddresses: [],\n userInputtedAddress: this.props.defaultValue,\n errors: null,\n searched: false,\n fetching: false,\n autocompleteRequestNumber: 0,\n };\n }\n\n componentDidMount() {\n this.focusInputAndSelect();\n this.smartyStreetsClient = new SmartyStreetsClient();\n }\n\n focusInputAndSelect = () => {\n this.input.focus();\n this.input.select();\n };\n\n onClose = () => {\n this.props.handleCancel();\n };\n\n hasValidatedAddresses() {\n return this.state.validatedAddresses.length > 0;\n }\n\n handleAddressSelect = (address) => {\n this.setState({ userInputtedAddress: address }, () => this.validateAddress());\n };\n\n handleKeyPress = (key, address) => {\n if (key === 'Enter') {\n this.handleAddressSelect(address);\n }\n };\n\n getSuggestions(requestNumber) {\n this.smartyStreetsClient.getSuggestions(this.state.userInputtedAddress)\n .then((res) => { this.resolveAddressSuggestions(res, requestNumber); })\n .catch(this.handleSuggestionError);\n }\n\n handleChange = () => {\n const requestNumber = this.state.autocompleteRequestNumber + 1;\n\n this.setState({ userInputtedAddress: this.input.value, autocompleteRequestNumber: requestNumber }, this.getSuggestions(requestNumber));\n };\n\n handleSuggestionError = (res) => {\n if (CityGrows.Server.env == 'development') {\n console.log(res.error);\n } else {\n Rollbar.error('AddressSuggestionsError', res.error);\n }\n };\n\n goBack = (e) => {\n e.preventDefault();\n\n this.setState({\n addressSuggestions: [],\n validatedAddresses: [],\n errors: null,\n searched: false,\n fetching: false,\n }, this.focusInputAndSelect);\n };\n\n validateAddress() {\n this.setState({ fetching: true, addressSuggestions: [] });\n AddressValidatorAPI.validateAddress(this.state.userInputtedAddress).done(\n (res) => {\n this.resolveAddressValidation(res);\n },\n );\n }\n\n resolveAddressSuggestions(response, requestNumber) {\n if (requestNumber < this.state.autocompleteRequestNumber) {\n return;\n }\n\n let addressSuggestions = [];\n if (response.result.length > 0) {\n addressSuggestions = response.result.map((r) => {\n return `${r.streetLine} ${r.secondary} ${r.city} ${r.state} ${r.zipcode}`\n })\n }\n\n this.setState({ addressSuggestions });\n }\n\n resolveAddressValidation(response) {\n let validatedAddresses = [];\n let selected = 'original';\n\n if (response.results.length > 0) {\n validatedAddresses = response.results;\n selected = 'suggested_0';\n }\n\n this.setState({\n validatedAddresses,\n searched: true,\n errors: response.error,\n selected,\n fetching: false,\n });\n }\n\n renderInput() {\n return (\n <>\n <div className='addressinput-searchinput'>\n <label>Search</label>\n <input\n className='padded-less'\n ref={(input) => { this.input = input; }}\n type='text'\n defaultValue={this.state.userInputtedAddress}\n onKeyPress={(e) => this.handleKeyPress(e.key, this.state.userInputtedAddress)}\n onChange={this.handleChange}\n placeholder='Type an Address...'\n />\n </div>\n\n <AutocompleteSuggestions\n className='addressinput-suggestions'\n userInput={this.state.userInputtedAddress ? this.state.userInputtedAddress : ''}\n suggestions={this.state.addressSuggestions}\n onKeyPress={this.handleKeyPress}\n onClick={this.handleAddressSelect}\n />\n\n </>\n );\n }\n\n renderWait() {\n return (\n <div className='padded align-center'>\n <div className='progress'>\n <div>Loading</div>\n </div>\n </div>\n );\n }\n\n renderContainer() {\n if (!this.state.searched) {\n return this.renderInput();\n } if (this.hasValidatedAddresses()) {\n return this.renderValidatedAddresses();\n }\n return this.noResults();\n }\n\n noResults() {\n let instructions = 'We couldn\\'t find any validated matches for that address. You may use this address anyway if you wish.';\n let backText = 'Use a Different Address';\n if (this.state.errors) {\n instructions = 'We\\'re sorry, the validation attempt failed due to a technical error. You can go back and try again or use your unvalidated address.';\n backText = 'Go Back';\n }\n return (\n <>\n <div className='padded'>{instructions}</div>\n {this.renderSubmittedAddressOption()}\n <div className='align-center padded'>\n <a onClick={this.goBack} href='#'>{backText}</a>\n </div>\n </>\n );\n }\n\n renderSubmittedAddressOption() {\n return (\n <AddressOption\n key='submitted'\n suggested={false}\n value={this.state.userInputtedAddress}\n onSelect={this.props.handleSave}\n />\n );\n }\n\n renderValidatedAddresses() {\n return (\n <>\n {this.state.validatedAddresses.map((address, index) => (\n <AddressOption\n key={index}\n suggested\n value={address}\n onSelect={this.props.handleSave}\n />\n ))}\n {this.renderSubmittedAddressOption()}\n <div className='align-center padded'>\n <a href='#' className='secondary' onClick={this.goBack}>Use a Different Address</a>\n </div>\n </>\n );\n }\n\n render() {\n const content = this.state.fetching\n ? this.renderWait()\n : this.renderContainer();\n return (\n <CloseIfOutsideWrapper onClose={this.onClose}>\n <div className='addressinput-expanded raised'>\n {content}\n </div>\n </CloseIfOutsideWrapper>\n );\n }\n}\n\nAddressValidator.propTypes = {\n handleSave: PropTypes.func.isRequired,\n handleCancel: PropTypes.func.isRequired,\n defaultValue: PropTypes.string,\n};\n\nexport default AddressValidator;\n","import React, { useState, useEffect } from 'react';\nimport AddressValidator from './address_input/address-validator';\n\nconst AddressInput = ({defaultValue, completionBegun, onChange, innerRef, required, disabled, id}) => {\n const [focused, setFocused] = useState(false);\n const [value, setValue] = useState(defaultValue);\n const [initialDefault, setInitialDefault] = useState(defaultValue);\n\n useEffect(() => {\n if (initialDefault !== defaultValue) {\n completionBegun();\n }\n }, [defaultValue, initialDefault]);\n\n function handleFocus() {\n setFocused(true);\n }\n\n function handleSave(address) {\n setFocused(false);\n setValue(address);\n onChange({}, address);\n }\n\n function handleCancel() {\n completionBegun();\n setFocused(false);\n }\n\n if (focused) {\n return (\n <AddressValidator defaultValue={value} handleSave={handleSave} handleCancel={handleCancel} />\n );\n }\n\n return (\n <input\n name='address'\n id={id}\n ref={innerRef}\n aria-required={required}\n onFocus={handleFocus}\n disabled={disabled}\n type='text'\n defaultValue={value}\n autoComplete='new-password'\n />\n );\n};\n\nexport default AddressInput;\n","import React, { useCallback } from \"react\";\nimport { useDropzone } from 'react-dropzone';\n\n\nconst FileDropzone = ({\n onFileAccept,\n width,\n height,\n disabled,\n children,\n inputId,\n}) => {\n const onDropCallback = useCallback((files) => {\n const file = files[0];\n if (file) { onFileAccept(file); }\n }, []);\n\n const {getRootProps, getInputProps} = useDropzone({\n onDrop: onDropCallback,\n multiple: false,\n disabled,\n });\n\n const rootProps = getRootProps({\n style: { width, height, marginBottom: '4px' },\n className: 'file-dropzone',\n });\n\n return (\n <div {...rootProps}>\n <input {...getInputProps()} id={inputId} />\n {children}\n </div>\n );\n};\n\n\nFileDropzone.defaultProps = {\n width: '250px',\n height: '140px',\n};\n\nexport default FileDropzone;\n","import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\nimport CollectedDataAPI from 'apis/collected-data-api';\nimport FormData from 'form-data';\nimport _ from 'underscore';\nimport { render } from 'components/shared/flash';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport FileDropzone from 'components/shared/file-dropzone';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { solid } from '@fortawesome/fontawesome-svg-core/import.macro';\n\nconst FileInput = ({onChange, disabled, id }) => {\n const [uploading, setUploading] = useState(false);\n\n function onFileAccept(file) {\n setUploading(true);\n\n uploadDirectToS3(file)\n .done((url) => onChange(url, file))\n .fail(onUploadError)\n .always(() => setUploading(false));\n }\n\n function onUploadError() {\n render({\n message: 'There was an error uploading your file. Please try again.',\n type: 'error',\n });\n }\n\n function uploadDirectToS3(file) {\n const d = $.Deferred();\n\n fetchPreauth(file.name)\n .done((res) => {\n postToS3(res.url, res.form_data, file)\n .done((s3Res) => {\n const url = findFileURL(s3Res);\n d.resolve(url);\n })\n .fail(d.reject);\n })\n .fail(d.reject);\n\n return d;\n }\n\n function findFileURL(res) {\n const $xml = $(res);\n return $xml.find('Location').text();\n }\n\n function fetchPreauth() {\n return CollectedDataAPI.s3Preauth();\n }\n\n function postToS3(url, authFields, file) {\n const formData = new FormData();\n formData.append('key', authFields.key);\n delete authFields.key;\n _.each(authFields, (k, v) => formData.append(v, k));\n formData.append('file', file);\n\n const request = $.ajax(url, {\n contentType: false,\n data: formData,\n method: 'POST',\n dataType: 'XML',\n processData: false,\n });\n\n return request;\n }\n\n function loadingHTML() {\n return (\n <div className='dropzone-content-container'>\n <LoadingSpinner size='medium' />;\n </div>\n );\n }\n\n function disabledHTML() {\n return (\n <div className='dropzone-content-container'>\n <span className='icon icon-lock biggest' />\n </div>\n );\n }\n\n function blockedContent() {\n if (disabled) { return disabledHTML(); }\n if (uploading) { return loadingHTML(); }\n }\n\n function mainContent() {\n return (\n <div className='dropzone-content-container'>\n <div><FontAwesomeIcon icon={solid('cloud-arrow-up')} size='2xl' style={{ color: '#7d99ac' }} /></div>\n <div>Drag and drop file here</div>\n <div className='padding-top'>\n <hr />\n <div className='inline-block'>or</div>\n <hr />\n </div>\n <div className='padding-top'>Click to browse files</div>\n </div>\n );\n }\n\n function isBlocked() {\n return uploading || disabled;\n }\n\n return (\n <FileDropzone onFileAccept={onFileAccept} disabled={disabled} inputId={id}>\n {isBlocked() ? blockedContent() : mainContent()}\n </FileDropzone>\n );\n};\n\nFileInput.propTypes = {\n disabled: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n};\n\nexport default FileInput;\n","import PropTypes from 'prop-types';\nimport React from 'react';\n\nclass Map extends React.Component {\n constructor(props) {\n super(props);\n this.mapRef = React.createRef();\n }\n\n componentDidMount() {\n this.map = this.initMap();\n this.geocoder = this.initGeocoder();\n this.setPosition();\n this.map.invalidateSize();\n window.invalidate = this.map.invalidateSize;\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.query !== this.props.query) {\n this.setPosition();\n }\n }\n\n initMap = () => {\n const map = L.mapbox.map(this.findMapElement(), 'mapbox.streets', {\n zoom: 15,\n zoomControl: false,\n attributionControl: { compact: false },\n scrollWheelZoom: false,\n });\n\n return map;\n };\n\n initGeocoder = () => {\n return L.mapbox.geocoder('mapbox.places');\n };\n\n setPosition = () => {\n if (this.props.query) {\n this.geocoder.query(this.props.query, this.handleQueryResponse);\n }\n };\n\n handleQueryResponse = (err, data) => {\n if (this.marker) {\n this.map.removeLayer(this.marker);\n }\n\n if (data.latlng && data.latlng.length == 2) {\n this.marker = L.mapbox.featureLayer({\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [\n data.latlng[1],\n data.latlng[0],\n ],\n },\n properties: {\n 'marker-color': '#0277BD',\n },\n }).addTo(this.map);\n\n this.map.panTo(data.latlng);\n this.map.invalidateSize();\n }\n };\n\n isOpen = () => {\n return (!!this.props.query);\n };\n\n findMapElement = () => {\n return this.mapRef.current;\n };\n\n render() {\n const statusClass = (this.isOpen() ? '' : 'closed');\n return (\n <div className={`currentstep-addywrap ${statusClass}`}>\n <div className='currentstep-addymap' ref={this.mapRef} />\n </div>\n );\n }\n}\n\nMap.propTypes = {\n query: PropTypes.string,\n};\n\nexport default Map;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport AlertConfirm from 'modules/alert-confirm';\nimport dayjs from 'dayjs';\nimport truncate from 'truncate';\n\nclass AttachedFile extends React.Component {\n state = {\n deleting: false,\n }; \n\n getUploadedByTagString = () => {\n const { adminUploaded } = this.props;\n if (adminUploaded === undefined || adminUploaded === null) {\n return;\n }\n\n const uploadedBy = adminUploaded ? 'admin' : 'applicant';\n return `(uploaded by ${uploadedBy})`;\n };\n\n onDeleteClick = (e) => {\n e.preventDefault();\n\n if (!this.state.deleting) {\n AlertConfirm.confirm('Delete file?', `Are you sure you want to delete ${this.props.fileName}`, () => {\n this.props.onDeleteClick(this.props.fileId)\n .fail(() => this.setDeletingState(false));\n\n this.setDeletingState(true);\n });\n }\n };\n\n setDeletingState = (boolean) => {\n this.setState({ deleting: boolean });\n };\n\n getTruncatedFileName = () => {\n return truncate(this.props.fileName, 35);\n };\n\n render() {\n return (\n <li>\n <a target='_blank' href={this.props.url} rel='noreferrer'>{this.getTruncatedFileName()}</a>\n { this.props.createdAt && (\n <span className='margin-left color-text-medium'>{dayjs(this.props.createdAt).format('LLL')}</span>\n )}\n <span className='margin-left color-text-medium'>{this.getUploadedByTagString()}</span>\n {this.props.deletable && (\n <button\n className='btn-link margin-left'\n onClick={this.onDeleteClick}\n >\n <span title='Delete File' className='margin-left icon icon-trash-grey bigger clickable'/>\n </button>\n )}\n </li>\n );\n }\n}\n\nAttachedFile.propTypes = {\n deletable: PropTypes.bool.isRequired,\n onDeleteClick: PropTypes.func.isRequired,\n\n url: PropTypes.string.isRequired,\n fileName: PropTypes.string.isRequired,\n};\n\nexport default AttachedFile;\n","import PropTypes from 'prop-types';\nimport React, {\n useState, createRef, useRef, useCallback, useEffect, useMemo, useContext,\n} from 'react';\nimport {\n contains, debounce, isEmpty, without,\n} from 'underscore';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\n\nimport Select from 'components/shared/select';\nimport usePrevious from 'components/hooks/use-previous';\nimport useDerivedState from 'components/hooks/use-derived-state';\nimport CollectInfoStepActions from 'actions/collect-info-step-actions';\nimport { alert } from 'modules/alert-confirm';\nimport { validate, validateNumberFormat, validateNumberInRange } from 'modules/collected-data-validator';\nimport ErrorMessages from 'constants/error-messages';\nimport DateSelector from 'components/shared/date-selector';\nimport DateRangeSelector from 'components/shared/date-range-selector';\nimport ActiveStepActions from 'actions/active-step-actions';\nimport EntityInput from './input_fields/entity-input';\nimport MoneyInput from './input_fields/money-input';\nimport AddressInput from './input_fields/address-input';\nimport FileInput from './input_fields/file-input';\nimport Map from './input_fields/address_input/map';\nimport AttachedFile from './input_fields/file_input/attached-file';\n\nconst getDebounceIntervalForDatum = (type) => {\n switch (type) {\n case 'address':\n return 1000;\n case 'date':\n return 0;\n case 'text':\n return 4000;\n default:\n return 500;\n }\n};\n\nconst StepDataCollectorInputField = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n const fieldCompletionBegun = () => {\n if (props.stepDatum.data_type === 'file') {\n return props.fieldValue.length > 0;\n }\n return props.fieldValue != null;\n };\n\n const initialStartDate = () => {\n if (props.stepDatum.data_type !== 'date_range' || !props.fieldValue) { return null; }\n\n return props.fieldValue.start_date;\n };\n\n const initialEndDate = () => {\n if (props.stepDatum.data_type !== 'date_range' || !props.fieldValue) { return null; }\n\n return props.fieldValue.end_date;\n };\n\n const ref = createRef();\n\n const submit = props.onInputChanged;\n const debouncedSubmit = useMemo(() => {\n return debounce(props.onInputChanged, getDebounceIntervalForDatum(props.stepDatum.data_type));\n }, [props.stepDatum.data_type]);\n\n const checkboxRefs = useRef([]);\n\n const [beganFieldCompletion, setBeganFieldCompletion] = useState(fieldCompletionBegun);\n const [version, setVersion] = useState(props.version);\n const [valid, setValid] = useState(() => !props.stepDatum.required || validate(props.fieldValue, props.stepDatum));\n // NOTE: it would be better for clarity's sake if this state only referenced one of the props,\n // but it should be okay because once fieldValue is defined, it should take precedence.\n const [localValue, setLocalValue] = useDerivedState(props.fieldValue || props.defaultValue);\n const [startDate, setStartDate] = useState(initialStartDate);\n const [endDate, setEndDate] = useState(initialEndDate);\n\n const onInputChanged = (_e, sentValue, immediately = false) => {\n const findFieldValue = () => {\n const { stepDatum } = props;\n\n switch (stepDatum.data_type) {\n case 'checkboxes': {\n const checkboxElements = stepDatum.multiple_choice_options.map(findCheckbox);\n const values = {};\n\n checkboxElements.forEach((element, idx) => {\n values[stepDatum.multiple_choice_options[idx].id] = element.checked;\n });\n\n return values;\n }\n default: {\n const inputElement = ref.current;\n return inputElement.value;\n }\n }\n };\n\n const value = sentValue === undefined ? findFieldValue() : sentValue;\n validateInput(value);\n submitValue(value, immediately);\n };\n\n useEffect(() => {\n if (!isEmpty(props.defaultValue)) {\n onInputChanged(props.defaultValue);\n }\n }, [onInputChanged, props.defaultValue]);\n\n useEffect(() => {\n if (props.version > version) {\n alert('This page is outdated', 'The information on this page is out of date. Someone else may have updated it. Please refresh the page.');\n }\n }, [props.version, version]);\n\n const prevFieldValue = usePrevious(props.fieldValue);\n\n useEffect(() => {\n if (props.stepDatum.data_type !== 'date_range') { return; }\n if (!props.fieldValue) { return; }\n\n if (!prevFieldValue && props.fieldValue.start_date) {\n return setStartDate(initialStartDate);\n }\n\n if (!prevFieldValue && props.fieldValue.end_date) {\n return setEndDate(initialEndDate);\n }\n\n if (prevFieldValue?.start_date !== props.fieldValue?.start_date) {\n setStartDate(props.fieldValue.start_date);\n }\n\n if (prevFieldValue?.end_date !== props.fieldValue?.end_date) {\n setEndDate(props.fieldValue.end_date);\n }\n }, [prevFieldValue, props.stepDatum.data_type, props.fieldValue]);\n\n useEffect(() => {\n if (!props.stepDatum.data_type === 'file') { return; }\n if (!props.fieldValue || !prevFieldValue) { return; }\n\n if (props.fieldValue.length === 0 && (prevFieldValue.length > 0 || props.version > 1)) {\n setValid(!props.stepDatum.required);\n setBeganFieldCompletion(true);\n }\n }, [prevFieldValue, props.stepDatum.data_type, props.fieldValue]);\n\n const prevAttemptedAdvance = usePrevious(props.attemptedAdvance);\n const prevFirstError = usePrevious(props.firstError);\n\n useEffect(() => {\n const setFocus = () => {\n if (props.stepDatum.data_type === 'date') {\n ref.current.input.focus();\n } else if (ref.current) {\n ref.current.focus();\n }\n };\n\n if ((!prevAttemptedAdvance && props.firstError)\n || (props.attemptedAdvance && props.firstError && !prevFirstError)) {\n setFocus();\n }\n }, [\n prevAttemptedAdvance,\n prevFirstError,\n props.attemptedAdvance,\n props.firstError,\n props.stepDatum.data_type,\n ref,\n ]);\n\n const stepDatumId = () => {\n return `stepdatum-${props.stepDatum.id}`;\n };\n\n const basicInput = (type, placeholder = null) => {\n return (\n <input\n ref={ref}\n id={stepDatumId()}\n onBlur={completionBegun}\n disabled={props.disabled}\n onChange={onInputChanged}\n placeholder={placeholder}\n type={type}\n aria-required={props.stepDatum.required}\n defaultValue={props.fieldValue}\n maxLength={props.stepDatum.max_length}\n />\n );\n };\n\n const inputTagForFieldType = () => {\n switch (props.stepDatum.data_type) {\n case 'string':\n return basicInput('text');\n case 'text':\n return (\n <textarea\n ref={ref}\n id={stepDatumId()}\n onBlur={onTextAreaBlur}\n disabled={props.disabled}\n onChange={onInputChanged}\n aria-required={props.stepDatum.required}\n defaultValue={props.fieldValue}\n maxLength={props.stepDatum.max_length}\n />\n );\n case 'integer':\n return basicInput('text');\n case 'float':\n return basicInput('text');\n case 'money':\n return (\n <MoneyInput\n innerRef={ref}\n id={stepDatumId()}\n onBlur={completionBegun}\n disabled={props.disabled}\n onChange={onInputChanged}\n type='money'\n required={props.stepDatum.required}\n defaultValue={props.fieldValue}\n minValue={props.stepDatum.min_value}\n maxValue={props.max_value}\n />\n );\n case 'phone':\n return basicInput('tel');\n case 'email':\n return basicInput('email', 'awesome@example.com');\n case 'address':\n return (\n <AddressInput\n innerRef={ref}\n id={stepDatumId()}\n completionBegun={completionBegun}\n disabled={props.disabled}\n onChange={onInputChanged}\n required={props.stepDatum.required}\n defaultValue={props.fieldValue}\n />\n );\n case 'file':\n return (\n <FileInput\n innerRef={ref}\n id={stepDatumId()}\n disabled={props.disabled}\n onChange={onFileInputChanged}\n />\n );\n case 'multiple_choice':\n const options = props.stepDatum.multiple_choice_options\n .map(({ id, name }) => ({ value: id, label: name }));\n return (\n <Select\n // NOTE: This casting is because the ids are numbers on the stepDatum,\n // but the defaultValue is a string. Ideally we would do this where\n // we're setting the default for `localValue`, but because this component\n // is used for so many things, it's easier to keep it isolated here.\n innerRef={ref}\n value={options.find(({ value }) => value === Number(localValue))}\n id={stepDatumId()}\n aria-required={props.stepDatum.required}\n onChange={onMultipleChoiceChange}\n disabled={props.disabled}\n options={options}\n placeholder='Select an option'\n styles={{\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n verticalAlign: 'middle',\n marginRight: '1rem',\n width: '80%',\n }),\n }}\n />\n );\n case 'date':\n return (\n <div className='inline-block'>\n <DateSelector\n innerRef={ref}\n id={stepDatumId()}\n value={props.fieldValue}\n type={props.stepDatum.date_type}\n placeholderText='Select Date'\n onDateChange={onDateInputChanged}\n onBlur={completionBegun}\n className={`margin-right currentstep-datum-datepicker${props.disabled ? ' unclickable' : ''}`}\n />\n </div>\n );\n case 'date_range':\n const startId = `${stepDatumId()}-start`;\n const endId = `${stepDatumId()}-end`;\n\n return (\n <div className='well inline-block margin-right'>\n <div className='inline-block'>\n <label htmlFor={startId}>\n {props.stepDatum.date_range_start_label}\n </label>\n <DateRangeSelector\n innerRef={ref}\n id={startId}\n endId={endId}\n value={startDate}\n type={props.stepDatum.date_type}\n onDateChange={onStartDateRangeInputChanged}\n className={`margin-right currentstep-datum-datepicker${props.disabled ? ' unclickable' : ''}`}\n startDate={startDate}\n onBlur={completionBegun}\n endDate={endDate}\n isStart\n />\n </div>\n\n <div className='inline-block margin-left'>\n <label htmlFor={endId}>{props.stepDatum.date_range_end_label}</label>\n <DateRangeSelector\n innerRef={ref}\n id={endId}\n value={endDate}\n type={props.stepDatum.date_type}\n onDateChange={onEndDateRangeInputChanged}\n className={`margin-right currentstep-datum-datepicker${props.disabled ? ' unclickable' : ''}`}\n startDate={startDate}\n endDate={endDate}\n onBlur={completionBegun}\n isStart={false}\n minDate={startDate}\n />\n </div>\n </div>\n );\n case 'checkboxes':\n return renderCheckboxes();\n case 'entity': {\n const fieldValue = props.fieldValue ? props.fieldValue : '';\n return (\n <EntityInput\n templateId={props.templateId}\n required={props.stepDatum.required}\n entityTemplateFields={props.stepDatum.entity_fields}\n canCreateNewEntity={props.stepDatum.entity_createable}\n customEntity={props.stepDatum.custom_entity}\n stepDatumId={props.stepDatum.id}\n initiatedFlowId={props.initiatedFlowId}\n teamId={props.teamId}\n fieldValue={fieldValue}\n onChange={onEntityValueChanged}\n disabled={props.disabled}\n />\n );\n }\n default:\n throw new Error(`Unrecognized input type '${props.stepDatum.data_type}'`);\n }\n };\n\n const renderCheckboxes = () => {\n const initialValues = props.fieldValue;\n const checkboxesHTML = props.stepDatum.multiple_choice_options.map((option) => {\n const initialValue = (initialValues ? initialValues[option.id] : false);\n return renderCheckbox(option, initialValue);\n });\n\n return (\n <div className='currentstep-datum-checkboxes' aria-labelledby={stepDatumId()} role='group'>{checkboxesHTML}</div>\n );\n };\n\n const renderCheckbox = (checkbox, isChecked) => {\n return (\n <div key={checkbox.id}>\n <label>\n <input\n ref={(el) => { checkboxRefs.current[`checkbox-${checkbox.id}`] = el; }}\n type='checkbox'\n onChange={onInputChanged}\n disabled={props.disabled}\n defaultChecked={isChecked}\n />\n {checkbox.name}\n </label>\n </div>\n );\n };\n\n const findCheckbox = (option) => {\n const refName = `checkbox-${option.id}`;\n return checkboxRefs.current[refName];\n };\n\n const onEntityValueChanged = (value) => {\n validateInput(value);\n submitValue(value);\n };\n\n const onStartDateRangeInputChanged = (date) => {\n validateInput({ start_date: date, end_date: endDate });\n submitValue({ start_date: date, end_date: endDate });\n };\n\n const onEndDateRangeInputChanged = (date) => {\n validateInput({ end_date: date, start_date: startDate });\n submitValue({ end_date: date, start_date: startDate });\n };\n\n const onMultipleChoiceChange = ({ value }) => {\n // NOTE: setLocalValue is currently only used here. It would likely be worth\n // refactoring to use this approach across more of these components in the future.\n setLocalValue(value);\n validateInput(value);\n submitValue(value);\n };\n\n const onDateInputChanged = (date) => {\n validateInput(date);\n submitValue(date);\n };\n\n const onFileInputChanged = (url, file) => {\n completionBegun();\n validateInput([file, url]);\n submitValue(url);\n };\n\n const validateInput = useCallback((input) => {\n const isValid = !props.stepDatum.required || validate(input, props.stepDatum);\n\n setValid(isValid);\n }, [props.stepDatum]);\n\n const submitValue = useCallback((fieldValue, immediately = false) => {\n const args = [props.stepDatum.id, fieldValue, version + 1];\n\n if (!props.survey) {\n CollectInfoStepActions.dispatchDataWillChange(dispatch);\n }\n\n if (immediately) {\n submit(...args);\n } else {\n debouncedSubmit(...args);\n }\n\n setVersion(version + 1);\n }, [debouncedSubmit, props.stepDatum.id, submit, version]);\n\n const completionBegun = () => {\n setBeganFieldCompletion(true);\n };\n\n const onTextAreaBlur = () => {\n if (fieldValueDidChange()) {\n onInputChanged({}, ref.current.value, true);\n }\n\n completionBegun();\n };\n\n const fieldValueDidChange = () => {\n return ref.current.value !== props.fieldValue;\n };\n\n const statusClassName = () => {\n if (valid) {\n return 'valid';\n } if (beganFieldCompletion || props.attemptedAdvance) {\n return 'invalid';\n }\n return '';\n };\n\n const deleteAttachedFile = (fileId) => {\n return CollectInfoStepActions.deleteAttachedFile(fileId)\n .done(() => CollectInfoStepActions.dispatchFileDeleted(dispatch, props.stepDatum.id, fileId));\n };\n\n const renderStatus = () => {\n if (props.stepDatum.required) {\n return <i className={`validityindicator ${statusClassName()}`} />;\n }\n return <span>Optional</span>;\n };\n\n const renderExtra = () => {\n if (props.stepDatum.data_type === 'file') {\n return (\n <ul className='currentstep-datum-extra'>\n {renderFiles()}\n </ul>\n );\n } if (props.stepDatum.data_type === 'address' && props.fieldValue) {\n return <Map query={props.fieldValue} />;\n }\n };\n\n const renderFile = (file) => {\n return (\n <AttachedFile\n key={file.url.original}\n fileName={file.file_file_name}\n createdAt={file.created_at}\n fileId={file.id}\n url={file.url.original}\n onDeleteClick={deleteAttachedFile}\n deletable={!props.disabled}\n adminUploaded={file.admin_uploaded}\n />\n );\n };\n\n const renderFiles = () => {\n const files = props.fieldValue;\n\n if (!files || !files.length) return;\n\n return (files.map((file) => renderFile(file)));\n };\n\n const shouldShowErrorMessage = () => {\n return !valid\n && (beganFieldCompletion || props.attemptedAdvance);\n };\n\n const renderFormErrorMessage = () => {\n if (shouldShowErrorMessage()) {\n const message = [props.stepDatum.name, errorMessageForDatum(props.stepDatum)].join(' ');\n return (\n <span className='error-message margin-top-less'>\n {message}\n </span>\n );\n }\n };\n\n const errorMessageForDatum = (datum) => {\n switch (datum.data_type) {\n case 'integer':\n case 'float':\n case 'money':\n if (!validateNumberFormat(localValue, datum)) {\n return ErrorMessages.formValidation[datum.data_type];\n }\n\n return ErrorMessages.formValidation.number({\n numberType: datum.data_type,\n minValue: datum.min_value,\n maxValue: datum.max_value,\n });\n case 'checkboxes':\n return ErrorMessages.formValidation.checkboxes({ minNumChecks: datum.min_num_checks });\n default:\n return ErrorMessages.formValidation[props.stepDatum.data_type];\n }\n };\n\n const needsAriaLabelledBy = () => {\n return contains(['entity', 'checkboxes', 'date_range'], props.stepDatum.data_type);\n };\n\n const extraLabel = () => {\n switch (props.stepDatum.data_type) {\n case 'checkboxes':\n if (props.stepDatum.min_num_checks) {\n return <span className='block'>{`(Minimum Selection: ${props.stepDatum.min_num_checks})`}</span>\n }\n break;\n case 'money':\n if (!props.stepDatum.min_value && !props.stepDatum.max_value ) { return }\n\n const max = props.stepDatum.max_value ? `Max value: ${props.stepDatum.max_value}` : ' ';\n const min = props.stepDatum.min_value ? `Min value: ${props.stepDatum.min_value}` : ' ';\n\n return <span className='block'>{`(${min} ${max})`}</span>;\n case 'string':\n if (props.stepDatum.max_length) {\n return <span className='block'>{`(Max characters: ${props.stepDatum.max_length})`}</span>;\n }\n break;\n case 'text':\n if (props.stepDatum.max_length) {\n return <span className='block'>{`(Max characters: ${props.stepDatum.max_length})`}</span>;\n }\n break;\n default: {\n break;\n }\n }\n }\n\n const renderTextLabel = () => {\n const requiredIcon = props.stepDatum.required ? <i title='required' /> : '';\n\n if (needsAriaLabelledBy()) {\n return (\n <span id={stepDatumId()} className='currentstep-input-label'>\n {props.stepDatum.name}\n {requiredIcon}\n {extraLabel()}\n </span>\n );\n }\n\n return (\n <label htmlFor={stepDatumId()}>\n {props.stepDatum.name}\n {requiredIcon}\n {extraLabel()}\n </label>\n );\n };\n\n const onLockClick = () => {\n let lockedFields = [];\n\n if (props.isFieldLocked) {\n lockedFields = without(props.lockedFields, String(props.stepDatum.id));\n } else {\n const currentlyLocked = props.lockedFields || [];\n lockedFields = [...currentlyLocked, String(props.stepDatum.id)];\n }\n\n ActiveStepActions.update(dispatch, props.activeStepId, { locked_fields: JSON.stringify(lockedFields) });\n };\n\n const lockButton = () => {\n if (props.isStepLocked) { return; }\n\n if (props.admin) {\n return (\n <button\n type='button'\n className={`forminput-lockbutton ${props.disabled ? 'locked' : 'unlocked'}`}\n onClick={onLockClick}\n >\n <span className={`icon ${props.disabled ? 'icon-lock' : 'icon-unlocked'}`} />\n </button>\n );\n }\n\n return (\n <span className={`icon ${props.disabled ? 'icon-lock' : 'icon-unlocked'}`} />\n );\n };\n\n const renderInputField = () => {\n const ariaLabelledBy = contains(['entity'], props.stepDatum.data_type) ? stepDatumId() : null;\n\n return (\n <div className={`forminput-validity ${statusClassName()} ${props.disabled ? 'disabled' : ''}`}>\n {renderTextLabel()}\n <div className='forminput-wrapper' aria-labelledby={ariaLabelledBy}>\n {inputTagForFieldType()}\n <div className='currentstep-validity'>{renderStatus()}</div>\n <div className='forminput-lockwrap'>\n {lockButton()}\n </div>\n </div>\n\n {renderFormErrorMessage()}\n </div>\n );\n };\n\n return (\n <div className='currentstep-datum'>\n {renderInputField()}\n\n {renderExtra()}\n </div>\n );\n};\n\nStepDataCollectorInputField.defaultProps = {\n attemptedAdvance: false,\n disabled: false,\n firstError: false,\n survey: false,\n};\n\nStepDataCollectorInputField.propTypes = {\n attemptedAdvance: PropTypes.bool,\n disabled: PropTypes.bool,\n firstError: PropTypes.bool,\n survey: PropTypes.bool,\n stepDatum: PropTypes.shape({\n data_type: PropTypes.string.isRequired,\n name: PropTypes.string,\n required: PropTypes.bool.isRequired,\n id: PropTypes.number.isRequired,\n multiple_choice_options: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.number.isRequired,\n })),\n max_length: PropTypes.number,\n entity_fields: PropTypes.arrayOf(PropTypes.shape({})),\n entity_createable: PropTypes.bool,\n entity_name: PropTypes.string,\n }).isRequired,\n fieldValue: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),\n version: PropTypes.number,\n onInputChanged: PropTypes.func,\n defaultValue: PropTypes.string,\n teamId: PropTypes.number.isRequired,\n templateId: PropTypes.number.isRequired,\n initiatedFlowId: PropTypes.number.isRequired,\n};\n\nexport default StepDataCollectorInputField;\n","import PropTypes from 'prop-types';\nimport React, { useState, useEffect, useMemo } from 'react';\nimport StepDataCollectorInputField from 'components/shared/step-data-collector-input-field';\nimport { validate } from 'modules/collected-data-validator';\nimport { debounce } from 'underscore';\n\nconst Section = ({\n attemptedAdvance, section, surveyData, disabled, onInputChanged, defaultValues, stepData,\n}) => {\n const [firstErrorId, setFirstErrorId] = useState(null);\n useEffect(() => {\n if (attemptedAdvance) {\n const firstDatumWithError = stepData.find((stepDatum) => {\n const collectedDatum = surveyData[stepDatum.id];\n const content = collectedDatum && collectedDatum.content;\n const isValid = !stepDatum.required || validate(content, stepDatum);\n return !isValid;\n });\n\n if (firstDatumWithError === undefined) {\n setFirstErrorId(null);\n } else {\n setFirstErrorId(firstDatumWithError.id);\n }\n }\n }, [attemptedAdvance, stepData, surveyData]);\n\n const addressOnInputChanged = useMemo(() => debounce(onInputChanged, 1000), [onInputChanged]);\n\n return (\n <section>\n <span className='collectinfosection-title'>{section.name_or_default}</span>\n\n {section.instructions && (\n <div className='currentstep-instructions simplerich' dangerouslySetInnerHTML={{ __html: section.instructions }} />\n )}\n\n {section.step_data.map((stepDatum) => (\n <StepDataCollectorInputField\n stepDatum={stepDatum}\n disabled={disabled}\n attemptedAdvance={attemptedAdvance}\n fieldValue={surveyData?.[stepDatum.id]?.content}\n firstError={stepDatum.id === firstErrorId}\n onInputChanged={stepDatum.data_type === 'address' ? addressOnInputChanged : onInputChanged}\n key={stepDatum.id}\n // This is how optional chaining works with object access\n defaultValue={defaultValues?.[stepDatum.id]}\n survey\n />\n ))}\n </section>\n );\n};\n\nSection.propTypes = {\n section: PropTypes.object.isRequired,\n disabled: PropTypes.bool.isRequired,\n attemptedAdvance: PropTypes.bool.isRequired,\n stepData: PropTypes.array.isRequired,\n surveyData: PropTypes.object,\n onInputChanged: PropTypes.func,\n defaultValues: PropTypes.object,\n};\n\nexport default Section;\n","import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\nimport SurveySubmissionActions from 'actions/survey-submission-actions';\nimport { validate } from 'modules/collected-data-validator';\nimport _ from 'underscore';\nimport EmailValidator from 'modules/email-validator';\nimport TimeAgo from 'react-timeago';\nimport Section from './survey/section';\n\nconst SUBMIT_BUTTON_LABELS = {\n new: {\n unsubmitted: 'Submit response',\n submitted: 'Response submitted',\n },\n\n existing: {\n unsubmitted: 'Update responses',\n submitted: 'Updates submitted',\n },\n};\n\nconst Survey = (props) => {\n const [email, setEmail] = useState(props.existingSubmission ? props.existingSubmission.email : null);\n const [surveyData, setSurveyData] = useState(initialSurveyData());\n const [submitted, setSubmitted] = useState(false);\n const [submitting, setSubmitting] = useState(false);\n const [attemptedAdvance, setAttemptedAdvance] = useState(false);\n\n function initialSurveyData() {\n return props.existingSubmission ? existingSubmissionData()\n : defaultValueData();\n }\n\n function existingSubmissionData() {\n const surveyDta = {};\n\n props.existingSubmission.collected_data.forEach((collectedDatum) => {\n surveyDta[collectedDatum.step_datum_id] = collectedDatum;\n });\n\n return surveyDta;\n }\n\n function defaultValueData() {\n const defaults = {};\n\n _.each(props.survey.default_values, (val, key) => {\n defaults[key] = { content: val };\n });\n\n return defaults;\n }\n\n function onSubmitSurvey() {\n if (!readyToSubmit()) {\n setAttemptedAdvance(true);\n return;\n }\n\n setSubmitting(true);\n\n let request;\n\n if (props.existingSubmission) {\n const submissionToken = props.existingSubmission.token || props.existingSubmission.id;\n request = SurveySubmissionActions.update(submissionToken, formattedDataForSubmit());\n } else {\n const { id, survey_token } = props.survey;\n request = SurveySubmissionActions.submit(id, survey_token, formattedDataForSubmit());\n }\n\n request.done(onSurveySubmitted)\n .always(onSubmitRequestComplete);\n }\n\n function onSubmitRequestComplete() {\n setSubmitting(false);\n }\n\n function onSurveySubmitted() {\n setSubmitted(true);\n }\n\n function onInputChanged(stepDatumId, value) {\n setDatumValue(stepDatumId, value);\n }\n\n function setDatumValue(stepDatumId, value) {\n // When collected datum already exists (on update)\n // it will contain the collectedDatumId, which\n // is required to trigger an update instead of\n // a create.\n\n const collectedDatum = surveyData[stepDatumId] || {};\n collectedDatum.content = value;\n\n const data = {\n [stepDatumId]: collectedDatum,\n };\n\n setSurveyData((prevState) => {\n return { ...prevState, ...data };\n });\n }\n\n function isNewSubmission() {\n return !props.existingSubmission;\n }\n\n function formattedDataForSubmit() {\n const datumIds = Object.keys(surveyData);\n const collectedDataAttrs = datumIds.map((datumId) => {\n const type = _.findWhere(allStepData(), { id: Number(datumId) }).data_type;\n return {\n field_id: datumId,\n field_type: 'StepDatum',\n content: formatContent(surveyData[datumId].content, type),\n id: surveyData[datumId].id,\n };\n });\n\n return {\n email,\n collectedDataAttrs,\n };\n }\n\n function formatContent(content, dataType) {\n if (dataType === 'checkboxes') {\n return JSON.stringify(content);\n }\n\n return content;\n }\n\n function surveyIsIdentified() {\n return props.survey.identified;\n }\n\n function readyToSubmit() {\n if (submitting || submitted) {\n return false;\n }\n\n if (surveyIsIdentified() && !EmailValidator.validate(email)) {\n return false;\n }\n\n if (_.isEmpty(surveyData)) { return false; }\n\n return allStepData().every((datum) => {\n const collectedDatum = surveyData[datum.id];\n const content = collectedDatum && collectedDatum.content;\n const isValid = !datum.required || validate(content, datum);\n return isValid;\n });\n }\n\n function allStepData() {\n return _.flatten(props.survey.sections.map((section) => section.step_data));\n }\n\n function renderSubmittedMessage() {\n return (\n <div className='survey-submittedmessage'>Your response has been submitted.</div>\n );\n }\n\n function renderSection(section, idx) {\n return (\n <Section\n onInputChanged={onInputChanged}\n section={section}\n surveyData={surveyData}\n disabled={submitted}\n attemptedAdvance={attemptedAdvance}\n stepData={allStepData()}\n key={idx}\n defaultValues={props.survey.default_values}\n />\n );\n }\n\n function renderSections() {\n return props.survey.sections.map(renderSection);\n }\n\n function renderContactField() {\n if (props.survey.identified) {\n return (\n <div className={`forminput-validity ${emailWrapperClass()}`}>\n <label className='bigger'>\n <span className='survey-emaillabel'>Email<i /></span>\n <input defaultValue={email} onChange={onEmailchange} className='margin-bottom-more bigger goldenwidth' type='email' placeholder='email@example.com' />\n </label>\n </div>\n );\n }\n }\n\n function emailWrapperClass() {\n if (attemptedAdvance && !EmailValidator.validate(email)) {\n return 'invalid';\n }\n }\n\n function onEmailchange(e) {\n setEmail(e.currentTarget.value);\n }\n\n function renderSubmitButtonText() {\n let labels;\n\n if (isNewSubmission()) {\n labels = SUBMIT_BUTTON_LABELS.new;\n return submitted ? labels.submitted : labels.unsubmitted;\n }\n\n labels = SUBMIT_BUTTON_LABELS.existing;\n return submitted ? labels.submitted : labels.unsubmitted;\n }\n\n function renderHeader() {\n let submissionNumber;\n let submissionDetails;\n\n if (props.existingSubmission) {\n submissionNumber = (\n <div className='processnumber float-right'>\n Response \n <span>#{props.existingSubmission.scoped_id}</span>\n </div>\n );\n\n submissionDetails = (\n <div className='color-text-medium margin-top-less'>\n Submitted <TimeAgo date={props.existingSubmission.created_at} /> {renderEmail()}\n </div>\n );\n }\n\n return (\n <header className='cf'>\n <div className='survey-title'>\n {props.survey.name}\n {submissionNumber}\n </div>\n {submissionDetails}\n </header>\n );\n }\n\n function renderEmail() {\n if (props.existingSubmission.email) {\n return (\n <>\n by <strong>{props.existingSubmission.email}</strong>\n </>\n );\n }\n }\n\n function renderInstructions() {\n return (\n <p>{props.survey.instructions}</p>\n );\n }\n\n return (\n <div className='survey'>\n <main className='raised'>\n {renderHeader()}\n {renderInstructions()}\n {renderContactField()}\n {renderSections()}\n\n <div className={`btn-primary${!readyToSubmit() ? ' disabled' : ''}`} onClick={onSubmitSurvey}>\n {renderSubmitButtonText()}\n </div>\n\n {submitted ? renderSubmittedMessage() : ''}\n </main>\n </div>\n );\n};\n\nSurvey.propTypes = {\n survey: PropTypes.shape({\n sections: PropTypes.array.isRequired,\n instructions: PropTypes.string,\n name: PropTypes.string,\n id: PropTypes.number.isRequired,\n survey_token: PropTypes.string,\n identified: PropTypes.bool.isRequired,\n }).isRequired,\n existingSubmission: PropTypes.shape({\n token: PropTypes.string.isRequired,\n collected_data: PropTypes.array.isRequired,\n email: PropTypes.string,\n }),\n};\n\nexport default Survey;\n","import PropTypes from 'prop-types';\nimport React, { useContext, useState, useEffect } from 'react';\nimport { Link } from 'react-router-dom';\nimport Actions from 'actions/survey-submission-actions';\nimport SurveySubmissionAPI from 'apis/survey-submission-api';\nimport Survey from 'components/shared/survey';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\n\nconst SurveySubmissionAdminView = (props) => {\n const [collectedData, setCollectedData] = useState(null);\n\n useEffect(() => {\n loadCollectedData();\n }, []);\n\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n function loadCollectedData() {\n SurveySubmissionAPI.fetchData(props.submission.id)\n .done(onSurveyDataLoaded);\n }\n\n function onSurveyDataLoaded(data) {\n setCollectedData(data);\n }\n\n function onDeleteClick(e) {\n e.preventDefault();\n\n Actions.destroy(props.submission.id)\n .done(() => {\n onSurveySubmissionDestroyed();\n });\n }\n\n function onSurveySubmissionDestroyed() {\n props.history.replace('/');\n Actions.dispatchSubmissionDestroyed(dispatch, props.submission.id);\n }\n\n function renderContent() {\n if (collectedData) {\n return (\n <Survey\n survey={props.survey}\n existingSubmission={Object.assign(props.submission, { collected_data: collectedData })}\n />\n );\n }\n\n return renderLoadingContent();\n }\n\n function renderLoadingContent() {\n return (\n <div className='text-center padded'>\n <div className='progress'>\n <div>Loading</div>\n </div>\n </div>\n );\n }\n\n function renderTopLinks() {\n return (\n <div className='survey-toplinks margin-top-more'>\n <Link className='secondary' to='/'>{'< Back to all responses'}</Link>\n <a href='#' className='float-right color-alert margin-left' onClick={onDeleteClick}>Delete</a>\n </div>\n );\n }\n\n return (\n <div className='scroll fullheight'>\n {renderTopLinks()}\n {renderContent()}\n </div>\n );\n};\n\nSurveySubmissionAdminView.propTypes = {\n submission: PropTypes.object.isRequired,\n survey: PropTypes.object.isRequired,\n history: PropTypes.object.isRequired,\n};\n\nexport default SurveySubmissionAdminView;\n","import InitiatedFlowAPI from '../apis/initiated-flow-api';\n\nconst resolveTags = function (htmlString, textType, textContainerId, initiatedFlow) {\n const parsedHTML = $.parseHTML(htmlString);\n const $html = $('<div>').append($(parsedHTML));\n const $formulaTags = $html.find('*[data-object-type=Formula]');\n const $fieldTags = $html.find('*[data-object-type=Field]');\n const $keywordTags = $html.find('*[data-object-type=Keyword]');\n if ($formulaTags.length == 0 && $fieldTags.length == 0 && $keywordTags.length == 0) {\n return Promise.resolve($html.html());\n }\n\n return InitiatedFlowAPI.parseVariableText(textType, textContainerId, initiatedFlow.id)\n .then((res) => { return res.text; });\n};\n\nexport default resolveTags;\n","import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport resolveTags from 'modules/tag-resolver';\n\nconst InformationalText = ({\n classes,\n text,\n textType,\n initiatedFlow,\n textContainerId,\n}) => {\n const [textState, setTextState] = useState(null);\n\n useEffect(() => {\n resolveTags(text, textType, textContainerId, initiatedFlow)\n .then((t) => { setTextState(t) });\n }, []);\n \n if (text) {\n return (\n <div className={`informationaltext simplerich ${classes}`} dangerouslySetInnerHTML={{ __html: textState }} />\n );\n }\n\n return (\n <div className={`${classes} currentstep-loading`}>\n <div className='progress small'>\n <div />\n </div>\n </div>\n );\n};\n\nInformationalText.propTypes = {\n classes: PropTypes.string,\n text: PropTypes.string,\n initiatedFlow: PropTypes.shape({}).isRequired,\n textContainerId: PropTypes.string.isRequired,\n};\n\nexport default InformationalText;\n","var ActivityAPI = {\n\tindex(initiatedFlowId){\n\t\tconst url = '/initiated_flows/' + initiatedFlowId + '/activities';\n\t\tvar request = $.ajax(url, {\n\t\t\tdataType: 'json',\n\t\t\tmethod: 'GET'\n\t\t});\n\n\t\treturn request;\n\t}\n};\n\nexport default ActivityAPI;","import API from '../apis/activity-api';\nimport Constants from '../constants/activity-log-constants';\n\nconst ActivityLogActions = {\n loadActivities(initiatedFlowId, dispatch) {\n return API.index(initiatedFlowId)\n .done((res) => {\n dispatch({\n type: Constants.LOADED,\n activities: res,\n });\n });\n },\n};\n\nexport default ActivityLogActions;\n","import React, { useEffect, useState, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport dayjs from 'dayjs';\nimport 'timeago';\n\nimport Actions from 'actions/activity-log-actions';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\n\n$.timeago.settings.cutoff = 1000 * 60 * 60 * 24;\n\nconst Activity = ({\n activities,\n initiatedFlowId,\n}) => {\n const [loadFailed, setLoadFailed] = useState(false);\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n useEffect(() => {\n Actions.loadActivities(initiatedFlowId, dispatch)\n .fail(() => { setLoadFailed(true); });\n }, []);\n\n useEffect(() => {\n $('time.timeago').each((_, item) => {\n if (!item.title) {\n item.title = dayjs(item.dateTime).format('LLL');\n $(item).timeago();\n }\n });\n });\n\n const renderActivities = () => {\n if (loadFailed) {\n return <div className='margin-top'>Unable to load activity log</div>;\n }\n\n return activities.map(renderActivity);\n }\n\n const renderActivity = (activity) => {\n return (\n <li key={activity.id} dangerouslySetInnerHTML={{ __html: activity.html }} />\n );\n }\n\n return (\n <div id='activitylog'>\n <ul>\n {renderActivities()}\n </ul>\n </div>\n );\n};\n\nActivity.propTypes = {\n initiatedFlowId: PropTypes.number.isRequired,\n};\n\nexport default Activity;\n","const ProcessAssignmentsAPI = {\n assign: function(id, assigneeId, assigneeType) {\n const URL = `/initiated_flows/${id}/process_assignments/`;\n\n return $.ajax(URL, {\n method: 'POST',\n data: {\n assignee_id: assigneeId,\n assignee_type: assigneeType\n },\n dataType: 'json'\n });\n },\n\n unassign: function(id, assignmentId) {\n const URL = `/initiated_flows/${id}/process_assignments/${assignmentId}`;\n\n return $.ajax(URL, {\n method: 'DELETE',\n dataType: 'json'\n });\n }\n}\n\nexport default ProcessAssignmentsAPI\n","import ProcessAssignmentsAPI from 'apis/process-assignments-api';\nimport InitiatedFlowConstants from 'constants/initiated-flow-constants';\n\nconst ProcessAssignmentsActions = {\n dispatchAssignmentUpdated(dispatch, attachment) {\n dispatch({\n type: InitiatedFlowConstants.ASSIGNMENT_UPDATED,\n personAttachment: attachment,\n });\n },\n\n assign(processId, assigneeId, assigneeType) {\n return ProcessAssignmentsAPI.assign(processId, assigneeId, assigneeType);\n },\n\n unassign(processId, assignmentId) {\n return ProcessAssignmentsAPI.unassign(processId, assignmentId);\n },\n};\n\nexport default ProcessAssignmentsActions;\n","import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { filter, findWhere } from 'underscore';\nimport { error } from 'components/shared/flash';\nimport AttachmentActions from 'actions/attachment-actions';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport SlidingToggle from 'components/shared/sliding-toggle';\nimport ProcessAssignmentsActions from 'actions/process-assignment-actions';\nimport RoleDisc from 'components/shared/role-disc';\nimport UserDisc from 'components/shared/user-disc';\nimport XClose from 'components/shared/x-close';\n\nconst Members = ({\n personAttachments,\n initiatedFlowId,\n}) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n const renderAdminDeleteLink = (user) => {\n return (\n <div className='accessmanager-removeuser'>\n {user.removable && <XClose onClick={(e) => { onAdminDelete(e, user); }} label='Remove user' /> }\n </div>\n );\n };\n\n const onAssignmentToggle = (personAttachment) => {\n if (personAttachment.assigned) {\n ProcessAssignmentsActions.unassign(initiatedFlowId, personAttachment.assignment_id)\n .done(() => {\n const attachment = { ...personAttachment, assigned: false, assignment_id: null };\n ProcessAssignmentsActions.dispatchAssignmentUpdated(dispatch, attachment);\n });\n } else {\n ProcessAssignmentsActions\n .assign(initiatedFlowId, personAttachment.id, personAttachment.type)\n .done((res) => {\n const attachment = { ...personAttachment, assigned: true, assignment_id: res.id };\n ProcessAssignmentsActions.dispatchAssignmentUpdated(dispatch, attachment);\n });\n }\n };\n\n const onAdminToggle = (user) => {\n const userId = user.id;\n // Verify existing users can be removed\n const existingUser = findWhere(personAttachments, { id: userId });\n if (existingUser && !existingUser.removable) {\n error('Form members cannot be removed from an individual process');\n } else if (existingUser) {\n AttachmentActions.removePerson(existingUser.attachment_id)\n .done((res) => AttachmentActions.dispatchInitiatedFlowTogglePerson(dispatch, res));\n } else {\n AttachmentActions.togglePerson(initiatedFlowId, 'InitiatedFlow', userId, user.type)\n .done((res) => AttachmentActions.dispatchInitiatedFlowTogglePerson(dispatch, res));\n }\n };\n\n const onAdminDelete = (e, user) => {\n e.preventDefault();\n onAdminToggle(user);\n };\n\n const renderAssignees = () => {\n let usersToRender = filter(personAttachments, {\n type: 'User',\n assigned: true,\n });\n\n usersToRender = filter(personAttachments, {\n assigned: true,\n });\n\n return usersToRender.map(renderAdminUser);\n };\n\n const renderViewers = () => {\n let usersToRender = filter(personAttachments, {\n type: 'User',\n assigned: false,\n });\n\n usersToRender = filter(personAttachments, {\n assigned: false,\n });\n\n return usersToRender.map(renderAdminUser);\n };\n\n const renderDisc = (user) => {\n if (user.type === 'User') {\n return (\n <UserDisc\n user={user}\n options={{\n showName: true,\n showEmail: false,\n }}\n />\n );\n }\n\n return <RoleDisc role={user} />;\n };\n\n const renderAdminUser = (user) => {\n const assignmentLabel = user.assigned ? 'Assigned' : 'Not assigned';\n const adminInviteStatus = user.pseudo ? (\n <span className='color-text-medium'> (Invited)</span>\n ) : '';\n\n return (\n <li key={user.id} className='cf'>\n <div title={user.name} className='float-left'>\n {renderDisc(user)}\n {adminInviteStatus}\n </div>\n\n <div className='float-right'>\n <SlidingToggle\n onToggle={() => { onAssignmentToggle(user); }}\n on={user.assigned}\n options={{ size: 'small' }}\n label={assignmentLabel}\n />\n {renderAdminDeleteLink(user)}\n </div>\n </li>\n );\n };\n\n return (\n <>\n <div className='accessmanager-label margin-bottom'>Assignees</div>\n <ul className='accessmanager-admins'>\n {renderAssignees()}\n </ul>\n\n <div className='accessmanager-label margin-bottom'>Viewers</div>\n <ul className='accessmanager-admins'>\n {renderViewers()}\n </ul>\n </>\n );\n};\n\nMembers.propTypes = {\n personAttachments: PropTypes.arrayOf(PropTypes.shape({}).isRequired),\n initiatedFlowId: PropTypes.number.isRequired,\n};\n\nexport default Members;\n","import React, { useState, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport PersonSelector from 'components/shared/person-selector';\nimport UserAPI from 'apis/user-api';\nimport AttachmentActions from 'actions/attachment-actions';\nimport { findWhere, filter, isEmpty } from 'underscore';\nimport { error } from 'components/shared/flash';\nimport truncate from 'truncate';\nimport Members from './members';\n\nconst AccessManager = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const [managingAdmins, setManagingAdmins] = useState(false);\n\n function onAdminSearchTermsChanged(terms) {\n return UserAPI.search(terms, { initiatedFlowId: props.initiatedFlowId });\n }\n\n function onAdminToggle(user) {\n const userId = user.id;\n // Verify existing users can be removed\n const existingUser = findWhere(props.personAttachments, { id: userId });\n if (existingUser && !existingUser.removable) {\n error('Form members cannot be removed from an individual submission');\n } else if (existingUser) {\n AttachmentActions.removePerson(existingUser.attachment_id)\n .done((res) => AttachmentActions.dispatchInitiatedFlowTogglePerson(dispatch, res));\n } else {\n AttachmentActions.togglePerson(props.initiatedFlowId, 'InitiatedFlow', userId, 'User')\n .done((res) => AttachmentActions.dispatchInitiatedFlowTogglePerson(dispatch, res));\n }\n }\n\n function onSendInviteButtonClicked(email, name) {\n AttachmentActions.addPseudomember(email, name, 'InitiatedFlow', props.initiatedFlowId, {})\n .done((res) => AttachmentActions.dispatchInitiatedFlowTogglePerson(dispatch, res));\n }\n\n function renderAdminRoles() {\n const rolesToRender = filter(props.personAttachments, { type: 'AdminRole' });\n if (isEmpty(rolesToRender)) { return; }\n\n return (\n <>\n <div className='accessmanager-label'>Roles</div>\n <ul className='accessmanager-admins'>\n {rolesToRender.map(renderAdminRole)}\n </ul>\n\n <div className='linebreak' />\n </>\n );\n }\n\n function renderAdminRole(user) {\n return (\n <li key={user.id} className='cf'>\n <div title={user.name} className='float-left'>\n <span>{truncate(user.name, 14)}</span>\n </div>\n </li>\n );\n }\n\n function onManageAdminsClick(e) {\n e.preventDefault();\n setManagingAdmins(!managingAdmins);\n }\n\n function renderSearch() {\n return (\n <PersonSelector\n doSearch={onAdminSearchTermsChanged}\n hideExternal\n allowPseudo\n teamId={props.teamId}\n onSelect={onAdminToggle}\n onInvite={onSendInviteButtonClicked}\n placeholder='Enter email, name, or ClearForms username'\n attachableType='InitiatedFlow'\n />\n );\n }\n\n return (\n <div className='accessmanager-wrap'>\n <div className='accessmanager relative'>\n <div className='accessmanager-header cf'>\n <div className='float-left'>\n <label>\n Access\n </label>\n </div>\n\n <div className='float-right'>\n <button className='btn-link' type='button' onClick={onManageAdminsClick}>Manage</button>\n </div>\n </div>\n\n <div className='accessmanager-body'>\n {managingAdmins && renderSearch()}\n\n {renderAdminRoles()}\n\n <Members\n personAttachments={props.personAttachments}\n initiatedFlowId={props.initiatedFlowId}\n />\n </div>\n </div>\n </div>\n );\n};\n\nAccessManager.propTypes = {\n teamId: PropTypes.number.isRequired,\n personAttachments: PropTypes.arrayOf(PropTypes.shape({})),\n initiatedFlowId: PropTypes.number.isRequired,\n};\n\nexport default AccessManager;\n","const ApplicantAttachmentAPI = {\n addApplicant(userId, initiatedFlowId) {\n const url = '/applicant_attachments/';\n return $.ajax(url, {\n data: {\n user_id: userId,\n initiated_flow_id: initiatedFlowId,\n },\n method: 'POST',\n dataType: 'json',\n });\n },\n\n makePrimary(applicantId) {\n const url = '/applicant_attachments/make_primary';\n return $.ajax(url, {\n data: {\n id: applicantId,\n },\n method: 'POST',\n dataType: 'json',\n });\n },\n\n removeApplicant(applicantId) {\n const url = `/applicant_attachments/${applicantId}`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n },\n\n addPseudoApplicant(email, name, initiatedFlowId) {\n const url = '/applicant_attachments/add_pseudoapplicant';\n return $.ajax(url, {\n data: {\n email,\n name,\n initiated_flow_id: initiatedFlowId,\n },\n method: 'POST',\n dataType: 'json',\n });\n },\n};\n\nexport default ApplicantAttachmentAPI;\n","import API from 'apis/applicant-attachment-api';\nimport InitiatedFlowConstants from 'constants/initiated-flow-constants';\nimport { error } from 'components/shared/flash';\n\nconst ApplicantAttachmentActions = {\n dispatchPrimaryApplicantChanged(dispatch, initiatedFlowId, applicant) {\n dispatch({\n type: InitiatedFlowConstants.PRIMARY_APPLICANT_CHANGED,\n initiatedFlowId,\n applicant,\n });\n },\n\n dispatchApplicantListUpdated(dispatch, initiatedFlowId, applicant, saved) {\n dispatch({\n type: InitiatedFlowConstants.APPLICANT_LIST_UPDATED,\n initiatedFlowId,\n applicant,\n saved,\n });\n },\n\n addApplicant(dispatch, userId, initiatedFlowId) {\n return API.addApplicant(userId, initiatedFlowId)\n .done((res) => {\n this.dispatchApplicantListUpdated(dispatch, initiatedFlowId, res, true);\n })\n .fail((res) => {\n error(res.responseJSON.error ? res.responseJSON.error : null);\n });\n },\n\n addPseudoApplicant(dispatch, email, name, initiatedFlowId) {\n return API.addPseudoApplicant(email, name, initiatedFlowId)\n .done((res) => {\n this.dispatchApplicantListUpdated(dispatch, initiatedFlowId, res, true);\n })\n .fail(() => { error(); });\n },\n\n makePrimary(dispatch, applicantId, initiatedFlowId) {\n API.makePrimary(applicantId)\n .done((res) => {\n this.dispatchPrimaryApplicantChanged(dispatch, initiatedFlowId, res);\n })\n .fail(() => { error(); });\n },\n\n removeApplicant(dispatch, applicantId, initiatedFlowId) {\n API.removeApplicant(applicantId)\n .done((res) => {\n this.dispatchApplicantListUpdated(dispatch, initiatedFlowId, res, false);\n })\n .fail(() => { error(); });\n },\n};\n\nexport default ApplicantAttachmentActions;\n","import React, { useState, useContext, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport PersonSelector from 'components/shared/person-selector';\nimport { isEmpty } from 'underscore';\nimport InitiatedFlowActions from 'actions/initiated-flow-actions';\nimport ApplicantAttachmentActions from 'actions/applicant-attachment-actions';\nimport UserDisc from 'components/shared/user-disc';\n\nconst ApplicantManager = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const [managingApplicants, setManagingApplicants] = useState(false);\n\n const isPrimaryApplicant = useMemo(() => {\n const primaryApplicant = props.applicantAttachments.find((applicant) => applicant.is_primary);\n return primaryApplicant.user_id === window.CityGrows.Server.currentUserId;\n }, [props.applicantAttachments]);\n\n const canManage = useMemo(() => {\n return CityGrows.Server.admin || isPrimaryApplicant;\n }, [isPrimaryApplicant]);\n\n const searchPerson = (search) => {\n return InitiatedFlowActions.searchApplicants(search);\n };\n\n const onApplicantUserSelect = (user) => {\n ApplicantAttachmentActions.addApplicant(dispatch, user.id, props.initiatedFlowId)\n .done(() => {\n setManagingApplicants(!managingApplicants);\n });\n };\n\n function onSendInviteButtonClicked(email, name) {\n ApplicantAttachmentActions.addPseudoApplicant(dispatch, email, name, props.initiatedFlowId)\n .done(() => {\n setManagingApplicants(!managingApplicants);\n });\n }\n\n const renderApplicants = () => {\n if (isEmpty(props.applicantAttachments)) { return; }\n const primaryApplicant = props.applicantAttachments.find((applicant) => applicant.is_primary);\n const otherApplicants = props.applicantAttachments.filter((applicant) => { return !applicant.is_primary; });\n return (\n <>\n <div className='applicantmanager-label margin-bottom'>Primary Applicant</div>\n <ul id='primaryapplicant' className='applicantmanager-applicants'>\n {renderApplicant(primaryApplicant)}\n </ul>\n\n {!isEmpty(otherApplicants) && (\n <>\n <div className='applicantmanager-label margin-bottom'>Other Applicants</div>\n <ul id='applicantlist' className='applicantmanager-applicants'>\n {otherApplicants.map(renderApplicant)}\n </ul>\n </>\n )}\n </>\n );\n };\n\n function onApplicantDelete(e, applicant) {\n ApplicantAttachmentActions.removeApplicant(dispatch, applicant.id, props.initiatedFlowId);\n }\n\n function onPrimaryApplicantChange(e, applicant) {\n ApplicantAttachmentActions.makePrimary(dispatch, applicant.id, props.initiatedFlowId);\n }\n\n const renderApplicant = (applicant) => {\n const showMakePrimaryButton = canManage && !applicant.is_primary && !applicant.pseudo;\n const showDeleteButton = canManage && !applicant.is_primary;\n return (\n <li key={applicant.id} className='cf'>\n <div title={applicant.name} className='float-left'>\n <UserDisc\n user={applicant}\n options={{\n showName: true,\n showPseudo: true,\n showAsCurrent: applicant.user_id === CityGrows.Server.currentUserId,\n }}\n />\n </div>\n {(showMakePrimaryButton || showDeleteButton) && (\n <div className='float-right'>\n <div className='applicantmanager-actions'>\n {showMakePrimaryButton && (\n <>\n <button className='btn-link' type='button' onClick={(e) => { onPrimaryApplicantChange(e, applicant); }}>Make primary</button>\n \n </>\n )}\n {showDeleteButton && (\n <i className='icon-trash-grey small clickable' onClick={(e) => { onApplicantDelete(e, applicant); }} />\n )}\n </div>\n </div>\n )}\n </li>\n );\n };\n\n function onManageApplicantsClick(e) {\n e.preventDefault();\n setManagingApplicants(!managingApplicants);\n }\n\n const renderSearch = () => {\n return (\n <PersonSelector\n onSelect={onApplicantUserSelect}\n doSearch={searchPerson}\n allowPseudo\n hideExternal={false}\n placeholder='Search people'\n attachableType='Applicant'\n onInvite={onSendInviteButtonClicked}\n />\n );\n };\n\n return (\n <div className='applicantmanager-wrap'>\n <div className='applicantmanager relative'>\n <div className='applicantmanager-header cf'>\n <div className='float-left'>\n <label>\n Applicants\n </label>\n </div>\n {canManage && (\n <div className='float-right'>\n <button id='manageapplicant' className='btn-link' type='button' onClick={onManageApplicantsClick}>Manage</button>\n </div>\n )}\n </div>\n\n <div className='applicantmanager-body'>\n {managingApplicants && renderSearch()}\n\n {renderApplicants()}\n </div>\n </div>\n </div>\n );\n};\n\nApplicantManager.propTypes = {\n applicantAttachments: PropTypes.arrayOf(PropTypes.shape({})),\n initiatedFlowId: PropTypes.number.isRequired,\n};\n\nexport default ApplicantManager;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport AccessManager from './menu/access-manager';\nimport ApplicantManager from './menu/applicant-manager';\n\nconst Access = ({\n admin,\n applicantAttachments,\n initiatedFlowId,\n personAttachments,\n teamId,\n}) => {\n const renderAccessManager = () => {\n if (admin) {\n return (\n <AccessManager\n personAttachments={personAttachments}\n initiatedFlowId={initiatedFlowId}\n teamId={teamId}\n />\n );\n }\n }\n\n const renderApplicantManager = () => {\n return (\n <ApplicantManager\n applicantAttachments={applicantAttachments}\n initiatedFlowId={initiatedFlowId}\n />\n );\n }\n\n return (\n <>\n {renderAccessManager()}\n {renderApplicantManager()}\n </>\n );\n};\n\nAccess.propTypes = {\n initiatedFlowId: PropTypes.number.isRequired,\n onCloseClick: PropTypes.func,\n transitionRef: PropTypes.object,\n};\n\nexport default Access;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport truncate from 'truncate';\nimport dayjs from 'dayjs';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport pluralize from 'modules/pluralize';\n\ndayjs.extend(localizedFormat);\n\nconst LaunchInfo = (props) => {\n const renderTimestamp = () => {\n return dayjs(props.initiatedFlow.created_at).format('l');\n };\n\n const renderIdentifier = () => {\n if (!props.initiatedFlow.identifier_field_value) { return; }\n\n return (\n <span\n title={props.initiatedFlow.identifier_field_value}\n >\n {truncate(props.initiatedFlow.identifier_field_value, 75)}\n </span>\n );\n };\n\n const getApplicantText = () => {\n const text = props.initiatedFlow.primary_applicant.name;\n const otherApplicantsCount = props.initiatedFlow.applicants_count - 1;\n if (otherApplicantsCount > 0) {\n return `${text} and ${otherApplicantsCount} ${pluralize('other', otherApplicantsCount, { many: 'others' })}`;\n }\n return text;\n };\n\n return (\n <>\n <li>\n <div>Applicant</div>\n <div>{getApplicantText()}</div>\n </li>\n\n {!!props.initiatedFlow.identifier_field_value && (\n <li>\n <div>Identifier</div>\n <div>{renderIdentifier()}</div>\n </li>\n )}\n\n <li>\n <div>Started</div>\n <div>{renderTimestamp()}</div>\n </li>\n </>\n );\n};\n\nLaunchInfo.propTypes = {\n flowTemplateId: PropTypes.number.isRequired,\n initiatedFlow: PropTypes.object.isRequired,\n admin: PropTypes.bool.isRequired,\n};\n\nexport default LaunchInfo;\n","import React, {\n useContext, useEffect, useRef, useState,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport TagManagerActions from 'actions/tag-manager-actions';\nimport { findWhere, find } from 'underscore';\nimport truncate from 'truncate';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { confirm } from 'modules/alert-confirm';\nimport pluralize from 'modules/pluralize';\nimport { error } from 'components/shared/flash';\n\nconst TagManager = (props) => {\n const reservedTagNames = ['late', 'renewal'];\n const createTagInput = useRef();\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const [creatingTag, setCreatingTag] = useState(false);\n const [editingTagId, setEditingTagId] = useState(null);\n const editTagInput = useRef();\n\n useEffect(() => {\n if (creatingTag) {\n setEditingTagId(null);\n createTagInput.current.focus();\n }\n }, [creatingTag]);\n\n useEffect(() => {\n if (editingTagId) {\n setCreatingTag(false);\n editTagInput.current.focus();\n }\n }, [editingTagId]);\n\n const onEnterKeyPressed = (e) => {\n if (e.keyCode === 13) {\n if (creatingTag) {\n onSubmitNewTag();\n } else if (editingTagId) {\n onUpdateTagClick();\n }\n }\n };\n\n const isReservedTagName = (name) => {\n return reservedTagNames.includes(name);\n };\n\n function onSubmitNewTag() {\n if (!createTagInput.current) { return; }\n\n const tagName = createTagInput.current.value.toLowerCase().trim();\n const existingTag = findTag(tagName);\n if (existingTag) {\n if (!findWhere(props.taggings, { tag_id: existingTag.id })) {\n TagManagerActions.addTagging(dispatch, props.taggableType, props.taggableId, existingTag.id);\n }\n } else if (isReservedTagName(tagName)) {\n error('Name is reserved');\n } else {\n TagManagerActions\n .createTag(dispatch, props.taggableType, props.taggableId, tagName);\n }\n createTagInput.current.value = '';\n setCreatingTag(false);\n }\n\n function onTagClick(tagId) {\n if (tagIsSelected(tagId)) {\n const tagging = findTagging(tagId);\n TagManagerActions.removeTagging(dispatch, tagging.id);\n } else {\n TagManagerActions.addTagging(dispatch, props.taggableType, props.taggableId, tagId);\n }\n }\n\n function tagIsSelected(tagId) {\n return !!findTagging(tagId);\n }\n\n function findTag(tagName) {\n return find(props.suggestedTags, ((tag) => tag.name === tagName));\n }\n\n function findTagging(tagId) {\n return findWhere(props.taggings, { tag_id: tagId });\n }\n\n function onCreateTagClick(e) {\n e.preventDefault();\n\n setCreatingTag(true);\n }\n\n const onUpdateTagClick = () => {\n if (!editTagInput.current) { return; }\n const tag = findTag(editTagInput.current.value);\n if (tag) {\n if (tag.id === editingTagId) {\n setEditingTagId(null);\n return;\n }\n error('Name already taken');\n } else {\n TagManagerActions.updateTag(dispatch, editingTagId, editTagInput.current.value)\n .done(() => {\n setEditingTagId(null);\n });\n }\n };\n\n function onDeleteTagClick(tag) {\n const taggingCount = tagIsSelected(tag.id) ? tag.tagging_count - 1 : tag.tagging_count;\n if (taggingCount > 0) {\n confirm('Are you sure?', `This tag is in use on ${taggingCount} other ${pluralize('submission', taggingCount)}`, () => {\n TagManagerActions.destroyTag(dispatch, tag.id);\n });\n } else {\n TagManagerActions.destroyTag(dispatch, tag.id);\n }\n }\n\n function renderTagCreationSection() {\n let content;\n if (creatingTag) {\n content = <input ref={createTagInput} type='text' placeholder='New tag name' onKeyDown={onEnterKeyPressed} />;\n } else {\n content = <button onClick={onCreateTagClick} type='button' className='secondary btn-link'>Create new tag</button>;\n }\n\n return (\n <div className='tagmanager-new'>\n {content}\n </div>\n );\n }\n\n function renderSuggestedTags() {\n return props.suggestedTags.map(renderTag);\n }\n\n function renderActions(tag) {\n const canModifyTag = CityGrows.Server.canModifyTag && !isReservedTagName(tag.name);\n if (canModifyTag) {\n return (\n <div className='tagmanager-actions'>\n <i className='clickable icon-pencil-grey' onClick={() => setEditingTagId(tag.id)} role='button' title='Edit tag' />\n <i className='clickable icon-trash-grey' title='Delete tag' onClick={() => onDeleteTagClick(tag)} />\n </div>\n );\n }\n }\n\n function renderTag(tag) {\n const className = (tagIsSelected(tag.id) ? 'tagmanager-tagname active' : 'tagmanager-tagname');\n\n if (editingTagId === tag.id) {\n return (\n <li\n key={tag.id}\n >\n <div className={className}>\n <input type='text' className='tagmanager-editinput' defaultValue={tag.name} ref={editTagInput} onKeyDown={onEnterKeyPressed} />\n </div>\n <div className='tagmanager-actions'>\n <FontAwesomeIcon icon={icon({ name: 'check' })} size='lg' title='Save' onClick={() => onUpdateTagClick()} className='clickable' />\n <FontAwesomeIcon icon={icon({ name: 'xmark' })} size='lg' onClick={() => setEditingTagId(null)} title='Cancel' className='clickable' />\n </div>\n </li>\n );\n }\n return (\n <li\n key={tag.id}\n >\n <div className={className} onClick={() => { onTagClick(tag.id); }} title={tag.name}>\n {truncate(tag.name, 50)}\n </div>\n {renderActions(tag)}\n </li>\n );\n }\n\n return (\n <div className='tagmanager'>\n <div className='tagmanager-title'>Tags</div>\n <ul className='tagmanager-suggestions scroll'>\n {renderSuggestedTags()}\n </ul>\n\n {renderTagCreationSection()}\n </div>\n );\n};\n\nTagManager.propTypes = {\n taggings: PropTypes.arrayOf(PropTypes.shape({})),\n suggestedTags: PropTypes.arrayOf(PropTypes.shape({})),\n taggableType: PropTypes.string.isRequired,\n taggableId: PropTypes.number.isRequired,\n};\n\nexport default TagManager;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport truncate from 'truncate';\n\nconst NUM_TAGS_TO_SHOW = 3;\nconst TAG_CHAR_LENGTH = 25;\n\nconst TagList = ({ taggings }) => {\n const [showAll, setShowAll] = useState(false);\n\n const renderTagging = (tagging) => {\n return (\n <li\n className='tag'\n key={tagging.id}\n title={tagging.tag.name}\n >\n {truncate(tagging.tag.name, TAG_CHAR_LENGTH)}\n </li>\n );\n };\n\n const firstTaggings = () => {\n const numToShow = showAll ? taggings.length : NUM_TAGS_TO_SHOW;\n return taggings.slice(0, numToShow)\n .map(renderTagging);\n };\n\n const moreTaggings = () => {\n const numTaggings = taggings.length;\n if (numTaggings <= NUM_TAGS_TO_SHOW) {\n return;\n }\n\n let content;\n if (showAll) {\n content = 'Show less';\n } else {\n content = (\n <>Show {taggings.length - NUM_TAGS_TO_SHOW} more</>\n );\n }\n\n return (\n <button\n className='tag tag-more margin-right'\n onClick={() => {\n setShowAll(!showAll);\n }}\n >\n {content}\n </button>\n );\n };\n\n return (\n <>\n {firstTaggings()}\n {moreTaggings()}\n </>\n );\n};\n\nTagList.propTypes = {\n taggings: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.number.isRequired,\n tag: PropTypes.shape({\n name: PropTypes.string.isRequired,\n }).isRequired,\n })).isRequired,\n};\n\nexport default TagList;\n","import React, { memo, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { where, any } from 'underscore';\n\nimport AutonomousPopup from 'components/shared/autonomous-popup';\nimport DiscGroup from 'components/shared/disc-group';\nimport LaunchInfo from './launch-info';\nimport TagManager from './tag-manager';\nimport TagList from './tag-list';\n\nconst HeaderMeta = memo((props) => {\n const ignoredCssClasses = [\n 'visible',\n 'alertconfirm-container',\n 'alertconfirm-icon',\n 'alertconfirm-text',\n 'alertconfirm-title',\n 'alertconfirm-message',\n 'alertconfirm-actions',\n 'btn-secondary',\n 'btn-primary'];\n\n const renderTagManager = () => {\n if (props.admin) {\n const buttonHTML = (\n <button\n type='button'\n onClick={(e) => e.preventDefault()}\n className='clickable secondary btn-link'\n >\n Manage tags\n </button>\n );\n\n return (\n <AutonomousPopup buttonHtml={buttonHTML} wrapperIgnoreClass={ignoredCssClasses}>\n <TagManager\n taggableId={props.initiatedFlow.id}\n taggableType='InitiatedFlow'\n taggings={props.initiatedFlow.taggings}\n suggestedTags={props.initiatedFlow.suggested_tags}\n />\n </AutonomousPopup>\n );\n }\n };\n\n const flowStatusClass = () => {\n const classes = ['activeflowheader-openclosed'];\n\n if (props.initiatedFlow.status === 'Halted') {\n classes.push('color-alert');\n }\n\n return classes.join(' ');\n };\n\n const members = useMemo(() => {\n return where(props.initiatedFlow.person_attachments, { assigned: true });\n }, [props.initiatedFlow.person_attachments]);\n\n return (\n <div className='activeflowheader-meta'>\n <ul>\n <LaunchInfo\n initiatedFlow={props.initiatedFlow}\n admin={props.admin}\n flowTemplateId={props.flowTemplateId}\n />\n\n <li>\n <div>Status</div>\n <div\n className={flowStatusClass()}\n dangerouslySetInnerHTML={{ __html: props.initiatedFlow.status }}\n />\n </li>\n { any(members) && (\n <li id='assignees'>\n <DiscGroup groupMembers={members} />\n </li>\n )}\n <li className='flex vmiddle'>\n <ul className='activeflowheader-statustags'>\n <TagList\n taggings={props.initiatedFlow.taggings}\n />\n </ul>\n\n {renderTagManager()}\n </li>\n </ul>\n </div>\n );\n});\n\nHeaderMeta.displayName = 'HeaderMeta';\n\nHeaderMeta.propTypes = {\n admin: PropTypes.bool.isRequired,\n flowTemplateId: PropTypes.number.isRequired,\n initiatedFlow: PropTypes.shape({\n id: PropTypes.number.isRequired,\n suggested_tags: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n taggings: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n }).isRequired,\n teamId: PropTypes.number.isRequired,\n};\n\nexport default HeaderMeta;\n","import { useRef, useEffect } from 'react';\n\nconst useKeyDown = (callback) => {\n const targetRef = useRef();\n const keydownRef = useRef();\n keydownRef.current = callback;\n useEffect(() => {\n // NOTE: this indirection looks weird but is necessary. This provides\n // a locally stable function reference for registering and unregistering\n // the keybind, while still allowing the keydownRef's value to change.\n const keydownCallback = (e) => keydownRef.current(e);\n const target = targetRef.current;\n target.addEventListener('keydown', keydownCallback);\n return () => target.removeEventListener('keydown', keydownCallback);\n }, []);\n return targetRef;\n};\n\nexport default useKeyDown;\n","import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport DiscussionDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport DiscussionActions from 'actions/discussion-actions';\nimport { success } from 'components/shared/flash';\nimport TimeAgo from 'react-timeago';\nimport dayjs from 'dayjs';\nimport XClose from 'components/shared/x-close';\n\nconst DiscussionComment = (props) => {\n const dispatch = useContext(DiscussionDispatchContext);\n function onDeleteClick() {\n DiscussionActions\n .deleteDiscussionComment(dispatch, props.discussionComment.id)\n .done(() => { success('Comment deleted'); });\n }\n\n function renderDeleteButton() {\n if (props.discussionComment.user.id === window.CityGrows.Server.currentUserId) {\n return <XClose buttonClass='float-right' onClick={onDeleteClick} label='Delete comment'/>;\n }\n }\n\n return (\n <div className='discussion-comment sub'>\n <div className='cf'>\n <span className='discussion-name margin-right-less'>{props.discussionComment.user.name}</span>\n <TimeAgo\n date={props.discussionComment.created_at}\n className='timeago discussion-timestamp'\n title={dayjs(props.discussionComment.created_at).format('LLL')}\n />\n {renderDeleteButton()}\n </div>\n\n <div className='discussion-body'>{props.discussionComment.body}</div>\n </div>\n );\n};\n\nDiscussionComment.propTypes = {\n discussionComment: PropTypes.shape({\n id: PropTypes.number,\n body: PropTypes.string,\n user: PropTypes.shape({\n id: PropTypes.number,\n name: PropTypes.string,\n }),\n created_at: PropTypes.string,\n }),\n};\n\nexport default DiscussionComment;\n","import React, {\n useRef, useState, useCallback, useEffect, useContext,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport Textarea from 'react-textarea-autosize';\nimport TimeAgo from 'react-timeago';\nimport DiscussionDispatchContext from 'contexts/discussion-dispatch-context';\nimport dayjs from 'dayjs';\n\nimport DiscussionActions from 'actions/discussion-actions';\nimport Select from 'components/shared/select';\nimport Flash from 'components/shared/flash';\nimport useKeyDown from 'components/hooks/use-keydown';\nimport { confirm } from 'modules/alert-confirm';\nimport DiscussionComment from './comment';\n\nconst ApprovalStatus = ({ className, verb, groupName }) => (\n <div className={`discussion-context margin-bottom ${className}`}>\n {verb} - <span className='light'>{groupName}</span>\n </div>\n);\n\nApprovalStatus.propTypes = {\n className: PropTypes.string,\n verb: PropTypes.string,\n groupName: PropTypes.string,\n};\n\nconst EditResponse = ({ discussion, close }) => {\n const dispatch = useContext(DiscussionDispatchContext);\n\n const [editedText, setEditedText] = useState(discussion.body);\n const inputRef = useRef();\n const onUpdateDiscussionClick = () => {\n if (!editedText || editedText.length === 0) {\n Flash.error('Discussion can\\'t be empty');\n }\n\n DiscussionActions.update(dispatch, discussion.id, { body: editedText })\n .done(() => {\n Flash.success('Discussion updated');\n close();\n });\n };\n\n const onKeyDown = (e) => {\n if (e.keyCode === 27) {\n // Esc\n close();\n } else if ((e.metaKey || e.ctrlKey) && e.keyCode === 13) {\n // CMD-Enter\n onUpdateDiscussionClick();\n }\n };\n\n const keydownTargetRef = useKeyDown(onKeyDown);\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, []);\n\n return (\n <div className='cf' ref={keydownTargetRef}>\n <Textarea className='margin-top' ref={inputRef} value={editedText} onChange={(e) => setEditedText(e.target.value)} placeholder='Start typing...' />\n <div className='float-right margin-top-less'>\n <button type='button' onClick={close} className='margin-right btn-thirdary small'>Cancel</button>\n <button type='button' onClick={onUpdateDiscussionClick} className='btn-primary small'>Save</button>\n </div>\n </div>\n );\n};\n\nEditResponse.propTypes = {\n discussion: PropTypes.object,\n close: PropTypes.func,\n};\n\n// TODO: this is really similar to EditResponse. They could probably be deduped.\nconst ReplyResponse = ({ discussion, close }) => {\n const dispatch = useContext(DiscussionDispatchContext);\n const inputRef = useRef();\n const [reply, setReply] = useState('');\n\n const onSaveComment = () => {\n if (!reply || reply.length < 1) {\n Flash.error('Comment can\\'t be blank');\n return;\n }\n\n DiscussionActions.saveDiscussionComment(dispatch, discussion.id, reply)\n .done(() => setReply(''));\n };\n\n useEffect(() => {\n if (inputRef.current) {\n inputRef.current.focus();\n }\n }, []);\n\n const onKeyDown = (e) => {\n if (e.keyCode === 27) {\n // Esc\n close();\n } else if ((e.metaKey || e.ctrlKey) && e.keyCode === 13) {\n // CMD-Enter\n onSaveComment();\n }\n };\n\n const keydownTargetRef = useKeyDown(onKeyDown);\n\n return (\n <div className='cf padding-left' ref={keydownTargetRef}>\n <Textarea value={reply} ref={inputRef} onChange={(e) => setReply(e.target.value)} className='margin-top' placeholder='Start typing...' />\n <div className='float-right margin-top-less'>\n <button type='button' onClick={close} className='btn-thirdary small margin-right-less'>Cancel</button>\n <button type='button' onClick={onSaveComment} className='btn-primary small'>Submit response</button>\n </div>\n </div>\n );\n};\n\nReplyResponse.propTypes = {\n discussion: PropTypes.object,\n close: PropTypes.func,\n};\n\nconst DISCUSSION_SELECT_ID = 'discussionOptionContainer';\nexport const DISCUSSION_SELECT_STYLES = {\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n }),\n menu: (provided) => ({\n // Make the menu wide enough to accomodate the longest\n // option without widening the container\n ...provided,\n minWidth: '10rem',\n }),\n control: (provided) => ({\n ...provided,\n // This is to whack the background provided by\n // CSS, which is higher-specificity\n background: 'inherit !important',\n }),\n valueContainer: (provided) => ({\n ...provided,\n // Make it left-aligned with everything else\n paddingLeft: '5px',\n }),\n singleValue: (provided) => ({\n ...provided,\n fontWeight: 'bold',\n textTransform: 'uppercase',\n fontSize: '0.83rem',\n lineHeight: '20px',\n }),\n};\n\nconst DiscussionItem = ({\n active,\n flash,\n discussion,\n onMakeActive,\n onMakeInactive,\n discussionOptions,\n userIsAdmin,\n}) => {\n const dispatch = useContext(DiscussionDispatchContext);\n const manageDiscussionRef = useRef();\n const deleteDiscussionRef = useRef();\n const resolvedWrapperRef = useRef();\n\n // Status\n const [editing, setEditing] = useState(false);\n const [replying, setReplying] = useState(false);\n const [highlighted, setHighlighted] = useState(false);\n\n // Input states\n const closeCommentBox = useCallback(() => {\n setReplying(false);\n if (!editing) {\n onMakeInactive();\n }\n }, [editing, onMakeInactive]);\n\n const closeEditBox = useCallback(() => {\n setEditing(false);\n if (!replying) {\n onMakeInactive();\n }\n }, [onMakeInactive, replying]);\n\n useEffect(() => {\n if (!active) {\n setEditing(false);\n setReplying(false);\n }\n }, [active]);\n\n // Flash if necessary\n useEffect(() => {\n setTimeout(() => {\n if (flash) {\n setHighlighted(true);\n setTimeout(() => {\n setHighlighted(false);\n }, 3000);\n }\n }, 200);\n }, [flash]);\n\n const onResolvedChange = (e) => {\n const { checked } = e.currentTarget;\n if (discussion.step_approval) {\n const text = `This will also mark the requested changes as ${checked ? '' : 'in'}complete. Do you want to proceed?`;\n confirm(`${checked ? 'Close' : 'Reopen'} discussion?`, text, () => {\n DiscussionActions.resolve(dispatch, discussion.id, checked)\n .done(() => { Flash.success('Discussion updated'); });\n }, () => {\n e.target.checked = !checked;\n });\n } else {\n DiscussionActions.resolve(dispatch, discussion.id, checked)\n .done(() => { Flash.success('Discussion updated'); });\n }\n };\n\n // TODO: revisit this\n const discussionHTMLName = `checkbox${discussion.id}`;\n\n const onReplyClick = (e) => {\n e.preventDefault();\n setReplying(true);\n // TODO: see what this is doing and if it makes sense\n onMakeActive();\n };\n\n const isResolvedClick = (target) => {\n return resolvedWrapperRef.current.contains(target) || resolvedWrapperRef.current === target;\n };\n const isSelectClick = (target) => {\n const select = document.querySelector(`#${DISCUSSION_SELECT_ID}`);\n // NOTE: this won't be in the DOM if the user isn't an admin, so we\n // check that it exists before we assert against it.\n return select && (select.contains(target) || select === target);\n };\n\n const canManageDiscussion = (discussion.user.id === window.CityGrows.Server.currentUserId);\n\n const isManageOrDeleteClick = (target) => {\n if (!canManageDiscussion) { return false; }\n\n return manageDiscussionRef.current === target || deleteDiscussionRef.current === target;\n };\n\n // TODO: see what the intent is here - is it necessary?\n const onContainerClick = (e) => {\n if (isResolvedClick(e.target)) { return; }\n if (isManageOrDeleteClick(e.target)) { return; }\n if (isSelectClick(e.target)) { return; }\n if (editing || replying) { return; }\n\n onMakeActive();\n setReplying(true);\n };\n\n const renderModeContent = () => {\n if (replying) {\n return (\n <div className='discussion-activewrap'>\n {/* NOTE: this empty div is here to allow the .sub styling to use last-child to remove\n the bottom border on the last comment. */}\n {/* TODO: rewrite those styles to decouple this */}\n <div>\n {discussion.discussion_comments.map((discussionComment) => (\n <DiscussionComment key={discussionComment.id} discussionComment={discussionComment} />\n ))}\n </div>\n <ReplyResponse discussion={discussion} close={closeCommentBox} />\n </div>\n );\n }\n\n const numComments = discussion.discussion_comments.length;\n const actionWord = numComments > 0 ? `Show ${numComments} comments & reply` : 'Reply';\n\n return <a onClick={onReplyClick} href='#' className='margin-top inline-block secondary'>{actionWord}</a>;\n };\n\n const onTypeChange = ({ value }) => {\n // TODO: figure out if this needs local state or if it needs to just track\n // the props from the parent\n DiscussionActions.update(dispatch, discussion.id, { type: value })\n .done(() => { Flash.success('Discussion updated'); });\n };\n\n const onEditClick = (e) => {\n e.preventDefault();\n setEditing(true);\n onMakeActive();\n };\n\n const onDeleteClick = (e) => {\n e.preventDefault();\n let text = 'Are you sure you want to delete this comment?';\n if (discussion.step_approval) {\n text = 'This will mark the change request as complete. Do you want to proceed?';\n }\n e.preventDefault();\n confirm('Delete comment?', text, () => {\n DiscussionActions.deleteDiscussion(dispatch, discussion.id);\n });\n };\n\n const renderContext = () => {\n const approval = discussion.step_approval;\n\n if (approval) {\n switch (approval.approval_status) {\n case true:\n return <ApprovalStatus verb='Approved' className='approval' groupName={approval.review_group_name} />;\n case false:\n return <ApprovalStatus verb='Rejected' className='rejection' groupName={approval.review_group_name} />;\n case null:\n return <ApprovalStatus verb='Change requested' className='changerequest' groupName={approval.review_group_name} />;\n default:\n throw Error(`Unhandled approval_status ${approval.approval_status}`);\n }\n }\n };\n\n const wrapperClass = [\n active && 'active',\n highlighted && 'flash',\n ].filter(Boolean).join(' ');\n\n return (\n <li onClick={onContainerClick} className={wrapperClass}>\n {renderContext()}\n\n <div className={`color-left ${discussion.resolved ? 'success' : 'neutral'}`}>\n <div className='discussion-options margin-bottom-less'>\n {/* TODO: Refactor this out into its own component */}\n {/* NOTE: This is all based around styling our own checkbox. */}\n <div className='discussion-resolvedcheckwrapper'>\n <label ref={resolvedWrapperRef} className='checkbox inline-block vmiddle'>\n <input onChange={onResolvedChange} id={discussionHTMLName} type='checkbox' defaultChecked={discussion.resolved} />\n {/* TODO: what is this span for? */}\n <span />\n </label>\n <label className='inline-block nomargin' htmlFor={discussionHTMLName}>Resolved</label>\n </div>\n\n {userIsAdmin && (\n <Select\n // This would be better to do with a ref, but since there's not a way\n // to put a ref on the container directly, this will do.\n id={DISCUSSION_SELECT_ID}\n options={discussionOptions}\n value={discussionOptions.find(({ value }) => value === discussion.type)}\n onChange={onTypeChange}\n disabled={!canManageDiscussion}\n // TODO: clicking this triggers the \"active\" click handler thing\n isSearchable={false}\n // Fixing the position on this one is a hack to prevent it from overflowing\n // and forcing a scroll bar\n menuPosition='fixed'\n styles={DISCUSSION_SELECT_STYLES}\n />\n )}\n </div>\n\n <div className='discussion-comment'>\n <div className='relative'>\n <span className='discussion-name margin-right-less'>{discussion.user.name}</span>\n <TimeAgo\n className='timeago discussion-timestamp'\n date={discussion.created_at}\n title={dayjs(discussion.created_at).format('LLL')}\n />\n\n {canManageDiscussion && (\n <div className='discussion-comment-manage'>\n <a title='Edit Comment' href='#' onClick={onEditClick}>\n <i ref={manageDiscussionRef} className='clickable icon-pencil-grey small' />\n </a>\n <a title='Delete comment' href='#' onClick={onDeleteClick}>\n <i ref={deleteDiscussionRef} className='clickable icon-trash-grey small margin-left-less' />\n </a>\n </div>\n )}\n </div>\n\n <div className='discussion-body'>\n {(active && editing)\n ? (\n <EditResponse discussion={discussion} close={closeEditBox} />\n )\n : discussion.body}\n </div>\n </div>\n\n {renderModeContent()}\n </div>\n </li>\n );\n};\n\nDiscussionItem.propTypes = {\n discussion: PropTypes.object.isRequired,\n active: PropTypes.bool.isRequired,\n userIsAdmin: PropTypes.bool.isRequired,\n onMakeActive: PropTypes.func.isRequired,\n onMakeInactive: PropTypes.func.isRequired,\n discussionOptions: PropTypes.array,\n flash: PropTypes.bool,\n};\n\nDiscussionItem.defaultProps = {\n flash: false,\n};\n\nexport default DiscussionItem;\n","import React, { useState, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport DiscussionDispatchContext from 'contexts/discussion-dispatch-context';\nimport Textarea from 'react-textarea-autosize';\n\nimport DiscussionActions from 'actions/discussion-actions';\nimport { error } from 'components/shared/flash';\nimport DiscussionItem, { DISCUSSION_SELECT_STYLES } from 'components/shared/discussions/item';\nimport Select from 'components/shared/select';\nimport useKeyDown from 'components/hooks/use-keydown';\n\nconst DISCUSSION_OPTIONS = [\n { value: 'PublicDiscussion', label: 'Discussion', description: 'Discussion can be seen by applicant and by admins. Applicant and admins are notified via email.' },\n { value: 'InternalDiscussion', label: 'Internal discussion', description: 'Only submission admins will see this discussion' },\n];\nconst DEFAULT_DISCUSSION_OPTION = DISCUSSION_OPTIONS[0];\n\nconst AddNewDiscussion = ({ admin, onDiscussionOpened, initiatedFlowId }) => {\n const dispatch = useContext(DiscussionDispatchContext);\n const [discussionContent, setDiscussionContent] = useState();\n const [discussionOption, setDiscussionOption] = useState(DEFAULT_DISCUSSION_OPTION);\n const onDiscussionContentUpdated = (e) => {\n setDiscussionContent(e.target.value);\n };\n\n const onStartDiscussion = () => {\n if (!discussionContent || discussionContent.length < 1) {\n error('Type a message in order to start a discussion');\n return;\n }\n\n DiscussionActions.startDiscussion(dispatch, initiatedFlowId, {\n body: discussionContent,\n type: discussionOption.value,\n })\n .done(onDiscussionOpened);\n };\n\n const onKeyDown = (e) => {\n if ((e.metaKey || e.ctrlKey) && e.keyCode === 13) {\n // CMD-Enter\n onStartDiscussion();\n }\n };\n\n const keydownTargetRef = useKeyDown(onKeyDown);\n\n return (\n <div className='discussion-new-dialog'>\n {admin && (\n <>\n <div className='discussion-new-meta margin-top cf'>\n <Select\n options={DISCUSSION_OPTIONS}\n value={discussionOption}\n onChange={setDiscussionOption}\n isSearchable={false}\n menuPosition='fixed'\n styles={DISCUSSION_SELECT_STYLES}\n />\n </div>\n\n <div className='discussion-typedescription'>{discussionOption.description}</div>\n </>\n )}\n\n <Textarea\n ref={keydownTargetRef}\n onChange={onDiscussionContentUpdated}\n value={discussionContent}\n className='margin-bottom margin-top'\n placeholder='Start typing...'\n title='New discussion'\n />\n\n <button type='button' onClick={onStartDiscussion} className='btn-primary fullwidth'>Start discussion</button>\n </div>\n );\n};\n\nAddNewDiscussion.propTypes = {\n initiatedFlowId: PropTypes.number.isRequired,\n onDiscussionOpened: PropTypes.func,\n admin: PropTypes.bool.isRequired,\n};\n\nconst ShowDiscussions = ({\n admin, recentlyAddedDiscussionId, onNewDiscussionClick, discussions,\n}) => {\n const [activeDiscussionId, setActiveDiscussionId] = useState();\n\n return (\n <div>\n <ul className='discussion-items'>\n {discussions.map((discussion) => (\n <DiscussionItem\n active={activeDiscussionId === discussion.id}\n key={discussion.id}\n discussion={discussion}\n onMakeActive={() => setActiveDiscussionId(discussion.id)}\n onMakeInactive={() => setActiveDiscussionId(null)}\n discussionOptions={DISCUSSION_OPTIONS}\n userIsAdmin={admin}\n flash={recentlyAddedDiscussionId === discussion.id}\n />\n ))}\n </ul>\n\n <div className='discussion-new'>\n <button type='button' onClick={onNewDiscussionClick} className='btn-secondary fullwidth'>New discussion</button>\n </div>\n </div>\n );\n};\n\nShowDiscussions.propTypes = {\n onNewDiscussionClick: PropTypes.func.isRequired,\n recentlyAddedDiscussionId: PropTypes.number,\n admin: PropTypes.bool.isRequired,\n};\n\nconst DiscussionContent = ({\n onNewDiscussionClick,\n admin,\n initiatedFlowId,\n recentlyAddedDiscussionId,\n onDiscussionOpened,\n addingNewDiscussion,\n discussions,\n}) => {\n return addingNewDiscussion\n ? (\n <AddNewDiscussion\n admin={admin}\n initiatedFlowId={initiatedFlowId}\n onDiscussionOpened={onDiscussionOpened}\n />\n )\n : (\n <ShowDiscussions\n onNewDiscussionClick={onNewDiscussionClick}\n recentlyAddedDiscussionId={recentlyAddedDiscussionId}\n admin={admin}\n discussions={discussions}\n />\n );\n};\n\nDiscussionContent.propTypes = {\n addingNewDiscussion: PropTypes.bool.isRequired,\n initiatedFlowId: PropTypes.number.isRequired,\n onNewDiscussionClick: PropTypes.func.isRequired,\n onDiscussionOpened: PropTypes.func,\n recentlyAddedDiscussionId: PropTypes.number,\n admin: PropTypes.bool.isRequired,\n};\n\nDiscussionContent.defaultProps = {\n onDiscussionOpened: () => {},\n};\n\nexport default DiscussionContent;\n","import React, { useState } from 'react';\nimport DiscussionContent from 'components/shared/discussion-content';\nimport { isFunction } from 'underscore';\nimport PropTypes from 'prop-types';\nimport XClose from 'components/shared/x-close';\nimport useFocusTrap from 'components/hooks/use-focus-trap';\n\nconst ProcessDiscussion = (props) => {\n const [addingNewDiscussion, setAddingNewDiscussion] = useState(false);\n const focusEl = useFocusTrap(props.onCloseClick);\n\n function onBackButtonClick(e) {\n e.preventDefault();\n setAddingNewDiscussion(false);\n }\n\n function panelTitle() {\n return addingNewDiscussion\n ? 'New discussion'\n : 'Discussion';\n }\n\n function renderHeaderFunction() {\n return addingNewDiscussion\n ? <a onClick={onBackButtonClick.bind(this)} href='#' className='secondary'>{'< Back'}</a>\n : <XClose onClick={onCloseClick} label='Close discussions' />;\n }\n\n function onCloseClick() {\n if (isFunction(props.onCloseClick)) {\n props.onCloseClick();\n }\n\n setAddingNewDiscussion(false);\n }\n\n function onDiscussionOpened() {\n setAddingNewDiscussion(false);\n }\n\n return (\n <div id='discussion' className='process' ref={props.transitionRef}>\n <div ref={focusEl}>\n <div className='ifslidingpanel-header'>\n <h2>{panelTitle()}</h2>\n {renderHeaderFunction()}\n </div>\n\n <div className='ifslidingpanel-contentwrap'>\n <DiscussionContent\n initiatedFlowId={props.initiatedFlowId}\n admin={props.admin}\n onNewDiscussionClick={() => { setAddingNewDiscussion(true); }}\n addingNewDiscussion={addingNewDiscussion}\n onDiscussionOpened={onDiscussionOpened}\n discussions={props.discussions}\n />\n </div>\n </div>\n </div>\n );\n};\n\nProcessDiscussion.propTypes = {\n initiatedFlowId: PropTypes.number.isRequired,\n admin: PropTypes.bool.isRequired,\n onCloseClick: PropTypes.func,\n};\n\nexport default ProcessDiscussion;\n","import 'whatwg-fetch';\n\nconst ajaxDownload = (url, fileName) => {\n return fetch(url)\n .then((resp) => resp.blob())\n .then((blob) => {\n const url = window.URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.style.display = 'none';\n a.href = url;\n a.download = fileName;\n document.body.appendChild(a);\n a.click();\n window.URL.revokeObjectURL(url);\n });\n};\n\nexport default ajaxDownload;\n","import React, { useState } from 'react';\nimport dayjs from 'dayjs';\nimport ajaxDownload from 'modules/ajax-download';\nimport { confirm } from 'modules/alert-confirm';\nimport InitiatedFlowAPI from 'apis/initiated-flow-api';\n\nconst File = ({ file, isStepFile, initiatedFlowId, removeFile }) => {\n const [expanded, setExpanded] = useState(false);\n\n const onDelete = () => {\n confirm('Delete this file?', 'Caution: This will permanently delete the file', () => {\n InitiatedFlowAPI.deleteRepoFile(initiatedFlowId, file.id)\n .done(() => { removeFile(file.id); });\n });\n };\n\n const fileName = isStepFile ? file.file_file_name : file.filename\n\n function toggleDetails() {\n setExpanded(!expanded);\n };\n\n const onClickDownload = () => {\n ajaxDownload(file.url.original, fileName);\n }\n\n function renderDownload() {\n if (isStepFile) {\n return (\n <a target='_blank' href={file.url.original}>Download</a>\n );\n }\n\n return <a href={file.url}>Download</a>\n }\n\n function renderDelete() {\n if (isStepFile || !CityGrows.Server.admin) { return };\n\n return <button className='btn-link alert margin-left' onClick={onDelete}>Delete</button>\n }\n\n function renderSteDetails() {\n return (\n <>\n <div>\n <span className='bold'>Step</span>\n <span className='margin-left'>{file.step}</span>\n </div>\n <div>\n <span className='bold'>Field</span>\n <span className='margin-left'>{file.field}</span>\n </div>\n </>\n )\n }\n\n function renderExpanded() {\n return (\n <div className='file-details expand'>\n <div>\n {isStepFile && renderSteDetails()}\n <div>\n <span className='bold'>Upload date</span>\n <span className='margin-left'>{dayjs(file.updated_at).format('LL')}</span>\n </div>\n <div>\n <span className='bold'>Uploaded by</span>\n <span className='margin-left'>{file.admin_uploaded ? 'Admin' : 'Applicant'}</span>\n </div>\n </div>\n <div className='file-actions'>\n {renderDownload()}\n {renderDelete()}\n </div>\n </div>\n )\n }\n\n return (\n <div className='ifslidingpanel-file'>\n <button type='button' className='btn-link file-header' onClick={toggleDetails}>\n <b>\n {fileName}\n </b>\n <i className={`icon-arrow-left bigger ${expanded ? 'open' : 'ß'}`}/>\n </button>\n {expanded && renderExpanded()}\n </div>\n );\n};\n\nexport default File;\n","\n\nexport function show(outputId, includeFiles = false){\n const URL = `/issued_outputs/${outputId}`;\n\n return $.ajax(URL, {\n method: 'GET',\n dataType: 'json',\n data: {\n with_files: includeFiles\n }\n });\n}\n\nexport default {\n show\n};","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport PollableJob from 'modules/pollable-job';\nimport LoadingSpinner from 'components/shared/loading-spinner';\n\nconst BackgroundedJobLink = (props) => {\n let timeout;\n\n const [isWorking, setIsWorking] = useState(false);\n const [showPatienceWarning, setShowPatienceWarning] = useState(false);\n\n const schedulePatienceWarning = () => {\n timeout = setTimeout(() => { setShowPatienceWarning(true); }, 10000);\n };\n\n const resetDownloadButton = () => {\n clearTimeout(timeout);\n setIsWorking(false);\n setShowPatienceWarning(false);\n };\n\n const onDownloadClick = (e) => {\n e.preventDefault();\n\n if (isWorking) { return; }\n\n setIsWorking(true);\n schedulePatienceWarning();\n\n const jobRunner = new PollableJob(props.queueFunction);\n jobRunner.run()\n .done(props.onJobComplete)\n .fail(props.onFail)\n .always(resetDownloadButton);\n };\n\n const buttonText = () => {\n if (showPatienceWarning) {\n return props.patienceWarning;\n } if (isWorking) {\n return props.workingText;\n }\n\n return props.children;\n };\n\n return (\n <button onClick={onDownloadClick} disabled={props.disabled} className={props.className}>\n {isWorking && <LoadingSpinner className='margin-right-less vmiddle' colorScheme='dark' />}\n <span className='vmiddle'>{buttonText()}</span>\n </button>\n );\n};\n\nBackgroundedJobLink.propTypes = {\n queueFunction: PropTypes.func.isRequired,\n onJobComplete: PropTypes.func,\n onFail: PropTypes.func,\n patienceWarning: PropTypes.string,\n workingText: PropTypes.string,\n children: PropTypes.string.isRequired,\n className: PropTypes.string,\n disabled: PropTypes.bool,\n};\n\nBackgroundedJobLink.defaultProps = {\n patienceWarning: 'Still working...',\n className: '',\n disabled: false,\n};\n\nexport default BackgroundedJobLink;\n","import React from \"react\";\n\nimport ajaxDownload from 'modules/ajax-download';\nimport { show as outputsShow } from 'apis/outputs-api';\nimport { error } from 'components/shared/flash';\nimport { alert } from 'modules/alert-confirm';\nimport BackgroundedJobLink from 'components/shared/backgrounded-job-link';\n\n\nconst DownloadLinks = ({ outputId }) => {\n const renderDownloadIcon = () => {\n return (\n <div className='ifslidingpanel-btniconwrap'>\n <i className='vmiddle icon-download-grey margin-right-less' />\n </div>\n );\n };\n\n const renderSummaryWithFilesLink = () => {\n return (\n <BackgroundedJobLink\n queueFunction={() => { return outputsShow(outputId, true); }}\n onJobComplete={onSummaryFinishedGenerating}\n onFail={error}\n workingText='Downloading...'\n className='ifslidingpanel-button'\n >\n <span>\n {renderDownloadIcon()}\n Download all documents and uploaded files\n </span>\n </BackgroundedJobLink>\n );\n };\n\n const alertWithDownloadURL = (url) => {\n alert('Download ready', `<a target='_blank' href='${url}'>Click here to download your file</a>`);\n };\n\n const onSummaryFinishedGenerating = (res) => {\n const parsed = JSON.parse(res);\n const url = parsed.file_url;\n const fileName = parsed.file_name;\n\n ajaxDownload(url, fileName)\n .catch(() => { alertWithDownloadURL(url); });\n };\n\n return (\n <div id='menuoutputs'>\n {renderSummaryWithFilesLink()}\n </div>\n );\n};\n\nexport default DownloadLinks;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\n\nconst ExpandableContent = (props) => {\n const [isOpen, setIsOpen] = useState(false);\n\n const onClick = (e) => {\n e.preventDefault();\n\n setIsOpen(!isOpen);\n };\n\n return (\n <div className={props.className}>\n <a\n className='secondary margin-right-less'\n href='#'\n onClick={onClick}\n >{props.linkText}\n </a>\n <a\n className={`clickable stepbreakdown-expand icon icon-arrow-down small thin ${isOpen ? 'flip-y' : ''}`}\n onClick={onClick}\n href='#'\n />\n\n <div className='margin-top-less'>\n {isOpen && props.children}\n </div>\n </div>\n );\n};\n\nExpandableContent.propTypes = {\n className: PropTypes.string,\n};\n\nExpandableContent.defaultProps = {\n className: 'margin-bottom',\n};\n\nexport default ExpandableContent;\n","import { createContext } from 'react';\n\nif(typeof(CityGrows.Server.admin) !== 'boolean'){\n throw('CityGrows.Server.admin is not set correctly');\n}\n\nconst RequestIsGovContext = createContext(CityGrows.Server.admin);\n\nexport default RequestIsGovContext;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { show as outputsShow } from 'apis/outputs-api';\nimport { alert } from 'modules/alert-confirm';\nimport BackgroundedJobLink from 'components/shared/backgrounded-job-link';\nimport ajaxDownload from 'modules/ajax-download';\nimport { error as flashError } from 'components/shared/flash';\n\nconst OutputDownloadLink = (props) => {\n const onOutputFinishedGenerating = (res) => {\n const parsed = JSON.parse(res);\n const url = parsed.file_url;\n const fileName = parsed.file_name;\n\n ajaxDownload(url, fileName)\n .catch(() => { alertWithDownloadURL(url); });\n };\n\n const alertWithDownloadURL = (url) => {\n alert('Download ready', `<a target='_blank' href='${url}'>Click here to download your file</a>`);\n };\n\n return (\n <BackgroundedJobLink\n queueFunction={() => { return outputsShow(props.output.id, false); }}\n onJobComplete={onOutputFinishedGenerating}\n onFail={flashError}\n workingText='Downloading'\n className={props.className}\n >\n Download\n </BackgroundedJobLink>\n );\n};\n\nOutputDownloadLink.propTypes = {\n className: PropTypes.string.isRequired,\n output: PropTypes.shape({\n id: PropTypes.number.isRequired,\n }).isRequired,\n};\n\nOutputDownloadLink.defaultProps = {\n className: 'output-downloadlink',\n};\n\nexport default OutputDownloadLink;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { isFunction } from 'underscore';\n\nconst RenewalManager = (props) => {\n const renderRenewalAction = () => {\n // This may eventually be many things,\n // eg. nothing required, same process required,\n // different process required, etc.\n // For now it's just same process.\n\n return renderRenewalProcess();\n };\n\n const onCancelClick = (e) => {\n e.preventDefault();\n\n isFunction(props.onCancelClick) && props.onCancelClick();\n };\n\n const renderRenewalProcess = () => {\n return (\n <div>\n <div className='margin-bottom color-text-medium'>This will start a new <strong>{props.output.current_published_workflow_name}</strong> application. </div>\n <a\n className={`btn btn-primary margin-right beginrenewalbutton ${(props.variation === 'mini') && 'small margin-bottom'}`}\n href={`/issued_outputs/${props.output.id}/renew`}\n data-method='post'\n >Begin {props.output.name} renewal\n </a>\n\n <a\n className={`btn btn-thirdary ${(props.variation === 'mini') && 'small'}`}\n href='#'\n onClick={onCancelClick}\n >Cancel\n </a>\n </div>\n );\n };\n\n return (\n <div className='renewalmanager-container'>\n {renderRenewalAction()}\n </div>\n );\n};\n\nRenewalManager.propTypes = {\n output: PropTypes.object.isRequired,\n onCancelClick: PropTypes.func,\n variation: PropTypes.string,\n};\n\nRenewalManager.defaultProps = {\n variation: 'normal',\n};\n\nexport default RenewalManager;\n","export const update = (id, attrs) => {\n const url = `/issued_outputs/${id}`;\n\n return $.ajax(url, {\n data: {\n issued_output: attrs,\n },\n dataType: 'json',\n method: 'PUT',\n });\n};\n\nexport const revoke = (id) => {\n const url = `/issued_outputs/${id}/revoke`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n });\n};\n\nexport const unrevoke = (id) => {\n const url = `/issued_outputs/${id}/unrevoke`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n });\n};\n\nexport const renewalOptIn = (id) => {\n const url = `/issued_outputs/${id}/renewal_opt_in`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n });\n};\n\nexport const renewalOptOut = (id) => {\n const url = `/issued_outputs/${id}/renewal_opt_out`;\n\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n });\n};\n\nexport default {\n update,\n revoke,\n unrevoke,\n renewalOptIn,\n renewalOptOut,\n};\n","import {\n update as apiUpdate,\n revoke as apiRevoke,\n unrevoke as apiUnrevoke,\n renewalOptIn as apiRenewalOptIn,\n renewalOptOut as apiRenewalOptOut,\n} from 'apis/issued-output-api';\nimport InitiatedFlowConstants from 'constants/initiated-flow-constants';\nimport { error, success } from 'components/shared/flash';\nimport { any } from 'underscore';\n\nconst onUpdateComplete = (dispatch, outputAttrs) => {\n if (any(outputAttrs.errors)) {\n error(outputAttrs.errors[0]);\n return;\n }\n\n dispatch({\n type: InitiatedFlowConstants.OUTPUT_UPDATED,\n attrs: outputAttrs,\n });\n\n success('Update successful');\n};\n\nexport const update = (dispatch, id, attrs) => {\n const req = apiUpdate(id, {\n issued_at: attrs.issuedAt,\n expires_at: attrs.expiresAt,\n })\n .done((res) => { onUpdateComplete(dispatch, res); })\n .fail(() => { error(); });\n\n return req;\n};\n\nexport const revoke = (dispatch, id) => {\n const onRevoked = (attrs) => {\n dispatch({\n type: InitiatedFlowConstants.OUTPUT_UPDATED,\n attrs,\n });\n\n success('Output revoked');\n };\n\n return apiRevoke(id)\n .done(onRevoked)\n .fail(() => { error(); });\n};\n\nexport const unrevoke = (dispatch, id) => {\n const onUnrevoked = (attrs) => {\n dispatch({\n type: InitiatedFlowConstants.OUTPUT_UPDATED,\n attrs,\n });\n\n success('Output re-issued');\n };\n\n return apiUnrevoke(id)\n .done(onUnrevoked)\n .fail(() => { error(); });\n};\n\nexport const renewalOptIn = (dispatch, id) => {\n const onRenewalOptIn = (attrs) => {\n dispatch({\n type: InitiatedFlowConstants.OUTPUT_UPDATED,\n attrs,\n });\n\n success('Renewal reminders enabled');\n };\n\n return apiRenewalOptIn(id)\n .done(onRenewalOptIn)\n .fail(() => { error(); });\n};\n\nexport const renewalOptOut = (dispatch, id) => {\n const onRenewalOptOut = (attrs) => {\n dispatch({\n type: InitiatedFlowConstants.OUTPUT_UPDATED,\n attrs,\n });\n\n success('Renewal reminders disabled');\n };\n\n return apiRenewalOptOut(id)\n .done(onRenewalOptOut)\n .fail(() => { error(); });\n};\n\nexport default {\n update,\n revoke,\n unrevoke,\n renewalOptIn,\n renewalOptOut,\n};\n","import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport dayjs from 'dayjs';\nimport { renewalOptIn, renewalOptOut } from 'actions/issued-output-actions';\nimport { confirm } from 'modules/alert-confirm';\nimport { isEmpty } from 'underscore';\n\nconst RenewalOptOutLink = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n const onRenewalOptIn = (e) => {\n e.preventDefault();\n const description = `This will re-enable notifications for <strong>${props.output.name}</strong>. ${props.admin ? 'The applicant' : 'You'} will be notified when renewal window is open.`;\n confirm('Are you sure?', description)\n .done(() => { renewalOptIn(dispatch, props.output.id); });\n };\n\n const onRenewalOptOut = (e) => {\n e.preventDefault();\n const description = `This will disable renewal notifications for <strong>${props.output.name}</strong>. ${props.admin ? 'The applicant' : 'You'} won't be notified when renewal window is open.`;\n confirm('Are you sure?', description)\n .done(() => { renewalOptOut(dispatch, props.output.id); });\n };\n\n const renderRenewalReminder = (reminder) => {\n let reminderDate = dayjs(props.output.expires_at);\n if (reminder.direction === 'before') {\n reminderDate = reminderDate.subtract(reminder.period_value, reminder.period_unit);\n } else {\n reminderDate = reminderDate.add(reminder.period_value, reminder.period_unit);\n }\n return (\n <div>\n <span>\n {reminderDate.format('LL')}\n </span>\n </div>\n );\n };\n\n const renderRenewalReminders = () => {\n if (isEmpty(props.output.simple_renewal_reminder_info)) {\n return (\n <div className='text-disabled-color'>\n None\n </div>\n );\n }\n return (\n <div className='bold'>\n {props.output.simple_renewal_reminder_info.map(renderRenewalReminder)}\n </div>\n );\n };\n\n if (!props.output.is_renewable) {\n return (\n <div className='output-renewaloptoutlink'>\n <table className='renewal-information'>\n <tbody>\n <tr className='titles'>\n <td>Renewals info</td>\n </tr>\n <tr className='values'>\n <td>Not renewable</td>\n </tr>\n </tbody>\n </table>\n </div>\n );\n }\n if (props.output.renewal_opted_out) {\n const text = props.admin ? 'Applicant does not intend to renew.' : 'You do not intend to renew.';\n return (\n <div className='output-renewaloptoutlink'>\n <table className='renewal-information'>\n <tbody>\n <tr className='titles'>\n <td>Renewals info</td>\n </tr>\n <tr className='values'>\n <span className='text-disabled-color padding-right-less'>\n {text}\n </span>\n <button\n type='button'\n onClick={onRenewalOptIn}\n >\n <span>Undo</span>\n </button>\n </tr>\n </tbody>\n </table>\n </div>\n );\n }\n const text = props.admin ? 'Click here if Applicant does not intend to renew' : 'I do not intend to renew';\n return (\n <div className='output-renewaloptoutlink'>\n <div className='renewal-information'>\n <div className='titles'>\n <div>Renewals open</div>\n <div>Renewals close</div>\n <div>Renewal reminders</div>\n </div>\n <div className='values'>\n <div className='bold'>{props.output.renewal_open_date ? dayjs(props.output.renewal_open_date).format('LL') : 'Currently open'}</div>\n <div className='bold'>{props.output.renewal_close_date && dayjs(props.output.renewal_close_date).format('LL')}</div>\n { renderRenewalReminders() }\n </div>\n </div>\n <button\n type='button'\n onClick={onRenewalOptOut}\n >\n <span>{text}</span>\n </button>\n </div>\n );\n};\n\nRenewalOptOutLink.propTypes = {\n output: PropTypes.shape({\n expires_at: PropTypes.string.isRequired,\n id: PropTypes.number.isRequired,\n is_renewable: PropTypes.bool.isRequired,\n renewal_open_date: PropTypes.string.isRequired,\n renewal_close_date: PropTypes.string.isRequired,\n renewal_opted_out: PropTypes.bool.isRequired,\n simple_renewal_reminder_info: PropTypes.arrayOf(\n PropTypes.shape({\n period_value: PropTypes.string.isRequired,\n period_unit: PropTypes.string.isRequired,\n direction: PropTypes.string.isRequired,\n }),\n ).isRequired,\n }).isRequired,\n admin: PropTypes.bool.isRequired,\n};\n\nexport default RenewalOptOutLink;\n","import React, { useState, useContext } from 'react';\nimport { revoke, unrevoke } from 'actions/issued-output-actions';\nimport { confirm } from 'modules/alert-confirm';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\n\nconst RevokeButton = ({ output }) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const [submitting, setSubmitting] = useState(false);\n const buttonText = output.revoked ? 'Unrevoke Output' : 'Revoke Output'\n const onRevokeClick = () => {\n setSubmitting(true);\n if (output.revoked) {\n return unrevokeAction();\n }\n\n return revokeAction();\n };\n\n const revokeAction = () => {\n return confirm('Are you sure you want to revoke this output?', `This will make <strong>${output.name}</strong> unavailable for download. The applicant will be notified.`)\n .done(() => { revoke(dispatch, output.id); })\n .always(() => { setSubmitting(false); });\n };\n\n const unrevokeAction = () => {\n return confirm('Are you sure you want to re-issue this output?', `This will re-enable downloads for <strong>${output.name}</strong>`)\n .done(() => { unrevoke(dispatch, output.id); })\n .always(() => { setSubmitting(false); });\n };\n\n return (\n <button type='button' name='revoke' onClick={onRevokeClick} disabled={submitting}>\n <span>\n {buttonText}\n </span>\n </button>\n );\n};\n\nexport default RevokeButton;\n","import React, { useState, useContext } from 'react';\nimport RequestIsGovContext from 'contexts/request-is-gov-context';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport { addYears } from 'react-datepicker/src/date_utils';\nimport { update } from 'actions/issued-output-actions';\nimport DatePicker from 'react-datepicker';\nimport dayjs from 'dayjs';\n\nconst OutputDetails = ({ output, style }) => {\n const [editingExpiration, setEditingExpiration] = useState(false);\n const [editingIssued, setEditingIssued] = useState(false);\n const isGov = useContext(RequestIsGovContext);\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n const shouldShowEditButtons = () => {\n return isGov && style !== 'mini';\n };\n\n const onEditExpirationClick = (e) => {\n e.preventDefault();\n\n setEditingExpiration(true);\n };\n\n const onEditIssuedClick = (e) => {\n e.preventDefault();\n\n setEditingIssued(true);\n };\n\n const onIssueDateUpdate = (date) => {\n update(dispatch, output.id, {\n issuedAt: date,\n });\n\n setEditingIssued(false);\n };\n\n const renderExpirationDetails = () => {\n if (!output.expires || !output.issued) { return; }\n\n let label;\n if (output.expired) {\n label = <div className='color-alert output-table-label'>Expired</div>;\n } else if (output.revoked) {\n label = <div className='color-alert output-table-label'>Original expiration</div>;\n } else {\n label = <div className='color-success output-table-label'>Valid through</div>;\n }\n\n return (\n <div className='output-expiredate'>\n {label}{renderExpirationDate()}\n </div>\n );\n };\n\n const renderExpirationDate = () => {\n if (editingExpiration) {\n return (\n <DatePicker\n selected={new Date(output.expires_at)}\n onChange={onExpirationDateUpdate}\n autoFocus\n onCalendarClose={() => { setEditingExpiration(false); }}\n maxDate={addYears(new Date(), 1000)}\n />\n );\n }\n\n const editButton = <button type='button' className='btn-link margin-left-less' onClick={onEditExpirationClick}>Edit</button>;\n\n return (\n <span>\n {dayjs(output.expires_at).format('LL')}\n {shouldShowEditButtons() && editButton}\n </span>\n );\n };\n\n const onExpirationDateUpdate = (date) => {\n update(dispatch, output.id, {\n expiresAt: date,\n });\n\n setEditingExpiration(false);\n };\n\n const renderIssueDate = () => {\n const issuedAt = output.issued ? dayjs(output.issued_at).format('LL')\n : 'Not yet issued';\n\n if (editingIssued) {\n return (\n <DatePicker\n selected={output.issued_at ? new Date(output.issued_at) : new Date()}\n onChange={onIssueDateUpdate}\n autoFocus\n onCalendarClose={() => { setEditingIssued(false); }}\n maxDate={addYears(new Date(), 1000)}\n />\n );\n }\n\n const editButton = <button type='button' className='issuedate-edit btn-link margin-left-less' onClick={onEditIssuedClick}>Edit</button>;\n\n return (\n <div>\n <div className='output-table-label'>Issued</div><span className='output-issuedate padding-bottom-less'>{issuedAt}</span>\n {shouldShowEditButtons() && editButton}\n </div>\n );\n };\n\n return (\n <div className='margin-top'>\n <div className='output-table'>\n {renderIssueDate()}\n {renderExpirationDetails()}\n </div>\n </div>\n );\n};\n\nexport default OutputDetails;\n","import React, { useState, useContext, useMemo, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport ExpandableContent from 'components/shared/expandable-content';\nimport RequestIsGovContext from 'contexts/request-is-gov-context';\nimport truncate from 'truncate';\nimport pluralize from 'modules/pluralize';\n\nimport dayjs from 'dayjs';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport OutputDownloadLink from './output-download-link';\nimport RenewalManager from './renewal-manager';\nimport RenewalOptOutLink from './renewal-opt-out-link';\nimport RevokeButton from './revoke-button';\nimport OutputDetails from './output-details';\n\ndayjs.extend(localizedFormat);\n\nconst Output = (props) => {\n let isGov = useContext(RequestIsGovContext);\n const [expanded, setExpanded] = useState(!props.collapse);\n\n // TODO:\n // This is super hacky, should just be using a different context\n\n // override the Context if for a custom search page result\n\n if (props.isCustomResult) {\n isGov = false;\n }\n\n const { issued } = props.output;\n\n function toggleCollapse () {\n setExpanded(!expanded);\n };\n\n const renderStatusTag = () => {\n let tagLabel;\n\n if (!props.output.issued) {\n tagLabel = 'Unissued';\n } else if (props.output.revoked) {\n tagLabel = 'Revoked';\n } else if (props.output.expired) {\n tagLabel = 'Expired';\n } else {\n tagLabel = 'Valid';\n }\n\n const openRevealArrowClass = expanded ? 'open' : '';\n\n return (\n <button type='button' onClick={toggleCollapse} className='output-status-wrapper btn-link'>\n <span className={`output-statustag static ${classNameForStatus()}`}>\n {tagLabel}\n </span>\n <i\n title={expanded ? 'close output details' : 'Open output details'}\n className={`icon-arrow-left bigger ${openRevealArrowClass}`}\n />\n </button>\n );\n };\n\n const renderHeaderDocumentLink = () => {\n const href = `/issued_outputs/${props.output.id}`;\n\n return <a href={href} target='_blank'>{truncate(props.output.name, 45)}</a>\n }\n\n const classNameForStatus = () => {\n if (props.output.revoked) {\n return 'revoked';\n } if (!props.output.issued) {\n return 'unissued';\n } if (props.output.expired) {\n return 'expired';\n }\n return 'valid';\n };\n\n const classNameForStyle = () => {\n if (props.style === 'mini') {\n return 'mini';\n }\n\n return '';\n };\n\n const renderRenewals = () => {\n const renderRenewal = (r) => {\n return <li className='margin-bottom-less'><a href={`/initiated_flows/manager/${r.initiated_flow_id}`}>{r.flow_template_name} #{r.initiated_flow_scoped_id}</a></li>;\n };\n\n return props.output.simple_renewal_info.map(renderRenewal);\n };\n\n const renderRenewalInfo = () => {\n const html = [];\n\n if (props.output.renewal) {\n html.push(\n <dl className='margin-bottom'>\n <dt>Renewal</dt>\n <dd>Originally issued via <a href={`/initiated_flows/${props.output.original_output.initiated_flow_id}`} className='secondary'>{props.output.original_output.flow_template_name} #{props.output.original_output.initiated_flow_scoped_id}</a></dd>\n </dl>,\n );\n }\n\n if (props.output.renewed) {\n const renewalCount = props.output.simple_renewal_info.length;\n\n html.push(\n <ExpandableContent linkText={`Renewed ${renewalCount} ${pluralize('time', renewalCount)}`}>\n <ul>{renderRenewals()}</ul>\n </ExpandableContent>,\n );\n }\n\n return html;\n };\n\n const [renewing, setRenewing] = useState(false);\n\n const showRevoke = useMemo(() => {\n return issued && isGov;\n }, [issued, isGov]);\n\n const renderOutputActionContent = () => {\n if (renewing) {\n return (\n <RenewalManager\n output={props.output}\n onCancelClick={() => { setRenewing(false); }}\n variation={props.style}\n />\n );\n }\n\n return (\n <ul className='output-actions'>\n { props.output.is_currently_renewable\n && (\n <li>\n <button\n type='button'\n onClick={(e) => { e.preventDefault(); setRenewing(true); }}\n >\n Renew\n </button>\n </li>\n )}\n {showRevoke && (\n <li>\n <RevokeButton output={props.output} />\n </li>\n )}\n <li>\n {renderDownloadLink()}\n </li>\n </ul>\n );\n };\n\n const renderDownloadLink = () => {\n if (!props.output.revoked) {\n return (\n <OutputDownloadLink output={props.output} />\n );\n }\n return (\n <button\n type='button'\n disabled\n className='disabled output-downloadlink'\n >\n <span>Download</span>\n </button>\n );\n };\n\n function renderExpanded() {\n return (\n <div className={`output-mainwrap`}>\n\n {renderRenewalInfo()}\n\n <OutputDetails output={props.output} style={props.style} />\n\n <RenewalOptOutLink\n output={props.output}\n admin={CityGrows.Server.admin}\n />\n {renderOutputActionContent()}\n </div>\n );\n }\n\n return (\n <div className={`output ${classNameForStyle()} ${classNameForStatus()}`}>\n\n <div style={{ display: 'flex' }}>\n <i className='icon-doc' />\n <div className='doc-title'>\n {renderHeaderDocumentLink()}\n </div>\n\n {renderStatusTag()}\n </div>\n\n {expanded && renderExpanded()}\n </div>\n );\n};\n\nOutput.propTypes = {\n output: PropTypes.shape({\n id: PropTypes.isRequired,\n expired: PropTypes.bool.isRequired,\n expires: PropTypes.bool.isRequired,\n expires_at: PropTypes.string.isRequired,\n is_currently_renewable: PropTypes.bool.isRequired,\n issued: PropTypes.bool.isRequired,\n issued_at: PropTypes.string.isRequired,\n name: PropTypes.string.isRequired,\n renewal: PropTypes.bool.isRequired,\n revoked: PropTypes.bool.isRequired,\n }).isRequired,\n style: PropTypes.string,\n isCustomResult: PropTypes.bool,\n collapse: PropTypes.bool,\n};\n\nOutput.defaultProps = {\n style: 'normal',\n collapse: false,\n};\n\nexport default Output;\n","import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport InitiatedFlowAPI from 'apis/initiated-flow-api';\nimport File from './documents_and_files/file'\nimport DownloadLinks from './documents_and_files/download-links'\nimport Output from 'components/initiated_flow/process/output/output';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport FileInput from 'components/shared/file-input';\nimport { reject } from 'underscore';\n\nconst DocumentsAndFiles = ({\n initiatedFlowId,\n issuedOutputs,\n}) => {\n const [isLoading, setIsLoading] = useState(false);\n const [isUploading, setIsUploading] = useState(false);\n const [files, setFiles] = useState([]);\n const [repoFiles, setRepoFiles] = useState([]);\n\n useEffect(() => {\n setIsLoading(true);\n\n InitiatedFlowAPI.\n documentsAndFiles(initiatedFlowId).\n done((res) => setFiles(res.files)).\n done((res) => setRepoFiles(res.repo_files)).\n always(() => setIsLoading(false));\n }, []);\n\n const removeFile = (id) => {\n setRepoFiles([...reject(repoFiles, { id })]);\n };\n\n const onFileSelect = (e) => {\n const file = e.currentTarget.files[0];\n setIsUploading(true);\n\n InitiatedFlowAPI.\n uploadRepoFile(initiatedFlowId, file).\n done((res) => setRepoFiles([...repoFiles, res.repo_file])).\n always(() => setIsUploading(false));\n };\n\n const renderOutputs = () => {\n const outputsNodes = issuedOutputs.map((o) => {\n return (\n <div key={o.id} className='margins'>\n <Output\n output={o}\n style='mini'\n collapse\n />\n </div>\n );\n });\n\n return (\n <div>\n <h3>Outputs</h3>\n {outputsNodes}\n </div>\n );\n };\n\n const renderFiles = () => {\n const filesNodes = files.map((f) => {\n return (\n <div key={f.id} className='margins'>\n <File file={f} isStepFile />\n </div>\n );\n });\n\n const repoFilesNodes = repoFiles.map((f) => {\n return (\n <div key={f.id} className='margins'>\n <File file={f} initiatedFlowId={initiatedFlowId} removeFile={removeFile} />\n </div>\n );\n });\n\n const anyFile = !!(filesNodes.length || repoFilesNodes.length);\n\n const uploadAction = () => {\n return (\n <div className='ifslidingpanel-upload-repo-file'>\n {isUploading\n ? <>\n <LoadingSpinner size='tiny' className='vmiddle' />\n <span className='color-text-medium'>Uploading...</span>\n </>\n : <FileInput onChange={onFileSelect} label='+ Upload new file' />\n }\n </div>\n );\n }\n\n return (\n <div>\n <div style={{ display: 'flex' }}>\n <h3>Files</h3>\n {uploadAction()}\n </div>\n {filesNodes}\n {repoFilesNodes}\n {anyFile && (\n <DownloadLinks outputId={issuedOutputs[0].id} />\n )}\n </div>\n );\n };\n\n return (\n <>\n {renderOutputs()}\n {isLoading\n ? <LoadingSpinner size='medium' className='vmiddle' />\n : renderFiles()}\n </>\n );\n};\n\nDocumentsAndFiles.propTypes = {\n initiatedFlowId: PropTypes.number.isRequired,\n issuedOutputs: PropTypes.array,\n onCloseClick: PropTypes.func,\n transitionRef: PropTypes.object,\n};\n\nexport default DocumentsAndFiles;\n","import React from 'react';\nimport NProgress from 'nprogress';\nimport PropTypes from 'prop-types';\n\nconst Menu = (props) => {\n function renderAdditionaPaymentButton() {\n if (props.admin) {\n return (\n <a\n className='ifslidingpanel-button'\n onClick={onRequestPaymentClicked}\n href={`/initiated_flows/${props.initiatedFlowId}/supplemental_requirements?type=PaymentRequirement`}\n data-method='POST'\n >\n\n <div className='ifslidingpanel-btniconwrap'>\n <i className='vmiddle icon-money-grey vbottom bigger' />\n </div>\n Request additional payment\n </a>\n );\n }\n }\n\n function onRequestPaymentClicked() {\n NProgress.start();\n }\n\n return (\n <div className='margin-top'>\n {renderAdditionaPaymentButton()}\n </div>\n );\n};\n\nMenu.propTypes = {\n initiatedFlowId: PropTypes.number.isRequired,\n admin: PropTypes.bool.isRequired,\n activeFlow: PropTypes.bool.isRequired,\n personAttachments: PropTypes.array.isRequired,\n onCloseClick: PropTypes.func,\n teamId: PropTypes.number,\n};\n\nexport default Menu;\n","function valid(step) {\n const noErrors = errors(step).length === 0;\n\n if (step.type === 'CollectInfoStep') {\n return noErrors;\n }\n return noErrors;\n}\n\nfunction errors(step) {\n return step.problems;\n}\n\nconst ActiveStepValidator = {\n valid(step) {\n return valid(step);\n },\n\n errors(step) {\n return errors(step);\n },\n};\n\nexport default ActiveStepValidator;\n","import React from 'react';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\nimport InitiatedFlowActions from 'actions/initiated-flow-actions';\nimport AlertConfirm from 'modules/alert-confirm';\n\nclass AddlOptions extends React.Component {\n state = {\n open: false,\n };\n\n toggleOpen = () => {\n this.setState({ open: !this.state.open });\n };\n\n onClose = () => {\n this.setState({ open: false });\n };\n\n canHalt = () => {\n return (!this.props.initiatedFlow.halted && !this.props.initiatedFlow.finished_at);\n };\n\n canDelete = () => {\n return !!this.props.admin;\n };\n\n canUnhalt = () => {\n return (this.props.initiatedFlow.halted && !this.props.initiatedFlow.finished_at);\n };\n\n notClearedToUnhalt = () => {\n return (this.props.initiatedFlow.halted_by_admin && !this.props.admin);\n };\n\n confirmDelete = (e) => {\n e.preventDefault();\n\n const body = (\n <span>\n <span className='color-alert bold'>Warning: </span>\n Deleting a submission makes it unavailable to all users. This is not recommended.\n </span>\n );\n\n AlertConfirm.confirm('Delete submission?', body, () => { InitiatedFlowActions.deleteProcess(this.props.initiatedFlow.id); });\n };\n\n renderOptions = () => {\n const options = [];\n if (this.canHalt()) {\n options.push(<li key='halt'><a href={`/initiated_flows/${this.props.initiatedFlow.id}/do_halt`} data-method='post'>Halt submission</a></li>);\n } else if (this.notClearedToUnhalt()) {\n options.push(<li className='disabled' key='halt-disabled'><span className='text-alert' href='#'>Resume submission (halted by admin)</span></li>);\n } else if (this.canUnhalt()) {\n options.push(<li key='unhalt'><a className='text-success' href={`/initiated_flows/${this.props.initiatedFlow.id}/do_unhalt`} data-method='post'>Resume submission</a></li>);\n } else {\n options.push(<li className='disabled' key='halt-disabled'><span className='text-alert' href='#'>Halt submission</span></li>);\n }\n\n if (this.canDelete()) {\n options.push(<li key='delete'><a className='text-alert' href='#' onClick={this.confirmDelete}>Delete submission</a></li>);\n }\n\n return <ul className='popup-listmenu'>{options}</ul>;\n };\n\n render() {\n return (\n <CloseIfOutsideWrapper onClose={this.onClose}>\n <button\n onClick={this.toggleOpen}\n className={`${this.props.className} btn-link ellipsispopup-blue${this.state.open ? ' active' : ''}`}\n title='Additional Options'\n type='button'\n >\n <div className='popup'>\n <div className='popup-nub-down' />\n {this.renderOptions()}\n </div>\n </button>\n </CloseIfOutsideWrapper>\n );\n }\n}\n\nexport default AddlOptions;\n","import React from 'react';\nimport Modal from 'components/shared/modal';\nimport { publicHost } from 'modules/url-generator';\n\nclass Support extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n questionViewOpen: false,\n technicalIssueViewOpen: false,\n };\n }\n\n showQuestionView = (e) => {\n e.preventDefault();\n this.setState({ questionViewOpen: true });\n };\n\n closeSupportWindow() {\n this.props.onOutsideClick();\n }\n\n onOpenDiscussionClick = (e) => {\n e.preventDefault();\n\n /* TODO use router to open discussion instead of callback.\n ** adding discussion component to router will require react-css-transition upgrade\n in order to add css transitions to router components\n */\n this.props.onOpenDiscussionClick(e);\n this.closeSupportWindow();\n };\n\n onSupportRequested = (e) => {\n e.preventDefault();\n this.setState({ technicalIssueViewOpen: true });\n };\n\n renderQuestionView() {\n return (\n <section className='align-center'>\n <h1>Has your question already been answered?</h1>\n\n <div>\n <a id='checkthefaqbutton' className='btn-primary' target='_blank' href={`${publicHost()}/${this.props.teamSlug}/${this.props.masterTemplateSlug}/faqs`} rel='noreferrer'>\n Check the FAQs\n <i className='icon-external-white' />\n </a>\n </div>\n\n <div className='color-text-medium'>Can't find what you're looking for?</div>\n <a href='#' className='support-discussionlink' onClick={this.onOpenDiscussionClick}>Try opening a discussion</a>\n </section>\n );\n }\n\n renderTechnicalIssueView() {\n return (\n <section className='support-technicalissueview align-center'>\n <h1>Have a technical question about the ClearForms website?</h1>\n\n <div>\n <span>Contact <a href='mailto:support@cleargov.com'>support@cleargov.com</a> and our Support team will be happy to assist you.</span>\n </div>\n </section>\n );\n }\n\n renderInitialView() {\n return (\n <section className='align-center'>\n <h1>What do you need help with?</h1>\n\n <ul className='support-menu' style={{ display: 'inline-block' }}>\n <li onClick={this.showQuestionView} id='processquestionbutton'>\n <i className='icon-building-primary' />\n <span>I have a question about this form</span>\n </li>\n\n <li onClick={this.onSupportRequested}>\n <i className='icon-wrench-primary' />\n <span>The website isn't working properly</span>\n </li>\n </ul>\n </section>\n );\n }\n\n renderView() {\n if (this.state.questionViewOpen) {\n return this.renderQuestionView();\n }\n if (this.state.technicalIssueViewOpen) {\n return this.renderTechnicalIssueView();\n }\n return this.renderInitialView();\n }\n\n render() {\n return (\n <Modal className='support' onOutsideClick={this.props.onOutsideClick}>\n { this.renderView() }\n </Modal>\n );\n }\n}\n\nexport default Support;\n","var create = function(activeStepId, dataURI){\n var url = '/active_steps/' + activeStepId + '/signings';\n var request = $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n signing: {\n signature: dataURI\n }\n }\n });\n\n return request;\n};\n\nexport default {\n create: create\n};","import SignatureAPI from '../apis/signing-api';\n\nconst sign = function (activeStepId, dataURI) {\n const request = SignatureAPI.create(activeStepId, dataURI);\n return request;\n};\n\nexport default {\n sign,\n};\n","import React, {useState, useRef, useEffect } from 'react';\nimport SignaturePad from 'react-signature-canvas';\nimport Flash from 'components/shared/flash';\nimport SignatureActions from 'actions/signature-actions';\nimport _ from 'underscore';\nimport NProgress from 'nprogress';\nimport useFocusTrap from 'components/hooks/use-focus-trap';\n\nconst SignaturePrompt = (props) => {\n const [submitting, setSubmitting] = useState(false);\n const [signed, setSigned] = useState(false);\n const [error, setError] = useState(false);\n const [name, setName] = useState('');\n const signaturePad = useRef();\n const focusEl = useFocusTrap(onCancelClick);\n\n useEffect(() => {\n if (signaturePad.current) {\n signaturePad.current.off();\n }\n }, []);\n\n function addText() {\n setSigned(false);\n const canvas = signaturePad.current.getCanvas();\n signaturePad.current.clear();\n\n const ctx = canvas.getContext('2d');\n ctx.font = '30px Brush Script MT, cursive';\n ctx.fillText(name, 200, 40);\n if (name.length > 0) { \n setError(false); \n setSigned(true);\n }\n }\n\n function onSignClick(e) {\n e.preventDefault();\n \n if (!signed) {\n setError(true);\n return;\n }\n\n setSubmitting(true);\n NProgress.start();\n\n SignatureActions.sign(props.activeStepId, signaturePad.current.getTrimmedCanvas().toDataURL())\n .done(onSuccess)\n .fail(onFail)\n .always(() => {\n setSubmitting(false);\n NProgress.done();\n });\n }\n\n function onCancelClick (e) {\n e.preventDefault();\n props.onCancel();\n }\n\n function onSuccess (res) {\n if (_.isFunction(props.onSuccess)) {\n props.onSuccess(res);\n }\n }\n\n function onFail () {\n Flash.render({\n type: 'error',\n message: 'Oops, that didn\\'t work. If you continue to experience problems, please contact support.',\n });\n }\n\n function renderError() {\n if (error) {\n return <div className='text-alert margin-top-less'>A signature is required in order to continue</div>;\n }\n }\n\n return (\n <div id='signaturerequester' className='popup' ref={focusEl}>\n <h1>Signature</h1>\n <label><span>Please sign. By signing, you certify that the information you're about to submit is true and correct to the best of your knowledge.</span></label>\n <SignaturePad\n canvasProps={{ width: 600, height: 50, className: 'sigCanvas' }}\n ref={signaturePad}\n minWidth={2}\n maxWidth={5}\n />\n {renderError()}\n <div className='signaturerequester-footer cf'>\n <label className='inline-block'>Name\n <input type='text' placeholder='Enter Name' onChange={(e) => { setName(e.target.value); }} value={name} />\n </label>\n <button className='btn-primary inline-block' type='submit' onClick={addText}>Sign</button>\n <div>\n <div className='float-right'>\n <button onClick={onCancelClick} className='btn-secondary signaturerequester-cancelbutton margin-right'>Cancel</button>\n <button onClick={onSignClick} disabled={submitting} className={`btn-primary margin-left ${submitting ? 'disabled' : ''}`}>Submit</button>\n </div>\n </div>\n </div>\n </div>\n );\n};\n\nexport default SignaturePrompt;\n","import React from 'react';\nimport ReactDOM from 'react-dom'\nimport renderer from 'modules/renderer';\nimport _ from 'underscore';\nimport Shield from './shield';\nimport SignaturePrompt from '../components/module_views/signature-prompt';\n\nlet el;\nlet _promise;\n\nfunction requestSignature(activeStepId) {\n _promise = $.Deferred();\n\n Shield.on();\n\n let $container = $('#signaturerequesterwrap');\n if ($container.length === 0) {\n $container = $('<div id=\"signaturerequesterwrap\">');\n $('body').append($container);\n }\n\n el = renderer(\n <SignaturePrompt activeStepId={activeStepId} onSuccess={onSuccess} onCancel={onCancel} />,\n document.getElementById('signaturerequesterwrap'),\n );\n\n return _promise;\n}\n\nfunction onSuccess(res) {\n unmount();\n _promise.resolve(res);\n}\n\nfunction onCancel() {\n unmount();\n _promise.resolve(false);\n}\n\nfunction unmount() {\n ReactDOM.unmountComponentAtNode(document.getElementById('signaturerequesterwrap'));\n Shield.off();\n}\n\nexport default {\n requestSignature,\n};\n","import AlertConfirm from 'modules/alert-confirm';\nimport SignaturePrompt from 'modules/signature-prompt';\n\n\nclass AdvancementHandler {\n constructor(isAdmin, step, currentStepId, activeStep){\n this.isAdmin = isAdmin;\n this.step = step;\n this.currentStepId = currentStepId;\n this.activeStep = activeStep;\n\n this.promise = $.Deferred();\n }\n\n attemptAdvance(){\n this.isAdmin ? this.attemptAdminAdvance() :\n this.attemptConstituentAdvance();\n\n return this.promise;\n }\n\n attemptAdminAdvance(){\n if(this.shouldShowNoPaymentWarning()){\n AlertConfirm.confirm('Continue without payment?', 'No payment has been made. Are you sure you want to continue?', () => {\n this.resolveAdvance();\n });\n } else if(this.requiresSignature()) {\n AlertConfirm.confirm('Skip signature?', 'This step asks for a signature from the applicant. If you continue, the applicant will not be prompted to sign.', () => {\n this.resolveAdvance();\n });\n } else {\n this.resolveAdvance();\n }\n }\n\n attemptConstituentAdvance(){\n if(this.shouldShowCantModifyWarning()){\n AlertConfirm.confirm('This info cannot be modified', 'This information cannot be modified after it has been submitted. Are you sure you want to continue?', () => {\n if(this.requiresSignature()){\n this.requestSignature();\n } else {\n this.resolveAdvance();\n }\n });\n } else if(this.requiresSignature()){\n this.requestSignature();\n } else if(this.shouldShowNoPaymentWarning()){\n AlertConfirm.confirm('Continue without payment?', 'No payment has been made. Are you sure you want to continue?', () => {\n this.resolveAdvance();\n });\n } else {\n this.resolveAdvance();\n }\n }\n\n resolveAdvance(){\n this.promise.resolve(true);\n }\n\n shouldShowCantModifyWarning = () => {\n return (this.step.type === 'CollectInfoStep') &&\n !this.step.revisable &&\n this.currentStepId === this.step.id;\n }\n\n requiresSignature = () => {\n\n // When you make a step internal, the\n // settings for signatures go away.\n\n return this.step.requires_signature &&\n this.activeStep.needs_signature &&\n this.step.external;\n }\n\n requestSignature = () => {\n SignaturePrompt.requestSignature(this.activeStep.id)\n .done((sig) => {\n if(sig){\n this.resolveAdvance();\n }\n });\n }\n\n shouldShowNoPaymentWarning = () => {\n return (this.step.type === 'PaymentStep')\n && !this.activeStep.paid\n && this.currentStepId === this.step.id;\n };\n}\n\nexport default AdvancementHandler;\n","import React, { useState, useRef, useContext } from 'react';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport PropTypes from 'prop-types';\nimport StepValidator from 'modules/active-step-validator';\nimport FlowConstants from 'constants/initiated-flow-constants';\nimport { CSSTransition } from 'react-transition-group';\nimport AddlOptions from './if_control_nav/addl-options';\nimport Support from './if_control_nav/support';\nimport AdvancementHandler from './if_control_nav/advancement-handler';\nimport InitiatedFlowAPI from '../../../apis/initiated-flow-api';\nimport { some } from 'underscore';\n\nconst IFControlNav = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const {\n initiatedFlow, activeStep, step, refreshing,\n } = props.initiatedFlowState;\n const submitButton = useRef();\n const [supportOpen, setSupportOpen] = useState(false);\n const [advancing, setAdvancing] = useState(false);\n\n function hasUnfinishedSubprocesses() {\n return some(initiatedFlow.subprocess_requirements, (sub) => { return !sub.completed && !sub.waived_at });\n }\n\n function readyToAdvance() {\n return !initiatedFlow.halted\n && !initiatedFlow.finished_at\n && StepValidator.valid(activeStep);\n }\n\n function renderAddlOptions() { \n return (\n <AddlOptions\n className='ifcontrolnav-addloptions'\n admin={props.admin}\n initiatedFlow={initiatedFlow}\n />\n );\n }\n\n function nextStepButtonContent() {\n const spinner = <div className='progress white'><div>Loading</div></div>;\n return refreshing ? spinner : nextStepButtonText();\n }\n\n function nextStepButtonText() {\n if (initiatedFlow.halted) {\n return 'Submission halted';\n }\n\n if (initiatedFlow.finished_at) {\n if (isSubprocess()) {\n return (\n <span><span className='mobile-hidden'>Sub-submission complete. </span>Return to parent submission.</span>\n );\n }\n\n return (\n <span>This submission was completed</span>\n );\n }\n\n if (step.is_last) { return 'Complete this submission'; }\n\n if (props.taskView) { return 'Complete Step'}\n\n return 'Go to next step >';\n }\n\n function onLastStepOfIncompleteProcess() {\n const onLastStep = initiatedFlow.steps.length === step.position;\n const onCurrentStep = initiatedFlow.current_step.position === step.position;\n return onLastStep && !onCurrentStep;\n }\n\n function userCanAdvance() {\n return ((props.admin\n || initiatedFlow.current_step.external\n || step.position < initiatedFlow.current_step.position)\n && !onLastStepOfIncompleteProcess());\n }\n\n function handleAdvanceAttempt() {\n dispatch({\n type: FlowConstants.ADVANCE_ATTEMPTED,\n });\n }\n\n function requiredActions() {\n return activeStep.required_actions.map((action) => {\n const names = (action.users.length\n ? action.users.map((user) => { return user.name; }).join(', ')\n : 'An admin');\n\n return {\n solution: action.solution,\n names,\n };\n });\n }\n\n function taskViewSubmit() {\n return InitiatedFlowAPI.doNextStep(initiatedFlow.id, activeStep.step_id)\n .done(() => {\n props.onAdvance();\n })\n }\n\n function onTaskViewSubmit() {\n // Prevent advanceattempts\n if (advancing) { return; }\n\n const { admin } = props;\n\n const advancer = new AdvancementHandler(admin, step, initiatedFlow.current_step.id, activeStep);\n\n advancer.attemptAdvance()\n .done((willAdvance) => {\n if (willAdvance) {\n setAdvancing(true);\n taskViewSubmit();\n }\n });\n }\n\n function onSubmitClick(e) {\n e.preventDefault();\n\n // Prevent advanceattempts\n if (advancing) { return; }\n\n const { admin } = props;\n\n const advancer = new AdvancementHandler(admin, step, initiatedFlow.current_step.id, activeStep);\n\n advancer.attemptAdvance()\n .done((willAdvance) => {\n if (willAdvance) {\n setAdvancing(true);\n submitButton.current.click();\n }\n });\n }\n\n function onSupportButtonClick(e) {\n e.preventDefault();\n setSupportOpen(!supportOpen);\n }\n\n function onSupportMessageSent() {\n setTimeout(closeSupportWindow.bind(this), 2000);\n }\n\n function closeSupportWindow() {\n setSupportOpen(false);\n }\n\n function renderSupportModal() {\n if (supportOpen) {\n return (\n <Support\n masterTemplateId={props.masterTemplateId}\n masterTemplateSlug={props.masterTemplateSlug}\n teamSlug={props.teamSlug}\n onMessageSent={onSupportMessageSent}\n onOutsideClick={closeSupportWindow}\n onOpenDiscussionClick={props.onOpenDiscussionClick}\n />\n );\n }\n }\n\n function renderSupportButton() {\n return <a id='supportbutton' onClick={onSupportButtonClick} className='btn-thirdary left' href='#'>Support</a>;\n }\n\n function renderButton() {\n if(props.taskView) {\n return (\n <button className='btn btn-primary' onClick={onTaskViewSubmit}>{nextStepButtonContent()}</button>\n )\n }\n\n return (\n <span>\n <a id='advancebutton' href='#' onClick={onSubmitClick} className='btn-primary'>\n {nextStepButtonContent()}\n </a>\n\n {/* TODO: why isn't this a window.location.href = assignment up above? */}\n <a\n ref={submitButton}\n className='hidden'\n data-method='post'\n href={`/initiated_flows/${initiatedFlow.id}/do_next_step?step_id=${activeStep.step_id}`}\n />\n </span>\n )\n }\n\n function renderSubmitButton() {\n if (userCanAdvance() && step.is_last && props.taskView && initiatedFlow.unfinished_requirements) {\n return (\n <div className='text-alert bold'>\n This submission has incomplete additional requirements. <a className='mytasks-submissionlink btn-link' href={`initiated_flows/${initiatedFlow.id}`} target='_blank'>View Submission</a>\n </div>\n )\n }\n\n if (userCanAdvance() && step.is_last && props.taskView && hasUnfinishedSubprocesses()) {\n return (\n <div className='text-alert bold'>\n This submission has incomplete sub-submissions. <a className='mytasks-submissionlink btn-link' href={`initiated_flows/${initiatedFlow.id}`} target='_blank'>View Submission</a>\n </div>\n )\n }\n\n if (userCanAdvance() && readyToAdvance()) {\n return renderButton()\n }\n\n if (userCanAdvance() && isCompletedSubprocess()) {\n return (\n <a id='returntoparentbutton' href={`/initiated_flows/${initiatedFlow.parent_process.id}`} className='btn-primary'>\n {nextStepButtonContent()}\n </a>\n );\n }\n\n return <span id='submitbutton' className='btn-primary disabled' onClick={handleAdvanceAttempt}>{nextStepButtonContent()}</span>;\n }\n\n function isSubprocess() {\n return !!initiatedFlow.parent_process.id;\n }\n\n function isCompletedSubprocess() {\n return initiatedFlow.finished_at && isSubprocess();\n }\n\n function renderCurrentStepButton() {\n return (\n <span>\n <a href={`/initiated_flows/${initiatedFlow.id}`} className='btn-primary'>\n Go to Current Step\n </a>\n </span>\n );\n }\n\n const waitingOnConditional = (\n !props.admin\n && initiatedFlow.current_step.external\n && props.initiatedFlowState.advanceAttempted\n && !!requiredActions().length\n );\n\n function renderButtonExtra() {\n return (\n <>\n <CSSTransition\n classNames='waiting-on'\n timeout={618}\n in={waitingOnConditional}\n mountOnEnter\n unmountOnExit\n >\n <span className='ifcontrolnav-waiting-on popup noshadow'>\n <span className='popup-nub-left' />\n <div>\n <i className='icon-x-red smaller' />\n <strong className='text-smaller'><span className='capitalize'>{requiredActions()[0]?.names}</span> must {requiredActions[0]?.solution}</strong>\n </div>\n </span>\n </CSSTransition>\n </>\n )\n }\n\n if (props.taskView) { \n return (\n <div className='ifcontrolnav align-center padded'>\n {renderSubmitButton()}\n {renderButtonExtra()}\n </div>\n )\n }\n\n return (\n <>\n <div className='ifcontrolnav'>\n <div className='float-left mobile-hidden'>\n {renderSupportButton()}\n </div>\n <div className='float-right'>\n {renderAddlOptions()}\n <span className='margin-left-more'>\n {step.generic_type === 'Step' ? renderSubmitButton() : renderCurrentStepButton()}\n </span>\n\n {renderButtonExtra()}\n </div>\n </div>\n\n {renderSupportModal()}\n </>\n );\n};\n\nIFControlNav.propTypes = {\n admin: PropTypes.bool,\n initiatedFlow: PropTypes.object,\n step: PropTypes.object,\n masterTemplateId: PropTypes.number,\n masterTemplateSlug: PropTypes.string,\n initialStepInstance: PropTypes.object,\n teamSlug: PropTypes.string,\n onOpenDiscussionClick: PropTypes.func,\n taskView: PropTypes.bool,\n};\n\nexport default IFControlNav;\n","import React from 'react';\nimport Labelbox from 'components/shared/labelbox';\nimport InformationalText from 'components/shared/informational-text';\n\nconst Instructions = ({admin, step, initiatedFlow}) => {\n function renderAdminInstructions() {\n if (!admin || !step.internal_instructions) { return; }\n\n return (\n <InformationalText\n text={step.internal_instructions}\n textType='InternalStepInstructions'\n textContainerId={step.id}\n initiatedFlow={initiatedFlow}\n classes='margin-top'\n />\n );\n }\n\n function renderApplicantInstructions() {\n const placeholder = admin\n ? <span className='color-text-medium'>This step has no applicant instructions</span>\n : '';\n\n const text = !step.external_instructions\n ? placeholder\n : (\n <InformationalText\n text={step.external_instructions}\n textType='ExternalStepInstructions'\n textContainerId={step.id}\n initiatedFlow={initiatedFlow}\n />\n );\n\n if (admin) {\n return (\n <Labelbox label='Applicant Instructions'>\n {text}\n </Labelbox>\n );\n }\n\n return <div className='margin-top'>{text}</div>;\n }\n\n return (\n <>\n {renderAdminInstructions()}\n {renderApplicantInstructions()}\n </>\n );\n};\n\nexport default Instructions;","import PropTypes from 'prop-types';\nimport React, { useContext } from 'react';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport StepDataCollectorInputField from 'components/shared/step-data-collector-input-field';\nimport CollectInfoStepActions from 'actions/collect-info-step-actions';\nimport { validate } from 'modules/collected-data-validator';\nimport InformationalText from 'components/shared/informational-text';\nimport { filter, any, contains } from 'underscore';\n\nconst CollectInfoSection = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n function firstErrorId() {\n const firstDatumWithError = props.stepData.find((stepDatum) => {\n const { fieldValue } = collectedDatumAttrsForInputField(stepDatum);\n return !fieldValid(fieldValue, stepDatum);\n });\n\n if (firstDatumWithError === undefined) {\n return null;\n }\n\n return firstDatumWithError.id;\n }\n\n function fieldValid(input, stepDatum) {\n return !stepDatum.required || validate(input, stepDatum);\n }\n\n function getCollectedDatum(stepDatumId) {\n return props.collectedData.find((collectedDatum) => {\n return collectedDatum.step_datum_id === stepDatumId;\n });\n }\n\n function collectedDatumAttrsForInputField(stepDatum) {\n const collectedDatum = getCollectedDatum(stepDatum.id);\n\n return {\n fieldValue: collectedDatumValue(stepDatum.data_type, collectedDatum),\n version: collectedDatumVersion(collectedDatum),\n };\n }\n\n function collectedDatumVersion(collectedDatum) {\n return collectedDatum ? collectedDatum.version : 1;\n }\n\n function collectedDatumValue(dataType, collectedDatum) {\n if (dataType === 'file') {\n return collectedDatum ? collectedDatum.files : [];\n }\n return collectedDatum ? collectedDatum.content : null;\n }\n\n function onFieldDataChanged(stepDatumId, fieldValue, version) {\n CollectInfoStepActions.dataChanged(\n dispatch,\n stepDatumId,\n props.initiatedFlow.id,\n fieldValue,\n version,\n props.step.generic_type,\n );\n }\n\n function isStepLocked() {\n return props.locked || (!props.external && !props.admin);\n }\n\n function isFieldLocked(fieldId) {\n return contains(props.lockedFields, String(fieldId));\n }\n\n function renderField(stepDatum) {\n const { fieldValue, version } = collectedDatumAttrsForInputField(stepDatum);\n const firstError = !!(stepDatum.id === firstErrorId);\n\n return (\n <StepDataCollectorInputField\n key={stepDatum.id}\n admin={props.admin}\n onInputChanged={onFieldDataChanged}\n stepDatum={stepDatum}\n templateId={props.step.flow_template_id}\n initiatedFlowId={props.initiatedFlow.id}\n teamId={props.teamId}\n fieldValue={fieldValue}\n firstError={firstError}\n version={version}\n attemptedAdvance={props.attemptedAdvance}\n persistBeforeSubmit\n lockedFields={props.lockedFields}\n isStepLocked={isStepLocked()}\n isFieldLocked={isFieldLocked(stepDatum.id)}\n disabled={isStepLocked() || isFieldLocked(stepDatum.id)}\n activeStepId={props.activeStepId}\n />\n );\n }\n\n function renderFields() {\n return fieldsToRender().map((stepDatum, index) => renderField(stepDatum, index));\n }\n\n function fieldsToRender() {\n return filter(props.section.step_data, (stepDatum) => {\n if (!props.external && stepDatum.redacted && !props.admin) { return false; }\n\n return true;\n });\n }\n\n function noViewableInstructions() {\n if (!props.section.instructions) { return true; }\n\n return (!props.external && !props.admin);\n }\n\n function renderInstructions() {\n if (noViewableInstructions()) { return; }\n\n return (\n <InformationalText\n text={props.section.instructions}\n textType='SectionInstructions'\n textContainerId={props.section.id}\n initiatedFlow={props.initiatedFlow}\n />\n );\n }\n\n if (!any(fieldsToRender()) && noViewableInstructions()) {\n return null;\n }\n\n return (\n <div className='collectinfosection'>\n <div className='collectinfosection-title'>{props.section.name_or_default}</div>\n\n {renderInstructions()}\n\n <div className='collectinfosection-body'>\n {renderFields()}\n </div>\n </div>\n );\n};\n\nCollectInfoSection.propTypes = {\n locked: PropTypes.bool.isRequired,\n stepData: PropTypes.array.isRequired,\n collectedData: PropTypes.array.isRequired,\n initiatedFlow: PropTypes.shape({\n id: PropTypes.number.isRequired,\n }).isRequired,\n section: PropTypes.shape({\n step_data: PropTypes.array.isRequired,\n name_or_default: PropTypes.string.isRequired,\n instructions: PropTypes.string,\n id: PropTypes.number,\n }),\n step: PropTypes.shape({\n flow_template_id: PropTypes.number.isRequired,\n generic_type: PropTypes.string.isRequired,\n }).isRequired,\n teamId: PropTypes.number.isRequired,\n admin: PropTypes.bool.isRequired,\n external: PropTypes.bool.isRequired,\n};\n\nexport default CollectInfoSection;\n","import React from 'react';\nimport SignaturePrompt from 'modules/signature-prompt';\nimport dayjs from 'dayjs';\n\nimport _ from 'underscore';\n\nclass SignatureDetails extends React.Component {\n renderMostRecentSigning = () => {\n if (!this.wasEverSigned()) { return; }\n\n const signing = _.first(this.props.signings);\n const altText = `Image of ${signing.user.name}'s signature`;\n const titleText = `${signing.user.name}'s signature`;\n if (signing) {\n return (\n <div onClick={this.onSignLinkClicked} className='clickable signaturebox-sigline'>\n <span className='signaturebox-x'>x</span>\n <img src={signing.signature.url} alt={altText} title={titleText} />\n </div>\n );\n }\n };\n\n renderSignings = () => {\n return this.props.signings.map(this.renderSigning);\n };\n\n renderSigning = (signing) => {\n return (\n <div className='margin-bottom-less'>\n Signed by {signing.user.name} <strong>{dayjs(signing.created_at).format('LLL')}</strong>\n </div>\n );\n };\n\n onSignLinkClicked = (e) => {\n e.preventDefault();\n\n if (this.props.admin) { return; }\n\n SignaturePrompt.requestSignature(this.props.activeStepId)\n .done((sig) => {\n if (sig) {\n window.location.reload();\n }\n });\n };\n\n renderInfo = () => {\n if (this.props.needsSignature) {\n let action;\n if (!this.props.admin) {\n action = <a onClick={this.onSignLinkClicked} href='#'>Sign it again</a>;\n }\n return (\n <div className='margin-bottom'>This information has been updated since it was signed for. {action}</div>\n );\n }\n };\n\n wasEverSigned = () => {\n const signing = _.first(this.props.signings);\n return !!signing;\n };\n\n render() {\n if (this.wasEverSigned()) {\n return (\n <div className='signaturebox margin-bottom'>\n <div><span className='subtitle'>Signature</span></div>\n {this.renderInfo()}\n {this.renderMostRecentSigning()}\n {this.renderSignings()}\n </div>\n );\n }\n\n return <div />;\n }\n}\n\nexport default SignatureDetails;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport InlineNotification from 'components/shared/inline-notification';\nimport CollectInfoSection from './collect-info/collect-info-section';\nimport SignatureDetails from './collect-info/signature-details';\nimport { findWhere } from 'underscore'\n\nconst CollectInfoStep = (props) => {\n function stepData() {\n let steps = [];\n props.step.sections.forEach((section) => {\n const array = [...section.step_data];\n steps = [...steps, ...array];\n });\n return steps;\n }\n\n function renderSectionIfVisible(section) {\n if (shouldRenderSection(section)) {\n return (\n <CollectInfoSection\n lockedFields={props.activeStep.locked_fields}\n activeStepId={props.activeStep.id}\n key={section.id}\n section={section}\n collectedData={props.collectedData}\n initiatedFlow={props.initiatedFlow}\n step={props.step}\n stepData={stepData()}\n teamId={props.teamId}\n admin={props.admin}\n locked={props.activeStep.locked}\n attemptedAdvance={props.attemptedAdvance}\n external={props.step.external}\n />\n );\n }\n }\n\n function shouldRenderSection(section) {\n if (!section.logic_config) { return true; }\n\n const evaluatedLogicConfig = findWhere(\n props.activeStep.logic_configs,\n { id: section.logic_config.id },\n );\n\n return evaluatedLogicConfig.show;\n }\n\n function renderSections() {\n return props.step.sections.map(renderSectionIfVisible)\n }\n\n function renderAdmin() {\n return (\n <>\n {renderAdminLockInfo()}\n {renderSections()}\n </>\n );\n }\n\n function renderAdminLockInfo() {\n if (!props.activeStep.locked) { return; }\n\n return (\n <InlineNotification\n type='notice'\n className='margin-bottom-more'\n >\n This step is locked. To make edits, unlock it by clicking the lock icon in the step listing on the left.\n </InlineNotification>\n );\n }\n\n function renderPublicLockInfo() {\n if (!props.activeStep.locked) { return; }\n\n return (\n <InlineNotification\n type='notice'\n className='margin-bottom-more'\n >\n This step is locked and cannot be edited. If you need to make edits, you can request that it be unlocked using the discussion feature in the upper right.\n </InlineNotification>\n );\n }\n\n function renderPublic() {\n if (props.step.external) {\n return (\n <>\n {renderPublicLockInfo()}\n {renderSections()}\n </>\n );\n }\n\n return (\n <>\n <p>Submission is in progress. No additional information is needed from you at this time.</p>\n {renderSections()}\n </>\n );\n }\n\n function renderSignatures() {\n if (!props.signaturesAllowed) { return; }\n\n return (\n <SignatureDetails\n signings={props.activeStep.signings}\n needsSignature={props.activeStep.needs_signature}\n activeStepId={props.activeStep.id}\n admin={props.admin}\n />\n );\n }\n\n return (\n <div className='currentstep-stepsection'>\n {props.admin ? renderAdmin() : renderPublic()}\n {renderSignatures()}\n </div>\n );\n};\n\nCollectInfoStep.propTypes = {\n activeStep: PropTypes.shape(),\n admin: PropTypes.bool.isRequired,\n collectedData: PropTypes.array.isRequired,\n initiatedFlow: PropTypes.shape().isRequired,\n locked: PropTypes.bool.isRequired,\n signaturesAllowed: PropTypes.bool.isRequired,\n step: PropTypes.shape().isRequired,\n teamId: PropTypes.number.isRequired,\n};\n\nCollectInfoStep.defaultProps = {\n signaturesAllowed: true,\n locked: false,\n};\n\nexport default CollectInfoStep;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport AttachedPeople from 'components/shared/attached-people';\n\nconst AssignResponsibilityStep = (props) => {\n const stepIsCompleted = () => {\n return props.step.position < props.initiatedFlow.current_step.position;\n };\n\n const renderCompletedAdminView = () => {\n return (\n <div>\n <p>This step has been completed. You can manage who is assigned using the menu in the upper right.</p>\n </div>\n );\n };\n\n const renderAdminView = () => {\n if (!stepIsCompleted()) {\n return (\n <AttachedPeople\n people={props.activeStep.tentative_assignments}\n attachableType='ActiveStep'\n attachableId={props.activeStep.id}\n tentativeAssignment\n searchOpts={{ initiatedFlowId: props.initiatedFlow.Id }}\n hideExternal={false}\n allowPseudo\n />\n );\n }\n\n return renderCompletedAdminView();\n };\n\n const renderConstituentView = () => {\n if (!stepIsCompleted()) {\n return (\n <p>Waiting for someone to be assigned to this submission. Nothing is needed from you at this time.</p>\n );\n }\n\n return <p>This step has been completed.</p>;\n };\n\n const renderContent = () => {\n if (props.admin) {\n return renderAdminView();\n }\n return renderConstituentView();\n };\n\n return (\n <div className='currentstep-stepsection'>\n {renderContent()}\n </div>\n );\n};\n\nAssignResponsibilityStep.propTypes = {\n admin: PropTypes.bool.isRequired,\n\n activeStep: PropTypes.object.isRequired,\n currentUserId: PropTypes.number.isRequired,\n\n step: PropTypes.shape({\n id: PropTypes.number.isRequired,\n position: PropTypes.number.isRequired,\n }).isRequired,\n\n initiatedFlow: PropTypes.shape({\n id: PropTypes.number.isRequired,\n current_step: PropTypes.object.isRequired,\n }).isRequired,\n};\n\nexport default AssignResponsibilityStep;\n","function round(value, decimals) {\n return Number(`${Math.round(`${value}e${decimals}`)}e-${decimals}`);\n}\n\nexport default round;\n","import round from 'modules/number-round';\n\nconst STRIPE_FEE_PERCENT = 0.029;\nconst STRIPE_ACH_FEE_PERCENT = 0.008;\nconst STRIPE_FEE_FIXED = 0.3;\nconst CG_FEE_PERCENT = 0.02;\n\nfunction calculateTotalFee(type, amount, noFee = true, customFeePercentage = null) {\n const stripeFee = calculateStripeFee(type, amount, noFee);\n const cgFee = calculateCGFee(amount, customFeePercentage, noFee);\n\n return stripeFee + cgFee;\n}\n\nfunction calculateStripeFee(type, amount, noFee) {\n // fee based on initial amount\n let stripeFee = 0;\n if (type === 'card' && noFee) {\n stripeFee = (amount + STRIPE_FEE_FIXED) / (1 - STRIPE_FEE_PERCENT) - amount;\n } else if (type === 'card') {\n stripeFee = (amount * STRIPE_FEE_PERCENT) + STRIPE_FEE_FIXED;\n } else if (type === 'us_bank_account') {\n const amnt = (amount * STRIPE_ACH_FEE_PERCENT);\n stripeFee = amnt > 5.00 ? 5.00 : amnt;\n }\n\n return round(stripeFee, 2);\n}\n\nfunction calculateCGFee(amount, customFeePercentage, noFee) {\n const feePercentage = customFeePercentage || CG_FEE_PERCENT;\n return noFee ? 0 : round(amount * feePercentage, 2);\n}\n\nexport default calculateTotalFee;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport Accounting from 'accounting';\nimport TimeAgo from 'react-timeago';\n\nclass Receipt extends React.Component {\n refundReason() {\n if (!this.props.admin || !this.props.charge.refund_reason) { return; }\n\n return (\n <div>\n <div className='cell label'>Refund Reason:</div>\n <div className='cell'>{this.props.charge.refund_reason || '---'}</div>\n </div>\n );\n }\n\n checkNumber = () => {\n const number = this.props.activeStep.check_number;\n if (!number || number.length === 0) {\n return;\n }\n\n return (\n <div>\n <div className='cell label'>Check Number:</div>\n <div className='cell'>{number}</div>\n </div>\n );\n };\n\n nonChargeReceipt = () => {\n const paymentMethod = (this.props.activeStep.check_paid_amount ? 'check' : 'cash');\n let amountPaid;\n\n switch (paymentMethod) {\n case 'check':\n amountPaid = this.props.activeStep.check_paid_amount;\n break;\n case 'cash':\n amountPaid = this.props.activeStep.cash_paid_amount;\n break;\n }\n\n const formattedAmount = Accounting.formatMoney(amountPaid / 100);\n\n return (\n <span>\n <div className='receipttable'>\n <div>\n <div className='cell label'>Paid:</div>\n <div className='cell color-green bold'>{formattedAmount}</div>\n </div>\n\n <div>\n <div className='cell label'>Method:</div>\n <div className='cell'>{paymentMethod}</div>\n </div>\n {paymentMethod === 'check' && this.checkNumber()}\n </div>\n </span>\n );\n };\n\n renderPendingText = () => {\n if (this.props.charge.method === 'ACH Payment') {\n return 'Processing - may take 4 business days to complete';\n }\n\n return 'Processing';\n };\n\n renderStatus = () => {\n switch (this.props.charge.status) {\n case 'refunded':\n return <span>Refunded <TimeAgo className='timeago' date={this.props.charge.refunded_at} /></span>;\n case 'disputed':\n return <span className='text-semialert'>Disputed</span>;\n case 'pending':\n return <span>{this.renderPendingText()}</span>;\n case 'refund_pending':\n return <span>Processing Refund</span>;\n case 'paid':\n return <span className=''>Processed</span>;\n case 'failed':\n return <span className='text-alert bold'>Failed</span>;\n }\n };\n\n refundDidRequireAuthorization = () => {\n return this.props.charge.refunded_at && this.props.charge.refund_authorizer;\n };\n\n renderAuthorizationDetails = () => {\n // Only admins should see this\n\n if (!this.props.admin || !this.refundDidRequireAuthorization()) { return; }\n\n return (\n <>\n <tr>\n <td>Refund requested by:</td>\n <td>{this.props.charge.refund_requester.name}</td>\n </tr>\n\n <tr>\n <td>Refund request time:</td>\n <td><TimeAgo date={this.props.charge.refund_requested_at} className='timeago' /></td>\n </tr>\n\n <tr>\n <td>Refund authorized by:</td>\n <td>{this.props.charge.refund_authorizer.name}</td>\n </tr>\n </>\n );\n };\n\n renderProcessed = () => {\n return (\n <div>\n <div className='cell label'>Processed:</div>\n <div className='cell'><TimeAgo date={this.props.charge.created_at} className='timeago' /></div>\n </div>\n );\n };\n\n renderFailureDetails = () => {\n if (this.props.charge.status === 'refund_failed' || this.props.charge.status === 'failed') {\n return (\n <div>\n <div className='cell label'>Details:</div>\n <div className='cell'><span>{this.props.charge.failure_message}</span></div>\n </div>\n );\n }\n };\n\n chargeReceipt = () => {\n const showDownloadLink = this.props.charge.status === 'paid' || this.props.charge.status === 'refunded';\n\n return (\n <div>\n <div className='receipttable'>\n <div>\n <div className='cell label'>Amount:</div>\n <div className='cell color-green bold'>{Accounting.formatMoney(this.props.charge.amount / 100)}</div>\n </div>\n\n <div>\n <div className='cell label'>Method:</div>\n <div className='cell'>{this.props.charge.method}</div>\n </div>\n\n <div>\n <div className='cell label'>By:</div>\n <div className='cell'>{this.props.charge.user.name}</div>\n </div>\n\n {this.props.charge.status === 'paid' && this.renderProcessed()}\n\n <div>\n <div className='cell label'>Status:</div>\n <div className='cell'>{this.renderStatus()}</div>\n </div>\n\n {this.renderFailureDetails()}\n {this.renderAuthorizationDetails()}\n {this.refundReason()}\n </div>\n\n {showDownloadLink && <a className='btn-secondary block margin-top' target='_blank' href={`/charges/${this.props.charge.confirmation_number}.pdf`} rel='noreferrer'>Download receipt</a>}\n </div>\n );\n };\n\n render() {\n if (this.props.charge) {\n return this.chargeReceipt();\n }\n return this.nonChargeReceipt();\n }\n}\n\nReceipt.propTypes = {\n admin: PropTypes.bool.isRequired,\n};\n\nexport default Receipt;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport Receipt from './receipt';\n\nclass Paid extends React.Component {\n paidStepUI() {\n if (this.props.nonRefundedCharge) {\n return this.props.renderReceiptForCharge(this.props.nonRefundedCharge);\n }\n return (\n <Receipt\n activeStep={this.props.activeStep}\n admin={this.props.admin}\n key='check/cash'\n />\n );\n }\n\n render() {\n return (\n this.paidStepUI()\n );\n }\n}\n\nPaid.propTypes = {\n activeStep: PropTypes.object.isRequired,\n admin: PropTypes.bool.isRequired,\n renderReceiptForCharge: PropTypes.func.isRequired,\n nonRefundedCharge: PropTypes.object,\n};\n\nexport default Paid;\n","const RefundAPI = {\n cancelRequest: (chargeId) => {\n const url = `/refunds/${chargeId}/cancel_request`;\n return $.ajax(url, {\n dataType: 'json',\n method: 'post'\n });\n },\n\n approveRequest: (chargeId) => {\n const url = `/refunds/${chargeId}/approve_request`;\n return $.ajax(url, {\n dataType: 'json',\n method: 'post'\n });\n }\n};\n\nexport default RefundAPI;","const ChargeAPI = {\n get(id) {\n return $.ajax(`/charges/${id}`, {\n method: 'GET',\n dataType: 'JSON'\n });\n },\n\n create(paymentId, data) {\n return $.ajax(`/charges`, {\n method: 'POST',\n dataType: 'JSON',\n data: {\n cc: {\n first: data.first,\n last: data.last,\n number: data.number,\n month: data.month,\n year: data.year,\n verification: data.verification,\n },\n amount: data.amount,\n payment_id: paymentId,\n }\n })\n }\n};\n\nexport default ChargeAPI;\n","var PaymentAPI = {\n update: function(paymentId, attrs){\n var url = '/payments/' + paymentId;\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n payment_data: attrs\n }\n });\n },\n\n receiveCheck: function(paymentId, attrs){\n var url = `/payments/${paymentId}/receive_check`;\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n payment_data: { check_paid_amount: attrs.amount, check_number: attrs.checkNumber }\n }\n });\n },\n\n receiveCash: function(paymentId, amount){\n var url = `/payments/${paymentId}/receive_cash`;\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n payment_data: { cash_paid_amount: amount }\n }\n });\n },\n\n removeCashPayment: function(paymentId){\n var url = `/payments/${paymentId}/remove_cash_payment`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n },\n\n removeCheckPayment: function(paymentId){\n var url = `/payments/${paymentId}/remove_check_payment`;\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json',\n });\n },\n\n getActiveCharge: function(paymentId){\n return $.ajax(`/payments/${paymentId}/get_active_charge`, {\n method: 'GET',\n dataType: 'json',\n })\n }\n};\n\nexport default PaymentAPI;\n","import RefundAPI from 'apis/refund-api';\nimport TeamAPI from 'apis/team-api';\nimport ChargeAPI from 'apis/charge-api';\nimport ActiveStepAPI from '../apis/active-step-api';\nimport PaymentAPI from '../apis/payment-api';\nimport ActiveStepConstants from '../constants/active-step-constants';\nimport Constants from '../constants/initiated-flow-constants';\nimport Flash from '../components/shared/flash';\n\nfunction api(type) {\n return type === 'PaymentStep' ? ActiveStepAPI : PaymentAPI;\n}\n\nfunction action(type, action) {\n if (type === 'PaymentStep') {\n return ActiveStepConstants.CHANGES_PERSISTED;\n }\n\n return Constants.PAYMENT_UPDATED;\n}\n\nconst PaymentStepActions = {\n submitPayment(dispatch, paymentId, data) {\n ChargeAPI.create(paymentId, data);\n // TODO: Dispatch\n },\n\n update(dispatch, paymentId, attrs, type) {\n return api(type).update(paymentId, attrs).done((res) => {\n dispatch({\n type: action(type, 'updating'),\n payment: res,\n });\n });\n },\n\n checkReceived(dispatch, activeStepId, paymentFormAttrs, type) {\n api(type).receiveCheck(activeStepId, paymentFormAttrs)\n .done((res) => {\n dispatch({\n type: action(type, 'receiving'),\n payment: res,\n });\n });\n },\n\n cashReceived(dispatch, activeStepId, amount, type) {\n api(type).receiveCash(activeStepId, amount)\n .done((res) => {\n dispatch({\n type: action(type, 'receiving'),\n payment: res,\n });\n });\n },\n\n waivePayment(dispatch, activeStepId, type) {\n api(type).waivePayment(activeStepId)\n .done((res) => {\n dispatch({\n type: action(type, 'waiving'),\n payment: res,\n });\n });\n },\n\n unwaivePayment(dispatch, activeStepId, type) {\n api(type).unwaivePayment(activeStepId)\n .done((res) => {\n dispatch({\n type: action(type, 'unwaiving'),\n payment: res,\n });\n });\n },\n\n removeCheckPayment(dispatch, activeStepId, type) {\n api(type).removeCheckPayment(activeStepId)\n .done((res) => this.onCheckPaymentRemoved(dispatch, res, type))\n .fail(() => { Flash.error(); });\n },\n\n removeCashPayment(dispatch, activeStepId, type) {\n api(type).removeCashPayment(activeStepId)\n .done((res) => this.onCashPaymentRemoved(dispatch, res, type))\n .fail(() => { Flash.error(); });\n },\n\n onCheckPaymentRemoved(dispatch, activeStep, type) {\n Flash.success('Check payment removed');\n\n dispatch({\n type: action(type, 'removing'),\n activeStep: activeStep,\n payment: activeStep,\n });\n },\n\n onCashPaymentRemoved(dispatch, activeStep, type) {\n Flash.success('Cash payment removed');\n\n dispatch({\n type: action(type, 'removing'),\n activeStep: activeStep,\n payment: activeStep,\n });\n },\n\n approveRefundRequest(chargeId) {\n RefundAPI.approveRequest(chargeId)\n .done((res) => {\n if (res.errors.length > 0) {\n Flash.error(res.errors[0]);\n } else {\n window.location.reload();\n }\n })\n .fail(() => { Flash.error(); });\n },\n\n cancelRefundRequest(chargeId) {\n RefundAPI.cancelRequest(chargeId)\n .done(() => { window.location.reload(); });\n },\n\n pollForCharge(dispatch, id, type) {\n return PaymentAPI.getActiveCharge(id)\n .done((res) => {\n const charge = res.charges[0];\n\n if (!charge) { return; }\n\n switch (charge.status) {\n case 'pending':\n Flash.success('Payment Processing')\n break;\n case 'paid':\n Flash.success('Payment completed')\n break;\n default:\n throw new Error(`Unhandled status ${charge.status}`);\n }\n\n if(type === 'PaymentStep') {\n dispatch({\n type: ActiveStepConstants.CHANGES_PERSISTED\n })\n } else if(type === 'PaymentRequirement') {\n dispatch({\n type: Constants.PAYMENT_MADE,\n charge,\n completed: charge.status === 'paid'\n })\n }\n });\n },\n\n checkChargesEnabled(initiatedFlowId) {\n return TeamAPI.checkChargesEnabled(initiatedFlowId)\n },\n//\n//\n};\n\nexport default PaymentStepActions;\n","import React, { useRef, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport { alert } from 'modules/alert-confirm';\nimport PaymentStepActions from 'actions/payment-step-actions';\n\nconst CheckForm = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const amountReceived = useRef();\n const checkNumber = useRef();\n\n function checkReceivedClicked() {\n const amount = amountReceived.current.value;\n\n if (!$.isNumeric(amount) || amount <= 0) {\n alert('Whoops', 'Check amount must be a valid number. Check your input and try again.');\n return;\n }\n\n const paymentFormAttrs = {\n amount,\n checkNumber: checkNumber.current.value,\n };\n\n PaymentStepActions.checkReceived(dispatch, props.activeStep.id, paymentFormAttrs, props.type);\n }\n\n function adminView() {\n return (\n <div>\n <div className='margin-top-more'><div className='subtitle'>Payment details</div></div>\n <label>Amount Received\n <input type='text' ref={amountReceived} />\n </label>\n\n <label>Check Number\n <input type='text' ref={checkNumber} />\n </label>\n <div className='margin-top'>\n <button\n type='submit'\n onClick={checkReceivedClicked}\n className='btn-primary'\n >Check received\n </button>\n </div>\n </div>\n );\n }\n\n function publicView() {\n return (\n <>\n <p>{props.checkInstructions}</p>\n <p className='color-text-medium'><strong>Note:</strong> This page will automatically update and you will receive an email notification when your check is received.</p>\n </>\n );\n }\n\n return (\n <div className='currentstep-ckecktools'>\n {props.admin ? adminView() : publicView() }\n </div>\n );\n};\n\nCheckForm.propTypes = {\n admin: PropTypes.bool.isRequired,\n checkInstructions: PropTypes.string.isRequired,\n activeStep: PropTypes.object.isRequired,\n};\n\nexport default CheckForm;\n","import React, { useRef, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport AlertConfirm from 'modules/alert-confirm';\nimport PaymentStepActions from 'actions/payment-step-actions';\n\nconst CashForm = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const amountReceived = useRef();\n\n function cashReceivedClicked() {\n const amount = amountReceived.current.value;\n\n if (!$.isNumeric(amount) || amount <= 0) {\n AlertConfirm.alert('Whoops', 'Cash amount must be a valid number. Check your input and try again.');\n return;\n }\n\n PaymentStepActions.cashReceived(dispatch, props.activeStep.id, amount, props.type);\n }\n\n function adminView() {\n return (\n <div>\n <input name='amountreceived' className='margin-top' type='text' placeholder='Amount received' ref={amountReceived} />\n <div className='margin-top'>\n <button\n type='submit'\n id='cashreceivedbutton'\n onClick={cashReceivedClicked}\n className='btn-primary'\n >Cash received\n </button>\n </div>\n </div>\n );\n }\n\n function publicView() {\n return (\n <>\n <p>{props.cashInstructions}</p>\n <p className='color-text-medium'><strong>Note:</strong> This page will automatically update and you will receive an email notification when your cash is received.</p>\n </>\n );\n }\n\n return (\n <div className='currentstep-ckecktools'>\n {props.admin ? adminView() : publicView()}\n </div>\n );\n};\n\nCashForm.propTypes = {\n admin: PropTypes.bool.isRequired,\n cashInstructions: PropTypes.string.isRequired,\n activeStep: PropTypes.object.isRequired,\n};\n\nexport default CashForm;\n","const PaymentIntentsApi = {\n create(paymentId, amount, paymentType) {\n return $.ajax(`/payments/${paymentId}/payment_intents`, {\n method: 'POST',\n dataType: 'JSON',\n data: {\n amount,\n payment_type: paymentType,\n },\n });\n },\n\n update(paymentId, amount, paymentType) {\n return $.ajax(`/payments/${paymentId}/payment_intents`, {\n method: 'PUT',\n dataType: 'JSON',\n data: {\n amount,\n payment_type: paymentType,\n },\n });\n },\n\n confirmPayment(paymentId, amount, paymentType) {\n return $.ajax(`/payments/${paymentId}/payment_intents/confirm_payment`, {\n method: 'GET',\n dataType: 'JSON',\n data: {\n amount,\n payment_type: paymentType,\n },\n });\n },\n};\n\nexport default PaymentIntentsApi;\n","import React, { useState } from 'react';\nimport MoneyInput from 'components/shared/input_fields/money-input';\n\nconst Amount = (props) => {\n const [amount, setAmount] = useState(props.amount);\n\n function calculateAmount() {\n if (amount) {\n return Number(amount).toFixed(2);\n }\n\n if (props.config.calculated) {\n // when formula can't be evaluated\n return 'N/A';\n }\n\n return '0.00';\n }\n\n function onAmountChange(_e, amnt) {\n setAmount(amnt);\n }\n\n function renderActionButtons() {\n if (!props.disabled) {\n return (\n <button onClick={() => { props.onAmountSave(amount); }}>Confirm amount</button>\n );\n }\n\n return (<button className='btn-link' onClick={props.onEditClick}>Edit</button>);\n }\n\n return (\n <div className='margin-bottom currentstep-paymentamount'>\n <label htmlFor='payment-box' className='margin-top subtitle'>Payment amount</label>\n <div>\n <MoneyInput\n onChange={onAmountChange}\n disabled={props.disabled}\n id='payment-box'\n defaultValue={calculateAmount()}\n />\n {!props.config.fixed && renderActionButtons()}\n </div>\n </div>\n );\n};\n\nexport default Amount;\n","import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nconst AmountBreakdown = (props) => {\n function formatAmount(amount) {\n return Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(amount.toFixed(2));\n }\n\n return (\n <span>\n <table className='receipttable currentstep-chargebreakdown'>\n <tbody>\n <tr>\n <td>Amount:</td>\n <td>{formatAmount(props.amount)}</td>\n </tr>\n\n <tr>\n <td>Processing Fee:</td>\n <td>{formatAmount(props.fee)}</td>\n </tr>\n\n <tr>\n <td>Total:</td>\n <td>{formatAmount(props.amount + props.fee)}</td>\n </tr>\n </tbody>\n </table>\n </span>\n );\n};\n\nAmountBreakdown.propTypes = {\n amount: PropTypes.number.isRequired,\n fee: PropTypes.number.isRequired,\n};\n\nexport default AmountBreakdown;\n","import React, { useEffect, useState, useContext } from 'react';\nimport {\n Elements, useStripe, useElements, PaymentElement,\n} from '@stripe/react-stripe-js';\nimport { loadStripe } from '@stripe/stripe-js';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport PaymentStepActions from 'actions/payment-step-actions';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport Flash from 'components/shared/flash';\nimport InlineNotification from 'components/shared/inline-notification';\nimport PaymentIntentsApi from 'apis/payment-intents-api';\nimport Amount from './amount';\nimport AmountBreakdown from './amount-breakdown';\n\nconst StripeForm = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const [isUpdating, setIsUpdating] = useState(props.updating);\n const [isProcessing, setIsProcessing] = useState(false);\n const [paymentSuccessful, setPaymentSuccessful] = useState(false);\n const [errored, setErrored] = useState(false);\n const elements = useElements();\n const stripe = useStripe();\n\n useEffect(() => {\n setIsUpdating(props.updating);\n }, [props.updating]);\n\n useEffect(() => {\n if (!paymentSuccessful) { return; }\n\n const interval = setInterval(pollForCharge, 2000);\n\n return function cleanup() {\n clearInterval(interval);\n };\n }, [paymentSuccessful]);\n\n function pollForCharge() {\n PaymentStepActions.pollForCharge(dispatch, props.paymentId, props.type);\n }\n\n const submitToStripe = async () => {\n const { error } = await stripe.confirmPayment({\n elements,\n redirect: 'if_required',\n });\n\n if (error) {\n Flash.error(error.message);\n setIsProcessing(false);\n } else {\n setPaymentSuccessful(true);\n }\n };\n\n function handleConfirmFail() {\n setErrored(true);\n setIsProcessing(false);\n }\n\n function handleSubmit(event) {\n // We don't want to let default form submission happen here,\n // which would refresh the page.\n event.preventDefault();\n setIsProcessing(true);\n\n if (!stripe || !elements) {\n // Stripe.js has not yet loaded.\n // Make sure to disable form submission until Stripe.js has loaded.\n return;\n }\n\n PaymentIntentsApi.confirmPayment(props.paymentId, props.amount, props.paymentType)\n .done((res) => {\n if (res.confirmed) {\n submitToStripe();\n } else {\n handleConfirmFail();\n }\n });\n }\n\n function renderMessage() {\n if (isProcessing) {\n return (\n <div className='inline-block margin-top'>\n <LoadingSpinner className='vtop' />\n <span> Processing your payment</span>\n </div>\n );\n }\n }\n if (isUpdating) {\n return (\n <div className='align-center'>\n <LoadingSpinner size='large' />\n <div>Updating Form</div>\n </div>\n );\n }\n\n if (errored) {\n return (\n <InlineNotification className='margin-top margin-bottom'>\n This page is out of date, please refresh your browser\n </InlineNotification>\n );\n }\n\n return (\n <form onSubmit={handleSubmit}>\n <PaymentElement onChange={props.handleChange} />\n {props.config.constituent_pays_fee\n && <AmountBreakdown amount={props.amount} fee={props.fee} /> }\n <div>\n {props.paymentType == 'us_bank_account' && <div>Bank payments may take 3-5 business days to process.</div>}\n {!isProcessing && (\n <button type='submit' className='btn-primary margin-top' disabled={isProcessing || !stripe || !elements || isUpdating} id='submit'>\n <span id='button-text'>\n Submit Payment\n </span>\n </button>\n ) }\n </div>\n {renderMessage()}\n </form>\n );\n};\n\nconst StripeWrapper = (props) => {\n const [clientSecret, setClientSecret] = useState(null);\n const [stripe, setStripe] = useState(null);\n const [amount, setAmount] = useState(props.amount);\n const [editingAmount, setEditingAmount] = useState(!props.config.fixed);\n const [paymentType, setPaymentType] = useState('card');\n const [updating, setUpdating] = useState(false);\n\n const paymentId = props.type === 'PaymentRequirement' ? props.activeStep.id : props.activeStep.payment_id;\n\n useEffect(() => {\n setStripe(loadStripe(CityGrows.Server.stripeKey, { stripeAccount: `${CityGrows.Server.merchantAccountId}` }));\n if (!amount) { return; }\n\n getClientSecret(amount);\n }, []);\n\n useEffect(() => {\n if (props.onPaymentTypeChange !== undefined) {\n props.onPaymentTypeChange(paymentType);\n }\n if (!clientSecret) { return; }\n updatePaymentIntent(amount);\n }, [paymentType]);\n\n useEffect(() => {\n if (props.onPaymentAmountChange !== undefined) {\n props.onPaymentAmountChange(amount);\n }\n }, [amount]);\n\n function getClientSecret(amnt) {\n PaymentIntentsApi.create(paymentId, amnt, paymentType)\n .done((res) => {\n setClientSecret(res.cs);\n });\n }\n\n function updatePaymentIntent(amnt) {\n setUpdating(true);\n PaymentIntentsApi.update(paymentId, amnt, paymentType)\n .done(() => { setUpdating(false); });\n }\n\n function onAmountSave(amnt) {\n if (amnt < 1.00) {\n return Flash.error('Amount must be at least 1.00');\n }\n\n setAmount(Number(amnt));\n if (!clientSecret) {\n getClientSecret(amnt);\n } else {\n updatePaymentIntent(amnt);\n }\n\n setEditingAmount(false);\n }\n\n function handleChange(e) {\n setPaymentType(e.value.type);\n }\n\n function renderDisabledChargesWarning() {\n if (props.chargesEnabled || !CityGrows.Server.admin) { return; }\n\n return (\n <InlineNotification>\n <>\n <span>Payments disabled. Please add a payout account </span>\n <a href={`/teams/${props.teamFriendlyId}/merchant_accounts`}>here</a>\n </>\n </InlineNotification>\n );\n }\n\n function renderDisabledWarning() {\n return (\n <InlineNotification>\n <>\n <span>This process is not active. Payments disabled.</span>\n </>\n </InlineNotification>\n );\n }\n\n function renderStripeElement() {\n if (!amount || editingAmount) { return; }\n\n if (!clientSecret) {\n return (\n <div className='align-center'>\n <LoadingSpinner size='large' />\n <div>Loading Form</div>\n </div>\n );\n }\n\n return (\n <Elements stripe={stripe} options={{ clientSecret }}>\n <StripeForm\n {...props}\n amount={amount}\n paymentId={paymentId}\n handleChange={handleChange}\n updating={updating}\n paymentType={paymentType}\n />\n </Elements>\n );\n }\n\n return (\n <div>\n {renderDisabledChargesWarning()}\n {props.disabled && renderDisabledWarning()}\n <Amount\n amount={amount}\n config={props.config}\n disabled={!editingAmount || props.disabled}\n onAmountSave={onAmountSave}\n onEditClick={() => {\n setEditingAmount(true);\n setAmount(0.0);\n }}\n />\n {!props.disabled && renderStripeElement()}\n </div>\n );\n};\n\nexport default StripeWrapper;\n","import React, { useRef, useState, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport { alert } from 'modules/alert-confirm';\nimport PaymentStepActions from 'actions/payment-step-actions';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport AmountBreakdown from './amount-breakdown';\nimport Amount from './amount';\n\nconst CreditCardForm = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const number = useRef();\n const cvc = useRef();\n const expMonth = useRef();\n const expYear = useRef();\n const first = useRef();\n const last = useRef();\n\n const [amount, setAmount] = useState(props.amount);\n const [processing, setProcessing] = useState(false);\n const [editingAmount, setEditingAmount] = useState(!props.config.fixed);\n\n function onAmountSave(amnt) {\n setAmount(Number(amnt));\n setEditingAmount(false);\n }\n\n function submitClicked() {\n if (processing) { return; }\n\n setProcessing(true);\n\n const formAttrs = {\n number: number.current.value,\n verification: cvc.current.value,\n month: expMonth.current.value,\n year: expYear.current.value,\n amount,\n first: first.current.value,\n last: last.current.value,\n };\n\n // Clean amount\n if (!$.isNumeric(formAttrs.amount) || formAttrs.amount <= 0) {\n alert('Whoops', 'Payment amount must be a valid number. Check your input and try again.');\n endProcessingState();\n return;\n }\n\n formAttrs.amount = String(formAttrs.amount).replace(/\\$/g, '');\n\n // PaymentStepActions.submitPayment(dispatch, props.activeStep.payment_id, formAttrs, props.type)\n // .fail(endProcessingState);\n }\n\n function endProcessingState() {\n setProcessing(false);\n }\n\n function submitStatus() {\n if (processing) {\n return (\n <div className='inline-block'>\n <LoadingSpinner className='vtop' />\n <span> Processing your payment</span>\n </div>\n );\n }\n }\n\n function renderSubmitButton() {\n const disabledClass = processing ? 'disabled' : '';\n\n return (\n <input\n type='submit'\n disabled={props.disabled}\n onClick={submitClicked}\n className={`btn-primary margin-top margin-bottom margin-right ${disabledClass}`}\n value='Submit payment'\n id='submitpaymentbutton'\n />\n );\n }\n\n return (\n <span>\n <Amount\n amount={amount}\n config={props.config}\n disabled={!editingAmount}\n onAmountSave={onAmountSave}\n onEditClick={() => {\n setEditingAmount(true);\n setAmount(0.0);\n }}\n />\n\n <div className='margin-top-more'><div className='subtitle'>Payment details</div></div>\n\n <label>\n First Name\n <input id='firstnamefield' disabled={props.disabled} ref={first} size='20' type='text' />\n </label>\n\n <label>\n Last Name\n <input id='lastnamefield' disabled={props.disabled} ref={last} size='20' type='text' />\n </label>\n\n <label>\n Card number\n <input id='cardnumberfield' disabled={props.disabled} ref={number} size='20' type='text' />\n </label>\n\n <label>\n Card CVC\n <input id='cardcvcfield' disabled={props.disabled} ref={cvc} size='20' type='text' />\n </label>\n\n <fieldset>\n <legend>Expiration date</legend>\n <div>\n <input\n className='inline-block'\n disabled={props.disabled}\n ref={expMonth}\n type='text'\n size='3'\n maxLength='2'\n placeholder='MM'\n id='cardmofield'\n />\n <span>/ </span>\n <input\n className='inline-block'\n disabled={props.disabled}\n ref={expYear}\n type='text'\n size='4'\n maxLength='4'\n placeholder='YYYY'\n id='cardyearfield'\n />\n </div>\n </fieldset>\n\n {props.config.constituent_pays_fee\n && <AmountBreakdown amount={amount} fee={props.fee} /> }\n\n <div className='margin-top'>\n {renderSubmitButton()}\n\n <span id='submitstatus'>{submitStatus()}</span>\n </div>\n </span>\n\n );\n};\n\nCreditCardForm.propTypes = {\n config: PropTypes.object.isRequired,\n noFee: PropTypes.bool.isRequired,\n disabled: PropTypes.bool.isRequired,\n amount: PropTypes.number.isRequired,\n};\n\nexport default CreditCardForm;\n","import React, { useContext, useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport ActiveStepActions from 'actions/active-step-actions';\nimport PaymentStepActions from 'actions/payment-step-actions';\nimport CheckForm from './check-form';\nimport CashForm from './cash-form';\nimport StripeForm from './stripe-form';\nimport CreditCardForm from './credit-card-form';\n\nconst UnPaid = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const [chargesEnabled, setChargesEnabled] = useState(true);\n\n useEffect(() => {\n // chargesEnabled is only used to show admins a disabled alert\n if (!CityGrows.Server.admin) { return; }\n\n PaymentStepActions.checkChargesEnabled(props.activeStep.initiated_flow_id)\n .done((res) => { setChargesEnabled(res.chargesEnabled); });\n }, [props.activeStep.initiated_flow_id]);\n\n function paymentMethodChanged(e) {\n if (props.step.generic_type === 'Step') {\n ActiveStepActions.updateCurrentActiveStep(dispatch, props.activeStep.id, {\n payment_method: e.currentTarget.value,\n });\n } else {\n PaymentStepActions.update(dispatch, props.activeStep.id, {\n payment_method: e.currentTarget.value,\n });\n }\n\n if (e.currentTarget.value !== 'creditcard') {\n props.onStripePaymentTypeChange(null);\n }\n }\n\n function paymentToggle(type, label) {\n return (\n <label>\n <input\n type='radio'\n name='paymentmethod'\n onChange={paymentMethodChanged}\n defaultChecked={props.activeStep.payment_method === type}\n value={type}\n />{label}\n </label>\n );\n }\n\n function renderPaymentMethodSelector() {\n if (!props.step.config.accepts_checks && !props.step.config.accepts_cash) {\n return;\n }\n\n return (\n <div className='margin-bottom'>\n <fieldset>\n <legend className='subtitle'>Payment method</legend>\n {paymentToggle('creditcard', 'Pay online')}\n {props.step.config.accepts_cash && paymentToggle('cash', 'Cash')}\n {props.step.config.accepts_checks && paymentToggle('check', 'Check')}\n </fieldset>\n </div>\n );\n }\n\n function renderCreditCardForm() {\n if (props.thirdPartyProcessor) {\n return (\n <CreditCardForm\n config={props.step.config}\n type={props.step.type}\n fee={props.fee}\n amount={props.amount}\n noFee={props.step.no_fee}\n activeStep={props.activeStep}\n customFeePercentage={props.step.custom_fee_percentage}\n disabled={disabled()}\n />\n );\n }\n\n return (\n <StripeForm\n type={props.step.type}\n activeStep={props.activeStep}\n amount={props.amount}\n fee={props.fee}\n noFee={props.step.no_fee}\n disabled={disabled()}\n chargesEnabled={chargesEnabled}\n customFeePercentage={props.step.custom_fee_percentage}\n teamFriendlyId={props.teamFriendlyId}\n config={props.step.config}\n onPaymentTypeChange={(type) => {\n props.onStripePaymentTypeChange(type);\n }}\n onPaymentAmountChange={(amount) => {\n props.onStripePaymentAmountChange(amount);\n }}\n />\n );\n }\n\n function disabled() {\n if (!props.active) { return true; }\n\n if (props.step.type === 'PaymentRequirement' && props.step.canceled) { return true; }\n\n return props.step.config.calculated && !props.activeStep.calculated_payment;\n }\n\n function renderPaymentForm() {\n switch (props.activeStep.payment_method) {\n case 'creditcard': {\n return renderCreditCardForm();\n }\n case 'check': {\n return (\n <CheckForm\n admin={props.admin}\n type={props.step.type}\n activeStep={props.activeStep}\n checkInstructions={props.step.config.check_instructions}\n />\n );\n }\n case 'cash': {\n return (\n <CashForm\n admin={props.admin}\n type={props.step.type}\n activeStep={props.activeStep}\n cashInstructions={props.step.config.cash_instructions}\n />\n );\n }\n }\n }\n\n return (\n <>\n {renderPaymentMethodSelector()}\n {renderPaymentForm()}\n </>\n );\n};\n\nUnPaid.propTypes = {\n activeStep: PropTypes.object.isRequired,\n amount: PropTypes.number.isRequired,\n fee: PropTypes.number.isRequired,\n step: PropTypes.object.isRequired,\n admin: PropTypes.bool.isRequired,\n onStripePaymentTypeChange: PropTypes.func.isRequired,\n onStripePaymentAmountChange: PropTypes.func.isRequired,\n};\n\nexport default UnPaid;\n","import React from 'react';\n\nclass NoPaymentRequiredView extends React.Component {\n render() {\n let text = 'No Payment is required.';\n if (this.props.admin && this.props.waived) {\n text = 'Payment Waived.';\n }\n return (\n <div>\n <p>{text}</p>\n </div>\n );\n }\n}\n\nexport default NoPaymentRequiredView;\n","import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport PaymentStepActions from 'actions/payment-step-actions';\nimport AlertConfirm from 'modules/alert-confirm';\nimport { any } from 'underscore';\n\nconst ActionLinks = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n function togglePaymentWaiver(e) {\n e.preventDefault();\n if (props.activeStep.payment_waived) {\n PaymentStepActions.unwaivePayment(dispatch, props.activeStep.id, props.stepType);\n } else {\n PaymentStepActions.waivePayment(dispatch, props.activeStep.id, props.stepType);\n }\n }\n\n function onRefundClick(e) {\n e.preventDefault();\n props.onRefund();\n }\n\n function onRemoveCheckClick(e) {\n e.preventDefault();\n PaymentStepActions.removeCheckPayment(dispatch, props.activeStep.id, props.stepType);\n }\n\n function onRemoveCashClick(e) {\n e.preventDefault();\n PaymentStepActions.removeCashPayment(dispatch, props.activeStep.id, props.stepType);\n }\n\n function paymentWaiverLink() {\n const text = props.activeStep.payment_waived ? 'Make payment required' : 'Waive payment';\n\n return (\n <li key='waivePayment'><a href='#' onClick={togglePaymentWaiver}>{text}</a></li>\n );\n }\n\n function removeCheckLink() {\n if (props.activeStep.check_paid_amount) {\n return (\n <li key='removecheck'><a href='#' onClick={onRemoveCheckClick}>Remove received check</a></li>\n );\n }\n }\n\n function removeCashLink() {\n if (props.activeStep.cash_paid_amount) {\n return (\n <li key='removecash'><a href='#' onClick={onRemoveCashClick}>Remove received cash</a></li>\n );\n }\n }\n\n const onCancelRefundRequest = () => {\n PaymentStepActions.cancelRefundRequest(props.nonRefundedCharge.id);\n };\n\n const onApproveRefundClick = () => {\n AlertConfirm.confirm('Issue refund', 'Are you sure you want to issue this refund?', () => {\n PaymentStepActions.approveRefundRequest(props.nonRefundedCharge.id);\n });\n };\n\n const currentUserIsAuthority = () => {\n return any(props.authorities, (a) => {\n return a.id === CityGrows.Server.currentUserId;\n });\n };\n\n const renderRefundApproveButton = () => {\n if (!currentUserIsAuthority()) { return; }\n\n return (\n <button type='submit' className='btn-link margin-left' onClick={onApproveRefundClick}>\n Approve refund\n </button>\n );\n };\n\n const refundPaymentLink = () => {\n if (!props.nonRefundedCharge) { return; }\n if (props.nonRefundedCharge.status === 'pending') { return; }\n if (props.nonRefundedCharge.status === 'refund_pending') { return; }\n\n if (props.nonRefundedCharge.refund_requested_at) {\n if (props.nonRefundedCharge.refund_authorized_at) {\n return <span>Refunded</span>;\n }\n return (\n <span className='text-semialert bold'>\n Refund authorization requested\n {renderRefundApproveButton()}\n <button type='button' className='btn-link margin-left' onClick={onCancelRefundRequest}>Cancel</button>\n </span>\n );\n }\n\n if (!props.refunding) {\n return (\n <li key='refundcharge'>\n <a\n onClick={onRefundClick}\n href='#'\n id='refundpaymentlink'\n >\n Refund payment\n </a>\n </li>\n );\n }\n };\n\n return (\n <div className='paymentmanager-actions'>\n <ul>\n {props.showPaymentWaive && paymentWaiverLink()}\n {removeCheckLink()}\n {removeCashLink()}\n {refundPaymentLink()}\n </ul>\n </div>\n );\n};\n\nActionLinks.propTypes = {\n showPaymentWaive: PropTypes.bool.isRequired,\n activeStep: PropTypes.object.isRequired,\n stepType: PropTypes.string.isRequired,\n nonRefundedCharge: PropTypes.object,\n};\n\nexport default ActionLinks;\n","import React, { useEffect, useContext } from 'react';\nimport PaymentStepActions from 'actions/payment-step-actions';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport Receipt from './receipt';\n\nconst Pending = (props) => {\n // const dispatch = useContext(InitiatedFlowDispatchContext);\n // useEffect(() => {\n // const interval = setInterval(checkStatus, 20000);\n //\n // return function cleanup() {\n // clearInterval(interval)\n // }\n // }, []);\n //\n // function checkStatus() {\n // PaymentStepActions.checkPendingCharge(dispatch, props.charge.id, props.stepType);\n // }\n\n return (\n <Receipt\n charge={props.charge}\n activeStep={props.activeStep}\n admin={props.admin}\n key={props.charge.id}\n />\n );\n};\n\nexport default Pending;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ExpandedSection = (props) => {\n return (\n <div className='expandedsection'>\n <div className='expandedsection-inner'>{props.children}</div>\n </div>\n );\n};\n\nexport default ExpandedSection;\n","import React, { useState, useRef, useEffect } from 'react';\nimport ExpandedSection from 'components/shared/expanded-section';\n\nconst RefundWidget = (props) => {\n const [refundReason, setRefundReason] = useState('');\n\n const refundReasonInput = useRef();\n\n useEffect(() => {\n refundReasonInput.current.focus();\n }, []);\n\n function authToken() {\n return $('meta[name=csrf-token]').attr('content');\n }\n\n return (\n <ExpandedSection>\n <textarea\n value={refundReason}\n id='paymentmanager-refundreason'\n placeholder='Why are you issuing this refund? (Optional)'\n ref={refundReasonInput}\n onChange={(e) => { setRefundReason(e.currentTarget.value); }}\n />\n\n <form id='form'>\n <input type='hidden' name='refund_reason' value={refundReason} />\n <input type='hidden' name='authenticity_token' value={authToken()} />\n </form>\n <div className='align-right'>\n <form id='form'>\n <input type='hidden' name='refund_reason' value={refundReason} />\n <input type='hidden' name='authenticity_token' value={authToken()} />\n <button type='button' onClick={props.onRefundCancel} className='btn-link margin-right'>Cancel</button>\n <button\n className='btn-primary'\n type='submit'\n form='form'\n formMethod='POST'\n formAction={`/charges/${props.nonRefundedCharge.id}/refunds`}\n id='issuerefundbutton'\n >\n Issue refund\n </button>\n </form>\n </div>\n </ExpandedSection>\n );\n};\n\nexport default RefundWidget;\n","import React, { useEffect, useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { filter, findWhere, find } from 'underscore';\nimport calculateTotalFee from 'modules/fee-calculator';\nimport Receipt from './payments/receipt';\nimport Paid from './payments/paid';\nimport UnPaid from './payments/unpaid';\nimport NoPaymentRequiredView from './payments/no-payment-required-view';\nimport ActionLinks from './payments/action-links';\nimport Pending from './payments/pending';\nimport RefundWidget from './payments/refund-widget';\n\nconst PaymentStep = (props) => {\n const { step: { config, customFeePercentage, no_fee } } = props;\n const [paymentAmount, setPaymentAmount] = useState(initialPaymentAmount());\n const [stripePaymentType, setStripePaymentType] = useState(null);\n const [refunding, setRefunding] = useState(false);\n\n const fee = useMemo(() => {\n if (!paymentAmount || stripePaymentType == null || !config.constituent_pays_fee) {\n return 0.0;\n }\n\n return calculateTotalFee(stripePaymentType, paymentAmount, no_fee, customFeePercentage);\n }, [stripePaymentType, paymentAmount, customFeePercentage, no_fee, config.constituent_pays_fee]);\n\n const totalAmount = useMemo(() => {\n if (!paymentAmount) {\n return 0.0;\n }\n return paymentAmount + fee;\n }, [paymentAmount, fee]);\n\n function noPaymentRequired() {\n return (config.fixed && fixedPaymentAmount() === 0)\n || props.activeStep.payment_waived;\n }\n\n function fixedPaymentAmount() {\n if (config.calculated) {\n return props.activeStep.calculated_payment;\n }\n\n return Number(config.amount);\n }\n\n function initialPaymentAmount() {\n return config.fixed\n ? fixedPaymentAmount()\n : 0;\n }\n\n function paidCharge() {\n return findWhere(props.activeStep.charges, { status: 'paid' });\n }\n\n function pendingCharge() {\n return find(props.activeStep.charges, (charge) => { return charge.status === 'pending' || charge.status === 'refund_pending'; });\n }\n\n function isPaid() {\n const hasNonRefundedCharge = !!paidCharge();\n return hasNonRefundedCharge\n || !!props.activeStep.check_paid_amount\n || !!props.activeStep.cash_paid_amount;\n }\n\n function isPending() {\n return !!pendingCharge();\n }\n\n function noOptionLinks() {\n if (pendingCharge()) { return false; }\n\n const charge = paidCharge();\n return (\n !props.activeStep.cash_paid_amount\n && !props.activeStep.check_paid_amount\n && !charge\n );\n }\n\n function renderProcessingInformation() {\n if (props.activeStep.payment_method === 'creditcard' && paymentAmount > 0) {\n const processingTime = stripePaymentType === 'card' ? 'up to 24 hrs' : '3-5 business days';\n const feeText = config.constituent_pays_fee ? Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(fee) : '';\n return (\n <dt>\n <p className='processing-information'>\n <i className={`icon-${stripePaymentType === 'card' ? 'card' : 'bank'}`} /> Processing time: <strong>{processingTime}</strong>\n {config.constituent_pays_fee && ' | Processing Fee: '}\n {config.constituent_pays_fee && <strong>{feeText}</strong>}\n </p>\n </dt>\n );\n }\n }\n\n function headerText() {\n if (isPaid()) {\n return 'Payment confirmation';\n }\n\n if (isPending()) {\n return 'Payment processing';\n }\n\n if (totalAmount > 0) {\n return (\n <dl>\n <dt>Total amount due</dt>\n <dd>{Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(totalAmount)}</dd>\n {renderProcessingInformation()}\n </dl>\n );\n }\n\n return 'Make a payment';\n }\n\n function hideOptions() {\n return !props.admin || (noOptionLinks() && props.supplemental);\n }\n\n function failedPayments() {\n const failed = filter(props.activeStep.charges, { status: 'failed' });\n\n if (failed.length < 1) { return; }\n\n const renderedFails = failed.map((charge) => {\n return (\n <div key={charge.id} className='raised bg-white padded margin-top'>\n {renderReceiptForCharge(charge)}\n </div>\n );\n });\n\n return (\n <div>\n <h3 className='margin-top-more text-alert'>Failed payments</h3>\n {renderedFails}\n </div>\n );\n }\n\n function refundedPayments() {\n const refunded = filter(props.activeStep.charges, { status: 'refunded' });\n if (refunded.length < 1) { return; }\n\n const renderedRefunds = refunded.map((charge) => {\n return (\n <div key={charge.id} className='raised bg-white padded margin-top'>\n {renderReceiptForCharge(charge)}\n </div>\n );\n });\n\n return (\n <div>\n <h3 className='margin-top-more'>Refunded payments</h3>\n {renderedRefunds}\n </div>\n );\n }\n\n function renderReceiptForCharge(charge) {\n return (\n <Receipt\n charge={charge}\n activeStep={props.activeStep}\n admin={props.admin}\n key={charge.id}\n />\n );\n }\n\n function mainContent() {\n if (noPaymentRequired()) {\n return (<NoPaymentRequiredView admin={props.admin} waived={props.activeStep.payment_waived} />);\n }\n\n if (isPaid()) {\n return (\n <Paid\n nonRefundedCharge={paidCharge()}\n activeStep={props.activeStep}\n admin={props.admin}\n renderReceiptForCharge={renderReceiptForCharge}\n />\n );\n }\n\n if (isPending()) {\n return (\n <Pending\n charge={pendingCharge()}\n activeStep={props.activeStep}\n admin={props.admin}\n stepType={props.step.type}\n />\n );\n }\n\n return (\n <UnPaid\n step={props.step}\n activeStep={props.activeStep}\n amount={paymentAmount}\n fee={fee}\n admin={props.admin}\n active={props.active}\n teamFriendlyId={props.teamFriendlyId}\n onStripePaymentTypeChange={(type) => {\n setStripePaymentType(type);\n if (type == null && !config.fixed) {\n setPaymentAmount(0.0);\n }\n }}\n onStripePaymentAmountChange={(amount) => {\n setPaymentAmount(amount);\n }}\n />\n );\n }\n\n const showPaymentWaive = !props.supplemental && noOptionLinks();\n\n return (\n\n <div className='currentstep-stepsection paymentmanager'>\n <div className='raised bg-white'>\n <div className='paymentmanager-header'>\n <h2>{headerText()}</h2>\n {!hideOptions() && (\n <ActionLinks\n showPaymentWaive={showPaymentWaive}\n activeStep={props.activeStep}\n stepType={props.step.type}\n refunding={refunding}\n nonRefundedCharge={paidCharge()}\n onRefund={() => { setRefunding(true); }}\n authorities={props.authorities}\n />\n ) }\n </div>\n {refunding && <RefundWidget onRefundCancel={() => { setRefunding(false); }} nonRefundedCharge={paidCharge()} />}\n\n <div className='paymentmanager-body'>\n {mainContent()}\n </div>\n </div>\n\n {failedPayments()}\n {refundedPayments()}\n </div>\n );\n};\n\nPaymentStep.propTypes = {\n admin: PropTypes.bool.isRequired,\n activeStep: PropTypes.object.isRequired,\n charges: PropTypes.array.isRequired,\n step: PropTypes.object.isRequired,\n supplemental: PropTypes.bool.isRequired,\n};\n\nexport default PaymentStep;\n","var RequirementAPI = {\n get: function(requirement) {\n var url = '/supplemental_requirements/' + requirement.id;\n return $.ajax(url, {\n method: 'GET',\n dataType: 'json',\n data: {\n type: requirement.type\n }\n });\n },\n\n update: function(requirementId, attrs, type){\n var url = '/supplemental_requirements/' + requirementId;\n return $.ajax(url, {\n method: 'PUT',\n dataType: 'json',\n data: {\n supplemental_requirement: attrs,\n type: type\n }\n });\n }\n\n // NOT CURRENTLY BEING USED\n // delete: function(requirementId, type){\n // var url = '/supplemental_requirements/' + requirementId;\n // return $.ajax(url, {\n // method: 'DELETE',\n // dataType: 'json',\n // data: {\n // type: type\n // }\n // });\n // },\n};\n\nexport default RequirementAPI;\n","import RequirementAPI from '../apis/requirement-api';\nimport Constants from '../constants/initiated-flow-constants';\nimport { error } from '../components/shared/flash';\n\nconst RequirementActions = {\n updateAttrs(dispatch, requirementId, attrs, type) {\n return RequirementAPI.update(requirementId, attrs, type).done((res) => {\n dispatch({\n type: Constants.REQUIREMENT_UPDATED,\n requirement: res,\n });\n });\n },\n\n // NOT CURRENTLY BEING USED\n // delete: function(requirementId, type){\n // return RequirementAPI.delete(requirementId, type)\n // .done(function(res){\n // Dispatcher.dispatch({\n // actionType: Constants.REQUIREMENT_DELETED,\n // requirementId: requirementId,\n // currentStep: res.step,\n // activeStep: res.active_step\n // });\n // });\n // },\n\n send(dispatch, requirementId, type) {\n return RequirementAPI.update(requirementId, { sent: true }, type).done((res) => {\n dispatch({\n type: Constants.REQUIREMENT_UPDATED,\n requirement: res,\n });\n }).fail((res) => {\n error(res.responseText);\n });\n },\n};\n\nexport default RequirementActions;\n","import React, { useContext } from 'react';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport RequirementActions from 'actions/requirement-actions';\n\nconst RequirementButtons = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n function sendRequest(e) {\n e.preventDefault();\n RequirementActions.send(dispatch, props.requirementId, props.type);\n }\n\n function deleteButton() {\n if (props.requirementSent) { return; }\n\n return <a className='secondary clickable padding-right' href={`/supplemental_requirements/${props.requirementId}?type=${props.type}`} data-method='delete'>Delete request</a>;\n }\n\n function sendButton() {\n if (props.requirementSent) { return; }\n\n return <a className='btn-primary' href='#' onClick={sendRequest}>Send request</a>;\n }\n\n function cancelButton() {\n if (!props.requirementSent || props.requirementCompleted || props.requirementCanceled) { return; }\n\n return <a className='secondary clickable padding-right' href={`/supplemental_requirements/${props.requirementId}/cancel?type=${props.type}`} data-method='put'>Cancel request</a>;\n }\n\n return (\n <div className='fullwidth align-right'>\n {cancelButton()}\n {deleteButton()}\n {sendButton()}\n </div>\n );\n};\n\nexport default RequirementButtons;\n","var StepApprovalAPI = {\n approve: function(activeStepId, reviewGroupId, approvalStatus, opts){\n opts = opts || {};\n\n var url = '/active_steps/' + activeStepId + '/step_approvals/set_approval';\n var request = $.ajax(url, {\n data: {\n approval_status: approvalStatus,\n review_group_id: reviewGroupId,\n signature: opts.signatureData,\n comment: opts.comment,\n role_id: opts.roleId\n },\n dataType: 'json',\n method: 'POST'\n });\n\n return request;\n }\n};\n\nexport default StepApprovalAPI;\n","import _ from 'underscore';\n\nconst ReviewRequestsAPI = {\n \n create(reviewRequestData){\n const url = '/review_requests';\n\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n review_request: reviewRequestData \n }\n });\n },\n\n destroy(reviewRequestId){\n const url = '/review_requests/' + reviewRequestId;\n\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json'\n });\n },\n\n doReview(token, signatureData){\n const url = '/review_requests/' + token + '/do_review';\n\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n signature: signatureData\n }\n });\n }\n};\n\nexport default ReviewRequestsAPI;","import NProgress from 'nprogress';\nimport API from '../apis/step-approval-api';\nimport SearchAPI from '../apis/search-api';\nimport ReviewRequestsAPI from '../apis/review-requests-api';\nimport Flash from '../components/shared/flash';\n\nconst ReviewActions = {\n approve(reviewGroupId, activeStepId, approvalStatus, opts) {\n NProgress.start();\n\n const req = API.approve(activeStepId, reviewGroupId, approvalStatus, opts)\n .fail(() => {\n Flash.error();\n })\n .always(() => { NProgress.done(); });\n\n return req;\n },\n\n requestReview(reviewGroupId, activeStepId, receivingUserId) {\n return ReviewRequestsAPI.create({\n review_group_id: reviewGroupId,\n active_step_id: activeStepId,\n receiving_user_id: receivingUserId,\n });\n },\n\n requestNonUserReview(reviewGroupId, activeStepId, email, name) {\n NProgress.start();\n\n return ReviewRequestsAPI.create({\n review_group_id: reviewGroupId,\n active_step_id: activeStepId,\n email,\n name,\n })\n .always(() => {\n NProgress.done();\n });\n },\n\n undoRequestReview(reviewRequestId) {\n NProgress.start();\n\n return ReviewRequestsAPI.destroy(reviewRequestId)\n .done(() => { Flash.success('Request canceled'); })\n .fail(() => { Flash.error(); })\n .always(() => { NProgress.done(); });\n },\n\n searchReviewers(terms, initiatedFlowId) {\n return SearchAPI.searchThirdPartyReviewers(terms, initiatedFlowId);\n },\n\n submitThirdPartyReview(token, signatureData) {\n NProgress.start();\n\n const request = ReviewRequestsAPI.doReview(token, signatureData)\n .done(() => { Flash.success('Review completed successfully. You\\'re all done!'); })\n .fail(() => { Flash.error(); })\n .always(() => { NProgress.done(); });\n return request;\n },\n};\n\nexport default ReviewActions;\n","import React from 'react';\nimport ReviewActions from 'actions/review-actions';\nimport PersonSelector from 'components/shared/person-selector';\nimport Flash from 'components/shared/flash';\nimport TimeAgo from 'react-timeago';\nimport PropTypes from 'prop-types';\nimport dayjs from 'dayjs';\n\nclass ThirdPartyReviewPersonSelector extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n reviewRequest: this.props.defaultReviewRequest,\n };\n }\n\n approvalDate() {\n return dayjs(this.state.reviewRequest.step_approval.created_at).format('LLL');\n }\n\n doSearch = (newTerms) => {\n return ReviewActions.searchReviewers(newTerms, this.props.initiatedFlowId)\n .always(() => {\n this.setState({\n searching: false,\n });\n });\n };\n\n onSelect = (user) => {\n ReviewActions.requestReview(this.props.reviewGroupId, this.props.activeStepId, user.id)\n .done((res) => {\n this.setState({\n reviewRequest: res,\n });\n })\n\n .fail(() => {\n Flash.error();\n });\n };\n\n onSendInvite = (email, inviteeName) => {\n ReviewActions.requestNonUserReview(this.props.reviewGroupId, this.props.activeStepId, email, inviteeName)\n .done((res) => {\n this.setState({\n reviewRequest: res,\n });\n });\n };\n\n undoRequest = (e) => {\n e.preventDefault();\n\n if (!this.state.reviewRequest) {\n throw 'Attempted to undo nonexistant review request';\n }\n\n ReviewActions.undoRequestReview(this.state.reviewRequest.id)\n .done(() => {\n this.setState({\n reviewRequest: null,\n });\n });\n };\n\n renderReceivingUserName = () => {\n if (!this.state.reviewRequest) { return null; }\n\n if (!this.state.reviewRequest.receiving_user.pseudo) {\n return <strong>{this.state.reviewRequest.receiving_user.name}</strong>;\n }\n return (\n <>\n <strong>{this.state.reviewRequest.receiving_user.name}</strong> <em>({this.state.reviewRequest.receiving_user.email})</em>\n </>\n );\n };\n\n renderRequest = () => {\n let content;\n\n if (!this.state.reviewRequest.completed) {\n content = (\n <span>\n Request sent to {this.renderReceivingUserName()} <TimeAgo date={this.state.reviewRequest.created_at} />\n \n <a href='#' onClick={this.undoRequest}>Undo</a>\n </span>\n );\n } else {\n content = (\n <span>\n Reviewed by <strong>{this.state.reviewRequest.receiving_user.name}</strong> on {this.approvalDate()}\n {this.renderSignature()}\n </span>\n );\n }\n\n return (\n <div className='margin-bottom'>\n {content}\n </div>\n );\n };\n\n renderSignature = () => {\n const approval = this.state.reviewRequest.stepApproval;\n if (approval && approval.signing) {\n return (\n <div className='signaturebox-sigline vmiddle nomargin-top margin-left'>\n <span className='signaturebox-x'>x</span>\n <img src={approval.signing.signature.url} title={`Signature for ${approval.signing.user.name}`} />\n </div>\n );\n }\n };\n\n renderContent() {\n if (this.state.reviewRequest) {\n return this.renderRequest();\n }\n return (\n <PersonSelector\n style={{ width: '430px' }}\n allowPseudo\n pseudoNeedsRole={false}\n hideExternal\n doSearch={this.doSearch}\n onInvite={this.onSendInvite}\n onSelect={this.onSelect}\n attachableType='ThirdPartyReviewRequest'\n />\n );\n }\n\n renderInfo() {\n if (!this.state.reviewRequest) {\n return 'We will send a link to this party to complete their review.';\n }\n }\n\n render() {\n return (\n <div className='relative'>\n {this.renderContent()}\n\n <div className='color-text-medium text-smaller margin-top'>\n {this.renderInfo()}\n </div>\n </div>\n );\n }\n}\n\nThirdPartyReviewPersonSelector.propTypes = {\n defaultReviewRequest: PropTypes.shape({\n id: PropTypes.number.isRequired,\n review_group_id: PropTypes.number.isRequired,\n requesting_user_id: PropTypes.number.isRequired,\n active_step_id: PropTypes.number.isRequired,\n receiving_user_id: PropTypes.number,\n created_at: PropTypes.string.isRequired,\n completed: PropTypes.bool.isRequired,\n }),\n activeStepId: PropTypes.number.isRequired,\n reviewGroupId: PropTypes.number.isRequired,\n};\n\nexport default ThirdPartyReviewPersonSelector;\n","export function colorForApprovalStatus(approval_status) {\n switch (approval_status) {\n case true:\n return 'color-success';\n case false:\n return 'color-alert';\n case null:\n return 'text-semialert';\n default:\n throw `Unrecognized approval status ${approval_status}`;\n }\n}\n\nconst colorForApproval = (approval) => {\n return colorForApprovalStatus(approval.approval_status);\n};\n\nexport default colorForApproval;\n","import React from 'react';\nimport colorForApproval from 'modules/color-for-approval';\nimport dayjs from 'dayjs';\nimport PropTypes from 'prop-types';\nimport { isNull } from 'underscore';\n\nconst PreviousReview = (props) => {\n const subject = () => {\n if (CityGrows.Server.currentUserId === props.approval.user_id) {\n return 'you previously';\n }\n return props.approval.user_name;\n };\n\n const renderSignature = () => {\n if (props.approval.signature_url) {\n return (\n <div className='signaturebox-sigline vmiddle'>\n <span className='signaturebox-x'>x</span>\n <img src={props.approval.signature_url} title={`Signature for ${props.approval.user_name}`} />\n </div>\n );\n }\n };\n\n return (\n <div className='review-previous capitalize-first'>\n <span className='margin-right'>\n {subject()} \n <strong className={colorForApproval(props.approval)}>{props.approval.verb}</strong> on {dayjs(props.approval.created_at).format('l')} \n </span>\n {isNull(props.approval.approval_status) && (\n <button className='clickable secondary btn-link' type='button' onClick={props.onOpenDiscussionClick}>\n View\n </button>\n )}\n {renderSignature()}\n </div>\n );\n};\n\nPreviousReview.propTypes = {\n approval: PropTypes.shape({\n id: PropTypes.number.isRequired,\n verb: PropTypes.string.isRequired,\n created_at: PropTypes.string.isRequired,\n signature_url: PropTypes.string.isRequired,\n user_name: PropTypes.string.isRequired,\n user_id: PropTypes.number.isRequired,\n approval_status: PropTypes.bool,\n }).isRequired,\n onOpenDiscussionClick: PropTypes.func,\n};\nexport default PreviousReview;\n","import React, { useMemo, useState, createRef, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n uniqueId as generateUniqueId, any, isEmpty, isFunction,\n} from 'underscore';\nimport InlineNotification from 'components/shared/inline-notification';\nimport PreviousReview from './previous-review';\n\nconst ReviewInterface = ({\n previousReviews,\n onOpenDiscussionClick,\n onReviewStart,\n defaultApprovalMessage,\n defaultRejectionMessage,\n toName,\n onCommentChange,\n onApprovalStatusUpdate,\n submitButtonText,\n}) => {\n const form = createRef();\n const uniqueId = useMemo(() => generateUniqueId('review-interface-'), []);\n\n const [showErrors, setShowErrors] = useState(false);\n const [selectedApprovalStatus, setSelectedApprovalStatus] = useState(null);\n const [comment, setComment] = useState(null);\n\n const renderPreviousReviews = () => {\n if (any(previousReviews)) {\n const reviews = previousReviews.map((stepApproval) => {\n return (\n <PreviousReview\n key={stepApproval.id}\n approval={stepApproval}\n onOpenDiscussionClick={onOpenDiscussionClick}\n />\n );\n });\n\n return (\n <>\n <div className='linebreak margin-bottom' />\n {reviews}\n </>\n );\n }\n };\n\n const isReadyToSubmit = () => {\n return !any(submissionIssues());\n };\n\n const commentContent = () => {\n return comment;\n };\n\n const submissionIssues = () => {\n const issues = [];\n\n if (isEmpty(selectedApprovalStatus)) {\n issues.push('no_selection');\n }\n\n if (['reject', 'feedback'].includes(selectedApprovalStatus) && isEmpty(commentContent())) {\n issues.push('missing_comment');\n }\n\n return issues;\n };\n\n const renderErrorMessage = () => {\n if (showErrors) {\n return (\n <InlineNotification className='margin-top'>\n {invalidSubmissionReason()}\n </InlineNotification>\n );\n }\n };\n\n const invalidSubmissionReason = () => {\n if (!any(submissionIssues())) {\n return;\n }\n\n const issue = submissionIssues()[0];\n\n switch (issue) {\n case 'no_selection':\n return 'You must choose an option';\n case 'missing_comment':\n return 'You must include a comment';\n default:\n throw `Unhandled submission issue: '${issue}'`;\n }\n };\n\n const onSubmitClick = (e) => {\n e.preventDefault();\n\n if (!isReadyToSubmit()) {\n setShowErrors(true);\n return;\n }\n\n onReviewStart();\n };\n\n const focusComment = () => {\n const { comment } = form.current;\n comment.focus();\n };\n\n const commentIsDefault = () => {\n if (isEmpty(comment)) { return false; }\n return [defaultApprovalMessage, defaultRejectionMessage].includes(comment);\n };\n\n const onApprovalStatusDidUpdate = (e) => {\n if (commentIsDefault() || isEmpty(comment)) {\n setComment(defaultMessage(e.currentTarget.value));\n }\n\n setShowErrors(false);\n setSelectedApprovalStatus(e.currentTarget.value);\n\n if (isFunction(onApprovalStatusUpdate)) { onApprovalStatusUpdate(e); }\n };\n\n useEffect(() => {\n focusComment();\n if (isFunction(onCommentChange)) { onCommentChange(comment); }\n }, [selectedApprovalStatus]);\n\n const onCommentDidChange = (e) => {\n setShowErrors(false);\n setComment(e.currentTarget.value);\n };\n\n useEffect(() => {\n if (isFunction(onCommentChange)) { onCommentChange(comment); }\n }, [comment, onCommentChange]);\n\n const defaultMessage = (status) => {\n switch (status || selectedApprovalStatus) {\n case 'approve':\n if (!isEmpty(defaultApprovalMessage)) {\n return defaultApprovalMessage;\n }\n break;\n case 'reject':\n if (!isEmpty(defaultRejectionMessage)) {\n return defaultRejectionMessage;\n }\n break;\n default:\n return '';\n }\n };\n\n return (\n <div id='review-actions' className='padded'>\n <form ref={form}>\n <ul>\n <li>\n <div>\n <input\n id={`approveoption-${uniqueId}`}\n type='radio'\n onChange={onApprovalStatusDidUpdate}\n name='outcome'\n value='approve'\n />\n </div>\n\n <label htmlFor={`approveoption-${uniqueId}`}>\n <dl>\n <dt>Approve</dt>\n <dd>Allow this submission to move forward</dd>\n </dl>\n </label>\n </li>\n\n <li>\n <div>\n <input\n id={`feedbackoption-${uniqueId}`}\n type='radio'\n onChange={onApprovalStatusDidUpdate}\n name='outcome'\n value='feedback'\n />\n </div>\n\n <label htmlFor={`feedbackoption-${uniqueId}`}>\n <dl>\n <dt>Request changes</dt>\n <dd>Ask for a change to the submitted information</dd>\n </dl>\n </label>\n </li>\n\n <li>\n <div>\n <input\n id={`rejectoption-${uniqueId}`}\n type='radio'\n onChange={onApprovalStatusDidUpdate}\n name='outcome'\n value='reject'\n />\n </div>\n\n <label htmlFor={`rejectoption-${uniqueId}`}>\n <dl>\n <dt>Reject and halt</dt>\n <dd>Do not allow this submission to continue</dd>\n </dl>\n </label>\n </li>\n </ul>\n\n <textarea id='review-commentbox' name='comment' onChange={onCommentDidChange} className='review-actions-commentbox margin-bottom' placeholder={`Add a message for ${toName}...`} value={comment} />\n\n <button\n type='button'\n id='review-submitbutton'\n className={`btn-primary fullwidth ${!isReadyToSubmit() ? 'disabled' : ''}`}\n onClick={onSubmitClick}\n >\n {submitButtonText}\n </button>\n\n {renderErrorMessage()}\n\n <div>\n {renderPreviousReviews()}\n </div>\n </form>\n </div>\n );\n};\n\nReviewInterface.propTypes = {\n onApprovalStatusUpdate: PropTypes.func,\n onSubmitClick: PropTypes.func,\n onCommentChange: PropTypes.func,\n submitButtonText: PropTypes.string,\n previousReviews: PropTypes.array,\n toName: PropTypes.string,\n onReviewStart: PropTypes.func,\n defaultApprovalMessage: PropTypes.string,\n defaultRejectionMessage: PropTypes.string,\n};\n\nReviewInterface.defaultProps = {\n toName: 'the applicant',\n};\n\nexport default ReviewInterface;\n","import React, { useRef, useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport SignaturePad from 'react-signature-canvas';\nimport Modal from 'components/shared/modal';\nimport ReviewActions from 'actions/review-actions';\nimport _ from 'underscore';\n\nconst SubmitReviewWidget = (props) => {\n const [submitting, setSubmitting] = useState(false);\n const [error, setError] = useState(false);\n const [name, setName] = useState('');\n const [signed, setSigned] = useState(false);\n const signaturePad = useRef();\n\n useEffect(() => {\n if (signaturePad.current) {\n signaturePad.current.off();\n }\n }, []);\n\n function addText() {\n setSigned(false);\n const canvas = signaturePad.current.getCanvas();\n signaturePad.current.clear();\n\n const ctx = canvas.getContext('2d');\n ctx.font = '30px Brush Script MT, cursive';\n ctx.fillText(name, 200, 40);\n if (name.length > 0) { \n setError(false); \n setSigned(true);\n }\n }\n\n function reviewText() {\n if (!!props.affidavit && props.affidavit.length > 0) {\n return props.affidavit;\n }\n return 'I certify that I have reviewed this submission';\n }\n\n function onCancelClick(e) {\n e.preventDefault();\n\n props.onClose();\n }\n\n function authorizeSubmit() {\n if (submitting) { return false; }\n \n if (signatureRequired() && !signed) {\n setError(true);\n return false;\n }\n\n return true;\n }\n\n function onSubmitReview(e) {\n e.preventDefault();\n\n if (!authorizeSubmit()) { return; }\n\n setSubmitting(true);\n\n const signatureData = signatureRequired()\n ? signaturePad.current.getTrimmedCanvas().toDataURL()\n : null;\n const { roleId } = props;\n ReviewActions.approve(props.reviewGroupId, props.activeStepId, props.approvalStatus, {\n comment: props.comment,\n signatureData,\n roleId,\n })\n .done(onReviewSubmitComplete)\n .fail(onClose);\n }\n\n function onClose() {\n if (_.isFunction(props.onClose)) { props.onClose(); }\n }\n\n function onReviewSubmitComplete(res) {\n setSubmitting(false);\n\n onClose();\n if (_.isFunction(props.onReviewComplete)) { props.onReviewComplete(res); }\n }\n\n function signatureRequired() {\n const signatureRequiredStatuses = [\n 'approve',\n 'reject',\n ];\n\n return props.requireSignature && _.contains(signatureRequiredStatuses, props.approvalStatus);\n }\n\n function renderError() {\n if (error) {\n return <div className='text-alert margin-top-less'>A signature is required in order to continue</div>;\n }\n }\n\n function renderSignaturePad() {\n if (signatureRequired()) {\n return (\n <>\n <SignaturePad\n canvasProps={{ width: 600, height: 50, className: 'sigCanvas' }}\n ref={signaturePad}\n minWidth={2}\n maxWidth={5}\n />\n {renderError()}\n </>\n );\n }\n }\n\n function reviewSubmitButtonText() {\n switch (props.approvalStatus) {\n case 'approve':\n return 'Approve';\n case 'reject':\n return 'Reject and halt';\n case 'feedback':\n return 'Request changes';\n default:\n throw `Unrecognized approval status ${props.approvalStatus}`;\n }\n }\n\n function submitButtonClass() {\n const classes = ['btn-primary', 'float-right'];\n if (submitting) { classes.push('disabled'); }\n return classes.join(' ');\n }\n\n function renderSignatureButtons() {\n return (\n <>\n <label className='inline-block'>Name\n <input type='text' placeholder='Enter Name' onChange={(e) => { setName(e.target.value); }} value={name} />\n </label>\n <button className='btn-primary inline-block' type='submit' onClick={addText}>Sign</button>\n </>\n );\n }\n\n return (\n <Modal onOutsideClick={onClose}>\n <div style={{ minWidth: '50vw' }}>\n <h1>Review</h1>\n <p dangerouslySetInnerHTML={{ __html: reviewText() }} />\n\n {renderSignaturePad()}\n <div className='linebreak' />\n\n {signatureRequired() && renderSignatureButtons()}\n <div>\n <div className='float-right'>\n <button className={submitButtonClass()} onClick={onSubmitReview} >{reviewSubmitButtonText()}</button>\n <button onClick={onCancelClick} className='btn-secondary margin-right'>Cancel</button>\n </div>\n </div>\n </div>\n </Modal>\n );\n}\n\nSubmitReviewWidget.propTypes = {\n onReviewComplete: PropTypes.func,\n onClose: PropTypes.func,\n requireSignature: PropTypes.bool.isRequired,\n reviewGroupId: PropTypes.number.isRequired,\n activeStepId: PropTypes.number.isRequired,\n affidavit: PropTypes.string,\n};\n\nexport default SubmitReviewWidget;\n","import React, { useState, useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport colorForApproval from 'modules/color-for-approval';\nimport { any, first } from 'underscore';\nimport InitiatedFlowConstants from 'constants/initiated-flow-constants';\nimport ActiveStepConstants from 'constants/active-step-constants';\nimport DiscussionActions from 'actions/discussion-actions';\nimport DiscussionDispatchContext from 'contexts/discussion-dispatch-context';\nimport UserDisc from 'components/shared/user-disc';\nimport PreviousReview from './previous-review';\nimport ReviewInterface from './interface';\nimport SubmitReviewWidget from './submit-review-widget';\n\nconst Reviewer = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const discussionDispatch = useContext(DiscussionDispatchContext);\n const [showPrompt, setShowPrompt] = useState(false);\n const [selectedApprovalStatus, setSelectedApprovalStatus] = useState(null);\n const [comment, setComment] = useState(null);\n const [recentlyCompletedReview, setRecentlyCompletedReview] = useState(null);\n\n function onReviewComplete(res) {\n setShowPrompt(false);\n setRecentlyCompletedReview(res.approval);\n setSelectedApprovalStatus(null);\n setComment(null);\n\n if (res.approval.approval_status === false) {\n dispatch({\n type: InitiatedFlowConstants.HALTED,\n });\n }\n\n DiscussionActions.loadDiscussions(props.initiatedFlow.id, discussionDispatch);\n\n dispatch({\n type: ActiveStepConstants.CHANGES_PERSISTED,\n reviewSubmitted: true,\n });\n }\n\n function onReviewStart() {\n setShowPrompt(true);\n }\n\n function onWidgetClose() {\n setShowPrompt(false);\n }\n\n function onCommentChange(newComment) {\n setComment(newComment);\n }\n\n function onApprovalStatusUpdate(e) {\n setSelectedApprovalStatus(e.target.value);\n }\n\n function submitButtonText() {\n if (any(props.reviewer.previous_reviews)) {\n return 'Submit another review';\n }\n\n return 'Submit review';\n }\n\n function renderApprovalInterface() {\n let content;\n\n if (recentlyCompletedReview) {\n content = (\n <div className='margin-top margin-bottom'>\n You <strong className={colorForApproval(recentlyCompletedReview)}>{recentlyCompletedReview.verb}</strong>\n </div>\n );\n } else {\n content = (\n <ReviewInterface\n onApprovalStatusUpdate={onApprovalStatusUpdate}\n onCommentChange={onCommentChange}\n onReviewStart={onReviewStart}\n submitButtonText={submitButtonText()}\n previousReviews={props.reviewer.previous_reviews}\n toName={props.initiatedFlow.primary_applicant.name}\n defaultApprovalMessage={props.defaultApprovalMessage}\n defaultRejectionMessage={props.defaultRejectionMessage}\n onOpenDiscussionClick={props.onOpenDiscussionClick}\n />\n );\n }\n\n return (\n <>\n <div className='linebreak nomargin-bottom' />\n {content}\n </>\n );\n }\n\n function renderApproval() {\n if (props.isMe) {\n return renderApprovalInterface();\n }\n\n return renderNonCurrentUserReview();\n }\n\n function mostRecentReview() {\n return first(props.reviewer.previous_reviews);\n }\n\n function roleIdParam() {\n if (!props.reviewer.reviewer.role_id) { return ''; }\n\n return `?role_id=${props.reviewer.reviewer.role_id}`;\n }\n\n function renderNonCurrentUserReview() {\n const approval = mostRecentReview();\n\n if (approval) {\n return (\n <>\n <div className='linebreak' />\n <PreviousReview approval={approval} onOpenDiscussionClick={props.onOpenDiscussionClick}/>\n </>\n );\n }\n\n return <strong className='margin-left text-semialert'>Review pending</strong>;\n }\n\n function renderReviewPrompt() {\n if (props.isMe && showPrompt) {\n return (\n <SubmitReviewWidget\n key={props.reviewer.reviewer.id}\n reviewer={props.reviewer.reviewer}\n roleId={props.reviewer.reviewer.role_id}\n reviewGroupId={props.reviewGroupId}\n activeStepId={props.activeStepId}\n affidavit={props.affidavit}\n requireSignature={props.requireSignature}\n stepId={props.stepId}\n initiatedFlowId={props.initiatedFlow.id}\n onClose={onWidgetClose}\n onReviewComplete={onReviewComplete}\n approvalStatus={selectedApprovalStatus}\n comment={comment}\n />\n );\n }\n }\n\n function renderReviewAppLink() {\n if (!props.isMe) { return; }\n\n return (\n <span className='stepapprovals-reviewapplink'>\n <span className='icon icon-external' />\n <a className='margin-left-less secondary' target='_blank' href={`/initiated_flows/${props.initiatedFlow.id}/steps/${props.stepId}/review/${props.reviewGroupId}${roleIdParam()}`} rel='noreferrer'>Open in review manager</a>\n </span>\n );\n }\n\n return (\n <div className={`stepapprovals-reviewerrow${props.isMe ? ' me' : ''}`}>\n <div className='stepapprovals-reviewername'>\n <UserDisc\n user={props.reviewer.reviewer}\n className='margin-right'\n options={{\n showName: true,\n }}\n />\n {renderReviewAppLink()}\n {renderApproval()}\n </div>\n\n {renderReviewPrompt()}\n </div>\n );\n};\n\nReviewer.propTypes = {\n affidavit: PropTypes.string,\n initiatedFlow: PropTypes.object.isRequired,\n stepId: PropTypes.number.isRequired,\n requireSignature: PropTypes.bool.isRequired,\n isMe: PropTypes.bool.isRequired,\n reviewer: PropTypes.object.isRequired,\n reviewGroupId: PropTypes.number.isRequired,\n activeStepId: PropTypes.number.isRequired,\n};\n\nexport default Reviewer;\n","import React from 'react';\nimport _ from 'underscore';\nimport PropTypes from 'prop-types';\nimport Reviewer from './reviewer';\n\nconst SpecificPeopleReview = (props) => {\n const renderReviewer = (reviewer) => {\n return (\n <Reviewer\n key={reviewer.reviewer.id}\n reviewer={reviewer}\n isMe={isMe(reviewer.reviewer)}\n reviewGroupId={props.activeReviewGroup.review_group_id}\n activeStepId={props.activeReviewGroup.active_step_id}\n affidavit={props.activeReviewGroup.affidavit}\n defaultApprovalMessage={props.activeReviewGroup.default_approval_message}\n defaultRejectionMessage={props.activeReviewGroup.default_rejection_message}\n requireSignature={props.activeReviewGroup.require_signature}\n stepId={props.stepId}\n initiatedFlow={props.initiatedFlow}\n onOpenDiscussionClick={props.onOpenDiscussionClick}\n />\n );\n };\n\n const isMe = (reviewer) => {\n if (!reviewer.is_role) {\n return reviewer.id == props.currentUserId;\n }\n return _.contains(reviewer.member_ids, props.currentUserId);\n };\n\n // Sort by you first\n const sortedReviewers = _.sortBy(props.activeReviewGroup.reviewers, (reviewer) => {\n return !isMe(reviewer);\n });\n\n return (\n <div className='stepapprovals'>\n {sortedReviewers.map(renderReviewer)}\n </div>\n );\n};\n\nSpecificPeopleReview.propTypes = {\n activeReviewGroup: PropTypes.object.isRequired,\n currentUserId: PropTypes.number.isRequired,\n initiatedFlow: PropTypes.object.isRequired,\n stepId: PropTypes.number.isRequired,\n};\n\nexport default SpecificPeopleReview;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport ThirdPartyReviewPersonSelector from './third-party-review-person-selector';\nimport SpecificPeopleReview from './specific-people-review';\n\nclass ActiveReviewGroup extends Component {\n renderReviewTypeInfo = () => {\n switch (this.props.reviewGroup.review_type) {\n case 'specific_people':\n return this.renderSpecificPeopleReviewInfo();\n case 'third_party':\n return this.renderThirdPartyReviewInfo();\n default:\n throw (`Can't render review info for unknown review type ${this.props.reviewGroup.review_type}`);\n }\n };\n\n renderSpecificPeopleReviewInfo = () => {\n return this.props.admin ? this.renderAdminView()\n : <div>{this.renderConstituentView()}</div>;\n };\n\n renderConstituentView = () => {\n if (this.props.reviewGroup.completed) {\n return 'Complete';\n }\n return 'Not reviewed yet';\n };\n\n renderAdminView = () => {\n const logicWord = (this.props.reviewGroup.logic_type === 'and' ? 'All' : 'Any');\n\n return (\n <div>\n <div className='margin-bottom'>{logicWord} of the following reviewers must approve</div>\n <SpecificPeopleReview\n currentUserId={this.props.currentUserId}\n activeReviewGroup={this.props.reviewGroup}\n initiatedFlow={this.props.initiatedFlow}\n stepId={this.props.stepId}\n onOpenDiscussionClick={this.props.onOpenDiscussionClick}\n />\n </div>\n );\n };\n\n renderThirdPartyReviewInfo = () => {\n return (\n <div>\n <ThirdPartyReviewPersonSelector\n reviewGroupId={this.props.reviewGroup.review_group_id}\n activeStepId={this.props.reviewGroup.active_step_id}\n defaultReviewRequest={this.props.reviewGroup.review_request}\n initiatedFlowId={this.props.initiatedFlow.id}\n />\n </div>\n );\n };\n\n renderStatus = () => {\n let innerHTML;\n\n const { completed } = this.props.reviewGroup;\n\n if (completed) {\n innerHTML = <span className='color-success'><i className='icon-check-green' style={{ position: 'relative', marginRight: '5px', bottom: '1px' }} />Completed</span>;\n } else {\n innerHTML = 'Pending';\n }\n\n return (\n <div className={`reviewgroup-status ${completed ? 'success' : 'alert'}`}>\n {innerHTML}\n </div>\n );\n };\n\n render() {\n const optional = !this.props.reviewGroup.required\n ? <span className='margin-left color-text-medium text-smaller'>Optional</span>\n : null;\n\n return (\n <div className='raised padded bg-grey margin-bottom'>\n <div className='subtitle'>{this.props.reviewGroup.name_or_default}</div> {optional}\n {this.renderStatus()}\n {this.renderReviewTypeInfo()}\n </div>\n );\n }\n}\n\nActiveReviewGroup.propTypes = {\n admin: PropTypes.bool.isRequired,\n currentUserId: PropTypes.number.isRequired,\n initiatedFlow: PropTypes.object.isRequired,\n reviewGroup: PropTypes.object.isRequired,\n stepId: PropTypes.number.isRequired,\n onOpenDiscussionClick: PropTypes.func.isRequired,\n};\n\nexport default ActiveReviewGroup;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport _ from 'underscore';\nimport pluralize from 'modules/pluralize';\nimport InlineNotification from 'components/shared/inline-notification';\n\nconst ConstituentReviewInfo = (props) => {\n const outstandingChangeRequests = () => {\n const test = (d) => {\n return !d.resolved && _.isNull(d.step_approval?.approval_status);\n };\n\n return _.filter(props.discussions, test);\n };\n\n const changes = outstandingChangeRequests();\n const count = changes.length;\n\n if (count > 0) {\n return (\n <InlineNotification className='margin-bottom'>\n <div>\n You have {count} requested {pluralize('change', count, { many: 'changes' })} that {pluralize('needs', count, { many: 'need' })} to be addressed. When you have made the requested changes, click the <em>Resolved</em> checkbox in the discussion. \n <a href='#' onClick={props.onOpenDiscussionClick}>View requested {pluralize('change', count, { many: 'changes' })}</a>\n </div>\n </InlineNotification>\n );\n }\n\n if (props.hasThirdPartyReview) { return <></>; }\n\n return (\n <div>\n Review is in progress. No action is required from you at this time.\n <div className='linebreak margin-bottom-more margin-top' />\n </div>\n );\n};\n\nConstituentReviewInfo.propTypes = {\n discussions: PropTypes.array.isRequired,\n hasThirdPartyReview: PropTypes.bool.isRequired,\n onOpenDiscussionClick: PropTypes.func.isRequired,\n};\n\nConstituentReviewInfo.defaultProps = {\n hasThirdPartyReview: false,\n onOpenDiscussionClick: () => {},\n};\n\nexport default ConstituentReviewInfo;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { any, where, filter } from 'underscore';\nimport pluralize from 'modules/pluralize';\nimport ActiveReviewGroup from './reviews/active-review-group';\nimport ConstituentReviewInfo from './reviews/constituent-review-info';\n\nconst RequireReviewStep = (props) => {\n function anyThirdPartyReview() {\n return any(requiredReviewGroups(), (g) => {\n return g.review_type === 'third_party';\n });\n }\n\n function renderReviewGroups() {\n return requiredReviewGroups().map(renderReviewGroup);\n }\n\n function reviewGroupRequired(group) {\n return group.should_show;\n }\n\n function renderReviewGroup(group) {\n return (\n <ActiveReviewGroup\n reviewGroup={group}\n currentUserId={props.currentUserId}\n key={group.review_group_id}\n admin={props.admin}\n initiatedFlow={props.initiatedFlow}\n stepId={props.stepId}\n discussions={props.discussions}\n onOpenDiscussionClick={props.onOpenDiscussionClick}\n />\n );\n }\n\n function completedCount() {\n return where(props.activeStep.review_groups, { completed: true }).length;\n }\n\n function requiredReviewGroups() {\n return filter(props.activeStep.review_groups, (group) => { return reviewGroupRequired(group); });\n }\n\n function unrequiredReviewGroups() {\n return filter(props.activeStep.review_groups, (group) => { return !reviewGroupRequired(group); });\n }\n\n function requiredReviewCount() {\n return requiredReviewGroups().length;\n }\n\n function unrequiredReviewCount() {\n return unrequiredReviewGroups().length;\n }\n\n function unrequiredReviewGroupHTML() {\n if (props.admin) {\n const count = unrequiredReviewCount();\n\n if (count > 0) {\n return <div className='color-text-medium margin-top-less'>{count} {pluralize('review', count)} not required</div>;\n }\n }\n }\n\n function renderReviewInfo() {\n const requiredCount = requiredReviewCount();\n if (requiredCount > 0) {\n return (\n <>\n <p className='bigger nomargin'><strong>{completedCount()}</strong> of <strong>{requiredCount}</strong> parties have completed their review</p>\n {unrequiredReviewGroupHTML()}\n </>\n );\n }\n\n if (props.admin) {\n return <p className='nomargin'>No review is required at this time. Please continue on to the next step.</p>;\n }\n }\n\n function renderConstituentAction() {\n if (!props.admin) {\n return (\n <ConstituentReviewInfo\n activeStep={props.activeStep}\n discussions={props.discussions}\n onOpenDiscussionClick={props.onOpenDiscussionClick}\n hasThirdPartyReview={anyThirdPartyReview()}\n />\n );\n }\n }\n\n return (\n <div className='currentstep-stepsection'>\n <div className='margin-bottom'>\n {renderConstituentAction()}\n {renderReviewInfo()}\n </div>\n\n {renderReviewGroups()}\n </div>\n );\n};\n\nRequireReviewStep.propTypes = {\n activeStepId: PropTypes.number.isRequired,\n currentUserId: PropTypes.number.isRequired,\n reviewGroups: PropTypes.arrayOf(PropTypes.object).isRequired,\n admin: PropTypes.bool.isRequired,\n collectedData: PropTypes.arrayOf(PropTypes.object).isRequired,\n};\n\nexport default RequireReviewStep;\n","import React from 'react';\nimport EmbeddedTextarea from 'components/shared/embedded-text-area';\nimport { debounce } from 'underscore';\n\nconst RequirementDescriptionManager = (props) => {\n const updateDescription = (newDescription) => {\n if (newDescription !== props.description) {\n props.update(props.step.id, { description: newDescription });\n }\n };\n\n return (\n <EmbeddedTextarea\n defaultValue={props.description}\n placeholder={props.disabled ? '' : 'Add a brief description...'}\n disabled={props.disabled}\n onChange={debounce(updateDescription, 500)}\n className='stepcreator-description'\n />\n );\n};\n\nexport default RequirementDescriptionManager;\n","import React, { useContext, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport PaymentStepDetails from 'components/shared/payment-step-details';\nimport _ from 'underscore';\nimport StepDataCollector from 'components/shared/step-data-collector';\nimport RequirementActions from 'actions/requirement-actions';\nimport InlineNotification from 'components/shared/inline-notification';\nimport PaymentStep from '../steps/payment-step';\nimport CollectInfoStep from '../steps/collect-info-step';\nimport RequirementDescriptionManager from './requirement-description-manager';\nimport RequirementButtons from './requirement-buttons';\n\nconst SupplementalRequirement = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const title = useRef();\n const debouncedSubmitChange = _.debounce(submitChange, 1000);\n\n function update(id, attrs) {\n return RequirementActions.updateAttrs(dispatch, id, attrs, props.requirement.type);\n }\n\n function submitChange() {\n update(props.requirement.id, { name: title.current.value });\n }\n\n function renderRequirement() {\n switch (props.requirement.type) {\n case ('PaymentRequirement'):\n return (\n <PaymentStep\n activeStep={props.requirement.payment}\n teamFriendlyId={CityGrows.Server.initiatedFlowData.team.friendly_id}\n supplemental\n active={!props.initiatedFlow.halted}\n step={props.requirement}\n charges={props.requirement.payment.charges}\n admin={props.admin}\n />\n );\n case ('DataRequirement'):\n return (\n <CollectInfoStep\n step={props.requirement}\n collectedData={props.collectedData}\n initiatedFlow={props.initiatedFlow}\n admin={props.admin}\n teamId={props.teamId}\n locked={props.requirement.active_step.locked}\n activeStep={props.requirement.active_step}\n signaturesAllowed={false}\n />\n );\n default:\n throw `Unrecognized step type ${props.requirement.type}`;\n }\n }\n\n function renderRequirementEditor() {\n switch (props.requirement.type) {\n case ('PaymentRequirement'):\n return (\n <PaymentStepDetails\n step={props.requirement}\n updateAttrs={update}\n disabled={false}\n />\n );\n\n case ('DataRequirement'):\n return (\n <StepDataCollector\n key={`datacollector-${props.requirement.id}`}\n sections={props.requirement.sections}\n allowedStepDatumTypes={CityGrows.Server.allowedStepDatumTypes}\n disabled={false}\n sectionableType='Requirement'\n sectionableId={props.requirement.id}\n flowTemplate={props.requirement.flowTemplate}\n stepId={props.requirement.id}\n />\n );\n default:\n throw `Unrecognized step type ${props.requirement.type}`;\n }\n }\n\n function stepNameHeader() {\n switch (props.requirement.type) {\n case 'PaymentRequirement':\n return 'Additional Payment Name';\n default:\n return `${props.requirement.type} Step`;\n }\n }\n\n function renderRequirementDetails() {\n if (props.requirement.sent) { return; }\n\n return (\n <>\n <div className='stepcreator-steptype'>\n {stepNameHeader()}\n </div>\n\n <div className='stepcreator-details-stepname'>\n <input\n ref={title}\n id='requesttitle'\n placeholder='Add a request name'\n type='text'\n defaultValue={props.requirement.name_or_default}\n onChange={debouncedSubmitChange}\n />\n </div>\n <RequirementDescriptionManager\n key={props.requirement.id}\n step={props.requirement}\n description={props.requirement.description}\n update={update}\n />\n </>\n );\n }\n\n function canceledBanner() {\n if (props.requirement.canceled) {\n return <InlineNotification> This requirement has been canceled.</InlineNotification>;\n }\n }\n\n if (props.requirement.sent) {\n return (\n <>\n <div className='currentstep-stepsection nopadding-top nopadding-bottom'>{canceledBanner()}</div>\n {renderRequirement()}\n <div className='currentstep-stepsection padding-bottom'>\n <RequirementButtons\n requirementId={props.requirement.id}\n type={props.requirement.type}\n requirementCompleted={props.requirement.completed}\n requirementSent={props.requirement.sent}\n requirementCanceled={props.requirement.canceled}\n />\n </div>\n </>\n );\n }\n\n return (\n <div className='requirementcreator-details'>\n <div className='stepcreator-details-padding'>\n {renderRequirementDetails()}\n <div className='linebreak' />\n {renderRequirementEditor()}\n <RequirementButtons\n requirementId={props.requirement.id}\n type={props.requirement.type}\n requirementCompleted={props.requirement.completed}\n requirementSent={props.requirement.sent}\n requirementCanceled={props.requirement.canceled}\n />\n </div>\n </div>\n );\n};\n\nSupplementalRequirement.propTypes = {\n requirement: PropTypes.object.isRequired,\n admin: PropTypes.bool.isRequired,\n collectedData: PropTypes.array,\n initiatedFlow: PropTypes.object.isRequired,\n teamId: PropTypes.number.isRequired,\n};\n\nexport default SupplementalRequirement;\n","import NProgress from 'nprogress';\nimport { any } from 'underscore';\nimport SurveyInvitationsAPI from '../../apis/survey-invitations-api';\nimport { error, success } from '../../components/shared/flash';\nimport SurveySubmissionConstants from '../../constants/survey-submission-constants';\n\nfunction onInvitesSent(dispatch, invites) {\n dispatch({\n type: SurveySubmissionConstants.INVITES_ADDED,\n invites,\n });\n\n success('Invitations sent');\n}\n\nfunction onInviteFailed(res) {\n const response = res.responseJSON;\n const errorMessage = (response && any(response.errors)) ? response.errors[0] : '';\n error(errorMessage);\n}\n\nfunction onInviteComplete() {\n NProgress.done();\n}\n\nconst SurveyActions = {\n inviteByList(dispatch, surveyToken, listOfEmails, message) {\n NProgress.start();\n\n return SurveyInvitationsAPI.doSend(surveyToken, listOfEmails, message)\n .done((res) => { onInvitesSent(dispatch, res); })\n .fail(onInviteFailed)\n .always(onInviteComplete);\n },\n\n inviteByCSV(dispatch, surveyToken, file, message) {\n return SurveyInvitationsAPI.doSend(surveyToken, file, message)\n .done((res) => { onInvitesSent(dispatch, res); })\n .fail(onInviteFailed)\n .always(onInviteComplete);\n },\n};\n\nexport default SurveyActions;\n","import PropTypes from 'prop-types';\nimport React, { useContext } from 'react';\nimport { withRouter } from 'react-router';\nimport Actions from 'actions/survey-submission-actions';\nimport TimeAgo from 'react-timeago';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport { confirm } from 'modules/alert-confirm';\nimport XClose from 'components/shared/x-close';\n\nconst SurveySubmissionLine = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n function onSubmissionClick(e) {\n e.preventDefault()\n props.history.push(`/survey-response/${props.submission.id}`);\n }\n\n function onDeleteClick(e) {\n e.stopPropagation();\n e.preventDefault();\n confirm('Delete this submission?', 'Are you sure you want to delete this submission?', () => {\n Actions.destroy(props.submission.id)\n .done(() => {\n Actions.dispatchSubmissionDestroyed(dispatch, props.submission.id);\n });\n });\n }\n\n function renderEmail() {\n if (props.submission.email) {\n return (\n <span className='margin-left'>\n {props.submission.email}\n </span>\n );\n }\n }\n\n return (\n <li className='clickable' onClick={onSubmissionClick} >\n <a href={`/initiated_flows/manager/${props.initiatedFlowId}#/survey-response/${props.submission.id}`} onClick={onSubmissionClick} >\n <strong>#{props.submission.scoped_id}</strong>\n {renderEmail()}\n <XClose onClick={onDeleteClick} label='Delete submission' buttonClass='float-right' />\n <TimeAgo\n date={props.submission.created_at}\n className='float-right color-text-medium margin-right'\n />\n </a>\n </li>\n );\n};\n\nSurveySubmissionLine.propTypes = {\n submission: PropTypes.object.isRequired,\n};\n\nexport default withRouter(SurveySubmissionLine)\n","import React, { useContext } from 'react';\nimport Actions from 'actions/survey-submission-actions';\nimport TimeAgo from 'react-timeago';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport { confirm } from 'modules/alert-confirm';\nimport XClose from 'components/shared/x-close';\n\nconst SurveySubmissionLineTaskView = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n\n function onDeleteClick(e) {\n e.stopPropagation();\n confirm('Delete this submission?', 'Are you sure you want to delete this submission?', () => {\n Actions.destroy(props.submission.id)\n .done(() => {\n Actions.dispatchSubmissionDestroyed(dispatch, props.submission.id);\n });\n });\n }\n\n function renderEmail() {\n if (props.submission.email) {\n return (\n <span className='margin-left'>\n {props.submission.email}\n </span>\n );\n }\n }\n\n return (\n <li className='clickable' >\n <a href={`/initiated_flows/manager/${props.initiatedFlowId}#/survey-response/${props.submission.id}`} target='_blank' >\n <strong>#{props.submission.scoped_id}</strong>\n {renderEmail()}\n <XClose onClick={onDeleteClick} label='Delete submission' />\n <TimeAgo\n date={props.submission.created_at}\n className='float-right color-text-medium margin-right'\n />\n </a>\n </li>\n );\n};\n\nexport default SurveySubmissionLineTaskView;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { exportResponses } from 'actions/survey-actions';\nimport ajaxDownload from 'modules/ajax-download';\nimport BackgroundedJobLink from 'components/shared/backgrounded-job-link';\nimport { error } from 'components/shared/flash';\nimport { alert } from 'modules/alert-confirm';\nimport SurveySubmissionLine from './survey-submission-line';\nimport SurveySubmissionLineTaskView from './survey-submission-line-task-view';\n\nconst SurveyResponses = ({\n surveySubmissions,\n activeStepId,\n initiatedFlowId,\n taskView,\n}) => {\n const renderSurveySubmissions = () => {\n const submissions = surveySubmissions;\n\n if (submissions.length) {\n return (\n <ul className='surveystep-responses'>\n {submissions.map(renderSurveySubmissionLine)}\n </ul>\n );\n }\n };\n\n const renderSurveySubmissionLine = (submission) => {\n if (taskView) {\n return (\n <SurveySubmissionLineTaskView\n submission={submission}\n key={submission.id}\n initiatedFlowId={initiatedFlowId}\n />\n )\n }\n\n return (\n <SurveySubmissionLine\n submission={submission}\n key={submission.id}\n initiatedFlowId={initiatedFlowId}\n />\n );\n };\n\n const alertWithDownloadURL = (url) => {\n alert('Download ready', `<a target='_blank' href='${url}'>Click here to download your file</a>`);\n };\n\n const onSurveyDownloadReady = (res) => {\n const parsed = JSON.parse(res);\n const url = parsed.file_url;\n const fileName = parsed.file_name;\n\n ajaxDownload(url, fileName)\n .catch(() => { alertWithDownloadURL(url); });\n };\n\n return (\n <section>\n <div className='surveystep-label inline-block padding-bottom'>Responses ({surveySubmissions.length})</div>\n <BackgroundedJobLink\n queueFunction={() => { return exportResponses(activeStepId); }}\n onJobComplete={onSurveyDownloadReady}\n onFail={error}\n workingText='Exporting...'\n className='float-right btn-link strong'\n disabled={surveySubmissions.length == 0}\n >\n Export responses\n </BackgroundedJobLink>\n {renderSurveySubmissions()}\n </section>\n );\n};\n\nSurveyResponses.propTypes = {\n surveySubmissions: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n activeStepId: PropTypes.number.isRequired,\n};\n\nexport default SurveyResponses;\n","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\nimport Actions from 'actions/survey-submission-actions';\nimport TimeAgo from 'react-timeago';\n\nclass SurveyInvitationLine extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n reminded: false,\n };\n }\n\n onResendClick = (e) => {\n e.preventDefault();\n\n if (this.state.reminded) { return; }\n\n this.setState({ reminded: true }, () => {\n Actions.sendReminder(this.props.invitation.id)\n .fail(this.onRemindFailed);\n });\n };\n\n onRemindFailed = () => {\n this.setState({\n reminded: false,\n });\n };\n\n remindLink = () => {\n if (this.state.reminded) {\n return <span className='margin-left color-success'>Reminded</span>;\n }\n return <a href='#' className='secondary margin-left' onClick={this.onResendClick}>Remind</a>;\n };\n\n render() {\n return (\n <li>\n {this.props.invitation.email}\n <div className='float-right cf'>\n <TimeAgo\n date={this.props.invitation.created_at}\n className='color-text-medium'\n />\n {this.remindLink()}\n </div>\n </li>\n );\n }\n}\n\nSurveyInvitationLine.propTypes = {\n invitation: PropTypes.object.isRequired,\n};\n\nexport default SurveyInvitationLine;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport SurveySubmissionActions from 'actions/survey-submission-actions';\nimport SurveyInvitationLine from './survey-invitation-line';\n\nclass SurveyInvitations extends React.Component {\n constructor(props) {\n super(props);\n\n this.state = {\n reminded: false,\n };\n }\n\n rendersurveyInvitations = () => {\n const invitations = this.props.surveyInvitations;\n\n if (invitations.length) {\n return (\n <ul className='surveystep-responses'>\n {invitations.map(this.renderSurveyInvitationLine)}\n </ul>\n );\n }\n };\n\n renderSurveyInvitationLine(invitation) {\n return (\n <SurveyInvitationLine\n invitation={invitation}\n key={invitation.id}\n />\n );\n }\n\n onRemindAllClick = (e) => {\n e.preventDefault();\n\n if (this.state.reminded) { return; }\n\n this.setState({ reminded: true }, () => {\n SurveySubmissionActions.sendAllReminder(this.props.activeStepId)\n .fail(this.onRemindFailed);\n });\n };\n\n onRemindFailed = () => {\n this.setState({\n reminded: false,\n });\n };\n\n render() {\n if (this.props.surveyInvitations.length === 0) { return null; }\n\n return (\n <section className='margin-top-more'>\n <div className='surveystep-label inline-block padding-bottom'>Invites ({this.props.surveyInvitations.length})</div>\n <a\n href={`/active_steps/${this.props.activeStepId}/survey_invitations/export`}\n data-method='POST'\n className='float-right secondary'\n >\n Export invitations\n </a>\n <a\n href='#'\n onClick={this.onRemindAllClick}\n className='float-right secondary margin-right'\n >\n { this.state.reminded ? 'Reminder sent' : 'Remind all' }\n </a>\n {this.rendersurveyInvitations()}\n </section>\n );\n }\n}\n\nSurveyInvitations.propTypes = {\n surveyInvitations: PropTypes.array.isRequired,\n activeStepId: PropTypes.number.isRequired,\n};\n\nexport default SurveyInvitations;\n","import PropTypes from 'prop-types';\nimport React, { useState, useRef, useContext } from 'react';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport CopyableLink from 'components/shared/copyable-link';\nimport Modal from 'components/shared/modal';\nimport Textarea from 'react-textarea-autosize';\nimport SurveyActions from 'actions/initiated_flow/survey-actions';\nimport FileInput from 'components/shared/file-input';\nimport { publicHost } from 'modules/url-generator';\nimport SurveyResponses from './surveys/survey-responses';\nimport SurveyInvitations from './surveys/survey-invitations';\n\nconst SurveyStep = (props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const [inviting, setInviting] = useState(false);\n const [selectedFile, setSelectedFile] = useState(null);\n const [message, setMessage] = useState('');\n\n const emailsTextarea = useRef();\n\n function onInviteClick() {\n setInviting(true);\n setMessage(props.step.survey.default_invite_message || '');\n }\n\n function onSendClick() {\n const token = props.activeStep.survey_token;\n\n switch (inviteMethod()) {\n case 'list': {\n const emails = emailsTextarea.current.value;\n SurveyActions.inviteByList(dispatch, token, emails, message)\n .done(resetState);\n break;\n }\n case 'file':\n SurveyActions.inviteByCSV(dispatch, token, selectedFile, message)\n .done(resetState);\n break;\n default:\n throw `Unrecognized invite method ${inviteMethod()}`;\n }\n }\n\n function inviteMethod() {\n return selectedFile ? 'file' : 'list';\n }\n\n function resetState() {\n setInviting(false);\n setSelectedFile(null);\n }\n\n function onFileSelect(e) {\n setSelectedFile(e.currentTarget.files[0]);\n }\n\n function onMessageChange(e) {\n setMessage(e.currentTarget.value);\n }\n\n function renderSurveyLink() {\n if (!props.active) { return; }\n\n const { survey_token } = props.activeStep;\n const linkURL = `${publicHost()}/surveys/${survey_token}`;\n\n return (\n <section className='margin-bottom-more'>\n <label htmlFor='survey-link' className='surveystep-label'>Link to survey</label>\n <div className='inline-block' style={{ width: '400px' }}>\n <CopyableLink linkURL={linkURL} inputId='survey-link' />\n </div>\n <button onClick={onInviteClick} className=' margin-left btn-thirdary'>Invite...</button>\n </section>\n );\n }\n\n function renderSurvey() {\n const { survey_submissions, survey_invitations, id, initiated_flow_id } = props.activeStep;\n\n return (\n <div>\n {renderSurveyLink()}\n\n <SurveyResponses\n activeStepId={id}\n surveySubmissions={survey_submissions}\n initiatedFlowId={initiated_flow_id}\n taskView={props.taskView}\n />\n\n <SurveyInvitations\n activeStepId={id}\n surveyInvitations={survey_invitations}\n />\n </div>\n );\n }\n\n function renderNoInfoNeeded() {\n return (\n <p>Submission is in progress. No additional information is needed from you at this time.</p>\n );\n }\n\n function renderPublic() {\n if (props.step.external) {\n return renderSurvey();\n }\n\n return renderNoInfoNeeded();\n }\n\n function renderMessageBox() {\n return (\n <div className='padding-top'>\n <label>\n <span>Invite Message</span>\n <Textarea className='block fullwidth margin-bottom' value={message} placeholder='Message for survey invite email' onChange={onMessageChange} />\n </label>\n </div>\n );\n }\n\n function renderPasteBox() {\n if (!selectedFile) {\n return (\n <>\n <p>Paste a list of emails, one per line.</p>\n <Textarea className='block fullwidth margin-bottom' ref={emailsTextarea} placeholder={'email@example.com\\nemail@example.com'} />\n </>\n );\n }\n }\n\n function renderFileUpload() {\n let content;\n\n if (selectedFile) {\n content = selectedFile.name;\n } else {\n content = (\n <>\n <span>Or </span>\n <FileInput\n onChange={onFileSelect}\n className='inline-block'\n label='upload a csv of emails'\n />\n <span className='margin-left-less color-text-medium'>(Ensure the file type is .csv and the emails are in the first column.)</span>\n </>\n );\n }\n\n return <div>{content}</div>;\n }\n\n function sendButtonText() {\n if (selectedFile) {\n return 'Upload and send invites';\n }\n\n return 'Send invites';\n }\n\n function renderInviteManager() {\n if (inviting) {\n return (\n <Modal onOutsideClick={resetState}>\n <h1>Send survey invites</h1>\n {renderPasteBox()}\n {renderFileUpload()}\n {renderMessageBox()}\n <button className='btn-primary margin-top' onClick={onSendClick}>{sendButtonText()}</button>\n </Modal>\n );\n }\n }\n\n return (\n <div className='currentstep-stepsection surveystep'>\n {props.admin ? renderSurvey() : renderPublic()}\n {renderInviteManager()}\n </div>\n );\n};\n\nSurveyStep.propTypes = {\n active: PropTypes.bool.isRequired,\n activeStep: PropTypes.shape({\n id: PropTypes.number.isRequired,\n survey_submissions: PropTypes.array.isRequired,\n survey_token: PropTypes.string.isRequired,\n survey_invitations: PropTypes.array.isRequired,\n }).isRequired,\n\n step: PropTypes.object.isRequired,\n admin: PropTypes.bool.isRequired,\n};\n\nexport default SurveyStep;\n","import React from 'react';\nimport Output from './output/output';\n\nconst OutputsContainer = (props) => {\n function renderOutput(output) {\n return <Output output={output} />;\n }\n\n return props.outputs.map(renderOutput);\n};\n\nexport default OutputsContainer;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { where } from 'underscore';\nimport Instructions from '../../shared/instructions';\nimport CollectInfoStep from './steps/collect-info-step';\nimport AssignResponsibilityStep from './steps/assign-responsibility-step';\nimport PaymentStep from './steps/payment-step';\nimport RequirementButtons from './requirements/requirement-buttons';\nimport RequireReviewStep from './steps/require-review-step';\nimport SupplementalRequirement from './requirements/supplemental-requirement';\nimport SurveyStep from './steps/survey-step';\nimport OutputsContainer from './outputs-container';\n\nconst CurrentStep = (props) => {\n const {\n step, initiatedFlow, activeStep, attemptedAdvance,\n } = props;\n function contentForStepType() {\n if (activeStep.type === 'SupplementalRequirementActiveStep') {\n return (\n <SupplementalRequirement\n requirement={step}\n collectedData={activeStep.collected_data}\n admin={props.admin}\n initiatedFlow={initiatedFlow}\n teamId={props.teamId}\n />\n );\n }\n\n switch (step.type) {\n case ('BasicStep'):\n if (!props.admin) {\n if (!step.external) {\n return (\n <div className='currentstep-stepsection'>\n <p>Submission is in progress. Nothing is needed from you at this time.</p>\n </div>\n );\n }\n }\n\n if (props.taskView) { return <></>}\n\n break;\n case ('CollectInfoStep'):\n return (\n <CollectInfoStep\n step={step}\n initiatedFlow={initiatedFlow}\n admin={props.admin}\n teamId={props.teamId}\n activeStep={activeStep}\n collectedData={activeStep.collected_data}\n attemptedAdvance={attemptedAdvance}\n />\n );\n\n case ('AssignResponsibilityStep'):\n return (\n <AssignResponsibilityStep\n step={step}\n activeStep={activeStep}\n currentUserId={props.currentUserId}\n initiatedFlow={initiatedFlow}\n admin={props.admin}\n />\n );\n\n case ('RequireReviewStep'):\n return (\n <RequireReviewStep\n activeStep={activeStep}\n currentUserId={props.currentUserId}\n admin={props.admin}\n initiatedFlow={initiatedFlow}\n discussions={props.discussions}\n stepId={step.id}\n onOpenDiscussionClick={props.onOpenDiscussionClick}\n />\n );\n\n case ('PaymentStep'):\n return (\n <PaymentStep\n activeStep={activeStep}\n supplemental={false}\n step={step}\n admin={props.admin}\n teamFriendlyId={props.teamFriendlyId}\n authorities={props.authorities}\n active={initiatedFlow.is_active}\n />\n );\n\n case ('SurveyStep'):\n return (\n <SurveyStep\n activeStep={activeStep}\n step={step}\n admin={props.admin}\n active={initiatedFlow.is_active}\n taskView={props.taskView}\n />\n );\n\n default:\n throw `Unrecognized step type ${step.type}`;\n }\n }\n\n function renderRequirementButtons() {\n if (step.generic_type === 'Step') { return; }\n\n return (\n <RequirementButtons\n requirementId={step.id}\n type={step.type}\n requirementCompleted={step.completed}\n requirementSent={step.sent}\n requirementCanceled={step.canceled}\n />\n );\n }\n\n function renderRequirementDescription() {\n if (step.generic_type === 'Step' || !step.description) { return; }\n\n return (\n <div>{step.description}</div>\n );\n }\n\n function renderOutputsIssuedOnStep() {\n const outputs = where(initiatedFlow.issued_outputs, { issued_on_step_identity: step.identity });\n\n if (outputs.length === 0) { return; }\n\n return (\n <div className='currentstep-stepsection cf'>\n <OutputsContainer outputs={outputs} />\n </div>\n );\n }\n\n if (props.taskView) {\n return contentForStepType()\n }\n\n return (\n <div className='currentstep'>\n <div className='flowcontent-main'>\n <div className='currentstep-stepsection cf'>\n {renderRequirementButtons()}\n <div className='currentstep-title'>{step.name_or_default}</div>\n {renderRequirementDescription()}\n <Instructions admin={props.admin} initiatedFlow={initiatedFlow} step={step} />\n </div>\n\n {renderOutputsIssuedOnStep()}\n\n {contentForStepType()}\n </div>\n </div>\n );\n};\n\nCurrentStep.propTypes = {\n admin: PropTypes.bool.isRequired,\n teamId: PropTypes.number.isRequired,\n currentUserId: PropTypes.number.isRequired,\n activeStep: PropTypes.object.isRequired,\n onOpenDiscussionClick: PropTypes.func.isRequired,\n initiatedFlow: PropTypes.shape({\n id: PropTypes.number.isRequired,\n is_active: PropTypes.bool.isRequired,\n }).isRequired,\n step: PropTypes.shape({\n external: PropTypes.bool.isRequired,\n sent: PropTypes.bool,\n instructions: PropTypes.text,\n generic_type: PropTypes.isRequired,\n id: PropTypes.number.isRequired,\n type: PropTypes.string.isRequired,\n completed: PropTypes.bool,\n description: PropTypes.string,\n name_or_default: PropTypes.string.isRequired,\n }).isRequired,\n\n};\n\nexport default CurrentStep;\n","export const waive = (subprocessRequirementId) => {\n const url = `/subprocess_requirements/${subprocessRequirementId}/waive`;\n\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n });\n};\n\nexport const unwaive = (subprocessRequirementId) => {\n const url = `/subprocess_requirements/${subprocessRequirementId}/unwaive`;\n\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n });\n};\n\nexport const unlinkSubprocess = (subprocessRequirementId) => {\n const url = `/subprocess_requirements/${subprocessRequirementId}/unlink_subprocess`;\n\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n });\n};\n\nexport default {\n waive,\n unwaive,\n unlinkSubprocess,\n};\n","import ActiveStepConstants from 'constants/active-step-constants';\nimport InitiatedFlowConstants from 'constants/initiated-flow-constants';\nimport {\n waive,\n unwaive,\n unlinkSubprocess as apiUnlinkSubprocess,\n} from 'apis/subprocess-requirements-api';\nimport {\n error as flashError,\n success as flashSuccess,\n} from 'components/shared/flash';\n\nconst onRequirementWaived = (dispatch, attrs) => {\n flashSuccess('Requirement waived');\n\n dispatch({\n type: InitiatedFlowConstants.SUBPROCESS_REQUIREMENT_UPDATED,\n attrs,\n });\n\n dispatch({\n type: ActiveStepConstants.CHANGES_PERSISTED,\n });\n};\n\nconst onRequirementUnwaived = (dispatch, attrs) => {\n flashSuccess('Requirement unwaived');\n\n dispatch({\n type: InitiatedFlowConstants.SUBPROCESS_REQUIREMENT_UPDATED,\n attrs,\n });\n\n dispatch({\n type: ActiveStepConstants.CHANGES_PERSISTED,\n })\n};\n\nconst onSubprocessUnlinked = (dispatch, attrs) => {\n flashSuccess('Subprocess unlinked');\n\n dispatch({\n type: InitiatedFlowConstants.SUBPROCESS_REQUIREMENT_UPDATED,\n attrs,\n });\n\n dispatch({\n type: ActiveStepConstants.CHANGES_PERSISTED,\n });\n};\n\nexport const waiveRequirement = (dispatch, subprocessRequirementId) => {\n return waive(subprocessRequirementId)\n .done((res) => onRequirementWaived(dispatch, res))\n .fail(() => { flashError(); });\n};\n\nexport const unwaiveRequirement = (dispatch, subprocessRequirementId) => {\n return unwaive(subprocessRequirementId)\n .done((res) => onRequirementUnwaived(dispatch, res))\n .fail(() => { flashError(); });\n};\n\nexport const unlinkSubprocess = (dispatch, requirementId) => {\n return apiUnlinkSubprocess(requirementId)\n .done((res) => onSubprocessUnlinked(dispatch, res))\n .fail(() => { flashError(); });\n};\n\nexport default {\n waiveRequirement,\n unwaiveRequirement,\n};\n","import React, {\n useState, useRef, useMemo, useContext,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport Popdown from 'components/shared/popdown';\nimport {\n waiveRequirement,\n unwaiveRequirement,\n unlinkSubprocess,\n} from 'actions/subprocess-requirement-actions';\nimport { confirm } from 'modules/alert-confirm';\nimport useOnclickOutside from 'react-cool-onclickoutside';\n\nconst Options = ({\n requirementId,\n isWaived,\n unlinkable,\n isGov,\n}) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const onWaiveClick = () => {\n waiveRequirement(dispatch, requirementId);\n setOptionsOpen(false);\n };\n\n const onUnwaiveClick = () => {\n unwaiveRequirement(dispatch, requirementId);\n setOptionsOpen(false);\n };\n\n const onUnlinkClick = () => {\n confirm('Unlink subprocess?', 'Are you sure you want to unlink this sub-submission from its parent submission?', () => {\n unlinkSubprocess(dispatch, requirementId);\n setOptionsOpen(false);\n });\n };\n\n const optionsMenuRef = useRef();\n const optionsAnchor = useRef();\n const [optionsOpen, setOptionsOpen] = useState(false);\n\n useOnclickOutside(() => {\n setOptionsOpen(false);\n }, { refs: [optionsAnchor], ignoreClass: 'popdown' });\n\n const onOptionsClick = () => {\n setOptionsOpen(!optionsOpen);\n };\n\n const options = useMemo(() => {\n const options = [];\n\n if (unlinkable) {\n options.push((\n <li>\n <button\n type='button'\n onClick={onUnlinkClick}\n >\n Unlink subprocess\n </button>\n </li>\n ));\n }\n\n if (!isGov) { return options; }\n\n if (!isWaived) {\n options.push((\n <li>\n <button\n type='button'\n onClick={onWaiveClick}\n >\n Waive requirement\n </button>\n </li>\n ));\n } else {\n options.push((\n <li>\n <button\n type='button'\n onClick={onUnwaiveClick}\n >\n Unwaive requirement\n </button>\n </li>\n ));\n }\n\n return options;\n }, [isWaived, unlinkable]);\n\n return (\n <div className='flowtimeline-activerequirement-options'>\n <button\n ref={optionsAnchor}\n type='button'\n className='unstyled'\n onClick={onOptionsClick}\n >\n <i\n className='icon icon-dots-horizontal bigger margin-right-less'\n />\n </button>\n { optionsOpen && (\n <Popdown\n anchorRef={optionsAnchor}\n justify='right'\n >\n <ul\n className='popdown-listmenu'\n ref={optionsMenuRef}\n >\n {options}\n </ul>\n </Popdown>\n )}\n </div>\n );\n};\n\nOptions.propTypes = {\n requirementId: PropTypes.number.isRequired,\n};\n\nexport default Options;\n","import React, { memo, useContext, useMemo, useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport RequestIsGovContext from 'contexts/request-is-gov-context';\nimport PersonSelector from 'components/shared/person-selector';\nimport { isEmpty, isNull } from 'underscore';\nimport InitiatedFlowActions from 'actions/initiated-flow-actions';\nimport UserDisc from 'components/shared/user-disc';\nimport Selection from 'components/shared/person-selection';\nimport Options from './subprocess_requirement/options';\n\nconst SubprocessRequirement = memo((props) => {\n const isGov = useContext(RequestIsGovContext);\n const defaultApplicant = props.applicants.find((user) => user.id === CityGrows.Server.currentUserId) || props.primaryApplicant;\n const [primaryApplicant, setPrimaryApplicant] = useState(defaultApplicant);\n const [isLaunching, setIsLaunching] = useState(false);\n const [applicants, setApplicants] = useState(props.applicants);\n const [selectedApplicants, setSelectedApplicants] = useState([]);\n\n useEffect(() => {\n if (isLaunching) {\n document.getElementById('subprocess-start').focus()\n }\n }, [isLaunching])\n\n const onApplicantSelect = (applicant) => {\n setApplicants(props.applicants.filter((user) => { return user.id !== applicant.id; }));\n setSelectedApplicants(selectedApplicants.filter((user) => { return user.id !== applicant.id; }));\n setPrimaryApplicant(applicant);\n };\n\n const onSelectedApplicantChange = (e, applicant) => {\n if (e.currentTarget.checked) {\n setSelectedApplicants([...selectedApplicants, applicant]);\n } else {\n setApplicants(selectedApplicants.filter((user) => { return user.id !== applicant.id; }));\n }\n };\n\n const onApplicantRemove = () => {\n setPrimaryApplicant(null);\n setApplicants(props.applicants);\n };\n\n const onApplicantSearchCancel = () => {\n setPrimaryApplicant(defaultApplicant);\n };\n\n const onPrimaryApplicantChange = (applicant) => {\n setApplicants(props.applicants.filter((user) => { return user.id !== applicant.id; }));\n setSelectedApplicants(selectedApplicants.filter((user) => { return user.id !== applicant.id; }));\n setPrimaryApplicant(applicant);\n };\n\n const linkPath = useMemo(() => {\n if (props.requirement.subprocess_id) {\n return `/initiated_flows/manager/${props.requirement.subprocess_id}`;\n }\n\n let applicantsParams = `&primary_applicant_id=${primaryApplicant?.id}`;\n if (!isEmpty(selectedApplicants)) {\n applicantsParams += selectedApplicants.map((applicant) => { return `&secondary_applicant_ids[]=${applicant.id}`; }).join('');\n }\n\n return `/initiated_flows/manager?flow_template_id=${props.requirement.subprocess_workflow.id}&subprocess_requirement_id=${props.requirement.id}${applicantsParams}`;\n }, [props.requirement, primaryApplicant, selectedApplicants]);\n\n function status() {\n if (props.requirement.subprocess_workflow_not_published) { return 'done'; }\n\n if (props.requirement.completed && props.requirement.subprocess_id) { return 'done'; }\n\n return 'notdone';\n }\n\n function allowedToStart() {\n return !props.requirement.subprocess_workflow_not_published;\n }\n\n const renderLink = () => {\n if (props.requirement.subprocess_workflow_not_published) {\n return (\n <div className='flowtimeline-stepnamewrap'>\n <span className='flowtimeline-stepname'>\n {props.requirement.subprocess_workflow.name}\n <span className='block text-smaller color-text-medium'>Legacy Requirement. No action necessary</span>\n </span>\n </div>\n );\n }\n\n const showAsLink = !!props.requirement.subprocess_id;\n const linkMethod = props.requirement.subprocess_id ? 'GET' : 'POST';\n if (allowedToStart() && showAsLink) {\n return (\n <a href={linkPath} data-method={linkMethod} disabled={!allowedToStart()}>\n {props.requirement.subprocess_workflow.name}\n </a>\n );\n }\n\n return <span className='flowtimeline-stepnamewrap-title'>{props.requirement.subprocess_workflow.name}</span>;\n };\n\n const renderStartButton = () => {\n if (isLaunching) {\n if (primaryApplicant) {\n return <a id='subprocess-start' href={linkPath} data-method='POST'>Okay</a>;\n }\n return <span className='flowtimeline-stepnamewrap-title color-text-medium'>Okay</span>;\n }\n\n return <button type='button' className='btn-link' onClick={() => setIsLaunching(true)}>Start ></button>;\n };\n\n const searchPerson = (search) => {\n return InitiatedFlowActions.searchApplicants(search);\n };\n\n const renderApplicants = () => {\n const filteredApplicants = isNull(primaryApplicant)\n ? applicants\n : applicants.filter((applicant) => {\n return applicant.id !== primaryApplicant.id;\n });\n\n if (!isEmpty(filteredApplicants)) {\n return (\n <>\n <span className='title'>Applicants</span>\n <ul id='applicantlist' className='applicantmanager-applicants margin-top'>\n {filteredApplicants.map(renderApplicant)}\n </ul>\n </>\n );\n }\n };\n\n const renderApplicant = (applicant) => {\n const showMakePrimaryButton = !applicant.pseudo;\n return (\n <li key={applicant.id} className='cf'>\n <div title={applicant.name} className='float-left' style={{ marginTop: '4px' }}>\n <input title={applicant.name} value='true' type='checkbox' name='carry' onClick={(e) => { onSelectedApplicantChange(e, applicant); }} />\n </div>\n <div title={applicant.name} className='float-left'>\n <UserDisc\n user={applicant}\n options={{\n showName: true,\n showPseudo: true,\n showAsCurrent: applicant.id === CityGrows.Server.currentUserId,\n }}\n />\n </div>\n <div className='float-right'>\n <div className='applicantmanager-actions' style={{ marginTop: '6px' }}>\n {showMakePrimaryButton && (\n <>\n <button className='btn-link' type='button' onClick={() => { onPrimaryApplicantChange(applicant); }}>Make primary</button>\n \n </>\n )}\n </div>\n </div>\n </li>\n );\n };\n\n const renderPrimaryApplicant = () => {\n if (primaryApplicant) {\n return (\n <Selection\n selection={primaryApplicant}\n onRemove={onApplicantRemove}\n className='personselection-icon'\n showAsCurrentUser={primaryApplicant.id === CityGrows.Server.currentUserId}\n removeLinkText='Change'\n disableRemoval={!CityGrows.Server.admin}\n />\n );\n }\n return (\n <>\n <PersonSelector\n onSelect={onApplicantSelect}\n doSearch={searchPerson}\n allowPseudo={false}\n hideExternal={false}\n placeholder='Search people'\n attachableType='Applicant'\n personNoFoundText='Not found, the user needs to create an account first.'\n />\n <button className='btn-link' onClick={onApplicantSearchCancel} type='button'>Cancel</button>;\n </>\n );\n };\n\n const renderApplicantContainer = () => {\n return (\n <div className='applicantmanager-wrap'>\n <span className='title'>Launching sub-submission as:</span>\n <div className='margin-top margin-bottom'>\n {renderPrimaryApplicant()}\n </div>\n {renderApplicants()}\n </div>\n );\n };\n\n const renderExtra = () => {\n if (props.requirement.waived_at) {\n return <span className='bold'>Requirement waived</span>;\n }\n\n if (!props.requirement.subprocess_id) {\n if (allowedToStart()) {\n return (\n <div className='padding-right'>\n {isLaunching && renderApplicantContainer()}\n {renderStartButton()}\n </div>\n );\n }\n return <span className='bold color-text-light'>Start ></span>;\n }\n\n return (\n <>\n <span className='margin-right-less'>Linked sub-submission:</span>\n <a href={linkPath}>\n {props.requirement.subprocess_workflow.name} #{props.requirement.subprocess_scoped_id}\n </a>\n </>\n );\n };\n\n const renderOptions = () => {\n if (isGov || !!props.requirement.subprocess_id) {\n return (\n <Options\n requirementId={props.requirement.id}\n isWaived={!!props.requirement.waived_at}\n unlinkable={!!props.requirement.subprocess_id}\n isGov={isGov}\n />\n );\n }\n };\n\n return (\n <li className='flowtimeline-activerequirement'>\n <div className={`flowtimeline-steptopline ${status()}`}>\n <span className='flowtimeline-stepicon icon icon-arrow-down-right' title='Sub-submission' />\n <div className='flowtimeline-stepnamewrap'>\n <div>\n {renderLink()}\n <div className='flowtimeline-activerequirement-extra'>\n {renderExtra()}\n </div>\n </div>\n </div>\n {renderOptions()}\n </div>\n </li>\n );\n});\n\nSubprocessRequirement.displayName = 'SubprocessRequirement';\n\nSubprocessRequirement.propTypes = {\n primaryApplicant: PropTypes.shape({\n id: PropTypes.number.isRequired,\n }).isRequired,\n requirement: PropTypes.shape({\n id: PropTypes.number.isRequired,\n completed: PropTypes.bool.isRequired,\n subprocess_id: PropTypes.number,\n subprocess_scoped_id: PropTypes.number,\n subprocess_workflow_not_published: PropTypes.bool.isRequired,\n subprocess_workflow: PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string.isRequired,\n }),\n }),\n applicants: PropTypes.arrayOf(PropTypes.shape({\n id: PropTypes.number.isRequired,\n })),\n};\n\nexport default SubprocessRequirement;\n","import React from 'react';\nimport OutputDownloadLink from '../../output/output-download-link';\n\nconst StepOutput = (props) => {\n if (props.output.revoked) {\n return <span className='output-statustag revoked'>Revoked</span>;\n }\n\n return <OutputDownloadLink output={props.output} className='btn-link' />;\n};\n\nexport default StepOutput;\n","import React, {\n memo, useCallback, useEffect, useState, useContext,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport ActiveStepActions from 'actions/active-step-actions';\nimport { success } from 'components/shared/flash';\nimport pluralize from 'modules/pluralize';\nimport {\n where, filter, isEmpty, isNull,\n} from 'underscore';\nimport truncate from 'truncate';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport StepOutput from './step_in_list/step-output';\n\nconst LOCKABLE_STEP_TYPES = ['CollectInfoStep'];\n\nconst StepInList = memo((props) => {\n const dispatch = useContext(InitiatedFlowDispatchContext);\n const [shouldAnimate, setAnimate] = useState(false);\n\n useEffect(() => {\n return (() => {\n setAnimate(true);\n });\n });\n\n const timelineStepClass = (step, flow) => {\n const klasses = [];\n\n if ((flow.finished_at && !isSupplementalRequirement()) || step.position < flow.current_step.position || step.completed) {\n klasses.push('done');\n } else if (step.position === flow.current_step.position) {\n if (flow.halted_at) {\n klasses.push('halted');\n } else {\n klasses.push('current');\n }\n } else {\n klasses.push('notdone');\n }\n\n if (step.sent) {\n klasses.push('flowtimeline-activerequirement');\n }\n\n if (isSupplementalRequirement()) {\n klasses.push('requirement');\n }\n\n if (shouldAnimate) {\n klasses.push('animate');\n }\n\n return klasses.join(' ');\n };\n\n const renderIcon = () => {\n return <span className={`flowtimeline-stepicon icon ${props.step.icon_class}`} />;\n };\n\n const renderStepName = () => {\n const typeForURL = props.step.generic_type === 'Step' ? 'steps' : 'supplemental_requirement';\n const prefix = props.step.generic_type === 'Step' ? `${props.step.position}. ` : '';\n return (\n <div className='flowtimeline-stepnamewrap'>\n <a href={`/initiated_flows/${props.initiatedFlow.id}/${typeForURL}/${props.step.id}`}>\n {`${prefix}${props.step.name_or_default}`}{renderRequirementStatus(props.step)}\n </a>\n </div>\n );\n };\n\n const renderChangeRequests = () => {\n const pendingChanges = filter(props.discussions, (discussion) => {\n return !discussion.resolved\n && discussion.step_approval\n && isNull(discussion.step_approval.approval_status)\n && props.activeStep.id === discussion.step_approval.active_step_id;\n });\n\n if (!isEmpty(pendingChanges)) {\n return (\n <div className='flowtimeline-changesrequested'>\n Changes requested\n <div className='text-right'>\n <a className='secondary' href='#' onClick={props.onOpenDiscussionClick}>View</a>\n </div>\n </div>\n );\n }\n };\n\n const isSupplementalRequirement = () => {\n return props.step.generic_type === 'SupplementalRequirement';\n };\n\n const onLockClick = () => {\n ActiveStepActions.update(dispatch, props.activeStep.id, {\n locked: !props.activeStep.locked,\n })\n .done(() => { success(`Step ${!props.activeStep.locked ? 'locked' : 'unlocked'}`); });\n };\n\n const doesNotLock = () => {\n return !LOCKABLE_STEP_TYPES.includes(props.step.type) || isSupplementalRequirement();\n };\n\n const renderLock = () => {\n if (doesNotLock()) { return; }\n\n if (props.admin) {\n return renderAdminLock();\n }\n\n return renderConstituentLock();\n };\n\n const renderConstituentLock = () => {\n return (\n <div className='flowtimeline-disabledlockwrap'>\n <span className={`icon ${props.activeStep.locked_at ? 'icon-lock' : 'icon-unlocked'}`} />\n </div>\n );\n };\n\n const renderAdminLock = useCallback(() => {\n return (\n <button\n type='button'\n className={`flowtimeline-lockbutton ${props.activeStep.locked_at ? 'locked' : 'unlocked'}`}\n href='#'\n onClick={onLockClick}\n >\n <span className={`icon ${props.activeStep.locked_at ? 'icon-lock' : 'icon-unlocked'}`} />\n </button>\n );\n }, [props.initiatedFlow]);\n\n const renderRequirementStatus = () => {\n if (props.step.generic_type === 'Step') { return; }\n\n if (props.step.canceled) {\n return <span className='text-alert bold'> - Canceled</span>;\n }\n\n if (props.step.sent) { return; }\n\n return (<span className='text-semialert bold'> - Unsent</span>);\n };\n\n const renderOutput = (output) => {\n let klass = 'valid';\n if (output.expired) {\n klass = 'expired';\n } else if (output.revoked) {\n klass = 'revoked';\n }\n\n return (\n <li className={`output ${klass}`}>\n <div>{truncate(output.name, 20)}</div>\n <div><StepOutput output={output} /></div>\n </li>\n );\n };\n\n const renderOutputs = () => {\n const outputs = where(props.initiatedFlow.issued_outputs, { issued_on_step_identity: props.step.identity, issued: true });\n if (outputs.length === 0) { return; }\n\n return (\n <div className='flowtimeline-outputs'>\n <div className='flowtimeline-outputname'>{`${pluralize('Output', outputs.length)} issued`}</div>\n <ul>\n {outputs.map(renderOutput)}\n </ul>\n </div>\n );\n };\n\n return (\n <li className={`flowtimeline-step ${props.viewing ? 'viewing' : ''}`}>\n <div className={`flowtimeline-steptopline ${timelineStepClass(props.step, props.initiatedFlow)}`}>\n {renderIcon()}\n {renderStepName()}\n <div className='flowtimeline-lockwrap'>{renderLock()}</div>\n </div>\n {renderOutputs()}\n {renderChangeRequests()}\n </li>\n );\n});\n\nStepInList.displayName = 'StepInList';\n\nStepInList.propTypes = {\n activeStep: PropTypes.shape(),\n admin: PropTypes.bool.isRequired,\n step: PropTypes.object.isRequired,\n initiatedFlow: PropTypes.object.isRequired,\n viewing: PropTypes.bool.isRequired,\n onOpenDiscussionClick: PropTypes.func,\n discussions: PropTypes.arrayOf(PropTypes.shape({})),\n};\n\nexport default StepInList;\n","import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\nimport { withRouter } from 'react-router';\nimport { findWhere, filter } from 'underscore';\nimport SubprocessRequirement from './timeline/subprocess-requirement';\nimport StepInList from './timeline/step-in-list';\n\nconst Timeline = ({\n initiatedFlowState, admin, desktop, location, onOpenDiscussionClick, discussions,\n}) => {\n const { activeStep, step, initiatedFlow } = initiatedFlowState;\n const [expanded, setExpanded] = useState(false);\n\n function onCompletionStep() {\n return location.pathname.match('completed');\n }\n\n function containerClassName() {\n if (expanded) {\n return 'mobile expanded';\n }\n\n if (!desktop) {\n return 'mobile unexpanded';\n }\n\n return '';\n }\n\n function toggleExpansion() {\n setExpanded(!expanded);\n }\n\n function renderCompletionStep() {\n return (\n <li key='complete' className={`completion${onCompletionStep() ? ' viewing' : ''}`}>\n <a className='margin-left' href='#/completed'>\n Submission completed\n </a>\n </li>\n );\n }\n\n function activeStepForStep(stepId) {\n return findWhere(initiatedFlow.active_steps, { steppable_id: stepId, steppable_type: 'Step' });\n }\n\n function activeSubprocessRequirements() {\n return filter(initiatedFlow.subprocess_requirements, (req) => {\n const evaluation = findWhere(activeStep.subprocess_requirement_evaluations, {id: req.id })\n return evaluation.required;\n });\n }\n\n function noRequirements() {\n return (!initiatedFlow.requirements || initiatedFlow.requirements.length == 0) && activeSubprocessRequirements().length == 0;\n }\n\n function renderStep(stp) {\n return (\n <StepInList\n step={stp}\n initiatedFlow={initiatedFlow}\n viewing={step.generic_type === stp.generic_type && step.id === stp.id && !onCompletionStep()}\n activeStep={activeStepForStep(stp.id)}\n key={`step-${stp.id}`}\n admin={admin}\n onOpenDiscussionClick={onOpenDiscussionClick}\n discussions={discussions}\n />\n );\n }\n\n function renderRequirement(requirement) {\n const viewing = step.generic_type === requirement.generic_type && step.id === requirement.id && !onCompletionStep();\n\n return (\n <StepInList\n step={requirement}\n initiatedFlow={initiatedFlow}\n viewing={viewing}\n key={`requirement-${requirement.id}`}\n admin={admin}\n />\n );\n }\n\n function renderSubprocessRequirement(requirement) {\n return (\n <SubprocessRequirement\n requirement={requirement}\n primaryApplicant={initiatedFlow.primary_applicant}\n key={requirement.id}\n collectedData={activeStep.collected_data}\n sections={step.sections}\n applicants={initiatedFlow.applicants}\n />\n );\n }\n\n function renderRequirements() {\n if (noRequirements()) { return; }\n\n return (\n <div>\n <div className='flowtimeline-sectionname first'>\n Additional Requirements\n </div>\n <ul className='flowtimeline-steplist'>\n {activeSubprocessRequirements().map(renderSubprocessRequirement)}\n {initiatedFlow.requirements.map(renderRequirement)}\n </ul>\n </div>\n );\n }\n\n function renderSteps() {\n const steps = initiatedFlow.steps.map(renderStep);\n\n if (initiatedFlow.finished_at) {\n steps.push(renderCompletionStep());\n }\n\n return (\n <div>\n <div className='flowtimeline-sectionname'>\n Steps\n </div>\n <ul className='flowtimeline-steplist'>\n {steps}\n </ul>\n </div>\n );\n }\n\n function renderMobileExpandIcon() {\n const extraClass = expanded ? 'open' : 'closed';\n return (\n <div className={`flowtimeline-expandwrap clickable ${extraClass}`} onClick={toggleExpansion}>\n <span className='flowtimeline-expandarrow' href='#' />\n </div>\n );\n }\n\n function renderListArea() {\n if (expanded || desktop) {\n return (\n <div>\n {renderRequirements()}\n {renderSteps()}\n </div>\n );\n }\n }\n\n return (\n <div className={`flowtimeline ${containerClassName()}`}>\n {renderListArea()}\n {!desktop && renderMobileExpandIcon()}\n </div>\n );\n};\n\nTimeline.propTypes = {\n admin: PropTypes.bool.isRequired,\n collectedData: PropTypes.array,\n location: PropTypes.object.isRequired,\n desktop: PropTypes.bool.isRequired,\n initiatedFlow: PropTypes.shape({\n active_steps: PropTypes.array.isRequired,\n primary_applicant: PropTypes.object.isRequired,\n subprocess_requirements: PropTypes.array.isRequired,\n requirements: PropTypes.array.isRequired,\n id: PropTypes.number.isRequired,\n finished_at: PropTypes.string,\n halted_at: PropTypes.string,\n\n steps: PropTypes.arrayOf(\n PropTypes.shape({\n icon_class: PropTypes.string.isRequired,\n position: PropTypes.number.isRequired,\n name_or_default: PropTypes.string.isRequired,\n }),\n ).isRequired,\n\n current_step: PropTypes.shape({\n position: PropTypes.number.isRequired,\n }).isRequired,\n }).isRequired,\n\n step: PropTypes.shape({\n id: PropTypes.number.isRequired,\n generic_type: PropTypes.string.isRequired,\n sections: PropTypes.array,\n }).isRequired,\n onOpenDiscussionClick: PropTypes.func,\n discussions: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n};\n\nexport default withRouter(Timeline);\n","import React from 'react';\nimport XClose from 'components/shared/x-close';\nimport useFocusTrap from 'components/hooks/use-focus-trap';\n\nconst SlidingPanel = (props) => {\n const focusEl = useFocusTrap(props.onCloseClick)\n\n return (\n <div ref={props.transitionRef} className='ifslidingpanel' >\n <div ref={focusEl} >\n <div className='ifslidingpanel-header'>\n <h2>{props.title}</h2>\n <XClose id='closepanel' onClick={props.onCloseClick} label={`Close ${props.title}`} />\n </div>\n <div className='ifslidingpanel-contentwrap'>\n {props.children}\n </div>\n </div>\n </div>\n );\n};\n\nexport default SlidingPanel;\n","import PropTypes from 'prop-types';\nimport React, { useState, useEffect, useRef } from 'react';\nimport { Route } from 'react-router-dom';\nimport { Switch } from 'react-router';\nimport { TransitionGroup, CSSTransition } from 'react-transition-group';\nimport { any } from 'underscore';\nimport MediaQuery from 'react-responsive';\nimport NotifBanner from 'components/shared/notif-banner';\nimport InformationalText from 'components/shared/informational-text';\nimport Activity from './process/activity';\nimport Access from './process/access';\nimport HeaderMeta from './process/header-meta';\nimport Discussion from './process/process-discussion';\nimport DocumentsAndFiles from './process/documents-and-files';\nimport Menu from './process/menu';\nimport IfControlNav from './process/if-control-nav';\nimport CurrentStep from './process/current-step';\nimport Timeline from './process/timeline';\nimport OutputsContainer from './process/outputs-container';\nimport SlidingPanel from '../shared/sliding-panel';\n\nconst Process = (props) => {\n const [accessIsOpen, setAccessIsOpen] = useState(false);\n const [activityIsOpen, setActivityIsOpen] = useState(false);\n const [menuIsOpen, setMenuIsOpen] = useState(false);\n const [discussionIsOpen, setDiscussionIsOpen] = useState(false);\n const [documentsIsOpen, setDocumentsIsOpen] = useState(false);\n\n const accessNode = useRef(null);\n const activityNode = useRef(null);\n const documentsNode = useRef(null);\n const discussionNode = useRef(null);\n const menuNode = useRef(null);\n\n useEffect(() => {\n if (shouldRedirectToCompleted()) {\n props.history.replace('/completed');\n }\n }, []);\n\n function onOpenMenuClick(e) {\n e.preventDefault();\n setMenuIsOpen(true);\n }\n\n function saveState() {\n if (props.initiatedFlowState.changePending) { return 'saving'; }\n\n if (props.initiatedFlowState.outstandingSaveRequests === 0) {\n return 'saved';\n } if (props.initiatedFlowState.outstandingSaveRequests > 0) {\n return 'saving';\n }\n\n return null;\n }\n\n function shouldRedirectToCompleted() {\n // redirect to completed view if no step is specified in route and flow is finished\n const onDefaultStep = !location.pathname.match('/steps/') && !location.pathname.match('/supplemental_requirement/');\n return onDefaultStep && props.initiatedFlow.finished_at;\n }\n\n function renderCompleted() {\n return (\n <div className='currentstep'>\n <div className='currentstep-stepsection cf'>\n <div className='text-center screenmin-less'>\n <div className='goldenwidth margin-top margin-bottom color-text-medium marginauto'>\n {renderCompletionMessage()}\n </div>\n\n <OutputsContainer outputs={props.initiatedFlow.issued_outputs} />\n </div>\n </div>\n </div>\n );\n }\n\n function renderCurrentStep() {\n const {\n currentUserId, initiatedFlowState, admin,\n } = props;\n return (\n <CurrentStep\n currentUserId={currentUserId}\n step={initiatedFlowState.step}\n initiatedFlow={initiatedFlowState.initiatedFlow}\n activeStep={initiatedFlowState.activeStep}\n attemptedAdvance={initiatedFlowState.attemptedAdvance}\n admin={admin}\n teamId={props.masterTemplate.team_id}\n viewingNonCurrent={(initiatedFlowState.step.id !== initiatedFlow.current_step_id)}\n onOpenDiscussionClick={onOpenDiscussionClick}\n authorities={props.masterTemplate.authorities}\n discussions={props.discussions}\n teamFriendlyId={CityGrows.Server.initiatedFlowData.team.friendly_id}\n />\n );\n }\n\n function onOpenDiscussionClick(e) {\n e.preventDefault();\n setDiscussionIsOpen(true);\n }\n\n function onCloseDiscussionClick() {\n setDiscussionIsOpen(false);\n }\n\n function onCloseMenuClick() {\n setMenuIsOpen(false);\n }\n\n function onOpenDocumentsClick(e) {\n e.preventDefault();\n setDocumentsIsOpen(true);\n }\n\n function onCloseDocumentsClick() {\n setDocumentsIsOpen(false);\n }\n\n function onOpenActivityClick(e) {\n e.preventDefault();\n setActivityIsOpen(true);\n }\n\n function onCloseActivityClick() {\n setActivityIsOpen(false);\n }\n\n function onOpenAccessClick(e) {\n e.preventDefault();\n setAccessIsOpen(true);\n }\n\n function onCloseAccessClick() {\n setAccessIsOpen(false);\n }\n\n function renderCompletionMessage() {\n if (props.initiatedFlow.completion_message) {\n return (\n <InformationalText\n text={props.initiatedFlow.completion_message}\n textType='CompletionMessage'\n textContainerId={props.flowTemplate.id}\n initiatedFlow={props.initiatedFlow}\n classes='completion-message'\n />\n );\n }\n }\n\n function renderTimeline() {\n return (\n <MediaQuery minWidth={769}>\n {(matches) => {\n /* TODO: push this mediaquery down into Timeline */\n if (matches) {\n return (\n <Timeline\n desktop\n admin={props.admin}\n initiatedFlowState={props.initiatedFlowState}\n onOpenDiscussionClick={onOpenDiscussionClick}\n discussions={props.discussions}\n />\n );\n }\n return (\n <Timeline\n desktop={false}\n admin={props.admin}\n initiatedFlowState={props.initiatedFlowState}\n onOpenDiscussionClick={onOpenDiscussionClick}\n discussions={props.discussions}\n />\n );\n }}\n </MediaQuery>\n );\n }\n\n function renderSaveStatus() {\n if (saveState() == null) { return; }\n\n const text = saveState() === 'saved' ? 'All Changes Saved.' : 'Saving Changes...';\n\n return (\n <div className={`activeflowheader-savetag margin-right ${saveState()}`}>\n {text}\n </div>\n );\n }\n\n function renderProcessNumber() {\n return (\n <div className='activeflowheader-processnumber'>\n Submission <span>#{props.initiatedFlow.scoped_id}</span>\n {renderCustomId()}\n </div>\n );\n }\n\n function renderCustomId() {\n if (!props.initiatedFlow.custom_id) { return; }\n\n return (\n <span className='processnumber-customid'>{props.initiatedFlow.custom_id}</span>\n );\n }\n\n function renderBannerNotifs() {\n if (props.initiatedFlow.halted) {\n return (\n <NotifBanner style='alert'>\n This submission has been <strong>halted</strong>\n </NotifBanner>\n );\n }\n\n if (props.admin && any(props.initiatedFlow.subprocess_requirements, (requirement) => {\n return requirement.subprocess_workflow_not_published;\n })) {\n return (\n <div className='flowbanner alert'>\n This submission is skipping a subprocess requirement because the sub-submission form has been unpublished.\n </div>\n );\n }\n }\n\n function renderSubprocessInfo() {\n if (props.initiatedFlow.with_access_to_parent && props.initiatedFlow.parent_process.id) {\n return (\n <div className='activeflowheader-subprocessinfo'>\n <span className='tag margin-right'>\n <span className='icon icon-arrow-down-right-white' /> Sub-submission\n </span>\n <span className='onlydesktop margin-right-less'>\n This submission is a requirement of\n </span>\n {textLinkToParent()}\n </div>\n );\n }\n }\n\n function textLinkToParent() {\n return (\n <a id='parent-process-link' href={`/initiated_flows/manager/${props.initiatedFlow.parent_process.id}`}>\n {props.initiatedFlow.parent_process.template_name} #{props.initiatedFlow.parent_process.scoped_id}\n </a>\n );\n }\n\n function masterTemplateUrl() {\n if (props.admin) {\n return `/workflows/${props.masterTemplate.id}`;\n }\n return `/${props.masterTemplate.team_friendly_id}/${props.masterTemplate.friendly_id}`;\n }\n\n function dashboardUrl() {\n if (props.admin) {\n return '/processes';\n }\n return '/dashboard';\n }\n\n function renderTemplateVersion() {\n return (\n <div className='versionnumber margin-right'>\n Version {props.flowTemplate.version}\n </div>\n );\n }\n\n const { initiatedFlow, admin, initiatedFlowState } = props;\n\n const transitionClassNames = admin ? 'ifslidingpanel al' : 'public ifslidingpanel al';\n\n return (\n <>\n <TransitionGroup component={null}>\n {menuIsOpen && (\n <CSSTransition\n classNames={transitionClassNames}\n timeout={250}\n nodeRef={menuNode}\n >\n <SlidingPanel transitionRef={menuNode} onCloseClick={onCloseMenuClick} title='Menu'>\n <Menu\n initiatedFlowId={initiatedFlow.id}\n issuedOutputs={initiatedFlow.issued_outputs}\n activeFlow={!initiatedFlow.finished_at}\n personAttachments={initiatedFlow.person_attachments}\n teamId={props.masterTemplate.team_id}\n hasPublicFiles={initiatedFlow.has_public_files}\n hasFiles={initiatedFlow.has_files}\n admin={admin}\n activities={initiatedFlowState.activities}\n applicantAttachments={initiatedFlow.applicant_attachments}\n />\n </SlidingPanel>\n </CSSTransition>\n )}\n {discussionIsOpen && (\n <CSSTransition\n classNames={transitionClassNames}\n timeout={250}\n nodeRef={discussionNode}\n >\n <Discussion\n transitionRef={discussionNode}\n initiatedFlowId={initiatedFlow.id}\n admin={admin}\n discussions={props.discussions}\n onCloseClick={onCloseDiscussionClick}\n />\n </CSSTransition>\n )}\n {documentsIsOpen && (\n <CSSTransition\n classNames={transitionClassNames}\n timeout={250}\n nodeRef={documentsNode}\n >\n <SlidingPanel transitionRef={documentsNode} onCloseClick={onCloseDocumentsClick} title='Documents and Files' >\n <DocumentsAndFiles\n initiatedFlowId={initiatedFlow.id}\n issuedOutputs={initiatedFlow.issued_outputs}\n />\n </SlidingPanel>\n </CSSTransition>\n )}\n {activityIsOpen && (\n <CSSTransition\n classNames={transitionClassNames}\n timeout={250}\n nodeRef={activityNode}\n >\n <SlidingPanel transitionRef={activityNode} onCloseClick={onCloseActivityClick} title='Activity'>\n <Activity\n activities={initiatedFlowState.activities}\n initiatedFlowId={initiatedFlow.id}\n />\n </SlidingPanel>\n </CSSTransition>\n )}\n {accessIsOpen && (\n <CSSTransition\n classNames={transitionClassNames}\n timeout={250}\n nodeRef={accessNode}\n >\n <SlidingPanel transitionRef={accessNode} onCloseClick={onCloseAccessClick} title='Access'>\n <Access\n admin={admin}\n applicantAttachments={initiatedFlow.applicant_attachments}\n initiatedFlowId={initiatedFlow.id}\n personAttachments={initiatedFlow.person_attachments}\n teamId={props.masterTemplate.team_id}\n />\n </SlidingPanel>\n </CSSTransition>\n )}\n </TransitionGroup>\n\n {renderBannerNotifs()}\n\n <div className='activeflowheader'>\n {renderSubprocessInfo()}\n\n <div className='activeflowheader-mainwrap'>\n <div className='activeflowheader-left'>\n <div className='viewall-container'>\n <h1><a id='templatetitle' href={masterTemplateUrl()}>{props.flowTemplate.name}</a></h1>\n | <a href={dashboardUrl()}>View All Submissions</a>\n </div>\n <HeaderMeta\n initiatedFlow={props.initiatedFlow}\n admin={props.admin}\n flowTemplateId={props.flowTemplate.id}\n teamId={props.masterTemplate.team_id}\n />\n </div>\n\n <div className='activeflowheader-right'>\n <ul className='activeflowheader-menus'>\n <li id='discussions' className='activeflowheader-icon-item'>\n <button className='btn-link' onClick={onOpenDiscussionClick} title='Discussions'>\n <span className='icon icon-speechballoon margin-right-less' />\n {props.discussions.length}\n <span className='tooltip'>Discussions</span>\n </button>\n </li>\n <li id='documents-and-files' className='activeflowheader-icon-item'>\n <button className='btn-link' onClick={onOpenDocumentsClick}title='Documents and files'>\n <span className='icon icon-doc' />\n {/* Temporary hide files count */}\n {/* {initiatedFlow.total_documents_count} */}\n <span className='tooltip'>Documents and files</span>\n </button>\n </li>\n <li id='access' className='activeflowheader-icon-item'>\n <button className='btn-link' onClick={onOpenAccessClick} title='Access' >\n <span className='icon icon-person-primary-2' />\n <span className='tooltip'>Access</span>\n </button>\n </li>\n <li id='activity' className='activeflowheader-icon-item'>\n <button className='btn-link' onClick={onOpenActivityClick} title='Activity'>\n <span className='icon icon-pulse' />\n <span className='tooltip'>Activity</span>\n </button>\n </li>\n <li id='menu' className='activeflowheader-icon-item'>\n <button className='btn-link' onClick={onOpenMenuClick} title='More options'>\n <span className='icon icon-dots-horizontal' />\n <span className='tooltip'>More options</span>\n </button>\n </li>\n </ul>\n\n <div className='activeflowheader-rightlowerwrap'>\n {renderSaveStatus()}\n {props.admin && renderTemplateVersion()}\n {renderProcessNumber()}\n </div>\n </div>\n </div>\n </div>\n\n <div className='flowcontent-wrap'>\n {renderTimeline()}\n <div className='flowcontent'>\n <Switch>\n <Route exact path='/' render={renderCurrentStep} />\n <Route exact path='/completed' render={renderCompleted} />\n </Switch>\n </div>\n </div>\n\n <IfControlNav\n initiatedFlowState={props.initiatedFlowState}\n admin={props.admin}\n masterTemplateId={props.masterTemplate.id}\n onOpenDiscussionClick={onOpenDiscussionClick}\n teamSlug={props.masterTemplate.team_friendly_id}\n masterTemplateSlug={props.masterTemplate.friendly_id}\n />\n </>\n );\n};\n\nProcess.propTypes = {\n admin: PropTypes.bool.isRequired,\n masterTemplate: PropTypes.shape({\n authorities: PropTypes.arrayOf(PropTypes.shape({})),\n friendly_id: PropTypes.string.isRequired,\n id: PropTypes.number.isRequired,\n team_friendly_id: PropTypes.string,\n team_id: PropTypes.number.isRequired,\n }).isRequired,\n step: PropTypes.shape({\n id: PropTypes.number.isRequired,\n }).isRequired,\n match: PropTypes.shape({}).isRequired,\n initiatedFlow: PropTypes.shape({\n completion_message: PropTypes.string,\n current_step_id: PropTypes.number.isRequired,\n custom_id: PropTypes.string,\n finished_at: PropTypes.string,\n halted: PropTypes.bool.isRequired,\n has_files: PropTypes.bool.isRequired,\n has_public_files: PropTypes.bool.isRequired,\n id: PropTypes.number.isRequired,\n issued_outputs: PropTypes.arrayOf(PropTypes.shape({})),\n parent_process: PropTypes.shape({\n id: PropTypes.number,\n template_name: PropTypes.string,\n }),\n person_attachments: PropTypes.arrayOf(PropTypes.shape({})),\n scoped_id: PropTypes.number.isRequired,\n subprocess_requirements: PropTypes.arrayOf(PropTypes.shape({})),\n with_access_to_parent: PropTypes.bool,\n }).isRequired,\n activeStep: PropTypes.shape({\n collected_data: PropTypes.arrayOf(PropTypes.shape({})),\n }).isRequired,\n currentUserId: PropTypes.number.isRequired,\n flowTemplate: PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string.isRequired,\n }).isRequired,\n history: PropTypes.shape({\n replace: PropTypes.func.isRequired,\n }).isRequired,\n};\n\nexport default Process;\n","import { find } from 'underscore';\nimport AdminNotif from 'components/shared/admin-notif';\nimport Notification from 'components/shared/notification';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { HashRouter as Router, Route, Redirect } from 'react-router-dom';\nimport { Switch } from 'react-router';\nimport NotifBanner from 'components/shared/notif-banner';\nimport { adminHost } from 'modules/url-generator';\nimport SurveySubmission from './survey-submission-admin-view';\nimport Process from './process';\nimport PrimaryTabs from 'components/shared/primary-tabs';\n\nconst ActiveProcess = (props) => {\n // put this into the reducer\n function pastCurrentStep() {\n return props.initiatedFlowState.step.position > props.initiatedFlowState.initiatedFlow.current_step.position;\n }\n\n function renderAdminWarning() {\n const baseURL = adminHost();\n const processURL = `${baseURL}/initiated_flows/manager/${props.initiatedFlowState.initiatedFlow.id}`;\n const dashboardURL = `${baseURL}/`;\n\n return (\n <AdminNotif>\n <i className='icon-exclaim' />\n <span>\n You are viewing this submission as a constituent. You can also\n <a href={processURL}> view it as an admin </a>\n or\n <a href={dashboardURL}> return to your dashboard</a>\n </span>\n </AdminNotif>\n );\n }\n\n function renderNotifications() {\n const notifications = find(props.notifications, ((notif) => { return notif.type === 'custom_display'; }));\n if (notifications) {\n return notifications.message.messages.map((alert, index) => {\n return <Notification key={index} notificationType='semialert' extraClasses='process-page' notification={alert} />;\n });\n }\n }\n\n function renderPastCurrentStepWarning() {\n const currentStepURL = `/initiated_flows/manager/${props.initiatedFlowState.initiatedFlow.id}`;\n\n return (\n <NotifBanner style='notice'>\n <i className='icon-exclaim margin-right' />\n You have not reached this step yet. Click <a href={currentStepURL}>here</a> to go to the current step.\n </NotifBanner>\n );\n }\n\n function renderProcessView(routerProps) {\n return (\n <Process\n initiatedFlowState={props.initiatedFlowState}\n discussions={props.discussions}\n initiatedFlow={props.initiatedFlowState.initiatedFlow}\n currentUserId={props.currentUserId}\n admin={props.admin}\n flowTemplate={props.flowTemplate}\n masterTemplate={props.masterTemplate}\n {...routerProps}\n />\n );\n }\n\n function renderSurveySubmission(routerProps) {\n const submissions = props.initiatedFlowState.activeStep.survey_submissions;\n const submission = submissions.find((submission) => submission.id === Number(routerProps.match.params.id));\n\n return (\n <SurveySubmission\n survey={props.initiatedFlowState.step.survey}\n submission={submission}\n {...routerProps}\n />\n );\n }\n\n return (\n <Router>\n <main className='flexcolumn relative fullheight'>\n {props.showAdminWarning ? renderAdminWarning() : null}\n {pastCurrentStep() ? renderPastCurrentStepWarning() : null}\n {renderNotifications()}\n {props.admin && (\n <PrimaryTabs />\n )}\n <div id='tabheader-body'>\n <Switch>\n <Route exact path={['/', '/completed']} render={renderProcessView} />\n <Route exact path='/survey-response/:id' render={renderSurveySubmission} />\n\n {/* Catchall route */}\n\n <Route path='/'>\n <Redirect to='/' />\n </Route>\n </Switch>\n </div>\n </main>\n </Router>\n );\n};\n\nActiveProcess.propTypes = {\n showAdminWarning: PropTypes.bool.isRequired,\n currentUserId: PropTypes.number.isRequired,\n admin: PropTypes.bool.isRequired,\n flowTemplate: PropTypes.object.isRequired,\n masterTemplate: PropTypes.object.isRequired,\n notifications: PropTypes.array,\n};\n\nexport default ActiveProcess;\n","export function fetchTasks(searchTerm) {\n return $.ajax('/my_tasks/fetch_tasks', {\n method: 'GET',\n dataType: 'json',\n data: {\n master_search_terms: searchTerm,\n },\n });\n}\n\nexport function fetchStep(id, type, initiatedFlowId) {\n return $.ajax('my_tasks/fetch_step', {\n method: 'GET',\n dataType: 'json',\n data: {\n id,\n type,\n initiated_flow_id: initiatedFlowId,\n },\n });\n}\n\nexport default {\n fetchTasks,\n fetchStep,\n};","import React from 'react';\nimport { any, findWhere } from 'underscore';\nimport Map from 'components/shared/input_fields/entity-input/map';\n\nconst CollectInfoStepSummary = ({step, collectedData}) => {\n function renderSections() {\n if (any(step.sections)) {\n return (\n <table key={step.id}>\n <tbody>\n {step.sections.map(renderSectionData)}\n </tbody>\n </table>\n );\n }\n\n return <div className='color-text-medium margin-top-less'>No data to display for this section</div>;\n };\n\n function renderSectionData(section) {\n if (!any(section.step_data)) { return; }\n\n return (\n <React.Fragment key={section.id}>\n <tr className='collecteddatatable-sectionname'>\n <td>{section.name}</td><td />\n </tr>\n {section.step_data.map(renderDatum)}\n </React.Fragment>\n );\n }\n\n function renderDatum(datum) {\n return (\n <tr key={datum.id}>\n <td>{datum.name}</td>\n <td>{renderValueForDatum(datum.id)}</td>\n </tr>\n );\n }\n\n function renderValueForDatum(stepDatumId) {\n const collectedDatum = findWhere(collectedData, {\n step_datum_id: stepDatumId,\n });\n\n if (!collectedDatum) { return '---'; }\n\n if (collectedDatum.data_type === 'entity' && collectedDatum.entity?.is_esri) {\n const fieldData = Object.entries(collectedDatum.entity.field_data).map(([key, val]) => {\n return (\n <div className='margin-bottom'>\n <label>\n {key}\n </label>\n <span>{val}</span>\n </div>\n );\n });\n\n return (\n <div>\n {fieldData}\n <Map\n feature={collectedDatum.entity.feature}\n />\n </div>\n );\n }\n\n return <span dangerouslySetInnerHTML={{ __html: collectedDatum.formatted_content }} />;\n };\n\n return (\n <div className='collecteddatatable-wrap'>\n {renderSections()}\n </div>\n );\n};\n\nexport default CollectInfoStepSummary;\n","import React from 'react';\nimport CollectInfoStepSummary from '../../shared/collect-info-step-summary';\n\nconst PreviousStep = ({ step, collectedData }) => {\n function renderMainContent() {\n if (step.type === 'CollectInfoStep') {\n return (\n <CollectInfoStepSummary step={step} collectedData={collectedData} />\n );\n }\n\n return (\n <div className='padded'>\n No data to display for this section\n </div>\n );\n }\n\n return renderMainContent()\n}\n\nexport default PreviousStep;","import React from 'react';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nconst UpDownArrow = ({ expanded, setExpanded }) => {\n if (expanded) {\n return (\n <button className='btn-link' onClick={() => {setExpanded(false)}}>\n <FontAwesomeIcon\n icon={icon({ name: 'chevron-up' })}\n style={{ color: '#0463B7', height: '1rem' }}\n /> \n </button>\n )\n }\n\n return ( \n <button className='btn-link' onClick={() => {setExpanded(true)}}>\n <FontAwesomeIcon\n icon={icon({ name: 'chevron-down' })}\n style={{ color: '#0463B7', height: '1rem' }}\n /> \n </button>\n )\n};\n\nexport default UpDownArrow;\n","import React, { useState, useEffect } from 'react';\nimport CurrentStep from 'components/initiated_flow/process/current-step';\nimport { fetchStep } from 'apis/my-tasks-api';\nimport PreviousStep from './task-step/previous-step';\nimport UpDownArrow from '../shared/buttons/up-down-arrow';\nimport { findWhere } from 'underscore';\nimport LoadingSpinner from 'components/shared/loading-spinner';\n\nconst TaskStep = ({initiatedFlow, step, activeStep, isCurrent, attemptedAdvance, position, teamFriendlyId}) => {\n const [expanded, setExpanded] = useState(isCurrent);\n const [loading, setLoading] = useState(false);\n const [stepData, setStepData] = useState(isCurrent ? step : null)\n\n useEffect(() => {\n if (expanded && !loading) {\n setLoading(true);\n fetchStep(step.id, step.generic_type, initiatedFlow.id)\n .done((res) => {\n setStepData(res);\n setLoading(false);\n });\n }\n }, [expanded])\n\n function findActivity() {\n return findWhere(initiatedFlow.step_completion_activities, { previous_step: `${step.id}` })\n }\n\n function renderStep() {\n if (!stepData) {\n return (\n <div className='mytasks-loading-wrapper nopadding'>\n <LoadingSpinner size='large' />\n </div>\n )\n }\n\n if (isCurrent) {\n return (\n <CurrentStep\n step={stepData}\n teamFriendlyId={teamFriendlyId}\n attemptedAdvance={attemptedAdvance}\n initiatedFlow={initiatedFlow}\n activeStep={activeStep}\n currentUserId={CityGrows.Server.currentUserId}\n admin\n taskView\n />\n )\n }\n\n if (position === 'previous') {\n return (\n <>\n {renderStepInformation()}\n <PreviousStep step={stepData} initiatedFlow={initiatedFlow} collectedData={activeStep.collected_data} />\n </>\n );\n }\n }\n\n function renderStepInformation() {\n let text = 'Pending completion of prior steps';\n\n if (position === 'previous') {\n const activity = findActivity();\n if (!activity) {\n text = '';\n } else {\n text = activity.type === 'AdvanceStep' ? `Step completed by ${activity.completer} | ${activity.date}` : `Step autoadvanced | ${activity.date}`;\n }\n }\n\n return <p className='mytasks-stepinformation'>{text}</p>;\n }\n\n function renderContent() {\n if (expanded) {\n return renderStep();\n }\n\n return renderStepInformation();\n }\n\n return (\n <li key={step.position} className={`mytasks-step ${position}`}>\n <h3 className='step-header'>{step.position}. {step.name_or_default}</h3>\n {(position === 'previous') && <div className='float-right inline-block'><UpDownArrow expanded={expanded} setExpanded={setExpanded}/></div>}\n <div>\n {renderContent()}\n </div>\n </li>\n );\n}\n\nexport default TaskStep","import React from 'react';\nimport TaskStep from './task-step';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nconst TasksMainContent = ({initiatedFlow, flowTemplateName, activeStep, currentStep, teamFriendlyId}) => {\n function renderTitle() {\n return (\n <div className='mytasks-submissionheader'>\n <h2 className='inline-block'>{flowTemplateName}</h2>\n <div className='float-right inline-block'>\n <a href={`initiated_flows/${initiatedFlow.id}`} target='_blank'>#{initiatedFlow.scoped_id} <FontAwesomeIcon icon={icon({ name: 'arrow-up-right-from-square', style: 'regular' })} /></a>\n </div>\n </div>\n )\n }\n\n function renderSteps() {\n return (\n <ul className='padded'>\n {initiatedFlow.steps.map(renderStep) }\n </ul>\n )\n }\n\n function getStepPosition(step) {\n if (currentStep.id === step.id ) { return 'current'}\n\n if (step.position > initiatedFlow.current_step.position) { return 'future'}\n\n if (step.position < initiatedFlow.current_step.position) { return 'previous'}\n }\n\n function renderStep(step) {\n const position = getStepPosition(step);\n const isCurrent = position === 'current';\n const stp = isCurrent ? currentStep : step;\n return (\n <TaskStep\n key={step.position}\n initiatedFlow={initiatedFlow}\n step={stp}\n activeStep={activeStep}\n isCurrent={isCurrent}\n position={position}\n teamFriendlyId={teamFriendlyId}\n />\n );\n }\n\n return (\n <>\n {renderTitle()}\n {renderSteps()}\n </>\n );\n}\n\nexport default TasksMainContent;\n","import React, { useState } from 'react';\nimport DiscussionContent from 'components/shared/discussion-content';\nimport PropTypes from 'prop-types';\n\nconst ReviewDiscussion = (props) => {\n const [addingNewDiscussion, setAddingNewDiscussion] = useState(false);\n\n function onBackButtonClick(e) {\n e.preventDefault();\n\n setAddingNewDiscussion(false);\n }\n\n function onNewDiscussionOpened() {\n setAddingNewDiscussion(false);\n }\n\n function renderBackButton() {\n return (\n <div className='text-center margin-top margin-bottom'>\n <a onClick={onBackButtonClick} href='#' className='secondary'>{'< Back'}</a>\n </div>\n );\n }\n\n return (\n <div id='discussion' className='review-discussion'>\n <DiscussionContent\n initiatedFlowId={props.initiatedFlowId}\n admin={props.admin}\n onNewDiscussionClick={() => { setAddingNewDiscussion(true); }}\n addingNewDiscussion={addingNewDiscussion}\n recentlyAddedDiscussionId={props.recentlyAddedDiscussionId}\n onDiscussionOpened={onNewDiscussionOpened}\n discussions={props.discussions}\n />\n\n {addingNewDiscussion && renderBackButton()}\n </div>\n );\n};\n\nReviewDiscussion.propTypes = {\n initiatedFlowId: PropTypes.number.isRequired,\n admin: PropTypes.bool.isRequired,\n recentlyAddedDiscussionId: PropTypes.number,\n};\n\nexport default ReviewDiscussion;\n","import React, { useState } from 'react';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport DocumentsAndFiles from '../initiated_flow/process/documents-and-files';\nimport Activity from '../initiated_flow/process/activity';\nimport Access from '../initiated_flow/process/access';\nimport ReviewDiscussion from '../initiated_flow/process/steps/reviews/discussion';\nimport Instructions from '../shared/instructions';\nimport IFControlNav from '../initiated_flow/process/if-control-nav';\n\nconst TasksSidebar = ({initiatedFlowState, activities, masterTemplate, discussions, currentStep, onTaskViewUpdate, onSkip}) => {\n const [openTab, setOpenTab] = useState('action');\n\n const {initiatedFlow} = initiatedFlowState;\n\n function renderAlternateOptions() {\n return (\n <button type='button' className='btn-link padded' onClick={onSkip}>Skip</button>\n )\n }\n\n function renderMainAction() {\n return (\n <>\n <div className='padded mytasks-instructions'>\n <Instructions admin initiatedFlow={initiatedFlow} step={currentStep} />\n </div>\n <IFControlNav\n initiatedFlowState={initiatedFlowState}\n admin\n masterTemplateId={masterTemplate.id}\n teamSlug={masterTemplate.team_friendly_id}\n masterTemplateSlug={masterTemplate.friendly_id}\n taskView\n onAdvance={onTaskViewUpdate}\n />\n {renderAlternateOptions()}\n </>\n )\n }\n\n function renderContent() {\n switch (openTab) {\n case 'action':\n return renderMainAction();\n case 'files':\n return (\n <div className='padded'>\n <DocumentsAndFiles\n initiatedFlowId={initiatedFlow.id}\n issuedOutputs={initiatedFlow.issued_outputs}\n />\n </div>\n )\n case 'discussion':\n return <ReviewDiscussion\n initiatedFlowId={initiatedFlow.id}\n admin\n recentlyAddedDiscussionId={null}\n discussions={discussions} />\n case 'activities':\n return <Activity\n activities={activities}\n initiatedFlowId={initiatedFlow.id}\n />\n case 'users':\n return <Access\n admin\n applicantAttachments={initiatedFlow.applicant_attachments}\n initiatedFlowId={initiatedFlow.id}\n personAttachments={initiatedFlow.person_attachments}\n teamId={masterTemplate.team_id}\n />\n default:\n throw new Error(`Unhandled tab ${openTab}`);\n }\n }\n\n return (\n <div className='mytasks-right flexcolumn'>\n <div className='mytasks-sidebaricons'>\n <ul>\n <li>\n <button className='btn-link' onClick={() => { setOpenTab('action'); }} type='button'>\n <FontAwesomeIcon\n icon={icon({ name: 'person-chalkboard' })}\n style={{ color: '#597A91', height: '1.5rem' }}\n title='Actions'\n />\n </button>\n </li>\n <li>\n <button className='btn-link' onClick={() => { setOpenTab('discussion'); }} type='button'>\n <FontAwesomeIcon\n icon={icon({ name: 'comment' })}\n style={{ color: '#597A91', height: '1.5rem' }}\n title='Discussion'\n />\n </button>\n </li>\n <li>\n <button className='btn-link' onClick={() => { setOpenTab('files'); }} type='button'>\n <FontAwesomeIcon\n icon={icon({ name: 'file' })}\n style={{ color: '#597A91', height: '1.5rem' }}\n title='Documents and Files'\n />\n </button>\n </li>\n <li>\n <button className='btn-link' onClick={() => { setOpenTab('users'); }} type='button'>\n <FontAwesomeIcon\n icon={icon({ name: 'user' })}\n style={{ color: '#597A91', height: '1.5rem' }}\n title='Access Manager'\n />\n </button>\n </li>\n <li>\n <button className='btn-link' onClick={() => { setOpenTab('activities'); }} type='button'>\n <FontAwesomeIcon\n icon={icon({ name: 'wave-pulse' })}\n style={{ color: '#597A91', height: '1.5rem' }}\n title='Activities'\n />\n </button>\n </li>\n </ul>\n </div>\n <div className='mytasks-sidebarmain'>\n {renderContent()}\n </div>\n </div>\n );\n};\n\nexport default TasksSidebar;\n","import PropTypes from 'prop-types';\nimport React, { useReducer, useEffect } from 'react';\nimport ErrorBoundary from 'components/shared/error-boundary';\nimport initiatedFlowReducer from 'reducers/initiated-flow-reducer';\nimport discussionReducer from 'reducers/discussions-reducer';\nimport DiscussionActions from 'actions/discussion-actions';\nimport ActiveStepConstants from 'constants/active-step-constants';\nimport InitiatedFlowConstants from 'constants/initiated-flow-constants';\nimport AttachmentsAPI from 'apis/attachment-api';\nimport ActiveStepAPI from 'apis/active-step-api';\nimport { debounce } from 'underscore';\nimport InitiatedFlowDispatchContext from 'contexts/initiated-flow-dispatch-context';\nimport DiscussionDispatchContext from 'contexts/discussion-dispatch-context';\nimport ActiveProcess from './initiated_flow/active-process';\nimport TasksMainContent from './my-tasks/tasks-main-content';\nimport TasksSidebar from './my-tasks/tasks-sidebar';\n\nconst InitiatedFlowManager = ({\n currentUserId,\n admin,\n flowTemplate,\n showAdminWarning,\n masterTemplate,\n notifications,\n initiatedFlow,\n step,\n activeStep,\n taskView,\n onTaskViewUpdate,\n onSkip,\n}) => {\n const [initiatedFlowState, initiatedFlowDispatch] = useReducer(initiatedFlowReducer, {\n initiatedFlow, step, activeStep, activities: [], refreshing: false, refreshingAttachments: false, outstandingSaveRequests: null, changePending: false,\n });\n const [discussionState, discussionDispatch] = useReducer(discussionReducer, { discussions: [] });\n\n useEffect(() => {\n DiscussionActions.loadDiscussions(initiatedFlowState.initiatedFlow.id, discussionDispatch);\n }, [initiatedFlowState.initiatedFlow.id]);\n\n const sync = debounce(() => {\n ActiveStepAPI.show(initiatedFlowState.activeStep.id)\n .done((aS) => {\n initiatedFlowDispatch({\n type: ActiveStepConstants.SYNC_ACTIVE_STEP,\n activeStep: aS,\n });\n })\n .always(() => {\n initiatedFlowDispatch({\n type: InitiatedFlowConstants.SET_REFRESHED,\n });\n });\n }, 1000);\n\n const syncAttachments = debounce(() => {\n AttachmentsAPI.fetchAttachments('InitiatedFlow', initiatedFlowState.initiatedFlow.id)\n .done((attachments) => {\n initiatedFlowDispatch({\n type: InitiatedFlowConstants.SYNC_ATTACHMENTS,\n attachments,\n });\n })\n .always(() => {\n initiatedFlowDispatch({\n type: InitiatedFlowConstants.SET_ATTACHMENTS_REFRESHED,\n });\n });\n }, 1000);\n\n useEffect(() => {\n if (initiatedFlowState.refreshing) {\n sync();\n }\n }, [initiatedFlowState.refreshing]);\n\n useEffect(() => {\n if (initiatedFlowState.refreshingAttachments) {\n if (initiatedFlowState.reviewSubmitted && taskView) {\n return onTaskViewUpdate();\n }\n\n syncAttachments();\n }\n }, [initiatedFlowState.refreshingAttachments]);\n\n function renderProcess() {\n if (taskView) {\n return (\n <>\n <div className='mytasks-main flexcolumn'>\n <TasksMainContent\n initiatedFlow={initiatedFlowState.initiatedFlow}\n teamFriendlyId={masterTemplate.team_friendly_id}\n discussions={discussionState.discussions}\n flowTemplateName={flowTemplate.name}\n activeStep={initiatedFlowState.activeStep}\n currentStep={initiatedFlowState.step}\n />\n </div>\n <TasksSidebar\n initiatedFlowState={initiatedFlowState}\n activities={initiatedFlowState.activities}\n discussions={discussionState.discussions}\n currentStep={initiatedFlowState.step}\n masterTemplate={masterTemplate}\n onTaskViewUpdate={onTaskViewUpdate}\n onSkip={onSkip}\n />\n </>\n );\n }\n\n return (\n <ActiveProcess\n currentUserId={currentUserId}\n admin={admin}\n flowTemplate={flowTemplate}\n showAdminWarning={showAdminWarning}\n masterTemplate={masterTemplate}\n notifications={notifications}\n initiatedFlowState={initiatedFlowState}\n discussions={discussionState.discussions}\n />\n )\n }\n\n return (\n <ErrorBoundary>\n <InitiatedFlowDispatchContext.Provider value={initiatedFlowDispatch}>\n <DiscussionDispatchContext.Provider value={discussionDispatch}>\n {renderProcess()}\n </DiscussionDispatchContext.Provider>\n </InitiatedFlowDispatchContext.Provider>\n </ErrorBoundary>\n );\n};\n\nInitiatedFlowManager.propTypes = {\n admin: PropTypes.bool.isRequired,\n showAdminWarning: PropTypes.bool.isRequired,\n masterTemplate: PropTypes.object.isRequired,\n notifications: PropTypes.array,\n taskView: PropTypes.bool,\n\n currentUser: PropTypes.shape({\n id: PropTypes.number.isRequired,\n }),\n\n flowTemplate: PropTypes.object.isRequired,\n};\n\nexport default InitiatedFlowManager;\n","import React from 'react';\nimport { render } from 'react-dom';\n\nimport LaunchManager from 'components/initiated_flow/launch-manager';\nimport { pollForLogin } from 'modules/poll-for-login';\nimport CommonProviders from 'components/common-providers';\nimport InitiatedFlowManager from '../components/initiated-flow-manager';\n\nconst show = () => {\n pollForLogin();\n\n const el = (\n <CommonProviders>\n <InitiatedFlowManager\n step={CityGrows.Server.initiatedFlowData.step}\n currentUserId={CityGrows.Server.currentUserId}\n admin\n initiatedFlow={CityGrows.Server.initiatedFlowData.initiated_flow}\n flowTemplate={CityGrows.Server.initiatedFlowData.flow_template}\n masterTemplate={CityGrows.Server.initiatedFlowData.master_template}\n activeStep={CityGrows.Server.initiatedFlowData.active_step}\n notifications={CityGrows.Server.FlashMessages}\n showAdminWarning={false}\n />\n </CommonProviders>\n );\n\n render(el, document.getElementById('flowcontent'));\n};\n\nconst start = () => {\n render(\n (\n <CommonProviders>\n <LaunchManager\n subprocessRequirement={CityGrows.Server.initiatedFlowData.subprocess_requirement}\n flowTemplate={CityGrows.Server.initiatedFlowData.flow_template}\n currentUser={CityGrows.Server.initiatedFlowData.current_user}\n primaryApplicant={CityGrows.Server.initiatedFlowData.primary_applicant}\n secondaryApplicantIds={CityGrows.Server.initiatedFlowData.secondary_applicant_ids}\n masterTemplateId={CityGrows.Server.initiatedFlowData.master_template.id}\n />\n </CommonProviders>\n ), document.getElementById('flowcontent'),\n );\n};\n\nexport default {\n show,\n start,\n};\n","import React, { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport PollableJob from 'modules/pollable-job';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport { show as outputsShow } from 'apis/outputs-api';\n\nconst IssuedOutput = (props) => {\n const [isLoaded, setIsLoaded] = useState(false);\n const [documentURL, setDocumentURL] = useState();\n const [loadingDidFail, setLoadingDidfail] = useState(false);\n\n const onGenerateComplete = (res) => {\n const parsed = JSON.parse(res);\n const url = parsed.file_url;\n setDocumentURL(url);\n setIsLoaded(true);\n document.location = url;\n };\n\n const startDownload = () => {\n const jobRunner = new PollableJob(() => { return outputsShow(props.issuedOutput.id, false); });\n jobRunner.run()\n .done(onGenerateComplete)\n .fail(() => { setLoadingDidfail(true); });\n };\n\n useEffect(() => {\n startDownload();\n }, []);\n\n const renderContent = () => {\n if (isLoaded) {\n return (\n <a href={documentURL}>Click to download {props.issuedOutput.name}</a>\n );\n } if (loadingDidFail) {\n return <span>Unable to generate document at this time. Please try again later.</span>;\n }\n\n return (\n <>\n <span className='inline-block nomargin vmiddle margin-right'>Generating <strong>{props.issuedOutput.name}</strong></span> <LoadingSpinner size='medium' className='vmiddle' />\n </>\n );\n };\n\n return (\n <div className='well'>\n {renderContent()}\n </div>\n );\n};\n\nIssuedOutput.propTypes = {\n\n};\n\nexport default IssuedOutput;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport IssuedOutput from 'components/issued-output';\nimport CommonProviders from 'components/common-providers';\n\nexport const show = () => {\n renderer(\n (\n <CommonProviders>\n <IssuedOutput issuedOutput={CityGrows.Server.issuedOutput} />\n </CommonProviders>\n ), document.getElementById('issuedoutput'),\n );\n};\n\nexport default {\n show,\n};\n","import LocalStorage from 'modules/local-storage';\n\nconst LOCAL_STORAGE_KEY = 'QUICKLAUNCH_TEMPLATES';\n\nconst onTemplatesLoaded = (req) => {\n cacheTemplates(req.master_templates);\n\n if(!promise.isResolved){\n promise.resolve({ master_templates: req.master_templates });\n }\n};\n\nconst cacheTemplates = (templates) => {\n const now = new Date();\n const ttl = 30*60*1000; // 30 minutes\n\n LocalStorage.save(LOCAL_STORAGE_KEY, {\n templates,\n expiresAt: now.getTime() + ttl\n });\n}\n\n\nconst loadMasterTemplates = () => {\n const url = `/master_templates/quick_launch`;\n\n const req = $.ajax(url, {\n method: 'GET',\n dataType: 'json'\n });\n\n return req;\n};\n\nconst getStoredTemplates = () => {\n const now = new Date();\n const storedTemplates = LocalStorage.fetch(LOCAL_STORAGE_KEY);\n\n if(!storedTemplates || !storedTemplates.expiresAt || storedTemplates.expiresAt < now.getTime()){\n LocalStorage.save(LOCAL_STORAGE_KEY, null);\n return null;\n }\n\n return storedTemplates.templates;\n};\n\nvar promise;\n\nconst QuicklaunchActions = {\n\n loadAndCacheMasterTemplates: () => {\n promise = $.Deferred();\n const storedTemplates = getStoredTemplates();\n const loadRequest = loadMasterTemplates()\n .done(onTemplatesLoaded);\n\n if(storedTemplates){\n promise.resolve({\n master_templates: storedTemplates,\n loadRequest\n });\n }\n\n\n return promise;\n }\n};\n\nexport default QuicklaunchActions;","import React, {\n useRef, useState, useEffect, useCallback,\n} from 'react';\nimport Popdown from 'components/shared/popdown';\nimport QuicklaunchActions from 'actions/quicklaunch-actions';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport truncate from 'truncate';\nimport { filter, isEmpty } from 'underscore';\nimport useOnclickOutside from 'react-cool-onclickoutside';\n\nconst NO_TEMPLATES_CONTENT = (\n <div>No forms available</div>\n);\n\nconst Quicklaunch = () => {\n const innerContentEl = useRef();\n const [isOpen, setIsOpen] = useState(false);\n const [masterTemplates, setMasterTemplates] = useState(null);\n const [searchTerm, setSearchTerm] = useState('');\n const inputEl = useRef();\n const elForAnchor = useRef();\n\n useOnclickOutside(() => {\n setIsOpen(false);\n }, { refs: [elForAnchor], ignoreClass: 'popdown' });\n\n const onMasterTemplatesLoaded = useCallback((res) => {\n setMasterTemplates(res.master_templates);\n\n // If we queued a request to refresh the data\n // set it when it loads.\n\n if (res.loadRequest) {\n res.loadRequest.done(onMasterTemplatesLoaded);\n }\n }, []);\n\n useEffect(() => {\n if (masterTemplates || !isOpen) { return; }\n\n QuicklaunchActions.loadAndCacheMasterTemplates()\n .done(onMasterTemplatesLoaded);\n }, [isOpen, masterTemplates, onMasterTemplatesLoaded]);\n\n useEffect(() => {\n if (isOpen && inputEl.current) { inputEl.current.select(); }\n }, [isOpen]);\n\n const onSearchChange = (e) => {\n setSearchTerm(e.currentTarget.value);\n };\n\n const filteredMasterTemplates = () => {\n return filter(masterTemplates, (mt) => {\n return mt.name.toLowerCase().includes(searchTerm.toLowerCase());\n });\n };\n\n const renderQuicklaunchContent = () => {\n return (\n <>\n <div className='quicklaunch-search'>\n <input onChange={onSearchChange} ref={inputEl} className='fullwidth margin-bottom' type='text' placeholder='Filter forms' />\n </div>\n {renderTemplateContent()}\n </>\n );\n };\n\n const renderTemplateContent = () => {\n if (isEmpty(masterTemplates)) {\n return NO_TEMPLATES_CONTENT;\n }\n return (\n <ul className='quicklaunch-list'>\n {filteredMasterTemplates().map(renderMasterTemplate)}\n </ul>\n );\n };\n\n const renderMasterTemplate = (mt) => {\n const launchButtonPath = `/initiated_flows/manager?flow_template_id=${mt.flow_template_id}&primary_applicant_id=${CityGrows.Server.currentUserId}`;\n\n return (\n <li key={`mt-${mt.id}`}>\n <div title={mt.name}>\n {truncate(mt.name, 35)}\n <span title={mt.team_name} className='color-text-medium'>\n ({truncate(mt.team_name, 25)})\n </span>\n </div>\n <a href={launchButtonPath} data-method='POST' className='btn btn-primary small'>Start</a>\n </li>\n );\n };\n\n const renderLoading = () => {\n return <div className='align-center'><LoadingSpinner size='medium' className='vmiddle margin-top' /></div>;\n };\n\n const renderPopdown = () => {\n if (!isOpen) { return; }\n\n return (\n <Popdown anchorRef={elForAnchor} justify='right' className='quicklaunch-popdown'>\n <div className='quicklaunch-content' ref={innerContentEl}>\n {!masterTemplates ? renderLoading() : renderQuicklaunchContent()}\n </div>\n </Popdown>\n );\n };\n\n const buttonClass = () => {\n if (!isOpen) { return ''; }\n\n return 'quicklaunch-active';\n };\n\n return (\n <>\n <button\n type='button'\n className={buttonClass()}\n title='Quick launch'\n ref={elForAnchor}\n onClick={() => { setIsOpen(!isOpen); }}\n >\n <span>+</span>\n </button>\n\n {renderPopdown()}\n </>\n );\n};\n\nexport default Quicklaunch;\n","import React, { useState, useEffect } from 'react';\nimport truncate from 'truncate';\n\nconst UserMenu = (props) => {\n const [open, setOpen] = useState(false);\n\n function checkTab(e) {\n if (e.keyCode === 9 && !e.shiftKey) {\n setOpen(false);\n }\n }\n\n return (\n <li className='nav-profilelink public'>\n <button onClick={() => {setOpen(!open)}} className='btn-link nav-profilelink-email dashboard-link'>\n {truncate(props.currentUser.name, 25)}\n </button>\n <div className={`popup nopadding ${open ? 'open' : ''}`}>\n <div className='popup-nub' />\n <ul className='popup-listmenu'>\n <li className='popup-listmenu-addendum'>\n <div> Logged in as</div>\n <div title={props.currentUser.email}>{truncate(props.currentUser.email, 25)}</div>\n </li>\n <li><a href='/account'>My profile</a></li>\n <li>\n <a href='/users/sign_out' data-method='delete' onKeyDown={checkTab}>\n Sign out\n </a>\n </li>\n </ul>\n </div>\n </li>\n );\n};\n\nexport default UserMenu;\n","import React, { useState } from 'react';\nimport CloseIfOutsideWrapper from 'components/shared/close-if-outside-wrapper';\nimport MediaQuery from 'react-responsive';\nimport UserMenu from './user-menu';\n\nconst PublicNavMenu = (props) => {\n const [activeClass, setActiveClass] = useState('');\n\n function onClose() {\n setActiveClass('');\n }\n\n function toggleHamburger() {\n const newActiveClass = activeClass == '' ? 'is-active' : '';\n setActiveClass(newActiveClass);\n }\n\n function renderDashboardLink() {\n return <a className='dashboard-link' href='/'>Dashboard</a>;\n }\n\n function renderSignInLink(mobile) {\n const className = `dashboard-link ${mobile ? 'color-standout' : ''}`;\n return (\n <a\n href='/users/sign_in?public=true'\n className={className}\n >\n Sign in\n </a>\n );\n }\n\n function renderSignUpLink() {\n return (\n <a className='dashboard-link' href='/users/sign_up?public=true'>Create a ClearForms account</a>\n );\n }\n\n function renderMenuLinks() {\n if (props.currentUser) {\n return [renderDashboardLink()];\n }\n return [renderSignUpLink()];\n }\n\n function renderMenuItems() {\n return renderMenuLinks().map((link, idx) => {\n return <li className='menulink' key={idx}>{link}</li>;\n });\n }\n\n function renderUserMenu() {\n if (props.currentUser) {\n return <UserMenu currentUser={props.currentUser} />;\n }\n return <li className='menulink'>{renderSignInLink()}</li>;\n }\n\n function renderMobileMenuPopup() {\n return (\n <div className='popup'>\n <ul className='popup-listmenu'>\n {renderMenuItems()}\n </ul>\n </div>\n );\n }\n\n function renderMobileMenu() {\n return (\n <ul className='nav-menu'>\n <li className={`hamburger orgheader-mobilemenu ${activeClass} margin-right`} type='button' onClick={toggleHamburger}>\n <CloseIfOutsideWrapper onClose={onClose}>\n <span className='hamburger-box'>\n <span className='hamburger-inner'>\n {renderMobileMenuPopup()}\n </span>\n </span>\n </CloseIfOutsideWrapper>\n </li>\n {renderUserMenu()}\n </ul>\n\n );\n }\n\n function renderDesktopMenu() {\n return (\n <ul className='orgheader-desktopmenu nav-menu'>\n {renderMenuItems()}\n {renderUserMenu()}\n </ul>\n );\n }\n\n function renderMenu() {\n return (\n <MediaQuery minWidth={769}>\n {(matches) => {\n if (matches) { return renderDesktopMenu(); }\n return renderMobileMenu();\n }}\n </MediaQuery>\n );\n }\n\n return (\n <div className={`nav-navlinks ${props.light ? 'light' : ''}`}>\n {renderMenu()}\n </div>\n );\n};\n\nexport default PublicNavMenu;\n","import React from 'react';\n\nconst HeaderDisc = ({avatar}) => {\n if (avatar) {\n const bStyle = {\n backgroundImage: `url('${avatar}')`,\n backgroundSize: 'cover',\n display: 'inline-block',\n height: '36px',\n width: '36px',\n borderRadius: '50%',\n };\n\n return <span style={bStyle} />\n }\n\n return (\n <span className='header-avatar-placeholder' />\n );\n};\n\nexport default HeaderDisc;","import React, { useState, useRef } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport Popdown from 'components/shared/popdown';\nimport useOnclickOutside from 'react-cool-onclickoutside';\n\nconst HelpLinks = () => {\n const [isOpen, setIsOpen] = useState(false);\n const elForAnchor = useRef();\n const innerContentEl = useRef();\n\n useOnclickOutside(() => {\n setIsOpen(false);\n }, { refs: [elForAnchor], ignoreClass: 'popdown' });\n\n function renderPopdown() {\n if (!isOpen) { return; }\n\n return (\n <Popdown anchorRef={elForAnchor} justify='right' className='helplinks-popdown'>\n <ul className='popdown-listmenu' ref={innerContentEl}>\n <li><a href='https://support.cleargov.com/' target='_blank'>Support Center</a></li>\n <li><a href='https://cleargov.learnupon.com/' target='_blank'>Cleargov Academy</a></li>\n </ul>\n </Popdown>\n );\n };\n\n return (\n <>\n <button className='help-icon' ref ={elForAnchor} onClick={() => { setIsOpen(!isOpen); }}>\n <FontAwesomeIcon icon={icon({ name: 'circle-question' })} size='xl' color='#54ADFB' />\n </button>\n {renderPopdown()}\n </>\n )\n}\n\nexport default HelpLinks;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport Quicklaunch from 'components/quicklaunch';\nimport AlertConfirm from 'modules/alert-confirm';\nimport CommonProviders from 'components/common-providers';\nimport PublicNavMenu from 'components/shared/public-nav-menu';\nimport { error as flashError, render as flashRender } from 'components/shared/flash';\nimport HeaderDisc from 'components/header-disc';\nimport HelpLinks from '../components/help-links';\n\nfunction init() {\n configOfflineJS();\n identify();\n initFlash();\n initPublicNav();\n initHamburgerMenu();\n initProfileDisc();\n configureDefaultAjaxErrors();\n initQuicklaunch();\n}\n\nfunction configureDefaultAjaxErrors() {\n window.jQuery.ajaxSetup({\n error: (e) => {\n if (e.status === 429) {\n flashError('You\\'re doing that too much. Wait a moment before trying again.');\n Rollbar.warning('RateLimited');\n }\n },\n });\n}\n\nfunction configOfflineJS() {\n Offline.options = { checks: { xhr: { url: '/images/pixel.png' } } };\n}\n\nfunction identify() {\n const userId = CityGrows.Server.currentUserId;\n if (userId) {\n if ((typeof analytics !== 'undefined')) {\n // Segment will only be available on prod\n analytics.identify(userId);\n }\n\n const cgID = CityGrows.Server.currentUser.cgId;\n\n if ((typeof ChurnZero !== 'undefined') && cgID) {\n ChurnZero.push(['setContact', cgID, CityGrows.Server.currentUser.email]);\n ChurnZero.push(['setModule', 'ClearForms']);\n }\n }\n}\n\nfunction initFlash() {\n CityGrows.Server.FlashMessages.forEach((message) => {\n switch (message.type) {\n case 'custom_display':\n return;\n case 'popup':\n const { title, body } = JSON.parse(message.message);\n AlertConfirm.alert(title, body);\n break;\n default:\n flashRender(message);\n }\n });\n}\n\nfunction initPublicNav() {\n const $el = document.getElementById('public-nav-links');\n if ($el) {\n renderer(\n (\n <CommonProviders>\n <PublicNavMenu currentUser={CityGrows.Server.currentUser} light/>\n </CommonProviders>\n ), $el,\n );\n }\n}\n\nfunction initProfileDisc() {\n const $el = document.getElementById('profile-disc');\n\n if ($el) {\n renderer(\n (\n <CommonProviders>\n <HeaderDisc avatar={CityGrows.Server.currentUser.avatarUrl} />\n </CommonProviders>\n ), $el,\n );\n }\n}\n\n\nfunction initHamburgerMenu() {\n $(document).on('click', '.hamburger', (e) => {\n const $popup = $('.hamburger .popup');\n if (!$popup[0]) { return; }\n if ($popup[0].contains(e.target)) { return; }\n\n const $menu = $('.hamburger')\n $($menu).toggleClass('is-active');\n });\n\n $(document).click((e) => {\n const $menu = $('.hamburger');\n if (!$menu[0]) { return; }\n\n if (!$menu[0].contains(e.target) && $menu.hasClass('is-active')) {\n $menu.removeClass('is-active');\n }\n });\n}\n\nfunction initQuicklaunch() {\n const $el = document.getElementById('quicklaunch');\n if ($el) {\n renderer(\n (\n <CommonProviders>\n <Quicklaunch />\n <HelpLinks />\n </CommonProviders>\n ), $el,\n );\n }\n}\n\nexport default init;\n","import { createContext } from 'react';\n\nexport const DocumentDispatchContext = createContext();\n","import FormData from 'form-data';\nimport {\n update,\n create,\n destroy,\n fetchMappables as apiFetchMappables,\n publish,\n unpublish,\n replace\n} from 'apis/document-api';\nimport { isEmpty } from 'underscore';\n\nexport const submitConfig = (documentId, masterTemplateSlug, configuredMappings, name, startVersion, stopVersion, latest) => {\n\n const formData = new FormData();\n\n if (!isEmpty(configuredMappings)) {\n let index = 0;\n Object.entries(configuredMappings).forEach(([_key, value]) => {\n const mappingName = `master_template_document[document_field_mappings_attributes][${index}]`;\n if (value.mappingId) {\n formData.append(`${mappingName}[id]`, value.mappingId);\n }\n formData.append(`${mappingName}[field_name]`, value.fieldName);\n formData.append(`${mappingName}[mappable]`, value.mappable);\n\n index++;\n\n });\n }\n\n formData.append('master_template_document[name]', name);\n formData.append('master_template_document[start_version]', startVersion);\n formData.append('master_template_document[stop_version]', stopVersion);\n formData.append('master_template_document[main]', latest);\n\n return update(documentId, masterTemplateSlug, formData);\n};\n\nexport const createDoc = (masterTemplateId, docFile) => {\n const formData = new FormData();\n formData.append('master_template_document[document]', docFile[0]);\n\n return create(masterTemplateId, formData);\n};\n\nexport const replaceDoc = (documentId, masterTemplateId, docFile) => {\n const formData = new FormData();\n formData.append('master_template_document[document]', docFile[0]);\n\n return replace(documentId, masterTemplateId, formData);\n};\n\nexport const fetchMappables = (documentId, masterTemplateId, query) => {\n return apiFetchMappables(documentId, masterTemplateId, query);\n};\n\nexport const publishDocument = (masterTemplateId, documentId) => {\n return publish(masterTemplateId, documentId);\n};\n\nexport const unpublishDocument = (masterTemplateId, documentId) => {\n return unpublish(masterTemplateId, documentId);\n};\n\nexport const deleteDocument = (masterTemplateId, documentId) => {\n return destroy(masterTemplateId, documentId);\n};\n","export const selectValueForMapping = (mapping) => {\n return {\n identity: mapping.mappable.identity,\n entity_field_id: mapping.entity_field_id,\n type: mapping.mappable_type,\n process_data_field: mapping.process_data_field\n };\n};\n","import React, { useEffect, useRef, useState } from 'react';\nimport { Document, pdfjs, Page } from 'react-pdf';\nimport PropTypes from 'prop-types';\nimport { isEmpty } from 'underscore';\nimport pdfjsWorker from 'pdfjs-dist/build/pdf.worker.entry';\n\npdfjs.GlobalWorkerOptions.workerSrc = pdfjsWorker;\n\nconst MappingPdfViewer = (props) => {\n const containerSize = 700;\n const containerRef = useRef();\n const [numPages, setNumPages] = useState(0);\n const [highlighted, setHighlighted] = useState([]);\n\n useEffect(() => {\n if (!props.activeSelect || numPages === 0) return;\n\n clearHighlighted();\n\n const inputs = containerRef.current.querySelectorAll(`.annotationLayer section [name=\"${props.activeSelect}\"]`);\n if (isEmpty(inputs)) return;\n\n inputs.forEach((input, index) => {\n input.classList.add('highlighted');\n highlighted.push(input);\n\n const inputTop = input.getBoundingClientRect().top;\n if (index === inputs.length - 1 && (inputTop < 0 || inputTop > containerSize)) {\n const page = input.closest('.react-pdf__Page');\n containerRef.current.scrollTo({\n top: (page.dataset.pageNumber - 1) * page.clientHeight,\n behavior: 'smooth',\n });\n }\n });\n }, [props.activeSelect, containerRef, numPages, highlighted]);\n\n useEffect(() => {\n if (!props.activeSelect) {\n clearHighlighted();\n }\n }, [props.activeSelect]);\n\n const clearHighlighted = () => {\n if (isEmpty(highlighted)) return;\n\n highlighted.forEach((el) => {\n el.classList.remove('highlighted');\n });\n setHighlighted([]);\n };\n\n const onDocumentLoadSuccess = ({ numPages: nPages }) => {\n setNumPages(nPages);\n };\n\n return (\n <div id='mappingpdfviewer-pdfviewercontainer' ref={containerRef}>\n <Document\n file={props.file}\n onLoadSuccess={onDocumentLoadSuccess}\n >\n {Array.from(\n new Array(numPages),\n (el, index) => (\n <Page\n key={`page_${index + 1}`}\n pageNumber={index + 1}\n renderForms\n renderTextLayer={false}\n />\n ),\n )}\n </Document>\n </div>\n );\n};\nMappingPdfViewer.propTypes = {\n file: PropTypes.string.isRequired,\n activeSelect: PropTypes.string,\n};\n\nexport default MappingPdfViewer;\n","import React, {\n useContext, useState, useMemo, useEffect,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport { useDropzone } from 'react-dropzone';\nimport {\n createDoc,\n replaceDoc,\n} from 'actions/document-manager-actions';\nimport {\n success as flashSuccess,\n error as flashError,\n} from 'components/shared/flash';\nimport { useHistory } from 'react-router-dom';\nimport { DocumentDispatchContext } from 'contexts/document-dispatch-context';\nimport LoadingSpinner from 'components/shared/loading-spinner';\n\nconst DragAndDropBox = ({\n document, prompt, onChange, replacing,\n}) => {\n const history = useHistory();\n\n const dispatch = useContext(DocumentDispatchContext);\n\n const [uploading, setUploading] = useState(false);\n\n const onDrop = (acceptedFiles) => {\n setUploading(true);\n\n if (document.id) {\n return replaceDoc(document.id, document.master_template_id, acceptedFiles)\n .done((doc) => {\n dispatch({ type: 'update', document: doc });\n onChange();\n })\n .fail(() => { flashError(); })\n .always(() => { setUploading(false); });\n }\n\n return createDoc(document.master_template_id, acceptedFiles)\n .done((doc) => {\n dispatch({ type: 'create', document: doc });\n history.push(`${doc.id}`);\n })\n .fail(() => { flashError(); })\n .always(() => { setUploading(false); });\n };\n\n const {\n getRootProps, getInputProps, isDragActive, open,\n } = useDropzone({ onDrop });\n\n useEffect(() => {\n // Not a great way of doing this. Apologies, future developer.\n\n if (replacing) {\n open();\n }\n }, [replacing]);\n\n const dndStatus = useMemo(() => {\n if (uploading) {\n return (\n <>\n <LoadingSpinner\n size='medium'\n className='vmiddle margin-right'\n />\n <span className='vmiddle'>Uploading</span>\n </>\n );\n }\n\n if (isDragActive) {\n return <span>Drop files here ...</span>;\n }\n\n return <span>{prompt}</span>;\n }, [uploading, isDragActive]);\n\n return (\n <div className='dnd-box margin-bottom' {...getRootProps()}>\n <input {...getInputProps()} />\n {dndStatus}\n </div>\n );\n};\n\nDragAndDropBox.propTypes = {\n document: PropTypes.shape({\n master_template_id: PropTypes.number.isRequired,\n id: PropTypes.number,\n }).isRequired,\n prompt: PropTypes.string,\n};\n\nDragAndDropBox.defaultProps = {\n prompt: 'Drag and drop some files here, or click to select files',\n};\n\nexport default DragAndDropBox;\n","import React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { createFilter } from 'react-select';\nimport Select from 'components/shared/select';\nimport {\n isMatch, uniq, has, isEmpty,\n} from 'underscore';\nimport { selectValueForMapping } from 'modules/document-mapping-helper';\n\nconst Mapping = ({\n mapping,\n defaultMappables,\n index,\n onChange,\n onMenuOpen,\n onMenuClose,\n latestTemplateVersionNumber,\n documentStartVersion,\n isLast,\n documentStopVersion,\n}) => {\n const defaultSelectValue = useMemo(() => {\n if (!mapping.id) { return; }\n\n return defaultMappables.find(({ value, label }) => {\n return isMatch(JSON.parse(value), selectValueForMapping(mapping));\n });\n }, [mapping, defaultMappables]);\n\n const formatOptionLabel = (o) => {\n let versionHTML = '';\n if (o.earliest_version) {\n const versionInfo = uniq([o.earliest_version, latestTemplateVersionNumber === o.latest_version ? 'Latest' : o.latest_version]).join(' - ');\n versionHTML = <><span className='versionnumber'>V({versionInfo})</span> </>;\n }\n\n return <>{versionHTML}{o.label}</>;\n };\n\n // TODO:\n // Ideally this would use the selected version rather\n // than the persisted version. I suspect this is good\n // enough for the time being though.\n\n const fullCoverage = useMemo(() => {\n const s = defaultSelectValue;\n\n if (!has(s, 'earliest_version') || !has(s, 'latest_version')) {\n return true;\n }\n\n if (isEmpty(documentStopVersion)) {\n return s.earliest_version <= documentStartVersion && s.latest_version >= latestTemplateVersionNumber;\n }\n\n return s.earliest_version <= documentStartVersion && s.latest_version >= documentStopVersion;\n }, [defaultSelectValue, documentStartVersion, documentStopVersion]);\n\n return (\n <li>\n <label>\n {mapping.field_name}\n <Select\n defaultValue={defaultSelectValue}\n onChange={(selection) => { onChange(selection, mapping.id, mapping.field_name); }}\n onMenuOpen={onMenuOpen}\n onMenuClose={onMenuClose}\n options={defaultMappables}\n className='react-select'\n classNamePrefix='react-select'\n menuPosition='fixed'\n maxMenuHeight={120}\n menuPlacement={isLast ? 'top' : 'auto'}\n filterOption={createFilter({\n ignoreCase: true,\n ignoreAccents: true,\n matchFrom: 'any',\n stringify: (option) => `${option.label} ${option.value}`,\n trim: true,\n })}\n formatOptionLabel={formatOptionLabel}\n styles={{\n container: (provided) => ({\n ...provided,\n minWidth: '10rem',\n maxWidth: '50rem',\n }),\n }}\n />\n <input\n value={mapping.id}\n type='hidden'\n name={`master_template_document[document_field_mappings_attributes][${index}][id]`}\n />\n <input\n value={mapping.field_name}\n type='hidden'\n name={`master_template_document[document_field_mappings_attributes][${index}][field_name]`}\n />\n\n </label>\n\n { !fullCoverage && (\n <div className='text-semialert strong'>Warning: This field does not exist on some covered form versions</div>\n )}\n </li>\n );\n};\n\nMapping.propTypes = {\n mapping: PropTypes.shape({\n id: PropTypes.number,\n field_name: PropTypes.string.isRequired,\n }).isRequired,\n defaultMappables: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n index: PropTypes.number.isRequired,\n isLast: PropTypes.bool.isRequired,\n onChange: PropTypes.func,\n document: PropTypes.shape({}).isRequired,\n latestTemplateVersionNumber: PropTypes.number.isRequired,\n documentStartVersion: PropTypes.number.isRequired,\n documentStopVersion: PropTypes.number.isRequired,\n};\n\nexport default Mapping;\n","import React, {\n useState, useContext, useEffect, useMemo, useRef, createRef,\n} from 'react';\nimport {\n isEqual,\n} from 'underscore';\nimport {\n Route, Switch, useHistory,\n} from 'react-router-dom';\nimport { success as flashSuccess, error as flashError } from 'components/shared/flash';\nimport { alert, confirm } from 'modules/alert-confirm';\nimport {\n submitConfig,\n publishDocument,\n unpublishDocument,\n deleteDocument,\n} from 'actions/document-manager-actions';\nimport { DocumentDispatchContext } from 'contexts/document-dispatch-context';\nimport { selectValueForMapping } from 'modules/document-mapping-helper';\nimport Popdown from 'components/shared/popdown';\nimport MappingPdfViewer from 'components/document-config/mapping-pdf-viewer';\nimport useOnclickOutside from 'react-cool-onclickoutside';\nimport DragAndDropBox from './drag-and-drop-box';\nimport Mapping from './mapping';\n\nconst DocumentConfig = ({\n document,\n defaultMappables,\n latestTemplateVersionNumber,\n}) => {\n const dispatch = useContext(DocumentDispatchContext);\n const history = useHistory();\n\n const optionsMenuRef = useRef();\n const optionsAnchor = useRef();\n useOnclickOutside(() => {\n setOptionsOpen(false);\n }, { refs: [optionsAnchor], ignoreClass: 'popdown' });\n\n const defaultName = document.name ?? '';\n const [name, setName] = useState(defaultName);\n\n const defaultStartVersion = document.start_version ?? '';\n const [startVersion, setStartVersion] = useState(defaultStartVersion);\n\n const defaultStopVersion = document.stop_version ?? '';\n const [stopVersion, setStopVersion] = useState(defaultStopVersion);\n const [latest, setLatest] = useState(document.main);\n\n const [replacing, setReplacing] = useState(false);\n\n const [optionsOpen, setOptionsOpen] = useState(false);\n\n const [activeSelect, setActiveSelect] = useState(null);\n\n useEffect(() => {\n setConfiguredMappings((prevMappings) => {\n return {\n ...prevMappings,\n ...initialMappingState,\n };\n });\n }, [document.mappings]);\n\n useEffect(() => {\n setName(defaultName);\n setStartVersion(defaultStartVersion);\n setStopVersion(defaultStopVersion);\n setLatest(document.main);\n }, [document.id]);\n\n const initialMappingState = useMemo(() => {\n return document.mappings.reduce((_mappings, _mapping) => {\n return {\n ..._mappings,\n [_mapping.field_name]: {\n mappable: JSON.stringify(selectValueForMapping(_mapping)),\n mappingId: _mapping.id,\n fieldName: _mapping.field_name,\n },\n };\n }, {});\n }, [document.mappings]);\n\n const [configuredMappings, setConfiguredMappings] = useState(initialMappingState);\n\n const onMappingChanged = (mappable, mappingId, fieldName) => {\n setConfiguredMappings((prevMappings) => {\n return {\n ...prevMappings,\n [fieldName]: {\n mappable: mappable.value,\n mappingId,\n fieldName,\n },\n };\n });\n };\n\n const [working, setWorking] = useState(false);\n\n const nothingChanged = useMemo(() => {\n return (name === defaultName)\n && (~~startVersion === ~~defaultStartVersion)\n && (~~stopVersion === ~~defaultStopVersion)\n && (latest === document.main)\n && isEqual(configuredMappings, initialMappingState);\n }, [\n name,\n defaultName,\n startVersion,\n defaultStartVersion,\n stopVersion,\n defaultStopVersion,\n configuredMappings,\n initialMappingState,\n latest,\n document.main,\n ]);\n\n const saveButtonIsDisabled = working || nothingChanged;\n\n const renderEndVersion = () => {\n return (\n <div className='inline-block'>\n <label className='inline-block'>\n <span>Stop version</span>\n <input\n id='stopversioninput'\n type='number'\n placeholder={latest ? 'Latest' : 'Type a number...'}\n value={latest ? '' : stopVersion}\n onChange={(e) => { setStopVersion(e.currentTarget.value); }}\n disabled={latest}\n />\n </label>\n\n <label className='inline-block'>\n <span>Latest</span>\n <input\n id='latestcheckbox'\n type='checkbox'\n checked={latest}\n onChange={(e) => { setLatest(e.currentTarget.checked); }}\n />\n </label>\n </div>\n );\n };\n\n const renderVersions = () => {\n if (!document.has_file) { return; }\n\n return (\n <div className='margin-bottom-more well'>\n <label className='inline-block margin-right'>\n <span>Start version</span>\n <input\n id='startversioninput'\n type='number'\n placeholder='Type a number...'\n onChange={(e) => { setStartVersion(e.currentTarget.value); }}\n value={startVersion}\n />\n </label>\n {renderEndVersion()}\n <div className='margin-top'>Latest unpublished version is <strong>{latestTemplateVersionNumber}</strong></div>\n </div>\n );\n };\n\n const renderMapping = (m, index) => {\n const isLast = index === document.mappings.length - 1;\n\n return (\n <Mapping\n key={m.field_name}\n index={index}\n mapping={m}\n isLast={isLast}\n defaultMappables={defaultMappables}\n onChange={onMappingChanged}\n onMenuOpen={() => setActiveSelect(m.field_name)}\n onMenuClose={() => setActiveSelect(null)}\n latestTemplateVersionNumber={latestTemplateVersionNumber}\n documentStartVersion={startVersion}\n documentStopVersion={stopVersion}\n />\n );\n };\n\n const renderedMappings = useMemo(() => {\n if (!document.has_file) { return []; }\n\n return (\n <ul\n id='mappingslist'\n style={{ overflowY: 'auto', maxHeight: '50vh' }}\n >\n {document.mappings.map(renderMapping)}\n </ul>\n );\n }, [document.has_file, document.mappings]);\n\n const onSaveClick = () => {\n setWorking(true);\n\n const s = submitConfig(document.id, document.master_template_id, configuredMappings, name, startVersion, stopVersion, latest)\n .done((doc) => {\n dispatch({ type: 'update', document: doc });\n flashSuccess('Document saved');\n })\n .fail(() => { flashError(); })\n .always(() => { setWorking(false); });\n };\n\n const findErrors = () => {\n const errors = [];\n\n if (!nothingChanged) {\n errors.push('Your changes must be saved before publishing. Click the \\'Save draft\\' button to save your changes.');\n }\n\n if (!document.name) {\n errors.push('Document must have a name');\n }\n\n if (!document.start_version) {\n errors.push('Document must have a start version');\n }\n\n if (!document.stop_version && !document.main) {\n errors.push('Document must have a stop version');\n }\n\n return errors;\n };\n\n const validateForPublish = () => {\n return findErrors().length === 0;\n };\n\n const onUnpublishClick = () => {\n unpublishDocument(document.master_template_id, document.id)\n .done((doc) => {\n if (doc.errors.length > 0) {\n flashError(doc.errors[0]);\n } else {\n dispatch({ type: 'update', document: doc });\n }\n })\n .fail(() => { flashError(); })\n .always(() => { setWorking(false); });\n };\n\n const onPublishClick = () => {\n if (!validateForPublish()) {\n alert('Unable to publish', findErrors()[0]);\n return;\n }\n\n setWorking(true);\n\n publishDocument(document.master_template_id, document.id)\n .done((doc) => {\n if (doc.errors.length > 0) {\n flashError(doc.errors[0]);\n } else {\n dispatch({ type: 'update', document: doc });\n }\n })\n .fail(() => { flashError(); })\n .always(() => { setWorking(false); });\n };\n\n const toggleOptions = () => {\n setOptionsOpen(!optionsOpen);\n };\n\n const onDeleteClick = () => {\n setOptionsOpen(false);\n confirm('Delete Document?', 'This will delete the uploaded pdf and associated mappings', () => {\n deleteDocument(document.master_template_id, document.id)\n .done(() => {\n flashSuccess('Document deleted');\n dispatch({\n type: 'destroy', documentId: document.id,\n });\n history.push('new');\n });\n });\n };\n\n const saveButtonText = () => {\n if (document.published_at) {\n return 'Save changes';\n }\n\n return 'Save draft';\n };\n\n const publishButton = () => {\n if (document.published_at) {\n return (\n <button\n id='unpublishbutton'\n onClick={onUnpublishClick}\n type='button'\n className='btn-thirdary margin-left'\n disabled={working}\n >\n Unpublish\n </button>\n );\n }\n\n return (\n <button\n id='publishbutton'\n onClick={onPublishClick}\n type='button'\n className='btn-primary margin-left'\n disabled={working}\n >\n Publish\n </button>\n );\n };\n\n const onReplaceClick = () => {\n setOptionsOpen(false);\n confirm('Are you sure?', `\n You are about to replace your current document. Note that:\n <ul>\n <li>The document will not work if the replacement document does not have input fields with identical names to the mapped fields on your current document.</li>\n <li>This will remove the current file from the system. Please ensure you have a copy of it before taking this action.</li>\n </ul>\n `.trim())\n .done(() => {\n setReplacing(true);\n });\n };\n\n const renderContent = () => {\n if (!document.has_file) {\n return (\n <DragAndDropBox\n document={document}\n prompt='Click or drag a fillable PDF document to get started'\n />\n );\n }\n\n return (\n <>\n <div id='documentmanager-savebar'>\n { document.has_file && (\n <>\n <input\n id='doctitle'\n type='text'\n value={name}\n placeholder='Untitled document'\n className='bigger margin-bottom'\n style={{ width: '400px' }}\n onChange={(e) => { setName(e.currentTarget.value); }}\n />\n\n <div>\n <button\n ref={optionsAnchor}\n type='button'\n className='unstyled'\n onClick={toggleOptions}\n >\n <i\n className='icon icon-dots-horizontal bigger margin-right'\n />\n </button>\n { optionsOpen && (\n <Popdown\n anchorRef={optionsAnchor}\n justify='right'\n >\n <ul\n className='popdown-listmenu'\n ref={optionsMenuRef}\n >\n <li>\n <a target='__blank' href={document.url}>Download document</a>\n </li>\n\n <li>\n <button\n type='button'\n onClick={onReplaceClick}\n >\n Replace document\n </button>\n </li>\n\n <li>\n <button\n type='button'\n onClick={onDeleteClick}\n >\n Delete document\n </button>\n </li>\n </ul>\n </Popdown>\n )}\n <button\n id='savebutton'\n type='submit'\n className='btn btn-primary'\n onClick={onSaveClick}\n disabled={saveButtonIsDisabled}\n >\n {saveButtonText()}\n </button>\n\n {publishButton()}\n </div>\n </>\n )}\n </div>\n <div id='documentmanager-config'>\n <div className='margin-right'>\n {renderVersions()}\n\n { document.has_file && (\n <p>Choose which ClearForms fields to map the following form fields to.</p>\n )}\n\n {renderedMappings}\n </div>\n\n <Switch>\n <Route exact path='/master_templates/:master_template_id/documents/new' />\n\n <Route exact path='/master_templates/:master_template_id/documents/:document_id'>\n <div id='documentmanager-preview'>\n { replacing && (\n <DragAndDropBox\n document={document}\n prompt='Click or drag a new file here to replace the document below'\n onChange={() => { setReplacing(false); }}\n replacing={replacing}\n />\n )}\n\n { !replacing && document.url && (\n <MappingPdfViewer\n file={document.url}\n activeSelect={activeSelect}\n />\n )}\n </div>\n </Route>\n </Switch>\n </div>\n </>\n );\n };\n\n return (\n <div id='documentmanager-docwrap' className='raised bg-white'>\n {renderContent()}\n </div>\n );\n};\n\nexport default DocumentConfig;\n","import React, { useReducer, useEffect, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n uniqueId, findWhere, isNumber, reject,\n} from 'underscore';\nimport {\n Link, useParams,\n} from 'react-router-dom';\nimport invariant from 'invariant';\nimport { DocumentDispatchContext } from 'contexts/document-dispatch-context';\nimport DocumentConfig from './document_manager/document-config';\n\nconst DocumentManager = ({\n defaultMappables,\n masterTemplate,\n}) => {\n const { document_id: documentId } = useParams();\n\n useEffect(() => {\n dispatch({\n type: 'setDocumentFocus',\n documentId,\n });\n }, [documentId]);\n\n const documentReducer = (state, action) => {\n switch (action.type) {\n case 'setDocumentFocus':\n return { ...state, currentDocument: findFocusedDocument(state.documents) };\n case 'create':\n return { ...state, documents: [...state.documents, action.document] };\n case 'update':\n const docs = [...state.documents];\n const docIndex = docs.findIndex((doc) => {\n return doc.id === action.document.id;\n });\n\n invariant(docIndex >= 0, `Expected to find document with id ${action.document.id}`);\n docs[docIndex] = action.document;\n\n return {\n ...state,\n documents: docs,\n currentDocument: findFocusedDocument(docs),\n };\n case 'destroy':\n const docsDupe = [...state.documents];\n return {\n ...state,\n documents: reject(docsDupe, { id: action.documentId }),\n };\n default:\n throw new Error('Unrecognized action type');\n }\n };\n\n const findFocusedDocument = (documents) => {\n if (documentId === 'new') {\n return {\n tempId: uniqueId('document'),\n master_template_id: masterTemplate.id,\n mappings: [],\n };\n }\n\n if (isNumber(parseInt(documentId))) {\n return findWhere(documents, { id: parseInt(documentId) });\n }\n\n throw new Error(`Unexpected document id: ${documentId}`);\n };\n\n const [state, dispatch] = useReducer(documentReducer, { documents: masterTemplate.documents, currentDocument: findFocusedDocument(masterTemplate.documents) });\n\n const renderVersionInfo = (doc) => {\n const text = doc.published_at ? <>Versions {doc.start_version} - { doc.main ? 'Latest' : doc.stop_version}</>\n : 'Draft';\n\n return (\n <div className='documentmanager-listingversion'>\n {text}\n </div>\n );\n };\n\n const renderDocumentInList = (documentInList, index, arr) => {\n return (\n <li key={documentInList.id} className={documentInList.id === state.currentDocument.id ? 'active' : ''}>\n <Link\n to={`${documentInList.id}`}\n >\n {documentInList.name || 'Untitled document'}\n {renderVersionInfo(documentInList)}\n </Link>\n </li>\n );\n };\n\n const sortedDocs = useMemo(() => {\n return state.documents.sort((doc1, doc2) => {\n if (!!doc1.published_at && !doc2.published_at) { return -1; }\n if (doc1.stop_version > doc2.stop_version) { return -1; }\n return 1;\n });\n }, [state.documents]);\n\n const renderDocumentListing = () => {\n return (\n <>\n <li key='new' className={documentId === 'new' ? 'active' : ''}>\n <Link\n to='new'\n id='addnewdoclink'\n >\n Add new document\n </Link>\n </li>\n {sortedDocs.map(renderDocumentInList)}\n </>\n );\n };\n\n return (\n <DocumentDispatchContext.Provider value={dispatch}>\n <div id='documentmanager'>\n <ul id='documentmanager-listing'>\n {renderDocumentListing()}\n </ul>\n\n <DocumentConfig\n key={state.currentDocument.id}\n document={state.currentDocument}\n defaultMappables={defaultMappables}\n latestTemplateVersionNumber={masterTemplate.latest_version_number}\n />\n </div>\n </DocumentDispatchContext.Provider>\n );\n};\n\nDocumentManager.propTypes = {\n\n};\n\nexport default DocumentManager;\n","import 'select2';\nimport React from 'react';\nimport renderer from 'modules/renderer';\nimport DocumentManager from 'components/document-manager';\nimport { BrowserRouter, Switch, Route, Redirect } from 'react-router-dom';\nimport PrimaryTabs from 'components/shared/primary-tabs';\n\nconst show = () => {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n renderer(\n <BrowserRouter>\n <Switch>\n <Route exact path='/master_templates/:master_template_id/documents'>\n <Redirect to={CityGrows.Server.masterTemplate.documents.length > 0 ? CityGrows.Server.masterTemplate.documents[0].id : 'new'} />\n </Route>\n\n <Route exact path='/master_templates/:master_template_id/documents/:document_id'>\n <DocumentManager\n masterTemplate={CityGrows.Server.masterTemplate}\n defaultMappables={CityGrows.Server.defaultMappables}\n />\n </Route>\n </Switch>\n </BrowserRouter>\n , document.getElementById('documentmanagerwrap'));\n};\n\nexport default {\n show,\n};\n","\nimport 'select2';\n\nconst knew = () => {\n $('select').select2();\n};\n\nexport default {\n new: knew,\n};\n","import { findWhere, without } from 'underscore';\nimport invariant from 'invariant';\nimport UserAccessConstants from 'constants/user-access-constants';\n\nfunction accessManagerReducer(state, action) {\n switch (action.type) {\n case UserAccessConstants.PERMISSION_CHANGED:\n const membershipToUpdate = findWhere(state.memberUsers, {\n id: action.membershipId,\n });\n\n membershipToUpdate.permission_level_id = action.permissionLevelId;\n return { ...state }\n case UserAccessConstants.AUTHORITY_REMOVED:\n invariant(action.authorityId, 'authorityId missing');\n const authorityToRemove = findWhere(state.authorityUsers, {\n id: action.authorityId,\n });\n\n invariant(authorityToRemove, 'authorityToRemove was not found');\n\n state.authorityUsers = without(state.authorityUsers, authorityToRemove);\n return { ...state }\n case UserAccessConstants.AUTHORITY_ADDED:\n state.authorityUsers.unshift(action.membership)\n return { ...state }\n case UserAccessConstants.MEMBERSHIP_REMOVED:\n const membershipToRemove = findWhere(state.memberUsers, {\n id: action.membershipId,\n });\n\n return { ...state, memberUsers: without(state.memberUsers, membershipToRemove) };\n case UserAccessConstants.MEMBERSHIP_ADDED:\n state.memberUsers.unshift(action.membership)\n return { ...state }\n case UserAccessConstants.MEMBERSHIP_LIST:\n return { ...state, memberUsers: action.memberships }\n default:\n throw new Error();\n }\n}\n\nexport default accessManagerReducer;\n","import PropTypes from 'prop-types';\nimport React, { Component } from 'react';\n\nclass ActionButton extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n activated: false,\n };\n }\n\n onClick = () => {\n if (this.isDisabled()) return;\n\n const deferred = this.props.onClick();\n\n if (!deferred.always) {\n throw new Error('onClick prop must return a deferred object');\n }\n\n deferred.always(() => { return this.setState({ activated: false }); });\n\n this.setState({ activated: true });\n };\n\n isDisabled() {\n return this.state.activated || this.props.disabled;\n }\n\n render() {\n return (\n <a\n onClick={this.onClick}\n className={this.props.className + (this.isDisabled() ? ' disabled' : '')}\n id={this.props.htmlID}\n >\n {this.props.children}\n </a>\n );\n }\n}\n\nActionButton.defaultProps = {\n className: 'btn-primary',\n htmlID: '',\n disabled: false,\n};\n\nActionButton.propTypes = {\n htmlID: PropTypes.string,\n children: PropTypes.node.isRequired,\n onClick: PropTypes.func.isRequired,\n disabled: PropTypes.bool,\n className: PropTypes.string,\n};\n\nexport default ActionButton;\n","import React, {\n useState, useRef, useEffect, useCallback,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport Popdown from 'components/shared/popdown';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport { isEmpty } from 'underscore';\nimport MasterTemplateAPI from 'apis/master-template-api';\nimport Flash from 'components/shared/flash';\nimport dayjs from 'dayjs';\nimport useOnclickOutside from 'react-cool-onclickoutside';\n\nconst VersionNumber = ({ onClick, version, masterTemplateId }) => {\n const innerContentEl = useRef();\n const elForAnchor = useRef();\n\n const [open, setOpen] = useState(false);\n const [loading, setLoading] = useState(false);\n const [versions, setVersions] = useState(null);\n\n const loadVersions = useCallback(() => {\n MasterTemplateAPI.versions(masterTemplateId)\n .done((responseVersions) => {\n setVersions(responseVersions);\n })\n .fail(() => { Flash.error('Couldn\\'t load previous form versions'); })\n .always(() => { setLoading(false); });\n }, [masterTemplateId]);\n\n const onButtonClick = () => {\n setOpen((currentOpen) => !currentOpen);\n onClick();\n };\n\n useEffect(() => {\n if (open && !loading && !versions) {\n setLoading(true);\n loadVersions();\n }\n }, [open, loading, versions, loadVersions]);\n\n useEffect(() => {\n // If a new version of the template comes down\n // to this component, it probably means that there's\n // a new version that we're not aware of.\n setVersions(null);\n }, [version]);\n\n useOnclickOutside(() => {\n setOpen(false);\n }, { refs: [elForAnchor] });\n\n const renderVersion = (templateVersion) => (\n <li key={templateVersion.id}>\n <div className='versionnumber-label'>\n Version {templateVersion.version}\n </div>\n <div className='versionnumber-date'>\n Published {dayjs(templateVersion.published_at).format('l')}\n </div>\n <dl className='versionnumber-stats'>\n <dt>Active</dt>\n <dd>{templateVersion.active}</dd>\n <dt>Complete</dt>\n <dd>{templateVersion.completed}</dd>\n </dl>\n </li>\n );\n\n const renderPopupContent = () => {\n if (!versions) {\n return <LoadingSpinner />;\n }\n\n if (isEmpty(versions)) {\n return 'This is the only version of this form';\n }\n\n return (\n <ul ref={innerContentEl} className='versionnumber-versionlist'>\n {versions.map(renderVersion)}\n </ul>\n );\n };\n\n const renderPopdown = () => {\n if (!open) { return null; }\n\n return (\n <Popdown\n anchorRef={elForAnchor}\n className='padded versionnumber-popdown'\n >\n {renderPopupContent()}\n </Popdown>\n );\n };\n\n return (\n <>\n <div ref={elForAnchor} title='Template version' className='versionnumber'>\n <button type='button' onClick={onButtonClick}>\n Version {version}\n </button>\n </div>\n\n {renderPopdown()}\n </>\n );\n};\n\nVersionNumber.defaultProps = {\n onClick: () => {},\n};\n\nVersionNumber.propTypes = {\n onClick: PropTypes.func,\n masterTemplateId: PropTypes.number.isRequired,\n version: PropTypes.number.isRequired,\n};\n\nexport default VersionNumber;\n","import React, { memo } from 'react';\nimport PropTypes from 'prop-types';\nimport { NavLink } from 'react-router-dom';\nimport { withRouter } from 'react-router';\n\nconst TemplateNavBar = memo((props) => {\n const activeClass = 'active';\n\n function renderOverviewLink() {\n if (props.masterTemplate.ever_published) {\n return (\n <li><NavLink\n to='/stats'\n activeClassName={activeClass}\n id='overviewtab'\n >Overview\n </NavLink>\n </li>\n );\n }\n }\n\n function renderWriteOnlyLinks() {\n if (props.permissionType === 'write') {\n return (\n <>\n <li><NavLink\n to='/edit'\n activeClassName={activeClass}\n tabIndex='1'\n >Steps\n </NavLink>\n </li>\n <li><NavLink\n to='/configuration/settings'\n activeClassName={activeClass}\n isActive={(match, location) => { return location.pathname.match(/^\\/configuration/); }}\n id='settingstab'\n tabIndex='1'\n >Settings\n </NavLink>\n </li>\n <li><NavLink\n to='/outputs'\n activeClassName={activeClass}\n isActive={(match, location) => { return location.pathname.match(/^\\/outputs/); }}\n id='formoutputstab'\n tabIndex='1'\n >Outputs\n </NavLink>\n </li>\n <li><NavLink\n to='/powerups/formulas'\n activeClassName={activeClass}\n isActive={(match, location) => { return location.pathname.match(/^\\/powerups/); }}\n tabIndex='1'\n id='powerupslink'\n >Power-Ups\n </NavLink>\n </li>\n </>\n );\n }\n }\n\n return (\n <div className='templatenavbar'>\n <div className='nav-bar'>\n <ul>\n {renderOverviewLink()}\n {renderWriteOnlyLinks()}\n <li>\n <NavLink\n to='/actions/duplicate'\n id='actionslink'\n activeClassName={activeClass}\n isActive={(match, location) => { return location.pathname.match(/^\\/actions/); }}\n >\n Actions\n </NavLink>\n </li>\n </ul>\n </div>\n </div>\n );\n});\n\nTemplateNavBar.displayName = 'TemplateNavBar';\n\nTemplateNavBar.propTypes = {\n permissionType: PropTypes.string.isRequired,\n flowTemplate: PropTypes.shape({\n id: PropTypes.number.isRequired,\n version: PropTypes.number.isRequired,\n }).isRequired,\n masterTemplate: PropTypes.object.isRequired,\n};\n\nexport default withRouter(TemplateNavBar);\n","import React, { useMemo, useState } from 'react';\nimport CopyableLink from 'components/shared/copyable-link';\nimport AutonomousPopup from 'components/shared/autonomous-popup';\nimport { publicHost } from 'modules/url-generator';\nimport PersonSelector from 'components/shared/person-selector';\nimport PropTypes from 'prop-types';\nimport InitiatedFlowActions from 'actions/initiated-flow-actions';\nimport Selection from 'components/shared/person-selection';\n\nconst LaunchOptions = (props) => {\n const linkURL = `${publicHost()}/${props.masterTemplate.team.friendly_id}/${props.masterTemplate.friendly_id}`;\n const isDisabled = props.masterTemplate.status === 'archived';\n const [applicant, setApplicant] = useState(props.applicant);\n\n const launchButtonPath = useMemo(() => {\n return `/initiated_flows/manager?flow_template_id=${props.flowTemplateId}&primary_applicant_id=${applicant?.id}`;\n }, [applicant, props.flowTemplateId]);\n\n const onApplicantUserSelect = (e) => {\n setApplicant(e);\n };\n\n const onApplicantUserRemove = () => {\n setApplicant(null);\n };\n\n const searchPerson = (search) => {\n return InitiatedFlowActions.searchApplicants(search);\n };\n\n const renderApplicant = () => {\n if (applicant) {\n return (\n <Selection\n selection={applicant}\n onRemove={onApplicantUserRemove}\n showAsCurrentUser={applicant?.id === props.applicantUser?.id}\n removeLinkText='Change'\n />\n );\n }\n return (\n <PersonSelector\n onSelect={onApplicantUserSelect}\n doSearch={searchPerson}\n allowPseudo={false}\n hideExternal={false}\n placeholder='Search people'\n attachableType='Applicant'\n personNoFoundText='Not found, the user needs to create an account first.'\n />\n );\n };\n\n const renderLauncher = () => {\n return (\n <AutonomousPopup buttonHtml='Start form' wrapperClassname='launchoptions' disabled={isDisabled} buttonClassName='btn-primary' onClose={() => { setApplicant(props.applicant); }}>\n <div className='launchoptions-public'>\n <h1>Share the link to start this form</h1>\n <CopyableLink linkURL={linkURL} />\n </div>\n <div className='launchoptions-public'>\n <h1>Start this form yourself</h1>\n <div className='launchoptions-admin cf'>\n <span className='label'>Applicant</span>\n <div className='applicantselector'>\n { renderApplicant() }\n </div>\n <a id='startworkflowbutton' href={launchButtonPath} className={`btn-primary start ${applicant ? '' : 'disabled'}`} data-method='post'>Start</a>\n </div>\n </div>\n </AutonomousPopup>\n );\n };\n\n return renderLauncher();\n};\n\nLaunchOptions.propTypes = {\n flowTemplateId: PropTypes.string.isRequired,\n masterTemplate: PropTypes.shape({\n status: PropTypes.string.isRequired,\n friendly_id: PropTypes.string.isRequired,\n team: PropTypes.shape({\n friendly_id: PropTypes.string.isRequired,\n }),\n }).isRequired,\n applicant: PropTypes.shape({\n id: PropTypes.number,\n }),\n};\nexport default LaunchOptions;\n","import PropTypes from 'prop-types';\nimport React, { useCallback, useState } from 'react';\nimport TemplateManagerActions from 'actions/template-manager-actions';\nimport EmbeddedTextInput from 'components/shared/embedded-text-input';\nimport { debounce } from 'underscore';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport UserPreferenceActions from 'actions/user-preference-actions';\n\nconst DEFAULT_NAME = 'Untitled form';\n\nconst FlowTemplateName = (props) => {\n const [isStarredForm, setIsStarredForm] = useState(props.flowTemplate.is_starred_form);\n const onNameChange = (newName) => {\n TemplateManagerActions.updateFlowTemplate(props.flowTemplate.id, {\n name: newName,\n });\n };\n\n const starForm = (id) => {\n UserPreferenceActions.starForm(id)\n .done(() => {\n setIsStarredForm(true);\n });\n };\n\n const unstarForm = (id) => {\n UserPreferenceActions.unstarForm(id)\n .done(() => {\n setIsStarredForm(false);\n });\n };\n\n const renderStarIcon = () => {\n if (isStarredForm) {\n return (\n <div className='stariconcontainer starred'>\n <FontAwesomeIcon\n icon={icon({ name: 'star', style: 'solid' })}\n onClick={() => unstarForm(props.flowTemplate.master_template_id)}\n className='staricon starred'\n size='lg'\n title='Click to unstar this form'\n />\n </div>\n );\n }\n return (\n <div className='stariconcontainer'>\n <FontAwesomeIcon\n icon={icon({ name: 'star', style: 'regular' })}\n onClick={() => starForm(props.flowTemplate.master_template_id)}\n className='staricon'\n size='lg'\n title='Click to star this form'\n />\n </div>\n );\n };\n\n return (\n <div className='viewall-container' style={{ marginTop: '1.5rem' }}>\n <EmbeddedTextInput\n defaultValue={props.flowTemplate.name}\n disabledValue={props.flowTemplate.name || DEFAULT_NAME}\n placeholder={DEFAULT_NAME}\n disabled={props.disabled}\n onChange={useCallback(debounce(onNameChange, 500), [])}\n className='templateheader-title'\n maxWidth={700}\n />\n {renderStarIcon()}\n | <a href='/workflows'>View All Forms</a>\n </div>\n );\n};\n\nFlowTemplateName.propTypes = {\n flowTemplate: PropTypes.shape({\n id: PropTypes.number.isRequired,\n name: PropTypes.string,\n master_template_id: PropTypes.number.isRequired,\n is_starred_form: PropTypes.bool.isRequired,\n }).isRequired,\n};\n\nexport default FlowTemplateName;\n","import ActionButton from 'components/shared/action-button';\nimport PropTypes from 'prop-types';\nimport React, { memo, useContext } from 'react';\nimport TemplateManagerActions from 'actions/template-manager-actions';\nimport truncate from 'truncate';\nimport UserAccessActions from 'actions/user-access-actions';\nimport VersionNumber from 'components/shared/version-number';\nimport AccessManagerDispatchContext from 'contexts/access-manager-dispatch-context';\nimport { withRouter } from 'react-router';\nimport TemplateNavBar from './template_header/template-navbar';\nimport LaunchOptions from './template_header/launch-options';\nimport FlowTemplateName from './template_header/flow-template-name';\n\nconst FlowTemplateHeader = memo((props) => {\n const dispatch = useContext(AccessManagerDispatchContext);\n const uneditable = () => {\n return props.permissionType !== 'write';\n };\n\n const onPublishClick = () => {\n return TemplateManagerActions.publish(props.flowTemplate.id)\n .done(() => props.history.push('/stats'));\n };\n\n const renderPublishButton = () => {\n return (\n <div className='templatenavbar-publish'>\n <ActionButton onClick={onPublishClick} className='btn-primary' htmlID='publish-button'>\n Publish\n </ActionButton>\n </div>\n );\n };\n\n const renderPublishOrLaunch = () => {\n const currentUser = { ...CityGrows.Server.currentUser, ...{ id: CityGrows.Server.currentUserId } };\n const renderLaunchOptions = () => {\n return (\n <LaunchOptions\n key='launchoptions'\n masterTemplate={props.masterTemplate}\n flowTemplateId={props.flowTemplate.id}\n applicant={currentUser}\n />\n );\n };\n\n if (!props.masterTemplate.ever_published) {\n return (props.permissionType === 'write') && renderPublishButton();\n }\n\n return renderLaunchOptions();\n };\n\n const onJoinTemplateClick = (e) => {\n e.preventDefault();\n UserAccessActions.addUser(CityGrows.Server.currentUserId, props.flowTemplate.master_template_id, dispatch);\n };\n\n const isTemplateMember = () => {\n return ['write', 'read'].includes(props.permissionType);\n };\n\n const renderJoinButton = () => {\n if (isTemplateMember()) { return; }\n\n return (\n <div className='templatenavbar-joinbtn margin-right-more'>\n <a onClick={onJoinTemplateClick} className='text-right' href=''>\n <i className='icon-plus-white' />\n + Join this form\n </a>\n </div>\n );\n };\n\n const { team } = props.flowTemplate;\n return (\n <div className='templateheader-wrap'>\n <div className='templateheader-leftwrap'>\n <FlowTemplateName\n flowTemplate={props.flowTemplate}\n disabled={uneditable()}\n />\n\n <TemplateNavBar\n permissionType={props.permissionType}\n flowTemplate={props.flowTemplate}\n masterTemplate={props.masterTemplate}\n />\n </div>\n\n <div className='templateheader-rightwrap'>\n {renderPublishOrLaunch()}\n {renderJoinButton()}\n\n <div className='templateheader-fragment margin-right-more'>\n <VersionNumber\n version={props.flowTemplate.version}\n masterTemplateId={props.flowTemplate.master_template_id}\n />\n\n </div>\n <div className='templateheader-fragment margin-right-more'>\n <div title={team.name}>\n <a href={`/teams/${team.friendly_id}`}>{truncate(team.name, 20)}</a>\n </div>\n </div>\n </div>\n </div>\n );\n});\n\nFlowTemplateHeader.displayName = 'FlowTemplateHeader';\n\nFlowTemplateHeader.propTypes = {\n permissionType: PropTypes.string.isRequired,\n flowTemplate: PropTypes.object.isRequired,\n masterTemplate: PropTypes.object.isRequired,\n history: PropTypes.object.isRequired,\n};\n\nexport default withRouter(FlowTemplateHeader);\n","import React, { useRef, useEffect } from 'react';\nimport {\n Chart, PieController, CategoryScale, LinearScale, Legend, Tooltip, ArcElement,\n} from 'chart.js';\n\nChart.register(PieController, CategoryScale, LinearScale, Legend, Tooltip, ArcElement);\n\nconst PieChart = (props) => {\n const chart = useRef(null);\n\n useEffect(() => {\n const options = { responsive: true, ...props.options };\n new Chart(chart.current, {\n type: 'pie',\n data: props.data,\n options,\n });\n }, []);\n\n return (\n <canvas ref={chart} id='myChart' />\n );\n};\n\nexport default PieChart;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport Pie from 'components/shared/chart/pie';\n\nconst MultipleChoiceVisualizer = ({ data }) => (\n <Pie data={data} />\n);\n\nMultipleChoiceVisualizer.propTypes = {\n data: PropTypes.object,\n};\n\nexport default MultipleChoiceVisualizer;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport 'leaflet.markercluster';\nimport 'leaflet.markercluster/dist/MarkerCluster.css';\nimport 'leaflet.markercluster/dist/MarkerCluster.Default.css';\n\nclass LocationVisualizer extends React.Component {\n constructor(props) {\n super(props);\n this.map = React.createRef();\n }\n\n componentDidMount() {\n this.map = this.initMap();\n this.renderDataToMap();\n }\n\n renderDataToMap = () => {\n if (this.props.markerData.length === 0) { return; }\n\n const markers = window.L.markerClusterGroup();\n this.props.markerData.forEach((datum) => {\n const marker = window.L.marker([datum[1], datum[0]]);\n this.addPopupContentToMarker(marker, datum);\n markers.addLayer(marker);\n });\n\n this.map.addLayer(markers);\n this.map.fitBounds(markers.getBounds());\n };\n\n addPopupContentToMarker = (marker, datum) => {\n // Note: the commas look a little weird here, but it basically says\n // \"ignore the first two things\" and keeps eslint happy.\n const [, , title, templateName, scopedId, initiatedFlowId] = datum;\n const url = (\n this.props.public\n ? `/initiated_flows/${initiatedFlowId}/summary`\n : `/initiated_flows/manager/${initiatedFlowId}`\n );\n\n marker.bindPopup(`<div class=\"map-popup-content\"><a href=${url}>#${scopedId} ${templateName}</a>${title}</div>`);\n };\n\n renderFeatureFromDatum = (datum) => {\n // Done directly from a pluck for performance reasons.\n // This is why data is an array and not an object.\n const [lon, lat, title, templateName, scopedId, initiatedFlowId] = datum;\n return {\n type: 'Feature',\n geometry: {\n type: 'Point',\n coordinates: [\n lon,\n lat,\n ],\n },\n properties: {\n title,\n templateName,\n scopedId,\n initiatedFlowId,\n },\n };\n };\n\n initMap = () => {\n return window.L.mapbox.map(this.map.current, 'mapbox.streets', {\n attributionControl: false,\n zoom: 10,\n center: [34.05, -118.2],\n });\n };\n\n render() {\n return <div className='map' ref={this.map} />;\n }\n}\n\nLocationVisualizer.propTypes = {\n public: PropTypes.bool.isRequired,\n markerData: PropTypes.array.isRequired,\n};\n\nexport default LocationVisualizer;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst MoneyVisualizer = ({ data }) => (\n <div className='tablevisualizer'>\n <table>\n <tbody>\n <tr>\n <td>\n Mean amount\n </td>\n <td>\n {data.mean}\n </td>\n </tr>\n\n <tr>\n <td>\n Median amount\n </td>\n <td>\n {data.median}\n </td>\n </tr>\n\n <tr>\n <td>\n Standard deviation\n </td>\n <td>\n {data.standard_deviation}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n);\n\nMoneyVisualizer.propTypes = {\n data: PropTypes.object,\n};\n\nexport default MoneyVisualizer;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\n// TODO: dedupe with moneyvisualizer?\nconst NumberVisualizer = ({ data }) => (\n <div className='tablevisualizer'>\n <div>\n <div>\n Mean\n </div>\n <div>\n {data.mean}\n </div>\n </div>\n\n <div>\n <div>\n Median\n </div>\n <div>\n {data.median}\n </div>\n </div>\n\n <div>\n <div>\n Standard deviation\n </div>\n <div>\n {data.standard_deviation}\n </div>\n </div>\n </div>\n);\n\nNumberVisualizer.propTypes = {\n data: PropTypes.object,\n};\n\nexport default NumberVisualizer;\n","import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport truncate from 'truncate';\n\nimport Select from 'components/shared/select';\nimport CollectedDataAPI from 'apis/collected-data-api';\nimport MultipleChoiceVisualizer from './data-visualizer/multiple-choice-visualizer';\nimport LocationVisualizer from './data-visualizer/location-visualizer';\nimport MoneyVisualizer from './data-visualizer/money-visualizer';\nimport NumberVisualizer from './data-visualizer/number-visualizer';\n\nconst TYPES_WITH_VISUALIZATION = ['address', 'multiple_choice', 'money', 'integer', 'float'];\n\nconst DataVisualizer = ({ visualizableFields, public: isPublic }) => {\n const actuallyVisualizableFields = visualizableFields.filter(\n (field) => TYPES_WITH_VISUALIZATION.includes(field.data_type),\n );\n const [selectedDatumId, setSelectedDatumId] = useState(actuallyVisualizableFields[0]?.id);\n const [data, setData] = useState();\n const [loading, setLoading] = useState(false);\n\n const activeField = visualizableFields.find(({ id }) => id === selectedDatumId);\n\n const selectedVisualizationIsSupported = (\n activeField && actuallyVisualizableFields.includes(activeField)\n );\n\n useEffect(() => {\n if (selectedVisualizationIsSupported) {\n setLoading(true);\n CollectedDataAPI.visualizationData(selectedDatumId)\n .done(setData)\n .always(() => setLoading(false));\n }\n }, [selectedDatumId, selectedVisualizationIsSupported]);\n\n const onSelectionChanged = ({ value }) => {\n setSelectedDatumId(value);\n setData(null);\n };\n\n // TODO: should this only show visualizable fields?\n const options = visualizableFields.map(({ id, section_name: sectionName, name }) => ({\n value: id,\n label: `(${truncate(sectionName, 10)}) ${name}`,\n }));\n\n const renderVisualization = () => {\n if (activeField) {\n if (loading) {\n // TODO render loading screen\n return;\n }\n\n if (!data) {\n return 'There is not currently data to visualize for this step.';\n }\n\n switch (activeField.data_type) {\n case 'address':\n return <LocationVisualizer markerData={data} public={isPublic} />;\n case 'multiple_choice':\n return <MultipleChoiceVisualizer data={data} />;\n case 'money':\n return <MoneyVisualizer data={data} />;\n case 'integer':\n return <NumberVisualizer data={data} />;\n case 'float':\n return <NumberVisualizer data={data} />;\n default:\n return 'Visualization is not supported for this field.';\n }\n }\n return 'This form does not have visualizable data';\n };\n\n return (\n <div className='datavisualizer goldenwidth'>\n <div className='cf margin-bottom'>\n <h2 className='uppercase inline-block margin-right'>Data Visualizer</h2>\n {(visualizableFields.length > 0) && (\n <label className='bold'>\n Field\n <Select\n options={options}\n title='Visualizable Field'\n onChange={onSelectionChanged}\n value={options.find(({ value }) => value === selectedDatumId)}\n placeholder='Select field to visualize...'\n // If messing with the z-index doesn't help, this might\n // work somehow in conjunction.\n // https://stackoverflow.com/questions/55830799/how-to-change-zindex-in-react-select-drowpdown\n // menuPortalTarget={document.body}\n styles={{\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n width: '100%',\n maxWidth: '420px',\n }),\n menu: (provided) => ({\n ...provided,\n // Without z-index here, the map controls\n // show up on top of the menu when the map\n // visualizer is rendered.\n // Yes, for whatever reason, leaflet decided\n // that 1000 was a reasonable z-index for those\n // controls.\n zIndex: 1001,\n }),\n }}\n />\n </label>\n )}\n </div>\n\n <div>\n {renderVisualization()}\n </div>\n </div>\n );\n};\n\nDataVisualizer.propTypes = {\n visualizableFields: PropTypes.array,\n public: PropTypes.bool,\n};\n\nexport default DataVisualizer;\n","import React, { useEffect, useRef } from 'react';\nimport {\n Chart, BarController, CategoryScale, LinearScale, BarElement,\n} from 'chart.js';\n\nChart.register(BarController, CategoryScale, LinearScale, BarElement);\n\nconst BarChart = (props) => {\n const chart = useRef(null);\n\n useEffect(() => {\n const options = { ...props.options };\n new Chart(chart.current, {\n type: 'bar',\n data: props.data,\n options,\n });\n }, []);\n\n return (\n <canvas ref={chart} id='myChart' width='1024' height='512' />\n );\n};\n\nexport default BarChart;\n","import React, { useMemo, useRef, useState } from 'react';\nimport Bar from 'components/shared/chart/bar';\nimport { isNumber } from 'underscore';\nimport Popdown from '../shared/popdown';\n\nconst OverviewStats = (props) => {\n const elForAnchor = useRef();\n const [showRevenueDetail, setShowRevenueDetail] = useState(false);\n const lowestFlowId = useMemo(() => {\n return props.stats?.revenue_digest?.lowest_revenue_info?.flow_id;\n }, [props.stats]);\n const highestFlowId = useMemo(() => {\n return props.stats?.revenue_digest?.highest_revenue_info?.flow_id;\n }, [props.stats]);\n const lowestAmount = useMemo(() => {\n return props.stats?.revenue_digest?.lowest_revenue_info?.amount;\n }, [props.stats]);\n const highestAmount = useMemo(() => {\n return props.stats?.revenue_digest?.highest_revenue_info?.amount;\n }, [props.stats]);\n const lowestProcessId = useMemo(() => {\n return props.stats?.revenue_digest?.lowest_revenue_info?.process_id;\n }, [props.stats]);\n const highestProcessId = useMemo(() => {\n return props.stats?.revenue_digest?.highest_revenue_info?.process_id;\n }, [props.stats]);\n\n const canShowRevenueRange = () => {\n return isNumber(lowestAmount) && isNumber(highestAmount);\n };\n const renderRevenueRange = () => {\n if (canShowRevenueRange()) {\n const formatter = Intl.NumberFormat('en', { style: 'currency', currency: 'USD' });\n return (\n <dl\n className='divider'\n onMouseEnter={() => setShowRevenueDetail(true)}\n onMouseLeave={() => setShowRevenueDetail(false)}\n >\n <dt>\n {formatter.format(lowestAmount / 100)} - {formatter.format(highestAmount / 100)}\n </dt>\n <dd ref={elForAnchor}>\n Revenue Range\n {showRevenueDetail && (\n <Popdown\n anchorRef={elForAnchor}\n >\n <div>\n <div className='padded'>\n Low \n <a href={`/initiated_flows/manager/${lowestFlowId}/`}>\n {formatter.format(lowestAmount / 100)} in #{lowestProcessId}\n </a>\n </div>\n </div>\n <div>\n <div className='padded'>\n High \n <a href={`/initiated_flows/manager/${lowestFlowId}/`}>\n {formatter.format(highestAmount / 100)} in #{highestProcessId}\n </a>\n </div>\n </div>\n </Popdown>\n )}\n </dd>\n </dl>\n );\n }\n return (\n <dl className='divider'>\n <dt>---</dt>\n <dd>Revenue Range</dd>\n </dl>\n );\n };\n\n return (\n <div className='overviewstats'>\n <div className='overviewstats-quick cf'>\n <dl className='divider'>\n <dt>{props.stats.last_30_days}</dt>\n <dd>Launched last 30 days</dd>\n </dl>\n\n <dl>\n <dt>{props.stats.revenue_last_30_days}</dt>\n <dd>30 day revenue</dd>\n </dl>\n\n {renderRevenueRange()}\n\n <dl>\n <dt>{props.stats.currently_open}</dt>\n <dd>Currently active</dd>\n </dl>\n\n <dl>\n <dt>{props.stats.completed}</dt>\n <dd>Completed</dd>\n </dl>\n\n <dl className='divider'>\n <dt>{props.stats.halted}</dt>\n <dd>Halted</dd>\n </dl>\n\n <dl>\n <dt>{props.stats.median_completion_time_in_words}</dt>\n <dd>Median time to complete</dd>\n </dl>\n </div>\n\n <Bar\n data={props.launchData}\n options={{\n plugins: {\n legend: {\n display: false,\n },\n },\n backgroundColor: '#597A91',\n }}\n />\n </div>\n );\n};\n\nexport default OverviewStats;\n","import React from 'react';\nimport DataVisualizer from 'components/shared/data-visualizer';\nimport SmallFlowTable from 'components/shared/small-flow-table';\nimport TemplateManagerStore from 'stores/template-manager-store';\nimport OverviewStats from './overview-stats';\n\nclass Stats extends React.Component {\n state = {\n flowTemplate: TemplateManagerStore.getFlowTemplate(),\n masterTemplate: TemplateManagerStore.getMasterTemplate(),\n };\n\n componentDidMount() {\n TemplateManagerStore.on('change', this.onTemplateChanged);\n }\n\n componentWillUnmount() {\n TemplateManagerStore.off('change', this.onTemplateChanged);\n }\n\n onTemplateChanged = () => {\n this.setState({\n flowTemplate: TemplateManagerStore.getFlowTemplate(),\n masterTemplate: TemplateManagerStore.getMasterTemplate(),\n });\n };\n\n render() {\n return (\n <div className='templatestats'>\n <div className='fixedcontainer padding-bottom-more'>\n <OverviewStats stats={this.state.flowTemplate.stats} launchData={this.state.flowTemplate.launch_data} />\n\n <div className='cf margin-top-more'>\n <div id='datavisualizer'>\n <DataVisualizer visualizableFields={this.state.flowTemplate.visualizable_fields} />\n </div>\n\n <div className='templatestats-activitytable'>\n <header className='margin-bottom'>\n <h2>Activity</h2>\n </header>\n <SmallFlowTable initiatedFlows={this.state.masterTemplate.recent_initiated_flows} />\n </div>\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default Stats;\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport TemplateManagerActions from 'actions/template-manager-actions';\nimport { CSSTransition } from 'react-transition-group';\nimport ActionButton from 'components/shared/action-button';\n\nclass UnpublishedChangesBanner extends React.Component {\n onPublishClick = () => {\n if (!this.props.show) return; // prevents clicks during transition\n\n return TemplateManagerActions.publish(this.props.flowTemplate.id)\n .done(this.props.onPublish);\n };\n\n renderPublishButton() {\n if (!this.props.disabled) {\n return (\n <div className='flowtemplatebanner-right'>\n <ActionButton onClick={this.onPublishClick} className='btn-primary' htmlID='publishchangesbutton'>\n Publish changes\n </ActionButton>\n </div>\n );\n }\n }\n\n renderBannerContents() {\n return (\n <div className='flowtemplatebanner cf'>\n <div className='flowtemplatebanner-left'>\n <p>This form has changes that are not yet live.</p>\n <p className='small'>Newly published changes will not apply to submissions that are already in progress.</p>\n </div>\n\n {this.renderPublishButton()}\n </div>\n );\n }\n\n render() {\n const { show } = this.props;\n return (\n <CSSTransition\n classNames='flowtemplatebanner'\n timeout={330}\n in={show}\n mountOnEnter\n unmountOnExit\n >\n {this.renderBannerContents()}\n </CSSTransition>\n );\n }\n}\n\nUnpublishedChangesBanner.propTypes = {\n show: PropTypes.bool,\n disabled: PropTypes.bool.isRequired,\n onPublish: PropTypes.func.isRequired,\n flowTemplate: PropTypes.shape({\n id: PropTypes.number.isRequired,\n }).isRequired,\n};\nUnpublishedChangesBanner.defaultProps = {\n show: false,\n};\n\nexport default UnpublishedChangesBanner;\n","import React, {\n lazy, Suspense, useState, useEffect, useReducer,\n} from 'react';\nimport PropTypes from 'prop-types';\nimport { Route, HashRouter } from 'react-router-dom';\nimport { Switch } from 'react-router';\nimport TemplateManagerStore from 'stores/template-manager-store';\nimport { CSSTransition } from 'react-transition-group';\nimport ErrorBoundary from 'components/shared/error-boundary';\nimport _ from 'underscore';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport NotifBanner from 'components/shared/notif-banner';\nimport TemplateManagerActions from 'actions/template-manager-actions';\nimport accessManagerReducer from 'reducers/access-manager-reducer';\nimport AccessManagerDispatchContext from 'contexts/access-manager-dispatch-context';\nimport FlowTemplateHeader from './edit_flow/flow-template-header';\nimport Stats from './flow_data/stats';\nimport UnpublishedChangesBanner from './template_manager/unpublished-changes-banner';\nimport PrimaryTabs from './shared/primary-tabs';\n\nconst FlowStepManager = lazy(() => { return import('./edit_flow/flow-step-manager'); });\nconst Outputs = lazy(() => { return import('./edit_flow/outputs'); });\nconst Configuration = lazy(() => { return import('./edit_flow/configuration'); });\nconst Modules = lazy(() => { return import('./edit_flow/modules'); });\nconst Actions = lazy(() => { return import('./edit_flow/actions'); });\n\nconst SUSPENSE_HTML = (\n <div className='workflowconfig-progresswrap'>\n <LoadingSpinner size='large' />\n </div>\n);\n\nconst TemplateManager = (props) => {\n const initialFlowTemplate = TemplateManagerStore.getFlowTemplate();\n const initialMasterTemplate = TemplateManagerStore.getMasterTemplate();\n const [flowTemplate, setFlowTemplate] = useState(initialFlowTemplate);\n const [masterTemplate, setMasterTemplate] = useState(initialMasterTemplate);\n const [showBanner, setShowBanner] = useState(shouldShowBanner(initialFlowTemplate, initialMasterTemplate));\n\n useEffect(() => {\n TemplateManagerActions.loadModificationStatus(flowTemplate.master_template_id);\n TemplateManagerStore.on('change', onTemplateChanged);\n\n if (props.location.pathname === '/') {\n // redirect if not on any child route\n redirectToDefaultPath();\n }\n }, [flowTemplate.master_template_id]);\n\n const [accessManagerState, accessManagerDispatch] = useReducer(\n accessManagerReducer,\n {\n memberUsers: props.userAccessData.masterTemplate.memberships,\n authorityUsers: props.userAccessData.masterTemplate.authorities,\n },\n );\n\n function permissionType() {\n const membership = _.findWhere(accessManagerState.memberUsers, { user_id: CityGrows.Server.currentUserId });\n if (!membership) { return; }\n\n if (membership.permission_level_id === 2) {\n return 'write';\n }\n\n return 'read';\n }\n\n function isReadOnly() {\n return permissionType() === 'read';\n }\n\n function isArchived() {\n return masterTemplate.status === 'archived';\n }\n\n function redirectToDefaultPath() {\n // default to stats path if not first unpublished version\n\n const path = flowTemplate.version === 1 ? '/edit' : '/stats';\n props.history.replace(path);\n }\n\n function onTemplateChanged() {\n const newFlowTemplate = TemplateManagerStore.getFlowTemplate();\n const newMasterTemplate = TemplateManagerStore.getMasterTemplate();\n setFlowTemplate(newFlowTemplate);\n setMasterTemplate(newMasterTemplate);\n setShowBanner(shouldShowBanner(newFlowTemplate, newMasterTemplate));\n }\n\n function onPublish() {\n setShowBanner(false);\n props.history.push('/stats');\n }\n\n function shouldShowBanner(ft, mt) {\n return ft.is_modified\n && ft.version > 1\n && mt.status !== 'archived';\n }\n\n function renderFlowStepManager(routerProps) {\n if (isReadOnly()) {\n props.history.replace('/stats');\n return;\n }\n\n return (\n <Suspense fallback={SUSPENSE_HTML}>\n <FlowStepManager\n disabled={permissionType() !== 'write'}\n allowedStepDatumTypes={props.allowedStepDatumTypes}\n {...routerProps}\n />\n </Suspense>\n );\n }\n\n function renderConfiguration(routerProps) {\n if (isReadOnly()) {\n props.history.replace('/stats');\n return;\n }\n\n return (\n <Suspense fallback={SUSPENSE_HTML}>\n <Configuration\n masterTemplate={masterTemplate}\n permissionType={permissionType()}\n flowTemplate={flowTemplate}\n accessManagerState={accessManagerState}\n permissionLevels={props.userAccessData.permissionLevels}\n {...routerProps}\n />\n </Suspense>\n );\n }\n\n function renderOutputs() {\n return (\n <Suspense fallback={SUSPENSE_HTML}>\n <Outputs\n flowTemplate={flowTemplate}\n masterTemplate={masterTemplate}\n />\n </Suspense>\n );\n }\n\n function renderModules(routerProps) {\n if (isReadOnly()) {\n props.history.replace('/stats');\n return;\n }\n\n return (\n <Suspense fallback={SUSPENSE_HTML}>\n <Modules flowTemplate={flowTemplate} masterTemplate={masterTemplate} {...routerProps} />\n </Suspense>\n );\n }\n\n function renderActions(routerProps) {\n if (isReadOnly() && routerProps.location.pathname !== '/actions/export') {\n props.history.replace('/stats');\n return;\n }\n\n return (\n <Suspense fallback={SUSPENSE_HTML}>\n <Actions\n flowTemplate={flowTemplate}\n masterTemplate={masterTemplate}\n myTeams={props.myTeams}\n {...routerProps}\n />\n </Suspense>\n );\n }\n\n const hasNotifs = () => {\n return !!renderNotification();\n };\n\n function renderNotification() {\n let banner = null;\n if (isArchived()) {\n banner = renderArchivedNotif();\n } else if (isReadOnly() && flowTemplate.version === 1) {\n banner = renderReadOnlyNotif();\n } else if (paymentsDisabled() && masterTemplate.ever_published) {\n banner = renderDisabledPaymentNotif();\n }\n\n if (!banner) { return; }\n\n return banner;\n }\n\n function renderDisabledPaymentNotif() {\n return (\n <CSSTransition\n classNames='fullwidthnotif'\n timeout={330}\n in={paymentsDisabled() && masterTemplate.ever_published}\n mountOnEnter\n unmountOnExit\n >\n <NotifBanner style='warning'>\n <i className='icon-exclaim margin-right-less' />\n <span>This form's payment step(s) cannot accept charges. To enable, add a payout account </span>\n <a href={`/teams/${flowTemplate.team.friendly_id}/merchant_accounts`}>here</a>\n </NotifBanner>\n </CSSTransition>\n );\n }\n\n function renderReadOnlyNotif() {\n return (\n <CSSTransition\n classNames='fullwidthnotif'\n timeout={330}\n in={isReadOnly() && flowTemplate.version === 1}\n mountOnEnter\n unmountOnExit\n >\n <NotifBanner style='warning'>\n <i className='icon-exclaim margin-right-less' />\n This form is read only. To edit, a team member will need to modify your permissions.\n </NotifBanner>\n </CSSTransition>\n );\n }\n\n function renderArchivedNotif() {\n return (\n <CSSTransition\n classNames='fullwidthnotif'\n timeout={330}\n in={isArchived()}\n mountOnEnter\n unmountOnExit\n >\n <NotifBanner style='warning'>\n <i className='icon-exclaim margin-right-less' />\n This form has been archived.\n </NotifBanner>\n </CSSTransition>\n );\n }\n\n function paymentsDisabled() {\n return flowTemplate.has_payment_step && !flowTemplate.team.charges_enabled;\n }\n\n function renderTabContent() {\n if (_.isUndefined(flowTemplate.is_modified)) {\n return SUSPENSE_HTML;\n }\n\n return (\n <Switch>\n <Route path='/edit' render={renderFlowStepManager} />\n <Route path='/stats' component={Stats} />\n <Route path='/configuration' render={renderConfiguration} />\n <Route path='/outputs' render={renderOutputs} />\n <Route path='/powerups' render={renderModules} />\n <Route path='/actions' render={renderActions} />\n </Switch>\n );\n }\n\n return (\n <AccessManagerDispatchContext.Provider value={accessManagerDispatch}>\n {renderNotification()}\n\n <UnpublishedChangesBanner\n flowTemplate={flowTemplate}\n disabled={permissionType() !== 'write'}\n onPublish={onPublish}\n show={showBanner}\n />\n\n <FlowTemplateHeader\n permissionType={permissionType()}\n flowTemplate={flowTemplate}\n masterTemplate={masterTemplate}\n />\n\n {renderTabContent()}\n <div id='sidemenusetting' />\n </AccessManagerDispatchContext.Provider>\n );\n};\n\nTemplateManager.propTypes = {\n history: PropTypes.object,\n location: PropTypes.object,\n allowedStepDatumTypes: PropTypes.array,\n myTeams: PropTypes.array,\n};\n\nconst TemplateManagerRouter = (props) => {\n const renderer = (routerProps) => {\n return (\n <ErrorBoundary>\n <div className='margins flexcolumn'>\n <PrimaryTabs />\n <div id='tabheader-body' className='workfloweditor'>\n <TemplateManager\n {...routerProps}\n {...props}\n />\n </div>\n </div>\n </ErrorBoundary>\n );\n };\n\n return (\n <HashRouter>\n <Route path='/' render={renderer} />\n </HashRouter>\n );\n};\n\nexport default TemplateManagerRouter;\n","import React from 'react';\nimport renderer from 'modules/renderer';\n\nimport 'select2';\n\nimport CommonProviders from 'components/common-providers';\nimport { pollForLogin } from 'modules/poll-for-login';\nimport FormsList from 'components/forms-container/forms-list';\nimport TemplateManager from '../components/template-manager';\nimport TemplateManagerActions from '../actions/template-manager-actions';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nconst index = () => {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n renderer(\n (\n <CommonProviders>\n <FormsList\n teamFriendlyId={CityGrows.Server.team.friendly_id}\n starredFormIds={CityGrows.Server.starredFormIds}\n masterTemplates={CityGrows.Server.masterTemplates}\n enableFormCreation={CityGrows.Server.enableFormCreation}\n />\n </CommonProviders>\n ), document.getElementById('formscontainer'),\n );\n\n $('select').select2({\n minimumResultsForSearch: -1,\n width: 'style',\n });\n\n $('#templateselect').change((e) => {\n document.location = `?status=${e.currentTarget.value}`;\n });\n};\n\nconst show = () => {\n Offline.options = { requests: false };\n initStore();\n initTemplateManager();\n pollForLogin();\n};\n\nfunction initStore() {\n TemplateManagerActions.setFlowTemplate(CityGrows.Server.initialFlowTemplateData);\n TemplateManagerActions.dispatchMasterTemplateLoaded(CityGrows.Server.initialMasterTemplateData);\n}\n\nfunction initTemplateManager() {\n renderer(\n <CommonProviders>\n <TemplateManager\n userAccessData={CityGrows.Server.userAccessData}\n allowedStepDatumTypes={CityGrows.Server.allowedStepDatumTypes}\n myTeams={CityGrows.Server.myTeams}\n />\n </CommonProviders>, document.getElementById('templatemanager'),\n );\n}\n\nexport default {\n show,\n index,\n};\n","import React, { useState } from 'react';\nimport Select from 'components/shared/select';\nimport ProcessorActions from 'actions/processor-actions';\nimport { findWhere, reject, contains } from 'underscore';\nimport FinanceSubnav from './shared/finance-subnav';\n\nconst DEFAULT_PROCESSOR_OPTIONS = [\n { label: 'Third party', value: 'third_party' },\n];\n\nconst MerchantAccountsManager = ({ processors, teamId, teamSlug }) => {\n const [processor, setProcessor] = useState(findActiveProcessor);\n const [addingNew, setAddingNew] = useState(false);\n const [newProcessor, setNewProcessor] = useState(null);\n\n function findActiveProcessor() {\n const prcssr = findWhere(processors, { active: true });\n if (!prcssr) { return { id: null, processor: 'stripe' }; }\n\n return prcssr;\n }\n\n function findProcessor(id) {\n const prcssr = findWhere(processors, { id });\n\n return prcssr;\n }\n\n function onNewProcessorChange({ value }) {\n setNewProcessor({ processor: value });\n }\n\n function onProcessorChange({ value }) {\n setProcessor(findProcessor(value));\n ProcessorActions.setProcessor(value, teamId);\n }\n\n function createProcessor() {\n ProcessorActions.createProcessor(newProcessor, teamId);\n }\n\n function onProcessorDataChange(value, key) {\n setNewProcessor({ ...newProcessor, [key]: value });\n }\n\n function processorOptions() {\n const processorOpts = processors.map((p) => { return { label: p.processor, value: p.id }; });\n\n return [{ label: 'Stripe', value: null }, ...processorOpts];\n }\n\n function newProcessorOptions() {\n const processorValues = processors.map((p) => { return p.processor; });\n return reject(DEFAULT_PROCESSOR_OPTIONS, (p) => { return contains(processorValues, p.value); });\n }\n\n function thirdPartyDetails() {\n return (\n <div>\n <label>\n API key\n <input type='text' disabled={!addingNew} value={processor.api_key} onChange={(e) => { onProcessorDataChange(e.currentTarget.value, 'api_key'); }} />\n </label>\n {addingNew && renderSubmitButton()}\n </div>\n );\n }\n\n function renderSubmitButton() {\n return <button onClick={createProcessor}>Save Processor</button>;\n }\n\n function renderStripeContent() {\n return (\n <div>\n This account is using Stripe, the default payment processor for ClearForms.\n <br />\n To use an alternate third party processor, first add a new processor. You will then be able to set it as your processor.\n <br />\n <strong>Note:</strong> Using a processor other than Stripe will disable the transaction reporting features of ClearGov.\n </div>\n );\n }\n\n function renderProcessorContent() {\n switch (processor.processor) {\n case 'third_party':\n return thirdPartyDetails();\n case 'stripe':\n return renderStripeContent();\n }\n }\n\n function newProcessorSelect() {\n if (newProcessorOptions().length === 0) {\n return <div>All available processors have been created.</div>;\n }\n\n return (\n <label>\n Processor\n <Select\n options={newProcessorOptions()}\n onChange={onNewProcessorChange}\n />\n </label>\n );\n }\n\n function renderMainContent() {\n if (addingNew) {\n return (\n <div>\n <button className='btn-link' type='button' onClick={() => setAddingNew(false)}>{'< Back'}</button>\n <h2>New Processor</h2>\n {newProcessorSelect()}\n\n {newProcessor && renderProcessorDetails()}\n </div>\n );\n }\n\n return (\n <div>\n <h2 className='inline-block nomargin-bottom'>Payment Processors</h2>\n <button className='btn-link strong float-right' onClick={() => setAddingNew(true)}>+ Add New Processor</button>\n <label>\n Active Payment Processor\n <Select\n value={processorOptions().find(({ value }) => value === processor.id)}\n options={processorOptions()}\n onChange={onProcessorChange}\n disabled={processors.length === 0}\n />\n </label>\n\n {renderProcessorContent()}\n\n </div>\n );\n }\n\n return (\n <div className='finance-container'>\n <div id='finance-left-nav'>\n <FinanceSubnav teamSlug={teamSlug} activeLink='manage' />\n </div>\n <div className='finance-main'>\n <div className='minimalcontentcontainer'>\n {renderMainContent()}\n </div>\n </div>\n </div>\n );\n};\n\nexport default MerchantAccountsManager;\n","import _ from 'underscore';\n\nimport 'select2';\nimport renderer from 'modules/renderer';\nimport CommonProviders from 'components/common-providers';\nimport MerchantAccountsManager from 'components/merchant-accounts-manager';\nimport FinanceSubnav from '../components/shared/finance-subnav';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nfunction hideAllExtraFields() {\n const allExtraFields = ['#weeklyanchor', '#monthlyanchor'];\n\n _.each(allExtraFields, (id) => {\n $(id).hide();\n });\n}\n\nfunction showExtraFields(schedule) {\n hideAllExtraFields();\n\n switch (schedule) {\n case 'daily':\n // No extra fields\n break;\n case 'weekly':\n $('#weeklyanchor').show();\n break;\n case 'monthly':\n $('#monthlyanchor').show();\n break;\n default:\n break;\n }\n}\n\nfunction manage() {\n renderer(\n (\n <CommonProviders>\n <MerchantAccountsManager processors={[]}\n teamId={CityGrows.Server.team.id}\n teamSlug={CityGrows.Server.team.slug}\n currentUserId={CityGrows.Server.currentUserId}/>\n </CommonProviders>\n ), document.getElementById('merchant_accounts_manager'),\n );\n}\n\nconst index = () => {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n $('select').select2();\n\n $('#payoutschedule').on('change', (e) => {\n showExtraFields(e.currentTarget.value);\n });\n\n $('#payoutschedule').trigger('change', $('#payoutschedule').val());\n\n renderer(\n (\n <FinanceSubnav teamSlug={CityGrows.Server.team.slug} activeLink='payouts'/>\n ), document.getElementById('finance-left-nav')\n )\n};\n\nexport default {\n index,\n};\n","import React from 'react';\n\nconst DataBox = ({number, label, children}) => {\n return (\n <div className='metricsdashboard-databox'>\n <h2 className='bold padding-top'>\n {label}\n </h2>\n <p className='metricsdashboard-number'>{number}</p>\n {children}\n </div>\n );\n};\n\nexport default DataBox;\n","import React from 'react';\nimport DataBox from 'components/metrics_dashboard/data-box';\n\nconst TopRow = ({formData}) => {\n function renderPercentage(numerator) {\n const percentage = (numerator / formData.launched_count ) * 100;\n const integer = formData.launched_count === 0 ? 0 : Math.round(percentage);\n\n return (\n <div className='inline-block margin-left-less'>\n <span className='percentage'>{`${integer}%`}</span>\n <p>of Submissions</p>\n </div>\n );\n }\n\n return (\n <div className='metricsdashboard-toprow'>\n <DataBox label='Launched' number={formData.launched_count} />\n <DataBox label='Completed' number={formData.completed_count}>\n {renderPercentage(formData.completed_count)}\n </DataBox>\n <DataBox label='Active' number={formData.active_count} >\n {renderPercentage(formData.active_count)}\n </DataBox>\n <DataBox label='Overdue' number={formData.overdue_count} >\n {renderPercentage(formData.overdue_count)}\n </DataBox>\n </div>\n );\n};\n\nexport default TopRow;\n","import React, { useRef, useEffect } from 'react';\nimport {\n Chart, DoughnutController, CategoryScale, LinearScale, Legend, Tooltip, ArcElement,\n} from 'chart.js';\n\nChart.register(DoughnutController, CategoryScale, LinearScale, Legend, Tooltip, ArcElement);\n\nconst DonutChart = (props) => {\n const chart = useRef(null);\n\n useEffect(() => {\n const options = { responsive: true, ...props.options };\n new Chart(chart.current, {\n type: 'doughnut',\n data: props.data,\n options,\n });\n }, []);\n\n return (\n <canvas ref={chart} id='myChart' />\n );\n};\n\nexport default DonutChart;\n","const COLORS = [\n '#2797FA',\n '#74A943',\n '#FB8E28',\n '#714FB6',\n '#FDC33C',\n '#034885',\n '#00ABB6',\n '#CF1C9D',\n '#C6C613',\n '#B1B2FF',\n '#FC876D',\n '#1E6E00',\n '#B9702C',\n '#53625D',\n '#7BE0F1',\n '#0463B7',\n '#7BC0FF',\n '#FD73C6',\n '#2654C9',\n '#90A1A9',\n '#008C95',\n '#FCB878',\n '#EF3477',\n '#8F5332',\n];\n\nexport default COLORS;\n","import React from 'react';\nimport DonutSvg from '/app/assets/images/personnel-costs-disabled-chart.svg';\nimport VChartSvg from '/app/assets/images/funds-disabled-chart.svg';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { solid } from '@fortawesome/fontawesome-svg-core/import.macro';\n\nconst NoDataPlaceholder = (props) => {\n function renderImg() {\n switch(props.type) {\n case 'donut':\n return <img src={DonutSvg} />\n case 'vertical-chart':\n return <img src={VChartSvg} />\n }\n }\n\n return (\n <div>\n {renderImg()}\n <div class=\"flexcolumn align-center text-semialert padding-top-less\">\n <FontAwesomeIcon icon={solid(\"circle-exclamation\")} size='xl' style={{color: \"#fb8e28\",}} />\n <div className='italic bold'>No data available yet</div>\n </div>\n </div>\n );\n}\n\nexport default NoDataPlaceholder;","import React, { useState, useEffect} from 'react';\nimport DonutChart from '../shared/chart/donut';\nimport BarChart from 'components/shared/chart/bar';\nimport COLORS from 'constants/chart-colors';\nimport NoDataPlaceholder from '../shared/no-data-placeholder';\n\nconst SecondRow = ({formData}) => {\n const [fLabels, setFLabels] = useState([]);\n const [fValues, setFValues] = useState([]);\n const [oLabels, setOLabels] = useState([]);\n const [oValues, setOValues] = useState([]);\n\n useEffect(() => {\n const [fData, fLabels] = parseData(formData.forms_chart_data)\n const [oData, oLabels] = parseData(formData.outputs_chart_data)\n\n setFLabels(fData);\n setFValues(fLabels);\n setOLabels(oData);\n setOValues(oLabels);\n }, [])\n\n\n function parseData(data) {\n let lbls = [];\n let vls = [];\n let otherTotal = 0;\n\n const topFive = data.slice(0,5);\n const other = data.slice(5);\n\n topFive.map((datum) => {\n lbls = [...lbls, ...Object.keys(datum)];\n vls = [...vls, ...Object.values(datum)];\n })\n\n other.map((datum) => {\n const num = Object.values(datum)[0];\n otherTotal += num;\n });\n\n lbls = [...lbls, 'Other'];\n vls = [...vls, otherTotal];\n\n return [lbls, vls]\n }\n\n const colors = COLORS.slice(0,6);\n\n function percentage(numerator) {\n const percentage = (numerator / formData.launched_count) * 100;\n return Math.round(percentage);\n }\n\n function renderLegend() {\n return fLabels.map((label, index) => {\n return (\n <li>\n <span className='dot' style={{backgroundColor: colors[index]}}/>\n <span>{label}</span>\n <span className='percentage'><strong>{`${fValues[index]}`}</strong>{` (${percentage(fValues[index])}%)`}</span>\n </li>\n );\n });\n }\n\n function renderFormSubmissionChart() {\n if (fValues.length === 0) { return null; }\n\n return (\n <div className='chart'>\n <h2 className='align-center'>Submissions Breakdown</h2>\n {renderChart()}\n </div>\n )\n }\n\n function renderChart() {\n if (fValues.length === 1) { \n return <NoDataPlaceholder type='donut' />}\n\n const data = {\n fLabels,\n datasets: [{\n data: fValues,\n backgroundColor: colors,\n }],\n }\n\n return (\n <div className='flex'>\n <div className='piechart'>\n <DonutChart data={data} options={{plugins: {legend: {display: false}}}} />\n </div>\n <div className='pielegend'>\n <ul>\n {renderLegend()}\n </ul>\n </div>\n </div>\n )\n }\n\n function renderOutputChart() {\n if ( oValues.length === 0) { return null;}\n\n const dta = {\n labels: oLabels.slice(0,5),\n datasets: [{\n indexAxis: 'y',\n data: oValues.slice(0,5),\n backgroundColor: colors.slice(0,5)\n }]\n }\n return (\n <div className='chart'>\n <h2 className='align-center'>Top 5 Issued Outputs by Type</h2>\n <div className='barchart'>\n <BarChart data={dta} \n options={{\n plugins: {\n legend: { display: false },\n },}}/>\n </div>\n </div>\n )\n\n }\n\n return (\n <div className='metricsdashboard-secondrow'>\n {renderFormSubmissionChart()}\n {renderOutputChart()}\n </div>\n )\n}\n\nexport default SecondRow;\n","import React, { useState } from 'react';\nimport Select from '../shared/select';\nimport DateSelector from '../shared/date-selector';\nimport { css } from '@emotion/react';\n\nconst Filters = ({ formsArray, teamsArray, applyFilters }) => {\n const [teams, setTeams] = useState(['all']);\n const [forms, setForms] = useState(['all']);\n const [startDate, setStartDate] = useState('');\n const [endDate, setEndDate] = useState('');\n\n const teamsDataForSelect = [\n { value: 'all', label: 'All teams' },\n ...teamsArray.map(({ id, name }) => ({\n value: id,\n label: name,\n })),\n ];\n\n function formDataForSelect() {\n let frms = formsArray;\n\n if (!teams.includes('all')) {\n frms = formsArray.filter((form) => {\n return teams.includes(form.teamId);\n });\n }\n\n return [\n { value: 'all', label: 'All forms' },\n ...frms.map(({ master_template_id: id, name_or_default: name }) => ({\n value: id,\n label: name,\n })),\n ];\n }\n\n function onFormsChange(newForms) {\n let fms = [];\n newForms.every((form) => {\n if (form.value === 'all' && !forms.includes('all')) {\n fms = ['all'];\n return false;\n }\n\n if (form.value !== 'all') {\n fms = [...fms, Number(form.value)];\n return true;\n }\n\n return true;\n });\n setForms(fms);\n }\n\n function onTeamsChange(newTeams) {\n let tms = [];\n newTeams.every((team) => {\n if (team.value === 'all' && !teams.includes('all')) {\n tms = ['all'];\n return false;\n }\n\n if (team.value !== 'all') {\n tms = [...tms, Number(team.value)];\n return true;\n }\n\n return true;\n });\n setTeams(tms);\n }\n\n function onDateChange(type, date) {\n if (type === 'start') {\n return setStartDate(date);\n }\n\n if (type === 'end') {\n return setEndDate(date);\n }\n }\n\n function onFilterApply() {\n const tms = teams.includes('all') ? [] : teams;\n const template_ids = forms.includes('all') ? [] : forms;\n const filters = {\n launched_from: startDate,\n launched_to: endDate,\n team_id: tms,\n template_ids,\n };\n\n applyFilters(filters);\n }\n\n return (\n <div\n className='padded border-bottom sticky'\n css={css`\n position:sticky;\n top:-1rem;\n background-color:#fff;\n `}\n >\n <div className='metricsdashboard-filterlabel bold'>Filter</div>\n <div className='metricsdashboard-filterselect wide-25'>\n <Select\n options={teamsDataForSelect}\n isMulti\n onChange={onTeamsChange}\n value={teamsDataForSelect.filter(({ value }) => teams.includes(value))}\n className='react-select-metrics padding-top'\n />\n </div>\n <div className='metricsdashboard-filterselect wide-25'>\n <Select\n options={formDataForSelect()}\n isMulti\n value={formDataForSelect().filter(({ value }) => forms.includes(value))}\n onChange={onFormsChange}\n className='react-select-metrics padding-top'\n />\n </div>\n <div className='metricsdashboard-datepicker padding-left'>\n <DateSelector\n value={startDate}\n onDateChange={(e) => { onDateChange('start', e); }}\n type='date'\n placeholderText='From'\n withPortal={false}\n />\n </div>\n <span className='padding-left-less padding-right-less'>to</span>\n <div className='metricsdashboard-datepicker padding-right'>\n <DateSelector\n value={endDate}\n onDateChange={(e) => { onDateChange('end', e); }}\n type='date'\n placeholderText='To'\n withPortal={false}\n />\n </div>\n <button className='btn-primary' onClick={onFilterApply}>Apply Filter</button>\n </div>\n );\n};\n\nexport default Filters;\n","import React from 'react';\nimport DataBox from '../data-box';\n\nconst TopRow = ({transactionData}) => {\n function formattedNumber(number) {\n return Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(number)\n }\n\n return (\n <div className='metricsdashboard-toprow border-top'>\n <DataBox label='Total Revenue Collected' number={`${formattedNumber(transactionData.total_revenue)}`}>\n <div>Excludes cash and checks</div>\n </DataBox>\n <DataBox label='Renewal Revenue' number={`${formattedNumber(transactionData.renewal_revenue)}`}/>\n <DataBox label='Refunded' number={`${formattedNumber(transactionData.total_refunded)}`}/>\n <DataBox label='Disputes' number={`${formattedNumber(transactionData.total_disputed)}`}/>\n </div>\n );\n};\n\nexport default TopRow;\n","import React from 'react';\nimport BarChart from 'components/shared/chart/bar';\nimport DonutChart from 'components/shared/chart/donut';\nimport COLORS from 'constants/chart-colors';\nimport NoDataPlaceholder from '../../shared/no-data-placeholder';\n\nconst SecondRow = (props) => {\n function renderChargesChart() {\n const labels = Object.keys(props.transactionData.charges);\n const data = Object.values(props.transactionData.charges).map((charge) => { return charge / 100});\n\n const dta = {\n labels,\n datasets: [{\n indexAxis: 'x',\n data,\n backgroundColor: [COLORS[1]],\n }],\n };\n\n const maxLimit = props.transactionData.max_charge * 1.1\n\n return (\n <div className='chart'>\n <h2 className='align-center'>Revenue Collected</h2>\n <div className='barchart'>\n <BarChart\n data={dta}\n options={{\n plugins: {\n legend: { display: false },\n },\n scales: {\n y: {\n suggestedMax: maxLimit,\n ticks: {\n callback(label, _index, _ticks) {\n return `$${label}`;\n },\n },\n },\n },\n }}\n />\n </div>\n </div>\n );\n }\n\n function noData() {\n const total = props.transactionData.by_type.card + props.transactionData.by_type.ACH\n\n return total === 0;\n }\n\n function percentage(numerator) {\n const total = props.transactionData.by_type.card + props.transactionData.by_type.ACH\n\n if (noData()) { return (0); }\n\n const prcntge = (numerator / total) * 100;\n return Math.round(prcntge);\n }\n\n function renderLegend() {\n const values = Object.values(props.transactionData.by_type)\n return ['Card', 'ACH'].map((label, index) => {\n return (\n <li>\n <span className='dot' style={{backgroundColor: COLORS[index]}}/>\n <span>{label}</span>\n <span className='percentage'><strong>{`${values[index]}`}</strong>{` (${percentage(values[index])}%)`}</span>\n </li>\n );\n });\n }\n\n function renderChart() {\n if (noData()) { return <NoDataPlaceholder type='donut' />; }\n\n const data = {\n labels: Object.keys(props.transactionData.by_type),\n datasets: [{\n data: Object.values(props.transactionData.by_type),\n backgroundColor: COLORS.slice(0,2)\n }]\n }\n\n return (\n <div className='piechart'>\n <DonutChart \n data={data} \n options={{plugins: {legend: {display: false}}}}\n />\n <div className='pielegend'>\n <ul>\n {renderLegend()}\n </ul>\n </div>\n </div>\n )\n\n }\n\n function renderDonutChart() {\n return (\n <div className='chart'>\n <h2 className='align-center'>Revenue by Payment Type</h2>\n <div className='flex'/>\n {renderChart()}\n </div>\n )\n }\n\n return (\n <div className='metricsdashboard-finances-secondrow'>\n {renderChargesChart()}\n {renderDonutChart()}\n </div>\n );\n};\n\nexport default SecondRow;\n","import React from 'react';\nimport TopRow from 'components/metrics_dashboard/finances/top-row';\nimport SecondRow from 'components/metrics_dashboard/finances/second-row';\n\nconst Finances = ({transactionData}) => {\n return (\n <div>\n <TopRow transactionData={transactionData} />\n <SecondRow transactionData={transactionData} />\n </div>\n )\n}\n\nexport default Finances;\n","const MetricsDashboardAPI = {\n fetchData(data) {\n return $.ajax('/metrics/fetch_data', {\n dataType: 'JSON',\n method: 'GET',\n data,\n });\n },\n};\n\nexport default MetricsDashboardAPI;\n","import React, {useRef, useEffect, useState} from 'react'; \nimport { Table, Column, Cell } from 'fixed-data-table-2';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport DashboardCell from 'components/dashboard/dashboard-cell';\nimport DashboardActions from 'actions/dashboard-actions';\nimport { debounce } from 'underscore';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\n\nconst SubmissionsTable = ({initiatedFlows, totalCount, loading}) => {\n const dashboardElement = useRef();\n\n const [tableWidth, setTableWidth] = useState(0);\n const [tableHeight, setTableHeight] = useState(0);\n\n const onResize = debounce(() => {\n setTableHeight(contentHeight);\n setTableWidth(contentWidth);\n }, 100);\n\n useEffect(() => {\n window.addEventListener('resize', onResize);\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [onResize]);\n\n useEffect(() => {\n onResize();\n }, [totalCount, onResize]);\n\n function dashboardHasContent() {\n return (initiatedFlows !== null\n && initiatedFlows.length > 0);\n }\n\n function isLoading() {\n return initiatedFlows === null;\n }\n\n function onFlowBoxClick() {\n return null\n }\n\n function buildCell(cellName, columnAttrs) {\n const initiatedFlow = initiatedFlows[columnAttrs.rowIndex];\n\n if (!initiatedFlow) {\n DashboardActions.nullCellRequested(columnAttrs.rowIndex);\n return (\n <Cell key='dashboardloadingcell'>\n <div className='dashboard-loadingcell' />\n </Cell>\n );\n }\n\n return (\n <DashboardCell\n item={initiatedFlow}\n cellName={cellName}\n onFlowBoxClick={onFlowBoxClick}\n />\n );\n }\n\n function contentWidth() {\n return dashboardElement.current.offsetWidth;\n }\n\n function contentHeight() {\n return dashboardElement.current.offsetHeight - 95;\n }\n\n function renderContent() {\n if (isLoading()) {\n return (\n <div className='dashboard-loading'>\n <LoadingSpinner size='large' />\n </div>\n );\n }\n\n return (\n <Table\n rowsCount={totalCount}\n rowHeight={50}\n headerHeight={35}\n width={tableWidth}\n height={535}\n >\n <Column\n header={<Cell>ID</Cell>}\n cell={(columnAttrs) => {\n return buildCell('id', columnAttrs);\n }}\n width={75}\n cellClassName='dashboard-processid'\n />\n\n <Column\n header={<Cell>Form Name</Cell>}\n cell={(columnAttrs) => {\n return buildCell('template_name', columnAttrs);\n }}\n width={225}\n flexGrow={1}\n />\n\n <Column\n header={<Cell>Assignees</Cell>}\n cell={(columnAttrs) => {\n return buildCell('responsible', columnAttrs);\n }}\n width={100}\n flexGrow={1}\n />\n\n <Column\n header={<Cell>Applicant</Cell>}\n cell={(columnAttrs) => {\n return buildCell('applicant', columnAttrs);\n }}\n width={200}\n flexGrow={1}\n />\n\n <Column\n header={<Cell>Action</Cell>}\n cell={(columnAttrs) => {\n return buildCell('action', columnAttrs);\n }}\n width={150}\n flexGrow={1}\n />\n\n <Column\n header={<Cell>Created</Cell>}\n cell={(columnAttrs) => {\n return buildCell('launched_at', columnAttrs);\n }}\n width={100}\n flexGrow={1}\n />\n\n <Column\n header={<Cell>Last Edited</Cell>}\n cell={(columnAttrs) => {\n return buildCell('last_edited', columnAttrs);\n }}\n width={100}\n flexGrow={1}\n />\n\n </Table>\n );\n }\n\n return (\n <div className='dashboard'>\n <div className='dashboard-maincontent'>\n <div className='dashboard-actionbar cf'>\n <div className='left'>\n <h1>Submissions Needing Attention</h1>\n </div>\n <div className='right'>\n <ul>\n <li>\n <a href='/dashboard' className='metricsdashboard-submissionslink'>\n <FontAwesomeIcon icon={icon({ name: 'list' })} />\n <span className='inline'>View all Submissions</span>\n </a>\n </li>\n </ul>\n </div>\n </div>\n\n <div ref={dashboardElement} className='dashboard-maincontent-rowwrap overflow-x-auto'>\n {renderContent()}\n </div>\n </div>\n </div>\n )\n};\n\nexport default SubmissionsTable;","import React, { useState, useEffect } from 'react';\nimport TopRow from 'components/metrics_dashboard/top-row';\nimport SecondRow from 'components/metrics_dashboard/second-row';\nimport Filters from 'components/metrics_dashboard/filters';\nimport Finances from 'components/metrics_dashboard/finances';\nimport MetricsDashboardAPI from 'apis/metrics-dashboard-api';\nimport DashboardAPI from 'apis/dashboard-api';\nimport SubmissionsTable from 'components/metrics_dashboard/submissions-table';\nimport PollableJob from 'modules/pollable-job';\nimport LoadingSpinner from 'components/shared/loading-spinner';\nimport PrimaryTabs from './shared/primary-tabs';\n\nconst MetricsDashboard = (props) => {\n const [data, setData] = useState({formData: {flows: []}, revenueData: {}});\n const [forms, setForms] = useState(null)\n const [loading, setLoading] = useState(true);\n\n useEffect(() => {\n applyFilters({});\n getForms({});\n }, []);\n\n function getForms(filters) {\n setForms(null);\n DashboardAPI.fetchAssigned(filters)\n .done((result) => {\n setForms(result);\n });\n }\n\n function applyFilters(filters) {\n setLoading(true);\n getForms(filters);\n const jobRunner = new PollableJob(() => { return MetricsDashboardAPI.fetchData(filters); });\n jobRunner.run()\n .done((result) => { setData(JSON.parse(result)); setLoading(false); })\n .fail(() => { setLoading(false); });\n }\n\n function renderMetrics() {\n if (loading) {\n return (\n <div className='metricsdashboard-loading vmiddle'>\n <LoadingSpinner size='xlarge' className='vmiddle' />\n </div>\n );\n }\n\n return (\n <div className='padding-bottom-more'>\n <TopRow formData={data.form_data} />\n <SecondRow formData={data.form_data} />\n <Finances transactionData={data.revenue_data} />\n </div>\n );\n }\n\n return (\n <div className='margin-left margin-bottom margin-right flexcolumn' style={{ height: '100%' }}>\n <PrimaryTabs />\n <div id='tabheader-body' className='metrics scroll'>\n <Filters teamsArray={props.teams} formsArray={props.forms} applyFilters={applyFilters} />\n {renderMetrics()}\n <SubmissionsTable initiatedFlows={forms} totalCount={forms?.length} />\n </div>\n </div>\n );\n};\n\nexport default MetricsDashboard;\n","import renderer from 'modules/renderer';\nimport CommonProviders from 'components/common-providers';\nimport MetricsDashboard from 'components/metrics-dashboard';\n\nconst index = () => {\n renderer(\n (\n <CommonProviders>\n <MetricsDashboard \n formData={CityGrows.Server.formData} \n revenueData={CityGrows.Server.revenueData}\n teams={CityGrows.Server.teams}\n forms={CityGrows.Server.forms}\n />\n </CommonProviders>\n ), document.getElementById('metricsdashboard'),\n );\n}\n\nexport default {\n index,\n};\n","import React from 'react';\n\nconst TasksHeaderBar = ({count, overdueCount, completed}) => {\n function percentage () {\n return Math.round(( completed / count ) * 100)\n }\n\n if (!count) {\n return <></>\n }\n\n return (\n <div className='tasks-header'>\n <div className='inline-block'>\n <span className='padding-right'>\n <strong>{count}</strong>{' Tasks'}\n </span>\n <span className='text-alert color-left neutral'>\n <strong>{overdueCount}</strong>{` Overdue`}\n </span>\n </div>\n <div className='float-right'>\n <span className='vtop'>{`Completion: ${completed}/${count}`}</span>\n <div className=\"inline-block progressbar-container\">\n <div className=\"progressbar-fill\" style={{width: `${percentage()}%`}}></div>\n </div>\n <span className='vtop'>{`${percentage()}%`}</span>\n </div>\n </div>\n )\n}\n\nexport default TasksHeaderBar;","import React, { useEffect, useRef } from 'react';\nimport truncate from 'truncate';\n\nconst TasksListItem = ({active, changeActiveSubmission, task}) => {\n const itemRef = useRef();\n // useEffect(() => {\n // if (active) {\n // itemRef.current.scrollIntoView();\n // }\n // }, [active]);\n\n function renderOverdueLabel() {\n return (\n <span className='overdue'>Overdue</span>\n );\n }\n\n return (\n <li className={`tasklist-item ${active ? 'active' : ''}`} key={task.id} ref={itemRef}>\n <a href='#' onClick={() => {changeActiveSubmission(task.id)}} >\n <div>\n <h3 className='inline-block'>{`#${task.scoped_id} ${truncate(task.template_name, 35)}`}</h3>\n {task.overdue && renderOverdueLabel()}\n </div>\n <span>{`${task.primary_applicant_name} - ${task.time_elapsed_string}`}</span>\n <div>{task.step_type}</div>\n </a>\n </li>\n );\n};\n\nexport default TasksListItem;\n","import React, { useEffect, useState } from 'react';\nimport Select from 'components/shared/select';\nimport { findWhere } from 'underscore';\nimport TasksListItem from './tasks-list-item';\nimport UpDownArrow from '../shared/buttons/up-down-arrow';\n\nconst FILTER_OPTIONS = [\n {label: 'All', value: 'all'},\n {label: 'Overdue', value: 'overdue'},\n {label: 'Reviews', value: 'reviews'},\n {label: 'Internal Step', value: 'assignedInternal'},\n {label: 'Applicant Step', value: 'assignedExternal'},\n]\n\nconst SORT_OPTIONS = [\n {label: 'Sort by oldest first', value: 'oldest' },\n {label: 'Sort by newest first', value: 'newest' },\n {label: 'Sort by form name', value: 'form' },\n {label: 'Sort by applicant', value: 'applicant' },\n]\n\nconst TasksList = (props) => {\n const [skippedExpanded, setSkippedExpanded] = useState(false);\n\n useEffect(() => {\n if (props.skipped.includes(props.activeSubmission)) {\n props.changeActiveSubmission(props.submissions[0])\n }\n }, [props.skipped])\n\n\n function updateSort({ value }) {\n props.setSort(value);\n }\n\n function updateFilter({ value }) {\n props.setTaskFilter(value);\n }\n\n function tabContent() {\n return (\n <>\n <Select\n options={FILTER_OPTIONS}\n value={findWhere(FILTER_OPTIONS, { value: props.taskFilter })}\n onChange={updateFilter}\n styles={{\n container: (provided) => ({\n ...provided,\n marginTop: '10px',\n width: '300px',\n backgroundColor: '#FFF',\n borderRadius: '4px',\n }),\n }}\n />\n <Select\n options={SORT_OPTIONS}\n value={findWhere(SORT_OPTIONS, { value: props.sort })}\n onChange={updateSort}\n styles={{\n container: (provided) => ({\n ...provided,\n marginTop: '10px',\n width: '300px',\n backgroundColor: '#FFF',\n borderRadius: '4px',\n }),\n }}\n />\n </>\n )\n }\n\n function renderTask(task) {\n const active = task.id === props.activeSubmission\n\n return <TasksListItem active={active} task={task} changeActiveSubmission={props.changeActiveSubmission} />;\n }\n\n function renderSkipped() {\n return (\n <div className={`mytasks-tasklist ${skippedExpanded ? 'skipped-expanded' : 'skipped'}`}>\n <div>\n <h3 className='padded-less inline-block bold'>{`Skipped (${props.skippedSubmissions.length})`}</h3>\n <div className='float-right inline-block padded-less'><UpDownArrow expanded={skippedExpanded} setExpanded={setSkippedExpanded} /></div>\n </div>\n {skippedExpanded && (\n <ul>\n {props.skippedSubmissions.map(renderTask)}\n </ul>\n )}\n </div>\n )\n }\n\n function renderTasks() {\n if (props.loading) {\n return (\n <ul className='mytasks-tasklist-loading'>\n\n </ul>\n )\n }\n\n return (\n <ul className='mytasks-tasklist'>\n {props.submissions.map(renderTask)}\n </ul>\n );\n }\n\n return (\n <div className='mytasks-tasklist-container'>\n <div className='padded'>\n <div className='tabnav'>\n <ul>\n <li className='selected'>\n Filter\n </li>\n </ul>\n </div>\n <div>\n {tabContent()}\n </div>\n </div>\n <div>\n <h3 className='padded-less inline-block bold'>{`Active Tasks (${props.submissions.length})`}</h3>\n </div>\n {renderTasks()}\n {renderSkipped()}\n </div>\n );\n};\n\nexport default TasksList;\n","import React, { useEffect, useState } from 'react';\nimport { fetchTasks } from 'apis/my-tasks-api';\nimport { filter, some, union, sortBy, reject, without } from 'underscore';\nimport PrimaryTabs from './shared/primary-tabs';\nimport TasksHeaderBar from './my-tasks/tasks-header-bar';\nimport TasksList from './my-tasks/tasks-list';\nimport InitiatedFlowManager from './initiated-flow-manager';\nimport InitiatedFlowAPI from '../apis/initiated-flow-api';\nimport LoadingSpinner from 'components/shared/loading-spinner';\n\nconst MyTasksContainer = () => {\n const [submissions, setSubmissions] = useState(null);\n const [loading, setLoading] = useState(true);\n const [activeSubmissionId, setActiveSubmissionId] = useState(null);\n const [activeSubmission, setActiveSubmission] = useState(null);\n const [completed, setCompleted] = useState([]);\n const [skipped, setSkipped] = useState([]);\n const [sort, setSort] = useState('oldest');\n const [taskFilter, setTaskFilter] = useState('all');\n const [initialCount, setInitialCount] = useState(null);\n\n useEffect(() => {\n fetchTasks(null)\n .done((result) => {\n setSubmissions(result);\n setLoading(false);\n setActiveSubmissionId(filteredAndSorted(result)[0]?.id || null);\n setInitialCount(result.length);\n });\n }, []);\n\n useEffect(() => {\n if (!submissions) { return }\n\n setActiveSubmissionId(filteredAndSorted(submissions)[0]?.id || null)\n }, [skipped])\n\n useEffect(() => {\n if (!activeSubmissionId) { return; }\n\n InitiatedFlowAPI.show(activeSubmissionId)\n .done((res) => { setActiveSubmission(res); });\n }, [activeSubmissionId]);\n\n const filteredAndSorted = (subs) => {\n return sortSubmissions(filterSubmissions(subs))\n }\n\n const skippedSubmissions = () => {\n return filter(submissions, (sub) => { return skipped.includes(sub.id); });\n }\n\n function filterSubmissions(subs) {\n const withoutSkipped = reject(subs, (sub) => { return skipped.includes(sub.id); });\n switch (taskFilter) {\n case 'all':\n return withoutSkipped;\n case 'overdue':\n return filter(withoutSkipped, { overdue: true });\n case 'assignedInternal':\n return filter(withoutSkipped, { internal: true });\n case 'assignedExternal':\n return filter(withoutSkipped, { internal: false });\n case 'reviews':\n return filter(withoutSkipped, { review: true });\n default:\n throw new Error('Unknown Filter Typ');\n }\n }\n\n function sortSubmissions(subs) {\n switch (sort) {\n case 'oldest':\n return subs;\n case 'newest':\n return subs.reverse();\n case 'form':\n return sortBy(subs, 'template_name');\n case 'applicant':\n return sortBy(subs, 'primary_applicant_name');\n default:\n throw new Error('Unknown sort type');\n }\n }\n\n function onSkip() {\n setSkipped([...skipped, activeSubmissionId]);\n }\n\n function changeActiveSubmission(id) {\n if (id === activeSubmissionId) { return; }\n\n setActiveSubmission(null);\n setActiveSubmissionId(id);\n }\n\n function overdueCount() {\n if (loading) { return 0; }\n\n return filter(submissions, { overdue: true }).length;\n }\n\n function onUpdate() {\n setLoading(true);\n setSubmissions(null);\n const previousSubmission = activeSubmissionId;\n setSkipped(without(skipped, activeSubmissionId));\n setActiveSubmission(null);\n setActiveSubmissionId(null);\n fetchTasks()\n .done((result) => {\n setSubmissions(result);\n if (some(result, (submission) => { return submission.id === previousSubmission; })) {\n setActiveSubmissionId(previousSubmission);\n } else {\n\n setActiveSubmissionId(filteredAndSorted(result)[0]?.id || null);\n setCompleted(union(completed, [previousSubmission]));\n }\n setLoading(false);\n });\n }\n\n function renderMain() {\n if (activeSubmission) {\n return (\n <InitiatedFlowManager\n step={activeSubmission.step}\n currentUserId={CityGrows.Server.currentUserId}\n admin\n initiatedFlow={activeSubmission.initiated_flow}\n flowTemplate={activeSubmission.flow_template}\n masterTemplate={activeSubmission.master_template}\n activeStep={activeSubmission.active_step}\n showAdminWarning={false}\n primaryApplicant={activeSubmission.primary_applicant}\n secondaryApplicantIds={activeSubmission.secondary_applicant_ids}\n taskView\n onTaskViewUpdate={onUpdate}\n onSkip={onSkip}\n />\n );\n }\n\n if (!loading && filteredAndSorted(submissions).length === 0 && !activeSubmissionId) {\n return (\n <div className='mytasks-loading flexcolumn'>\n <div className='mytasks-loading-wrapper'>\n <span className='mytasks-empty'>No Current Tasks</span>\n </div>\n </div>\n )\n }\n\n return (\n <div className='mytasks-loading flexcolumn'>\n <div className='mytasks-loading-wrapper'>\n <LoadingSpinner size='xlarge' />\n </div>\n </div>\n );\n }\n\n function renderTaskList() {\n return (\n <TasksList\n submissions={filteredAndSorted(submissions)}\n loading={loading}\n activeSubmission={activeSubmissionId}\n skipped={skipped}\n skippedSubmissions={skippedSubmissions()}\n setSort={setSort}\n sort={sort}\n taskFilter={taskFilter}\n setTaskFilter={setTaskFilter}\n changeActiveSubmission={changeActiveSubmission}\n />\n );\n }\n\n return (\n <div className='margin-left margin-bottom margin-right flexcolumn fullheight'>\n <PrimaryTabs />\n <div id='tabheader-body' className='flexcolumn'>\n <TasksHeaderBar\n count={loading ? null : initialCount}\n overdueCount={overdueCount()}\n completed={completed.length}\n />\n <div className='my-tasks'>\n {renderTaskList()}\n {renderMain()}\n </div>\n </div>\n </div>\n );\n};\n\nexport default MyTasksContainer;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport MyTasksContainer from 'components/my-tasks-container';\nimport CommonProviders from 'components/common-providers';\n\nexport const index = () => {\n renderer(\n (\n <CommonProviders>\n <MyTasksContainer />\n </CommonProviders>\n ), document.getElementById('mytasks'),\n );\n};\n\nexport default {\n index,\n};","\n\nfunction index() {\n // Sticky nav\n //\n const $window = $(window);\n const $nav = $('nav.home-nav');\n const scrolledClassName = 'scrolled';\n\n $window.scroll(() => {\n if ($window.scrollTop() > 0) {\n $nav.addClass(scrolledClassName);\n } else {\n $nav.removeClass(scrolledClassName);\n }\n });\n\n // Word spinner\n //\n const words = document.querySelectorAll('#wordspinner span');\n const wordCount = words.length;\n let currentIdx = 0;\n\n function run() {\n words[currentIdx % wordCount].className = '';\n words[(currentIdx + 1) % wordCount].className = 'entering';\n\n currentIdx += 1;\n\n setTimeout(run, 2500);\n }\n\n setTimeout(run, 2500);\n}\n\nexport default {\n index,\n};\n","import PropTypes from 'prop-types';\nimport React from 'react';\nimport PublicNavMenu from './public-nav-menu';\n\nconst OrgHeader = (props) => {\n function isLightColored() {\n if (!props.team.color) { return true; }\n\n return props.team.has_light_color;\n }\n\n const style = props.team.color ? { backgroundColor: props.team.color } : { backgroundColor: 'transparent' };\n const logoUrl = props.team.logo.url\n return (\n <div>\n <div className='public-react'>\n <div className={`orgheader cf${isLightColored() ? ' light' : ''}`} style={style}>\n <span className='relative'>\n <a href={`/${props.team.friendly_id}`}>\n <img src={logoUrl} alt={`${props.team.name} logo`} className='margin-right-less' height='50px' />\n <span className='orgheader-org'>\n {props.team.name}\n </span>\n </a>\n </span>\n <PublicNavMenu currentUser={props.currentUser} light={isLightColored()}/>\n </div>\n </div>\n </div>\n );\n};\n\nOrgHeader.propTypes = {\n currentUser: PropTypes.shape({\n email: PropTypes.string.isRequired,\n }),\n\n team: PropTypes.shape({\n friendly_id: PropTypes.string.isRequired,\n logo: PropTypes.string,\n name: PropTypes.string.isRequired,\n color: PropTypes.string,\n has_light_color: PropTypes.bool,\n }),\n};\n\nexport default OrgHeader;\n","import 'timeago';\nimport React from 'react';\nimport renderer from 'modules/renderer';\nimport LaunchManager from 'components/initiated_flow/launch-manager';\nimport InitiatedFlowManager from '../../components/initiated-flow-manager';\nimport OrgHeader from '../../components/shared/org-header';\nimport InitiatedFlowActions from '../../actions/initiated-flow-actions';\nimport CommonProviders from '../../components/common-providers';\n\nconst initStore = () => {\n if (CityGrows.Server.initiatedFlowData) {\n InitiatedFlowActions.receiveInitiatedFlow(CityGrows.Server.initiatedFlowData.initiated_flow);\n InitiatedFlowActions.receiveActiveStep(CityGrows.Server.initiatedFlowData.active_step);\n InitiatedFlowActions.receiveStep(CityGrows.Server.initiatedFlowData.step);\n }\n};\n\nconst show = () => {\n initStore();\n\n renderer(\n (\n <CommonProviders>\n <OrgHeader\n currentUser={CityGrows.Server.currentUser}\n team={CityGrows.Server.initiatedFlowData.team}\n />\n </CommonProviders>\n ), document.getElementById('topnav'),\n );\n\n renderer(\n (\n <CommonProviders>\n <InitiatedFlowManager\n currentUser={{ id: CityGrows.Server.currentUserId, email: CityGrows.Server.currentUser.email }}\n admin={false}\n initiatedFlow={CityGrows.Server.initiatedFlowData.initiated_flow}\n activeStep={CityGrows.Server.initiatedFlowData.active_step}\n step={CityGrows.Server.initiatedFlowData.step}\n flowTemplate={CityGrows.Server.initiatedFlowData.flow_template}\n masterTemplate={CityGrows.Server.initiatedFlowData.master_template}\n showAdminWarning={CityGrows.Server.showAdminWarning}\n subprocessRequirement={CityGrows.Server.initiatedFlowData.subprocess_requirement}\n team={CityGrows.Server.initiatedFlowData.team}\n />\n </CommonProviders>\n ), document.getElementById('flowcontent'),\n );\n};\n\nconst start = () => {\n renderer(\n (\n <CommonProviders>\n <LaunchManager\n subprocessRequirement={CityGrows.Server.initiatedFlowData.subprocess_requirement}\n flowTemplate={CityGrows.Server.initiatedFlowData.flow_template}\n currentUser={CityGrows.Server.initiatedFlowData.current_user}\n masterTemplateId={CityGrows.Server.initiatedFlowData.master_template.id}\n primaryApplicant={CityGrows.Server.initiatedFlowData.primary_applicant}\n secondaryApplicantIds={CityGrows.Server.initiatedFlowData.secondary_applicant_ids}\n />\n </CommonProviders>\n ), document.getElementById('flowcontent')\n );\n};\n\nexport default {\n show,\n start,\n};\n","import React from 'react';\nimport Bar from 'components/shared/chart/bar';\n\nclass TemplateStats extends React.Component {\n render() {\n return (\n <Bar\n data={this.props.data}\n options={{\n plugins: {\n legend: { display: false },\n },\n }}\n />\n );\n }\n}\n\nexport default TemplateStats;\n","import React from 'react';\nimport _ from 'underscore';\nimport dayjs from 'dayjs';\n\nconst AdminStepGroup = (props) => {\n const NO_DATA_SYMBOL = '---';\n\n const renderSteps = () => {\n return props.steps.map(renderStep);\n };\n\n const renderStep = (step) => {\n return (\n <li key={step.id}>{step.name}</li>\n );\n };\n\n const renderStepRange = () => {\n const firstPos = _.first(props.steps).position;\n const lastPos = _.last(props.steps).position;\n\n if (firstPos === lastPos) {\n return `Step ${firstPos}`;\n }\n return `Steps ${firstPos} - ${lastPos}`;\n };\n\n const renderMedianTime = () => {\n const times = props.digest?.median_step_times;\n\n // Return unless time is present for each step in group\n if (!times || !_.all(times, (t) => { return t; })) { return NO_DATA_SYMBOL; }\n\n const totalTime = props.steps.reduce((total, step) => {\n return total + Number(times[step.id]);\n }, 0);\n\n\n const duration = dayjs.duration(totalTime, 'seconds');\n return duration.humanize();\n };\n\n return (\n <div className='stepbreakdown-step city'>\n <div className='stepbreakdown-resp'>\n <dl>\n <dt>{props.cityName}</dt>\n <dd>{renderStepRange()}</dd>\n </dl>\n </div>\n\n <div className='stepbreakdown-stepmain'>\n <div className='stepbreakdown-skipinfo'>{props.steps.length} steps are not your responsibility</div>\n <div className='stepbreakdown-meta'>\n <div className='stepbreakdown-timeest' title='Median time to complete this group of steps'>{renderMedianTime()}</div>\n </div>\n\n <ul className='stepbreakdown-skippedsteps'>\n {renderSteps()}\n </ul>\n\n </div>\n </div>\n );\n};\n\nexport default AdminStepGroup;\n","import React from 'react';\nimport _ from 'underscore';\nimport { fieldNameForType } from 'modules/step-data-types';\n\nconst FieldPreview = (props) => {\n if (!_.any(props.sections)) { return <></>; }\n\n const renderSections = (sections) => {\n return props.sections.map(renderSection);\n };\n\n const renderSection = (section) => {\n return (\n <React.Fragment key={section.id}>\n <tr className='collecteddatatable-sectionname'>\n <td>{section.name}</td><td />\n </tr>\n {renderStepData(section.step_data)}\n </React.Fragment>\n );\n };\n\n const renderStepData = (stepData) => {\n return stepData.map(renderStepDatum);\n };\n\n const renderStepDatum = (stepDatum) => {\n return (\n <tr key={`datum-${stepDatum.id}`}>\n <td>{stepDatum.name}{renderAsterisk(stepDatum)}</td>\n <td>{fieldNameForType(stepDatum.data_type, { customEntityName: stepDatum.custom_entity_name })}</td>\n </tr>\n );\n };\n\n const renderAsterisk = (stepDatum) => {\n if (!stepDatum.required) { return; }\n\n return (\n <span className='color-alert'>*</span>\n );\n };\n\n return (\n <div className='well margin-top collecteddatatable-wrap'>\n <table>\n <tbody>\n {renderSections()}\n </tbody>\n </table>\n </div>\n );\n};\n\nexport default FieldPreview;\n","import React from 'react';\nimport dayjs from 'dayjs';\nimport FieldPreview from './field-preview';\n\nconst OverviewStep = (props) => {\n const NO_DATA_SYMBOL = '---';\n\n const [isOpen, setOpen] = React.useState(false);\n\n const onExpandClick = (e) => {\n e.preventDefault();\n setOpen(!isOpen);\n };\n\n const stepTypeName = () => {\n switch (props.step.type) {\n case 'BasicStep':\n return 'Informational Step';\n case 'CollectInfoStep':\n return 'Form';\n case 'RequireReviewStep':\n return 'Review';\n case 'SurveyStep':\n return 'Survey';\n case 'PaymentStep':\n return 'Payment';\n case 'AssignResponsibilityStep':\n return 'Assignment Step';\n default:\n throw `Unrecognized step type ${props.step.type}`;\n }\n };\n\n const renderExpandArrow = () => {\n if (!hasAdditionalInfo()) { return; }\n\n return (\n <span className={`margin-left stepbreakdown-expand icon icon-arrow-down small thin ${isOpen ? 'flip-y' : ''}`} />\n );\n };\n\n const hasAdditionalInfo = () => {\n const addlInfoTypes = [\n 'CollectInfoStep',\n 'RequireReviewStep',\n 'SurveyStep',\n 'PaymentStep',\n ];\n\n return props.step.description || addlInfoTypes.includes(props.step.type);\n };\n\n const renderAdditionalInfo = () => {\n if (!isOpen) { return; }\n\n const renderLowerContent = () => {\n switch (props.step.type) {\n case 'SurveyStep':\n return <div className='well margin-top'>You will be prompted to collect responses to an online survey.</div>;\n case 'CollectInfoStep':\n return <FieldPreview sections={props.step.sections} />;\n case 'PaymentStep':\n return <div className='well margin-top'>A payment may be required.</div>;\n default:\n return <div className='well margin-top'>No additional info available</div>;\n }\n };\n\n const renderDescription = () => {\n if (!props.step.description) { return; }\n\n return <p className='stepbreakdown-description margin-top'>{props.step.description}</p>;\n };\n\n return (\n <div>\n {renderDescription()}\n {renderLowerContent()}\n </div>\n );\n };\n\n const renderStepResponsibility = () => {\n if (!props.respDidChange) { return; }\n\n let respName;\n\n if (props.step.external) {\n respName = 'Your responsibility';\n } else {\n respName = props.cityName;\n }\n\n return (\n <div className='stepbreakdown-resp'>\n <div className='stepbreakdown-respname'>{respName}</div>\n <div className='stepbreakdown-stepnum'>{renderStepRange()}</div>\n </div>\n );\n };\n\n const renderStepRange = () => {\n const firstPos = props.step.position;\n const lastPos = props.lastStepPos;\n\n if (firstPos === lastPos) {\n return `Step ${firstPos}`;\n }\n return `Steps ${firstPos} - ${lastPos}`;\n };\n\n const renderLinebreak = () => {\n if (props.respWillChange) {\n return <div className='linebreak onlydesktop' />;\n }\n };\n\n const renderTimeEstimate = () => {\n const time = props.medianTime;\n\n if (time) {\n const duration = dayjs.duration(time, 'seconds');\n return duration.humanize();\n }\n\n return NO_DATA_SYMBOL;\n };\n\n const altText = () => {\n if (open) { return 'hide step details'; }\n\n return 'open step details'\n }\n\n return (\n <div className={`stepbreakdown-step ${props.respDidChange ? 'firstoftype' : ''}`}>\n {renderStepResponsibility()}\n\n <div className='stepbreakdown-stepmain'>\n <div className='stepbreakdown-stepname'>{props.step.name}</div>\n <div className='stepbreakdown-meta'>\n <div className='stepbreakdown-timeest' title='Median time to complete this step'>{renderTimeEstimate()}</div>\n <button alt={altText()} onClick={onExpandClick} className='stepbreakdown-steptype btn-link'>\n {stepTypeName()}\n {renderExpandArrow()}\n </button>\n \n </div>\n\n {renderAdditionalInfo()}\n\n </div>\n\n {renderLinebreak()}\n </div>\n );\n};\n\nexport default OverviewStep;\n","import React from 'react';\nimport _ from 'underscore';\nimport OverviewStep from './overview-step';\n\nconst ConstStepGroup = (props) => {\n const renderStep = (step) => {\n const nextStep = findStepAfter(step);\n const prevStep = findStepBefore(step);\n const medianTime = props.digest ? props.digest.median_step_times[step.id] : null;\n\n return (\n <OverviewStep\n step={step}\n lastStepPos={_.last(props.steps).position}\n cityName={props.cityName}\n respWillChange={!nextStep}\n respDidChange={step.position === 1 || !prevStep}\n key={step.id}\n medianTime={medianTime}\n />\n );\n };\n\n const findStepAfter = (step) => {\n return _.findWhere(props.steps, { position: step.position + 1 });\n };\n\n const findStepBefore = (step) => {\n return _.findWhere(props.steps, { position: step.position - 1 });\n };\n\n return props.steps.map(renderStep);\n};\n\nexport default ConstStepGroup;\n","import React from 'react';\nimport _ from 'underscore';\nimport AdminStepGroup from './admin-step-group';\nimport ConstStepGroup from './const-step-group';\n\nconst StepBreakdown = (props) => {\n const renderSteps = () => {\n // Group steps by change of responsibility\n let currentGroup = [];\n const grouped = [];\n\n _.each(props.steps, (step) => {\n if (_.isEmpty(currentGroup) || (step.external === _.last(currentGroup).external)) {\n currentGroup.push(step);\n } else {\n grouped.push(currentGroup);\n currentGroup = [step];\n }\n });\n\n grouped.push(currentGroup);\n\n return grouped.map(renderGroup);\n };\n\n const renderGroup = (group) => {\n switch (group[0].external) {\n case true:\n return (\n <ConstStepGroup\n steps={group}\n cityName={props.cityName}\n key={group[0].id}\n digest={props.digest}\n />\n );\n case false:\n return (\n <AdminStepGroup\n steps={group}\n cityName={props.cityName}\n key={group[0].id}\n digest={props.digest}\n />\n );\n default:\n throw `Unhandled group type ${group[0].external}`;\n }\n };\n\n return (\n <div id='stepbreakdown'>\n {renderSteps()}\n </div>\n );\n};\n\nexport default StepBreakdown;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport AutonomousPopup from 'components/shared/autonomous-popup';\nimport { findWhere, any } from 'underscore';\nimport Modal from 'components/shared/modal';\nimport Select from 'components/shared/select';\nimport TemplateExtrasActions from 'actions/template-extras-actions';\n\nclass OverviewTabs extends React.PureComponent {\n activeClass = (tab) => {\n const classes = ['tab'];\n\n if (CityGrows.Server.actionName === tab) {\n classes.push('active');\n }\n\n return classes.join(' ');\n };\n\n moreHTML = (\n <a id='morelink' href='#' className='tab' onClick={(e) => { e.preventDefault(); }}>\n More\n <span className=' margin-left-less icon icon-arrow-down thin dark small' />\n </a>\n );\n\n constructor(props) {\n super(props);\n\n this.state = {\n modalOpen: false,\n selectedTeamId: CityGrows.Server.currentUser?.isGov ? this.props.myTeams[0]?.id : null,\n };\n }\n\n onCloneProcessClick = (e) => {\n e.preventDefault();\n\n this.setState({\n modalOpen: true,\n });\n };\n\n onClose = () => {\n this.setState({\n modalOpen: false,\n });\n };\n\n onDoClone = (e) => {\n e.preventDefault();\n TemplateExtrasActions.cloneTemplate(this.props.flowTemplateId, this.state.selectedTeamId)\n .done((res) => { window.location = res.url; });\n };\n\n updateSelectedTeam = (option) => {\n const selectedTeamId = option.value;\n this.setState({\n selectedTeamId,\n });\n };\n\n renderTeamSelector() {\n if (this.state.modalOpen) {\n const teamOptions = this.props.myTeams.map((team) => ({ value: team.id, label: team.name }));\n return (\n <Modal className='padded-more cf' onOutsideClick={this.onClose} scroll={false}>\n <h2>Clone form</h2>\n <p className='color-text-medium margin-bottom'>Select a team to clone this form into</p>\n <Select\n options={teamOptions}\n style={{ width: '100%' }}\n value={teamOptions.find((option) => this.state.selectedTeamId === option.value)}\n onChange={this.updateSelectedTeam}\n />\n <a href='#' className='btn-primary margin-top float-right' onClick={this.onDoClone}>Clone form</a>\n </Modal>\n );\n }\n }\n\n renderMoreMenu = () => {\n const menuItems = [];\n const { currentUser } = CityGrows.Server;\n\n if (currentUser && currentUser.isGov && this.props.forkAllowed) {\n menuItems.push(\n <li key='clone'><a onClick={this.onCloneProcessClick} href='#'>Clone this form</a></li>,\n );\n }\n\n if (!any(menuItems)) { return; }\n\n return (\n <li className='tab'>\n <AutonomousPopup buttonHtml={this.moreHTML}>\n <ul className='popup-listmenu'>\n {menuItems}\n </ul>\n </AutonomousPopup>\n </li>\n );\n };\n\n renderPublicRecordSearch = () => {\n if (!this.props.searchEnabled) { return; }\n\n return (\n <li className={this.activeClass('search')}>\n <a href={`/${this.props.teamSlug}/${this.props.templateSlug}/search`}>\n <span className='icon icon-magnifyingglass' />\n Public record search\n </a>\n </li>\n );\n };\n\n renderStatsTab = () => {\n if (!this.props.canPublicRead || this.props.templatePrivate) { return; }\n\n return (\n <li className={this.activeClass('data')}>\n <a id='statslink' href={`/${this.props.teamSlug}/${this.props.templateSlug}/data`}>\n <span className='icon icon-stats' />\n Stats\n </a>\n </li>\n );\n };\n\n render() {\n return (\n <>\n <nav id='publicoverview-tabs'>\n <ul className='column narrow'>\n <li className={this.activeClass('show')}>\n <a href={`/${this.props.teamSlug}/${this.props.templateSlug}`}>\n <span className='icon icon-lines-medium' />\n Form details\n </a>\n </li>\n <li className={this.activeClass('faqs')}>\n <a id='faqslink' href={`/${this.props.teamSlug}/${this.props.templateSlug}/faqs`}>\n <span className='icon icon-speechballoon-medium' />\n FAQs\n </a>\n </li>\n {this.renderStatsTab()}\n {this.renderPublicRecordSearch()}\n {this.renderMoreMenu()}\n </ul>\n </nav>\n\n {this.renderTeamSelector()}\n </>\n );\n }\n}\n\nOverviewTabs.propTypes = {\n searchEnabled: PropTypes.bool,\n teamSlug: PropTypes.string.isRequired,\n templateSlug: PropTypes.string.isRequired,\n flowTemplateId: PropTypes.number.isRequired,\n myTeams: PropTypes.array,\n forkAllowed: PropTypes.bool,\n};\n\nOverviewTabs.defaultProps = {\n searchEnabled: false,\n forkAllowed: false,\n};\n\nexport default OverviewTabs;\n","import React, { Component } from 'react';\nimport FlowTemplateAPI from 'apis/flow-template-api';\nimport _ from 'underscore';\nimport Flash from 'components/shared/flash';\nimport NProgress from 'nprogress';\n\nclass OverviewDescriptionEditor extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n editing: false,\n description: this.props.description,\n };\n }\n\n renderEditView() {\n return (\n <div className='cf'>\n <textarea ref='description' defaultValue={this.state.description} />\n <a href='#' onClick={this.onSaveClick.bind(this)} className='float-right btn-secondary'>Save description</a>\n </div>\n );\n }\n\n onSaveClick(e) {\n e.preventDefault();\n\n NProgress.start();\n\n const newDescription = this.refs.description.value;\n\n FlowTemplateAPI.update(this.props.flowTemplateId, {\n description: newDescription,\n })\n\t\t.done(() => {\n\t\t this.setState({\n\t\t editing: false,\n\t\t description: newDescription,\n\t\t }, () => {\n\t\t if (_.isFunction(this.props.onChange)) { this.props.onChange(newDescription); }\n\t\t });\n\t\t})\n\t\t.fail(() => { Flash.error(); })\n\t\t.always(() => { NProgress.done(); });\n }\n\n onEditClick(e) {\n e.preventDefault();\n\n this.setState({\n editing: true,\n }, () => {\n this.refs.description.select();\n });\n }\n\n editLinkText() {\n const desc = this.state.description;\n if (!desc || desc.length === 0) {\n return 'Add description';\n }\n return 'Edit';\n }\n\n renderEditDescriptionButton = () => {\n if (this.props.admin) {\n return (\n <a id='publicoverview-desceditlink' href='#' onClick={this.onEditClick.bind(this)}>{this.editLinkText()}</a>\n );\n }\n };\n\n renderDescription() {\n return (\n <p>{this.state.description} {this.renderEditDescriptionButton()}</p>\n );\n }\n\n render() {\n return this.state.editing ? this.renderEditView() : this.renderDescription();\n }\n}\n\nexport default OverviewDescriptionEditor;\n","import React, { createRef } from 'react';\nimport PropTypes from 'prop-types';\nimport OverviewTabs from 'components/public/overview-tabs';\nimport DescriptionEditor from 'components/public/overview-description-editor';\nimport OrgHeader from 'components/shared/org-header';\nimport _ from 'underscore';\n\nclass PublicOverviewHeader extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.header = createRef();\n this.bannerform = createRef();\n this.bannerfield = createRef();\n this.headerHeight = null;\n\n this.state = {\n showMiniNav: false,\n };\n }\n\n componentDidMount() {\n this.setScrollEvent();\n this.setBannerHeight();\n }\n\n componentWillUnmount() {\n this.unsetScrollEvent();\n }\n\n setBannerHeight = () => {\n this.headerHeight = $(this.header.current).height();\n };\n\n setScrollEvent = () => {\n $(window).bind('scroll', this.didScroll);\n };\n\n unsetScrollEvent = () => {\n $(window).unbind('scroll', this.didScroll);\n };\n\n didScroll = _.throttle(() => {\n const offset = $(window).scrollTop();\n\n if (offset > this.headerHeight + 10 && !this.state.showMiniNav) {\n this.setState({\n showMiniNav: true,\n });\n } else if (offset < this.headerHeight && this.state.showMiniNav) {\n this.setState({\n showMiniNav: false,\n });\n }\n });\n\n getScrollStyle = () => {\n if (this.state.showMiniNav) {\n return {\n marginTop: this.headerHeight,\n };\n }\n };\n\n bgImageStyle = () => {\n const url = this.props.flowTemplateData.master_template.banner_image_url;\n if (!url) { return; }\n\n return {\n backgroundImage: `url(${url})`,\n backgroundColor: '#4F6A78',\n };\n };\n\n renderStartButton = () => {\n const buttonText = (() => {\n if (this.templateIsClosed()) {\n return 'This form is not currently active. You will not be able to start it.';\n } if (!this.publiclyLaunchable()) {\n return 'This submission is not available to be launched';\n }\n return 'Start this submission';\n })();\n\n return (\n <a\n href={`/initiated_flows/manager?flow_template_id=${this.props.flowTemplateData.id}`}\n className={`btn-primary ${this.canBeLaunched() ? '' : 'disabled'}`}\n tabIndex='0'\n title={buttonText}\n id='startbutton'\n data-method='post'\n >\n Start\n </a>\n );\n };\n\n canBeLaunched = () => {\n return !this.templateIsClosed() && (this.publiclyLaunchable() || this.canLaunchInternally());\n };\n\n publiclyLaunchable = () => {\n return this.props.flowTemplateData.master_template.publicly_launchable;\n };\n\n templateIsClosed = () => {\n return this.props.flowTemplateData.master_template.status === 'closed';\n };\n\n renderNotice = () => {\n if (this.templateIsClosed()) {\n return <div className='inline-block color-left alert inverted'><strong>Note:</strong> This submission is not currently active. You will not be able to start it.</div>;\n }\n };\n\n onBannerUploadClick = (e) => {\n e.preventDefault();\n $(this.bannerfield.current).click();\n };\n\n onImageSelect = () => {\n this.bannerform.current.submit();\n };\n\n userIsAdmin = () => {\n return this.props.flowTemplateData.master_template.managable_by_user;\n };\n\n canLaunchInternally = () => {\n return this.props.flowTemplateData.master_template.internally_launchable_by_user;\n };\n\n renderBannerForm = () => {\n if (!this.userIsAdmin()) { return; }\n\n const csrfToken = $('meta[name=csrf-token]').first();\n if (!csrfToken) { throw 'Missing CSRF token'; }\n\n return (\n <form id='publicoverview-bannerform' ref={this.bannerform} encType='multipart/form-data' action={`/master_templates/${this.props.flowTemplateData.master_template.friendly_id}`} acceptCharset='UTF-8' method='post'>\n <input type='hidden' name='_method' value='patch' />\n <input type='hidden' name='authenticity_token' value={csrfToken.attr('content')} />\n <input onChange={this.onImageSelect} ref={this.bannerfield} className='hidden' type='file' name='master_template[banner_image]' />\n <button className='btn-link' onClick={this.onBannerUploadClick} >Change banner image</button>\n </form>\n );\n };\n\n render() {\n return (\n <>\n <div id='publicoverview-headerwrap' style={this.getScrollStyle()} className={this.state.showMiniNav ? 'mini' : ''}>\n <section id='publicoverview-header' ref={this.header}>\n\n {this.renderBannerForm()}\n\n <div id='publicoverview-header-bgimage' style={this.bgImageStyle()} />\n \n <div id='publicoverview-header-overlay' />\n <nav className='cf public relative overview startpage' id='topnav'>\n <OrgHeader\n currentUser={this.props.user}\n team={this.props.flowTemplateData.team}\n />\n </nav>\n\n <div id='publicoverview-processstart' className=' relative column narrow cf'>\n <h1>{this.props.flowTemplateData.name}</h1>\n <DescriptionEditor\n description={this.props.flowTemplateData.description}\n flowTemplateId={this.props.flowTemplateData.id}\n admin={this.userIsAdmin()}\n onChange={this.setBannerHeight}\n />\n {this.renderNotice()}\n\n <div className='linebreak' />\n\n {this.renderStartButton()}\n </div>\n </section>\n </div>\n\n <OverviewTabs\n teamSlug={this.props.flowTemplateData.team.friendly_id}\n templateSlug={this.props.flowTemplateData.master_template.friendly_id}\n canPublicRead={this.props.flowTemplateData.master_template.public_read}\n templatePrivate={this.props.flowTemplateData.master_template.private}\n myTeams={this.props.myTeams}\n flowTemplateId={this.props.flowTemplateData.id}\n forkAllowed={this.props.flowTemplateData.master_template.fork_allowed}\n searchEnabled={this.props.flowTemplateData.master_template.publicly_searchable}\n />\n </>\n );\n }\n}\n\nPublicOverviewHeader.propTypes = {\n flowTemplateData: PropTypes.object.isRequired,\n myTeams: PropTypes.array,\n user: PropTypes.object.isRequired,\n};\n\nexport default PublicOverviewHeader;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StepBreakdown from 'components/public/step-breakdown';\nimport _ from 'underscore';\nimport dayjs from 'dayjs';\nimport PublicOverviewHeader from './public-overview-header';\n\nconst NO_DATA_SYMBOL = '---';\nconst CONTENT_FOR_FREE = 'No payment required';\n\nclass ProcessOverview extends React.PureComponent {\n renderMedianTime = () => {\n const time = this.props.flowTemplateData.digest?.median_process_time;\n if (time) {\n return dayjs.duration(time, 'seconds').humanize();\n }\n\n return NO_DATA_SYMBOL;\n };\n\n renderCostRange = () => {\n const lowEnd = this.props.flowTemplateData.digest?.lowest_cost;\n const highEnd = this.props.flowTemplateData.digest?.highest_cost;\n\n if (!_.isNumber(lowEnd) || !_.isNumber(highEnd)) {\n return NO_DATA_SYMBOL;\n }\n\n if (highEnd === 0) {\n return CONTENT_FOR_FREE;\n }\n\n const formatter = Intl.NumberFormat('en', { style: 'currency', currency: 'USD' });\n\n if (lowEnd === highEnd) {\n return formatter.format(lowEnd / 100);\n }\n\n return `${formatter.format(lowEnd / 100)} - ${formatter.format(highEnd / 100)}`;\n };\n\n render() {\n return (\n <div id='publicoverview'>\n <PublicOverviewHeader\n flowTemplateData={this.props.flowTemplateData}\n user={this.props.user}\n myTeams={this.props.myTeams}\n />\n\n <section className='column narrow margin-bottom-more'>\n {(this.props.flowTemplateData.public_median_time\n || this.props.flowTemplateData.public_cost_range) && (\n <div id='publicoverview-stats'>\n {this.props.flowTemplateData.public_median_time && (\n <dl>\n <dt>\n <span className='icon icon-clock' />\n Typically takes\n </dt>\n <dd>{this.renderMedianTime()}</dd>\n </dl>\n )}\n {this.props.flowTemplateData.public_cost_range && (\n <dl>\n <dt>\n <span className='icon icon-money-dark' />\n Cost\n </dt>\n <dd>{this.renderCostRange()}</dd>\n </dl>\n )}\n </div>\n )}\n <StepBreakdown\n steps={this.props.flowTemplateData.steps}\n cityName={this.props.flowTemplateData.team.name}\n digest={this.props.flowTemplateData.digest}\n />\n </section>\n </div>\n );\n }\n}\n\nProcessOverview.propTypes = {\n flowTemplateData: PropTypes.object.isRequired,\n user: PropTypes.object.isRequired,\n myTeams: PropTypes.array,\n};\n\nexport default ProcessOverview;\n","const SearchPagesApi = {\n\n\n publicSearch(params) {\n const url = '/search';\n\n return $.ajax(url, {\n method: 'get',\n dataType: 'json',\n data: params,\n });\n },\n\n customSearch(params, slug) {\n const url = `/search_pages/${slug}/search`;\n\n return $.ajax(url, {\n method: 'get',\n dataType: 'json',\n data: params,\n });\n },\n};\nexport default SearchPagesApi;\n","import IconButton from '@material-ui/core/IconButton';\nimport PropTypes from 'prop-types';\nimport React from 'react';\n\nconst PaginationButtons = (props) => {\n const {\n count, page, rowsPerPage, onChangePage,\n } = props;\n\n const lastPage = Math.ceil(count / rowsPerPage);\n\n const handleFirstPageButtonClick = (event) => {\n onChangePage(event, 0);\n };\n\n const handleBackButtonClick = (event) => {\n onChangePage(event, page - 1);\n };\n\n const handleNextButtonClick = (event) => {\n onChangePage(event, page + 1);\n };\n\n const handleLastPageButtonClick = (event) => {\n onChangePage(event, lastPage - 1);\n };\n\n const isFirstPage = () => { return page === 0; };\n\n const isLastPage = () => { return page === lastPage - 1; };\n\n return (\n <div className='pagination-actions'>\n <IconButton\n onClick={handleFirstPageButtonClick}\n disabled={isFirstPage()}\n aria-label='first page'\n >\n <i className='icon-skip-left bigger' />\n </IconButton>\n <IconButton\n onClick={handleBackButtonClick}\n disabled={isFirstPage()}\n aria-label='previous page'\n >\n <i className='icon-arrow-left bigger' />\n </IconButton>\n <p>Page {page + 1} of {lastPage}</p>\n <IconButton\n onClick={handleNextButtonClick}\n disabled={isLastPage()}\n aria-label='next page'\n >\n <i className='icon-arrow-right bigger' />\n </IconButton>\n <IconButton\n onClick={handleLastPageButtonClick}\n disabled={isLastPage()}\n aria-label='last page'\n >\n <i className='icon-skip-right bigger' />\n </IconButton>\n </div>\n );\n};\n\nPaginationButtons.propTypes = {\n count: PropTypes.number.isRequired,\n onChangePage: PropTypes.func.isRequired,\n page: PropTypes.number.isRequired,\n rowsPerPage: PropTypes.number.isRequired,\n};\n\nexport default PaginationButtons;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport dayjs from 'dayjs';\nimport TablePagination from '@material-ui/core/TablePagination';\nimport PaginationButtons from 'components/shared/pagination-buttons';\n\nconst SearchResults = (props) => {\n const link = (flow) => {\n if (props.type === 'custom') {\n return `/search_pages/${props.slug}/results/${flow.id}?type=${flow.dashboardable_type}`;\n }\n\n return `/flows/${flow.id}/summary?type=${flow.dashboardable_type}`;\n };\n\n const renderFlowRow = (flow) => {\n const id = flow.dashboardable_type === 'ImportedFlow' ? '-' : flow.scoped_id;\n const identifierContent = flow.identifier_redacted\n ? <span className='color-text-medium'>Redacted</span>\n : flow.identifier;\n return (\n <tr key={flow.id}>\n <td>{`#${id}`}</td>\n <td>{identifierContent}</td>\n <td>{dayjs(flow.created_at).format('l')}</td>\n <td><a href={link(flow)}>View</a></td>\n </tr>\n );\n };\n\n const handleChangePage = (_, newPage) => {\n props.searchHandler(_, newPage + 1);\n };\n\n const labelDisplayedRows = ({ from, to, count }) => {\n return `Showing ${from}-${to} of ${count}`;\n };\n\n if (props.searching) {\n return (\n <div className='margin-top-more text-center'>\n <div className='progress-wrap'>\n <div className='progress smaller'>\n <div />\n </div>\n </div>\n </div>\n );\n }\n\n if (!props.results) { return null; }\n\n if (props.results.length > 0) {\n return (\n <div className='margin-top-more'>\n <table className='datatable highlightable'>\n <thead>\n <tr>\n <th>Submission ID</th>\n <th>Identifier</th>\n <th>Launched</th>\n <th>Summary</th>\n </tr>\n </thead>\n <tbody>\n {props.results.map(renderFlowRow)}\n {props.paginated\n && (\n <tr className='pagination-row'>\n <TablePagination\n rowsPerPageOptions={[props.rowsPerPage]}\n colSpan={4}\n count={props.totalResults}\n rowsPerPage={props.rowsPerPage}\n page={props.currentPage - 1} // mui pagination is zero based\n labelDisplayedRows={labelDisplayedRows}\n onChangePage={handleChangePage}\n ActionsComponent={PaginationButtons}\n />\n </tr>\n )}\n </tbody>\n </table>\n </div>\n );\n }\n return (\n <div className='margin-top-more text-center'>\n <p className='color-text-medium'>No results found.</p>\n </div>\n );\n};\n\nSearchResults.propTypes = {\n searching: PropTypes.bool,\n results: PropTypes.array,\n currentPage: PropTypes.number,\n rowsPerPage: PropTypes.number,\n totalResults: PropTypes.number,\n paginated: PropTypes.bool,\n slug: PropTypes.string,\n type: PropTypes.string,\n searchHandler: PropTypes.func,\n};\n\nexport default SearchResults;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport SearchPagesAPI from 'apis/search-pages-api';\nimport SearchBar from 'components/shared/search-bar';\nimport SearchResults from 'components/shared/search-results';\nimport { error as flashError } from 'components/shared/flash';\nimport KEYS from '../constants/keys';\n\nconst PublicSearch = ({ flowTemplateId, instructions }) => {\n const [searching, setSearching] = useState(false);\n const [results, setResults] = useState(null);\n const [searchTerm, setSearchTerm] = useState('');\n const [searchType, setSearchType] = useState('contains');\n const [currentPage, setCurrentPage] = useState(1);\n const [totalPages, setTotalPages] = useState(0);\n const [rowsPerPage, setRowsPerPage] = useState(0);\n const [totalResults, setTotalResults] = useState(0);\n\n const searchTypeChanged = ({ value }) => {\n setSearchType(value);\n };\n\n const searchChanged = (e) => {\n setSearchTerm(e.target.value);\n };\n\n const search = (_, page) => {\n setResults(null);\n setSearching(true);\n setCurrentPage(1);\n setTotalPages(0);\n setRowsPerPage(0);\n setTotalResults(0);\n\n const params = {\n search_terms: searchTerm,\n template_id: flowTemplateId,\n search_type: searchType,\n page: page || 1,\n };\n\n SearchPagesAPI.publicSearch(params)\n .done((response) => {\n setResults(response.initiated_flows);\n setCurrentPage(response.pagination.current_page);\n setRowsPerPage(response.pagination.per_page);\n setTotalResults(response.pagination.total_count);\n })\n .fail(() => { flashError(); })\n .always(() => setSearching(false));\n };\n\n const onInputKeyUp = (e) => {\n if (e.keyCode === KEYS.ENTER_KEY) {\n e.preventDefault();\n search(e, 1);\n }\n };\n\n return (\n <div className='publicsearch'>\n <div className='margin-bottom-more'>\n {instructions}\n </div>\n <SearchBar\n searchTypeChanged={searchTypeChanged}\n searchType={searchType}\n search={search}\n searchButtonId='searchbutton'\n >\n <input title='Search' type='text' onChange={searchChanged} onKeyUp={onInputKeyUp} value={searchTerm} placeholder='Search...' />\n </SearchBar>\n <div>\n <SearchResults\n results={results}\n searching={searching}\n type='public'\n paginated\n currentPage={currentPage}\n totalPages={totalPages}\n rowsPerPage={rowsPerPage}\n totalResults={totalResults}\n searchHandler={search}\n />\n </div>\n </div>\n );\n};\n\nPublicSearch.propTypes = {\n flowTemplateId: PropTypes.number,\n instructions: PropTypes.node,\n};\n\nexport default PublicSearch;\n","import React from 'react';\nimport renderer from 'modules/renderer';\n\nimport CommonProviders from '../../components/common-providers';\nimport TemplateStats from '../../components/template-stats';\nimport DataVisualizer from '../../components/shared/data-visualizer';\nimport PublicProcessOverview from '../../components/public-process-overview';\nimport PublicSearch from '../../components/public-search';\nimport PublicOverviewHeader from '../../components/public-overview-header';\n\nconst show = () => {\n renderer(\n <CommonProviders>\n <PublicProcessOverview\n user={CityGrows.Server.currentUser}\n flowTemplateData={CityGrows.Server.flowTemplateData}\n myTeams={CityGrows.Server.teams}\n />\n </CommonProviders>,\n document.getElementById('publicoverview-container'),\n );\n};\n\nconst data = () => {\n renderer(\n <CommonProviders>\n <PublicOverviewHeader\n user={CityGrows.Server.currentUser}\n flowTemplateData={CityGrows.Server.flowTemplateData}\n myTeams={CityGrows.Server.teams}\n />\n </CommonProviders>, document.getElementById('publicoverview-container'),\n );\n renderer(\n <CommonProviders>\n <TemplateStats data={CityGrows.Server.launchdata} />\n </CommonProviders>, document.getElementById('initiatedbar'),\n );\n renderer(\n <CommonProviders>\n <DataVisualizer visualizableFields={CityGrows.Server.visualizableFields} public />\n </CommonProviders>, document.getElementById('datavisualizer'),\n );\n};\n\nconst faqs = () => {\n renderer(\n <CommonProviders>\n <PublicOverviewHeader\n user={CityGrows.Server.currentUser}\n flowTemplateData={CityGrows.Server.flowTemplateData}\n myTeams={CityGrows.Server.teams}\n />\n </CommonProviders>, document.getElementById('publicoverview-container'),\n );\n};\n\nconst search = () => {\n renderer(\n <CommonProviders>\n <PublicOverviewHeader\n user={CityGrows.Server.currentUser}\n flowTemplateData={CityGrows.Server.flowTemplateData}\n myTeams={CityGrows.Server.teams}\n />\n </CommonProviders>, document.getElementById('publicoverview-container'),\n );\n renderer(\n <CommonProviders>\n <PublicSearch\n instructions={CityGrows.Server.flowTemplateData.master_template.public_search_instructions}\n flowTemplateId={CityGrows.Server.flowTemplateData.id}\n />\n </CommonProviders>, document.getElementById('data_search'),\n );\n};\n\nexport default {\n data,\n show,\n faqs,\n search,\n};\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport Survey from 'components/shared/survey';\nimport CommonProviders from 'components/common-providers';\n\nconst show = () => {\n renderer(\n (\n <CommonProviders>\n <Survey survey={CityGrows.Server.surveyData} />\n </CommonProviders>\n ), document.getElementById('survey'),\n );\n};\n\nexport default {\n show,\n};\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport Survey from 'components/shared/survey';\nimport CommonProviders from 'components/common-providers';\n\nconst edit = () => {\n renderer(\n (\n <CommonProviders>\n <Survey\n survey={CityGrows.Server.surveyData}\n existingSubmission={CityGrows.Server.submissionData}\n />\n </CommonProviders>\n ), document.getElementById('survey'),\n );\n};\n\nexport default {\n edit,\n};\n","import React, { useState, useRef } from 'react';\nimport { debounce, isEmpty } from 'underscore';\nimport useOnclickOutside from 'react-cool-onclickoutside';\nimport Popdown from 'components/shared/popdown';\nimport TeamAPI from 'apis/team-api';\nimport Flash from 'components/shared/flash';\n\nconst ProcessSearch = props => {\n const [open, setOpen] = useState(false);\n const [results, setResults] = useState([]);\n const closeResults = () => { setOpen(false); }\n const elForAnchor = useRef();\n\n useOnclickOutside(\n closeResults,\n { refs: [elForAnchor], ignoreClass: 'popdown' }\n );\n\n const onQueryType = debounce(\n (target) => {\n const { value } = target;\n\n if (isEmpty(value)) {\n setResults([]);\n setOpen(false);\n return;\n }\n\n TeamAPI.processListing(props.team.friendly_id, value)\n .done((res) => {\n setResults(res.flow_templates);\n setOpen(true);\n })\n .fail(() => { Flash.error(); })\n },\n 333\n );\n\n const renderProcess = (p) => {\n return (\n <li key={p.id}>\n <a href={p.public_path} style={{ width: '100%' }}>\n {p.name}\n </a>\n </li>\n )\n };\n\n const renderProcesses = (items) => {\n if (items.length) {\n return items.map(renderProcess);\n } else {\n return 'No results';\n }\n }\n\n return (\n <>\n <input\n ref={elForAnchor}\n id='form-search'\n onClick={() => { setOpen(true && !isEmpty(results)); }}\n onKeyUp={(e) => { onQueryType(e.currentTarget); }}\n placeholder=\"Ex: Building permit...\"\n type=\"text\"\n style={{ marginRight: '0px' }}\n />\n {open && (\n <Popdown anchorRef={elForAnchor}\n justify='left'\n topOffset={1}\n scrollAgainstWindow\n stretchAgainstAnchor\n >\n <ul className='public-portal-search-list'>\n {renderProcesses(results)}\n </ul>\n </Popdown>\n )\n }\n </>\n );\n};\n\nexport default ProcessSearch;\n","import React from 'react';\nimport renderer from 'modules/renderer';\n\nimport OrgHeader from 'components/shared/org-header';\nimport CommonProviders from 'components/common-providers';\nimport ProcessSearch from 'components/teams/process-search';\n\nconst show = () => {\n renderer(\n (\n <CommonProviders>\n <OrgHeader\n currentUser={CityGrows.Server.currentUser}\n team={CityGrows.Server.team}\n />\n </CommonProviders>\n ), document.getElementById('topnav'),\n );\n\n renderer(\n (\n <ProcessSearch team={CityGrows.Server.team} />\n ), document.getElementById('process-search'),\n );\n\n const publicPortalHeader = CityGrows.Server.team.public_portal_banner;\n const portalHeaderElement = document.getElementById('publicPortalHeader');\n portalHeaderElement.style.backgroundImage = `url(${publicPortalHeader.url})`;\n};\n\nexport default {\n show,\n processListing: show,\n};\n","import jstz from 'jstimezonedetect';\n\n\nfunction knew() {\n const $input = $('<input type=\"hidden\" name=\"user[time_zone]\" />');\n $input.val(jstz.determine().name());\n\n const $form = $('#new-user-form');\n $form.append($input);\n}\n\nexport default {\n new: knew,\n};\n","import React from \"react\";\nimport CollectInfoStepSummary from './shared/collect-info-step-summary';\n\nconst ProcessSummary= (props) => {\n const renderStepData = (step) => {\n return (\n <li key={step.id} className='review-stepinfo'>\n <div className='review-stepinfo-header'> {step.position}. {step.name}</div>\n <CollectInfoStepSummary step={step} collectedData={props.initiatedFlow.collected_data} />\n </li>\n );\n };\n\n return (\n <>\n {props.flowTemplate.steps.map(renderStepData)}\n </>\n )\n}\n\nexport default ProcessSummary;","import React, { useState, useEffect, useReducer, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport stickybits from 'stickybits';\nimport { CSSTransition, TransitionGroup } from 'react-transition-group';\nimport DiscussionActions from 'actions/discussion-actions';\nimport InformationalText from 'components/shared/informational-text';\nimport discussionReducer from 'reducers/discussions-reducer';\nimport DiscussionDispatchContext from 'contexts/discussion-dispatch-context';\nimport pluralize from 'modules/pluralize';\nimport SubmitReviewWidget from './initiated_flow/process/steps/reviews/submit-review-widget';\nimport ReviewDiscussion from './initiated_flow/process/steps/reviews/discussion';\nimport ReviewInterface from './initiated_flow/process/steps/reviews/interface';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { useReactToPrint } from \"react-to-print\";\nimport ProcessSummary from './process-summary';\n\nconst DISCUSSION_TAB = 'discussion';\nconst REVIEW_TAB = 'review';\n\nconst ReviewApp = (props) => {\n const [discussionState, discussionDispatch] = useReducer(discussionReducer, { discussions: [] });\n\n useEffect(() => {\n DiscussionActions.loadDiscussions(props.initiatedFlow.id, discussionDispatch);\n stickybits('.review-stepinfo-header');\n }, [props.initiatedFlow.id]);\n\n const [submitting, setSubmitting] = useState(false);\n const [selectedApprovalStatus, setSelectedApprovalStatus] = useState(null);\n const [comment, setComment] = useState(null);\n const [tab, setTab] = useState('review');\n const [recentlyAddedDiscussionId, setRecentlyAddedDiscussionId] = useState(null);\n const [outstandingReviewCount,\n setOutstandingReviewcount] = useState(props.outstandingReviewCount);\n const [previousReviews, setPreviousReviews] = useState(props.previousReviews);\n const [wasJustReviewed, setWasJustReviewed] = useState(false);\n const [reviewOutcome, setReviewOutcome] = useState(null);\n\n const contentRef = useRef(null);\n const onPrint = useReactToPrint({ contentRef, bodyClass:'print-view', documentTitle: `${props.initiatedFlow.template_name} #${props.initiatedFlow.scoped_id}` });\n\n const onReviewStart = () => {\n setSubmitting(true);\n };\n\n const onReviewExit = () => {\n setSubmitting(false);\n };\n\n const onReviewComplete = (res) => {\n setOutstandingReviewcount(res.review_data.outstanding_review_count);\n setPreviousReviews(res.review_data.previous_reviews);\n setWasJustReviewed(true);\n setReviewOutcome(res.approval.approval_status);\n\n if (res.approval.discussion) {\n const { discussion } = res.approval;\n DiscussionActions.onDiscussionCreate(discussionDispatch, discussion);\n\n setTab(DISCUSSION_TAB);\n setRecentlyAddedDiscussionId(discussion.id);\n }\n\n if (res.approval.resolved_pending_requests) {\n DiscussionActions.loadDiscussions(props.initiatedFlow.id, discussionDispatch);\n }\n };\n\n const onTabClick = (e, newTab) => {\n e.preventDefault();\n setTab(newTab);\n };\n\n const renderSubmitWidget = () => {\n if (submitting) {\n return (\n <SubmitReviewWidget\n key={props.reviewer.reviewer.id}\n roleId={props.activeReviewGroup.role_id}\n reviewer={props.reviewer.reviewer}\n requireSignature={props.activeReviewGroup.require_signature}\n reviewGroupId={props.activeReviewGroup.review_group_id}\n activeStepId={props.activeReviewGroup.active_step_id}\n affidavit={props.activeReviewGroup.affidavit}\n stepId={props.stepId}\n onClose={onReviewExit}\n onReviewComplete={onReviewComplete}\n approvalStatus={selectedApprovalStatus}\n comment={comment}\n />\n );\n }\n };\n\n const renderRoleNotif = () => {\n return <div id='review-rolenotif'>You are reviewing as a member of the {props.activeReviewGroup.role_name} Role</div>;\n };\n\n const onApprovalStatusUpdate = (e) => {\n setSelectedApprovalStatus(e.target.value);\n };\n\n const onCommentChange = (newComment) => {\n setComment(newComment);\n };\n\n const submitButtonText = () => {\n if (previousReviews.length > 0) {\n return 'Submit another review';\n }\n\n return 'Submit review';\n };\n\n const tabClassName = (tb) => {\n return tb === tab ? 'selected' : null;\n };\n\n const renderNextURL = () => {\n if (props.nextURL) {\n const verb = wasPreviouslyReviewed() ? 'Continue' : 'Skip';\n return <a href={props.nextURL}>{`${verb} to next review >`}</a>;\n }\n };\n\n const renderPrevURL = () => {\n if (props.prevURL) {\n return <a href={props.prevURL}>{'< Back to previous review'}</a>;\n }\n };\n\n const renderFirstURL = () => {\n if (props.firstURL) {\n return <a href={props.firstURL}>{`Continue to ${props.outstandingReviewCount} other reviews >`}</a>;\n }\n };\n\n const renderReviewNumber = () => {\n if (props.currentReviewNumber > 0) {\n return (\n <>\n <strong>{props.currentReviewNumber}</strong> of \n </>\n );\n }\n };\n\n const wasPreviouslyReviewed = () => {\n return previousReviews.length > 0;\n };\n\n const completedReviewInfo = () => {\n switch (reviewOutcome) {\n case true:\n return 'You approved this submission.';\n case false:\n return 'You rejected this submission. It has been halted.';\n case null:\n return 'You requested changes.';\n default:\n throw `Unrecognized approval status ${reviewOutcome}`;\n }\n };\n\n const renderNavBarContent = () => {\n if (wasJustReviewed) {\n return (\n <div id='review-navmiddle'>{completedReviewInfo()} {renderNextURL()}</div>\n );\n } if (props.completedForCurrentUser) {\n return (\n <div id='review-navmiddle'>You already reviewed. {renderFirstURL()}</div>\n );\n }\n return (\n <>\n <div>{renderPrevURL()}</div>\n <div id='review-navmiddle'>{renderReviewNumber()}<strong>{outstandingReviewCount}</strong> items to review</div>\n <div id='review-nextlink'>{renderNextURL()}</div>\n </>\n );\n };\n\n const bannerColorClass = () => {\n if (!wasJustReviewed) { return; }\n\n switch (reviewOutcome) {\n case true:\n return 'approved';\n case false:\n return 'rejected';\n case null:\n return 'commented';\n default:\n throw `Unrecognized approval status ${reviewOutcome}`;\n }\n };\n\n const renderAdminInstructions = () => {\n if (!props.reviewStepInternalInstructions) { return; }\n\n return (\n <InformationalText\n text={props.reviewStepInternalInstructions}\n textType='InternalStepInstructions'\n textContainerId={props.stepId}\n initiatedFlow={props.initiatedFlow}\n classes='color-text-dark'\n />\n );\n };\n\n function getApplicantText() {\n const text = props.initiatedFlow.primary_applicant.name;\n const otherApplicantsCount = props.initiatedFlow.applicants_count - 1;\n if (otherApplicantsCount > 0) {\n return `${text} and ${otherApplicantsCount} ${pluralize('other', otherApplicantsCount, { many: 'others' })}`;\n }\n return text;\n }\n\n function renderReviewInterface() {\n return (\n <>\n {props.activeReviewGroup.role_name && renderRoleNotif()}\n <ReviewInterface\n onApprovalStatusUpdate={onApprovalStatusUpdate}\n onReviewStart={onReviewStart}\n onCommentChange={onCommentChange}\n submitButtonText={submitButtonText()}\n previousReviews={previousReviews}\n toName={getApplicantText()}\n defaultApprovalMessage={props.activeReviewGroup.default_approval_message}\n defaultRejectionMessage={props.activeReviewGroup.default_rejection_message}\n onOpenDiscussionClick={(e) => { onTabClick(e, 'discussion'); }}\n />\n </>\n );\n };\n\n function renderPrintFlowInfo() {\n return (\n <div className='print-info'>\n <div id='review-cityname'>{props.flowTemplate.team_name}</div>\n <div id='review-templatename' className='inline-block margin-right'><a title='View full submission' href={`/initiated_flows/${props.initiatedFlow.id}`}>{props.initiatedFlow.template_name}</a></div>\n <div className='processnumber inline-block margin-right'>\n Submission \n <span>#{props.initiatedFlow.scoped_id}</span>\n </div>\n </div>\n )\n }\n\n return (\n <DiscussionDispatchContext.Provider value={discussionDispatch}>\n {renderSubmitWidget()}\n\n <nav id='review-nav' className={bannerColorClass()}>\n {renderNavBarContent()}\n </nav>\n <div id='review-maincontent'>\n <div id='review-cityname'>{props.flowTemplate.team_name}</div>\n\n <div className='margin-top-less margin-bottom-less fixed'>\n <div id='review-templatename' className='inline-block margin-right'><a title='View full submission' href={`/initiated_flows/${props.initiatedFlow.id}`}>{props.initiatedFlow.template_name}</a></div>\n <div className='processnumber inline-block margin-right'>\n Submission \n <span>#{props.initiatedFlow.scoped_id}</span>\n </div>\n <div className='inline-block clickable'>\n <FontAwesomeIcon\n onClick={onPrint}\n icon={icon({ name: 'print' })}\n style={{ color: '#0463B7' }}\n size=\"lg\"\n title='Print'\n />\n </div>\n </div>\n <div id='review-columnwrap'>\n <div id='review-left' ref={contentRef}>\n {renderPrintFlowInfo()}\n <div id='review-metainfo'>\n <div id='review-metainfo-left'>\n <div className='margin-right-less'>\n <table>\n <tbody>\n <tr>\n <td>\n <strong>Review group</strong>\n </td>\n <td>\n {props.activeReviewGroup.name_or_default}\n </td>\n </tr>\n\n <tr>\n <td>\n <strong>Applicant</strong>\n </td>\n\n <td>\n {getApplicantText()}\n </td>\n </tr>\n\n <tr>\n <td>\n <strong>Instructions</strong>\n </td>\n\n <td>\n {renderAdminInstructions()}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <ul id='review-processdata'>\n <ProcessSummary flowTemplate={props.flowTemplate} initiatedFlow={props.initiatedFlow} />\n </ul>\n </div>\n\n <div id='review-right'>\n <div id='review-actionbox' className='raised'>\n <div className='tabnav align-center'>\n <ul>\n <li className={tabClassName('review')}>\n <button\n type='button'\n className='btn-link'\n onClick={(e) => { onTabClick(e, 'review'); }}\n >\n Review\n </button>\n </li>\n <li className={tabClassName('discussion')}>\n <button\n type='button'\n className='btn-link'\n onClick={(e) => { onTabClick(e, 'discussion'); }}\n >\n Discussion\n </button>\n </li>\n </ul>\n </div>\n\n <div id='review-overflowwrap'>\n <TransitionGroup>\n {tab === REVIEW_TAB && (\n <CSSTransition\n classNames='review-reviewtab'\n timeout={{ enter: 150 }}\n >\n {renderReviewInterface()}\n </CSSTransition>\n )}\n {tab === DISCUSSION_TAB && (\n <CSSTransition\n classNames='review-discussiontab'\n timeout={{ enter: 150 }}\n >\n <ReviewDiscussion\n initiatedFlowId={props.initiatedFlow.id}\n admin\n recentlyAddedDiscussionId={recentlyAddedDiscussionId}\n discussions={discussionState.discussions}\n />\n </CSSTransition>\n )}\n </TransitionGroup>\n </div>\n\n </div>\n </div>\n </div>\n </div>\n </DiscussionDispatchContext.Provider>\n );\n};\n\nReviewApp.propTypes = {\n initiatedFlow: PropTypes.shape({\n id: PropTypes.number.isRequired,\n collected_data: PropTypes.array.isRequired,\n primary_applicant: PropTypes.shape({\n name: PropTypes.string,\n }).isRequired,\n applicants_count: PropTypes.number.isRequired,\n scoped_id: PropTypes.number.isRequired,\n template_name: PropTypes.string.isRequired,\n }).isRequired,\n activeReviewGroup: PropTypes.shape({}).isRequired,\n completedForCurrentUser: PropTypes.bool.isRequired,\n currentReviewNumber: PropTypes.number.isRequired,\n firstURL: PropTypes.string.isRequired,\n flowTemplate: PropTypes.shape({\n steps: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n }).isRequired,\n nextURL: PropTypes.string.isRequired,\n outstandingReviewCount: PropTypes.number.isRequired,\n previousReviews: PropTypes.arrayOf(PropTypes.shape({})).isRequired,\n prevURL: PropTypes.string.isRequired,\n reviewer: PropTypes.shape({}).isRequired,\n stepId: PropTypes.number.isRequired,\n reviewStepInternalInstructions: PropTypes.string,\n};\n\nexport default ReviewApp;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport CommonProviders from 'components/common-providers';\nimport ReviewApp from '../components/review-app';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nfunction index() {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n}\n\nfunction show() {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n renderer(\n (\n <CommonProviders>\n <ReviewApp\n initiatedFlow={CityGrows.Server.reviewData.initiated_flow}\n flowTemplate={CityGrows.Server.reviewData.flow_template}\n reviewer={CityGrows.Server.reviewData.reviewer}\n stepId={CityGrows.Server.reviewData.step_id}\n activeReviewGroup={CityGrows.Server.reviewData.active_review_group}\n reviewStepInternalInstructions={CityGrows.Server.reviewData.review_step_internal_instructions}\n currentReviewNumber={CityGrows.Server.reviewData.current_review_number}\n outstandingReviewCount={CityGrows.Server.reviewData.outstanding_review_count}\n previousReviews={CityGrows.Server.reviewData.previous_reviews}\n nextURL={CityGrows.Server.reviewData.next_url}\n prevURL={CityGrows.Server.reviewData.prev_url}\n firstURL={CityGrows.Server.reviewData.first_url}\n completedForCurrentUser={CityGrows.Server.reviewData.completed_for_current_user}\n />\n </CommonProviders>\n ), document.getElementById('review'),\n );\n}\n\nexport default {\n index,\n show,\n};\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport SearchBar from 'components/shared/search-bar';\nimport SearchResults from 'components/shared/search-results';\nimport SearchPagesAPI from 'apis/search-pages-api';\nimport { error as flashError } from 'components/shared/flash';\nimport KEYS from '../constants/keys';\n\nconst SearchPageContainer = ({ name, instructions, searchSlug }) => {\n const [searchType, setSearchType] = useState('exact');\n const [searchTerm, setSearchTerm] = useState('');\n const [searching, setSearching] = useState(false);\n const [results, setResults] = useState(null);\n const [currentPage, setCurrentPage] = useState(1);\n const [totalPages, setTotalPages] = useState(0);\n const [rowsPerPage, setRowsPerPage] = useState(0);\n const [totalResults, setTotalResults] = useState(0);\n\n const searchTypeChanged = ({ value }) => {\n setSearchType(value);\n };\n\n const searchChanged = (e) => {\n setSearchTerm(e.currentTarget.value);\n };\n\n const search = (_, page) => {\n setSearching(true);\n setResults(null);\n setCurrentPage(1);\n setTotalPages(0);\n setRowsPerPage(0);\n setTotalResults(0);\n\n const params = {\n search_terms: searchTerm,\n search_type: searchType,\n page: page || 1,\n };\n\n SearchPagesAPI.customSearch(params, searchSlug)\n .done((response) => {\n setResults(response.initiated_flows);\n setCurrentPage(response.pagination.current_page);\n setRowsPerPage(response.pagination.per_page);\n setTotalResults(response.pagination.total_count);\n })\n .fail((res) => {\n flashError(res.responseJSON.errors ? res.responseJSON.errors[0] : null);\n })\n .always(() => setSearching(false));\n };\n\n const onInputKeyUp = (e) => {\n if (e.keyCode === KEYS.ENTER_KEY) {\n e.preventDefault();\n search(e, 1);\n }\n };\n\n return (\n <div>\n <h2>{name}</h2>\n <div className='margin-bottom'>\n {instructions}\n </div>\n <SearchBar searchTypeChanged={searchTypeChanged} searchType={searchType} search={search}>\n <input type='text' onChange={searchChanged} onKeyUp={onInputKeyUp} value={searchTerm} placeholder='Search...' />\n </SearchBar>\n <div style={{ marginBottom: totalResults > 0 ? '-1.5rem' : '' }}>\n <SearchResults\n results={results}\n searching={searching}\n type='custom'\n slug={searchSlug}\n paginated\n currentPage={currentPage}\n totalPages={totalPages}\n rowsPerPage={rowsPerPage}\n totalResults={totalResults}\n searchHandler={search}\n />\n </div>\n </div>\n );\n};\n\nSearchPageContainer.propTypes = {\n name: PropTypes.string,\n instructions: PropTypes.string,\n searchSlug: PropTypes.string,\n};\n\nSearchPageContainer.defaultProps = {\n name: '',\n instructions: '',\n searchSlug: '',\n};\n\nexport default SearchPageContainer;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport CommonProviders from 'components/common-providers';\nimport SearchPageContainer from 'components/search-page-container';\nimport Output from 'components/initiated_flow/process/output/output';\n\nfunction show() {\n renderer(\n (\n <CommonProviders>\n <SearchPageContainer\n name={CityGrows.Server.name}\n searchSlug={CityGrows.Server.searchSlug}\n instructions={CityGrows.Server.instructions}\n />\n </CommonProviders>\n ), document.getElementById('search-page'),\n );\n}\n\nfunction renderOutput(output) {\n return <Output output={output} isCustomResult={true} />;\n}\n\nfunction showResult() {\n renderer(\n (\n <>\n {CityGrows.Server.outputs.map(renderOutput)}\n </>\n ), document.getElementById('outputs')\n )\n}\n\nexport default {\n show,\n showResult,\n};\n","import NProgress from 'nprogress';\nimport TeamAPI from '../apis/team-api';\nimport Flash from '../components/shared/flash';\n\nconst TeamActions = {\n update(teamId, attrs) {\n NProgress.start();\n\n return TeamAPI.update(teamId, attrs)\n .fail(() => { Flash.error(); })\n .always(NProgress.done);\n },\n\n onSlugSave(teamId, slug) {\n NProgress.start();\n\n return TeamAPI.update(teamId, {\n slug,\n })\n .done(() => { Flash.success('Team URL updated'); })\n .fail(() => { Flash.error(); })\n .always(NProgress.done);\n },\n\n};\n\nexport default TeamActions;\n","const TeamDomainAPI = {\n create: (teamId, domain) => {\n const url = `/teams/${teamId}/team_domains`;\n\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n team_domain: {\n domain\n }\n }\n });\n },\n\n destroy: (teamDomainId) => {\n const url = `/team_domains/${teamDomainId}`;\n\n return $.ajax(url, {\n method: 'DELETE',\n dataType: 'json'\n });\n }\n};\n\nexport default TeamDomainAPI;","import TeamDomainAPI from '../apis/team-domain-api';\nimport Flash from '../components/shared/flash';\n\nconst TeamDomainActions = {\n addDomain: (teamId, domain) => {\n return TeamDomainAPI.create(teamId, domain)\n .fail(() => {\n Flash.error('Unable to add domain. Try again later.');\n });\n },\n\n deleteDomain: (teamDomainId) => {\n return TeamDomainAPI.destroy(teamDomainId)\n .fail(() => {\n Flash.error('Unable to delete domain. Try again later.');\n });\n },\n};\n\nexport default TeamDomainActions;\n","export const validDomain = (domain) => {\n return /^([a-zA-Z0-9\\-]+\\.){1,}[a-zA-Z]{2,24}$/.test(domain);\n};\n\nexport default validDomain;\n","import React, { memo, useState, useRef } from 'react';\nimport DomainManagerActions from 'actions/domain-manager-actions';\nimport validDomain from 'modules/domain-validator';\nimport Flash from 'components/shared/flash';\nimport { isEmpty, union, reject } from 'underscore';\nimport AlertConfirm from 'modules/alert-confirm';\n\nconst DomainManager = memo((props) => {\n const newDomainField = useRef();\n const [addingDomain, setAddingDomain] = useState(false);\n const [domains, setDomains] = useState(props.domains);\n\n const onAddDomainClick = (e) => {\n e.preventDefault();\n\n setAddingDomain(true);\n };\n\n const onSaveDomainClick = (e) => {\n const newDomain = newDomainField.current.value.trim();\n\n if (!validateDomain(newDomain)) { return; }\n\n DomainManagerActions.addDomain(props.teamId, newDomain)\n .done(onDomainAdded);\n };\n\n const onDomainAdded = (res) => {\n const newDomain = res;\n newDomainField.current.value = '';\n setDomains(union(domains, [newDomain]));\n Flash.success('Domain added');\n };\n\n const validateDomain = (domain) => {\n if (isEmpty(domain)) {\n Flash.error('Type a domain name to add');\n return false;\n }\n\n if (!validDomain(domain)) {\n Flash.error(`${domain} is not a valid domain.`);\n return false;\n }\n\n if (domains.includes(domain)) {\n Flash.error('That domain has already been added.');\n return false;\n }\n\n return true;\n };\n\n const renderDomainInput = () => {\n if (!addingDomain) { return; }\n\n return (\n <li>\n <input id='adddomaininput' className='inline-block' placeholder='example.com' type='text' ref={newDomainField} />\n <button id='savedomainbutton' className='btn-primary small' onClick={onSaveDomainClick}>Save</button>\n </li>\n );\n };\n\n const renderAddLink = () => {\n if (props.disabled) { return; }\n if (addingDomain) { return; }\n\n return (\n <li>\n <a id='adddomainbutton' href='#' role='button' onClick={onAddDomainClick}>+ Add domain</a>\n </li>\n );\n };\n\n const renderDomains = () => {\n return domains.map(renderDomain);\n };\n\n const renderDomain = (teamDomain) => {\n return (\n <li key={teamDomain.id}>\n {teamDomain.domain}\n <span\n role='button'\n aria-label='Delete domain'\n className='icon icon-trash-grey margin-left-less vmiddle clickable'\n onClick={() => { onDomainDeleteClick(teamDomain.id); }}\n />\n </li>\n );\n };\n\n const onDomainDeleteClick = (teamDomainId) => {\n AlertConfirm.confirm(\n 'Delete domain?', (\n <span>\n Are you sure you want to delete this domain? \n <a target='_blank' href='https://help.citygrows.com/en/articles/4382220-internal-domains' rel='noreferrer'>Learn more about how this might affect your users.</a>\n </span>\n ), () => {\n DomainManagerActions.deleteDomain(teamDomainId)\n .done(() => { onDomainDestroyed(teamDomainId); });\n },\n );\n };\n\n const onDomainDestroyed = (teamDomainId) => {\n setDomains(reject(domains, (teamDomain) => {\n return teamDomain.id === teamDomainId;\n }));\n };\n\n return (\n <>\n <label className='margin-top-more'>\n <span>Team domains</span>\n </label>\n <ul id='teamdomains'>\n {renderDomains()}\n {renderDomainInput()}\n {renderAddLink()}\n </ul>\n </>\n );\n});\n\nexport default DomainManager;\n","import React, { useState, useRef } from 'react';\nimport ReactCrop from 'react-image-crop';\nimport NProgress from 'nprogress';\n\nconst PuplicPortalHeader = props => {\n const bannerRef = useRef();\n const [defFile, setDefFile] = useState(null);\n const [defFileCrop, setDefFileCrop] = useState({\n unit: 'px',\n x: 0,\n y: 0,\n width: 160,\n height: 90,\n });\n const [bannerImageAspect, setBannerImageAspect] = useState(1.0);\n const [newBannerPresent, setNewBannerPresent] = useState(false);\n const [bannerOptions, setBannerOptions] = useState({});\n\n const onDefFileCrop = (crop) => {\n setDefFileCrop(crop);\n setBannerOptions({\n x: Math.floor(defFileCrop.x * bannerImageAspect),\n y: Math.floor(defFileCrop.y * bannerImageAspect),\n w: Math.floor(defFileCrop.width * bannerImageAspect),\n h: Math.floor(defFileCrop.height * bannerImageAspect),\n });\n }\n\n const onBannerChange = (event) => {\n var reader = new FileReader();\n\n reader.onload = function (ev) {\n setDefFile(ev.target.result);\n\n var img = new Image;\n img.onload = function() {\n if (img.width > bannerRef.current.width) {\n setBannerImageAspect(img.width / bannerRef.current.width);\n }\n\n setBannerOptions({\n x: Math.floor(defFileCrop.x * bannerImageAspect),\n y: Math.floor(defFileCrop.y * bannerImageAspect),\n w: Math.floor(defFileCrop.width * bannerImageAspect),\n h: Math.floor(defFileCrop.height * bannerImageAspect),\n });\n };\n\n img.src = ev.target.result;\n };\n\n reader.readAsDataURL(event.currentTarget.files[0]);\n setNewBannerPresent(event.currentTarget.files.length > 0)\n };\n\n const onBannerSave = () => {\n if (!newBannerPresent) {\n e.preventDefault();\n }\n\n NProgress.start();\n };\n\n const renderPublicBanner = () => {\n if (props.team.public_portal_banner.present) {\n return <img\n className='imgborder margin-top-less'\n style={{ maxHeight: '100px' }}\n src={props.team.public_portal_banner.url}\n alt='Public header banner'\n />;\n }\n }\n\n return (\n <>\n <label>\n <span>Public Portal Header</span>\n {renderPublicBanner()}\n <form encType='multipart/form-data' method='post' action={`/teams/${props.team.friendly_id}`}>\n <input type='hidden' name='_method' value='patch' />\n <input type='hidden' name='team[public_portal_banner_options]' value={JSON.stringify(bannerOptions)} />\n <input\n disabled={props.disabled}\n type='file'\n accept='image/*'\n name='team[public_portal_banner]'\n onChange={onBannerChange}\n />\n <input\n onClick={onBannerSave}\n className={`btn-primary small${(newBannerPresent ? '' : ' disabled')}`}\n type='submit'\n value={props.team.public_portal_banner.present ? 'Replace' : 'Add'}\n />\n {props.team.public_portal_banner.present && (\n <input\n name='remove_banner'\n className={`btn-secondary small margin-left-less`}\n type='submit'\n value='Delete'\n />\n )}\n </form>\n </label>\n\n <ReactCrop aspect={16/9} crop={defFileCrop} onChange={onDefFileCrop}>\n <img style={{ width: '100%' }} src={defFile} ref={bannerRef} />\n </ReactCrop>\n </>\n )\n}\n\nexport default PuplicPortalHeader;\n\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { ChromePicker } from 'react-color';\nimport NProgress from 'nprogress';\nimport { debounce } from 'underscore';\n\nimport TeamActions from 'actions/team-actions';\nimport Select from 'components/shared/select';\nimport CopyableLink from 'components/shared/copyable-link';\nimport Flash from 'components/shared/flash';\nimport TeamAPI from 'apis/team-api';\nimport { publicHost } from 'modules/url-generator';\nimport { slugIsValid } from 'modules/slug-validator';\nimport NotifBanner from 'components/shared/notif-banner';\nimport AttachedPeople from 'components/shared/attached-people';\nimport DomainManager from './teams/domain-manager';\nimport PublicPortalHeader from './team_page/public-portal-header';\n\nconst defaultTeamColor = '#363636';\n\nclass TeamPage extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n team: this.props.team,\n newTimeZone: this.props.team.time_zone,\n newTeamColor: this.props.team.color,\n newTeamName: this.props.team.name,\n newSlug: this.props.team.friendly_id,\n newLogoPresent: false,\n savingTeamName: false,\n savingTeamColor: false,\n newSlugAvailable: null,\n slugSaving: false,\n slugChecking: false,\n };\n }\n\n componentDidMount() {\n this.doCheckSlug = debounce(this.doCheckSlug, 350);\n }\n\n renderDefaultStatus = () => {\n if (this.state.team.default && this.state.team.creator_id === this.props.currentUserId) {\n return <div className='margin-bottom'>This is your default team</div>;\n }\n };\n\n renderTeamLogo = () => {\n if (this.state.team.logo.present) {\n return <img className='imgborder margin-top-less' src={this.state.team.logo.url} alt='Team logo' height='50px' />;\n }\n };\n\n nameDidChange = () => {\n return this.state.newTeamName !== this.state.team.name;\n };\n\n onTeamNameSave = () => {\n this.setState({ savingTeamName: true });\n\n TeamActions.update(this.state.team.id, { name: this.state.newTeamName })\n .done(this.teamNameDidSave)\n .always(() => { this.setState({ savingTeamName: false }); });\n };\n\n teamNameDidSave = () => {\n const { team } = this.state;\n team.name = this.state.newTeamName;\n this.setState({ team });\n\n Flash.success('Team name updated');\n };\n\n onTeamNameChanged = (e) => {\n this.setState({ newTeamName: e.currentTarget.value });\n };\n\n shouldAllowTeamNameSave = () => {\n return this.nameDidChange() && !this.state.savingTeamName;\n };\n\n shouldAllowColorSave = () => {\n if (this.props.disabled) { return false; }\n\n return this.colorWasModified() && !this.state.savingTeamColor;\n };\n\n shouldAllowSlugSave = () => {\n return slugIsValid(this.state.newSlug)\n && this.slugWasModified()\n && !!this.state.newSlugAvailable\n && !this.state.slugSaving;\n };\n\n slugWasModified = () => {\n return this.state.newSlug !== this.state.team.friendly_id;\n };\n\n colorWasModified = () => {\n // if color has already been assigned to team\n if (this.state.team.color) {\n return this.state.newTeamColor !== this.state.team.color;\n }\n\n // if using defaultTeamColor and color was modified in state\n if (this.state.newTeamColor) {\n return this.state.newTeamColor !== defaultTeamColor;\n }\n };\n\n onSlugChanged = (e) => {\n const newValue = e.currentTarget.value;\n\n this.setState({\n newSlugAvailable: null,\n newSlug: newValue,\n }, this.checkSlugAvailable);\n };\n\n checkSlugAvailable = () => {\n if (!this.slugWasModified() || !slugIsValid(this.state.newSlug)) { return; }\n this.setState({ slugChecking: true });\n this.doCheckSlug();\n };\n\n doCheckSlug = () => {\n TeamAPI.checkSlugAvailable(this.state.team.friendly_id, this.state.newSlug)\n .done((res) => { this.setState({ newSlugAvailable: res.available }); })\n .fail(() => { Flash.error(); })\n .always(() => { this.setState({ slugChecking: false }); });\n };\n\n textForSlugSaveButton = () => {\n if (!slugIsValid(this.state.newSlug)) {\n return 'URL not valid';\n }\n if (this.state.slugChecking) {\n return 'Checking availability';\n }\n if (this.state.newSlugAvailable === false) {\n return 'URL not available';\n }\n return 'Save';\n };\n\n onColorChange = ({ hex }) => {\n this.setState({ newTeamColor: hex });\n };\n\n onColorSave = () => {\n this.setState({ savingTeamColor: true });\n\n TeamActions.update(this.props.team.id, { color: this.state.newTeamColor })\n .done(() => {\n this.setState(({ team, newTeamColor }) => ({ team: { ...team, color: newTeamColor } }));\n Flash.success('Changes saved');\n })\n .always(() => { this.setState({ savingTeamColor: false }); });\n };\n\n onSlugSave = () => {\n if (!this.shouldAllowSlugSave()) { return; }\n\n this.setState({ slugSaving: true });\n TeamActions.onSlugSave(this.state.team.id, this.state.newSlug)\n .done(() => {\n this.setState(({ team, newSlug }) => ({\n team: { ...team, slug: newSlug, friendly_id: newSlug },\n }));\n })\n .always(() => {\n this.setState({ slugSaving: false });\n });\n };\n\n publicPortalURL = () => {\n return `${publicHost()}/${this.state.newSlug}`;\n };\n\n onTimeZoneChange = ({ value }) => {\n this.setState({\n newTimeZone: value,\n });\n };\n\n onTimeZoneSave = () => {\n TeamActions.update(this.state.team.id, { time_zone: this.state.newTimeZone })\n .done(this.timeZoneDidSave);\n };\n\n timeZoneDidSave = () => {\n this.setState(({ team, newTimeZone }) => ({ team: { ...team, time_zone: newTimeZone } }));\n Flash.success('Time zone updated');\n };\n\n shouldAllowTimeZoneSave = () => {\n return (this.state.newTimeZone !== this.state.team.time_zone);\n };\n\n onLogoChange = (e) => {\n const logoPresent = e.currentTarget.files.length > 0;\n this.setState({ newLogoPresent: logoPresent });\n };\n\n onLogoSave = (e) => {\n if (!this.state.newLogoPresent) {\n e.preventDefault();\n }\n\n NProgress.start();\n };\n\n render() {\n const timeZoneOptions = Object.values(this.props.timeZone).map((zone) => ({\n value: zone,\n label: zone,\n }));\n return (\n <div>\n {this.props.disabled && <NotifBanner style='warning'>You do not have permission to make changes to this team.</NotifBanner>}\n <dl {...this.props.disabled && { className: 'margin-top' }}>\n <dt>Details</dt>\n <dd>\n {this.renderDefaultStatus()}\n <label>\n <span>Team name</span>\n <input disabled={this.props.disabled} onChange={this.onTeamNameChanged} className='team-inputfield inline-block' type='text' defaultValue={this.state.team.name} />\n <a\n className={`small btn-primary${(this.shouldAllowTeamNameSave() ? '' : ' disabled')}`}\n onClick={this.onTeamNameSave}\n >\n Save\n </a>\n </label>\n\n <label>\n <span>Public URL</span>\n <input\n disabled={this.props.disabled}\n placeholder='Public URL'\n onChange={this.onSlugChanged}\n className='team-inputfield inline-block margin-bottom'\n type='text'\n defaultValue={this.state.newSlug}\n />\n <a\n className={`small btn-primary${(this.shouldAllowSlugSave() ? '' : ' disabled')}`}\n onClick={this.onSlugSave}\n >\n {this.textForSlugSaveButton()}\n </a>\n <CopyableLink linkURL={this.publicPortalURL()} />\n </label>\n\n <label>\n <span>Logo</span>\n {this.renderTeamLogo()}\n <form encType='multipart/form-data' method='post' action={`/teams/${this.state.team.friendly_id}`}>\n <input type='hidden' name='_method' value='patch' />\n <input disabled={this.props.disabled} type='file' name='team[logo]' onChange={this.onLogoChange} />\n <input\n onClick={this.onLogoSave}\n className={`btn-primary small${(this.state.newLogoPresent ? '' : ' disabled')}`}\n type='submit'\n value={this.state.team.logo.present ? 'Replace' : 'Add'}\n />\n </form>\n </label>\n\n <PublicPortalHeader\n team={this.props.team}\n disabled={this.props.disabled}\n />\n\n <label>\n <span>Time zone</span>\n <Select\n options={timeZoneOptions}\n disabled={this.props.disabled}\n value={timeZoneOptions.find(({ value }) => value === this.state.newTimeZone)}\n onChange={this.onTimeZoneChange}\n styles={{\n container: (provided) => ({\n ...provided,\n display: 'inline-block',\n minWidth: '10rem',\n zIndex: 500,\n }),\n }}\n />\n\n <a\n className={`small btn-primary margin-left margin-top${(this.shouldAllowTimeZoneSave() ? '' : ' disabled')}`}\n onClick={this.onTimeZoneSave}\n >\n Save Time Zone\n </a>\n </label>\n\n <label>\n <span>Navbar Color</span>\n <ChromePicker\n disabled={this.props.disabled}\n color={this.state.newTeamColor || defaultTeamColor}\n disableAlpha\n onChangeComplete={this.onColorChange}\n />\n <a\n className={`small btn-primary margin-top${(this.shouldAllowColorSave() ? '' : ' disabled')}`}\n onClick={this.onColorSave}\n >\n Save Color\n </a>\n </label>\n\n <DomainManager\n teamId={this.state.team.friendly_id}\n disabled={this.props.disabled}\n domains={this.state.team.domains}\n />\n </dd>\n </dl>\n\n <dl className='margin-top-more'>\n <dt>\n Members\n <div className='helpertext'>Users can be added and removed from a team via <a href={`${this.props.team.friendly_id}/roles`}>Roles</a>. Team members can access all forms on a team.</div>\n </dt>\n <dd>\n <div className='teamsettings-permissions fullwidth'>\n <AttachedPeople\n people={this.props.team.members}\n onChange={this.updateMembers}\n attachableType='Team'\n attachableId={this.props.team.id}\n showEmail\n allowPseudo\n lockedUserIds={[this.props.currentUserId, this.props.team.creator_id]}\n allowToggle={false}\n disabled\n hideExternal\n />\n\n </div>\n </dd>\n </dl>\n\n </div>\n );\n }\n}\n\nTeamPage.propTypes = {\n team: PropTypes.object,\n currentUserId: PropTypes.number,\n disabled: PropTypes.bool,\n timeZone: PropTypes.object,\n};\n\nexport default TeamPage;\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport TeamPage from 'components/team-page';\nimport CommonProviders from 'components/common-providers';\nimport Directory from './directory';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nfunction initTabs() {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n}\n\nfunction index() {\n initTabs();\n}\n\nfunction knew() {\n initTabs();\n}\n\nfunction show() {\n initTabs();\n renderer(\n (\n <CommonProviders>\n <TeamPage\n currentUserId={CityGrows.Server.currentUserId}\n team={CityGrows.Server.team}\n disabled={CityGrows.Server.disabled}\n timeZone={CityGrows.Server.timeZone}\n />\n </CommonProviders>\n ), document.getElementById('team'),\n );\n}\n\nfunction people() {\n Directory.init();\n}\n\nexport default {\n index,\n new: knew,\n show,\n people,\n};\n","export const exportTransactions = (teamId, startDate, endDate) => {\n const url = `/teams/${teamId}/transactions/export`;\n\n return $.ajax(url, {\n method: 'POST',\n dataType: 'json',\n data: {\n start_date: startDate,\n end_date: endDate\n }\n });\n};\n\nexport const exportCashAndChecks = (teamId, startDate, endDate) => {\n return $.ajax(`/teams/${teamId}/transactions/export_cash_and_checks`, {\n method: 'POST',\n dataType: 'json',\n data: {\n start_date: startDate,\n end_date: endDate\n }\n })\n}\n\nexport default {\n exportTransactions,\n exportCashAndChecks,\n};","import React from 'react';\nimport PropTypes from 'prop-types';\nimport DatePicker from 'react-datepicker';\nimport QueryString from 'query-string';\nimport dayjs from 'dayjs';\nimport { exportTransactions, exportCashAndChecks } from 'apis/transactions-api';\nimport ExportsMessage from 'components/shared/exports-message';\n\nclass DateFilters extends React.Component {\n constructor(props) {\n super(props);\n const params = QueryString.parse(location.search);\n\n const startDate = new Date();\n startDate.setMonth(startDate.getMonth() - 1);\n\n const endDate = new Date();\n\n this.state = {\n exportQueued: false,\n exportQueueRequested: false,\n startDate: (params.start_date ? dayjs(params.start_date).toDate() : startDate),\n endDate: (params.end_date ? dayjs(params.end_date).toDate() : endDate),\n };\n }\n\n onStartChange = (dateString) => {\n this.setState({\n startDate: dateString,\n });\n };\n\n onEndChange = (dateString) => {\n this.setState({\n endDate: dateString,\n });\n };\n\n goButtonClicked = () => {\n document.location = `?${this.urlParams()}`;\n };\n\n formatDate(date) {\n return date ? date.toISOString() : null;\n }\n\n urlParams = () => {\n return $.param({\n start_date: this.formatDate(this.state.startDate),\n end_date: this.formatDate(this.state.endDate),\n });\n };\n\n transactionsExport = () => {\n exportTransactions(\n this.props.teamId,\n this.formatDate(this.state.startDate),\n this.formatDate(this.state.endDate),\n )\n\n .done(() => { this.setState({ exportQueued: true }); })\n .always(() => { this.setState({ exportQueueRequested: false }); });\n }\n\n cashAndChecksExport = () => {\n exportCashAndChecks(\n this.props.teamId,\n this.formatDate(this.state.startDate),\n this.formatDate(this.state.endDate),\n )\n\n .done(() => { this.setState({ exportQueued: true }); })\n .always(() => { this.setState({ exportQueueRequested: false }); });\n }\n\n onExportClick = () => {\n this.setState({ exportQueueRequested: true });\n\n if (this.props.type === 'transactions') {\n return this.transactionsExport();\n }\n\n return this.cashAndChecksExport();\n };\n\n render() {\n return (\n <div>\n <div className='width-25 inline-block'>\n <span className='margin-right color-text-medium'>From:</span>\n <DatePicker\n onChange={this.onStartChange}\n className='margin-right'\n selected={this.state.startDate}\n dateFormat={['yyyy-MM-dd', 'yyyy-M-d', 'M/d/yyyy', 'M-d-yyyy']}\n placeholderText='YYYY-MM-DD'\n />\n </div>\n\n <div className='width-25 inline-block'>\n <span className='margin-right color-text-medium'>To:</span>\n\n <DatePicker\n onChange={this.onEndChange}\n className='margin-right'\n selected={this.state.endDate}\n dateFormat={['yyyy-MM-dd', 'yyyy-M-d', 'M/d/yyyy', 'M-d-yyyy']}\n placeholderText='YYYY-MM-DD'\n />\n </div>\n\n <button onClick={this.goButtonClicked} className='btn-primary margin-right'>Go</button>\n <button disabled={this.state.exportQueueRequested} className='btn-thirdary' onClick={this.onExportClick}>Export to CSV</button>\n\n {this.state.exportQueued && <ExportsMessage className='margin-top' />}\n </div>\n );\n }\n}\n\nDateFilters.propTypes = {\n teamId: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired,\n};\n\nexport default DateFilters;\n","import React from 'react';\nimport renderer from 'modules/renderer';\n\nimport { confirm } from '../modules/alert-confirm';\nimport CommonProviders from '../components/common-providers';\nimport DateFilters from '../components/shared/date-filters';\nimport FinanceSubnav from '../components/shared/finance-subnav';\nimport PrimaryTabs from '../components/shared/primary-tabs';\n\nconst index = () => {\n renderer(<PrimaryTabs />, document.getElementById('tabs'));\n \n let confirmed = false;\n\n $('.refundlink').click((e) => {\n if (!confirmed) {\n e.preventDefault();\n e.stopPropagation();\n\n confirm('Are you sure?', 'Are you sure you want to refund this payment?', () => {\n confirmed = true;\n $(e.currentTarget).click();\n });\n }\n });\n\n renderer(\n (\n <FinanceSubnav teamSlug={CityGrows.Server.teamId} activeLink={CityGrows.Server.type}/>\n ), document.getElementById('finance-left-nav')\n );\n\n renderer(\n <CommonProviders><DateFilters teamId={CityGrows.Server.teamId} type={CityGrows.Server.type}/></CommonProviders>, document.getElementById('dateselects')\n );\n};\n\nexport default {\n index,\n cashAndChecks: index,\n};\n","\nimport Shield from '../modules/shield';\n\nfunction show() {\n $('#launchbutton').click(() => {\n Shield.on();\n $('#popup').fadeIn();\n });\n}\n\nexport default {\n show,\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst UserEmailSetting = (props) => {\n function handleChange(e) {\n const val = e.currentTarget.value;\n\n props.handleToggleChange(props.setting, val);\n }\n\n function renderSettings() {\n return (\n <div className='inline-block padding-left'>\n <form>\n <fieldset className='btn-multitoggle'>\n <div>\n <input type='radio' id={`${props.type}-on`} name='on' value='on' checked={props.setting.should_send === true} onChange={handleChange} />\n <label id={`${props.type}-onlabel`} className='outside-left' htmlFor={`${props.type}-on`}>On</label>\n </div>\n <div>\n <input type='radio' id={`${props.type}-off`} name='off' value='off' checked={props.setting.should_send === false} onChange={handleChange} />\n <label id={`${props.type}-offlabel`} className='inside' htmlFor={`${props.type}-off`}>Off</label>\n </div>\n <div>\n <input type='radio' id={`${props.type}-default`} name='default' value='default' checked={props.setting.should_send === 'default'} onChange={handleChange} />\n <label id={`${props.type}-defaultlabel`} className='outside-right' htmlFor={`${props.type}-default`}>Default</label>\n </div>\n </fieldset>\n </form>\n </div>\n );\n }\n\n function renderSettingsDetails() {\n const defaultSetting = props.email.should_send ? 'On' : 'Off';\n return <div className='color-text-medium'>Default Setting: {defaultSetting}</div>;\n }\n\n return (\n <div className='border-bottom padding-top padding-bottom'>\n <div>\n <div style={{ minWidth: '250px' }} className='inline-block bold'>{props.email.name}</div>\n {renderSettings()}\n </div>\n {renderSettingsDetails()}\n </div>\n );\n};\n\nexport default UserEmailSetting;\n\nUserEmailSetting.propTypes = {\n email: PropTypes.object.isRequired,\n handleToggleChange: PropTypes.func.isRequired,\n type: PropTypes.string.isRequired,\n setting: PropTypes.object.isRequired,\n};\n","const EmailSettingsAPI = {\n create: function(emailSetting) {\n const url = '/email_settings';\n return $.ajax(url, {\n dataType: 'json',\n method: 'POST',\n data: {\n email_setting: emailSetting\n }\n });\n },\n\n update: function(id, shouldSend) {\n const url = `/email_settings/${id}`;\n return $.ajax(url, {\n dataType: 'json',\n method: 'PUT',\n data: {\n should_send: shouldSend\n }\n });\n },\n\n destroy: function(id) {\n const url = `/email_settings/${id}`;\n return $.ajax(url, {\n dataType: 'json',\n method: 'DELETE'\n });\n },\n\n delete_all: function(typeParentId, typeParentType) {\n const url = '/email_settings/delete_all';\n return $.ajax(url, {\n dataType: 'json',\n method: 'DELETE',\n data: {\n type_parent_id: typeParentId,\n type_parent_type: typeParentType\n }\n });\n }\n\n};\n\nexport default EmailSettingsAPI;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport Select from 'components/shared/select';\nimport { findWhere, reject } from 'underscore';\nimport UserEmailSetting from './email-setting';\nimport EmailSettingsAPI from '../../apis/email-settings-api';\nimport Flash from '../shared/flash';\n\nconst formatForSelect = (object) => {\n return {\n value: object.id,\n label: object.name,\n };\n};\n\nconst UserEmailSettings = (props) => {\n const [workflowId, setWorkflowId] = useState(initialWorkflowSetting());\n const [teamId, setTeamId] = useState(initialTeamSetting());\n const [settings, setSettings] = useState(props.emailSettings);\n\n function initialWorkflowSetting() {\n if (!props.initialType || props.initialType.type !== 'MasterTemplate') { return null; }\n\n return props.initialType.id;\n }\n\n function initialTeamSetting() {\n if (!props.initialType || props.initialType.type !== 'Team') { return null; }\n\n return props.initialType.id;\n }\n\n function findEmailSetting(type, typeParentType) {\n const typeParentId = (typeParentType === 'MasterTemplate') ? workflowId : teamId;\n const setting = findWhere(\n settings,\n { email_type: type, type_parent_id: Number(typeParentId), type_parent_type: typeParentType },\n );\n if (!setting) {\n return {\n email_type: type,\n type_parent_id: typeParentId,\n type_parent_type: typeParentType,\n owner_type: 'User',\n owner_id: props.currentUserId,\n should_send: 'default',\n };\n }\n\n return setting;\n }\n\n function addSetting(setting) {\n setSettings([...settings, setting]);\n }\n\n function removeSetting(id) {\n const newSettings = reject(settings, (setting) => { return setting.id === Number(id); });\n setSettings(newSettings);\n }\n\n function updateSetting(setting) {\n const dupSettings = [...settings];\n const index = dupSettings.findIndex((s) => { return s.id === setting.id; });\n dupSettings[index] = setting;\n setSettings(dupSettings);\n }\n\n function removeSettings(typeParentId, typeParentType) {\n const newSettings = reject(\n settings,\n (setting) => {\n return (setting.type_parent_id === Number(typeParentId)\n && setting.type_parent_type === typeParentType);\n },\n );\n setSettings(newSettings);\n }\n\n const handleToggleChange = (setting, toggleValue) => {\n if (toggleValue !== 'default') {\n const shouldSend = toggleValue === 'on';\n updateOrCreateSetting(shouldSend, setting);\n } else if (setting.id) {\n EmailSettingsAPI.destroy(setting.id)\n .done((r) => {\n Flash.success('Setting updated');\n removeSetting(r.id);\n })\n .fail(() => { Flash.error('Oops, something went wrong'); });\n }\n };\n\n function updateOrCreateSetting(shouldSend, setting) {\n if (!setting.id) {\n const emailSetting = { ...setting, should_send: shouldSend };\n EmailSettingsAPI.create(emailSetting)\n .done((r) => {\n addSetting(r.setting);\n Flash.success('Setting updated');\n })\n .fail(() => { Flash.error('Oops, something went wrong'); });\n } else {\n EmailSettingsAPI.update(setting.id, shouldSend)\n .done((r) => {\n updateSetting(r.setting);\n Flash.success('Setting updated');\n })\n .fail(() => { Flash.error('Oops, something went wrong'); });\n }\n }\n\n function revertToDefault(type) {\n const typeParentId = type === 'MasterTemplate' ? workflowId : teamId;\n EmailSettingsAPI.delete_all(typeParentId, type)\n .done((r) => { removeSettings(r.type_parent_id, r.type_parent_type); });\n }\n\n function renderWorkflowSelect() {\n const workflowOptionsForSelect = props.workflows ? props.workflows.map(formatForSelect) : [];\n const handleWorkflowSelect = (option) => {\n setWorkflowId(option.value);\n };\n\n return (\n <label>\n <div>Form</div>\n <Select\n id='workflow-select'\n options={workflowOptionsForSelect}\n style={{ width: '100%' }}\n placeholder='Choose a form'\n onChange={handleWorkflowSelect}\n value={workflowOptionsForSelect.find((option) => workflowId === option.value)}\n menuPosition='fixed'\n />\n </label>\n );\n }\n\n function renderEmails(emails, typeParentType) {\n return (\n <div>\n <button type='button' className='btn-link margin-top' onClick={() => { revertToDefault(typeParentType); }}>Revert all to default</button>\n <ul>\n {Object.keys(emails).map((emailType) => {\n const setting = findEmailSetting(emailType, typeParentType);\n return (\n <UserEmailSetting\n key={emailType}\n type={emailType}\n email={emails[emailType]}\n setting={setting}\n handleToggleChange={handleToggleChange}\n />\n );\n })}\n </ul>\n </div>\n );\n }\n\n function renderTeamSelect() {\n const teamOptionsForSelect = props.teams ? props.teams.map(formatForSelect) : [];\n\n const handleTeamSelect = (option) => {\n setTeamId(option.value);\n };\n\n return (\n <label>\n <div>Team</div>\n <Select\n id='team-select'\n options={teamOptionsForSelect}\n style={{ width: '100%' }}\n placeholder='Choose a team'\n onChange={handleTeamSelect}\n value={teamOptionsForSelect.find((option) => teamId === option.value)}\n menuPosition='fixed'\n />\n </label>\n );\n }\n\n return (\n <div>\n <h1>Email Settings</h1>\n <p>Adjust the types of emails you receive. Each team and form has its own email settings. <a target='_blank' href='https://help.citygrows.com/en/articles/3972561-what-status-emails-does-citygrows-generate-automatically' rel='noreferrer'>Descriptions of the types of emails we send.</a></p>\n <div>\n <h2>Form Emails</h2>\n {renderWorkflowSelect()}\n {workflowId && renderEmails(props.emails.processSpecific, 'MasterTemplate')}\n </div>\n <div className='padding-top'>\n <h2>Team Emails</h2>\n {renderTeamSelect()}\n {teamId && renderEmails(props.emails.teamSpecific, 'Team')}\n </div>\n </div>\n );\n};\n\nUserEmailSettings.propTypes = {\n initialType: PropTypes.object,\n emailSettings: PropTypes.array,\n workflows: PropTypes.array,\n teams: PropTypes.array,\n emails: PropTypes.object,\n currentUserId: PropTypes.string,\n};\n\nexport default UserEmailSettings;\n","import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\n\nconst EditableInput = (props) => {\n const [editing, setEditing] = useState(props.editing);\n\n function cancel() {\n props.onCancel();\n setEditing(false);\n }\n\n function save() {\n props.onSave()\n .done(() => { setEditing(false); });\n }\n\n function renderInput() {\n return (\n <>\n <label htmlFor={props.id}>{props.label}</label>\n <input className='width-50' disabled={!editing} type={props.type} value={props.value} onChange={props.onInputChanged} id={props.id} />\n </>\n );\n }\n\n function renderButtons() {\n if (editing) {\n return (\n <div className='padding-top'>\n <button className='btn-link' onClick={cancel}>Cancel</button>\n <button className='margin-left small' onClick={save}>Save</button>\n </div>\n );\n }\n return <span aria-label='Edit' onClick={() => setEditing(true)} className='icon icon-pencil-grey clickable' />;\n }\n\n return (\n <div className='padding-bottom'>\n {renderInput()}\n {renderButtons()}\n </div>\n );\n};\n\nEditableInput.propTypes = {\n type: PropTypes.string,\n label: PropTypes.string.isRequired,\n value: PropTypes.string.isRequired,\n onInputChanged: PropTypes.func.isRequired,\n id: PropTypes.string.isRequired,\n onCancel: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n};\n\nEditableInput.defaultProps = {\n type: 'text',\n};\n\nexport default EditableInput;\n","import React, { useState } from 'react';\nimport EditableInput from 'components/shared/editable-input';\nimport LoadingSpinner from 'components/shared/loading-spinner';\n\nconst UserProfile = (props) => {\n const [name, setName] = useState(props.user.name);\n const [username, setUsername] = useState(props.user.username);\n const [email, setEmail] = useState(props.user.email);\n\n function renderProfilePhoto() {\n return (\n <div className='margin-bottom-more'>\n <label htmlFor='user_avatar'>Avatar</label>\n <div>\n {renderImage()}\n <div>\n {props.user.has_avatar && removeAvatarButton()}\n <input onChange={(e) => { props.changeAvatar(e.currentTarget.files[0]); }} className='vmiddle' type='file' id='user_avatar' />\n </div>\n </div>\n </div>\n );\n }\n\n function renderImage() {\n if (props.imageLoading) {\n return (\n <LoadingSpinner className='margin-top margin-bottom' size='large' />\n );\n }\n\n const src = props.user.avatar_src;\n return (\n <img className='vmiddle margin-right margin-bottom' src={src} height='100px' />\n );\n }\n\n function removeAvatarButton() {\n return (\n <span>\n <button className='btn-link margin-right' onClick={() => { props.changeAvatar(''); }}>Remove Avatar</button>\n </span>\n );\n }\n\n function renderPersonalInfo() {\n return (\n <div>\n <EditableInput\n label='Name'\n onInputChanged={(e) => (setName(e.currentTarget.value))}\n onCancel={() => setName(props.user.name)}\n onSave={() => props.updateUser({ name })}\n id='user_name'\n value={name}\n key='user_name'\n />\n <EditableInput\n label='Username'\n onInputChanged={(e) => (setUsername(e.currentTarget.value))}\n onCancel={() => setUsername(props.user.username)}\n onSave={() => props.updateUser({ username })}\n id='user_username'\n value={username}\n key='user_username'\n />\n <EditableInput\n label='Email'\n onInputChanged={(e) => (setEmail(e.currentTarget.value))}\n onCancel={() => setEmail(props.user.email)}\n onSave={() => props.updateUser({ email })}\n id='user_email'\n value={email}\n key='user_email'\n />\n </div>\n );\n }\n\n return (\n <>\n <h1>Profile</h1>\n {renderProfilePhoto()}\n {renderPersonalInfo()}\n </>\n );\n};\n\nexport default UserProfile;\n","import React, { useState } from 'react';\n\nconst UserPasswordManager = (props) => {\n const emptyPackage = {\n current_password: '',\n password: '',\n password_confirmation: '',\n };\n const [passwordPackage, setPasswordPackage] = useState(emptyPackage);\n\n function handlePasswordInputChange(field, value) {\n setPasswordPackage({ ...passwordPackage, [field]: value });\n }\n\n function handlePasswordSubmit() {\n props.changePassword(passwordPackage)\n .done(() => {\n setPasswordPackage(emptyPackage);\n });\n }\n\n // if (CityGrows.Server.currentUser?.isGov) {\n // return (\n // <div>\n // <h1>Change Password</h1>\n // {\n // CityGrows.Server.currentUser?.isSSOAccount\n // ? <p>Accounts using single-sign on (SSO) cannot reset passwords. Check with your SSO identity provider for password reset options.</p>\n // : <a className='margin-top btn success' href='/users/reset_password'>Update Password</a>\n // }\n // </div>\n // );\n // }\n\n return (\n <div>\n <h1>Change Password</h1>\n <div className='padding-bottom'>\n <label htmlFor='current_password'>Current Password</label>\n <input id='current_password' type='password' value={passwordPackage.current_password} onChange={(e) => (handlePasswordInputChange('current_password', e.currentTarget.value))} />\n </div>\n <div className='padding-bottom'>\n <label htmlFor='password'>New Password</label>\n <input id='password' type='password' value={passwordPackage.password} onChange={(e) => (handlePasswordInputChange('password', e.currentTarget.value))} />\n </div>\n <div className='padding-bottom'>\n <label htmlFor='password_confirmation'>Confirm Password</label>\n <input type='password' value={passwordPackage.password_confirmation} onChange={(e) => (handlePasswordInputChange('password_confirmation', e.currentTarget.value))} />\n </div>\n <button className='btn-primary margin-top' onClick={handlePasswordSubmit}>Update Password</button>\n </div>\n );\n};\n\nexport default UserPasswordManager;\n","import React, { useState, useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport UserAPI from 'apis/user-api';\nimport { Switch } from 'react-router';\nimport {\n HashRouter as Router,\n NavLink,\n Route,\n useHistory,\n useLocation,\n} from 'react-router-dom';\n\nimport LeftMenu from 'components/shared/left-menu';\nimport Flash from 'components/shared/flash';\nimport UserEmailSettings from './user/email-settings';\nimport UserProfile from './user/profile';\nimport UserPasswordManager from './user/password-manager';\nimport MfaManager from './user/mfa-manager';\n\nconst activeClass = 'active';\n\nconst UserContainerRouter = (props) => {\n return (\n <Router>\n <UserContainer {...props} />\n </Router>\n );\n};\n\nconst UserContainer = ({ initialPath, user, settingsData }) => {\n const [localUser, setUser] = useState(user);\n const [imageLoading, setImageLoading] = useState(false);\n const location = useLocation();\n const initialLocation = useRef(location);\n const history = useHistory();\n\n useEffect(() => {\n if (initialLocation.current.pathname === '/') {\n // redirect if not on any child route\n history.push(initialPath);\n }\n }, [history, initialPath]);\n\n const changePassword = (data) => (\n UserAPI.update(data)\n .done(() => Flash.success('Password updated'))\n .fail((r) => Flash.error(r.responseText))\n );\n\n const changeAvatar = (file) => {\n setImageLoading(true);\n UserAPI.uploadAvatar(file)\n .done((r) => {\n Flash.success('Avatar updated');\n setImageLoading(false);\n setUser({ ...user, avatar_src: r.avatar_src, has_avatar: r.has_avatar });\n })\n .fail((r) => {\n Flash.error(r.responseText);\n setImageLoading(false);\n });\n };\n\n const sendUpdate = (update) => {\n const updatedUser = { ...localUser, ...update };\n return UserAPI.update(updatedUser)\n .done(() => {\n Flash.success('Profile updated');\n setUser(updatedUser);\n })\n .fail((res) => Flash.error(res.responseText));\n };\n\n const profileRenderer = () => (\n <UserProfile\n user={localUser}\n updateUser={sendUpdate}\n changeAvatar={changeAvatar}\n imageLoading={imageLoading}\n />\n );\n\n const passwordManagerRenderer = () => (\n <UserPasswordManager changePassword={changePassword} />\n );\n\n const mfaManagerRenderer = () => (\n <MfaManager />\n );\n\n const emailSettingsRenderer = () => (\n <UserEmailSettings\n currentUserId={user.id}\n emailSettings={settingsData.userSettings}\n workflows={settingsData.workflows}\n teams={settingsData.teams}\n initialType={settingsData.initialType}\n emails={settingsData.emails}\n />\n );\n\n const renderEmailSettingsLink = () => {\n if (window.CityGrows.Server.admin === false) { return null; }\n\n return (\n <li>\n <NavLink\n activeClassName={activeClass}\n to='/email_settings'\n >\n Email Settings\n </NavLink>\n </li>\n );\n };\n\n return (\n <div className='config'>\n <LeftMenu>\n <li>\n <NavLink\n activeClassName={activeClass}\n to='/profile'\n >\n Profile\n </NavLink>\n </li>\n <li>\n <NavLink\n activeClassName={activeClass}\n to='/password'\n >\n Change Password\n </NavLink>\n\n {/* { */}\n {/* CityGrows.Server.currentUser?.emailVerified */}\n {/* && <NavLink activeClassName={activeClass} to='/password'> Change Password </NavLink> */}\n {/* } */}\n </li>\n {/* <li> */}\n {/* {CityGrows.Server.currentUser?.isGov && <NavLink activeClassName={activeClass} to='/mfa'> Security </NavLink>} */}\n {/* </li> */}\n {renderEmailSettingsLink()}\n </LeftMenu>\n <div className='config-main'>\n <div className='raised bg-white padded-more margin-bottom-more'>\n <Switch>\n <Route path='/profile' render={profileRenderer} />\n <Route path='/password' render={passwordManagerRenderer} />\n {/* {CityGrows.Server.currentUser?.emailVerified && <Route path='/password' render={passwordManagerRenderer} />} */}\n {/* {CityGrows.Server.currentUser?.isGov && <Route path='/mfa' render={mfaManagerRenderer} />} */}\n {window.CityGrows.Server.admin === true && <Route path='/email_settings' render={emailSettingsRenderer} />}\n </Switch>\n </div>\n </div>\n </div>\n );\n};\n\nUserContainer.propTypes = {\n initialPath: PropTypes.string,\n user: PropTypes.object,\n settingsData: PropTypes.object,\n};\n\nexport default UserContainerRouter;\n","import React, { useEffect, useState } from 'react';\n\nconst DelayedRedirect = (props) => {\n const [count, setCount] = useState(props.waitFor);\n useEffect(() => {\n const interval = setInterval(() => {\n // update the state after 1000ms\n setCount((currentCount) => currentCount - 1);\n }, 1000);\n // when count is 0, navigate\n if (count === 1) {\n window.location = '/';\n }\n // clean up the interval\n return () => clearInterval(interval);\n }, [count]);\n return (\n <div>\n <p>Redirecting you in {count} sec </p>\n </div>\n );\n};\n\nexport default DelayedRedirect;\n","import React, { useState } from 'react';\nimport Flash from './shared/flash';\nimport UserAPI from '../apis/user-api';\nimport DelayedRedirect from './delayed-redirect';\n\nconst UnverifiedEmailApp = () => {\n const [textInfo, setTextInfo] = useState('We\\'ve sent you an email to verify your email address and activate your account.');\n const [redirect, setRedirect] = useState(false);\n\n function onSendVerificationEmailClick(e) {\n e.preventDefault();\n UserAPI.sendVerificationEmail().done((res) => {\n if (res.sent) {\n setTextInfo(res.text);\n } else {\n Flash.error(res.text);\n }\n setRedirect(true);\n }).fail((r) => Flash.error(r.responseText));\n }\n return (\n <div className='minimalcontentcontainer text-center'>\n <h1>Confirm your email address to start using ClearForms</h1>\n <p>{textInfo}</p>\n {\n redirect\n ? <DelayedRedirect to='/' waitFor={5} />\n : <a id='resend-email' href='#' onClick={onSendVerificationEmailClick}>Re-send verification email</a>\n }\n </div>\n );\n};\nexport default UnverifiedEmailApp;\n","import React from 'react';\nimport renderer from 'modules/renderer';\n\nimport UserContainer from 'components/user-container';\nimport CommonProviders from 'components/common-providers';\nimport UnverifiedEmailApp from 'components/unverified-email-app';\n\nfunction account() {\n renderer(\n (\n <CommonProviders>\n <UserContainer\n user={CityGrows.Server.user}\n settingsData={CityGrows.Server.settingsData}\n initialPath={CityGrows.Server.initialPath}\n />\n </CommonProviders>\n ), document.getElementById('user_account'),\n );\n}\n\nfunction unverifiedEmail() {\n renderer(\n (\n <CommonProviders>\n <UnverifiedEmailApp />\n </CommonProviders>\n ), document.getElementById('unverified-email-page'),\n );\n}\n\nexport default {\n account,\n unverifiedEmail,\n};\n","\nimport 'select2';\n\nconst knew = () => {\n $('select').select2();\n\n // PII\n $('#account-form').submit(() => {\n if ($('#pin').length === 0) { return null; }\n const $form = $(this);\n\n // Disable the submit button to prevent repeated clicks\n $form.find('input[type=submit]').prop('disabled', true);\n Stripe.piiData.createToken({\n personal_id_number: $('#pin').val(),\n }, stripeResponseHandler);\n\n // Prevent the form from submitting with the default action\n return false;\n });\n\n function stripeResponseHandler(status, response) {\n const $form = $('#account-form');\n\n if (response.error) {\n // Show the errors on the form\n $form.find('.payment-errors').text(response.error.message);\n $form.find('input[type=submit]').prop('disabled', false);\n } else {\n // response contains id and card, which contains additional card details\n const token = response.id;\n // Insert the token into the form so it gets submitted to the server\n $form.append($('<input type=\"hidden\" name=\"verification[legal_entity][personal_id_number]\" />').val(token));\n // and submit\n $form.get(0).submit();\n }\n }\n};\n\nexport default {\n new: knew,\n};\n","// Swap for lodash?\nimport _ from 'underscore';\nimport L from 'mapbox.js';\nimport 'offline-js';\nimport '@webcomponents/webcomponentsjs';\n\n// IE 11 Polyfill\nimport { ResizeObserver } from '@juggle/resize-observer';\n\nimport dayjs from 'dayjs';\nimport localizedFormat from 'dayjs/plugin/localizedFormat';\nimport customParseFormat from 'dayjs/plugin/customParseFormat';\nimport duration from 'dayjs/plugin/duration';\nimport relativeTime from 'dayjs/plugin/relativeTime';\n\nimport AdminRoles from 'initializers/admin-roles';\nimport BatchExportTemplates from 'initializers/batch-export-templates';\nimport ChargeDisputes from 'initializers/charge-disputes';\nimport CustomEntities from './initializers/custom-entities';\nimport Dashboards from './initializers/dashboards';\nimport EditSuggestionsRequests from './initializers/edit-suggestions-requests';\nimport Entities from './initializers/entities';\nimport EntityImports from './initializers/entity-imports';\nimport Exports from './initializers/exports';\nimport FlowTemplates from './initializers/flow-templates';\nimport InitiatedFlows from './initializers/initiated-flows.jsx';\nimport IssuedOutputs from './initializers/issued-outputs';\nimport Layout from './initializers/layout.jsx';\nimport MasterTemplateDocuments from './initializers/master-template-documents';\nimport MasterTemplateImports from './initializers/master-template-imports';\nimport MasterTemplates from './initializers/master-templates';\nimport MerchantAccounts from './initializers/merchant-accounts';\nimport MetricsDashboard from './initializers/metrics-dashboard';\nimport MyTasks from './initializers/my-tasks';\nimport Pages from './initializers/pages';\nimport PublicInitiatedFlows from './initializers/public/initiated-flows';\nimport PublicMasterTemplates from './initializers/public/master-templates';\nimport PublicSurveys from './initializers/public/surveys';\nimport PublicSurveySubmissions from './initializers/public/survey-submissions';\nimport PublicTeams from './initializers/public/teams';\nimport Registrations from './initializers/registrations';\nimport Review from './initializers/review';\nimport SearchPages from './initializers/search-pages';\nimport Teams from './initializers/teams';\nimport Transactions from './initializers/transactions';\nimport UnclaimedProcesses from './initializers/unclaimed-processes';\nimport Users from './initializers/users';\nimport Verifications from './initializers/verifications';\nimport objectPatch from './modules/object-patch';\n\nwindow.ResizeObserver = ResizeObserver;\ndayjs.extend(relativeTime);\ndayjs.extend(duration);\ndayjs.extend(localizedFormat);\ndayjs.extend(customParseFormat);\n\nL.mapbox.accessToken = 'pk.eyJ1IjoiY29yd2luc3RlcGhlbiIsImEiOiJkUmYyVlYwIn0.W1x76fJSmLH8Lo34sVCSgw';\n\nconst initializers = {\n 'MasterTemplate::Documents': MasterTemplateDocuments,\n 'MasterTemplate::Imports': MasterTemplateImports,\n 'Public::InitiatedFlows': PublicInitiatedFlows,\n 'Public::MasterTemplates': PublicMasterTemplates,\n 'Public::Surveys': PublicSurveys,\n 'Public::SurveySubmissions': PublicSurveySubmissions,\n 'Public::Teams': PublicTeams,\n AdminRoles,\n BatchExportTemplates,\n ChargeDisputes,\n CustomEntities,\n Dashboards,\n EditSuggestionsRequests,\n Entities,\n EntityImports,\n Exports,\n FlowTemplates,\n InitiatedFlows,\n IssuedOutputs,\n Layout,\n MasterTemplates,\n MerchantAccounts,\n MetricsDashboard,\n MyTasks,\n Pages,\n Review,\n SearchPages,\n Teams,\n Transactions,\n UnclaimedProcesses,\n Users,\n Registrations,\n Verifications,\n};\n\n$(document).ready(() => {\n // Apply patches\n objectPatch.run();\n\n //\n // Serves as the JS entrypoint on any given page. Essentially\n // just tries to call ControllerName.actionName();\n //\n\n initializers.Layout();\n const controller = initializers[CityGrows.Server.controllerName];\n const action = CityGrows.Server.actionName;\n\n if (!_.isUndefined(controller) && _.isFunction(controller[action])) {\n controller[action]();\n } else {\n console.log('No JS to init');\n }\n});\n","import React, { useState, useRef } from 'react';\nimport _ from 'underscore';\nimport { icon } from '@fortawesome/fontawesome-svg-core/import.macro';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport useFocusTrap from 'components/hooks/use-focus-trap';\n\nconst Alertconfirm = (props) => {\n const [errorMessage, setErrorMessage] = useState(null);\n const challengeResponse = useRef();\n const focusEl = useFocusTrap();\n\n function renderButtons () {\n const confirmButton = <button id='alertconfirm-confirmbutton' className='btn-primary' onClick={onConfirmClick}>Okay</button>;\n\n if (props.type === 'confirm') {\n return (\n <div>\n <button className='btn-secondary margin-right' onClick={props.onCancel}>Never mind</button>\n {confirmButton}\n </div>\n );\n }\n return (\n <div>\n {confirmButton}\n </div>\n );\n }\n\n function onConfirmClick () {\n setErrorMessage(null);\n\n if (!props.challenge) {\n props.onConfirm();\n } else if (props.challengeAnswer.toString() === challengeResponse.current.value) {\n props.onConfirm();\n } else {\n setErrorMessage('Invalid response');\n }\n }\n\n function renderErrorMessage () {\n if (errorMessage) {\n return <div className='margin-top text-alert strong align-right'>{errorMessage}</div>;\n }\n }\n\n function renderMessageBody () {\n const challengeHTML = props.challenge ? (\n <div className='margin-bottom'>\n <div className='linebreak' />\n <span>{props.challenge}</span>\n <input type='text' ref={challengeResponse} className='box' size='6' />\n {renderErrorMessage()}\n </div>\n ) : null;\n\n const bodyTag = _.isString(props.body)\n ? <div dangerouslySetInnerHTML={{ __html: props.body }} />\n : props.body;\n\n return (\n <div>\n {bodyTag}\n {challengeHTML}\n </div>\n );\n }\n\n return (\n <div id='alertconfirm' ref={focusEl} className={`alertconfirm-container ${props.klass ?? ''}`}>\n <div className='cf'>\n <FontAwesomeIcon icon={icon({ name: 'triangle-exclamation' })} size='2xl' className='alertconfirm-icon' />\n <dl className='alertconfirm-text margin-bottom'>\n <dt className='alertconfirm-title'>{props.title}</dt>\n <dd className='alertconfirm-message'>\n {renderMessageBody()}\n </dd>\n </dl>\n </div>\n <div className='alertconfirm-actions align-right'>\n {renderButtons()}\n </div>\n </div>\n );\n};\n\nexport default Alertconfirm;\n","function log(value) {\n if (CityGrows.Server.env !== 'production') {\n console.log(value);\n }\n}\n\nexport default {\n log,\n};\n","import React from 'react';\nimport renderer from 'modules/renderer';\nimport ReactDOM from 'react-dom'\nimport { isFunction } from 'underscore';\nimport AlertConfirm from '../components/module_views/alert-confirm';\nimport Shield from './shield';\nimport Logger from './logger';\n\nlet el;\n\nexport function alert(title, body, onConfirm) {\n const onConfirmWithClose = function () {\n Shield.off();\n\n if (isFunction(onConfirm)) {\n onConfirm();\n }\n unmount();\n };\n\n Shield.on();\n\n el = renderer(\n <AlertConfirm title={title} body={body} onConfirm={onConfirmWithClose} type='alert' />,\n document.getElementById('alertconfirm-container'),\n );\n}\n\nexport function confirm(title, body, onConfirm = () => {}, onCancel = () => {}, klass = null) {\n const promise = $.Deferred();\n\n const onConfirmWithClose = () => {\n Shield.off();\n\n try {\n promise.resolve();\n onConfirm();\n } catch (e) {\n Logger.log(e);\n }\n\n unmount();\n };\n\n const onCancelWithClose = () => {\n Shield.off();\n\n try {\n promise.reject();\n onCancel();\n } catch (e) {\n Logger.log(e);\n }\n\n unmount();\n };\n\n Shield.on();\n\n el = renderer(\n <AlertConfirm\n title={title}\n body={body}\n onConfirm={onConfirmWithClose}\n onCancel={onCancelWithClose}\n type='confirm'\n klass={klass}\n />,\n document.getElementById('alertconfirm-container'),\n );\n\n return promise;\n}\n\nfunction strongConfirm(title, body, challenge, challengeAnswer) {\n const promise = $.Deferred();\n\n const onConfirmWithClose = function () {\n Shield.off();\n promise.resolve();\n unmount();\n };\n\n const onCancelWithClose = function () {\n Shield.off();\n promise.reject();\n unmount();\n };\n\n Shield.on();\n\n el = renderer(\n <AlertConfirm\n title={title}\n body={body}\n onConfirm={onConfirmWithClose}\n onCancel={onCancelWithClose}\n challenge={challenge}\n challengeAnswer={challengeAnswer}\n type='confirm'\n />,\n document.getElementById('alertconfirm-container'),\n );\n\n return promise;\n}\n\nfunction unmount() {\n ReactDOM.unmountComponentAtNode(document.getElementById('alertconfirm-container'));\n}\n\nexport default {\n alert,\n confirm,\n strongConfirm,\n};\n","import PhoneValidator from 'phone';\nimport {\n filter, isArray, isEmpty, isFinite, isNumber, isNull,\n} from 'underscore';\nimport EmailValidator from './email-validator';\n\nfunction validate(value, field) {\n if (!value || value.length < 1) {\n return false;\n }\n\n // Now let's make sure it's legit.\n //\n switch (field.data_type) {\n case 'integer':\n case 'float':\n case 'money':\n return validateNumber(value, field);\n case 'email':\n return EmailValidator.validate(value);\n case 'phone':\n return !isEmpty(PhoneValidator(value));\n case 'multiple_choice':\n return Number(value) !== 0 && isNumber(Number(value));\n case 'checkboxes':\n if (!field.hasOwnProperty('min_num_checks')) {\n throw 'Checkbox field is missing required min_num_checks property';\n }\n\n return checkboxResponseTally(value) >= field.min_num_checks;\n case 'file':\n return isArray(value) && value.length > 0;\n case 'date_range':\n if (!value.start_date || !value.end_date) { return false; }\n\n return value.start_date.length > 0 && value.end_date.length > 0;\n default:\n return true;\n }\n}\n\nfunction isFloat(value) {\n return isFinite(value) && !isNull(value.match(/^-?[0-9]+(\\.[0-9]+)?$/));\n}\n\nfunction checkboxResponseTally(checkboxFieldContent) {\n const checked = filter(checkboxFieldContent, (v, k) => {\n return !!v;\n });\n\n return checked.length;\n}\n\nfunction validateNumber(value, field) {\n return validateNumberFormat(value, field) && validateNumberInRange(value, field);\n}\n\nfunction validateNumberFormat(value, field) {\n switch (field.data_type) {\n case 'integer':\n return isFinite(value) && (value % 1 === 0) && !isNull(value.trim().match(/^-?[0-9]+$/));\n default:\n return isFloat(value);\n }\n}\n\nfunction validateNumberInRange(value, field) {\n const parsedValue = parseFloat(value);\n let min = parseFloat(field.min_value);\n min = isFinite(min) ? min : parsedValue;\n let max = parseFloat(field.max_value);\n max = isFinite(max) ? max : parsedValue;\n\n return min <= parsedValue && parsedValue <= max;\n}\n\nexport { validate, validateNumberFormat, validateNumberInRange };\n","/* eslint-disable import/prefer-default-export */\n\nexport const reorder = (list, startIndex, endIndex) => {\n const result = Array.from(list);\n const [removed] = result.splice(startIndex, 1);\n result.splice(endIndex, 0, removed);\n\n return result;\n};\n","function validateEmail(email) {\n if (!email) { return false; }\n const re = /^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]+$/;\n return re.test(email);\n}\n\nexport default {\n validate: validateEmail,\n};\n","import {\n each, contains, filter,\n} from 'underscore';\n\nconst LOGIC_ENABLED_FIELDS = ['multiple_choice', 'checkboxes', 'integer', 'float'];\n\nclass FieldManager {\n constructor(steps) {\n this.steps = steps;\n }\n\n availableEmailFields(stepPositionLimit) {\n const availableFields = [];\n\n each(this.getStepData(), ({ position, stepData }) => {\n each(stepData, (stepDatum) => {\n if (stepDatum.data_type === 'email'\n && stepDatum.required\n && position <= stepPositionLimit) {\n availableFields.push({ ...stepDatum, stepPosition: position });\n }\n });\n });\n\n return availableFields;\n }\n\n availableLogicFields() {\n const availableFields = [];\n\n each(this.getStepData(), ({stepData}) => {\n each(stepData, (stepDatum) => {\n if (contains(LOGIC_ENABLED_FIELDS, stepDatum.data_type)) {\n availableFields.push(stepDatum);\n }\n })\n });\n\n return availableFields;\n }\n\n getCollectInfoSteps() {\n return filter(this.steps, (step) => {\n return step.type === 'CollectInfoStep';\n });\n }\n\n getStepData() {\n return this.getCollectInfoSteps().map((step) => { return {stepData: step.step_data, position: step.position} });\n }\n\n findStepDatumByIdentity(identity) {\n let stpDtm = null;\n each(this.getStepData(), ({ position, stepData }) => {\n each(stepData, (stepDatum) => {\n if (stepDatum.identity === identity) {\n stpDtm = { ...stepDatum, stepPosition: position };\n }\n });\n });\n\n return stpDtm;\n }\n}\n\nexport default FieldManager;\n","function run() {\n if (typeof Object.assign !== 'function') {\n Object.assign = function (target) {\n if (target == null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n\n target = Object(target);\n for (let index = 1; index < arguments.length; index++) {\n const source = arguments[index];\n if (source != null) {\n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n }\n return target;\n };\n }\n}\n\nmodule.exports = {\n run,\n};\n","import { extend } from 'underscore';\n\nfunction pluralize(word, count, opts) {\n const config = extend({\n many: `${word}s`,\n }, opts);\n\n if (count === 1) {\n return word;\n }\n return config.many;\n}\n\nexport default pluralize;\n","\nimport Flash from '../components/shared/flash';\n\nvar JobsAPI = {\n status: function(jobId){\n const URL = `/jobs/${jobId}`;\n\n return $.ajax(URL, {\n dataType: 'json',\n method: 'GET'\n });\n },\n\n\tdestroy: function(jobID){\n\t\tconst URL = `/jobs/${jobID}`;\n\n\t\treturn $.ajax(URL, {\n\t\t\tmethod: 'DELETE',\n\t\t\tdataType: 'JSON'\n\t\t})\n\t\t.error(() => { Flash.error(); });\n\t}\n};\n\nexport default JobsAPI;\n","\n\nimport JobsAPI from '../apis/jobs-api';\n\nclass PollableJob {\n constructor(queueFunction) {\n this.queueFunction = queueFunction;\n this._promise = null;\n }\n\n run = () => {\n this._promise = $.Deferred();\n\n this.queueFunction()\n .done(this.onSuccessfulQueue)\n .fail(this.onJobFailed);\n\n return this._promise;\n }\n\n onSuccessfulQueue = (res) => {\n this.poll(res.job_id);\n }\n\n poll = (jobId) => {\n JobsAPI.status(jobId)\n .fail(this.onJobFailed)\n .done((res) => { this.processJobStatus(res, jobId); });\n }\n\n processJobStatus = (res, jobId) => {\n if (res.status === 'complete') {\n this.onPollingComplete(res.result);\n } else if (res.status === 'failed') {\n this.onJobFailed();\n } else if (['working', 'queued'].includes(res.status)) {\n setTimeout(() => { this.poll(jobId); }, 1000);\n } else {\n this.onJobFailed();\n }\n }\n\n onJobFailed = () => {\n this._promise.reject();\n this._promise = null;\n }\n\n onPollingComplete = (status) => {\n this._promise.resolve(status);\n }\n}\n\nexport default PollableJob;\n","import ReactDom from 'react-dom';\n\nfunction renderer(component, element) {\n return ReactDom.render(component, element);\n}\n\nexport default renderer;\n","const _shieldEnabled = false;\nlet originalOverflow;\n\nfunction addShield() {\n let $shield = $('#shield');\n if ($shield.length === 0) {\n $shield = $('<div id=\"shield\"></div>');\n $('body').append($shield);\n }\n\n $shield.addClass('visible');\n\n const $body = $('body');\n if (!$body.hasClass('shield-visable')) {\n $body.addClass('shield-visable');\n }\n}\n\nfunction removeShield() {\n const $shield = $('#shield');\n $('body').removeClass('shield-visable');\n $shield.removeClass('visible');\n}\n\nfunction toggleShield() {\n _shieldEnabled ? removeShield() : addShield();\n}\n\nexport default {\n on: addShield,\n off: removeShield,\n toggle: toggleShield,\n};\n","export const slugIsValid = (slug) => {\n return slug\n && slug.match(/^[a-zA-Z0-9_\\-]{3,}$/)\n && !slug.match(/^[0-9]+$/);\n};\n\nexport default slugIsValid;\n","import invariant from 'invariant';\nimport { reject, findWhere } from 'underscore';\n\nconst fixedDataTypes = [\n {\n name: 'Text',\n type: 'string',\n },\n {\n name: 'Paragraph text',\n type: 'text',\n },\n {\n name: 'Email',\n type: 'email',\n },\n {\n name: 'Number (no decimal)',\n type: 'integer',\n },\n {\n name: 'Number (with decimal)',\n type: 'float',\n },\n {\n name: 'Money',\n type: 'money',\n },\n {\n name: 'Address',\n type: 'address',\n },\n { name: 'Date Range',\n type: 'date_range'\n },\n {\n name: 'Date/Time',\n type: 'date',\n },\n {\n name: 'Multiple choice (choose one)',\n type: 'multiple_choice',\n },\n {\n name: 'Checkboxes (choose many)',\n type: 'checkboxes',\n },\n {\n name: 'File',\n type: 'file',\n },\n {\n name: 'Phone number',\n type: 'phone',\n },\n];\n\nconst buildCustomEntityField = (customEntity) => {\n return {\n name: customEntity.name,\n type: `entity-${customEntity.id}`,\n customEntityId: customEntity.id,\n };\n};\n\nconst allDataTypes = (entityTypes = []) => {\n let types = fixedDataTypes;\n\n entityTypes.forEach((customEntity) => {\n types = types.concat(buildCustomEntityField(customEntity));\n });\n\n return types;\n};\n\nexport function getDataTypes(dataCollectible, opts = {}) {\n switch (dataCollectible) {\n case 'CollectInfoStep':\n invariant(opts.customEntities, 'Must provide custom entities for CollectInfoStep');\n\n return allDataTypes(opts.customEntities);\n case 'SurveyStep':\n return reject(fixedDataTypes, (dataType) => ['file', 'entity'].includes(dataType.type));\n case 'Entity':\n return reject(fixedDataTypes, (dataType) => ['multiple_choice', 'checkboxes'].includes(dataType.type));\n default:\n throw `Invalid dataCollectible ${dataCollectible}`;\n }\n}\n\nexport function fieldNameForType(type, opts = {}) {\n if (type === 'entity') {\n if (opts.customEntityName) {\n // Probably we should just be passing this everywhere instead\n // of overcomplicating things below.\n return opts.customEntityName;\n }\n \n invariant(opts.customEntities, 'Must provide custom entities');\n invariant(opts.customEntityId, `Must provide customEntityId. Got: ${opts.customEntityId}`);\n\n type = `entity-${opts.customEntityId}`;\n }\n\n const dataType = findWhere(allDataTypes(opts.customEntities), { type });\n invariant(dataType, 'Data type does not exist');\n\n return dataType.name;\n}\n\nconst StepDataTypes = {\n getDataTypes,\n fieldNameForType,\n};\n\nexport default StepDataTypes;\n","function getTemplateVariables(formulas, fields, type) {\n const formattedFormulas = formulas.map((formula, idx) => {\n return {\n id: formula.identity,\n name: formula.name,\n displayName: formula.name,\n mentionType: 'Formula',\n selectedIconClass: 'icon-formula-primary-2',\n iconClass: 'icon-formula-black',\n };\n });\n\n const stepData = fields.map((field) => {\n return {\n mentionType: 'Field',\n id: field.identity,\n name: field.name,\n displayName: `${field.section_name}-${field.name}`,\n selectedIconClass: 'icon-field-primary-2',\n iconClass: 'icon-field-black',\n };\n });\n\n const constantVariables = [\n {\n name: 'launcher_name',\n displayName: 'launcher_name',\n mentionType: 'Keyword',\n id: 'launcher_name',\n selectedIconClass: 'icon-keyword-primary-2',\n iconClass: 'icon-keyword-black',\n },\n ];\n\n const baseVariables = [...formattedFormulas, ...stepData, ...constantVariables];\n\n switch (type) {\n case 'Instructions':\n return baseVariables;\n case 'CompletionMessage':\n return baseVariables;\n case 'ReviewMessages':\n return baseVariables;\n case 'Email':\n baseVariables.push({\n name: 'process_link',\n displayName: 'process_link',\n mentionType: 'Keyword',\n id: 'process_link',\n selectedIconClass: 'icon-keyword-primary-2',\n iconClass: 'icon-keyword-black',\n });\n return baseVariables;\n }\n}\n\nexport default getTemplateVariables;\n","export function adminHost() {\n const domainParts = window.location.host.split('.');\n if (domainParts[0] === 'go') {\n domainParts[0] = 'admin';\n }\n\n return `${window.location.protocol}//${domainParts.join('.')}`;\n}\n\nexport function publicHost() {\n const domainParts = window.location.host.split('.');\n if (domainParts[0] === 'admin') {\n domainParts[0] = 'go';\n }\n\n return `${window.location.protocol}//${domainParts.join('.')}`;\n}\n\nexport default {\n publicHost,\n adminHost,\n};\n","import Dispatcher from 'appdispatcher';\nimport Constants from 'constants/template-manager-constants';\nimport MultipleChoiceOptionConstants from 'constants/multiple-choice-option-constants';\nimport AttachedPeopleConstants from 'constants/attached-people-constants';\nimport {\n find, findWhere, compact, flatten, without, extend, reject, each, get, any\n} from 'underscore';\nimport Stapes from 'stapes';\n\nlet _masterTemplate = null;\nconst _formulaTermSearchResults = [];\nlet _flowTemplate = {\n steps: [],\n};\n\nconst CHANGE_EVENT = 'change';\nconst TERM_SEARCH_RESULTS_CHANGE_EVENT = 'termSearchResultsChange';\n\nfunction getStep(stepId) {\n return find(_flowTemplate.steps, (step) => {\n return step.id === stepId;\n });\n}\n\nfunction getReviewGroups() {\n return compact(flatten(_flowTemplate.steps.map((step) => step.review_groups)));\n}\n\nfunction getStepAssignmentGroups() {\n return compact(flatten(_flowTemplate.steps.map((step) => step.step_assignment_groups)));\n}\n\nfunction getReviewGroup(reviewGroupId) {\n const reviewGroupToUpdate = getReviewGroups().find((group) => {\n return group.id === reviewGroupId;\n });\n\n return reviewGroupToUpdate;\n}\n\nfunction getStepAssignmentGroup(stepAssignmentGroupId) {\n const stepAssignmentGroupToUpdate = getStepAssignmentGroups().find((group) => {\n return group.id === stepAssignmentGroupId;\n });\n\n return stepAssignmentGroupToUpdate;\n}\n\nfunction getNotifications() {\n return compact(flatten(_flowTemplate.steps.map((step) => {\n return step.email_notifications;\n })));\n}\n\nfunction getNotification(notificationId) {\n return find(getNotifications(), (notif) => {\n if (notif.id === notificationId) {\n return notif;\n }\n });\n}\n\nfunction getAllSections() {\n return getStepSections().concat(getSurveySections());\n}\n\nfunction getSection(sectionId) {\n return findWhere(getAllSections(), { id: sectionId });\n}\n\nfunction getStepSections() {\n return compact(flatten(_flowTemplate.steps.map((step) => step.sections)));\n}\n\nfunction getSurveys() {\n const surveySteps = _flowTemplate.steps.filter((step) => step.type === 'SurveyStep');\n return surveySteps.map((step) => step.survey);\n}\n\nfunction getSurvey(surveyId) {\n return getSurveys().find((survey) => survey.id === surveyId);\n}\n\nfunction getSurveySections() {\n const sections = getSurveys().map((survey) => survey.sections);\n\n return flatten(sections);\n}\n\nfunction getDatum(stepDatumId) {\n return findWhere(getData(), {\n id: stepDatumId,\n });\n}\n\nfunction getStepData() {\n const stepData = [];\n _flowTemplate.steps.map((step) => {\n if (step.step_data) {\n stepData.push(step.step_data);\n }\n });\n\n return flatten(stepData);\n}\n\nfunction getData() {\n const stepData = [];\n _flowTemplate.steps.map((step) => {\n if (step.step_data) {\n stepData.push(step.step_data);\n }\n\n if (step.survey) {\n stepData.push(step.survey.step_data);\n }\n });\n\n return flatten(stepData);\n}\n\nfunction getOptions() {\n return flatten(getData().map((datum) => {\n return datum.multiple_choice_options;\n }));\n}\n\nfunction getOption(optionId) {\n return find(getOptions(), (option) => {\n return option.id === optionId;\n });\n}\n\nfunction addDataRow(sectionId, datum) {\n const section = getSection(sectionId);\n const sectionable = getSectionable(section);\n\n sectionable.step_data.push(datum);\n}\n\nfunction updateDataRow(datumId, attrs) {\n const datum = findWhere(getData(), { id: datumId });\n extend(datum, attrs);\n}\n\nfunction removeDataRow(stepDatumId) {\n const datum = findWhere(getData(), { id: stepDatumId });\n const section = getSection(datum.section_id);\n const sectionable = getSectionable(section);\n sectionable.step_data = without(sectionable.step_data, datum);\n}\n\nfunction moveDataRow(data) {\n getData().forEach((datum) => {\n const updatedMatch = findWhere(data, {\n id: datum.id,\n });\n\n if (updatedMatch) {\n datum.position = updatedMatch.position;\n datum.section_id = updatedMatch.section_id;\n }\n });\n}\n\nfunction addStep(newStep) {\n const newSteps = [..._flowTemplate.steps, newStep];\n _flowTemplate.steps = newSteps;\n}\n\nfunction removeStep(stepId) {\n _flowTemplate.steps = reject(_flowTemplate.steps, (step) => {\n return step.id === stepId;\n });\n}\n\nfunction updateStep(stepId, attrs) {\n const step = _flowTemplate.steps.find((step) => {\n return step.id === stepId;\n });\n\n extend(step, attrs);\n}\n\nfunction reorderSteps(stepPositions) {\n _flowTemplate.steps.forEach((step) => { step.position = stepPositions[step.id]; });\n}\n\nfunction addSection(stepId, section) {\n const step = getStep(stepId);\n step.sections.push(section);\n}\n\nfunction updateSection(updatedSection) {\n const sectionToUpdate = getSection(updatedSection.id);\n extend(sectionToUpdate, updatedSection);\n}\n\nfunction getSectionable(section) {\n switch (section.sectionable_type) {\n case 'Survey':\n return getSurvey(section.sectionable_id);\n case 'Step':\n return getStep(section.sectionable_id);\n default:\n throw new Error(`Invalid sectionable type: ${section.sectionable_type}`);\n }\n}\n\nfunction destroySection(sectionId) {\n const sectionToDestroy = getSection(sectionId);\n const sectionable = getSectionable(sectionToDestroy);\n sectionable.step_data = sectionable.step_data.filter((stepDatum) => {\n return stepDatum.section_id !== sectionId;\n });\n sectionable.sections = sectionable.sections.filter((section) => section !== sectionToDestroy);\n}\n\nfunction moveSection(sections) {\n sections.forEach((section) => {\n const match = getSection(section.id);\n\n if (match) {\n match.position = section.position;\n }\n });\n}\n\nfunction updateEmailNotification(notificationId, attrs) {\n const notif = getNotification(notificationId);\n extend(notif, attrs);\n}\n\nfunction addEmailNotification(stepId, attrs) {\n const step = getStep(stepId);\n step.email_notifications.push(attrs);\n}\n\nfunction destroyEmailNotification(notificationId) {\n const notif = getNotification(notificationId);\n const step = getStep(notif.step_id);\n step.email_notifications = without(step.email_notifications, notif);\n}\n\nfunction addSurveySection(section, stepId) {\n const step = getStep(stepId);\n step.survey.sections.push(section);\n}\n\nfunction updateSurvey(updatedSurvey) {\n const step = getStep(updatedSurvey.survey_step_id);\n step.survey = updatedSurvey;\n}\n\nfunction updateOutput(updatedOutput) {\n const output = getOutput(updatedOutput.id);\n extend(output, updatedOutput);\n}\n\nfunction addRenewalReminder(renewalReminderAttrs) {\n const output = getOutput(renewalReminderAttrs.configured_output_id);\n output.renewal_reminders.push(renewalReminderAttrs);\n}\n\nfunction updateRenewalReminder(attrs) {\n const output = getOutput(attrs.configured_output_id);\n const reminder = findWhere(output.renewal_reminders, { id: attrs.id });\n Object.assign(reminder, attrs);\n}\n\nfunction removeRenewalReminder(attrs) {\n const output = getOutput(attrs.configured_output_id);\n output.renewal_reminders = reject(output.renewal_reminders, (r) => {\n return r.id === attrs.id;\n });\n}\n\nfunction getOutput(outputId) {\n return _flowTemplate.configured_outputs.find((output) => {\n return output.id === outputId;\n });\n}\n\nfunction addReviewGroup(reviewGroupAttrs) {\n const step = getStep(reviewGroupAttrs.step_id);\n step.review_groups.push(reviewGroupAttrs);\n}\n\nfunction updateReviewGroup(updatedReviewGroup) {\n const reviewGroup = getReviewGroup(updatedReviewGroup.id);\n extend(reviewGroup, updatedReviewGroup);\n}\n\nfunction destroyReviewGroup(reviewGroupId) {\n const reviewGroupToDestroy = getReviewGroup(reviewGroupId);\n const step = getStep(reviewGroupToDestroy.step_id);\n step.review_groups = without(step.review_groups, reviewGroupToDestroy);\n}\n\nfunction getAttachableType(type, id) {\n if (type === 'Step') {\n return getStep(id);\n } if (type === 'ReviewGroup') {\n return getReviewGroup(id);\n }\n}\n\nfunction toggleAttachedPerson(person, id, type) {\n const attachable = getAttachableType(type, id);\n\n if (person.persisted) {\n attachable.person_attachments.push(person);\n } else {\n attachable.person_attachments = reject(attachable.person_attachments, (p) => {\n return p.id === person.id;\n });\n }\n}\n\nfunction updateRoleUsers(person, roleId, attachableId, type) {\n const attachable = getAttachableType(type, attachableId);\n const attachment = findWhere(attachable.person_attachments, { id: roleId, type: 'AdminRole' });\n if (person.persisted) {\n attachment.user_count += 1;\n attachment.user_ids.push(person.id);\n } else {\n attachment.user_count -= 1;\n const index = attachment.user_ids.indexOf(person.id);\n attachment.user_ids = attachment.user_ids.splice(index, 1);\n }\n}\n\nfunction addMultipleChoiceOption(stepDatumId, optionAttrs) {\n const datum = getDatum(stepDatumId);\n datum.multiple_choice_options.push(optionAttrs);\n}\n\nfunction removeMultipleChoiceOption(optionId) {\n const option = getOption(optionId);\n const datum = getDatum(option.step_datum_id);\n datum.multiple_choice_options = without(datum.multiple_choice_options, option);\n}\n\nfunction updateMultipleChoiceOption(optionId, optionAttrs) {\n const option = getOption(optionId);\n\n // If making default, clear other defaults\n if (!option.is_default && optionAttrs.is_default) {\n clearSiblingDefaults(optionId);\n }\n\n extend(option, optionAttrs);\n}\n\nfunction moveMultipleChoiceOption(options) {\n getOptions().forEach((option) => {\n const updatedMatch = findWhere(options, {\n id: option.id,\n });\n\n if (updatedMatch) {\n option.position = updatedMatch.position;\n }\n });\n}\n\nfunction clearSiblingDefaults(optionId) {\n const option = getOption(optionId);\n const datum = getDatum(option.step_datum_id);\n\n each(datum.multiple_choice_options, (o) => {\n o.is_default = false;\n });\n}\n\nfunction getLogicable(logicConfig) {\n switch (logicConfig.logicable_type) {\n case 'StepDatum::Section':\n return getSection(logicConfig.logicable_id);\n case 'ReviewGroup':\n return getReviewGroup(logicConfig.logicable_id);\n case 'StepAssignmentGroup':\n return getStepAssignmentGroup(logicConfig.logicable_id);\n default:\n throw new Error(`Unhandled logicable_type ${logicConfig.logicable_type}`);\n }\n}\n\nfunction addLogicConfig(logicConfig) {\n const logicable = getLogicable(logicConfig);\n logicable.logic_config = logicConfig;\n}\n\nfunction removeLogicConfig(logicConfig) {\n const logicable = getLogicable(logicConfig);\n logicable.logic_config = null;\n}\n\nfunction replaceAssignmentGroups(stepId, newGroups) {\n const step = getStep(stepId);\n step.step_assignment_groups = newGroups;\n}\n\nfunction setFormula(formula) {\n const existingFormula = findWhere(_flowTemplate.formulas, { id: formula.id });\n\n if (existingFormula) {\n extend(existingFormula, formula);\n } else {\n _flowTemplate.formulas.push(formula);\n }\n}\n\nfunction removeFormula(formulaId) {\n _flowTemplate.formulas = reject(_flowTemplate.formulas, (formula) => {\n return formula.id === formulaId;\n });\n}\n\nfunction setMasterTemplate(masterTemplate) {\n _masterTemplate = masterTemplate;\n}\n\nfunction setFlowTemplate(flowTemplate) {\n _flowTemplate = flowTemplate;\n}\n\nfunction updateFlowTemplate(attrs) {\n extend(_flowTemplate, attrs, { is_modified: get(attrs, 'is_modified', true) });\n}\n\nfunction addFAQ(faq) {\n _masterTemplate.faqs.push(faq);\n}\n\nfunction updateFAQ(updatedFaq) {\n const faq = findWhere(_masterTemplate.faqs, { id: updatedFaq.id });\n extend(faq, updatedFaq);\n}\n\nfunction removeFAQ(faqId) {\n _masterTemplate.faqs = reject(_masterTemplate.faqs, (faq) => { return faq.id === faqId; });\n}\n\nfunction addSubprocessConfig(config) {\n _flowTemplate.subprocess_configs = [config, ..._flowTemplate.subprocess_configs];\n}\n\nfunction removeSubprocessConfig(id) {\n _flowTemplate.subprocess_configs = reject(_flowTemplate.subprocess_configs, (config) => {\n return config.id === id;\n });\n}\n\nfunction addSearchConfig(config) {\n _masterTemplate.search_page_configs = [config, ..._masterTemplate.search_page_configs];\n}\n\nfunction updateSearchConfig(updatedConfig) {\n const config = findWhere(_masterTemplate.search_page_configs, { id: updatedConfig.id });\n extend(config, updatedConfig);\n}\n\nfunction removeSearchConfig(id) {\n _masterTemplate.search_page_configs = reject(_masterTemplate.search_page_configs, (config) => {\n return config.id === id;\n });\n}\n\nfunction setModifiedStatus(modified) {\n _flowTemplate.is_modified = modified;\n}\n\nfunction addCustomId(customId) {\n _masterTemplate.custom_id = customId;\n}\n\nfunction setSlug(slug) {\n _masterTemplate.friendly_id = slug;\n _masterTemplate.slug = slug;\n}\n\nfunction removeCustomId() {\n _masterTemplate.custom_id = null;\n}\n\nfunction addAssignmentGroup(group) {\n const step = findWhere(_flowTemplate.steps, { id: group.step_id });\n if (!step) { throw new Error('Expected to find step'); }\n\n step.step_assignment_groups = [...step.step_assignment_groups, group];\n}\n\nfunction deleteAssignmentGroup(id) {\n const group = findAssignmentGroup(id);\n if (!group) { throw new Error('Expected to find group'); }\n\n const step = findWhere(_flowTemplate.steps, { id: group.step_id });\n if (!step) { throw new Error('Expected to find step'); }\n\n step.step_assignment_groups = without(step.step_assignment_groups, group);\n}\n\nfunction getAssignmentGroups() {\n return _flowTemplate.steps.map((s) => s.step_assignment_groups).flat();\n}\n\nfunction findAssignmentGroup(groupId) {\n const groups = _flowTemplate.steps.map((s) => s.step_assignment_groups).flat();\n return findWhere(groups, { id: groupId });\n}\n\nfunction addAssignment(assignment) {\n const group = findAssignmentGroup(assignment.step_assignment_group_id);\n if (!group) { throw new Error('Expected to find group'); }\n\n group.step_assignments = [...group.step_assignments, assignment];\n}\n\nfunction removeAssignment(assignmentId) {\n const group = find(getAssignmentGroups(), (g) => {\n return any(g.step_assignments, (a) => a.id === assignmentId);\n });\n if (!group) { throw new Error('Expected to find group'); }\n\n group.step_assignments = reject(group.step_assignments, (a) => {\n return a.id === assignmentId;\n });\n}\n\nconst TemplateManagerStore = Stapes.subclass({\n emitChange() {\n this.emit(CHANGE_EVENT);\n },\n\n emitTermSearchResultsChangeEvent() {\n this.emit(TERM_SEARCH_RESULTS_CHANGE_EVENT);\n },\n\n getFlowTemplate() {\n return $.extend(true, {}, _flowTemplate);\n },\n\n getMasterTemplate() {\n return $.extend(true, {}, _masterTemplate);\n },\n\n getFormulaTermSearchResults() {\n return $.extend(true, [], _formulaTermSearchResults);\n },\n\n getStepData() {\n return getStepData();\n },\n\n _setSteps(steps) {\n _flowTemplate.steps = steps;\n },\n\n // Will display banner indicating template has\n // been modified.\n markChanged() {\n updateFlowTemplate({});\n this.emitChange();\n },\n\n getDefaultActiveStepId() {\n if (_flowTemplate.steps.length === 0) {\n return null;\n }\n return _flowTemplate.steps[0].id;\n },\n});\n\nconst store = new TemplateManagerStore();\n\nDispatcher.register((action) => {\n switch (action.actionType) {\n case Constants.FLOW_TEMPLATE_LOADED:\n setFlowTemplate(action.flowTemplate);\n store.emitChange();\n break;\n case Constants.FLOW_TEMPLATE_UPDATED:\n updateFlowTemplate(action.attrs);\n store.emitChange();\n break;\n case Constants.MASTER_TEMPLATE_LOADED:\n setMasterTemplate(action.masterTemplate);\n store.emitChange();\n break;\n case Constants.FORMULA_LOADED:\n setFormula(action.formula);\n store.emitChange();\n break;\n case Constants.FORMULA_DESTROYED:\n removeFormula(action.formulaId);\n store.emitChange();\n break;\n case Constants.MARK_FLOW_TEMPLATE_CHANGED:\n store.markChanged();\n break;\n case Constants.FAQ_CREATED:\n addFAQ(action.faq);\n store.emitChange();\n break;\n case Constants.FAQ_UPDATED:\n updateFAQ(action.faq);\n store.emitChange();\n break;\n case Constants.FAQ_DESTROYED:\n removeFAQ(action.faqId);\n store.emitChange();\n break;\n case Constants.SUBPROCESS_CONFIG_ADDED:\n addSubprocessConfig(action.subprocessConfig);\n setModifiedStatus(action.templateModified);\n store.emitChange();\n break;\n case Constants.SUBPROCESS_CONFIG_DELETED:\n removeSubprocessConfig(action.subprocessConfigId);\n setModifiedStatus(action.templateModified);\n store.emitChange();\n break;\n case Constants.SUBPROCESS_CONFIG_UPDATED:\n break;\n case Constants.SEARCH_CONFIG_ADDED:\n addSearchConfig(action.searchConfig);\n store.emitChange();\n break;\n case Constants.SEARCH_CONFIG_DELETED:\n removeSearchConfig(action.searchConfigId);\n store.emitChange();\n break;\n case Constants.SEARCH_CONFIG_UPDATED:\n updateSearchConfig(action.searchConfig);\n store.emitChange();\n break;\n case Constants.SLUG_UPDATED:\n setSlug(action.newSlug);\n store.emitChange();\n break;\n case Constants.CUSTOM_ID_CREATED:\n addCustomId(action.customIdAttrs);\n store.emitChange();\n break;\n case Constants.CUSTOM_ID_DELETED:\n removeCustomId();\n store.emitChange();\n break;\n case Constants.STEPS_REORDERED:\n reorderSteps(action.stepPositions);\n store.markChanged();\n break;\n case Constants.STEP_ADDED:\n addStep(action.step);\n store.markChanged();\n break;\n case Constants.STEP_REMOVED:\n removeStep(action.stepId);\n store.markChanged();\n break;\n case Constants.STEP_UPDATED:\n updateStep(action.stepId, action.attrs);\n store.markChanged();\n break;\n case Constants.STEP_DATA_ADDED:\n addDataRow(action.sectionId, action.datum);\n store.markChanged();\n break;\n case Constants.STEP_DATA_UPDATED:\n updateDataRow(action.datumId, action.datumAttrs);\n store.markChanged();\n break;\n case Constants.STEP_DATA_REMOVED:\n removeDataRow(action.stepDatumId);\n store.markChanged();\n break;\n case Constants.STEP_DATA_MOVED:\n moveDataRow(action.data);\n store.markChanged();\n break;\n case Constants.SECTION_ADDED:\n addSection(action.stepId, action.section);\n store.markChanged();\n break;\n case Constants.SECTION_COPIED:\n addSection(action.stepId, action.section);\n\n action.section.step_data.forEach((stepDatum) => {\n addDataRow(action.section.id, stepDatum);\n });\n\n store.markChanged();\n break;\n case Constants.SECTION_UPDATED:\n updateSection(action.section);\n store.markChanged();\n break;\n case Constants.SECTION_REMOVED:\n destroySection(action.sectionId);\n store.markChanged();\n break;\n case Constants.SECTION_MOVED:\n moveSection(action.sections);\n store.markChanged();\n break;\n case MultipleChoiceOptionConstants.ADDED:\n addMultipleChoiceOption(action.stepDatumId, action.optionAttrs);\n store.markChanged();\n break;\n case MultipleChoiceOptionConstants.DESTROYED:\n removeMultipleChoiceOption(action.optionId);\n store.markChanged();\n break;\n case MultipleChoiceOptionConstants.UPDATED:\n updateMultipleChoiceOption(action.optionId, action.optionAttrs);\n store.markChanged();\n break;\n case MultipleChoiceOptionConstants.MOVED:\n moveMultipleChoiceOption(action.options);\n store.markChanged();\n break;\n case Constants.EMAIL_NOTIFICATION_ADDED:\n addEmailNotification(action.stepId, action.attrs);\n store.markChanged();\n break;\n case Constants.EMAIL_NOTIFICATION_UPDATED:\n updateEmailNotification(action.emailNotificationId, action.attrs);\n store.markChanged();\n break;\n case Constants.EMAIL_NOTIFICATION_DESTROYED:\n destroyEmailNotification(action.notificationId);\n store.markChanged();\n break;\n case Constants.REVIEW_GROUP_ADDED:\n addReviewGroup(action.groupAttrs);\n store.markChanged();\n break;\n case Constants.REVIEW_GROUP_UPDATED:\n updateReviewGroup(action.groupAttrs);\n store.markChanged();\n break;\n case Constants.REVIEW_GROUP_DELETED:\n destroyReviewGroup(action.reviewGroupId);\n store.markChanged();\n break;\n case Constants.STEP_ASSIGNMENT_GROUP_CREATED:\n addAssignmentGroup(action.group);\n store.markChanged();\n break;\n case Constants.STEP_ASSIGNMENT_GROUP_DELETED:\n deleteAssignmentGroup(action.id);\n store.markChanged();\n break;\n case Constants.STEP_ASSIGNMENT_CREATED:\n addAssignment(action.stepAssignment);\n store.markChanged();\n break;\n case Constants.STEP_ASSIGNMENT_DELETED:\n removeAssignment(action.id);\n store.markChanged();\n break;\n case Constants.SURVEY_UPDATED:\n updateSurvey(action.survey);\n store.markChanged();\n break;\n case Constants.SURVEY_SECTION_ADDED:\n addSurveySection(action.section, action.stepId);\n store.markChanged();\n break;\n case Constants.SURVEY_SECTION_COPIED:\n addSurveySection(action.section, action.stepId);\n action.section.step_data.forEach((stepDatum) => {\n addDataRow(action.section.id, stepDatum);\n });\n\n store.markChanged();\n break;\n case Constants.LOGIC_CONFIG_ADDED:\n addLogicConfig(action.logicConfig);\n store.markChanged();\n break;\n case Constants.LOGIC_CONFIG_DESTROYED:\n\n // When destroying logic on an assignment group,\n // the members of the group must be split out into\n // their own individual groups.\n\n if (action.newStepAssignmentGroups) {\n\n // At time of writing, it's impossible for there\n // to not be at least one assignment group in the\n // response.\n const stepId = action.newStepAssignmentGroups[0].step_id;\n\n replaceAssignmentGroups(stepId, action.newStepAssignmentGroups);\n } else {\n removeLogicConfig(action.logicConfig);\n }\n store.markChanged();\n break;\n case AttachedPeopleConstants.TOGGLE_PERSON:\n toggleAttachedPerson(action.attachedPerson, action.attachableId, action.attachableType);\n store.markChanged();\n break;\n case AttachedPeopleConstants.UPDATE_ATTACHMENT:\n updateRoleUsers(action.attachment, action.roleId, action.attachableId, action.attachableType);\n store.markChanged();\n break;\n case Constants.OUTPUT_UPDATED:\n updateOutput(action.output);\n store.markChanged();\n break;\n case Constants.RENEWAL_REMINDER_CREATED:\n addRenewalReminder(action.attrs);\n store.markChanged();\n break;\n case Constants.RENEWAL_REMINDER_UPDATED:\n updateRenewalReminder(action.attrs);\n store.markChanged();\n break;\n case Constants.RENEWAL_REMINDER_DELETED:\n removeRenewalReminder(action.attrs);\n store.markChanged();\n break;\n default:\n // Nothing\n }\n});\n\nexport default store;\n","export const primary = '#5FAE7F'; // CityGrows green\nexport const secondary = '#597A91'; // Slate blue\nexport const color1 = primary;\nexport const color2 = secondary;\nexport const color3 = '#677A7E'; // Primary Grey\nexport const color4 = '#5E9998'; // Teal\nexport const color5 = '#BCD0D9'; // Pale blue\nexport const color6 = '#4F6A78'; // Dark blue\nexport const color7 = '#00B9AD'; // Cyan\nexport const color8 = '#1B3A3E'; // Almost black\nexport const color9 = '#D0E8CF'; //Light green\nexport const colorBackground = '#f2f2f2';\nexport const colorNeutralLight = 'rgba(0, 0, 0, 0.08)';\nexport const colorTextMedium = 'rgba(0, 0, 0, .54)';\n","import { css } from '@emotion/react';\nimport { color3 } from 'theme/colors';\n\nexport const buildDisc = (size = 30) => {\n return css`\n background-color: ${color3};\n border-radius:50%;\n box-sizing:content-box;\n color:rgb(255, 255, 255, .9);\n cursor:default;\n display:inline-block;\n font-weight:normal;\n height:${size}px;\n line-height:${size}px;\n margin-right:5px;\n overflow:hidden;\n position:relative;\n text-align:center;\n text-transform:uppercase;\n vertical-align:middle;\n width:${size}px;\n `;\n}\n\nexport const disc = buildDisc();\n","//\n// ____ _ _\n// / ___|| |_ __ _ _ __ ___ ___ (_)___ (*)\n// \\___ \\| __/ _` | '_ \\ / _ \\/ __| | / __|\n// ___) | || (_| | |_) | __/\\__ \\_ | \\__ \\\n// |____/ \\__\\__,_| .__/ \\___||___(_)/ |___/\n// |_| |__/\n//\n// (*) the Javascript MVC microframework that does just enough\n//\n// (c) Hay Kranen < hay@bykr.org >\n// Released under the terms of the MIT license\n// < http://en.wikipedia.org/wiki/MIT_License >\n//\n// Stapes.js : http://hay.github.com/stapes\n;(function() {\n 'use strict';\n\n var VERSION = \"0.8.1\";\n\n // Global counter for all events in all modules (including mixed in objects)\n var guid = 1;\n\n // Makes _.create() faster\n if (!Object.create) {\n var CachedFunction = function(){};\n }\n\n // So we can use slice.call for arguments later on\n var slice = Array.prototype.slice;\n\n // Private attributes and helper functions, stored in an object so they\n // are overwritable by plugins\n var _ = {\n // Properties\n attributes : {},\n\n eventHandlers : {\n \"-1\" : {} // '-1' is used for the global event handling\n },\n\n guid : -1,\n\n // Methods\n addEvent : function(event) {\n // If we don't have any handlers for this type of event, add a new\n // array we can use to push new handlers\n if (!_.eventHandlers[event.guid][event.type]) {\n _.eventHandlers[event.guid][event.type] = [];\n }\n\n // Push an event object\n _.eventHandlers[event.guid][event.type].push({\n \"guid\" : event.guid,\n \"handler\" : event.handler,\n \"scope\" : event.scope,\n \"type\" : event.type\n });\n },\n\n addEventHandler : function(argTypeOrMap, argHandlerOrScope, argScope) {\n var eventMap = {},\n scope;\n\n if (typeof argTypeOrMap === \"string\") {\n scope = argScope || false;\n eventMap[ argTypeOrMap ] = argHandlerOrScope;\n } else {\n scope = argHandlerOrScope || false;\n eventMap = argTypeOrMap;\n }\n\n for (var eventString in eventMap) {\n var handler = eventMap[eventString];\n var events = eventString.split(\" \");\n\n for (var i = 0, l = events.length; i < l; i++) {\n var eventType = events[i];\n _.addEvent.call(this, {\n \"guid\" : this._guid || this._.guid,\n \"handler\" : handler,\n \"scope\" : scope,\n \"type\" : eventType\n });\n }\n }\n },\n\n addGuid : function(object, forceGuid) {\n if (object._guid && !forceGuid) return;\n\n object._guid = guid++;\n\n _.attributes[object._guid] = {};\n _.eventHandlers[object._guid] = {};\n },\n\n // This is a really small utility function to save typing and produce\n // better optimized code\n attr : function(guid) {\n return _.attributes[guid];\n },\n\n clone : function(obj) {\n var type = _.typeOf(obj);\n\n if (type === 'object') {\n return _.extend({}, obj);\n }\n\n if (type === 'array') {\n return obj.slice(0);\n }\n },\n\n create : function(proto) {\n if (Object.create) {\n return Object.create(proto);\n } else {\n CachedFunction.prototype = proto;\n return new CachedFunction();\n }\n },\n\n createSubclass : function(props, includeEvents) {\n props = props || {};\n includeEvents = includeEvents || false;\n\n var superclass = props.superclass.prototype;\n\n // Objects always have a constructor, so we need to be sure this is\n // a property instead of something from the prototype\n var realConstructor = props.hasOwnProperty('constructor') ? props.constructor : function(){};\n\n function constructor() {\n // Be kind to people forgetting new\n if (!(this instanceof constructor)) {\n throw new Error(\"Please use 'new' when initializing Stapes classes\");\n }\n\n // If this class has events add a GUID as well\n if (this.on) {\n _.addGuid( this, true );\n }\n\n realConstructor.apply(this, arguments);\n }\n\n if (includeEvents) {\n _.extend(superclass, Events);\n }\n\n constructor.prototype = _.create(superclass);\n constructor.prototype.constructor = constructor;\n\n _.extend(constructor, {\n extend : function() {\n return _.extendThis.apply(this, arguments);\n },\n\n // We can't call this 'super' because that's a reserved keyword\n // and fails in IE8\n 'parent' : superclass,\n\n proto : function() {\n return _.extendThis.apply(this.prototype, arguments);\n },\n\n subclass : function(obj) {\n obj = obj || {};\n obj.superclass = this;\n return _.createSubclass(obj);\n }\n });\n\n // Copy all props given in the definition to the prototype\n for (var key in props) {\n if (key !== 'constructor' && key !== 'superclass') {\n constructor.prototype[key] = props[key];\n }\n }\n\n return constructor;\n },\n\n emitEvents : function(type, data, explicitType, explicitGuid) {\n explicitType = explicitType || false;\n explicitGuid = explicitGuid || this._guid;\n\n // #30: make a local copy of handlers to prevent problems with\n // unbinding the event while unwinding the loop\n var handlers = slice.call(_.eventHandlers[explicitGuid][type]);\n\n for (var i = 0, l = handlers.length; i < l; i++) {\n // Clone the event to prevent issue #19\n var event = _.extend({}, handlers[i]);\n var scope = (event.scope) ? event.scope : this;\n\n if (explicitType) {\n event.type = explicitType;\n }\n\n event.scope = scope;\n event.handler.call(event.scope, data, event);\n }\n },\n\n // Extend an object with more objects\n extend : function() {\n var args = slice.call(arguments);\n var object = args.shift();\n\n for (var i = 0, l = args.length; i < l; i++) {\n var props = args[i];\n for (var key in props) {\n object[key] = props[key];\n }\n }\n\n return object;\n },\n\n // The same as extend, but uses the this value as the scope\n extendThis : function() {\n var args = slice.call(arguments);\n args.unshift(this);\n return _.extend.apply(this, args);\n },\n\n // from http://stackoverflow.com/a/2117523/152809\n makeUuid : function() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n },\n\n removeAttribute : function(keys, silent) {\n silent = silent || false;\n\n // Split the key, maybe we want to remove more than one item\n var attributes = _.trim(keys).split(\" \")\n ,mutateData = {}\n ;\n\n // Actually delete the item\n for (var i = 0, l = attributes.length; i < l; i++) {\n var key = _.trim(attributes[i]);\n\n if (key) {\n // Store data for mutate event\n mutateData.key = key;\n mutateData.oldValue = _.attr(this._guid)[key];\n\n delete _.attr(this._guid)[key];\n\n // If 'silent' is set, do not throw any events\n if (!silent) {\n this.emit('change', key);\n this.emit('change:' + key);\n this.emit('mutate', mutateData);\n this.emit('mutate:' + key, mutateData);\n this.emit('remove', key);\n this.emit('remove:' + key);\n }\n\n // clean up\n delete mutateData.oldValue;\n }\n }\n },\n\n removeEventHandler : function(type, handler) {\n var handlers = _.eventHandlers[this._guid];\n\n if (type && handler) {\n // Remove a specific handler\n handlers = handlers[type];\n if (!handlers) return;\n\n for (var i = 0, l = handlers.length, h; i < l; i++) {\n h = handlers[i].handler;\n if (h && h === handler) {\n handlers.splice(i--, 1);\n l--;\n }\n }\n } else if (type) {\n // Remove all handlers for a specific type\n delete handlers[type];\n } else {\n // Remove all handlers for this module\n _.eventHandlers[this._guid] = {};\n }\n },\n\n setAttribute : function(key, value, silent) {\n silent = silent || false;\n\n // We need to do this before we actually add the item :)\n var itemExists = this.has(key);\n var oldValue = _.attr(this._guid)[key];\n\n // Is the value different than the oldValue? If not, ignore this call\n if (value === oldValue) {\n return;\n }\n\n // Actually add the item to the attributes\n _.attr(this._guid)[key] = value;\n\n // If 'silent' flag is set, do not throw any events\n if (silent) {\n return;\n }\n\n // Throw a generic event\n this.emit('change', key);\n\n // And a namespaced event as well, NOTE that we pass value instead of\n // key here!\n this.emit('change:' + key, value);\n\n // Throw namespaced and non-namespaced 'mutate' events as well with\n // the old value data as well and some extra metadata such as the key\n var mutateData = {\n \"key\" : key,\n \"newValue\" : value,\n \"oldValue\" : oldValue || null\n };\n\n this.emit('mutate', mutateData);\n this.emit('mutate:' + key, mutateData);\n\n // Also throw a specific event for this type of set\n var specificEvent = itemExists ? 'update' : 'create';\n\n this.emit(specificEvent, key);\n\n // And a namespaced event as well, NOTE that we pass value instead of key\n this.emit(specificEvent + ':' + key, value);\n },\n\n trim : function(str) {\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n },\n\n typeOf : function(val) {\n if (val === null || typeof val === \"undefined\") {\n // This is a special exception for IE, in other browsers the\n // method below works all the time\n return String(val);\n } else {\n return Object.prototype.toString.call(val).replace(/\\[object |\\]/g, '').toLowerCase();\n }\n },\n\n updateAttribute : function(key, fn, silent) {\n var item = this.get(key);\n\n // In previous versions of Stapes we didn't have the check for object,\n // but still this worked. In 0.7.0 it suddenly doesn't work anymore and\n // we need the check. Why? I have no clue.\n var type = _.typeOf(item);\n\n if (type === 'object' || type === 'array') {\n item = _.clone(item);\n }\n\n var newValue = fn.call(this, item, key);\n _.setAttribute.call(this, key, newValue, silent || false);\n }\n };\n\n // Can be mixed in later using Stapes.mixinEvents(object);\n var Events = {\n emit : function(types, data) {\n data = (typeof data === \"undefined\") ? null : data;\n\n var splittedTypes = types.split(\" \");\n\n for (var i = 0, l = splittedTypes.length; i < l; i++) {\n var type = splittedTypes[i];\n\n // First 'all' type events: is there an 'all' handler in the\n // global stack?\n if (_.eventHandlers[-1].all) {\n _.emitEvents.call(this, \"all\", data, type, -1);\n }\n\n // Catch all events for this type?\n if (_.eventHandlers[-1][type]) {\n _.emitEvents.call(this, type, data, type, -1);\n }\n\n if (typeof this._guid === 'number') {\n // 'all' event for this specific module?\n if (_.eventHandlers[this._guid].all) {\n _.emitEvents.call(this, \"all\", data, type);\n }\n\n // Finally, normal events :)\n if (_.eventHandlers[this._guid][type]) {\n _.emitEvents.call(this, type, data);\n }\n }\n }\n },\n\n off : function() {\n _.removeEventHandler.apply(this, arguments);\n },\n\n on : function() {\n _.addEventHandler.apply(this, arguments);\n }\n };\n\n _.Module = function() {\n\n };\n\n _.Module.prototype = {\n each : function(fn, ctx) {\n var attr = _.attr(this._guid);\n for (var key in attr) {\n var value = attr[key];\n fn.call(ctx || this, value, key);\n }\n },\n\n extend : function() {\n return _.extendThis.apply(this, arguments);\n },\n\n filter : function(fn) {\n var filtered = [];\n var attributes = _.attr(this._guid);\n\n for (var key in attributes) {\n if ( fn.call(this, attributes[key], key)) {\n filtered.push( attributes[key] );\n }\n }\n\n return filtered;\n },\n\n get : function(input) {\n if (typeof input === \"string\") {\n // If there is more than one argument, give back an object,\n // like Underscore's pick()\n if (arguments.length > 1) {\n var results = {};\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n var key = arguments[i];\n results[key] = this.get(key);\n }\n\n return results;\n } else {\n return this.has(input) ? _.attr(this._guid)[input] : null;\n }\n } else if (typeof input === \"function\") {\n var items = this.filter(input);\n return (items.length) ? items[0] : null;\n }\n },\n\n getAll : function() {\n return _.clone( _.attr(this._guid) );\n },\n\n getAllAsArray : function() {\n var arr = [];\n var attributes = _.attr(this._guid);\n\n for (var key in attributes) {\n var value = attributes[key];\n\n if (_.typeOf(value) === \"object\" && !value.id) {\n value.id = key;\n }\n\n arr.push(value);\n }\n\n return arr;\n },\n\n has : function(key) {\n return (typeof _.attr(this._guid)[key] !== \"undefined\");\n },\n\n map : function(fn, ctx) {\n var mapped = [];\n this.each(function(value, key) {\n mapped.push( fn.call(ctx || this, value, key) );\n }, ctx || this);\n return mapped;\n },\n\n // Akin to set(), but makes a unique id\n push : function(input, silent) {\n if (_.typeOf(input) === \"array\") {\n for (var i = 0, l = input.length; i < l; i++) {\n _.setAttribute.call(this, _.makeUuid(), input[i], silent || false);\n }\n } else {\n _.setAttribute.call(this, _.makeUuid(), input, silent || false);\n }\n\n return this;\n },\n\n remove : function(input, silent) {\n if (typeof input === 'undefined') {\n // With no arguments, remove deletes all attributes\n _.attributes[this._guid] = {};\n this.emit('change remove');\n } else if (typeof input === \"function\") {\n this.each(function(item, key) {\n if (input(item)) {\n _.removeAttribute.call(this, key, silent);\n }\n });\n } else {\n // nb: checking for exists happens in removeAttribute\n _.removeAttribute.call(this, input, silent || false);\n }\n\n return this;\n },\n\n set : function(objOrKey, valueOrSilent, silent) {\n if (typeof objOrKey === \"object\") {\n for (var key in objOrKey) {\n _.setAttribute.call(this, key, objOrKey[key], valueOrSilent || false);\n }\n } else {\n _.setAttribute.call(this, objOrKey, valueOrSilent, silent || false);\n }\n\n return this;\n },\n\n size : function() {\n var size = 0;\n var attr = _.attr(this._guid);\n\n for (var key in attr) {\n size++;\n }\n\n return size;\n },\n\n update : function(keyOrFn, fn, silent) {\n if (typeof keyOrFn === \"string\") {\n _.updateAttribute.call(this, keyOrFn, fn, silent || false);\n } else if (typeof keyOrFn === \"function\") {\n this.each(function(value, key) {\n _.updateAttribute.call(this, key, keyOrFn);\n });\n }\n\n return this;\n }\n };\n\n var Stapes = {\n \"_\" : _, // private helper functions and properties\n\n \"extend\" : function() {\n return _.extendThis.apply(_.Module.prototype, arguments);\n },\n\n \"mixinEvents\" : function(obj) {\n obj = obj || {};\n\n _.addGuid(obj);\n\n return _.extend(obj, Events);\n },\n\n \"on\" : function() {\n _.addEventHandler.apply(this, arguments);\n },\n\n \"subclass\" : function(obj, classOnly) {\n classOnly = classOnly || false;\n obj = obj || {};\n obj.superclass = classOnly ? function(){} : _.Module;\n return _.createSubclass(obj, !classOnly);\n },\n\n \"version\" : VERSION\n };\n\n // This library can be used as an AMD module, a Node.js module, or an\n // old fashioned global\n if (typeof exports !== \"undefined\") {\n // Server\n if (typeof module !== \"undefined\" && module.exports) {\n exports = module.exports = Stapes;\n }\n exports.Stapes = Stapes;\n } else if (typeof define === \"function\" && define.amd) {\n // AMD\n define(function() {\n return Stapes;\n });\n } else {\n // Global scope\n window.Stapes = Stapes;\n }\n})();\n"],"names":["toggleAssignment","activeStepId","userId","$","ajax","method","dataType","data","active_step_id","user_id","addPseudomember","email","name","removeAssignment","id","url","AttachmentActions","dispatchInitiatedFlowTogglePerson","dispatch","response","type","InitiatedFlowConstants","ASSIGNED_PEOPLE_UPDATED","personAttachment","dispatchTogglePersonEvent","attachableType","attachableId","Dispatcher","actionType","Constants","TOGGLE_PERSON","attachedPerson","onAssignmentToggled","ASSIGNMENT_UPDATED","onTentativeDone","ActiveStepConstants","CHANGES_PERSISTED","addPseudomemberTentative","TentativeAssignmentsAPI","opts","API","pseudoAdd","toggleTentativePerson","togglePerson","toggle","togglePersonViaAttachedRole","roleId","done","UPDATE_ATTACHMENT","attachment","removeTentativePerson","personAttachmentId","removePerson","removeAttachment","toggleAssigned","toggledAttachment","assigned","update","attachment_id","fetchRoles","teamId","RolesAPI","search","toggleRole","userToAdd","subjectId","subjectType","fail","error","stepAssignmentGroupId","assigneeId","assigneeType","step_assignment","assignee_id","assignee_type","stepAssignmentId","add","flowTemplateId","step","attrs","reorder","stepId","position","delete","duplicate","URL","index","step_assignment_group","step_assignments_attributes","delete_old_assignments","parseUpdates","updates","Object","keys","forEach","key","config","attrsConfig","responseConfig","buildConfig","config_attributes","FlowStepActions","addStep","stepType","NProgress","newStep","STEP_ADDED","res","Flash","responseJSON","errors","always","removeStep","STEP_REMOVED","errorMessage","base","AlertConfirm","stepsReordered","this","onFail","STEPS_REORDERED","stepPositions","duplicateStep","updateStep","STEP_UPDATED","addData","sectionId","StepDataAPI","datum","STEP_DATA_ADDED","duplicateDatum","datumId","section_id","addSection","section","SECTION_ADDED","updateSection","SECTION_UPDATED","destroySection","SECTION_REMOVED","moveSection","reorderSection","sections","SECTION_MOVED","copySection","SECTION_COPIED","refreshStepData","stepDatumId","fetch","STEP_DATA_UPDATED","datumAttrs","moveStepData","STEP_DATA_MOVED","updateStepData","deleteStepData","destroy","STEP_DATA_REMOVED","changeTime","message","time","time_unit","clearSpecificResponsibility","responsibility_type","person_attachments","createPrevAssigneesGroup","StepAssignmentGroupAPI","group","STEP_ASSIGNMENT_GROUP_CREATED","createAssignmentGroup","deleteAssignmentGroup","STEP_ASSIGNMENT_GROUP_DELETED","deleteAssignment","StepAssignmentAPI","STEP_ASSIGNMENT_DELETED","createAssignment","selectionId","selectionType","STEP_ASSIGNMENT_CREATED","stepAssignment","isArray","surveyId","survey","submit","surveyToken","survey_token","exportResponses","SurveyAPI","dispatchSurveyUpdated","onSurveyUpdateFail","SURVEY_SECTION_ADDED","SURVEY_SECTION_COPIED","SURVEY_UPDATED","updateIdentified","newValue","identified","TemplateExtrasActions","cloneTemplate","templateId","FlowTemplateAPI","clone","duplicateTemplate","cloneOutputDocuments","team_id","clone_output_documents","create","masterTemplateId","pattern","custom_id","customIdId","_publishTemplatePromise","loadModificationStatus","MasterTemplateAPI","modified","FLOW_TEMPLATE_UPDATED","is_modified","fetchSearchStepDataOptions","stepData","fetchSubprocessOptions","setFlowTemplate","flowTemplate","FLOW_TEMPLATE_LOADED","setLaunchData","launchData","SET_LAUNCH_DATA","updateFlowTemplate","triggerUpdateEvent","updateMasterTemplate","onMasterTemplateUpdateSuccess","bind","template","dispatchMasterTemplateLoaded","changeTemplateStatus","newStatus","status","masterTemplate","onSlugSave","newSlug","slug","SLUG_UPDATED","onCustomIdSave","CustomIdAPI","customIdAttrs","length","CUSTOM_ID_CREATED","onCustomIdDelete","CUSTOM_ID_DELETED","MASTER_TEMPLATE_LOADED","publish","PollableJob","run","onPublishJobCompleted","Deferred","markChanged","MARK_FLOW_TEMPLATE_CHANGED","result","JSON","parse","hasOwnProperty","onTemplatePublished","template_data","onTemplatePublishFailed","assign","flow_template","master_template","resolve","reject","onTemplateCategorySave","TemplateCategoryAPI","authorityId","membership","sendInvite","master_template_id","resendInvite","invitationId","membershipId","dispatchMembershipAdd","UserAccessConstants","MEMBERSHIP_ADDED","fetchAll","MembershipAPI","memberships","MEMBERSHIP_LIST","dispatchMembershipList","searchUsers","terms","UserAPI","addUser","toggleAuthorityOn","AuthoritiesAPI","AUTHORITY_ADDED","dispatchAuthorityAdd","toggleAuthorityOff","AUTHORITY_REMOVED","dispatchAuthorityRemove","removeUser","MEMBERSHIP_REMOVED","dispatchMembershipRemove","updateUserPermission","newPermissionId","permissionLevelId","PERMISSION_CHANGED","onPermissionUpdated","permission_level_id","r","permission_level_id_was","onPermissionUpdateFailed","success","AttachmentAPI","subject_id","subject_type","attachable_id","attachable_type","user_to_add","attachmentId","role_id","fetchAttachments","formData","processData","cache","contentType","replace","unpublish","fetchMappables","documentId","query","get","window","location","host","FormulaAPI","formula","formulaId","availableForStep","checkSlugAvailable","only_published","versions","MasterTemplateDataImportAPI","submitCSV","file","FormData","append","queueImport","masterTemplateDataImportId","dataMapping","mappings","initiated_flow","initiatedFlow","step_data","queueTest","RoleAPI","show","role","addUserToRole","add_user_to_role","attach","attachmentType","search_term","searchTerm","SearchAPI","searchApplicants","searchAll","search_all","searchThirdPartyReviewers","initiatedFlowId","initiated_flow_id","searchSupportContacts","usersAndRoles","dataMethod","sectionableType","sectionableId","sectionable_type","sectionable_id","date_type","data_type","required","redacted","entity_createable","lock_on_renewal","autofill_on_renewal","min_num_checks","max_length","min_value","max_value","date_range_start_label","date_range_end_label","step_datum","date_config_attributes","range_end_label","range_start_label","default","entity_config_attributes","availableForSectionConfig","TeamAPI","team","checkChargesEnabled","processListing","q","xhr","csrfParam","getResponseHeader","csrfToken","attr","gov_only","govOnly","exists","login","password","user","csrfReset","signup","accountType","account_type","updateAuthMetaData","uploadAvatar","sendVerificationEmail","propValue","prevPropValue","setPrevPropValue","useState","stateValue","setStateValue","onClose","elRef","useRef","focusableEls","el","current","querySelectorAll","handleFocus","e","focusable","firstFocusableEl","lastFocusableEl","isTabPressed","keyCode","shiftKey","document","activeElement","focus","preventDefault","useEffect","addEventListener","setTimeout","removeEventListener","props","className","label","helperText","icon","title","active","setActive","roles","setRoles","loading","setLoading","setSearchTerm","loadRoles","useCallback","debounce","newSearchTerm","rolesToDisplay","attachedRoleIds","rolesToFilter","map","contains","renderRole","onClick","onChange","currentTarget","value","placeholder","onFocus","size","referrerLink","teamSlug","referrer","href","renderRoles","AttachPerson","person","setPerson","viaRole","setViaRole","useContext","InitiatedFlowDispatchContext","onSendInviteButtonClicked","isPseudo","handlePersonSelect","selectedPerson","canAttachRoles","toggleAttachment","prsn","onToggleOff","removedPerson","tentativeAssignment","onAttachedPeopleChange","doSearch","UserAccessActions","searchOpts","personAttachedViaRole","attachedRoles","find","user_ids","reset","onSelect","onInvite","allowPseudo","allowToggle","memberUsers","people","hideExternal","idForInput","defaultProps","NO_USERS_ADDED_CONTENT","NO_ROLES_ADDED_CONTENT","AttachedPeople","attachedPeople","filter","a","setAttachment","legacyPersonAddOpen","setLegacyPersonAddOpen","any","onToggleEvent","onAttachmentPersisted","onPersonAttachmentPersisted","roleIsAttached","findWhere","roleUsersAlreadyAttached","roleUserIds","users","u","directAttachedUserIds","p","intersection","attachViaRole","attachPersonHandler","userAttachment","options","newPerson","togglePersonRoleAttachment","newAttachment","duplicateAttachments","persisted","cleanUpDuplicates","Error","attchmnt","buildPerson","isDisabled","disabled","lockedUserIds","showEmail","A","onDeleteClick","renderPersonAdd","pseudoNeedsRole","togglePersonViaRole","renderPeopleList","displayRoleUser","confirmAttachmentText","willRemoveDirectAttachments","roleUsers","actionText","userConfirmation","renderRolesWidget","isEmpty","rolesList","renderRolesList","AttachedPerson","Component","render","showName","PopupButton","React","stopPropagation","onToggle","buttonClassName","open","wrapperClassName","wrapperClassname","popupNubClassName","nubDirection","renderPopup","wrapperIgnoreClass","closeOnPopupClick","children","buttonHtml","AutonomousPopup","constructor","super","state","setState","ref","useOnclickOutside","ignoreClass","CopyableLink","linkField","selectURL","select","inputId","copyEnabled","readOnly","linkURL","onSuccess","successMsg","component","groupMembers","count","showMembers","setShowMembers","membersContentRef","elForAnchor","refs","css","discStyle","colorBackground","colorTextMedium","NUM_TO_SHOW","anchorRef","baseStyle","stackedStyle","slice","member","i","style","zIndex","showPseudo","renderEveryoneElse","DropdownMenu","isOpen","setIsOpen","menuAnchorRef","onMenuOpen","color","iconColor","justify","defaultValue","setValue","target","EmbeddedTextInput","input","measure","resize","useLayoutEffect","onKeyPress","which","blur","fontSize","getComputedStyle","getPropertyValue","fontWeight","paddingLeft","split","parseFloat","paddingRight","innerHTML","width","clientWidth","newWidth","maxWidth","classForSize","tabIndex","tabindex","klass","disabledValue","onKeyDown","idName","renderEditIcon","ExportsMessage","FileInput","handleChange","returnValue","isFunction","resetFileInput","triggerFileBrowse","click","accept","fileType","pixelOffset","bottom","dangerouslySetInnerHTML","__html","MESSAGE_DURATION","items","TransitionGroup","item","CSSTransition","classNames","timeout","content","_component","_queue","_","ReactDOM","getElementById","potentialMatch","timer","expireOldest","push","setComponentState","addItem","ErrorMessages","flash","actionFailed","shift","notice","InlineNotification","memo","classForType","MoneyInput","isFinite","innerRef","onBlur","InstructionsManager","instructions","onSave","newInstructions","formattedMentionData","templateVariables","referenceKey","isActive","toolbar","theme","ListOfPeoplePerson","ListOfPeople","showExternal","setShowExternal","onPersonSelect","filteredInternalPeople","useMemo","internal","filteredExternalPeople","renderExternalPeople","LoadingSpinner","colorScheme","displayName","sourceField","condition","multipleChoiceMatchValue","matchValue","includes","match_value","connective","truncate","ALL_COMPARATORS","comparator","connectiveId","CONNECTIVES","nameForConnective","sendChange","selectedFieldId","source_id","Number","availableFields","isLast","onRemoveClick","setSelectedFieldId","setComparator","setMatchValue","setConnective","DEFAULT_CONNECTIVE","selectedField","selectedFieldType","onConnectiveChange","comparatorsForFieldType","fieldType","NUMERIC_COMPARATORS","STANDARD_COMPARATORS","CHECKBOX_COMPARATORS","comparatorOptions","matchOptions","multiple_choice_options","option","onMatchValueChange","onInputMatchValueChange","onSelectMatchValueChange","availableFieldOptions","field","fieldId","newComparator","comparators","defaultComparitorForFieldType","menuShouldScrollIntoView","menuPosition","styles","container","provided","display","verticalAlign","isSearchable","control","background","singleValue","textTransform","dropdownIndicator","LogicWidget","FieldManager","steps","availableLogicFields","setLogicConfig","logicConfig","onActionChanged","prevConfig","action","updateCondition","conditionAttrs","conditions","conditionIndex","splice","sendConditions","onAddConditionClick","tempId","uniqueId","onDelete","confirm","showTitle","editing","actionsForLogicableType","logicableType","array","colSpan","renderEditView","setEditing","renderEditButton","LOGICABLE_TYPES","subprocess","renderXButton","validateConfig","allConditionsValid","every","Modal","focusEl","useFocusTrap","onOutsideClick","classes","scroll","join","renderMain","buttonClass","Shield","on","off","enableCloseIfOutside","alert","warning","FixedPaymentSettings","calculated","fixed","debouncedAmountChanged","amountChanged","availableFormulas","formulaLoadError","componentDidMount","loadAvailableFormulas","componentDidUpdate","prevProps","onAutoadvanceToggle","autoadvance","onFormulaLoadComplete","onFormulaLoadFailed","onCalculatedChanged","updateConfig","checked","onFormulaChanged","_e","newAmount","attrName","updateAttrs","renderAmountOption","amount","loadingFormulaOptions","isNull","noFormulasAvailable","formulas","defaultFormulaOptionText","getFormulaOptions","defaultOptions","renderCalcValueOption","formulaOptions","formula_id","supportsAutoadvance","generic_type","renderAutoadvanceToggle","description","flatRef","calculatedRef","cashAllowedCheckbox","checkAllowedCheckbox","constituentFeeCheckbox","configChanged","accepts_cash","accepts_checks","constituent_pays_fee","renderFixedPaymentSettings","flat","defaultChecked","htmlFor","renderCalculateOption","renderPaymentAmount","cash_instructions","cashInstructionsBlurred","renderCashDetails","check_instructions","checkInstructionsBlurred","renderCheckDetails","PaymentStepDetails","selection","showAsCurrent","showAsCurrentUser","smallerAvatar","disableRemoval","removeLinkText","onRemove","renderRemoveLink","PersonSelector","searchInput","setSearchInput","searching","setSearching","searchResults","setSearchResults","inviteeName","setInviteeName","onSendInvite","onInviteeNameChanged","onInputChanged","newTerms","existingAttachment","existingMember","autoComplete","inputStyle","EmailValidator","validate","personNoFoundText","renderSearchResults","selected","setSelected","saving","setSaving","isSelected","columns","renderText","saveTitle","Popdown","scrollableElementId","scrollAgainstWindow","stretchAgainstAnchor","topOffset","createElement","setPosition","coords","getBoundingClientRect","offset","top","height","left","innerWidth","right","scrollableElement","classList","fragment","body","appendChild","remove","createPortal","propTypes","PropTypes","isRequired","roleMembers","setRoleMembers","backgroundStyle","backgroundColor","randomcolor","hue","seed","luminosity","initials","loadedRole","flashError","user_count","pluralize","defaultComponents","IndicatorSeparator","classNamePrefix","components","baseStyles","borderColor","SideMenu","transitionRef","SlidingToggle","handleClick","renderDescription","renderNestedContent","FIELD_ICONS","string","text","integer","float","money","address","date_range","date","multiple_choice","checkboxes","phone","entity","setFieldType","getDataTypes","customEntities","optionId","destroyAll","optionAttrs","multiple_choice_option","upload","optionFile","addOption","ADDED","dispatchOptionAdd","removeOption","DESTROYED","dispatchOptionDestroy","updateOption","UPDATED","dispatchOptionUpdate","reorderOption","newPos","MOVED","uploadOptions","optionNumber","shouldFocus","formulaValuesEnabled","onOptionChange","onDeleteFail","canDelete","displayValueInputRef","displayValue","setDisplayValue","numericValue","setNumericValue","numeric_value","debouncedSendValueUpdate","debouncedSendNumericUpdate","deleteClicked","Actions","onDisplayValueChange","onNumericValueChange","draggableId","draggableProps","dragHandleProps","stepDatum","newElements","setNewElements","setFormulaValuesEnabled","some","sortedOptionsFromProps","sort","b","orderedOptions","setOrderedOptions","useDerivedState","removeNumericValues","optionNeedsFocus","fakeActionClicked","inputsClass","onDragEnd","source","destination","oldOptions","draggedOptionId","newPosition","droppableId","droppableProps","optionData","indexOf","files","testOption","isNaN","onDataChanged","onLimitChanged","minValue","setMinValue","maxValue","setMaxValue","debouncedOnDataChanged","d","validateMinValue","updateValue","validateMaxValue","min","max","validateNumberFormat","lockOnRenewal","autofillEnabled","autofillOnRenewal","onToggleLockOnRenewal","onToggleAutofillOnRenewal","toggleValue","renderAutofillOnRenewal","NoNegativesInput","allowZero","Math","abs","maxLength","maxLengthValue","setMaxLengthValue","dateFormatOptions","dateRangeFormatOptions","dateRangeStartLabel","dateRangeEndLabel","dateType","isRange","onStartDateLabelChange","onEndDateLabelChange","numberOfOptions","minNumberOfChecks","minNumChecks","setMinNumChecks","validateMinNumChecks","TYPES_WITH_DEFAULTS","TYPES_WITH_TYPE_SPECIFIC_SETTINGS","FieldSettings","multipleChoiceOptions","fieldName","canConfigureDefault","hasTypeSpecificSettings","setDefaultValue","defaultOptionId","setDefaultOptionId","is_default","entityCreateable","setEntityCreateable","setOpen","canAllowNewEntity","startsWith","custom_entity","validateDefault","toggleAdvancedSettings","onDefaultChange","onDefaultClear","MultipleChoiceOptionActions","getDefaultInputType","onDefaultSelect","onEntityCreatableChanged","iconClass","renderToggle","minWidth","defaultInput","renderDefaultIsInvalidWarning","renderTypeSpecificSettings","autofillEnabledOnTemplate","setError","nameValue","setNameValue","handleError","prevType","setPrevType","onTypeChange","custom_entity_id","onDeleteButtonClick","onMultipleChoiceOptionChange","err","dataTypeOptions","isDataTypeWithOptions","onRowClick","onDuplicateButtonClick","fieldNameForType","customEntityId","opacity","logicDisabled","hasLogic","isEditorActive","setIsEditorActive","addingLogic","setAddingLogic","onInstructionsSave","getTemplateVariables","TemplateManagerStore","getStepData","renderInstructions","logic_config","logicableId","onLogicOff","renderLogicConfig","STEP_TYPE_MAP","Step","Survey","onDatumClick","activeDatumId","allowedStepDatumTypes","showSectionSettings","setShowSectionSettings","sectionName","setSectionName","showFieldMenu","setShowFieldMenu","sidemenuRef","isLogicDisabled","s","used_in_formula","sectionNameChanged","copy","SurveyActions","destroySectionClicked","configured_outputs","autofill","marginRight","margin","justifyContent","alignItems","STEP_ROW","datumInnerRef","rowIndex","custom_entities","nodeRef","positionSort","getSectionId","droppable","sectionsBottomRef","setActiveDatumId","sortedSectionsFromProps","orderedSections","setOrderedSections","sortedStepDatFromProps","fromEntries","entries","reduce","acc","datumStepId","datumArray","transformStepData","orderedStepData","setOrderedStepData","prevLength","setPrevLength","scrollIntoView","STEP_SECTION","oldSections","draggedSectionId","sourceSectionId","destSectionId","oldStepData","draggedDatum","sourceArray","destArray","logicable_id","logicable_type","logic_conditions_attributes","logicConfigId","onLogicConfigSaved","FlowStepConstants","LOGIC_CONFIG_ADDED","onLogicConfigDestroy","newStepAssignmentGroups","new_groups","LOGIC_CONFIG_DESTROYED","formatConditions","c","source_type","fetchAvailableFields","LogicConfigAPI","StepLogic","initialLogicConfig","defaultAction","didMountRef","LogicActions","LogicValidator","promise","onLogicSave","saveLogic","MentionsManager","mentionStarted","suggestions","selectionIdx","searchQueries","getSearchQueries","inputElement","getInputElement","keyboard","prevSuggestion","nextSuggestion","handleKeydown","componentWillUnmount","html","handleTagSearch","selectSuggestion","handleDefaultKeyEvents","newIndex","selectedTag","insertTag","resetSuggestions","mentionNames","mention","normalizeName","toLowerCase","newProps","newQueries","newActiveQuery","getActiveQuery","queryInactive","activeQuery","updateSuggestedMentions","newQuery","idx","oldQuery","queryStr","escapedQuery","RegexEscape","match","RegExp","allPossibleQueries","mentionBeginningIdx","char","onMentionInsert","mentionType","renderSuggestedTag","selectedIconClass","renderSuggestedMentions","Embed","Quill","import","Mention","node","setAttribute","textContent","domNode","dataset","objectType","blotName","tagName","register","TextEditor","formats","modules","cursorPos","quillEditor","quill","getEditor","getSelection","pos","getText","deleteText","insertEmbed","setSelection","editor","list","TextEditorButtons","saveDisabled","MemberUserPseudoInfo","onResendInviteClick","UserDisc","avatar_url","backgroundImage","backgroundSize","buildDisc","ellipsis","pseudo","invitation","keyMirror","CURRENT_ACTIVE_STEP_UPDATED","SYNC_ACTIVE_STEP","numberErrorMessage","numberType","formValidation","number","ADVANCE_ATTEMPTED","ACTIVE_STEP_LOADED","ACTIVE_STEP_UPDATED","APPROVAL_CHANGED","COLLECTED_DATA_CHANGED","COLLECTED_DATA_ERROR","COLLECTED_DATA_WILL_CHANGE","DELETE_ATTACHED_FILE","ENTITY_LOADED","HALTED","LOADED","OUTPUT_UPDATED","PAYMENT_MADE","PAYMENT_UPDATED","SET_ATTACHMENTS_REFRESHED","SET_REFRESHED","SUBPROCESS_REQUIREMENT_UPDATED","SYNC_ATTACHMENTS","REQUIREMENT_DELETED","REQUIREMENT_UPDATED","STEP_APPROVAL_CHANGED","STEP_LOADED","TAG_ADDED","TAG_REMOVED","TAG_DELETED","TAG_UPDATED","APPLICANT_LIST_UPDATED","PRIMARY_APPLICANT_CHANGED","STEP_ASSIGNMENT_GROUP_ACTIONS","FORM_ACTIONS","REVIEW_ACTIONS","SUBPROCESS_ACTIONS","reviewGroup","stepAssignmentGroup","concat","EMAIL_NOTIFICATION_ADDED","EMAIL_NOTIFICATION_DESTROYED","EMAIL_NOTIFICATION_UPDATED","FAQ_CREATED","FAQ_DESTROYED","FAQ_UPDATED","FORMULA_DESTROYED","FORMULA_LOADED","RENEWAL_REMINDER_CREATED","RENEWAL_REMINDER_UPDATED","RENEWAL_REMINDER_DELETED","REVIEW_GROUP_ADDED","REVIEW_GROUP_DELETED","REVIEW_GROUP_REMOVED","REVIEW_GROUP_UPDATED","SEARCH_CONFIG_ADDED","SEARCH_CONFIG_DELETED","SEARCH_CONFIG_UPDATED","SUBPROCESS_CONFIG_ADDED","SUBPROCESS_CONFIG_DELETED","SUBPROCESS_CONFIG_UPDATED","TEAM_DATA_LOADED","MANAGER_LOADED","SEARCH_RESULTS_CHANGED","AccessManagerDispatchContext","createContext","Notification","renderDetails","notification","details","detail","notificationType","extraClasses","Role","setRole","newRole","setNewRole","tab","setTab","addToRole","setAddToRole","setNotification","member_mgmt_level","userIsOwner","sendSave","onCancel","onRoleChange","change","allowedToEdit","userIsAMember","CityGrows","Server","currentUserId","renderPermissions","workflow_creator","team_manager","finance_manager","finance_member","can","cannot","workflowCreatorPermission","teamSettingsPermission","financeManagerPermission","financeMemberPermission","renderNonOwnerPermissions","renderPermissionLevelSelect","role_type","membersDisabled","userPermissionLevelSelect","renderNotifications","renderButtons","additionalText","renderUsers","THead","TH","TBody","TD","TR","expandedContent","expanded","setExpanded","closeExpansion","rowClass","ExpandedSection","team_creator_id","labelId","onEdit","RolesContainer","defaultName","setDefaultName","roleName","history","useHistory","ownerRole","updatedRoles","roleIndex","findIndex","changedPerson","attachments","updateAttachedPeople","savedRole","RoleActions","updatedRole","onRoleUpdate","onNewClick","exact","path","addingNew","onNewClosed","setAddingNew","renderer","routerProps","prps","params","parseInt","pathname","activeTab","workflows","new","StrictMode","batch_export_template","export","exportTemplate","onExport","scheduled_day","DAYS","setOptions","activeSelection","setActiveSelection","filterTerm","setFilterTerm","availableOptions","matchName","selectedOptions","toggleSelect","dupOption","dupOptions","o","renderOption","ExportTemplate","setExportTemplate","scheduled","setScheduled","monthLimited","setMonthLimited","prior_months_limit","days","Array","from","flowTemplates","item_ids","toggleScheduling","onExportTemplateChange","toggleMonthLimited","prior_months_type","isNewExportTemplate","ids","dupTemplate","types","renderDateLimit","include_legacy","exportTemplates","setExportTemplates","BatchExportTemplateAPI","dupTemplates","t","renderExportTemplateRow","newExportTemplate","renderExportTemplates","exportTemplatesData","isFinanceManager","activeLink","ENTITY_UPDATED","CUSTOM_ADDED","CUSTOM_UPDATED","CUSTOM_REMOVED","CUSTOM_ENTITY_CREATED","CUSTOM_ENTITY_ARCHIVED","invariant","custom_entity_fields","entityId","fieldToUpdate","each","customEntity","without","newCustomEntity","isESRI","serviceURL","esri_service_url","is_esri","custom_entity_field","createEntity","CustomEntitiesAPI","updateEntity","responseText","addField","removeField","updateField","archive","LinkyButton","restProps","EntityConfigurationDispatchContext","viewable","setViewable","setName","editSuggestable","setEditSuggestable","edit_suggestable","editingName","setEditingName","nameBlank","updateName","saveNewEntity","EntityConfigurationActions","onNewFieldAdded","saveName","editName","deleteField","data_count","onViewableChanged","onEditableChanged","editNameAction","isEsri","showDelete","editable","nameField","cancelNewField","optionsForSelect","f","name_field_id","newVal","newField","setNewField","newFieldButton","onEntityNameChanged","newName","newFieldSection","renderEntityTypeInfo","CreateDialog","onEntityCreated","esriIsEnabled","setIsESRI","setServiceURL","allow","entityConfigurationState","entityConfigurationDispatch","useReducer","entityConfigurationReducer","creatingNewEntity","setCreatingNewEntity","renderCustomEntity","Provider","custom_entity_data","ITEMS_LOADED","MORE_ITEMS_LOADED","STEP_DATA_LOADED","ITEMS_LOADING","LOAD_FAILED","_initiatedFlows","_totalCount","_currentTemplateStepData","_currentPosition","_batchSize","_totalLoadedCount","store","Stapes","getInitiatedFlows","getTotalInitiatedFlowCount","getTotalLoadedInitiatedFlowCount","getNextBatchSize","difference","addNewItems","DashboardConstants","total_count","emit","OPERATOR_IS","OPERATOR_IS_NOT","OPERATOR_RANGE","OPERATOR_LONGER","WORKFLOW_STATUSES","COMPLETION_STATUSES","DATE_TERMS","IMPORTED_OPTIONS","OUTPUT_STATUSES","RENEWAL_STATUSES","TEAM_SELECT","filterGroup","defaults","operator","operators","FORM_SELECT","OUTPUT_STATUS_SELECT","RENEWAL_STATUS_SELECT","CURRENT_STEP_SELECT","DIMENSIONS","applicant","term","getSubmissionDimensions","sortBy","getOutputDimensions","AdvancedFilterContext","activeFilters","availableFilters","currentFilter","savedFilters","triggerRefresh","defaultFilters","AdvancedFilterDispatchContext","AdvancedFilterProvider","initial","advancedFilterReducer","useAdvancedFilterContext","useAdvancedFilterDispatchContext","buildDatumField","groupName","identity","addToFiltersGroup","filters","removeFromFiltersGroup","loadFilter","savedFilter","step_data_for_search","filterIds","datumFiltersIds","datum_fields","current_step","filtersGroups","datumFields","fields","legacyDatumFields","legacy_data","formFields","flatten","legacyFormFields","stepDataForSearch","isDefault","newState","inDatumFields","DashboardStore","stringify","loadedFilter","groups","mainGroup","currentFilters","filterId","updatedSaved","loaded","save","dfault","toggleDefault","templates","FilterAPI","loadTemplates","changeFilterValue","changeFilterValueOptions","filterState","minify","showPeopleList","setShowPeopleList","peopleList","setPeopleList","setApplicant","hidePeopleList","searchPerson","FilterActions","onPersonRemove","defaultStatus","opt","getOptionValue","formatIncoming","dayjs","toDate","formatOutgoing","format","dateFormats","onDateChange","dateFormat","placeholderText","showTimeSelect","showTimeSelectOnly","timeIntervals","showMonthDropdown","showYearDropdown","dropdownMode","withPortal","fromToValues","setFrom","to","setTo","updateFrom","updateTo","defaultTerm","SingleCheckboxToggle","onToggleFallback","setToggle","CheckboxesSelect","onDatumFieldsChange","activeOptions","setActiveOptions","toggleValues","setToggleValues","termIds","isMulti","newTerm","val","undefined","getOptionLabel","onInputChange","onMultipleChoiceChange","fetchFilterValue","fromTo","filterValue","renderMultipleChoiceSelect","halt","initiatedFlowIds","initiated_flow_ids","unassign","DashboardAPI","fetchAssigned","fetchOutputs","confirmCount","extend","confirm_count","exportOutputs","_mostRecentQueryParams","_pagesRequested","_mostRecentRequest","_loadingNewPage","filteredSearch","textStatus","jqXHR","initiated_flows","onLoadFailed","loadMoreItems","page","requestParams","include_count","selectInitiatedFlowDashboardIds","chain","where","onFailedHalt","onFailedDelete","onSuccessfulHalt","flashSuccess","onSuccessfulDelete","BatchInitiatedFlowsAPI","floor","dashboardIds","search_type","req","statusText","disableStepDataFilters","enableStepDataFilters","teamFilter","formTemplates","form","templatesBySelectedStatus","defaultStatusValue","formNumberIds","defaultSelectedFormsValue","DashboardActions","name_or_default","multiValue","loadSources","DataImportAPI","DEFAULT_OPTION","dataImports","setDataImports","optionValue","SourceFilterActions","formattedSources","onImportedSourceChange","filterType","tags","toggledOn","importedSelect","currentStep","tagOptions","tagNumberIds","tagsContent","tag","completedStatus","outputStatus","renewalStatus","submissionText","teams","teamNumberIds","teamsContent","DropdownIndicator","onFilterDelete","onOperatorChange","onFilterValueChange","onFilterValueOptionsChange","unitId","minified","marginTop","renderSubUnit","cursor","marginLeft","renderMainContent","AdvancedFilterAPI","kind","loadDefault","rename","isActiveRow","editMode","setEditMode","deleteMode","setDeleteMode","setDisplayName","setNewName","showEditMode","OnNameEdit","ApplyNameEdit","flexGrow","flexBasis","created_at","onLoad","activeFilterId","setActiveFilterId","onDeleteFilter","loadFilterButtonClass","filterName","setFilterName","saveAsOn","setSaveAsOn","saveAsDefaultOn","setSaveAsDefaultOn","setTemplates","tagId","setTags","TagAPI","onFilterApply","menuAvailable","defaultFilter","previousState","filterParams","showMenuOptions","setShowMenuOptions","showLoadFilter","setShowLoadFilter","showSaveFilter","setShowSaveFilter","setMinify","menuAnchor","useLoadTemplates","useLoadTags","completed_status","imported","addActiveFilter","openLoadFilterModal","openSaveFilterModal","onLoadFilter","renderFilterSelect","filterOptions","padding","flex","joiningAndSpan","prependJoiningAnd","renderMinified","renderActiveFilters","hasLocalStorage","testKey","ls","global","localStorage","setItem","removeItem","storedState","getItem","console","warn","saveState","ErrorBoundary","hasError","componentDidCatch","info","env","log","Rollbar","src","alt","SEARCH_TYPES","SearchBar","searchTypeChanged","searchType","searchButtonId","wrapperRef","focusedClass","lineHeight","border","Portal","containerRef","div","removeChild","DEFAULT_OPTIONS","paddingChars","phrase","lowerInput","lowerPhrase","phrasePos","startPos","startCap","startChunk","candidateEndPos","endPos","endCap","endChunk","typeToUrlSegment","InitiatedFlow","ImportedFlow","urlForItem","dashboardable_type","dashboardable_id","results","searchTerms","getPopupPosition","resultsHTML","collected_datum_id","template_name","scoped_id","identifier","ENTER_KEY","masterSearchResults","setMasterSearchResults","masterSearchTerms","setMasterSearchTerms","chipPresent","setChipPresent","searchBarInFocus","setSearchBarInFocus","typeInFocus","setTypeInFocus","setSearchType","currentSearchRef","masterSearchRef","debouncedMasterSearchChanged","abort","shouldShowSearchResults","onEnterPressed","sendSearch","Chip","clickable","onKeyUp","KEYS","Cell","require","cellName","onFlowBoxClick","selectedItems","buildId","is_renewal","applicantName","buildApplicant","current_step_name","current_step_elapsed_time_string","last_edited","last_activity_at","columnId","activeOrder","onSorting","by","order","sortByColumn","isString","renderIcon","Table","Column","MainDashboard","resizeCount","initiatedFlows","rowsCount","hasTemplates","noTeams","sortingFn","dashboardElement","tableWidth","setTableWidth","tableHeight","setTableHeight","onResize","offsetHeight","contentWidth","buildCell","columnAttrs","offsetWidth","rowResponsibilityClass","current_user_responsible","rowHeight","headerHeight","rowClassNameGetter","header","cell","cellClassName","rel","taggableType","taggableId","tagAttrs","mergedAttrs","taggable_type","taggable_id","tagging","createInBatch","taggingsAttrs","taggings","taggingId","destroyInBatch","createTag","TaggingAPI","new_tag_name","onTagAdded","addTagging","tag_id","addTaggingInBulk","removeTagging","onTaggingRemoved","removeTaggingInBulk","updateTag","onTagUpdated","destroyTag","onTagDeleted","reservedTagNames","tagNames","setTagNames","selectedTags","setSelectedTags","tagTerm","setTagTerm","isWorking","setIsWorking","filteredTags","isTagSelected","renderAddTagLink","onNewTagAdd","submissionCount","renderHeaderTitle","trim","filtered","onTagToggle","renderSelectedIcon","tag_name","TagManagerActions","onTagCreate","VALID_URL_PARAMS","Dashboard","loadItems","currentFilterId","dashboardResizeCount","cachedState","totalInitiatedFlowCount","showTagManager","tagManagerDeleteMode","defaultWasInaccessible","bindToUnload","bindToStore","updatedURLParams","pick","substr","replaceState","hash","fetchStateFromURL","unBindToStore","LocalStorage","getLocalStorageKey","getSyncState","__react_localstorage_beforeunload","inputState","changeCurrentFilter","loadSavedFilterState","filtersOpen","getOpenState","createLocalStorageKey","Date","now","newParams","paramString","searchParams","master_search_terms","master_search_type","cacheAndApplyAdvancedFilter","applyAdvancedFilter","onStoreChange","onLoadMore","masterSearchChanged","flowBoxClicked","isOn","currentSelectedItems","unique_id","visibleItemsForAction","visibleItems","handleHalt","handleDelete","deleteMatching","deleteSpecific","confirmDelete","itemCount","challengeResponse","strongConfirm","onActionClicked","handleAssign","handleUnassign","handleExport","handleAddTag","handleRemoveTag","toggleTagManager","ontagNamesUpdate","sortChanged","renderSelectedProcessesMessage","renderTagManager","renderProcessesTab","MasterSearchWrapper","defaultFilterIds","matches","maxlength","substring","wrapperElement","outputs","contentHeight","output","processHref","buildCellContent","primary_applicant","expire_value","expires_at","issued_value","issued_at","initiated_flow_scoped_id","flow_template_color","flow_template_name","totalCount","_isLoading","addItems","next_page","lastFilters","setLastFilters","setOutputs","setTotalCount","isLoading","setIsLoading","onSortChange","applyFilter","loadMore","useLoadMoreOutputs","newItems","rejectSuggestion","editSuggestionsRequestId","suggestionId","suggestion_id","suggest","entity_id","EditSuggestionsRequest","addingPOC","updating","request","authToken","toggleAddPOC","rejectChange","EditSuggestionsAPI","cancel","deSelectRequest","renderSuggestion","suggestion","new_content","current_content","renderChanges","renderPocAdd","entity_name","is_poc","formMethod","formAction","step_datum_id","createEsri","esriUniqueId","esri_unique_id","fetchSuggested","flow_template_id","getEntity","toggleDestroyed","EntityAPI","createEsriEntity","suggestEdits","onNoteChange","customFieldValues","values","fieldRef","createRef","onFormChange","custom_entity_field_values","note","_a","feature","mapContainerRef","mapRef","L","mapbox","zoom","attributionControl","compact","marker","featureLayer","geometry","addTo","invalidateSize","fitBounds","getBounds","field_data","entityFromProps","setEntity","contacts","setContacts","updateContacts","contact","updatedContacts","EntityActions","onNameChange","newNote","toggleEntityDestroyed","renderFlow","flow","template_color","launched_by","custom_entity_name","deleted_at","renderExtras","teamsForSelect","peopleSelected","exported","setExported","exporting","setExporting","exportType","init","entityTabLabel","entityData","Directory","select2","minimumResultsForSearch","entityOptions","Exports","exports","interval","setInterval","fetchUpdates","clearInterval","loadExports","ExportsAPI","getFileLink","statusColor","renderExportRow","xport","export_type","scope","removalLink","renderExportsTable","renderExportTables","exportsData","starForm","unstarForm","templateList","onTemplateChange","fullSize","noId","stepNames","templateCategoryId","categoryId","templateCategories","category","setTemplate","setCategoryId","showContent","setShowContent","isLaunching","setIsLaunching","launchUrl","filteredTemplates","tmpl","matchCategory","closeMainContainer","renderLaunchButton","bigger","it","renderTemplateInformation","onShowTemplateModal","starredFormIds","setStarredFormIds","starredForms","masterTemplates","forms","tmp","formsPagination","showViewAllLink","teamFriendlyId","renderFormItem","isStarred","starIcon","UserPreferenceActions","starred_master_template_ids","teamName","renderTitle","canCreateForms","enableFormCreation","newFormContainer","unmountOnExit","renderCreateNewForm","renderList","teamlessForms","archivedMode","friendly_id","master_templates","enable_form_creation","InitiatedFlowAPI","launchProcess","primary_applicant_id","primaryApplicantId","secondary_applicant_ids","secondaryApplicantIds","subprocess_requirement_id","subprocessRequirementId","previouslyLaunched","destroyProcess","parseVariableText","textType","textContainerId","text_type","text_container_id","documentsAndFiles","uploadRepoFile","deleteRepoFile","fileId","file_id","doNextStep","step_id","checkIfAccountExists","InitiatedFlowActions","receiveInitiatedFlow","receiveStep","receiveActiveStep","activeStep","deleteProcess","renderRow","processURL","identifier_field","is_renewable","ExistingProcessesStep","onNextClick","ExistingAccountStep","getInitialState","isIncomplete","onSubmit","autoFocus","EmailStep","emailValid","onEmailChange","PersonalInfoStep","defaultNameValue","onBackClick","goBack","PasswordStep","buttonText","LaunchManager","setEmail","setPassword","existingAccount","setExistingAccount","currentUser","setCurrentUser","existingProcesses","setExistingProcesses","existingProcessCheck","checkEmailAndRedirect","authenticateUser","redirectTo","LaunchManagerActions","handleEmailCheckResponse","accountExists","onEmailSubmit","newEmail","onPersonalInfoSubmit","onPasswordSubmit","newPassword","authRequest","UserActions","existing","canUseExistingProcesses","launchChain","subprocessRequirement","allow_link_existing","postAuth","onLaunchFlowComplete","primaryApplicant","isLoggedIn","checkForLogin","throttle","trailing","pollForLogin","INVITES_ADDED","reqsDupe","refreshing","requirements","requirement","reqDupe","payment","completed","payable_id","charges","charge","chargeable_id","collected_data","outstandingSaveRequests","changePending","refreshingAttachments","activeStepIndex","active_steps","activeStepDupe","currentActiveStep","reviewSubmitted","SurveySubmissionConstants","survey_invitations","invites","survey_submissions","ActivityLogConstants","activities","taggingsDupe","suggestedTags","suggested_tags","tagToUpdate","tagging_count","otherSuggestedTags","taggingToUpdate","otherTaggings","updatedTaggings","taggingToRemove","updatedTags","attachmentsDup","halted","issued_outputs","outputsDupe","subprocess_requirements","subprocessReqDupe","attemptedAdvance","saved","applicant_attachments","is_primary","DiscussionConstants","discussions","CREATED","discussion","discussionsDupe","COMMENT_ADDED","discussionComment","discussion_id","discussion_comments","COMMENT_DELETED","discussionCommentId","discussionCommentsDupe","DiscussionCommentId","discussionId","resolved","discussion_comment","disucssionCommentId","onDiscussionUpdated","discussionAttrs","DiscussionActions","onDiscussionCreate","startDiscussion","DiscussionAPI","saveDiscussionComment","commentBody","commentAttrs","DiscussionCommentAPI","comment","deleteDiscussionComment","loadDiscussions","deleteDiscussion","onDiscussionDeleted","active_step","waivePayment","unwaivePayment","receiveCheck","paymentAttrs","check_paid_amount","check_number","checkNumber","receiveCash","cash_paid_amount","removeCheckPayment","removeCashPayment","AdminNotif","onCloseClick","in","mountOnEnter","SurveySubmissionAPI","survey_submission","survey_id","collected_data_attributes","collectedDataAttrs","submissionToken","fetchData","surveySubmissionId","postData","emailsOrFile","emails","doSend","remind","surveyInvitationId","remindAll","SurveySubmissionActions","submissionId","sendReminder","SurveyInvitationsAPI","sendAllReminder","onRemindAllComplete","dispatchSubmissionDestroyed","version","isObject","visualizationData","deleteAttachedFile","s3Preauth","dataChanged","FlowConstants","sync","ajaxRequest","CollectedDataAPI","jsonResponseMessage","dispatchDataWillChange","dispatchFileDeleted","startDate","endDate","ignoreClose","setIgnoreClose","isStart","selectsStart","selectsEnd","onCalendarClose","endId","onClickOutside","updateCurrentActiveStep","attrsForDispatch","locked_fields","CreateButton","createNewEntity","onSelectEntityClick","titleize","SearchResults","resultType","canCreateNewEntity","fieldValue","fetchEntities","keycode","newEntity","fieldState","admin","removeEntity","entityName","setEntityName","cancelEdit","edit","anyEditable","RemoveEntityButton","EntityField","Map","entityTemplateFields","cancelNewEntity","creatingEntity","fieldReducer","getEntityFields","fetchingEntity","setFetchingEntity","setCreatingEntity","entityIsEsri","entityValues","thisEntity","doCreateNewEsriEntity","doCreateNewEntity","entityFieldMap","field_id","resultId","validateAddress","SmartyStreetsCore","SmartyStreetsSDK","Lookup","websiteKey","credentials","SharedCredentials","clientBuilder","ClientBuilder","withLicenses","client","buildUsAutocompleteProClient","getSuggestions","lookup","send","userInput","AddressOption","labelText","suggested","AddressValidator","addressSuggestions","validatedAddresses","userInputtedAddress","searched","fetching","autocompleteRequestNumber","focusInputAndSelect","smartyStreetsClient","SmartyStreetsClient","handleCancel","hasValidatedAddresses","handleAddressSelect","handleKeyPress","requestNumber","then","resolveAddressSuggestions","catch","handleSuggestionError","AddressValidatorAPI","resolveAddressValidation","streetLine","secondary","city","zipcode","renderInput","renderWait","renderContainer","renderValidatedAddresses","noResults","backText","renderSubmittedAddressOption","handleSave","completionBegun","focused","setFocused","initialDefault","setInitialDefault","FileDropzone","onFileAccept","onDropCallback","getRootProps","getInputProps","useDropzone","onDrop","multiple","rootProps","marginBottom","uploading","setUploading","onUploadError","fetchPreauth","authFields","k","v","postToS3","form_data","s3Res","$xml","findFileURL","uploadDirectToS3","initMap","geocoder","initGeocoder","invalidate","findMapElement","zoomControl","scrollWheelZoom","handleQueryResponse","removeLayer","latlng","coordinates","properties","panTo","statusClass","AttachedFile","deleting","getUploadedByTagString","adminUploaded","fileName","setDeletingState","boolean","getTruncatedFileName","createdAt","deletable","StepDataCollectorInputField","initialStartDate","start_date","initialEndDate","end_date","debouncedSubmit","getDebounceIntervalForDatum","checkboxRefs","beganFieldCompletion","setBeganFieldCompletion","setVersion","valid","setValid","localValue","setLocalValue","setStartDate","setEndDate","sentValue","immediately","checkboxElements","findCheckbox","element","findFieldValue","validateInput","submitValue","prevFieldValue","usePrevious","prevAttemptedAdvance","prevFirstError","firstError","basicInput","renderCheckboxes","initialValues","checkboxesHTML","initialValue","renderCheckbox","checkbox","isChecked","refName","onEntityValueChanged","onStartDateRangeInputChanged","onEndDateRangeInputChanged","onDateInputChanged","onFileInputChanged","isValid","args","CollectInfoStepActions","onTextAreaBlur","fieldValueDidChange","statusClassName","renderFiles","original","file_file_name","admin_uploaded","renderFile","renderFormErrorMessage","errorMessageForDatum","extraLabel","renderTextLabel","requiredIcon","onLockClick","lockedFields","isFieldLocked","String","ActiveStepActions","ariaLabelledBy","startId","minDate","entity_fields","inputTagForFieldType","isStepLocked","lockButton","renderInputField","surveyData","defaultValues","firstErrorId","setFirstErrorId","firstDatumWithError","collectedDatum","addressOnInputChanged","SUBMIT_BUTTON_LABELS","unsubmitted","submitted","existingSubmission","setSurveyData","surveyDta","existingSubmissionData","default_values","defaultValueData","setSubmitted","submitting","setSubmitting","setAttemptedAdvance","onSubmitRequestComplete","onSurveySubmitted","prevState","setDatumValue","formattedDataForSubmit","allStepData","field_type","formatContent","readyToSubmit","renderSection","emailWrapperClass","onEmailchange","submissionNumber","submissionDetails","renderEmail","renderHeader","renderContactField","token","labels","renderSubmitButtonText","collectedData","setCollectedData","submission","onSurveyDataLoaded","htmlString","parsedHTML","parseHTML","$html","$formulaTags","$fieldTags","$keywordTags","Promise","textState","setTextState","resolveTags","loadActivities","timeago","settings","cutoff","loadFailed","setLoadFailed","dateTime","renderActivity","activity","assignmentId","dispatchAssignmentUpdated","processId","ProcessAssignmentsAPI","personAttachments","onAdminDelete","existingUser","removable","onAdminToggle","renderAdminUser","assignmentLabel","adminInviteStatus","renderDisc","ProcessAssignmentsActions","assignment_id","renderAdminDeleteLink","usersToRender","renderAssignees","renderViewers","managingAdmins","setManagingAdmins","onAdminSearchTermsChanged","renderAdminRole","rolesToRender","renderAdminRoles","addApplicant","makePrimary","applicantId","removeApplicant","addPseudoApplicant","dispatchPrimaryApplicantChanged","dispatchApplicantListUpdated","managingApplicants","setManagingApplicants","isPrimaryApplicant","applicantAttachments","canManage","onApplicantUserSelect","ApplicantAttachmentActions","renderApplicant","showMakePrimaryButton","showDeleteButton","onPrimaryApplicantChange","onApplicantDelete","otherApplicants","renderApplicants","renderAccessManager","localizedFormat","otherApplicantsCount","applicants_count","many","getApplicantText","identifier_field_value","renderIdentifier","createTagInput","creatingTag","setCreatingTag","editingTagId","setEditingTagId","editTagInput","onEnterKeyPressed","existingTag","findTag","isReservedTagName","onSubmitNewTag","onUpdateTagClick","tagIsSelected","findTagging","onCreateTagClick","renderActions","canModifyTag","taggingCount","onDeleteTagClick","renderTag","onTagClick","renderTagCreationSection","showAll","setShowAll","renderTagging","numToShow","firstTaggings","moreTaggings","HeaderMeta","ignoredCssClasses","members","flowStatusClass","buttonHTML","callback","targetRef","keydownRef","keydownCallback","DiscussionDispatchContext","renderDeleteButton","ApprovalStatus","verb","EditResponse","close","editedText","setEditedText","inputRef","onUpdateDiscussionClick","keydownTargetRef","useKeyDown","metaKey","ctrlKey","ReplyResponse","reply","setReply","onSaveComment","DISCUSSION_SELECT_ID","DISCUSSION_SELECT_STYLES","menu","valueContainer","DiscussionItem","onMakeActive","onMakeInactive","discussionOptions","userIsAdmin","manageDiscussionRef","deleteDiscussionRef","resolvedWrapperRef","replying","setReplying","highlighted","setHighlighted","closeCommentBox","closeEditBox","discussionHTMLName","onReplyClick","canManageDiscussion","wrapperClass","Boolean","isManageOrDeleteClick","querySelector","isSelectClick","approval","step_approval","approval_status","review_group_name","renderContext","numComments","actionWord","renderModeContent","DISCUSSION_OPTIONS","DEFAULT_DISCUSSION_OPTION","AddNewDiscussion","onDiscussionOpened","discussionContent","setDiscussionContent","discussionOption","setDiscussionOption","onStartDiscussion","ShowDiscussions","recentlyAddedDiscussionId","onNewDiscussionClick","activeDiscussionId","setActiveDiscussionId","DiscussionContent","addingNewDiscussion","setAddingNewDiscussion","onBackButtonClick","renderHeaderFunction","resp","blob","createObjectURL","download","revokeObjectURL","isStepFile","removeFile","filename","updated_at","renderDelete","outputId","includeFiles","with_files","BackgroundedJobLink","showPatienceWarning","setShowPatienceWarning","resetDownloadButton","clearTimeout","queueFunction","onJobComplete","patienceWarning","workingText","onSummaryFinishedGenerating","parsed","file_url","file_name","ajaxDownload","alertWithDownloadURL","outputsShow","ExpandableContent","linkText","OutputDownloadLink","RenewalManager","onCancelClick","renderRenewalProcess","current_published_workflow_name","variation","issued_output","revoke","unrevoke","renewalOptIn","renewalOptOut","apiUpdate","issuedAt","expiresAt","outputAttrs","onUpdateComplete","apiRevoke","apiUnrevoke","apiRenewalOptIn","apiRenewalOptOut","onRenewalOptIn","renderRenewalReminder","reminder","reminderDate","direction","subtract","period_value","period_unit","renewal_opted_out","renewal_open_date","renewal_close_date","simple_renewal_reminder_info","revoked","revokeAction","unrevokeAction","editingExpiration","setEditingExpiration","editingIssued","setEditingIssued","isGov","RequestIsGovContext","shouldShowEditButtons","onEditExpirationClick","onEditIssuedClick","onIssueDateUpdate","renderExpirationDate","onExpirationDateUpdate","maxDate","addYears","editButton","issued","renderIssueDate","expires","expired","renderExpirationDetails","Output","collapse","isCustomResult","toggleCollapse","classNameForStatus","renderRenewalInfo","renewal","original_output","renewed","renewalCount","simple_renewal_info","renewing","setRenewing","showRevoke","renderDownloadLink","renderHeaderDocumentLink","tagLabel","openRevealArrowClass","renderStatusTag","is_currently_renewable","issuedOutputs","isUploading","setIsUploading","setFiles","repoFiles","setRepoFiles","repo_files","onFileSelect","repo_file","outputsNodes","renderOutputs","filesNodes","repoFilesNodes","anyFile","onRequestPaymentClicked","renderAdditionaPaymentButton","problems","noErrors","AddlOptions","toggleOpen","canHalt","finished_at","canUnhalt","notClearedToUnhalt","halted_by_admin","renderOptions","Support","questionViewOpen","technicalIssueViewOpen","showQuestionView","closeSupportWindow","onOpenDiscussionClick","onSupportRequested","renderQuestionView","publicHost","masterTemplateSlug","renderTechnicalIssueView","renderInitialView","renderView","dataURI","signing","signature","SignatureAPI","signed","setSigned","signaturePad","canvasProps","renderError","canvas","getCanvas","clear","ctx","getContext","font","fillText","SignatureActions","getTrimmedCanvas","toDataURL","_promise","unmount","requestSignature","$container","isAdmin","currentStepId","attemptAdvance","attemptAdminAdvance","attemptConstituentAdvance","shouldShowNoPaymentWarning","resolveAdvance","requiresSignature","shouldShowCantModifyWarning","revisable","requires_signature","needs_signature","external","SignaturePrompt","sig","paid","initiatedFlowState","submitButton","supportOpen","setSupportOpen","advancing","setAdvancing","nextStepButtonContent","spinner","isSubprocess","is_last","taskView","nextStepButtonText","userCanAdvance","onLastStep","onCurrentStep","onLastStepOfIncompleteProcess","handleAdvanceAttempt","requiredActions","required_actions","names","solution","onTaskViewSubmit","AdvancementHandler","willAdvance","onAdvance","onSubmitClick","onSupportButtonClick","onSupportMessageSent","renderSubmitButton","unfinished_requirements","sub","waived_at","StepValidator","parent_process","waitingOnConditional","advanceAttempted","renderButtonExtra","onMessageSent","renderSupportModal","internal_instructions","renderAdminInstructions","external_instructions","renderApplicantInstructions","collectedDatumAttrsForInputField","fieldValid","collectedDatumValue","collectedDatumVersion","onFieldDataChanged","locked","fieldsToRender","noViewableInstructions","persistBeforeSubmit","renderField","SignatureDetails","renderMostRecentSigning","wasEverSigned","signings","altText","titleText","onSignLinkClicked","renderSignings","renderSigning","reload","renderInfo","needsSignature","CollectInfoStep","renderSectionIfVisible","evaluatedLogicConfig","logic_configs","shouldRenderSection","renderSections","renderAdminLockInfo","renderPublicLockInfo","signaturesAllowed","renderSignatures","stepIsCompleted","renderAdminView","tentative_assignments","Id","decimals","round","STRIPE_FEE_PERCENT","STRIPE_ACH_FEE_PERCENT","STRIPE_FEE_FIXED","CG_FEE_PERCENT","noFee","customFeePercentage","stripeFee","amnt","calculateStripeFee","cgFee","feePercentage","calculateCGFee","Receipt","refundReason","refund_reason","nonChargeReceipt","paymentMethod","amountPaid","formattedAmount","Accounting","renderPendingText","renderStatus","refunded_at","refundDidRequireAuthorization","refund_authorizer","renderAuthorizationDetails","refund_requester","refund_requested_at","renderProcessed","renderFailureDetails","failure_message","chargeReceipt","showDownloadLink","confirmation_number","Paid","paidStepUI","nonRefundedCharge","renderReceiptForCharge","cancelRequest","chargeId","approveRequest","ChargeAPI","paymentId","cc","first","last","month","year","verification","payment_id","payment_data","getActiveCharge","api","ActiveStepAPI","PaymentAPI","PaymentStepActions","submitPayment","checkReceived","paymentFormAttrs","cashReceived","onCheckPaymentRemoved","onCashPaymentRemoved","approveRefundRequest","RefundAPI","cancelRefundRequest","pollForCharge","amountReceived","checkReceivedClicked","isNumeric","checkInstructions","cashReceivedClicked","cashInstructions","paymentType","payment_type","confirmPayment","setAmount","toFixed","onEditClick","onAmountSave","formatAmount","Intl","NumberFormat","currency","fee","StripeForm","isUpdating","setIsUpdating","isProcessing","setIsProcessing","paymentSuccessful","setPaymentSuccessful","errored","setErrored","elements","useElements","stripe","useStripe","event","PaymentIntentsApi","confirmed","async","redirect","submitToStripe","PaymentElement","renderMessage","clientSecret","setClientSecret","setStripe","editingAmount","setEditingAmount","setPaymentType","setUpdating","getClientSecret","cs","updatePaymentIntent","loadStripe","stripeKey","stripeAccount","merchantAccountId","onPaymentTypeChange","onPaymentAmountChange","chargesEnabled","renderDisabledChargesWarning","Elements","renderStripeElement","cvc","expMonth","expYear","processing","setProcessing","submitClicked","formAttrs","disabledClass","submitStatus","setChargesEnabled","paymentMethodChanged","payment_method","onStripePaymentTypeChange","paymentToggle","canceled","calculated_payment","renderPaymentMethodSelector","thirdPartyProcessor","no_fee","custom_fee_percentage","onStripePaymentAmountChange","renderPaymentForm","NoPaymentRequiredView","waived","togglePaymentWaiver","payment_waived","onRefundClick","onRefund","onRemoveCheckClick","onRemoveCashClick","onCancelRefundRequest","onApproveRefundClick","renderRefundApproveButton","authorities","showPaymentWaive","paymentWaiverLink","removeCheckLink","removeCashLink","refund_authorized_at","refunding","refundPaymentLink","setRefundReason","refundReasonInput","onRefundCancel","paymentAmount","setPaymentAmount","fixedPaymentAmount","stripePaymentType","setStripePaymentType","setRefunding","calculateTotalFee","totalAmount","paidCharge","pendingCharge","isPaid","isPending","noOptionLinks","supplemental","processingTime","feeText","renderProcessingInformation","failed","renderedFails","failedPayments","refunded","renderedRefunds","refundedPayments","requirementId","supplemental_requirement","RequirementAPI","sent","sendRequest","RequirementActions","requirementSent","requirementCompleted","requirementCanceled","cancelButton","deleteButton","sendButton","approve","reviewGroupId","approvalStatus","review_group_id","signatureData","reviewRequestData","review_request","reviewRequestId","doReview","requestReview","receivingUserId","ReviewRequestsAPI","receiving_user_id","requestNonUserReview","undoRequestReview","searchReviewers","submitThirdPartyReview","ThirdPartyReviewPersonSelector","reviewRequest","defaultReviewRequest","approvalDate","ReviewActions","undoRequest","renderReceivingUserName","receiving_user","renderRequest","renderSignature","stepApproval","renderContent","colorForApprovalStatus","user_name","colorForApproval","signature_url","ReviewInterface","previousReviews","onReviewStart","defaultApprovalMessage","defaultRejectionMessage","toName","onCommentChange","onApprovalStatusUpdate","submitButtonText","generateUniqueId","showErrors","setShowErrors","selectedApprovalStatus","setSelectedApprovalStatus","setComment","isReadyToSubmit","submissionIssues","issues","invalidSubmissionReason","issue","onApprovalStatusDidUpdate","defaultMessage","focusComment","renderErrorMessage","reviews","renderPreviousReviews","addText","onReviewSubmitComplete","onReviewComplete","signatureRequired","requireSignature","affidavit","renderSignaturePad","submitButtonClass","reviewSubmitButtonText","discussionDispatch","showPrompt","setShowPrompt","recentlyCompletedReview","setRecentlyCompletedReview","onWidgetClose","newComment","isMe","reviewer","renderReviewAppLink","previous_reviews","renderApprovalInterface","renderNonCurrentUserReview","renderReviewPrompt","is_role","member_ids","sortedReviewers","activeReviewGroup","reviewers","default_approval_message","default_rejection_message","require_signature","ActiveReviewGroup","renderReviewTypeInfo","review_type","renderSpecificPeopleReviewInfo","renderThirdPartyReviewInfo","renderConstituentView","logicWord","logic_type","optional","ConstituentReviewInfo","hasThirdPartyReview","reviewGroupRequired","should_show","renderReviewGroup","requiredReviewGroups","review_groups","unrequiredReviewCount","g","renderConstituentAction","requiredCount","unrequiredReviewGroupHTML","renderReviewInfo","newDescription","debouncedSubmitChange","canceledBanner","initiatedFlowData","renderRequirement","renderRequirementDetails","renderRequirementEditor","onInvitesSent","onInviteFailed","onInviteComplete","inviteByList","listOfEmails","inviteByCSV","withRouter","onSubmissionClick","surveySubmissions","renderSurveySubmissionLine","submissions","renderSurveySubmissions","SurveyInvitationLine","reminded","onResendClick","onRemindFailed","remindLink","SurveyInvitations","rendersurveyInvitations","invitations","surveyInvitations","renderSurveyInvitationLine","onRemindAllClick","inviting","setInviting","selectedFile","setSelectedFile","setMessage","emailsTextarea","onInviteClick","default_invite_message","onSendClick","inviteMethod","resetState","onMessageChange","renderSurvey","renderSurveyLink","renderPasteBox","renderFileUpload","renderInviteManager","contentForStepType","is_active","renderRequirementButtons","renderRequirementDescription","issued_on_step_identity","renderOutputsIssuedOnStep","waive","unwaive","unlinkSubprocess","waiveRequirement","onRequirementWaived","unwaiveRequirement","onRequirementUnwaived","apiUnlinkSubprocess","onSubprocessUnlinked","isWaived","unlinkable","onWaiveClick","setOptionsOpen","onUnwaiveClick","onUnlinkClick","optionsMenuRef","optionsAnchor","optionsOpen","SubprocessRequirement","defaultApplicant","applicants","setPrimaryApplicant","setApplicants","selectedApplicants","setSelectedApplicants","onApplicantSelect","onApplicantRemove","onApplicantSearchCancel","linkPath","subprocess_id","applicantsParams","subprocess_workflow","allowedToStart","subprocess_workflow_not_published","onSelectedApplicantChange","renderApplicantContainer","filteredApplicants","showAsLink","linkMethod","renderLink","subprocess_scoped_id","LOCKABLE_STEP_TYPES","StepInList","shouldAnimate","setAnimate","isSupplementalRequirement","renderConstituentLock","locked_at","renderAdminLock","renderRequirementStatus","renderOutput","viewing","klasses","halted_at","timelineStepClass","icon_class","typeForURL","prefix","renderStepName","renderLock","pendingChanges","renderChangeRequests","desktop","onCompletionStep","toggleExpansion","activeSubprocessRequirements","subprocess_requirement_evaluations","renderStep","stp","steppable_id","steppable_type","renderSubprocessRequirement","renderRequirements","renderSteps","renderListArea","extraClass","renderMobileExpandIcon","accessIsOpen","setAccessIsOpen","activityIsOpen","setActivityIsOpen","menuIsOpen","setMenuIsOpen","discussionIsOpen","setDiscussionIsOpen","documentsIsOpen","setDocumentsIsOpen","accessNode","activityNode","documentsNode","discussionNode","menuNode","transitionClassNames","activeFlow","hasPublicFiles","has_public_files","hasFiles","has_files","with_access_to_parent","renderSubprocessInfo","team_friendly_id","renderSaveStatus","renderCustomId","viewingNonCurrent","current_step_id","completion_message","renderCompletionMessage","showAdminWarning","baseURL","adminHost","dashboardURL","renderAdminWarning","currentStepURL","renderPastCurrentStepWarning","notifications","notif","messages","fetchTasks","fetchStep","renderSectionData","renderDatum","fieldData","formatted_content","renderValueForDatum","isCurrent","setStepData","renderStepInformation","step_completion_activities","previous_step","completer","flowTemplateName","getStepPosition","onTaskViewUpdate","onSkip","openTab","setOpenTab","renderMainAction","initiatedFlowDispatch","initiatedFlowReducer","discussionState","discussionReducer","aS","syncAttachments","AttachmentsAPI","FlashMessages","start","subprocess_requirement","current_user","isLoaded","setIsLoaded","documentURL","setDocumentURL","loadingDidFail","setLoadingDidfail","onGenerateComplete","issuedOutput","LOCAL_STORAGE_KEY","onTemplatesLoaded","cacheTemplates","isResolved","getTime","loadAndCacheMasterTemplates","storedTemplates","getStoredTemplates","loadRequest","NO_TEMPLATES_CONTENT","innerContentEl","setMasterTemplates","inputEl","onMasterTemplatesLoaded","QuicklaunchActions","onSearchChange","renderTemplateContent","mt","renderMasterTemplate","launchButtonPath","team_name","renderPopdown","activeClass","setActiveClass","toggleHamburger","renderMenuItems","link","renderUserMenu","mobile","renderSignInLink","renderMobileMenu","light","avatar","bStyle","borderRadius","Offline","checks","analytics","identify","cgID","cgId","ChurnZero","flashRender","$el","initPublicNav","$popup","$menu","toggleClass","hasClass","removeClass","avatarUrl","initProfileDisc","jQuery","ajaxSetup","initQuicklaunch","DocumentDispatchContext","selectValueForMapping","mapping","mappable","entity_field_id","mappable_type","process_data_field","pdfjs","workerSrc","pdfjsWorker","numPages","setNumPages","activeSelect","clearHighlighted","inputs","inputTop","closest","scrollTo","pageNumber","clientHeight","behavior","onLoadSuccess","nPages","renderForms","renderTextLayer","DragAndDropBox","prompt","replacing","isDragActive","acceptedFiles","docFile","replaceDoc","doc","createDoc","dndStatus","defaultMappables","onMenuClose","latestTemplateVersionNumber","documentStartVersion","documentStopVersion","defaultSelectValue","isMatch","fullCoverage","has","earliest_version","latest_version","field_name","maxMenuHeight","menuPlacement","filterOption","createFilter","ignoreCase","ignoreAccents","matchFrom","formatOptionLabel","versionHTML","versionInfo","uniq","defaultStartVersion","start_version","startVersion","setStartVersion","defaultStopVersion","stop_version","stopVersion","setStopVersion","latest","setLatest","main","setReplacing","setActiveSelect","setConfiguredMappings","prevMappings","initialMappingState","_mappings","_mapping","mappingId","configuredMappings","onMappingChanged","working","setWorking","nothingChanged","isEqual","saveButtonIsDisabled","renderVersions","has_file","renderMapping","m","renderedMappings","overflowY","maxHeight","onSaveClick","_key","mappingName","submitConfig","findErrors","onUnpublishClick","onPublishClick","toggleOptions","onReplaceClick","published_at","document_id","useParams","findFocusedDocument","documents","isNumber","currentDocument","docs","docIndex","docsDupe","renderDocumentInList","documentInList","arr","renderVersionInfo","sortedDocs","doc1","doc2","latest_version_number","authorityToRemove","authorityUsers","unshift","membershipToRemove","ActionButton","activated","deferred","htmlID","VersionNumber","setVersions","loadVersions","responseVersions","renderVersion","templateVersion","currentOpen","TemplateNavBar","ever_published","activeClassName","renderOverviewLink","permissionType","renderWriteOnlyLinks","onApplicantUserRemove","applicantUser","DEFAULT_NAME","isStarredForm","setIsStarredForm","is_starred_form","TemplateManagerActions","FlowTemplateHeader","onJoinTemplateClick","renderPublishOrLaunch","renderJoinButton","Chart","PieController","CategoryScale","LinearScale","Legend","Tooltip","ArcElement","chart","responsive","LocationVisualizer","renderDataToMap","markerData","markers","markerClusterGroup","addPopupContentToMarker","addLayer","templateName","scopedId","public","bindPopup","renderFeatureFromDatum","lon","lat","center","mean","median","standard_deviation","TYPES_WITH_VISUALIZATION","visualizableFields","isPublic","actuallyVisualizableFields","selectedDatumId","setSelectedDatumId","setData","activeField","selectedVisualizationIsSupported","section_name","renderVisualization","BarController","BarElement","showRevenueDetail","setShowRevenueDetail","lowestFlowId","stats","revenue_digest","lowest_revenue_info","flow_id","lowestAmount","highest_revenue_info","highestAmount","lowestProcessId","process_id","highestProcessId","last_30_days","revenue_last_30_days","formatter","onMouseEnter","onMouseLeave","renderRevenueRange","currently_open","median_completion_time_in_words","plugins","legend","Stats","getFlowTemplate","getMasterTemplate","onTemplateChanged","launch_data","visualizable_fields","recent_initiated_flows","UnpublishedChangesBanner","onPublish","renderPublishButton","renderBannerContents","FlowStepManager","lazy","Outputs","Configuration","Modules","SUSPENSE_HTML","TemplateManager","initialFlowTemplate","initialMasterTemplate","setMasterTemplate","showBanner","setShowBanner","shouldShowBanner","redirectToDefaultPath","accessManagerState","accessManagerDispatch","accessManagerReducer","userAccessData","isReadOnly","isArchived","newFlowTemplate","newMasterTemplate","ft","renderFlowStepManager","Suspense","fallback","renderConfiguration","permissionLevels","renderModules","myTeams","renderNotification","banner","paymentsDisabled","has_payment_step","charges_enabled","requests","initialFlowTemplateData","initialMasterTemplateData","showExtraFields","schedule","hide","trigger","renderPercentage","numerator","percentage","launched_count","completed_count","active_count","overdue_count","DoughnutController","DonutSvg","VChartSvg","renderImg","class","fLabels","setFLabels","fValues","setFValues","oLabels","setOLabels","oValues","setOValues","parseData","lbls","vls","otherTotal","topFive","other","num","fData","forms_chart_data","oData","outputs_chart_data","colors","COLORS","renderLegend","datasets","renderChart","dta","indexAxis","renderOutputChart","formsArray","teamsArray","applyFilters","setTeams","setForms","teamsDataForSelect","formDataForSelect","frms","newTeams","tms","newForms","fms","template_ids","launched_from","launched_to","transactionData","formattedNumber","total_revenue","renewal_revenue","total_refunded","total_disputed","noData","by_type","card","ACH","total","prcntge","maxLimit","max_charge","scales","y","suggestedMax","ticks","_index","_ticks","renderChargesChart","MetricsDashboardAPI","flows","revenueData","getForms","revenue_data","overdueCount","changeActiveSubmission","task","itemRef","overdue","primary_applicant_name","time_elapsed_string","step_type","FILTER_OPTIONS","SORT_OPTIONS","skippedExpanded","setSkippedExpanded","updateSort","setSort","updateFilter","setTaskFilter","renderTask","activeSubmission","skipped","taskFilter","skippedSubmissions","setSubmissions","activeSubmissionId","setActiveSubmissionId","setActiveSubmission","setCompleted","setSkipped","initialCount","setInitialCount","filteredAndSorted","subs","reverse","sortSubmissions","withoutSkipped","review","filterSubmissions","onUpdate","previousSubmission","union","$window","$nav","scrolledClassName","scrollTop","addClass","words","wordCount","currentIdx","isLightColored","has_light_color","logoUrl","logo","TemplateStats","cityName","firstPos","lastPos","renderStepRange","times","digest","median_step_times","totalTime","humanize","renderMedianTime","renderStepData","renderStepDatum","renderAsterisk","customEntityName","hasAdditionalInfo","lastStepPos","respDidChange","respName","renderStepResponsibility","medianTime","renderTimeEstimate","stepTypeName","renderExpandArrow","renderLowerContent","renderAdditionalInfo","respWillChange","renderLinebreak","findStepAfter","findStepBefore","nextStep","prevStep","renderGroup","currentGroup","grouped","OverviewTabs","actionName","moreHTML","modalOpen","selectedTeamId","onCloneProcessClick","onDoClone","updateSelectedTeam","renderTeamSelector","teamOptions","renderMoreMenu","menuItems","forkAllowed","renderPublicRecordSearch","searchEnabled","templateSlug","renderStatsTab","canPublicRead","templatePrivate","OverviewDescriptionEditor","editLinkText","desc","renderEditDescriptionButton","PublicOverviewHeader","bannerform","bannerfield","showMiniNav","setScrollEvent","setBannerHeight","unsetScrollEvent","didScroll","unbind","getScrollStyle","bgImageStyle","flowTemplateData","banner_image_url","renderStartButton","templateIsClosed","publiclyLaunchable","canBeLaunched","canLaunchInternally","publicly_launchable","renderNotice","onBannerUploadClick","onImageSelect","managable_by_user","internally_launchable_by_user","renderBannerForm","encType","acceptCharset","public_read","private","fork_allowed","publicly_searchable","ProcessOverview","median_process_time","renderCostRange","lowEnd","lowest_cost","highEnd","highest_cost","public_median_time","public_cost_range","publicSearch","customSearch","rowsPerPage","onChangePage","lastPage","ceil","isFirstPage","isLastPage","IconButton","renderFlowRow","identifierContent","identifier_redacted","handleChangePage","newPage","searchHandler","labelDisplayedRows","paginated","TablePagination","rowsPerPageOptions","totalResults","currentPage","ActionsComponent","PaginationButtons","setResults","setCurrentPage","totalPages","setTotalPages","setRowsPerPage","setTotalResults","search_terms","template_id","SearchPagesAPI","pagination","current_page","per_page","launchdata","faqs","public_search_instructions","submissionData","onQueryType","flow_templates","renderProcess","public_path","publicPortalHeader","public_portal_banner","$input","jstz","DISCUSSION_TAB","stickybits","setRecentlyAddedDiscussionId","outstandingReviewCount","setOutstandingReviewcount","setPreviousReviews","wasJustReviewed","setWasJustReviewed","reviewOutcome","setReviewOutcome","contentRef","onPrint","useReactToPrint","bodyClass","documentTitle","onReviewExit","review_data","outstanding_review_count","resolved_pending_requests","onTabClick","newTab","tabClassName","tb","renderNextURL","nextURL","wasPreviouslyReviewed","renderSubmitWidget","bannerColorClass","completedReviewInfo","completedForCurrentUser","firstURL","renderFirstURL","prevURL","renderPrevURL","currentReviewNumber","renderReviewNumber","reviewStepInternalInstructions","enter","role_name","reviewData","active_review_group","review_step_internal_instructions","current_review_number","next_url","prev_url","first_url","completed_for_current_user","SearchPageContainer","searchSlug","showResult","domain","team_domain","teamDomainId","addDomain","TeamDomainAPI","deleteDomain","test","newDomainField","addingDomain","setAddingDomain","domains","setDomains","onAddDomainClick","onSaveDomainClick","newDomain","validateDomain","DomainManagerActions","onDomainAdded","validDomain","renderDomain","teamDomain","onDomainDeleteClick","onDomainDestroyed","renderDomainInput","renderAddLink","bannerRef","defFile","setDefFile","defFileCrop","setDefFileCrop","unit","x","bannerImageAspect","setBannerImageAspect","newBannerPresent","setNewBannerPresent","bannerOptions","setBannerOptions","present","renderPublicBanner","reader","FileReader","onload","ev","img","Image","w","h","readAsDataURL","aspect","crop","defaultTeamColor","TeamPage","newTimeZone","time_zone","newTeamColor","newTeamName","newLogoPresent","savingTeamName","savingTeamColor","newSlugAvailable","slugSaving","slugChecking","doCheckSlug","renderDefaultStatus","creator_id","renderTeamLogo","nameDidChange","onTeamNameSave","TeamActions","teamNameDidSave","onTeamNameChanged","shouldAllowTeamNameSave","shouldAllowColorSave","colorWasModified","shouldAllowSlugSave","slugIsValid","slugWasModified","onSlugChanged","available","textForSlugSaveButton","onColorChange","hex","onColorSave","publicPortalURL","onTimeZoneChange","onTimeZoneSave","timeZoneDidSave","shouldAllowTimeZoneSave","onLogoChange","logoPresent","onLogoSave","timeZoneOptions","timeZone","zone","disableAlpha","onChangeComplete","updateMembers","initTabs","exportTransactions","exportCashAndChecks","DateFilters","QueryString","setMonth","getMonth","exportQueued","exportQueueRequested","onStartChange","dateString","onEndChange","goButtonClicked","urlParams","formatDate","toISOString","param","transactionsExport","cashAndChecksExport","onExportClick","cashAndChecks","fadeIn","handleToggleChange","setting","should_send","defaultSetting","renderSettingsDetails","emailSetting","email_setting","shouldSend","delete_all","typeParentId","typeParentType","type_parent_id","type_parent_type","formatForSelect","object","workflowId","setWorkflowId","initialType","initialWorkflowSetting","setTeamId","initialTeamSetting","setSettings","emailSettings","EmailSettingsAPI","dupSettings","updateSetting","addSetting","updateOrCreateSetting","newSettings","removeSetting","revertToDefault","removeSettings","renderEmails","emailType","email_type","owner_type","owner_id","findEmailSetting","workflowOptionsForSelect","renderWorkflowSelect","processSpecific","teamOptionsForSelect","renderTeamSelect","teamSpecific","EditableInput","username","setUsername","imageLoading","avatar_src","renderImage","has_avatar","changeAvatar","updateUser","emptyPackage","current_password","password_confirmation","passwordPackage","setPasswordPackage","handlePasswordInputChange","changePassword","UserContainer","initialPath","settingsData","localUser","setUser","setImageLoading","useLocation","initialLocation","sendUpdate","updatedUser","userSettings","setCount","waitFor","currentCount","textInfo","setTextInfo","setRedirect","account","unverifiedEmail","stripeResponseHandler","$form","prop","Stripe","piiData","createToken","personal_id_number","ResizeObserver","relativeTime","duration","customParseFormat","accessToken","initializers","MasterTemplateDocuments","MasterTemplateImports","PublicInitiatedFlows","PublicMasterTemplates","PublicSurveys","PublicSurveySubmissions","PublicTeams","AdminRoles","BatchExportTemplates","ChargeDisputes","CustomEntities","Dashboards","EditSuggestionsRequests","Entities","EntityImports","FlowTemplates","InitiatedFlows","IssuedOutputs","Layout","MasterTemplates","MerchantAccounts","MetricsDashboard","MyTasks","Pages","Review","SearchPages","Teams","Transactions","UnclaimedProcesses","Users","Registrations","Verifications","ready","objectPatch","controller","controllerName","setErrorMessage","onConfirmClick","challenge","challengeAnswer","toString","onConfirm","challengeHTML","bodyTag","renderMessageBody","confirmButton","Logger","parsedValue","validateNumberInRange","validateNumber","PhoneValidator","checkboxFieldContent","isFloat","startIndex","endIndex","removed","LOGIC_ENABLED_FIELDS","availableEmailFields","stepPositionLimit","stepPosition","getCollectInfoSteps","findStepDatumByIdentity","stpDtm","module","TypeError","arguments","prototype","call","word","jobId","jobID","onSuccessfulQueue","onJobFailed","poll","job_id","JobsAPI","processJobStatus","onPollingComplete","ReactDom","addShield","$shield","$body","removeShield","fixedDataTypes","allDataTypes","buildCustomEntityField","dataCollectible","baseVariables","domainParts","protocol","_masterTemplate","_formulaTermSearchResults","_flowTemplate","getStep","getReviewGroup","getStepAssignmentGroup","step_assignment_groups","getNotification","notificationId","email_notifications","getAllSections","getSurveys","getSurveySections","getSection","getDatum","getData","getOptions","getOption","addDataRow","getSectionable","addSurveySection","getOutput","getAttachableType","updateMultipleChoiceOption","clearSiblingDefaults","getLogicable","setModifiedStatus","findAssignmentGroup","groupId","step_assignments","emitChange","emitTermSearchResultsChangeEvent","getFormulaTermSearchResults","_setSteps","getDefaultActiveStepId","existingFormula","setFormula","faq","updatedFaq","updateFAQ","faqId","subprocessConfig","subprocess_configs","templateModified","subprocessConfigId","search_page_configs","addSearchConfig","searchConfig","removeSearchConfig","searchConfigId","updatedConfig","updateSearchConfig","customId","newSteps","updateDataRow","sectionable","removeDataRow","updatedMatch","updatedSection","sectionToUpdate","sectionToDestroy","MultipleChoiceOptionConstants","removeMultipleChoiceOption","addEmailNotification","updateEmailNotification","emailNotificationId","destroyEmailNotification","reviewGroupAttrs","groupAttrs","updatedReviewGroup","updateReviewGroup","reviewGroupToDestroy","destroyReviewGroup","addAssignmentGroup","assignment","step_assignment_group_id","addAssignment","updatedSurvey","survey_step_id","newGroups","replaceAssignmentGroups","removeLogicConfig","AttachedPeopleConstants","attachable","toggleAttachedPerson","updateRoleUsers","updatedOutput","updateOutput","renewalReminderAttrs","configured_output_id","renewal_reminders","updateRenewalReminder","removeRenewalReminder","color3","colorNeutralLight","disc","guid","CachedFunction","attributes","eventHandlers","addEvent","handler","addEventHandler","argTypeOrMap","argHandlerOrScope","argScope","eventMap","eventString","events","l","eventType","_guid","addGuid","forceGuid","obj","typeOf","proto","createSubclass","includeEvents","superclass","realConstructor","apply","Events","extendThis","subclass","emitEvents","explicitType","explicitGuid","handlers","makeUuid","random","removeAttribute","silent","mutateData","oldValue","removeEventHandler","itemExists","specificEvent","str","updateAttribute","fn","splittedTypes","all","Module","getAll","getAllAsArray","mapped","set","objOrKey","valueOrSilent","keyOrFn","classOnly"],"sourceRoot":""}