{"version":3,"sources":["firmSettingConfiguration/selectors/SubjectSelector.tsx","featureConfigurationLayout/dialogs/FeatureNotesPreviewDialog.tsx","enums/LocalStorageEnum.ts","firmSettingConfiguration/FirmSettingConfigurationRepository.tsx","firmSettingConfiguration/common/Currencies.ts","firmSettingConfiguration/FirmSettingConfigurationBanner.tsx","eventsAndCampaigns/EventsAndCampaignsRepositories.tsx","firmSettingConfiguration/tabs/EmailingTab.tsx","firmSettingConfiguration/tabs/EnquiryDefaultTab.tsx","firmSettingConfiguration/selectors/PassowrdStrengtthSelector.tsx","firmSettingConfiguration/tabs/SecurityTab.tsx","firmSettingConfiguration/tabs/FirmDetailsTab.tsx","firmSettingConfiguration/common/CountryData.tsx","firmSettingConfiguration/selectors/CountrySelector.tsx","firmSettingConfiguration/selectors/CurrencyCodeSelector.tsx","firmSettingConfiguration/selectors/CurrencySymbolSelector.tsx","firmSettingConfiguration/common/Timezone.ts","firmSettingConfiguration/selectors/TimeZoneSelector.tsx","firmSettingConfiguration/tabs/RegionalTab.tsx","firmSettingConfiguration/selectors/TimesheetActivitiesSelector.tsx","firmSettingConfiguration/tabs/TimeRecordingTab.tsx","firmSettingConfiguration/tabs/TimeRecordingDefaultsTab.tsx","firmSettingConfiguration/tabs/ConnectTab.tsx","firmSettingConfiguration/tabs/TimeRecordingWarningDefaultsTab.tsx","firmSettingConfiguration/tabs/InprotechTab.tsx","firmSettingConfiguration/tabs/PhoneMessageDefaultConfigurationTab.tsx","firmSettingConfiguration/tabs/TaskDefaultConfigurationTab.tsx","firmSettingConfiguration/tabs/ClientAndContactsDefaultConfigurationTab.tsx","firmSettingConfiguration/tabs/FinancialThresholdsTab.tsx","firmSettingConfiguration/FirmSettingConfigurationPage.tsx","firmStructureConfiguration/FurmStructureConfigurationBanner.tsx","firmStructureConfiguration/tabs/LookupTeamsMaintenance.tsx","firmStructureConfiguration/tabs/LookupTeamMemberMaintenance.tsx","firmStructureConfiguration/tabs/LookupOfficesMaintenance.tsx","firmStructureConfiguration/tabs/LookupOfficeMemberMaintenance.tsx","firmStructureConfiguration/tabs/LookupDepartmentMaintenance.tsx","firmStructureConfiguration/tabs/LookupDepartmentMemberMaintenance.tsx","firmStructureConfiguration/tabs/LookupUserAssistantMaintenance.tsx","firmStructureConfiguration/tabs/LookupUserAssistantMemberMaintenance.tsx","firmStructureConfiguration/FirmStructureConfigurationPage.tsx","featureConfigurationLayout/FeatureLayoutConfigurationRepository.tsx","globals.tsx","featureConfigurationLayout/FeatureLayoutConfigurationHeader.tsx","featureConfigurationLayout/FeatureLayoutConfigurationControlPanel.tsx","featureConfigurationLayout/styles.tsx","featureConfigurationLayout/hooks/useUpdateFeatureMutation.ts","featureConfigurationLayout/dialogs/FeatureNotesDialog.tsx","featureConfigurationLayout/FeatureLayoutCardDraggable.tsx","featureConfigurationLayout/FeatureLayoutCardClone.tsx","featureConfigurationLayout/FeatureLayoutConfigurationDroppable.tsx","featureConfigurationLayout/FeatureLayoutConfigurationList.tsx","featureConfigurationLayout/FeatureLayoutConfigurationPage.tsx"],"names":["SubjectSelector","props","data","state","setState","clientAndMatterNoteSubjectQuery","ClientAndMatterNoteSubjectQuery","variables","isApplyMatterAccess","fetchPolicy","loading","error","lookup","clientAndMatterNoteSubject","prevState","items","map","country","label","description","value","id","toString","handleChange","event","onSelection","name","getInputProps","params","isLoading","InputProps","endAdornment","Fragment","color","size","multiple","style","className","disabled","onChange","options","disablePortal","getOptionLabel","option","onBlur","renderTags","getTagProps","index","length","substring","key","renderInput","variant","fullWidth","margin","required","renderOption","inputValue","matches","parts","part","fontWeight","highlight","text","useStyles","theme","dialogRoot","flex","padding","header","textTransform","content","buttonContainer","display","justifyContent","button","spacing","minWidth","hidden","loaderWrapper","alignItems","position","top","left","right","bottom","backgroundColor","formLabel","paddingBottom","editorClassName","minHeight","maxHeight","wrapperClassName","border","flexFlow","toolbarClassName","paperRoot","overflow","dialogContent","FeatureNotesPreviewDialog","classes","useState","setIsLoading","tempDesription","indexOf","draftContent","JSON","parse","contentState","createWithContent","getCurrentContent","open","onClose","maxWidth","scroll","disableScrollLock","disableEnforceFocus","disableAutoFocus","paper","dividers","container","item","xs","md","apiKey","initialValue","init","height","autoresize_min_height","autoresize_max_height","menubar","plugins","toolbar","statusbar","content_style","toolbar_sticky","autosave_ask_before_unload","autosave_interval","autosave_prefix","autosave_restore_when_empty","autosave_retention","image_advtab","content_css","image_class_list","title","importcss_append","min_height","onInit","evt","editor","type","onClick","LocalStorageEnum","retrieveSystemSettingsNamesQueryData","refreshData","onSuccess","onError","query","SystemSettingsNamesQuery","then","results","catch","reason","retrieveEnquiryDefaultConfigData","EnquiryDefaultConfigQuery","UpdateEnquiryDefaultConfigMutation","retrieveEmailConfigData","EmailConfigQuery","UpdateEmailConfigMutation","SettingNotificationSubscription","UPDATE_TASK_DEFAULT_CONFIG_MUTATION","UPDATE_PHONE_MESSAGE_DEFAULT_CONFIG_MUTATION","PHONE_MESSAGE_DEFAULTS_QUERY","retrievePhoneMessageDefaultConfigData","TASK_DEFAULTS_QUERY","retrieveTaskDefaultConfigData","ClientAndContacsDefaultConfigurationQuery","ClientAndContactsDefaultConfigurationMutation","CurrenciesData","currency","symbol","digitalCode","root","width","BrandColors","TextPrimary","fontFamily","Font","Main","fontSize","FontSize","PX","size8","letterSpacing","lineHeight","LineHeight","ExtraLarge","paddingRight","size10","TemplatePrimary","buttonGroupWrapper","FirmSettingConfigurationBanner","onClickBack","onLearnMore","rvKey","rvbuttonType","icon","rvIcon","rvClassName","Heading4","startIcon","EventsAndCampginQuery","retrieveEventsAndCampaignData","offset","first","filter","isIncludeCompleted","excludeDataTracking","category","responsible","typeList","statusList","startDateFrom","startDateTo","CreateEventAndCampaignMutation","UpdateEventsAndCampaignMutation","DeleteEventsAndCampaignMutation","CreateEventsAndCampaignNotification","UpdateEventsAndCampaignNotification","DeleteEventsAndCampaignNotification","makeStyles","createStyles","textField","buttonWrapper","EmailingTab","isFormChanged","onSubmitLoading","fromName","replyTo","sendEmailOnBehalfOf","confirmationBcc","formState","setFormState","fetchData","onEmailConfigRetrieved","settings","systems","emailDefaults","config","prevFormState","onReset","form","setConfig","batch","reset","onSubmit","values","_prevState","mutate","mutation","initialValues","initialValuesEqual","keepDirtyOnReinitialize","subscription","submitting","pristine","render","handleSubmit","Grid","Alert","severity","UserFeature","HasAccess","hasEmailSendOrReplyDefinition","input","meta","TextField","touched","helperText","justify","Button","heading","typography","pxToRem","palette","primary","main","accordionDetails","radioGroup","formControl","optionWrapper","gap","optionContainer","optionList","reminderTextField","radioIcon","defaultMeetingLabel","marginTop","marginRight","EnquiryDefaultTab","dueDateOption","timeOfDay","addDays","addHours","defaultMeetingLength","reminder","overdueReminder","isSendReminderOnWeekend","isSendInvitationToAssignee","isSendInvitationToEnquirer","isSendReminderOnWeekendForOverDueReminders","isLocationFieldMandatory","isSendFistUnassignedReminderOnWeekends","isSendUnassignedAfterFirstReminderOnWeekends","periodAfterFirstUnassignedReminder","periodBeforeFirstUnassignedReminder","isNatureOfEnquiryMandatory","isInternalNotesMandatory","isEventAndCampaignMandatory","isSourceNotesMandatory","periodMeetingDefaultReminder","isSendMeetingDefaultReminderEmail","isSendMeetingDefaultReminderSms","onEnquiryDefaultConfigRetrieved","enquiryDefaults","isTimeTodayValid","isValid","isDefaultMeetingLengthValid","isCalculatedDays","isCalculatedHours","RadioComp","compProps","Radio","checkedIcon","utils","isManualEntry","format","validate","errors","Accordion","defaultExpanded","AccordionSummary","expandIcon","Typography","AccordionDetails","FormControl","component","FormLabel","RadioGroup","FormControlLabel","control","validating","allowNull","keyboardIcon","InputLabelProps","shrink","inputProps","pattern","ReminderSelector","selection","FormGroup","Checkbox","checked","isNoZeroMinutes","ampm","hasSmsIntegration","PassowrdStrengtthSelector","CircularProgress","Autocomplete","formGroup","marginLeft","SecurityTab","mFA","passwordStrength","passwordLength","applicationSecuritySettings","APPLICATION_SECURITY_SETTINGS_QUERY","updateApplicationSecuritySettings","APPLICATION_SECURITY_SETTINGS_MUTATION","getPasswordStrength","_value","ONE","TWO","THREE","FOUR","FIVE","Switch","lg","sm","FirmDetailsTab","firmName","firmAddress","firmPhone","firmWebsite","firmEmailContact","firmHelpDeskContact","FirmDetailsConfigQuery","retrieveFirmDetailsConfigData","onFirmDetailsConfigRetrieved","firmDetails","undefined","UpdateFirmDetailsMutation","multiline","rows","CountryData","countryCode","CountrySelector","uniqBy","sort","a","b","currentTarget","newValue","tempValue","CurrencyCodeSelector","Currencies","CurrencySymbolSelector","TimeZoneData","timeZoneId","TimeZoneSelector","RegionalTab","homeCountry","timeZone","currencyCode","currencySymbol","financialYearStart","taxLabel","taxPercentage","regionSettingsQuery","REGION_SETTINGS_QUERY","upRegionSettingsQuery","REGION_SETTINGS_MUTATION","getCountryDetails","renderType","countryData","find","console","log","regionSettings","autoComplete","parseFloat","TimesheetActivitiesSelector","TimesheetActivitiesQuery","clientOnly","retrieveTimesheetActivitiesData","onRetrieveEnquiryStatus","timesheetActivities","activities","source","stringValue","getOptionSelected","flexDirection","TimeRecordingTab","unitsPerHour","standardHoursPerDay","expectedHoursPerDay","useStartEndTime","warningOnExceedingHours","timeCaptureOptions","copyActivityAsNote","thresholdLevel","defaultDurationMinutes","defaultDurationUnits","phoneCallActivity","emailActivity","submissionType","timeSelectionMinuteInterval","useSmartSettings","suggestCustomButtons","timeCaptureMode","warnOnDefaultTime","warnOnExceedingHours","warnIfNotToday","timeRecordingSettings","TIME_RECORDING_SETTINGS_QUERY","updateTimeRecordingSettings","TIME_RECORDING_SETTINGS_MUTATION","tenantTimeCaptureMode","parseInt","TimeRecordingDefaultsTab","timeRecordingDefaults","TIME_RECORDING_DEFAULTS","updateTimeRecordingDefaults","TIME_RECORD_DEFAULTS_MUTATION","ConnectTab","staffContactFilter","welcomeMessage","isEmailNotificationDocuments","isEmailNotificationMessages","isPushNotificationDocuments","isPushNotificationMessages","isExternalMessagesToActing","isExternalMessagesToResponsible","isExternalMessagesToAssisting","isExternalMessageToActing","isExternalMessageToAssisting","isExternalMessageToResponsible","isFirmToClientPushNewDocumentNotifications","isFirmToClientPushNewMessageNotifications","alternativeLogo","connectSettingQuery","ConnectSettingQuery","CONNECT_SETTINGS_MUTATION","updateConnectSetting","updateConnectSettingObj","connectSettings","message","emailDocumentNotifications","emailMessageNotifications","pushDocumentNotifications","pushMessageNotifications","externalMessagesToActing","externalMessagesToAssisting","externalMessagesToResponsible","firmToClientPushNewDocumentNotifications","firmToClientPushNewMessageNotifications","externalMessageToError","getFieldState","FormHelperText","maxFileSize","showFileNames","useChipsForPreview","filesLimit","files","existingFiles","newFiles","file","some","status","forEach","documentFile","guidID","url","push","onDelete","filteredFiles","onDrop","initialFiles","dropzoneText","TimeRecordingWarningDefaultsTab","timeRecordingWarnings","TIME_RECORDING_WARNING_QUERY","updateTimeRecordingWarnings","TIME_RECORDING_WARNING_MUTATION","InprotechTab","fetchInProtectionSettings","onInProtechRetrievedData","subscribeFirmObj","inProtechSettingsNotification","unsubscribe","subscribe","next","lookupNotification","err","inprotechSettings","completionDate","instructionDate","internalImportanceLevel","externalImportanceLevel","clientNoteActivityCategory","clientNoteActivityType","fileNoteActivityCategory","fileNoteActivityType","applicationNumber","grantNumber","publicationNumber","INPROTECH_MUTATION","registrationDate","filingDate","result","inputComponent","CustomNumberFormat","minValue","maxValue","INPROTECH_QUERY","inputRef","other","getInputRef","onValueChange","target","isNumericString","isAllowed","formattedValue","floatValue","Math","max","min","onPhoneMessageDefaultConfigRetrieved","phoneMessageDefaults","onTaskDefaultConfigRetrieved","taskDefaults","noteTypeData","noteSubjectData","isNoteTypeMandatory","isNoteSubjectMandatory","campaignCreationSubject","campaignCreationType","eventCreationSubject","eventCreationType","outlookAddinSubject","outlookAddinType","clientAndContactDefaultConfigQuery","clientAndContactDefaults","outlookAddinNoteTypeGuid","outlookAddinNoteTypeDescription","outlookAddinNoteSubjectId","outlookAddinNoteSubjectDescription","eventCreationNoteTypeGuid","eventCreationNoteTypeDescription","eventCreationNoteSubjectId","eventCreationNoteSubjectDescription","campaignCreationNoteTypeGuid","campaignCreationNoteTypeDescription","campaignCreationNoteSubjectId","campaignCreationNoteSubjectDescription","CorrespondenceActivitySelector","FinancialThresholdsTab","redIndicatorWhenActualVsBudgetIsLessThanPercentage","amberIndicatorWhenActualVsBudgetIsLessThanPercentage","redIndicatorWhenNinetyDayDebtExceedsPercentage","redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage","redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage","firmOverallStandardChargeOutRate","currentBankOverdraftInterestRate","firmStandardTradingTermsInDays","firmTargetWipLockupDays","firmOverallBlendedCostRate","currencyQuery","useCurrencySymbol","financialThresholdsQuery","FinancialThresholdsQuery","financialThresholdsSettings","showGreenIndicator","FinancialThresholdsMutation","update","Box","gridGap","InputAdornment","textAlign","startAdornment","FirmSettingConfigurationList","wrapper","sidebar","sidebarInner","sidebarList","flexGrow","tabLoaderWrapper","FirmSettingConfigurationPage","selectedTable","tabs","isTabLoading","pageState","setPageState","routeCommand","match","command","fetchTabData","routeTab","tab","subscribeSettingNotificationObj","subscribeSettingNotification","settingNotification","onFirmSettingTabRetrieved","settingNames","settingName","history","List","internalName","ListItem","selected","ListItemAvatar","Security","Avatar","FirmDetails","Regional","TimeRecording","TimeRecordingDefaults","EmailConfiguration","EnquiryDefaultConfiguration","PhoneMessageDefaultConfiguration","ClientAndContactsDefaultConfiguration","TaskDefaultConfiguration","ListItemText","secondary","Connect","TimeRecordingWarningDefaults","Inprotech","FinancialThresholds","FurmStructureConfigurationBanner","Label","onDeleteItems","LookupTeamsMaintenance","selectedRow","showDeleteConfirm","setShowDeleteConfirm","subscribeFirm","count","tableIcons","Add","ref","Check","Clear","Delete","DetailPanel","Edit","Export","Filter","FirstPage","LastPage","NextPage","PreviousPage","ResetSearch","Search","SortArrow","ThirdStateCheck","ViewColumn","firmSubscription","includes","tdata","temp","guidId","onRetrieveData","firm","teams","team","getCheckboxRender","field","checkIcon","checkBoxComponent","componentProps","deleteData","oldData","deleteFirmTeam","DialogBox","show","isAgree","agree","splice","disAgreeLabel","agreeLabel","dialogBox","tableTitle","tableHeading","Chip","chip","icons","onRowClick","rowData","toggleDetailPanel","tableData","encodeURIComponent","columns","bColor","stringInitials","replace","split","n","join","slice","avatar","getSection","cellStyle","headerStyle","hasOwnProperty","editComponent","componentData","staffCount","Badge","badgeContent","getMember","editable","components","Toolbar","customToolbar","actions","addRowPosition","search","paging","pageSize","pageSizeOptions","showTitle","actionsColumnIndex","rowStyle","onRowAdd","newData","Promise","resolve","setTimeout","createFirmTeam","usedByTasks","usedByFinancials","usedByEnquiries","createData","toLowerCase","insertRowData","onRowUpdate","updateFirmTeam","updateRowData","onRowDelete","deleteRowData","tooltip","onDeleteData","LookupTeamMemberMaintenance","isRefreshData","setIsRefreshData","guID","iconProps","groupId","FirmTeamMember","teamGuidId","retrieveTeamMemberData","members","member","getStaffList","staffArray","Array","isArray","friendlyName","RemoveFirmTeamMember","handleBreadCrumbClick","preventDefault","goBack","decodeURIComponent","breadcrumbsWrapper","Breadcrumbs","separator","breadcrumbs","Link","href","breadcrumbsTitle","email","getUser","AvailableTeamMemberSelector","onSelectedItem","selectionList","onRemoveItem","itemId","memberList","itemToRemove","findIndex","removeItems","getUserComponent","searchable","personIcons","toolbarProps","AddFirmTeamMember","staffIdList","staffId","isDeletable","LookupOfficesMaintenance","firmOffices","firmOffice","office","timezoneSelector","timezone","timezoneDescription","deleteFirmOffice","timezoneRender","TimezoneSelector","createFirmOffice","e","updateFirmOffice","LookupOfficeMemberMaintenance","FirmOfficeMember","officeGuidId","retrieveOfficeMemberData","RemoveFirmOfficeMember","AvailableOfficeMemberSelector","officeMemberList","AddFirmOfficeMember","LookupDepartmentMaintenance","departments","department","deleteFirmDepartment","createFirmDepartment","updateFirmDepartment","LookupDepartmentMemberMaintenance","FirmDepartmentMember","departmentGuidId","retrieveDepartmentMemberData","RemoveFirmDepartmentMember","AvailableDepartmentMemberSelector","AddFirmDepartmentMember","LookupUserAssistantMaintenance","isStaff","isExternal","isNextPageLoading","tempData","administrator","users","user","userID","staffName","assistantCount","userRender","UserAutocompleteSelector","customFilterAndSearch","columnDef","memberCountRender","LookupUserAssistantMemberMaintenance","userAssistantSubscription","userAssistantNotification","guid","userGuid","UserAssistantsQuery","retrieveUserAssistantsData","userAssistants","DeleteUserAssistant","userToAssistId","CreateUserAssistantMutation","assistantId","UpdateUserAssistantMutation","updateData","TableList","FirmStructureConfigurationPage","isInternalAdmin","setIsInternalAdmin","fetchAppUserData","appUser","onClickTab","pathname","FIRM_STRUCTURE","hasFirmDepartmentLookupMaintenance","hasFirmOfficeLookupMaintenance","offices","hasFirmTeamLookupMaintenance","hasUserAssistantLookupMaintenance","userAssistant","RoleCategoryType","fetchScopeFeatureData","isPersonalise","scope","hasDashboardSecurityScope","hasDashboardSecurityRoleCategory","hasDashboardSecurityRole","hasDashboardSecurityUser","hasDashboardSecurityPersonal","x","fetchRoleCategoryData","isIncludeAdmin","roleCategoryData","Internal","External","Administrator","fetchFeatureLayoutConfigurationData","FeatureLayoutConfigurationData","layoutId","includeHidden","isInternalRole","isAdministrator","roleId","userEmail","isPersonal","dashboardPanelId","UpdateFeatureLayoutConfigData","DeleteFeatureLayoutConfigData","featureLayoutConfigSubscription","fetchCurrentUserData","CURRENT_USER_QUERY","UpdateFeatureSubscription","globalVariableDefaults","canViewDashboard","paddingLeft","transform","FeatureLayoutConfigurationHeader","hasBack","cssStyle","Configuring_Dashboards","StyledContainer","div","ControlWrapper","borderBottom","SearchWrapper","NeutralColors","BackgroundGrey1","borderRadius","boxShadow","BackgroundGrey2","handleChangeFilters","bind","onDownShiftSelect","constructSecondDropDown","handleSave","handleReset","onHideAllChange","handleDeleteConfirm","onPanelSelection","onSearchChange","handleFeatureLayoutConfigurationSearch","onClearSearch","onUserSelection","subscribeToUpdateFeature","dashboardScope","featureLayoutConfigurationList","roleCategoryList","userList","isUserLoading","isSearchAgain","isDisableReset","userLabel","isHideAll","showConfirm","dashboardPanel","personalise","componentDidMount","this","fetchScopeData","componentWillUnmount","featureSubscription","UNSAFE_componentWillReceiveProps","nextProps","terminology","MatterTerminology","loader","secondDropDown","isHidden","isShowFilterControls","TypeOfDashboard","lead","client","DashboardLayoutScopeSelector","Scope","isInternalUser","externalUser","PanelSelector","panelSelector","dashboardPanelUsedBy","rightContainer","placeholder","searchField","IconButton","edge","scopeList","scopeData","defaultValue","RoleCategorySelector","RoleCategory","isIncludeAdministrator","RoleSelector","Role","UserSelector","User","displayLabel","isAuthorized","featureLayoutConfig","onFeatureLayoutConfigurationFetch","userEmailParam","onSearchCriteriaChanged","isInternalRoleParam","isAdministratorParam","roleIdParam","isScopeChanged","queryParams","handleFeatureLayoutConfigurationFetch","featureLayoutConfiguration","stringify","filteredItems","trim","vm","featureUpdateNotification","withStyles","paddingTop","card","marginBottom","overflowY","devider","borderLeft","grey","extendedIcon","formContainer","generateWrapper","mainContainer","subContainer","borderTop","table","tableWrapper","tableWrapperDetails","upperButton","withTheme","addButtonWrapper","checkbox","checkboxContainer","checkboxWrapper","clientGrid","col","flexWrap","customExpandablePanel","customGrid","flexBasis","dateField","expansionPanel","flexEnd","grid","gridContainer","gridWrapper","group","menu","panelAction","typeTitle","zIndex","breakpoints","up","voiPadding","cardRoot","cardDetails","cardContent","cardCover","cardControls","popover","pointerEvents","controlContainer","cardMedia","cardWrapper","cardContainer","rightControl","videoButton","UpdateFeature","taskForm","FeatureNotesDialog","updateFeature","updateResult","useUpdateFeatureMutation","isChanged","setIsChanged","showDiscard","setShowDiscard","notes","Dialog","DialogTitle","DialogContent","featureGuid","imagetools_cors_hosts","templates","template_cdate_format","template_mdate_format","image_caption","quickbars_selection_toolbar","noneditable_noneditable_class","toolbar_mode","contextmenu","onEditorChange","DialogActions","actionButton","CardDraggable","TrendingUpIconWrapper","TemplateColor","Primary","SwitchWrapper","handlePopoverClose","setAnchorEl","onClickVideoToggle","toggle","isVideoModalOpen","onToggleNotesDialog","isEditNotesOpen","onPreviewNotes","isNotesPreviewOpen","onHiddenChange","handlePopoverOpen","getWidthPerRow","getTooltip","isVisible","hiddenText","anchorEl","feature","infoUrl","VideoModal","draggableId","isDragDisabled","provided","snapshot","draggableProps","dragHandleProps","innerRef","itemPerRow","windowInnterWidth","cursor","Card","CardMedia","CardContent","min_width","onIsHiddenUpdated","anchorElValue","Boolean","FeatureListContainer","FeatureList","CloneItem","FeatureLayoutCardDraggableWrapper","getFeatureLayoutCardDraggable","shouldComponentUpdate","featureLayouts","droppableId","direction","renderClone","rubric","isDragging","getCloneItem","droppableProps","featureLayout","sequence","itemsPerRow","onDragEnd","constructRows","getDroppable","gridBreakPoints","window","innerWidth","droppableRows","droppableRow","featureSearchChanges","isSearch","isHideAllOperation","isSearchChanged","addEventListener","updateDimensions","removeEventListener","featureList","isReOrder","isHiddenUpdated","featureLayoutConfigurationListCopy","featureChange","rowNumber","lastDroppableRow","featureLayoutConfigList","newdroppableRowList","from","featureSearchChange","featureItem","featureSearch","feesBilledByPeriodVsBudgetChart","destination","sourceDroppable","draggableFeature","destinationDroppable","newfeatureLayoutConfigurationList","onVisibilityChanged","GridWrapper","ContentWrapper","StyledSummaryContent","BackgroundWhite","BackgroundGrey4","SummaryViewWrapper","saveFeatureLayoutConfiguration","deleteFeatureLayoutConfiguration","subscribeToFeatureLayoutConfig","fetchCurrentUser","onRetreivedCurrentUser","isSubscribed","personaliseStorage","sessionStorage","getItem","dashboardPanelValue","dashboardPanelLabel","location","Number","filteredFeatureLayoutConfigurationList","isCurrentUserLoading","userId","removeItem","featureLayoutConfigurationSubscription","FirmDashboardLayout","EnquiryDashboardLayout","feeEarner","FeeEarnerDashboardLayout","task","TaskDashboardLayout","ClientDashboardLayout","filtered","objIndex","obj","hiddenFeatureList","featureLayoutConfigurationNotification","isInternal"],"mappings":"kiBA6CaA,EAAkD,SAACC,GAGtD,MAAoB,mBAA+B,CACrDC,KAAM,KADHC,EAAK,KAAEC,EAAQ,KAIhBC,EAAkC,YAAyCC,EAAiC,CAC9GC,UAAW,CACPC,oBAAqBP,EAAM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B5tC,GAC3B2+B,KAAKz+B,SAAS,CAEVouC,sBAAsB,EACtB1O,eAAgB5/B,EAAKo5B,QAAQkW,WAC7BrW,gBAAiBj5B,EAAKo5B,QAAQH,mBAG1C,EA7YA,CAAoD","file":"static/js/main~63defed8.e6483bfc.chunk.js","sourcesContent":["import React, { useState, useMemo } from 'react';\r\n// import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { Autocomplete, GetTagProps, RenderInputParams } from '@material-ui/lab';\r\nimport { TextField, CircularProgress, Chip } from '@material-ui/core';\r\nimport match from 'autosuggest-highlight/match';\r\nimport parse from 'autosuggest-highlight/parse';\r\nimport gql from 'graphql-tag';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { useQuery } from 'react-apollo';\r\n\r\n// const useStyles = makeStyles((theme: Theme) =>\r\n// createStyles({\r\n// removedAvatar: {\r\n// maxWidth: '15px',\r\n// maxHeight: '15px',\r\n// },\r\n// }),\r\n// );\r\n\r\ninterface SubjectSelectorProps {\r\n disabled?: boolean;\r\n required?: boolean;\r\n // tslint:disable-next-line: no-any\r\n value?: SubjectAutoCompleteItem | SubjectAutoCompleteItem[] | any; // value only available in single select\r\n error?: boolean;\r\n onSelection?: (value?: SubjectAutoCompleteItem | SubjectAutoCompleteItem[], name?: string) => void;\r\n className?: string;\r\n helperText?: string;\r\n name?: string;\r\n label?: string;\r\n style?: React.CSSProperties;\r\n disablePortal?: boolean;\r\n variant?: 'standard' | 'filled' | 'outlined';\r\n size?: 'small' | 'medium';\r\n onBlur?: React.FocusEventHandler;\r\n multiple?: boolean;\r\n isApplyMatterAccess?: boolean;\r\n}\r\n\r\nexport interface SubjectAutoCompleteItem extends IAutoCompleteItem, ClientAndMatterNoteSubject {}\r\n\r\ninterface SubjectSelectorState {\r\n data: SubjectAutoCompleteItem[];\r\n}\r\n\r\nexport const SubjectSelector: React.FC = (props) => {\r\n // const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n data: [],\r\n });\r\n\r\n const clientAndMatterNoteSubjectQuery = useQuery(ClientAndMatterNoteSubjectQuery, {\r\n variables: {\r\n isApplyMatterAccess: props.isApplyMatterAccess,\r\n },\r\n fetchPolicy: 'cache-first',\r\n });\r\n\r\n useMemo(() => {\r\n if (\r\n !clientAndMatterNoteSubjectQuery.loading &&\r\n !clientAndMatterNoteSubjectQuery.error &&\r\n clientAndMatterNoteSubjectQuery.data &&\r\n clientAndMatterNoteSubjectQuery.data.lookup &&\r\n clientAndMatterNoteSubjectQuery.data.lookup.clientAndMatterNoteSubject\r\n ) {\r\n setState((prevState) => {\r\n const { clientAndMatterNoteSubject } = clientAndMatterNoteSubjectQuery.data!.lookup;\r\n\r\n const items: SubjectAutoCompleteItem[] = clientAndMatterNoteSubject.map((country: ClientAndMatterNoteSubject) => {\r\n return {\r\n ...country,\r\n label: country.description,\r\n value: country.id.toString(),\r\n };\r\n });\r\n return {\r\n ...prevState,\r\n data: items,\r\n };\r\n });\r\n }\r\n // tslint:disable-next-line: align\r\n }, [clientAndMatterNoteSubjectQuery.loading, clientAndMatterNoteSubjectQuery.data, clientAndMatterNoteSubjectQuery.error]);\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleChange = (event: React.ChangeEvent<{}>, value: any) => {\r\n if (props.onSelection) {\r\n props.onSelection(value, props.name);\r\n }\r\n };\r\n\r\n const getInputProps = (params: RenderInputParams, isLoading?: boolean) => {\r\n return {\r\n ...params.InputProps,\r\n endAdornment: (\r\n \r\n {isLoading ? : null}\r\n {params.InputProps.endAdornment}\r\n \r\n ),\r\n };\r\n };\r\n\r\n const onRenderTags = (value: SubjectAutoCompleteItem[], getTagProps: GetTagProps): React.ReactNode => {\r\n let renderTagsValue = value.map((option: SubjectAutoCompleteItem, index: number) => {\r\n let label = option.label;\r\n if (option.label.length > 20) {\r\n label = `${option.label.substring(0, 20)}...`;\r\n }\r\n\r\n return (\r\n \r\n );\r\n });\r\n\r\n return renderTagsValue;\r\n };\r\n\r\n if (props.multiple) {\r\n return (\r\n option.label}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n onBlur={props.onBlur}\r\n multiple={true}\r\n renderTags={onRenderTags}\r\n renderInput={(params) => (\r\n \r\n )}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderOption={(option, { inputValue }) => {\r\n const matches = match(option.label, inputValue);\r\n const parts = parse(option.label, matches);\r\n\r\n return (\r\n
\r\n {parts.map((part, index) => (\r\n \r\n {part.text}\r\n \r\n ))}\r\n
\r\n );\r\n }}\r\n />\r\n );\r\n }\r\n\r\n return (\r\n option.label}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n onBlur={props.onBlur}\r\n renderInput={(params) => (\r\n \r\n )}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderOption={(option, { inputValue }) => {\r\n const matches = match(option.label, inputValue);\r\n const parts = parse(option.label, matches);\r\n\r\n return (\r\n
\r\n {parts.map((part, index) => (\r\n \r\n {part.text}\r\n \r\n ))}\r\n
\r\n );\r\n }}\r\n />\r\n );\r\n};\r\n\r\nexport type ClientAndMatterNoteSubjectData = {\r\n lookup: Lookup;\r\n};\r\n\r\nexport type Lookup = {\r\n clientAndMatterNoteSubject: ClientAndMatterNoteSubject[];\r\n};\r\n\r\nexport type ClientAndMatterNoteSubject = {\r\n id: number;\r\n description: string;\r\n sequence: number;\r\n};\r\n\r\nconst ClientAndMatterNoteSubjectQuery = gql`\r\n query ClientAndMatterNoteSubject {\r\n lookup {\r\n clientAndMatterNoteSubject {\r\n id\r\n description\r\n sequence\r\n }\r\n }\r\n }\r\n`;\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React from 'react';\r\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { Button, Dialog, DialogActions, DialogContent, Grid } from '@material-ui/core';\r\n// import { Editor } from 'react-draft-wysiwyg';\r\nimport { convertFromRaw, convertToRaw, EditorState } from 'draft-js';\r\n// import htmlToDraft from 'html-to-draftjs';\r\nimport draftToHtml from 'draftjs-to-html';\r\nimport { convertToDraftWysiwygContent } from '../../helpers/commonHelper';\r\nimport { Editor as TinyEditor } from '@tinymce/tinymce-react';\r\nimport { RvLoader } from '../../components/Loader';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n dialogRoot: {\r\n '& .downshift-wrapper': {\r\n flex: 1,\r\n padding: 0,\r\n },\r\n },\r\n header: {\r\n textTransform: 'capitalize',\r\n },\r\n content: {\r\n flex: 1,\r\n },\r\n buttonContainer: {\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n // paddingBottom: '20px'\r\n },\r\n button: {\r\n margin: theme.spacing(1),\r\n minWidth: '83px',\r\n },\r\n hidden: {\r\n display: 'none',\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n padding: '10px',\r\n alignItems: 'center',\r\n position: 'absolute',\r\n top: 0,\r\n left: 0,\r\n right: 0,\r\n bottom: 0,\r\n backgroundColor: 'rgba(255,255,255,0.8)',\r\n },\r\n formLabel: {\r\n paddingBottom: '10px',\r\n },\r\n editorClassName: {\r\n padding: '0 10px',\r\n minHeight: '300px',\r\n maxHeight: '500px',\r\n },\r\n wrapperClassName: {\r\n border: '1px solid #949494',\r\n display: 'flex',\r\n flexFlow: 'column-reverse',\r\n },\r\n toolbarClassName: {\r\n border: 0,\r\n // borderBottom: '1px solid #F1F1F1',\r\n margin: 0,\r\n padding: 0,\r\n '& .rdw-dropdown-wrapper': {\r\n position: 'relative',\r\n },\r\n '& .rdw-dropdown-optionwrapper': {\r\n position: 'absolute',\r\n },\r\n },\r\n paperRoot: {\r\n overflow: 'auto',\r\n position: 'relative',\r\n minHeight: 'calc(100vh - 50px)',\r\n display: 'flex',\r\n flexFlow: 'column',\r\n },\r\n dialogContent: {\r\n overflow: 'inherit',\r\n // minHeight: '538px',\r\n flex: 1,\r\n display: 'flex',\r\n flexFlow: 'column',\r\n },\r\n }),\r\n);\r\n\r\ninterface FeatureNotesPreviewDialogProps {\r\n open: boolean;\r\n onClose?: () => void;\r\n description: string;\r\n}\r\n\r\nexport interface FeatureNotesPreviewDialogForm {\r\n notes: string; // EditorState;\r\n}\r\n\r\nexport const FeatureNotesPreviewDialog: React.FC = (props) => {\r\n const classes = useStyles();\r\n\r\n const [isLoading, setIsLoading] = React.useState(true);\r\n\r\n let tempDesription = props.description;\r\n\r\n if (props.description) { \r\n if (props.description.indexOf('blocks\":') !== -1) {\r\n const draftContent = convertToDraftWysiwygContent(JSON.parse(props.description));\r\n const contentState = convertFromRaw(draftContent);\r\n tempDesription = draftToHtml(convertToRaw(EditorState.createWithContent(contentState).getCurrentContent()));\r\n }\r\n }\r\n\r\n return (\r\n \r\n {isLoading ? (\r\n
\r\n \r\n
\r\n ) : null}\r\n \r\n \r\n \r\n {\r\n setIsLoading(false);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n );\r\n};\r\n","export enum LocalStorageEnum {\r\n PersonActing = 'PersonActing',\r\n PersonResponsible = 'PersonResponsible',\r\n}","import { FetchPolicy } from 'apollo-client';\r\nimport gql from 'graphql-tag';\r\nimport { client } from '..';\r\n\r\nexport interface SystemSettingsNamesData {\r\n settings: Settings;\r\n loading?: boolean;\r\n networkStatus?: number;\r\n}\r\n\r\nexport interface Settings {\r\n systems: Systems;\r\n}\r\n\r\nexport interface Systems {\r\n id: number;\r\n settingNames: SettingNames;\r\n enquiryDefaults: EnquiryDefaults;\r\n emailDefaults: EmailDefaults;\r\n}\r\n\r\nexport interface SettingNames {\r\n settingName: SettingName[];\r\n}\r\n\r\nexport interface SettingName {\r\n id: number;\r\n guidID: string;\r\n title: string;\r\n description: string;\r\n internalName: string;\r\n}\r\n\r\nexport interface EnquiryDefaults {\r\n id: number;\r\n config: EnquiryDefaultConfig;\r\n}\r\n\r\nexport interface EnquiryDefaultConfig {\r\n id: number;\r\n isManualEntry: boolean;\r\n isCalculatedDays: boolean;\r\n isCalculatedHours: boolean;\r\n timeOfDay: string;\r\n addDays: number;\r\n addHours: number;\r\n defaultMeetingLength: string;\r\n reminder: string;\r\n overdueReminder: string;\r\n isSendReminderOnWeekend: boolean;\r\n isSendInvitationToEnquirer: boolean;\r\n isSendInvitationToAssignee: boolean;\r\n isSendReminderOnWeekendForOverDueReminders: boolean;\r\n isLocationFieldMandatory: boolean;\r\n periodBeforeFirstUnassignedReminder: string;\r\n periodAfterFirstUnassignedReminder: string;\r\n isSendFistUnassignedReminderOnWeekends: boolean;\r\n isSendUnassignedAfterFirstReminderOnWeekends: boolean;\r\n isSourceNotesMandatory: boolean;\r\n isInternalNotesMandatory: boolean;\r\n isEventAndCampaignMandatory: boolean;\r\n isNatureOfEnquiryMandatory: boolean;\r\n periodMeetingDefaultReminder: string;\r\n isSendMeetingDefaultReminderEmail: boolean;\r\n isSendMeetingDefaultReminderSms: boolean;\r\n}\r\n\r\nexport interface EmailDefaults {\r\n config: EmailConfig;\r\n}\r\n\r\nexport interface EmailConfig {\r\n fromName: null;\r\n replyTo: null;\r\n sendEmailOnBehalfOf: null;\r\n confirmationBcc: null;\r\n}\r\n\r\nexport function retrieveSystemSettingsNamesQueryData(\r\n refreshData: boolean,\r\n onSuccess: (data: SystemSettingsNamesData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void)\r\n : void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n\r\n client.query({\r\n query: SystemSettingsNamesQuery,\r\n variables: {},\r\n fetchPolicy: fetchPolicy\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any; }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any ) => { onError(reason); });\r\n}\r\n\r\nexport const SystemSettingsNamesQuery = gql`\r\n query SystemSettingsNames{\r\n settings {\r\n id\r\n systems {\r\n id\r\n settingNames {\r\n settingName {\r\n id,\r\n guidID,\r\n title,\r\n description,\r\n internalName\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport function retrieveEnquiryDefaultConfigData(\r\n refreshData: boolean,\r\n onSuccess: (data: SystemSettingsNamesData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void)\r\n : void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n\r\n client.query({\r\n query: EnquiryDefaultConfigQuery,\r\n variables: {},\r\n fetchPolicy: fetchPolicy\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any; }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any ) => { onError(reason); });\r\n}\r\n\r\nconst EnquiryDefaultConfigQuery = gql`\r\n query EnquiryDefaultConfig {\r\n settings {\r\n id,\r\n systems {\r\n id,\r\n enquiryDefaults {\r\n id,\r\n config {\r\n id,\r\n isManualEntry,\r\n isCalculatedDays,\r\n isCalculatedHours,\r\n timeOfDay,\r\n addDays,\r\n addHours,\r\n defaultMeetingLength,\r\n reminder,\r\n overdueReminder,\r\n \tisSendReminderOnWeekend,\r\n isSendInvitationToEnquirer\r\n isSendInvitationToAssignee\r\n isSendReminderOnWeekendForOverDueReminders\r\n \tisLocationFieldMandatory\r\n periodBeforeFirstUnassignedReminder\r\n periodAfterFirstUnassignedReminder\r\n isSendFistUnassignedReminderOnWeekends\r\n isSendUnassignedAfterFirstReminderOnWeekends\r\n isSourceNotesMandatory\r\n isInternalNotesMandatory\r\n isEventAndCampaignMandatory\r\n isNatureOfEnquiryMandatory\r\n periodMeetingDefaultReminder\r\n isSendMeetingDefaultReminderEmail\r\n isSendMeetingDefaultReminderSms\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport const UpdateEnquiryDefaultConfigMutation = gql`\r\nmutation updateEnquiryDefaultConfigMutation(\r\n $isManualEntry: Boolean\r\n $isCalculatedDays: Boolean\r\n $isCalculatedHours: Boolean\r\n $timeOfDay: String\r\n $addDays: Int\r\n $addHours: Decimal\r\n $defaultMeetingLength: String\r\n $reminder: String\r\n $overdueReminder: String\r\n $isSendReminderOnWeekend: Boolean\r\n $isSendInvitationToEnquirer: Boolean\r\n $isSendInvitationToAssignee: Boolean\r\n $isSendReminderOnWeekendForOverDueReminders: Boolean\r\n $isLocationFieldMandatory: Boolean\r\n $periodBeforeFirstUnassignedReminder: String\r\n $periodAfterFirstUnassignedReminder: String\r\n $isSendFistUnassignedReminderOnWeekends: Boolean\r\n $isSendUnassignedAfterFirstReminderOnWeekends: Boolean\r\n $isSourceNotesMandatory: Boolean\r\n $isInternalNotesMandatory: Boolean\r\n $isNatureOfEnquiryMandatory: Boolean\r\n $isEventAndCampaignMandatory: Boolean\r\n $periodMeetingDefaultReminder: String\r\n $isSendMeetingDefaultReminderSms: Boolean\r\n $isSendMeetingDefaultReminderEmail: Boolean\r\n) {\r\nsettings {\r\n enquiryDefaultConfig {\r\n update(\r\n isManualEntry: $isManualEntry\r\n isCalculatedDays: $isCalculatedDays\r\n isCalculatedHours: $isCalculatedHours\r\n timeOfDay: $timeOfDay\r\n addDays: $addDays\r\n addHours: $addHours\r\n defaultMeetingLength: $defaultMeetingLength\r\n reminder: $reminder\r\n overdueReminder: $overdueReminder\r\n isSendReminderOnWeekend: $isSendReminderOnWeekend\r\n isSendInvitationToEnquirer: $isSendInvitationToEnquirer\r\n isSendInvitationToAssignee: $isSendInvitationToAssignee\r\n isSendReminderOnWeekendForOverDueReminders: $isSendReminderOnWeekendForOverDueReminders\r\n isLocationFieldMandatory: $isLocationFieldMandatory\r\n periodBeforeFirstUnassignedReminder: $periodBeforeFirstUnassignedReminder\r\n periodAfterFirstUnassignedReminder: $periodAfterFirstUnassignedReminder\r\n isSendFistUnassignedReminderOnWeekends: $isSendFistUnassignedReminderOnWeekends\r\n isSendUnassignedAfterFirstReminderOnWeekends: $isSendUnassignedAfterFirstReminderOnWeekends\r\n isSourceNotesMandatory: $isSourceNotesMandatory\r\n isInternalNotesMandatory: $isInternalNotesMandatory\r\n isEventAndCampaignMandatory: $isEventAndCampaignMandatory\r\n isNatureOfEnquiryMandatory: $isNatureOfEnquiryMandatory\r\n periodMeetingDefaultReminder: $periodMeetingDefaultReminder\r\n isSendMeetingDefaultReminderSms: $isSendMeetingDefaultReminderSms\r\n isSendMeetingDefaultReminderEmail: $isSendMeetingDefaultReminderEmail\r\n \r\n ) {\r\n error\r\n status\r\n }\r\n }\r\n }\r\n}\r\n`;\r\n\r\nexport function retrieveEmailConfigData(\r\n refreshData: boolean,\r\n onSuccess: (data: SystemSettingsNamesData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void)\r\n : void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n\r\n client.query({\r\n query: EmailConfigQuery,\r\n variables: {},\r\n fetchPolicy: fetchPolicy\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any; }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any ) => { onError(reason); });\r\n}\r\n\r\nconst EmailConfigQuery = gql`\r\nquery EmailConfig {\r\n settings {\r\n id,\r\n systems {\r\n id\r\n emailDefaults {\r\n id\r\n config {\r\n id\r\n fromName\r\n replyTo\r\n sendEmailOnBehalfOf\r\n confirmationBcc\r\n }\r\n }\r\n }\r\n }\r\n}`;\r\n\r\nexport const UpdateEmailConfigMutation = gql`\r\n mutation UpdateEmailConfig($sendEmailOnBehalfOf: String, $fromName: String, $replyTo: String, $confirmationBcc: String) {\r\n settings {\r\n emailConfig {\r\n update(sendEmailOnBehalfOf: $sendEmailOnBehalfOf, fromName: $fromName, replyTo: $replyTo, confirmationBcc: $confirmationBcc) {\r\n error\r\n status\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport const SettingNotificationSubscription = gql`\r\n subscription SettingfigNotification {\r\n settingNotification {\r\n description\r\n id\r\n message\r\n status\r\n }\r\n }\r\n`;\r\n\r\nexport interface TaskAndPhoneMessageDefaultConfigMutationParams {\r\n isSendReminderOnWeekend?: boolean;\r\n reminder?: string;\r\n isSendReminderOnWeekendForOverDueReminders?: boolean;\r\n overdueReminder?: string;\r\n}\r\n\r\nexport const UPDATE_TASK_DEFAULT_CONFIG_MUTATION = gql`\r\n mutation updateTaskDefaultConfigMutation(\r\n $isSendReminderOnWeekend: Boolean,\r\n $reminder: String,\r\n $isSendReminderOnWeekendForOverDueReminders: Boolean,\r\n $overdueReminder: String\r\n ) {\r\n settings {\r\n taskDefaultConfig {\r\n update(\r\n isSendReminderOnWeekend: $isSendReminderOnWeekend,\r\n reminder: $reminder,\r\n isSendReminderOnWeekendForOverDueReminders: $isSendReminderOnWeekendForOverDueReminders,\r\n overdueReminder: $overdueReminder\r\n ) {\r\n error\r\n status\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport const UPDATE_PHONE_MESSAGE_DEFAULT_CONFIG_MUTATION = gql`\r\n mutation updatePhoneMessageDefaultConfigMutation(\r\n $isSendReminderOnWeekend: Boolean,\r\n $reminder: String,\r\n $isSendReminderOnWeekendForOverDueReminders: Boolean,\r\n $overdueReminder: String\r\n ) {\r\n settings {\r\n phoneMessageDefaultConfig {\r\n update(\r\n isSendReminderOnWeekend: $isSendReminderOnWeekend,\r\n reminder: $reminder,\r\n isSendReminderOnWeekendForOverDueReminders: $isSendReminderOnWeekendForOverDueReminders,\r\n overdueReminder: $overdueReminder\r\n ) {\r\n error\r\n status\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport interface PhoneMessageDefaultsData {\r\n settings: Settings;\r\n}\r\n\r\nexport interface TaskDefaultsData {\r\n settings: Settings;\r\n}\r\n\r\nexport interface Settings {\r\n systems: Systems;\r\n id: number;\r\n}\r\n\r\nexport interface Systems {\r\n id: number;\r\n phoneMessageDefaults: PhoneMessageDefaults;\r\n taskDefaults: TaskDefaults;\r\n clientAndContactDefaults: ClietnAdnContactDefaults;\r\n}\r\n\r\nexport interface PhoneMessageDefaults {\r\n id: number;\r\n config: TaskAndPhoneMessageConfig;\r\n}\r\nexport interface TaskDefaults {\r\n id: number;\r\n config: TaskAndPhoneMessageConfig;\r\n}\r\n\r\nexport interface TaskAndPhoneMessageConfig {\r\n isSendReminderOnWeekend: boolean;\r\n isSendReminderOnWeekendForOverDueReminders: boolean;\r\n reminder: string | null;\r\n overdueReminder: string | null;\r\n}\r\n\r\nexport const PHONE_MESSAGE_DEFAULTS_QUERY = gql`\r\n query phoneMessageDefaultsQuery {\r\n settings {\r\n id\r\n systems {\r\n id\r\n phoneMessageDefaults {\r\n id\r\n config {\r\n id\r\n isSendReminderOnWeekend\r\n isSendReminderOnWeekendForOverDueReminders\r\n reminder\r\n overdueReminder\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport function retrievePhoneMessageDefaultConfigData(\r\n refreshData: boolean,\r\n onSuccess: (data: PhoneMessageDefaultsData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void)\r\n : void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n\r\n client.query({\r\n query: PHONE_MESSAGE_DEFAULTS_QUERY,\r\n variables: {},\r\n fetchPolicy: fetchPolicy\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any; }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any ) => { onError(reason); });\r\n}\r\n\r\nexport const TASK_DEFAULTS_QUERY = gql`\r\n query TaskDefaultsQuery {\r\n settings {\r\n id\r\n systems {\r\n id\r\n taskDefaults {\r\n id\r\n config {\r\n id\r\n isSendReminderOnWeekend\r\n isSendReminderOnWeekendForOverDueReminders\r\n reminder\r\n overdueReminder\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n`;\r\n\r\nexport function retrieveTaskDefaultConfigData(\r\n refreshData: boolean,\r\n onSuccess: (data: TaskDefaultsData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void)\r\n : void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n\r\n client.query({\r\n query: TASK_DEFAULTS_QUERY,\r\n variables: {},\r\n fetchPolicy: fetchPolicy\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any; }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any ) => { onError(reason); });\r\n}\r\n\r\nexport interface ClientAndContactsDefaultsData {\r\n settings: Settings;\r\n}\r\n\r\nexport interface ClietnAdnContactDefaults {\r\n config: ClientAndContactDefaultsData;\r\n}\r\n\r\nexport interface ClientAndContactDefaultsData {\r\n isNoteTypeMandatory: boolean;\r\n isNoteSubjectMandatory: boolean;\r\n outlookAddinNoteTypeGuid: string;\r\n outlookAddinNoteTypeDescription: string;\r\n outlookAddinNoteSubjectId: number;\r\n outlookAddinNoteSubjectDescription: string;\r\n\r\n eventCreationNoteTypeGuid: string;\r\n eventCreationNoteTypeDescription: string;\r\n eventCreationNoteSubjectId: number;\r\n eventCreationNoteSubjectDescription: string;\r\n\r\n campaignCreationNoteTypeGuid: string;\r\n campaignCreationNoteTypeDescription: string;\r\n campaignCreationNoteSubjectId: number;\r\n campaignCreationNoteSubjectDescription: string;\r\n}\r\n\r\nexport interface ClientAndContactDefaultConfigParams {\r\n isNoteTypeMandatory: boolean;\r\n isNoteSubjectMandatory: boolean;\r\n outlookAddinNoteTypeGuid: string | number | null;\r\n outlookAddinNoteSubjectId: string | number | null;\r\n eventCreationNoteTypeGuid: string | number | null;\r\n eventCreationNoteSubjectId: string | number | null;\r\n campaignCreationNoteTypeGuid: string | number | null;\r\n campaignCreationNoteSubjectId: string | number | null;\r\n}\r\n\r\nexport const ClientAndContacsDefaultConfigurationQuery = gql`\r\n query ClientAndContactDefaultConfig {\r\n settings {\r\n id\r\n systems {\r\n id \r\n clientAndContactDefaults {\r\n id\r\n config {\r\n id\r\n isNoteTypeMandatory\r\n isNoteSubjectMandatory\r\n outlookAddinNoteTypeGuid\r\n outlookAddinNoteTypeDescription\r\n outlookAddinNoteSubjectId\r\n outlookAddinNoteSubjectDescription\r\n eventCreationNoteTypeGuid\r\n eventCreationNoteTypeDescription\r\n eventCreationNoteSubjectId\r\n eventCreationNoteSubjectDescription\r\n campaignCreationNoteTypeGuid\r\n campaignCreationNoteTypeDescription\r\n campaignCreationNoteSubjectId\r\n campaignCreationNoteSubjectDescription\r\n }\r\n }\r\n } \r\n }\r\n }\r\n`;\r\n\r\nexport const ClientAndContactsDefaultConfigurationMutation = gql`\r\nmutation ClientAndContactDefaultConfig (\r\n $isNoteTypeMandatory: Boolean,\r\n $isNoteSubjectMandatory: Boolean,\r\n $outlookAddinNoteTypeGuid: String,\r\n $outlookAddinNoteSubjectId: Int,\r\n $eventCreationNoteTypeGuid: String,\r\n $eventCreationNoteSubjectId: Int,\r\n $campaignCreationNoteTypeGuid: String,\r\n $campaignCreationNoteSubjectId: Int\r\n ) \r\n {\r\n settings {\r\n clientAndContactDefaultConfig {\r\n update (\r\n isNoteTypeMandatory: $isNoteTypeMandatory,\r\n isNoteSubjectMandatory: $isNoteSubjectMandatory,\r\n outlookAddinNoteTypeGuid: $outlookAddinNoteTypeGuid,\r\n outlookAddinNoteSubjectId: $outlookAddinNoteSubjectId,\r\n eventCreationNoteTypeGuid: $eventCreationNoteTypeGuid,\r\n eventCreationNoteSubjectId: $eventCreationNoteSubjectId,\r\n campaignCreationNoteTypeGuid: $campaignCreationNoteTypeGuid,\r\n campaignCreationNoteSubjectId: $campaignCreationNoteSubjectId\r\n )\r\n {\r\n error\r\n status\r\n }\r\n }\r\n }\r\n}\r\n`;\r\n\r\nexport function retrieveClientAndContactsDefaultConfigData(\r\n refreshData: boolean,\r\n onSuccess: (data: ClientAndContactsDefaultsData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void)\r\n : void {\r\n \r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n\r\n client.query({\r\n query: ClientAndContacsDefaultConfigurationQuery,\r\n variables: {},\r\n fetchPolicy: fetchPolicy\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any; }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any ) => { onError(reason); });\r\n}","// tslint:disable\r\nexport interface CurrencyDataProps {\r\n\tcurrency: string;\r\n\tsymbol: string;\r\n\tdigitalCode: string;\r\n\tname: string;\r\n\tcountry: string;\r\n}\r\n\r\nexport const CurrenciesData: CurrencyDataProps[] = [\r\n {\r\n currency: 'AED',\r\n symbol: 'د.إ',\r\n digitalCode: '784',\r\n name: 'UAE Dirham',\r\n country: 'UAE',\r\n },\r\n {\r\n currency: 'AFN',\r\n symbol: 'Af',\r\n digitalCode: '971',\r\n name: 'Afghani',\r\n country: 'Afghanistan',\r\n },\r\n {\r\n \tcurrency: 'ALL',\r\n\t\tsymbol: 'L',\r\n\t\tdigitalCode: '008',\r\n\t\tname: 'Lek',\r\n\t\tcountry: 'Albania',\r\n },\r\n {\r\n currency: 'AMD',\r\n symbol: 'Դ',\r\n digitalCode: '051',\r\n name: 'Armenian Dram',\r\n country: 'Armenia',\r\n },\r\n {\r\n currency: 'AOA',\r\n symbol: 'Kz',\r\n digitalCode: '973',\r\n name: 'Kwanza',\r\n country: 'Angola',\r\n },\r\n\t{\r\n\t\tcurrency: 'ARS',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '032',\r\n\t\tname: 'Argentine Peso',\r\n\t\tcountry: 'Argentina',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'AUD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '036',\r\n\t\tname: 'Australian Dollar',\r\n\t\tcountry: 'Australia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'AUD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '036',\r\n\t\tname: 'Australian Dollar',\r\n\t\tcountry: 'Kiribati'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'AUD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '036',\r\n\t\tname: 'Australian Dollar',\r\n\t\tcountry: 'Coconut Islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'AUD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '036',\r\n\t\tname: 'Australian Dollar',\r\n\t\tcountry: 'Nauru'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'AUD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '036',\r\n\t\tname: 'Australian Dollar',\r\n\t\tcountry: 'Tuvalu'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'AWG',\r\n\t\tsymbol: 'ƒ',\r\n\t\tdigitalCode: '533',\r\n\t\tname: 'Aruban Guilder/Florin',\r\n\t\tcountry: 'Aruba',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'AZN',\r\n\t\tsymbol: 'ман',\r\n\t\tdigitalCode: '944',\r\n\t\tname: 'Azerbaijanian Manat',\r\n\t\tcountry: 'Azerbaijan',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BAM',\r\n\t\tsymbol: 'КМ',\r\n\t\tdigitalCode: '977',\r\n\t\tname: 'Konvertibilna Marka',\r\n\t\tcountry: 'Bosnia and Herzegovina',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BBD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '052',\r\n\t\tname: 'Barbados Dollar',\r\n\t\tcountry: 'Barbados',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BDT',\r\n\t\tsymbol: '৳',\r\n\t\tdigitalCode: '050',\r\n\t\tname: 'Taka',\r\n\t\tcountry: 'Bangladesh',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BGN',\r\n\t\tsymbol: 'лв',\r\n\t\tdigitalCode: '975',\r\n\t\tname: 'Bulgarian Lev',\r\n\t\tcountry: 'Bulgaria',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BHD',\r\n\t\tsymbol: 'ب.د',\r\n\t\tdigitalCode: '048',\r\n\t\tname: 'Bahraini Dinar',\r\n\t\tcountry: 'Bahrain',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BIF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '108',\r\n\t\tname: 'Burundi Franc',\r\n\t\tcountry: 'Burundi',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BMD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '060',\r\n\t\tname: 'Bermudian Dollar',\r\n\t\tcountry: 'Bermuda',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BND',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '096',\r\n\t\tname: 'Brunei Dollar',\r\n\t\tcountry: 'Brunei',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BND',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '096',\r\n\t\tname: 'Brunei Dollar',\r\n\t\tcountry: 'Singapore',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BOB',\r\n\t\tsymbol: 'Bs.',\r\n\t\tdigitalCode: '068',\r\n\t\tname: 'Boliviano',\r\n\t\tcountry: 'Bolivia',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BRL',\r\n\t\tsymbol: 'R$',\r\n\t\tdigitalCode: '986',\r\n\t\tname: 'Brazilian Real',\r\n\t\tcountry: 'Brazil',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BSD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '044',\r\n\t\tname: 'Bahamian Dollar',\r\n\t\tcountry: 'Bahamas',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BTN',\r\n\t\tsymbol: '',\r\n\t\tdigitalCode: '064',\r\n\t\tname: 'Ngultrum',\r\n\t\tcountry: 'Bhutan',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BWP',\r\n\t\tsymbol: 'P',\r\n\t\tdigitalCode: '072',\r\n\t\tname: 'Pula',\r\n\t\tcountry: 'Botswana'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BYN',\r\n\t\tsymbol: 'Br',\r\n\t\tdigitalCode: '933',\r\n\t\tname: 'Belarusian Ruble',\r\n\t\tcountry: 'Belarus'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'BZD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '084',\r\n\t\tname: 'Belize Dollar',\r\n\t\tcountry: 'Belize'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'CAD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '124',\r\n\t\tname: 'Canadian Dollar',\r\n\t\tcountry: 'Canada'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'CDF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '976',\r\n\t\tname: 'Congolese Franc',\r\n\t\tcountry: 'Congo (Kinshasa)'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'CHF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '756',\r\n\t\tname: 'Swiss Franc',\r\n\t\tcountry: 'Lichtenstein',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'CHF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '756',\r\n\t\tname: 'Swiss Franc',\r\n\t\tcountry: 'Switzerland'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'CLP',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '152',\r\n\t\tname: 'Chilean Peso',\r\n\t\tcountry: 'Chile'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'CNY',\r\n\t\tsymbol: '¥',\r\n\t\tdigitalCode: '156',\r\n\t\tname: 'Yuan',\r\n\t\tcountry: 'China'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'COP',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '170',\r\n\t\tname: 'Colombian Peso',\r\n\t\tcountry: 'Colombia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'CRC',\r\n\t\tsymbol: '₡',\r\n\t\tdigitalCode: '188',\r\n\t\tname: 'Costa Rican Colon',\r\n\t\tcountry: 'Costa Rica'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'CUP',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '192',\r\n\t\tname: 'Cuban Peso',\r\n\t\tcountry: 'Cuba'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'CVE',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '132',\r\n\t\tname: 'Cape Verde Escudo',\r\n\t\tcountry: 'Cape Verde'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'CZK',\r\n\t\tsymbol: 'Kč',\r\n\t\tdigitalCode: '203',\r\n\t\tname: 'Czech Koruna',\r\n\t\tcountry: 'Czech Republic'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'DJF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '262',\r\n\t\tname: 'Djibouti Franc',\r\n\t\tcountry: 'Djibouti'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'DKK',\r\n\t\tsymbol: 'kr',\r\n\t\tdigitalCode: '208',\r\n\t\tname: 'Danish Krone',\r\n\t\tcountry: 'Denmark'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'DOP',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '214',\r\n\t\tname: 'Dominican Peso',\r\n\t\tcountry: 'Dominican Republic'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'DZD',\r\n\t\tsymbol: 'د.ج',\r\n\t\tdigitalCode: '012',\r\n\t\tname: 'Algerian Dinar',\r\n\t\tcountry: 'Algeria'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EGP',\r\n\t\tsymbol: '£',\r\n\t\tdigitalCode: '818',\r\n\t\tname: 'Egyptian Pound',\r\n\t\tcountry: 'Egypt'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'ERN',\r\n\t\tsymbol: 'Nfk',\r\n\t\tdigitalCode: '232',\r\n\t\tname: 'Nakfa',\r\n\t\tcountry: 'Eritrea'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'ETB',\r\n\t\tsymbol: '',\r\n\t\tdigitalCode: '230',\r\n\t\tname: 'Ethiopian Birr',\r\n\t\tcountry: 'Ethiopia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Akrotiri and Dhekelia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Andorra'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Austria'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Belgium'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Cyprus'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Estonia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Finland'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'France'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Germany'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Greece'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Ireland'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Italy'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Kosovo'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Latvia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Lithuania'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Luxembourg'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Malta'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Monaco'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Montenegro'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Netherlands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Portugal'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'San-Marino'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Slovakia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Slovenia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Spain'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'EUR',\r\n\t\tsymbol: '€',\r\n\t\tdigitalCode: '978',\r\n\t\tname: 'Euro',\r\n\t\tcountry: 'Vatican'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'FJD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '242',\r\n\t\tname: 'Fiji Dollar',\r\n\t\tcountry: 'Fiji'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'FKP',\r\n\t\tsymbol: '£',\r\n\t\tdigitalCode: '238',\r\n\t\tname: 'Falkland Islands Pound',\r\n\t\tcountry: 'Falkland Islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GBP',\r\n\t symbol: '£',\r\n\t\tdigitalCode: '826',\r\n\t\tname: 'Pound Sterling',\r\n\t\tcountry: 'Alderney',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GBP',\r\n\t\tsymbol: '£',\r\n\t\tdigitalCode: '826',\r\n\t\tname: 'Pound Sterling',\r\n\t\tcountry: 'British Indian Ocean Territory',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GBP',\r\n\t\tsymbol: '£',\r\n\t\tdigitalCode: '826',\r\n\t\tname: 'Pound Sterling',\r\n\t\tcountry: 'Great Britain',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GBP',\r\n\t\tsymbol: '£',\r\n\t\tdigitalCode: '826',\r\n\t\tname: 'Pound Sterling',\r\n\t\tcountry: 'Isle of Maine',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GEL',\r\n\t\tsymbol: 'ლ',\r\n\t\tdigitalCode: '981',\r\n\t\tname: 'Lari',\r\n\t\tcountry: 'Georgia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GEL',\r\n\t\tsymbol: 'ლ',\r\n\t\tdigitalCode: '981',\r\n\t\tname: 'Lari',\r\n\t\tcountry: 'South Ossetia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GHS',\r\n\t\tsymbol: '₵',\r\n\t\tdigitalCode: '936',\r\n\t\tname: 'Cedi',\r\n\t\tcountry: 'Ghana'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GIP',\r\n\t\tsymbol: '£',\r\n\t\tdigitalCode: '292',\r\n\t\tname: 'Gibraltar Pound',\r\n\t\tcountry: 'Gibraltar'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GMD',\r\n\t\tsymbol: 'D',\r\n\t\tdigitalCode: '270',\r\n\t\tname: 'Dalasi',\r\n\t\tcountry: 'Gambia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GNF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '324',\r\n\t\tname: 'Guinea Franc',\r\n\t\tcountry: 'Guinea'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GTQ',\r\n\t\tsymbol: 'Q',\r\n\t\tdigitalCode: '320',\r\n\t\tname: 'Quetzal',\r\n\t\tcountry: 'Guatemala'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'GYD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '328',\r\n\t\tname: 'Guyana Dollar',\r\n\t\tcountry: 'Guyana'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'HKD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '344',\r\n\t\tname: 'Hong Kong Dollar',\r\n\t\tcountry: 'Hong Kong'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'HNL',\r\n\t\tsymbol: 'L',\r\n\t\tdigitalCode: '340',\r\n\t\tname: 'Lempira',\r\n\t\tcountry: 'Honduras'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'HRK',\r\n\t\tsymbol: 'Kn',\r\n\t\tdigitalCode: '191',\r\n\t\tname: 'Croatian Kuna',\r\n\t\tcountry: 'Croatia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'HTG',\r\n\t\tsymbol: 'G',\r\n\t\tdigitalCode: '332',\r\n\t\tname: 'Gourde',\r\n\t\tcountry: 'Haiti'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'HUF',\r\n\t\tsymbol: 'Ft',\r\n\t\tdigitalCode: '348',\r\n\t\tname: 'Forint',\r\n\t\tcountry: 'Hungary'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'IDR',\r\n\t\tsymbol: 'Rp',\r\n\t\tdigitalCode: '360',\r\n\t\tname: 'Rupiah',\r\n\t\tcountry: 'Indonesia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'ILS',\r\n\t\tsymbol: '₪',\r\n\t\tdigitalCode: '376',\r\n\t\tname: 'New Israeli Shekel',\r\n\t\tcountry: 'Israel'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'ILS',\r\n\t\tsymbol: '₪',\r\n\t\tdigitalCode: '376',\r\n\t\tname: 'New Israeli Shekel',\r\n\t\tcountry: 'Palestine'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'INR',\r\n\t\tsymbol: '₹',\r\n\t\tdigitalCode: '356',\r\n\t\tname: 'Indian Rupee',\r\n\t\tcountry: 'Bhutan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'INR',\r\n\t\tsymbol: '₹',\r\n\t\tdigitalCode: '356',\r\n\t\tname: 'Indian Rupee',\r\n\t\tcountry: 'India'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'IQD',\r\n\t\tsymbol: 'ع.د',\r\n\t\tdigitalCode: '368',\r\n\t\tname: 'Iraqi Dinar',\r\n\t\tcountry: 'Iraq'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'IRR',\r\n\t\tsymbol: '﷼',\r\n\t\tdigitalCode: '364',\r\n\t\tname: 'Iranian Rial',\r\n\t\tcountry: 'Iran'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'ISK',\r\n\t\tsymbol: 'Kr',\r\n\t\tdigitalCode: '352',\r\n\t\tname: 'Iceland Krona',\r\n\t\tcountry: 'Iceland'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'JMD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '388',\r\n\t\tname: 'Jamaican Dollar',\r\n\t\tcountry: 'Jamaica'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'JOD',\r\n\t\tsymbol: 'د.ا',\r\n\t\tdigitalCode: '400',\r\n\t\tname: 'Jordanian Dinar',\r\n\t\tcountry: 'Jordan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'JPY',\r\n\t\tsymbol: '¥',\r\n\t\tdigitalCode: '392',\r\n\t\tname: 'Yen',\r\n\t\tcountry: 'Japan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'KES',\r\n\t\tsymbol: 'Sh',\r\n\t\tdigitalCode: '404',\r\n\t\tname: 'Kenyan Shilling',\r\n\t\tcountry: 'Kenya'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'KGS',\r\n\t\tsymbol: '',\r\n\t\tdigitalCode: '417',\r\n\t\tname: 'Som',\r\n\t\tcountry: 'Kyrgyzstan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'KHR',\r\n\t\tsymbol: '៛',\r\n\t\tdigitalCode: '116',\r\n\t\tname: 'Riel',\r\n\t\tcountry: 'Cambodia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'KPW',\r\n\t\tsymbol: '₩',\r\n\t\tdigitalCode: '408',\r\n\t\tname: 'North Korean Won',\r\n\t\tcountry: 'North Korea'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'KRW',\r\n\t\tsymbol: '₩',\r\n\t\tdigitalCode: '410',\r\n\t\tname: 'South Korean Won',\r\n\t\tcountry: 'South Korea'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'KWD',\r\n\t\tsymbol: 'د.ك',\r\n\t\tdigitalCode: '414',\r\n\t\tname: 'Kuwaiti Dinar',\r\n\t\tcountry: 'Kuwait'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'KYD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '136',\r\n\t\tname: 'Cayman Islands Dollar',\r\n\t\tcountry: 'Cayman Islands',\r\n\t},\r\n\t{\r\n\t\tcurrency: 'KZT',\r\n\t\tsymbol: '〒',\r\n\t\tdigitalCode: '398',\r\n\t\tname: 'Tenge',\r\n\t\tcountry: 'Kazakhstan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'LAK',\r\n\t\tsymbol: '₭',\r\n\t\tdigitalCode: '418',\r\n\t\tname: 'Kip',\r\n\t\tcountry: 'Laos'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'LBP',\r\n\t\tsymbol: 'ل.ل',\r\n\t\tdigitalCode: '422',\r\n\t\tname: 'Lebanese Pound',\r\n\t\tcountry: 'Lebanon'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'LKR',\r\n\t\tsymbol: 'Rs',\r\n\t\tdigitalCode: '144',\r\n\t\tname: 'Sri Lanka Rupee',\r\n\t\tcountry: 'Sri Lanka'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'LRD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '430',\r\n\t\tname: 'Liberian Dollar',\r\n\t\tcountry: 'Liberia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'LSL',\r\n\t\tsymbol: 'L',\r\n\t\tdigitalCode: '426',\r\n\t\tname: 'Loti',\r\n\t\tcountry: 'Lesotho'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'LYD',\r\n\t\tsymbol: 'ل.د',\r\n\t\tdigitalCode: '434',\r\n\t\tname: 'Libyan Dinar',\r\n\t\tcountry: 'Libya'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MAD',\r\n\t\tsymbol: 'د.م.',\r\n\t\tdigitalCode: '504',\r\n\t\tname: 'Moroccan Dirham',\r\n\t\tcountry: 'Morocco'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MDL',\r\n\t\tsymbol: 'L',\r\n\t\tdigitalCode: '498',\r\n\t\tname: 'Moldovan Leu',\r\n\t\tcountry: 'Moldova'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MGA',\r\n\t\tsymbol: '',\r\n\t\tdigitalCode: '969',\r\n\t\tname: 'Malagasy Ariary',\r\n\t\tcountry: 'Madagascar'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MKD',\r\n\t\tsymbol: 'ден',\r\n\t\tdigitalCode: '807',\r\n\t\tname: 'Denar',\r\n\t\tcountry: 'Macedonia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MMK',\r\n\t\tsymbol: 'K',\r\n\t\tdigitalCode: '104',\r\n\t\tname: 'Kyat',\r\n\t\tcountry: 'Myanmar (Burma)'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MNT',\r\n\t\tsymbol: '₮',\r\n\t\tdigitalCode: '496',\r\n\t\tname: 'Tugrik',\r\n\t\tcountry: 'Mongolia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MOP',\r\n\t\tsymbol: 'P',\r\n\t\tdigitalCode: '446',\r\n\t\tname: 'Pataca',\r\n\t\tcountry: 'Macao'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MRU',\r\n\t\tsymbol: 'UM',\r\n\t\tdigitalCode: '929',\r\n\t\tname: 'Ouguiya',\r\n\t\tcountry: 'Mauritania'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MUR',\r\n\t\tsymbol: '₨',\r\n\t\tdigitalCode: '480',\r\n\t\tname: 'Mauritius Rupee',\r\n\t\tcountry: 'Mauritius'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MVR',\r\n\t\tsymbol: 'ރ.',\r\n\t\tdigitalCode: '462',\r\n\t\tname: 'Rufiyaa',\r\n\t\tcountry: 'Maldives'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MWK',\r\n\t\tsymbol: 'MK',\r\n\t\tdigitalCode: '454',\r\n\t\tname: 'Kwacha',\r\n\t\tcountry: 'Malawi'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MXN',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '484',\r\n\t\tname: 'Mexican Peso',\r\n\t\tcountry: 'Mexico'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MYR',\r\n\t\tsymbol: 'RM',\r\n\t\tdigitalCode: '458',\r\n\t\tname: 'Malaysian Ringgit',\r\n\t\tcountry: 'Malaysia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'MZN',\r\n\t\tsymbol: 'MTn',\r\n\t\tdigitalCode: '943',\r\n\t\tname: 'Metical',\r\n\t\tcountry: 'Mozambique'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'NAD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '516',\r\n\t\tname: 'Namibia Dollar',\r\n\t\tcountry: 'Namibia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'NGN',\r\n\t\tsymbol: '₦',\r\n\t\tdigitalCode: '566',\r\n\t\tname: 'Naira',\r\n\t\tcountry: 'Nigeria'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'NIO',\r\n\t\tsymbol: 'C$',\r\n\t\tdigitalCode: '558',\r\n\t\tname: 'Cordoba Oro',\r\n\t\tcountry: 'Nicaragua'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'NOK',\r\n\t\tsymbol: 'kr',\r\n\t\tdigitalCode: '578',\r\n\t\tname: 'Norwegian Krone',\r\n\t\tcountry: 'Norway'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'NPR',\r\n\t\tsymbol: '₨',\r\n\t\tdigitalCode: '524',\r\n\t\tname: 'Nepalese Rupee',\r\n\t\tcountry: 'Nepal'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'NZD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '554',\r\n\t\tname: 'New Zealand Dollar',\r\n\t\tcountry: 'Cook Islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'NZD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '554',\r\n\t\tname: 'New Zealand Dollar',\r\n\t\tcountry: 'Cook Islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'NZD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '554',\r\n\t\tname: 'New Zealand Dollar',\r\n\t\tcountry: 'New Zealand'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'NZD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '554',\r\n\t\tname: 'New Zealand Dollar',\r\n\t\tcountry: 'Niue'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'NZD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '554',\r\n\t\tname: 'New Zealand Dollar',\r\n\t\tcountry: 'Pitcairn Island'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'OMR',\r\n\t\tsymbol: 'ر.ع.',\r\n\t\tdigitalCode: '512',\r\n\t\tname: 'Rial Omani',\r\n\t\tcountry: 'Oman'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'PAB',\r\n\t\tsymbol: 'B/.',\r\n\t\tdigitalCode: '590',\r\n\t\tname: 'Balboa',\r\n\t\tcountry: 'Panama'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'PEN',\r\n\t\tsymbol: 'S/.',\r\n\t\tdigitalCode: '604',\r\n\t\tname: 'Nuevo Sol',\r\n\t\tcountry: 'Peru'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'PGK',\r\n\t\tsymbol: 'K',\r\n\t\tdigitalCode: '598',\r\n\t\tname: 'Kina',\r\n\t\tcountry: 'Papua New Guinea'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'PHP',\r\n\t\tsymbol: '₱',\r\n\t\tdigitalCode: '608',\r\n\t\tname: 'Philippine Peso',\r\n\t\tcountry: 'Philippines'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'PKR',\r\n\t\tsymbol: '₨',\r\n\t\tdigitalCode: '586',\r\n\t\tname: 'Pakistan Rupee',\r\n\t\tcountry: 'Pakistan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'PLN',\r\n\t\tsymbol: 'zł',\r\n\t\tdigitalCode: '985',\r\n\t\tname: 'PZloty',\r\n\t\tcountry: 'Poland'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'PYG',\r\n\t\tsymbol: '₲',\r\n\t\tdigitalCode: '600',\r\n\t\tname: 'Guarani',\r\n\t\tcountry: 'Paraguay'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'QAR',\r\n\t\tsymbol: 'ر.ق',\r\n\t\tdigitalCode: '634',\r\n\t\tname: 'Qatari Rial',\r\n\t\tcountry: 'Qatar'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'RON',\r\n\t\tsymbol: 'L',\r\n\t\tdigitalCode: '946',\r\n\t\tname: 'Leu',\r\n\t\tcountry: 'Romania'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'RSD',\r\n\t\tsymbol: 'din',\r\n\t\tdigitalCode: '941',\r\n\t\tname: 'Serbian Dinar',\r\n\t\tcountry: 'Kosovo'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'RSD',\r\n\t\tsymbol: 'din',\r\n\t\tdigitalCode: '941',\r\n\t\tname: 'Serbian Dinar',\r\n\t\tcountry: 'Serbia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'RUB',\r\n\t\tsymbol: 'р. ',\r\n\t\tdigitalCode: '643',\r\n\t\tname: 'Russian Ruble',\r\n\t\tcountry: 'Russia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'RUB',\r\n\t\tsymbol: 'р. ',\r\n\t\tdigitalCode: '643',\r\n\t\tname: 'Russian Ruble',\r\n\t\tcountry: 'South Ossetia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'RWF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '646',\r\n\t\tname: 'Rwanda Franc',\r\n\t\tcountry: 'Rwanda'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SAR',\r\n\t\tsymbol: 'ر.س',\r\n\t\tdigitalCode: '682',\r\n\t\tname: 'Saudi Riyal',\r\n\t\tcountry: 'Saudi Arabia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SBD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '090',\r\n\t\tname: 'Solomon Islands Dollar',\r\n\t\tcountry: 'Solomon Islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SCR',\r\n\t\tsymbol: '₨',\r\n\t\tdigitalCode: '690',\r\n\t\tname: 'Seychelles Rupee',\r\n\t\tcountry: 'Seychelles'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SDG',\r\n\t\tsymbol: '£',\r\n\t\tdigitalCode: '938',\r\n\t\tname: 'Sudanese Pound',\r\n\t\tcountry: 'Sudan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SEK',\r\n\t\tsymbol: 'kr',\r\n\t\tdigitalCode: '752',\r\n\t\tname: 'Swedish Krona',\r\n\t\tcountry: 'Sweden'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SGD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '702',\r\n\t\tname: 'Singapore Dollar',\r\n\t\tcountry: 'Brunei'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SGD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '702',\r\n\t\tname: 'Singapore Dollar',\r\n\t\tcountry: 'Singapore'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SHP',\r\n\t\tsymbol: '£',\r\n\t\tdigitalCode: '654',\r\n\t\tname: 'Saint Helena Pound',\r\n\t\tcountry: 'Ascension Island'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SHP',\r\n\t\tsymbol: '£',\r\n\t\tdigitalCode: '654',\r\n\t\tname: 'Saint Helena Pound',\r\n\t\tcountry: 'Saint Helena'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SHP',\r\n\t\tsymbol: '£',\r\n\t\tdigitalCode: '654',\r\n\t\tname: 'Saint Helena Pound',\r\n\t\tcountry: 'Tristan da Cunha'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SLL',\r\n\t\tsymbol: 'Le',\r\n\t\tdigitalCode: '694',\r\n\t\tname: 'Leone',\r\n\t\tcountry: 'Sierra Leone'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SOS',\r\n\t\tsymbol: 'Sh',\r\n\t\tdigitalCode: '706',\r\n\t\tname: 'Somali Shilling',\r\n\t\tcountry: 'Somalia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SRD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '968',\r\n\t\tname: 'Suriname Dollar',\r\n\t\tcountry: 'Suriname'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'STN',\r\n\t\tsymbol: 'Db',\r\n\t\tdigitalCode: '930',\r\n\t\tname: 'Dobra',\r\n\t\tcountry: 'Sao Tome and Principe'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SYP',\r\n\t\tsymbol: 'ل.س',\r\n\t\tdigitalCode: '760',\r\n\t\tname: 'Syrian Pound',\r\n\t\tcountry: 'Syria'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'SZL',\r\n\t\tsymbol: 'L',\r\n\t\tdigitalCode: '748',\r\n\t\tname: 'Lilangeni',\r\n\t\tcountry: 'Swaziland'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'THB',\r\n\t\tsymbol: '฿',\r\n\t\tdigitalCode: '764',\r\n\t\tname: 'Baht',\r\n\t\tcountry: 'Thailand'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'TJS',\r\n\t\tsymbol: 'ЅМ',\r\n\t\tdigitalCode: '972',\r\n\t\tname: 'Somoni',\r\n\t\tcountry: 'Tajikistan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'TMT',\r\n\t\tsymbol: 'm',\r\n\t\tdigitalCode: '934',\r\n\t\tname: 'Manat',\r\n\t\tcountry: 'Turkmenistan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'TND',\r\n\t\tsymbol: 'د.ت',\r\n\t\tdigitalCode: '788',\r\n\t\tname: 'Tunisian Dinar',\r\n\t\tcountry: 'Tunisia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'TOP',\r\n\t\tsymbol: 'T$',\r\n\t\tdigitalCode: '776',\r\n\t\tname: 'Pa’anga',\r\n\t\tcountry: 'Tonga'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'TRY',\r\n\t\tsymbol: '₤',\r\n\t\tdigitalCode: '949',\r\n\t\tname: 'Turkish Lira',\r\n\t\tcountry: 'North Cyprus'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'TRY',\r\n\t\tsymbol: '₤',\r\n\t\tdigitalCode: '949',\r\n\t\tname: 'Turkish Lira',\r\n\t\tcountry: 'Turkey'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'TTD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '780',\r\n\t\tname: 'Trinidad and Tobago Dollar',\r\n\t\tcountry: 'Trinidad and Tobago'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'TWD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '901',\r\n\t\tname: 'Taiwan Dollar',\r\n\t\tcountry: 'Taiwan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'TZS',\r\n\t\tsymbol: 'Sh',\r\n\t\tdigitalCode: '834',\r\n\t\tname: 'Tanzanian Shilling',\r\n\t\tcountry: 'Tanzania'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'UAH',\r\n\t\tsymbol: '₴',\r\n\t\tdigitalCode: '980',\r\n\t\tname: 'Hryvnia',\r\n\t\tcountry: 'Ukraine'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'UGX',\r\n\t\tsymbol: 'Sh',\r\n\t\tdigitalCode: '800',\r\n\t\tname: 'Uganda Shilling',\r\n\t\tcountry: 'Uganda'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'American Samoa'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'British Indian Ocean Territory'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'British Virgin Islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'Guam'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'Haiti'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'Marshall Islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'Micronesia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'Northern Mariana Islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'Pacific Remote islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'Palau'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'Panama'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'Puerto Rico'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'Turks and Caicos Islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'United States of America'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'USD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '840',\r\n\t\tname: 'US Dollar',\r\n\t\tcountry: 'US Virgin Islands'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'UYU',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '858',\r\n\t\tname: 'Peso Uruguayo',\r\n\t\tcountry: 'Uruguay'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'UZS',\r\n\t\tsymbol: '',\r\n\t\tdigitalCode: '860',\r\n\t\tname: 'Uzbekistan Sum',\r\n\t\tcountry: 'Uzbekistan'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'VEF',\r\n\t\tsymbol: 'Bs F',\r\n\t\tdigitalCode: '937',\r\n\t\tname: 'Bolivar Fuerte',\r\n\t\tcountry: 'Venezuela'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'VND',\r\n\t\tsymbol: '₫',\r\n\t\tdigitalCode: '704',\r\n\t\tname: 'Dong',\r\n\t\tcountry: 'Vietnam'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'VUV',\r\n\t\tsymbol: 'Vt',\r\n\t\tdigitalCode: '548',\r\n\t\tname: 'Vatu',\r\n\t\tcountry: 'Vanuatu'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'WST',\r\n\t\tsymbol: 'T',\r\n\t\tdigitalCode: '882',\r\n\t\tname: 'Tala',\r\n\t\tcountry: 'Samoa'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Benin'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Burkina Faso'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Cameroon'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Central African Republic'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Chad'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Congo (Brazzaville)'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: `Côte d'Ivoire`\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Equatorial Guinea'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Gabon'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Guinea-Bissau'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Mali'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Niger'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Senegal'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XAF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '950',\r\n\t\tname: 'CFA Franc BCEAO',\r\n\t\tcountry: 'Togo'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XCD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '951',\r\n\t\tname: 'East Caribbean Dollar',\r\n\t\tcountry: 'Anguilla'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XCD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '951',\r\n\t\tname: 'East Caribbean Dollar',\r\n\t\tcountry: 'Antigua and Barbuda'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XCD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '951',\r\n\t\tname: 'East Caribbean Dollar',\r\n\t\tcountry: 'Dominica'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XCD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '951',\r\n\t\tname: 'East Caribbean Dollar',\r\n\t\tcountry: 'Grenada'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XCD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '951',\r\n\t\tname: 'East Caribbean Dollar',\r\n\t\tcountry: 'Montserrat'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XCD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '951',\r\n\t\tname: 'East Caribbean Dollar',\r\n\t\tcountry: 'Saint Kitts and Nevis'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XCD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '951',\r\n\t\tname: 'East Caribbean Dollar',\r\n\t\tcountry: 'Saint Lucia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XCD',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '951',\r\n\t\tname: 'East Caribbean Dollar',\r\n\t\tcountry: 'Saint Vincent and Grenadine'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XPF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '953',\r\n\t\tname: 'CFP Franc',\r\n\t\tcountry: 'French Polynesia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XPF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '953',\r\n\t\tname: 'CFP Franc',\r\n\t\tcountry: 'New Caledonia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'XPF',\r\n\t\tsymbol: '₣',\r\n\t\tdigitalCode: '953',\r\n\t\tname: 'CFP Franc',\r\n\t\tcountry: 'Wallis and Futuna'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'YER',\r\n\t\tsymbol: '﷼',\r\n\t\tdigitalCode: '886',\r\n\t\tname: 'Yemeni Rial',\r\n\t\tcountry: 'Yemen'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'ZAR',\r\n\t\tsymbol: 'R',\r\n\t\tdigitalCode: '710',\r\n\t\tname: 'Rand',\r\n\t\tcountry: 'Lesotho'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'ZAR',\r\n\t\tsymbol: 'R',\r\n\t\tdigitalCode: '710',\r\n\t\tname: 'Rand',\r\n\t\tcountry: 'Namibia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'ZAR',\r\n\t\tsymbol: 'R',\r\n\t\tdigitalCode: '710',\r\n\t\tname: 'Rand',\r\n\t\tcountry: 'South Africa'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'ZMW',\r\n\t\tsymbol: 'ZK',\r\n\t\tdigitalCode: '967',\r\n\t\tname: 'Zambian Kwacha',\r\n\t\tcountry: 'Zambia'\r\n\t},\r\n\t{\r\n\t\tcurrency: 'ZWL',\r\n\t\tsymbol: '$',\r\n\t\tdigitalCode: '932',\r\n\t\tname: 'Zimbabwe Dollar',\r\n\t\tcountry: 'Zimbabwe'\r\n\t}\r\n\t\t\t\t\t\r\n];","import React from 'react';\r\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { RvButtonFabric, RvButtonType } from '../components/Button';\r\nimport { RvLabel, LabelStyle } from '../components/Label/Label';\r\nimport { mainTheme } from '../Theme';\r\nimport VideoLibraryOutlinedIcon from '@material-ui/icons/VideoLibraryOutlined';\r\nimport { Button } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n width: '100%',\r\n padding: '0 15px'\r\n },\r\n container: {},\r\n buttonContainer: {\r\n position: 'relative',\r\n padding: '15px 80px',\r\n display: 'flex',\r\n // justifyContent: 'space-between',\r\n alignItems: 'center',\r\n color: mainTheme.BrandColors.TextPrimary,\r\n '@media (max-width: 1024px)': {\r\n padding: '15px 30px'\r\n },\r\n '& .rvlabel': {\r\n // paddingLeft: '82px',\r\n flex: 1,\r\n fontFamily: mainTheme.Font.Main,\r\n fontSize: mainTheme.FontSize.PX.size8,\r\n letterSpacing: '0.86px',\r\n lineHeight: mainTheme.LineHeight.ExtraLarge\r\n },\r\n '& .back-button': {\r\n paddingRight: '32px',\r\n // position: 'absolute',\r\n // top: '50%',\r\n // transform: 'translateY(-50%)',\r\n '& .ms-Button': {\r\n width: '50px',\r\n height: '50px'\r\n },\r\n '& .ms-Button-icon': {\r\n fontSize: mainTheme.FontSize.PX.size10,\r\n color: mainTheme.BrandColors.TemplatePrimary\r\n }\r\n }\r\n },\r\n buttonGroupWrapper: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n margin: '0 -10px',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n button: {\r\n margin: '0 10px',\r\n textTransform: 'none',\r\n fontSize: '14px',\r\n }\r\n })\r\n);\r\n\r\ninterface BannerProps {\r\n title: string;\r\n onClickBack?: () => void;\r\n onLearnMore?: () => void;\r\n}\r\n\r\nexport const FirmSettingConfigurationBanner: React.FC = ({\r\n title,\r\n onClickBack,\r\n onLearnMore\r\n}) => {\r\n const classes = useStyles();\r\n\r\n return (\r\n
\r\n
\r\n
\r\n \r\n \r\n
\r\n {onLearnMore && (\r\n \r\n )}\r\n
\r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import { FetchPolicy } from 'apollo-client';\r\nimport gql from 'graphql-tag';\r\nimport { client } from '..';\r\n\r\nexport const EventsAndCampginQuery = gql`\r\nquery eventandcampaign(\r\n $offset: Int, \r\n $first: Int, \r\n $filter: String, \r\n $isIncludeCompleted: Boolean, \r\n $excludeDataTracking: Boolean,\r\n $category: String,\r\n $responsible: String,\r\n $typeList: String,\r\n $statusList: String,\r\n $startDateFrom: DateTime,\r\n $startDateTo: DateTime\r\n) {\r\n eventAndCampaign {\r\n summaryList(\r\n offset: $offset, \r\n first: $first, \r\n filter: $filter, \r\n isIncludeCompleted: $isIncludeCompleted, \r\n excludeDataTracking: $excludeDataTracking,\r\n category: $category\r\n responsible: $responsible\r\n typeList: $typeList\r\n statusList: $statusList\r\n startDateFrom: $startDateFrom\r\n startDateTo: $startDateTo\r\n ) {\r\n recordCount\r\n actualRowCountForSearch\r\n eventAndCampaignSummaries {\r\n guid\r\n name\r\n category\r\n type\r\n typeGuid\r\n startDate\r\n endDate\r\n rsvpDueDate\r\n venue\r\n availableSeats\r\n positiveResponse\r\n negativeResponse\r\n noResponse\r\n attended\r\n status\r\n statusGuid\r\n inviteeCount\r\n personResponsible\r\n personResponsibleGuid\r\n attendeeCost\r\n notes\r\n duration\r\n isCompleted\r\n attendedPercentage\r\n acceptedPercentage\r\n campaignDate\r\n budgetedCost\r\n enquiries\r\n billing\r\n costPerEnquiry\r\n trackingFields {\r\n guid\r\n eventAndCampaignGuid\r\n trackingFieldId\r\n trackingValue\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`;\r\n\r\nexport interface EventsAndCampaignQueryData {\r\n eventAndCampaign: EventAndCampaign;\r\n}\r\n\r\nexport interface EventAndCampaign {\r\n summaryList: SummaryList;\r\n}\r\n\r\nexport interface SummaryList {\r\n recordCount: number;\r\n actualRowCountForSearch: number;\r\n eventAndCampaignSummaries: EventAndCampaignSummary[];\r\n}\r\n\r\nexport type TrackingField = {\r\n guid: string;\r\n eventAndCampaignGuid: string;\r\n trackingFieldId: number;\r\n trackingValue: string;\r\n}\r\n\r\nexport interface EventAndCampaignSummary {\r\n guid: string;\r\n name: string;\r\n category: number;\r\n type: string;\r\n typeGuid: string;\r\n startDate: Date;\r\n endDate: Date;\r\n rsvpDueDate: Date;\r\n venue: string;\r\n availableSeats: number;\r\n positiveResponse: number;\r\n negativeResponse: number;\r\n noResponse: number;\r\n attended: number;\r\n status: string;\r\n statusGuid: string;\r\n inviteeCount: number;\r\n personResponsible: string;\r\n personResponsibleGuid: string;\r\n attendeeCost: number;\r\n notes: string;\r\n duration: string;\r\n isCompleted: boolean;\r\n attendedPercentage: number;\r\n acceptedPercentage: number;\r\n campaignDate: Date;\r\n budgetedCost: number;\r\n trackingFields: TrackingField[];\r\n}\r\n\r\nexport interface EventsAndCampaignQueryParams {\r\n offset: number | null;\r\n first: number | null;\r\n filter?: string | null;\r\n isIncludeCompleted?: boolean;\r\n excludeDataTracking?: boolean;\r\n category?: string | null;\r\n responsible?: string | null;\r\n typeList?: string | null;\r\n statusList?: string | null;\r\n startDateFrom?: Date | null;\r\n startDateTo?: Date | null;\r\n}\r\n\r\nexport function retrieveEventsAndCampaignData(\r\n query: EventsAndCampaignQueryParams,\r\n refreshData: boolean,\r\n onSuccess: (data: EventsAndCampaignQueryData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void,\r\n): void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n client\r\n .query({\r\n query: EventsAndCampginQuery,\r\n variables: {\r\n offset: query.offset,\r\n first: query.first,\r\n filter: query.filter,\r\n isIncludeCompleted: query.isIncludeCompleted,\r\n excludeDataTracking: query.excludeDataTracking,\r\n category: query.category,\r\n responsible: query.responsible,\r\n typeList: query.typeList,\r\n statusList: query.statusList,\r\n startDateFrom: query.startDateFrom,\r\n startDateTo: query.startDateTo,\r\n },\r\n fetchPolicy: fetchPolicy,\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n onError(reason);\r\n });\r\n}\r\n\r\nexport interface TrackingFieldInput {\r\n trackingFieldId: number;\r\n trackingValue: string;\r\n}\r\nexport interface CreateEventAndCampaignMutationInput {\r\n category: number;\r\n name: string;\r\n eventAndCampaignTypeGuid?: string;\r\n eventStatusGuid?: string;\r\n responsibleGuid?: string;\r\n startDate?: Date;\r\n endDate?: Date;\r\n rsvpDueDate?: Date;\r\n availableSeats?: number;\r\n attendeeCost?: number;\r\n notes?: string;\r\n venue?: string;\r\n campaignDate?: Date;\r\n duration?: string;\r\n isCompleted?: boolean;\r\n trackingFieldInput?: TrackingFieldInput[];\r\n budgetedCost?: number;\r\n}\r\n\r\nexport interface CreateEventAndCampaignMutationParams {\r\n input: CreateEventAndCampaignMutationInput;\r\n}\r\n\r\nexport interface EventsAndCampaignData {\r\n eventsAndCampaign: EventsAndCampaign;\r\n}\r\n\r\nexport interface EventsAndCampaign {\r\n create: EventAndCampaignResult;\r\n update: EventAndCampaignResult;\r\n delete: EventAndCampaignResult;\r\n}\r\n\r\nexport interface EventAndCampaignResult {\r\n status: boolean;\r\n error: null;\r\n}\r\n\r\nexport const CreateEventAndCampaignMutation = gql`\r\n\tmutation createEventAndCampaign($input: CreateEventAndCampaignInput) {\r\n\t\teventsAndCampaign {\r\n\t\t\tcreate(input: $input) {\r\n\t\t\t\tstatus\r\n\t\t\t\terror\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n`;\r\n\r\nexport interface UpdateEventAndCampaignMutationParams {\r\n input: {\r\n guid?: string;\r\n category?: number;\r\n name?: string;\r\n eventAndCampaignTypeGuid?: string;\r\n eventStatusGuid?: string;\r\n responsibleGuid?: string;\r\n startDate?: Date;\r\n endDate?: Date;\r\n rsvpDueDate?: Date;\r\n availableSeats?: number;\r\n attendeeCost?: number;\r\n notes?: string;\r\n venue?: string;\r\n };\r\n}\r\n\r\nexport const UpdateEventsAndCampaignMutation = gql`\r\n\tmutation UpdateEventAndCampaign($input: UpdateEventAndCampaignInput) {\r\n\t\teventsAndCampaign {\r\n\t\t\tupdate(input: $input) {\r\n\t\t\t\tstatus\r\n\t\t\t\terror\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n`;\r\n\r\nexport interface DeleteEventAndCampaignMutationParams {\r\n guid?: string;\r\n}\r\n\r\nexport const DeleteEventsAndCampaignMutation = gql`\r\n\tmutation DeleteEventCampaign(\r\n\t\t$guid: String\r\n\t\t) {\r\n\t\t\teventsAndCampaign {\r\n\t\t\t\tdelete(\r\n\t\t\t\t\tguid: $guid\r\n\t\t\t\t) {\r\n\t\t\t\t\tstatus\r\n\t\t\t\t\terror\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n`;\r\n\r\nexport const CreateEventsAndCampaignNotification = gql`\r\n\tsubscription createEventAndCampaign{\r\n\t\tcreateEventAndCampaignNotification{\r\n\t\t\tid\r\n\t\t\t\tmessage\r\n\t\t\t\tstatus\r\n\t\t\t\tdescription\r\n\t\t}\r\n\t\t\t}\r\n`;\r\n\r\nexport const UpdateEventsAndCampaignNotification = gql`\r\n\tsubscription updateEventAndCampaign{\r\n\t\tupdateEventAndCampaignNotification{\r\n\t\t\tid\r\n\t\t\t\tmessage\r\n\t\t\t\tstatus\r\n\t\t\t\tdescription\r\n\t\t}\r\n\t}\r\n`;\r\n\r\nexport const DeleteEventsAndCampaignNotification = gql`\r\n\tsubscription deleteEventAndCampaign{\r\n\t\tdeleteEventAndCampaignNotification{\r\n\t\t\tid\r\n\t\t\t\tmessage\r\n\t\t\t\tstatus\r\n\t\t\t\tdescription\r\n\t\t}\r\n\t}\r\n`;\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { Button, createStyles, Grid, makeStyles, TextField, Theme } from '@material-ui/core';\r\nimport { Alert } from '@material-ui/lab';\r\nimport { FormApi } from 'final-form';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport { client } from '../..';\r\nimport { showNotification } from '../../App';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport { retrieveEmailConfigData, SystemSettingsNamesData, UpdateEmailConfigMutation } from '../FirmSettingConfigurationRepository';\r\nimport { UserFeature, UserFeatureEnum } from '../../types/UserFeature';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n textField: {\r\n width: '100%'\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n }\r\n })\r\n);\r\n\r\ninterface FormState {\r\n fromName: string | null;\r\n replyTo: string | null;\r\n sendEmailOnBehalfOf: string | null;\r\n confirmationBcc: string | null;\r\n}\r\ninterface EmailingTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function EmailingTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: true,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n fromName: null,\r\n replyTo: null,\r\n sendEmailOnBehalfOf: null,\r\n confirmationBcc: null\r\n });\r\n\r\n useEffect(() => {\r\n fetchData();\r\n // tslint:disable-next-line: align\r\n }, []);\r\n \r\n useEffect(() => {\r\n fetchData();\r\n // tslint:disable-next-line: align\r\n }, []);\r\n \r\n const fetchData = () => {\r\n retrieveEmailConfigData(\r\n true,\r\n (data: SystemSettingsNamesData) => onEmailConfigRetrieved(data),\r\n // tslint:disable-next-line: no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onEmailConfigRetrieved = (data: SystemSettingsNamesData) => {\r\n if (data && data.settings && data.settings.systems && data.settings.systems.emailDefaults && data.settings.systems.emailDefaults.config) {\r\n \r\n const {fromName, sendEmailOnBehalfOf, replyTo, confirmationBcc} = data.settings.systems.emailDefaults.config;\r\n \r\n setFormState((prevFormState) => {\r\n return {\r\n ...prevFormState,\r\n fromName: fromName,\r\n sendEmailOnBehalfOf: sendEmailOnBehalfOf,\r\n confirmationBcc: confirmationBcc,\r\n replyTo: replyTo,\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n }\r\n };\r\n\r\n // const onTextFieldChange = (event: React.ChangeEvent) => {\r\n // const value = event.target.value;\r\n // const name = event.target.name;\r\n\r\n // setState((prevState) => {\r\n // return {\r\n // ...prevState,\r\n // [name]: value\r\n // };\r\n // });\r\n \r\n // };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: AnyObject) => {\r\n\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: true\r\n };\r\n });\r\n\r\n client\r\n .mutate({\r\n mutation: UpdateEmailConfigMutation,\r\n variables: {\r\n sendEmailOnBehalfOf: values.sendEmailOnBehalfOf,\r\n fromName: values.fromName,\r\n replyTo: values.replyTo,\r\n confirmationBcc: values.confirmationBcc\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n }); \r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update firm details', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n });\r\n };\r\n\r\n return (\r\n
\r\n {state.isLoading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n ) => onSubmit(form, values)} \r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{\r\n submitting: true,\r\n pristine: true\r\n }}\r\n render={({\r\n handleSubmit,\r\n form,\r\n submitting,\r\n pristine,\r\n values\r\n }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n \r\n \r\n \r\n All fields are optional. If none are provided, the RedView defaults are used\r\n \r\n {UserFeature.HasAccess(UserFeatureEnum.hasEmailSendOrReplyDefinition) ? (\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n ) : null}\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n {UserFeature.HasAccess(UserFeatureEnum.hasEmailSendOrReplyDefinition) ? (\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n ) : null}\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n )}\r\n
\r\n );\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport function printJson(values: any) {\r\n if (values) {\r\n return (\r\n <>\r\n
\r\n                    {JSON.stringify(values, undefined, 2)}\r\n                
\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n
\r\n                            {JSON.stringify(values, undefined, 2)}\r\n                            {/*  */}\r\n                        
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { \r\n Accordion, \r\n AccordionDetails, \r\n AccordionSummary, \r\n Button, \r\n Checkbox, \r\n createStyles, \r\n FormControl, \r\n FormControlLabel, \r\n FormGroup, \r\n FormLabel, \r\n Grid, \r\n makeStyles, \r\n Radio, \r\n RadioGroup, \r\n TextField, \r\n Theme, \r\n Typography \r\n} from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { Field, Form, FormSpy } from 'react-final-form';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport RadioButtonCheckedIcon from '@material-ui/icons/RadioButtonChecked';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { MaterialUiPickersDate } from '@material-ui/pickers/typings/date';\r\nimport { Alert } from '@material-ui/lab';\r\nimport { KeyboardTimePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';\r\nimport { ReminderSelector } from '../../components/ReminderSelector';\r\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\r\nimport ScheduleIcon from '@material-ui/icons/Schedule';\r\nimport { mainTheme } from '../../Theme';\r\nimport MomentUtils from '@date-io/moment';\r\nimport { retrieveEnquiryDefaultConfigData, SystemSettingsNamesData, UpdateEnquiryDefaultConfigMutation } from '../FirmSettingConfigurationRepository';\r\nimport { showNotification } from '../../App';\r\nimport moment from 'moment';\r\nimport { client } from '../..';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\nimport { UserFeature, UserFeatureEnum } from '../../types/UserFeature';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n heading: {\r\n fontSize: theme.typography.pxToRem(15),\r\n fontWeight: 600,\r\n color: theme.palette.primary.main\r\n },\r\n accordionDetails: {\r\n flexFlow: 'column',\r\n },\r\n radioGroup: {\r\n flexFlow: 'row wrap',\r\n },\r\n formControl: {\r\n margin: '10px 0',\r\n },\r\n optionWrapper: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '10px',\r\n },\r\n optionContainer: {\r\n flex: 1,\r\n },\r\n optionList: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n padding: '10px 0',\r\n margin: '0 -5px',\r\n '& > span': {\r\n margin: '0 5px',\r\n },\r\n '& > div': {\r\n margin: '0 5px',\r\n }\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n reminderTextField: {\r\n width: '30%'\r\n },\r\n radioIcon: {\r\n color: mainTheme.BrandColors.TemplatePrimary\r\n },\r\n defaultMeetingLabel: {\r\n marginTop: '10px',\r\n marginRight: '10px'\r\n }\r\n })\r\n);\r\n\r\ninterface MandatoryFields {\r\n isLocationFieldMandatory: boolean;\r\n isSourceNotesMandatory: boolean;\r\n isInternalNotesMandatory: boolean;\r\n isNatureOfEnquiryMandatory: boolean;\r\n isEventAndCampaignMandatory: boolean;\r\n}\r\n\r\ninterface FormState extends MandatoryFields {\r\n dueDateOption: 'isManualEntry' | 'isCalculatedDays' | 'isCalculatedHours';\r\n timeOfDay: MaterialUiPickersDate;\r\n addDays: number;\r\n addHours: number;\r\n defaultMeetingLength: MaterialUiPickersDate;\r\n reminder?: IAutoCompleteItem;\r\n overdueReminder?: IAutoCompleteItem;\r\n isSendReminderOnWeekend: boolean;\r\n isSendInvitationToAssignee: boolean;\r\n isSendInvitationToEnquirer: boolean;\r\n isSendReminderOnWeekendForOverDueReminders: boolean;\r\n \r\n // unassigned enquiry notification\r\n periodBeforeFirstUnassignedReminder?: IAutoCompleteItem;\r\n periodAfterFirstUnassignedReminder?: IAutoCompleteItem;\r\n isSendFistUnassignedReminderOnWeekends: Boolean;\r\n isSendUnassignedAfterFirstReminderOnWeekends: Boolean;\r\n\r\n periodMeetingDefaultReminder: IAutoCompleteItem;\r\n isSendMeetingDefaultReminderEmail: boolean;\r\n isSendMeetingDefaultReminderSms: boolean;\r\n}\r\ninterface EnquiryDefaultTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function EnquiryDefaultTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: true,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n dueDateOption: 'isManualEntry',\r\n timeOfDay: null,\r\n addDays: 0,\r\n addHours: 0,\r\n defaultMeetingLength: null,\r\n reminder: { value: 'None', label: 'None' },\r\n overdueReminder: { value: 'None', label: 'None' },\r\n isSendReminderOnWeekend: false,\r\n isSendInvitationToAssignee: true,\r\n isSendInvitationToEnquirer: true,\r\n isSendReminderOnWeekendForOverDueReminders: false,\r\n isLocationFieldMandatory: false,\r\n isSendFistUnassignedReminderOnWeekends: false,\r\n isSendUnassignedAfterFirstReminderOnWeekends: false,\r\n periodAfterFirstUnassignedReminder: { value: 'None', label: 'None' },\r\n periodBeforeFirstUnassignedReminder: { value: 'None', label: 'None' },\r\n isNatureOfEnquiryMandatory: false,\r\n isInternalNotesMandatory: false,\r\n isEventAndCampaignMandatory: false,\r\n isSourceNotesMandatory: false,\r\n periodMeetingDefaultReminder: { value: 'None', label: 'None'},\r\n isSendMeetingDefaultReminderEmail: false,\r\n isSendMeetingDefaultReminderSms: false\r\n });\r\n\r\n useEffect(() => {\r\n fetchData();\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const fetchData = () => {\r\n retrieveEnquiryDefaultConfigData(\r\n true,\r\n // tslint:disable-next-line: no-console\r\n (data: SystemSettingsNamesData) => onEnquiryDefaultConfigRetrieved(data),\r\n // tslint:disable-next-line: no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onEnquiryDefaultConfigRetrieved = (data: SystemSettingsNamesData) => {\r\n const config = data.settings.systems.enquiryDefaults.config;\r\n\r\n const isTimeTodayValid = moment(config.timeOfDay, 'hh:mm a').isValid();\r\n\r\n const isDefaultMeetingLengthValid = moment(config.defaultMeetingLength, 'HH:mm').isValid();\r\n\r\n setFormState((prevFormState) => {\r\n\r\n let dueDateOption: 'isManualEntry' | 'isCalculatedDays' | 'isCalculatedHours' = 'isManualEntry';\r\n\r\n if (config.isCalculatedDays) {\r\n dueDateOption = 'isCalculatedDays';\r\n }\r\n\r\n if (config.isCalculatedHours) {\r\n dueDateOption = 'isCalculatedHours';\r\n }\r\n\r\n return {\r\n ...prevFormState,\r\n dueDateOption,\r\n timeOfDay: isTimeTodayValid ? moment(config.timeOfDay, 'hh:mm a') : null,\r\n addDays: config.addDays,\r\n addHours: config.addHours,\r\n defaultMeetingLength: isDefaultMeetingLengthValid ? moment(config.defaultMeetingLength, 'hh:mm') : null,\r\n reminder: config.reminder ? { value: config.reminder, label: config.reminder } : formState.reminder,\r\n overdueReminder: config.overdueReminder ? { value: config.overdueReminder, label: config.overdueReminder } : formState.overdueReminder,\r\n isSendReminderOnWeekend: config.isSendReminderOnWeekend,\r\n isSendInvitationToAssignee: config.isSendInvitationToAssignee,\r\n isSendInvitationToEnquirer: config.isSendInvitationToEnquirer,\r\n isSendReminderOnWeekendForOverDueReminders: config.isSendReminderOnWeekendForOverDueReminders,\r\n isSendFistUnassignedReminderOnWeekends: config.isSendFistUnassignedReminderOnWeekends,\r\n isSendUnassignedAfterFirstReminderOnWeekends: config.isSendUnassignedAfterFirstReminderOnWeekends,\r\n periodAfterFirstUnassignedReminder: config.periodAfterFirstUnassignedReminder\r\n ? { value: config.periodAfterFirstUnassignedReminder, label: config.periodAfterFirstUnassignedReminder }\r\n : formState.periodAfterFirstUnassignedReminder,\r\n periodBeforeFirstUnassignedReminder: config.periodBeforeFirstUnassignedReminder\r\n ? { value: config.periodBeforeFirstUnassignedReminder, label: config.periodBeforeFirstUnassignedReminder }\r\n : formState.periodBeforeFirstUnassignedReminder,\r\n isLocationFieldMandatory: config.isLocationFieldMandatory,\r\n isNatureOfEnquiryMandatory: config.isNatureOfEnquiryMandatory,\r\n isInternalNotesMandatory: config.isInternalNotesMandatory,\r\n isEventAndCampaignMandatory: config.isEventAndCampaignMandatory,\r\n isSourceNotesMandatory: config.isSourceNotesMandatory,\r\n periodMeetingDefaultReminder: config.periodMeetingDefaultReminder\r\n ? { value: config.periodMeetingDefaultReminder, label: config.periodMeetingDefaultReminder }\r\n : formState.periodMeetingDefaultReminder,\r\n isSendMeetingDefaultReminderEmail: config.isSendMeetingDefaultReminderEmail,\r\n isSendMeetingDefaultReminderSms: config.isSendMeetingDefaultReminderSms\r\n };\r\n });\r\n setState((prevState) => {\r\n\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: FormState) => {\r\n // tslint:disable-next-line: no-console\r\n // console.log('submit', values);\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onSubmitLoading: true,\r\n };\r\n });\r\n\r\n client\r\n .mutate({\r\n mutation: UpdateEnquiryDefaultConfigMutation,\r\n variables: {\r\n isManualEntry: values.dueDateOption === 'isManualEntry',\r\n isCalculatedDays: values.dueDateOption === 'isCalculatedDays',\r\n isCalculatedHours: values.dueDateOption === 'isCalculatedHours',\r\n timeOfDay: moment(values.timeOfDay).format('HH:mm'),\r\n addDays: values.addDays,\r\n addHours: values.addHours,\r\n defaultMeetingLength: moment(values.defaultMeetingLength).format('HH:mm'),\r\n reminder: values.reminder ? values.reminder.value : 'None',\r\n overdueReminder: values.overdueReminder ? values.overdueReminder.value : 'None',\r\n isSendReminderOnWeekend: values.isSendReminderOnWeekend,\r\n isSendInvitationToAssignee: values.isSendInvitationToAssignee,\r\n isSendInvitationToEnquirer: values.isSendInvitationToEnquirer,\r\n isSendReminderOnWeekendForOverDueReminders: values.isSendReminderOnWeekendForOverDueReminders,\r\n isSendFistUnassignedReminderOnWeekends: values.isSendFistUnassignedReminderOnWeekends,\r\n isSendUnassignedAfterFirstReminderOnWeekends: values.isSendUnassignedAfterFirstReminderOnWeekends,\r\n periodAfterFirstUnassignedReminder: values.periodAfterFirstUnassignedReminder ? values.periodAfterFirstUnassignedReminder.value : 'None',\r\n periodBeforeFirstUnassignedReminder: values.periodBeforeFirstUnassignedReminder ? values.periodBeforeFirstUnassignedReminder.value : 'None',\r\n isLocationFieldMandatory: values.isLocationFieldMandatory,\r\n isNatureOfEnquiryMandatory: values.isNatureOfEnquiryMandatory,\r\n isInternalNotesMandatory: values.isInternalNotesMandatory,\r\n isEventAndCampaignMandatory: values.isEventAndCampaignMandatory,\r\n isSourceNotesMandatory: values.isSourceNotesMandatory,\r\n periodMeetingDefaultReminder: values.periodMeetingDefaultReminder ? values.periodMeetingDefaultReminder.value : 'None',\r\n isSendMeetingDefaultReminderEmail: values.isSendMeetingDefaultReminderEmail,\r\n isSendMeetingDefaultReminderSms: values.isSendMeetingDefaultReminderSms\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n }); \r\n\r\n // reset the field and set to the current changes after saved.\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset(values);\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update enquiry default', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const RadioComp = (compProps: any) => {\r\n\r\n const { input } = compProps; \r\n return (\r\n }\r\n />\r\n );\r\n };\r\n\r\n return (\r\n \r\n
\r\n {state.isLoading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n ) => onSubmit(form, values)}\r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{ submitting: true, pristine: true }}\r\n validate={(values: FormState) => {\r\n let errors = {\r\n addDays: '',\r\n addHours: '',\r\n };\r\n\r\n if (values.addDays && values.addDays < 0) {\r\n errors.addDays = 'Negative value is not allowed';\r\n }\r\n\r\n if (values.addHours && values.addHours < 0) {\r\n errors.addHours = 'Negative value is not allowed';\r\n }\r\n\r\n if (errors.addDays === '' && errors.addHours === '') {\r\n return undefined;\r\n }\r\n\r\n return errors;\r\n }}\r\n // debug={(values) => {\r\n // // tslint:disable-next-line: no-console\r\n // console.log('debug', values);\r\n // }}\r\n render={({ handleSubmit, form, submitting, pristine, values }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n\r\n \r\n \r\n \r\n } aria-controls=\"panel1a-content\">\r\n Due Dates Default\r\n \r\n \r\n All fields are optional. If none are provided, the RedView defaults are used\r\n \r\n Due Date Options\r\n \r\n }\r\n value={'isManualEntry'}\r\n label=\"Manual Entry\"\r\n />\r\n }\r\n value={'isCalculatedDays'}\r\n label=\"Calculated Days\"\r\n />\r\n }\r\n value={'isCalculatedHours'}\r\n label=\"Calculated Hours\"\r\n />\r\n \r\n \r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n <>\r\n {values.dueDateOption === 'isManualEntry' && (\r\n
\r\n \r\n {({ input, meta }) => (\r\n }\r\n InputLabelProps={{ shrink: true }}\r\n />\r\n )}\r\n \r\n
\r\n )}\r\n {values.dueDateOption === 'isCalculatedDays' && (\r\n
\r\n
\r\n Add\r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n of working days to the current/time\r\n
\r\n
\r\n Optionally set time to \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n
\r\n
\r\n )}\r\n {values.dueDateOption === 'isCalculatedHours' && (\r\n
\r\n
\r\n Add\r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n to the current date/time\r\n
\r\n
\r\n )}\r\n \r\n )}\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n \r\n } aria-controls=\"panel1a-content\">\r\n Follow Up Reminders\r\n \r\n \r\n \r\n \r\n These fields define when reminders will be sent for enquiries.\r\n \r\n \r\n
\r\n
\r\n
\r\n Set default reminder to\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={meta.error && meta.touched ? meta.error : ''}\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n before follow up due\r\n
\r\n
\r\n
\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send on Weekends\"\r\n />\r\n )}\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n Send repeat reminders every\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={meta.error && meta.touched ? meta.error : ''}\r\n size=\"small\"\r\n isNoZeroMinutes={true}\r\n />\r\n )}\r\n \r\n after follow up is due\r\n
\r\n
\r\n
\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send on Weekends\"\r\n />\r\n )}\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n \r\n } aria-controls=\"panel1a-content\">\r\n Unassigned Enquiry Notification\r\n \r\n \r\n \r\n \r\n \r\n These fields define when notifications will be sent for enquiries that remain unassigned. The delivery rules for the\r\n notifications are defined in Email Templates > Unassigned Enquiry Notification\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n Send your notification\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={meta.error && meta.touched ? meta.error : ''}\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n after remaining unassigned\r\n
\r\n
\r\n
\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send on Weekends\"\r\n />\r\n )}\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n Send repeat reminders every\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={meta.error && meta.touched ? meta.error : ''}\r\n size=\"small\"\r\n isNoZeroMinutes={true}\r\n />\r\n )}\r\n \r\n after the first notifications\r\n
\r\n
\r\n
\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send on Weekends\"\r\n />\r\n )}\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n {/* \r\n \r\n }\r\n aria-controls=\"panel1a-content\"\r\n >\r\n Follow Up Reminder Default\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send reminder on weekend\" \r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n Send reminder\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={\r\n meta.error &&\r\n meta.touched\r\n ? meta.error\r\n : ''\r\n }\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n before follow up due\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
*/}\r\n\r\n {/* \r\n \r\n }\r\n aria-controls=\"panel1a-content\"\r\n >\r\n Follow Up Overdue Reminder Default\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send reminder on weekend\" \r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n Send overdue reminder\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={\r\n meta.error &&\r\n meta.touched\r\n ? meta.error\r\n : ''\r\n }\r\n size=\"small\"\r\n isNoZeroMinutes={true}\r\n />\r\n )}\r\n \r\n after follow up due\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
*/}\r\n\r\n \r\n \r\n } aria-controls=\"panel1a-content\">\r\n Meeting Defaults\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send confirmation email to staff member\"\r\n />\r\n )}\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send confirmation email to enquirer\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n Default meeting length\r\n \r\n {({ input, meta }) => (\r\n }\r\n required={true}\r\n />\r\n )}\r\n \r\n
\r\n
\r\n
\r\n
\r\n Set default reminder to\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={meta.error && meta.touched ? meta.error : ''}\r\n size=\"small\"\r\n isNoZeroMinutes={true}\r\n />\r\n )}\r\n \r\n
\r\n
\r\n \r\n \r\n Default send reminder options: \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Email\"\r\n />\r\n )}\r\n \r\n {UserFeature.HasAccess(UserFeatureEnum.hasSmsIntegration) &&\r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"SMS\"\r\n />\r\n )}\r\n \r\n }\r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n } aria-controls=\"panel1a-content\">\r\n Mandatory Fields\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Location\"\r\n />\r\n )}\r\n \r\n\r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Source Notes\"\r\n />\r\n )}\r\n \r\n\r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Internal Notes\"\r\n />\r\n )}\r\n \r\n\r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Event and Campaign\"\r\n />\r\n )}\r\n \r\n\r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Nature of Enquiry\"\r\n />\r\n )}\r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n )}\r\n
\r\n
\r\n );\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\n// export function printJson(values: any) {\r\n// if (values) {\r\n// return (\r\n// <>\r\n//
\r\n//                     {JSON.stringify(values, undefined, 2)}\r\n//                 
\r\n// \r\n// );\r\n// } else {\r\n// return (\r\n// <>\r\n// \r\n// {/* tslint:disable-next-line: no-shadowed-variable */}\r\n// {({ values }) => (\r\n//
\r\n//                             {JSON.stringify(values, undefined, 2)}\r\n//                             {/*  */}\r\n//                         
\r\n// )}\r\n//
\r\n// \r\n// );\r\n// }\r\n// }\r\n","import React, { useState } from 'react';\r\n// import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { Autocomplete, RenderInputParams } from '@material-ui/lab';\r\nimport { TextField, CircularProgress } from '@material-ui/core';\r\nimport match from 'autosuggest-highlight/match';\r\nimport parse from 'autosuggest-highlight/parse';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\n\r\n// const useStyles = makeStyles((theme: Theme) =>\r\n// createStyles({\r\n// root: {\r\n// minWidth: '150px',\r\n// },\r\n// })\r\n// );\r\n\r\ninterface PasswordStrengthItem {\r\n value: number;\r\n label: string;\r\n}\r\n\r\ninterface PassowrdStrengtthSelectorProps {\r\n disabled?: boolean;\r\n required?: boolean;\r\n multiple?: boolean;\r\n // tslint:disable-next-line: no-any\r\n value?: PasswordStrengthItem | any; // value only available in single select\r\n error?: boolean;\r\n onSelection?: (value?: IAutoCompleteItem | IAutoCompleteItem[], name?: string) => void;\r\n className?: string;\r\n helperText?: string;\r\n name?: string;\r\n label?: string;\r\n style?: React.CSSProperties; \r\n disablePortal?: boolean;\r\n size?: 'small' | 'medium';\r\n}\r\n\r\ninterface PassowrdStrengtthSelectorState {\r\n isLoading: boolean;\r\n data: PasswordStrengthItem[];\r\n}\r\n\r\nexport const PassowrdStrengtthSelector: React.FC = props => {\r\n\r\n // const classes = useStyles();\r\n\r\n const [state] = useState({\r\n isLoading: false,\r\n data: [\r\n {\r\n label: 'Basic',\r\n value: 1\r\n },\r\n {\r\n label: 'Good',\r\n value: 2\r\n },\r\n {\r\n label: 'Strong',\r\n value: 3\r\n },\r\n {\r\n label: 'Stronger',\r\n value: 4\r\n },\r\n {\r\n label: 'Very Strong',\r\n value: 5\r\n }\r\n ],\r\n });\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleChange = (event: React.ChangeEvent<{}>, value: any) => {\r\n if (props.onSelection) {\r\n props.onSelection(value, props.name);\r\n }\r\n };\r\n\r\n const getInputProps = (params: RenderInputParams, isLoading?: boolean) => {\r\n return ({ \r\n ...params.InputProps,\r\n endAdornment: (\r\n \r\n {isLoading ? : null}\r\n {params.InputProps.endAdornment}\r\n \r\n ), \r\n });\r\n };\r\n\r\n return (\r\n <>\r\n { props.multiple ? \r\n (\r\n option.label} \r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderInput={params => (\r\n \r\n )}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderOption={(option, { inputValue }) => {\r\n const matches = match(option.label, inputValue);\r\n const parts = parse(option.label, matches);\r\n \r\n return (\r\n
\r\n {parts.map((part, index) => (\r\n \r\n {part.text}\r\n \r\n ))}\r\n
\r\n );\r\n }}\r\n />\r\n )\r\n :\r\n (\r\n option.label} \r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderInput={params => (\r\n \r\n )}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderOption={(option, { inputValue }) => {\r\n const matches = match(option.label, inputValue);\r\n const parts = parse(option.label, matches);\r\n \r\n return (\r\n
\r\n {parts.map((part, index) => (\r\n \r\n {part.text}\r\n \r\n ))}\r\n
\r\n );\r\n }}\r\n />\r\n )\r\n }\r\n \r\n );\r\n};","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { Button, createStyles, FormControlLabel, FormGroup, Grid, makeStyles, Switch, TextField, Theme } from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport gql from 'graphql-tag';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { useMutation, useQuery } from 'react-apollo';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport { showNotification } from '../../App';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport { StrengthEnum } from '../../components/PasswordStrengthIndicator';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { PassowrdStrengtthSelector } from '../selectors/PassowrdStrengtthSelector';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n textField: {\r\n width: '100%'\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n formGroup: {\r\n alignItems: 'flex-start',\r\n '& .MuiFormControlLabel-root': {\r\n marginLeft: 0,\r\n }\r\n }\r\n })\r\n);\r\n\r\ninterface FormState {\r\n mFA: boolean;\r\n passwordStrength: {label: string, value: number} | null;\r\n passwordLength: number;\r\n}\r\ninterface SecurityTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function SecurityTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: true,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n mFA: false,\r\n passwordStrength: null,\r\n passwordLength: 0,\r\n });\r\n\r\n const applicationSecuritySettings = useQuery(APPLICATION_SECURITY_SETTINGS_QUERY);\r\n\r\n // tslint:disable-next-line: no-any\r\n const [updateApplicationSecuritySettings] = useMutation(APPLICATION_SECURITY_SETTINGS_MUTATION);\r\n\r\n useEffect(() => {\r\n \r\n // tslint:disable-next-line: max-line-length\r\n if (!applicationSecuritySettings.loading && applicationSecuritySettings.data) {\r\n\r\n const { \r\n mFA,\r\n passwordLength,\r\n passwordStrength,\r\n } = applicationSecuritySettings.data.settings.systems.applicationSecuritySettings.config;\r\n\r\n // console.log('test', applicationSecuritySettings.data);\r\n\r\n setFormState((prevFormState) => {\r\n return {\r\n ...prevFormState,\r\n mFA: mFA,\r\n passwordLength: passwordLength,\r\n passwordStrength: getPasswordStrength(passwordStrength),\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n }\r\n }, [applicationSecuritySettings.data, applicationSecuritySettings.loading]);\r\n\r\n const getPasswordStrength = (_value: StrengthEnum): { label: string, value: number } | null => {\r\n if (_value === StrengthEnum.ONE) {\r\n return {\r\n label: 'Basic',\r\n value: StrengthEnum.ONE\r\n };\r\n } \r\n if (_value === StrengthEnum.TWO) {\r\n return {\r\n label: 'Good',\r\n value: StrengthEnum.TWO\r\n };\r\n } \r\n if (_value === StrengthEnum.THREE) {\r\n return {\r\n label: 'Strong',\r\n value: StrengthEnum.THREE\r\n };\r\n } \r\n if (_value === StrengthEnum.FOUR) {\r\n return {\r\n label: 'Stronger',\r\n value: StrengthEnum.FOUR\r\n };\r\n } \r\n if (_value === StrengthEnum.FIVE) {\r\n return {\r\n label: 'Very Strong',\r\n value: StrengthEnum.FIVE\r\n };\r\n } \r\n return null;\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: AnyObject) => {\r\n // console.log('submit');\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onSubmitLoading: true,\r\n };\r\n });\r\n\r\n updateApplicationSecuritySettings({\r\n variables: {\r\n mFA: values.mFA,\r\n passwordStrength: values.passwordStrength ? values.passwordStrength.value : 0, \r\n passwordLength: values.passwordLength\r\n }\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n\r\n const tempInitial: FormState = {\r\n mFA: values.mFA,\r\n passwordStrength: values.passwordStrength,\r\n passwordLength: values.passwordLength\r\n };\r\n\r\n form.batch(() => {\r\n form.reset(tempInitial);\r\n });\r\n \r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update application security settings', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n });\r\n };\r\n\r\n return (\r\n
\r\n {state.isLoading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n ) => onSubmit(form, values)} \r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{\r\n submitting: true,\r\n pristine: true\r\n }}\r\n render={({\r\n handleSubmit,\r\n form,\r\n submitting,\r\n pristine,\r\n values\r\n }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n }\r\n label=\"Multi-Factor Authentication\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n input.onChange(selection)\r\n }\r\n />\r\n )}\r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n )}\r\n
\r\n );\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport function printJson(values: any) {\r\n if (values) {\r\n return (\r\n <>\r\n
\r\n                    {JSON.stringify(values, undefined, 2)}\r\n                
\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n
\r\n                            {JSON.stringify(values, undefined, 2)}\r\n                            {/*  */}\r\n                        
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nexport interface ApplicationSecuritySettingsData {\r\n settings: Settings;\r\n}\r\n\r\nexport interface Settings {\r\n id: number;\r\n systems: Systems;\r\n}\r\n\r\nexport interface Systems {\r\n applicationSecuritySettings: ApplicationSecuritySettings;\r\n}\r\n\r\nexport interface ApplicationSecuritySettings {\r\n id: number;\r\n config: Config;\r\n}\r\n\r\nexport interface Config {\r\n id: number;\r\n mFA: boolean;\r\n passwordLength: number;\r\n passwordStrength: number;\r\n}\r\n\r\nconst APPLICATION_SECURITY_SETTINGS_QUERY = gql`\r\n query ApplicationSecuritySettings {\r\n settings {\r\n id\r\n systems {\r\n applicationSecuritySettings {\r\n id\r\n config {\r\n id\r\n mFA\r\n passwordLength\r\n passwordStrength\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\ninterface ApplicationSecuritySettingsMutationParams {\r\n passwordLength: number | null;\r\n passwordStrength: number | null;\r\n mFA: Boolean;\r\n}\r\n\r\nconst APPLICATION_SECURITY_SETTINGS_MUTATION = gql`\r\n mutation ApplicationSecuritySettingsMutation(\r\n $mFA: Boolean,\r\n $passwordStrength: Int,\r\n $passwordLength: Int,\r\n ){\r\n settings {\r\n applicationSecuritySettings {\r\n update (\r\n mFA: $mFA,\r\n passwordStrength: $passwordStrength,\r\n passwordLength: $passwordLength,\r\n ) {\r\n status\r\n error\r\n }\r\n }\r\n }\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { Button, createStyles, Grid, makeStyles, TextField, Theme } from '@material-ui/core';\r\nimport { FetchPolicy } from 'apollo-client';\r\nimport { FormApi } from 'final-form';\r\nimport gql from 'graphql-tag';\r\n// import { DropzoneArea } from 'material-ui-dropzone';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport { client } from '../..';\r\nimport { showNotification } from '../../App';\r\nimport { RvLoader } from '../../components/Loader';\r\n// import { DocumentFile } from '../../types/DocumentFile';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n textField: {\r\n width: '100%'\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n formGroup: {\r\n alignItems: 'flex-start',\r\n '& .MuiFormControlLabel-root': {\r\n marginLeft: 0,\r\n }\r\n }\r\n })\r\n);\r\n\r\ninterface FormState {\r\n firmName: string | null;\r\n firmAddress: string | null;\r\n firmPhone: string | null;\r\n firmWebsite: string | null;\r\n firmEmailContact: string | null;\r\n firmHelpDeskContact: string | null;\r\n // alternativeLogo: DocumentFile[];\r\n}\r\ninterface FirmDetailsTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function FirmDetailsTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: true,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n firmName: null,\r\n firmAddress: null,\r\n firmPhone: null,\r\n firmWebsite: null,\r\n firmEmailContact: null,\r\n firmHelpDeskContact: null,\r\n // alternativeLogo: []\r\n });\r\n\r\n useEffect(() => {\r\n fetchData();\r\n // tslint:disable-next-line: align\r\n }, []);\r\n \r\n const fetchData = () => {\r\n retrieveFirmDetailsConfigData(\r\n true,\r\n (data: FirmDetailsConfigData) => onFirmDetailsConfigRetrieved(data),\r\n // tslint:disable-next-line: no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onFirmDetailsConfigRetrieved = (data: FirmDetailsConfigData) => {\r\n if (data && data.settings && data.settings.systems && data.settings.systems.firmDetails && data.settings.systems.firmDetails.config) {\r\n\r\n const config = data.settings.systems.firmDetails.config;\r\n\r\n setFormState((prevFormState) => {\r\n return {\r\n ...prevFormState,\r\n firmName: config.firmName,\r\n firmAddress: config.firmAddress,\r\n firmPhone: config.firmPhone,\r\n firmWebsite: config.firmWebsite,\r\n firmEmailContact: config.firmEmailContact,\r\n firmHelpDeskContact: config.firmHelpDeskContact,\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n }\r\n };\r\n\r\n // const onTextFieldChange = (event: React.ChangeEvent) => {\r\n // const value = event.target.value;\r\n // const name = event.target.name;\r\n\r\n // setState((prevState) => {\r\n // return {\r\n // ...prevState,\r\n // [name]: value\r\n // };\r\n // });\r\n \r\n // };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const required = (value: any) => {\r\n return value ? undefined : 'Required';\r\n };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: AnyObject) => {\r\n\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: true\r\n };\r\n });\r\n\r\n client\r\n .mutate({\r\n mutation: UpdateFirmDetailsMutation,\r\n variables: {\r\n firmName: values.firmName,\r\n firmAddress: values.firmAddress,\r\n firmPhone: values.firmPhone,\r\n firmWebsite: values.firmWebsite,\r\n firmEmailContact: values.firmEmailContact,\r\n firmHelpDeskContact: values.firmHelpDeskContact\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n }); \r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update firm details', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n });\r\n };\r\n\r\n return (\r\n
\r\n {state.isLoading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n ) => onSubmit(form, values)} \r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{\r\n submitting: true,\r\n pristine: true\r\n }}\r\n render={({\r\n handleSubmit,\r\n form,\r\n submitting,\r\n pristine,\r\n values\r\n }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n {/* \r\n \r\n {({ input, meta }) => (\r\n {\r\n let existingFiles: DocumentFile[] = [...input.value];\r\n const newFiles = files.filter((file: File) => {\r\n return !existingFiles.some((item: DocumentFile) => {\r\n return item.name === file.name && item.status !== 2;\r\n });\r\n });\r\n if (newFiles && newFiles.length > 0) {\r\n newFiles.forEach((file: File) => {\r\n const documentFile: DocumentFile = {\r\n guidID: null,\r\n file: file,\r\n status: 1,\r\n name: file.name,\r\n url: ''\r\n };\r\n existingFiles.push(documentFile);\r\n }); \r\n input.onChange(existingFiles);\r\n }\r\n }}\r\n onDelete={(file: File) => {\r\n let existingFiles: DocumentFile[] = [...input.value];\r\n // eslint-disable-next-line array-callback-return\r\n existingFiles.map((item: DocumentFile) => {\r\n if (file.name === item.name) {\r\n item.file = file;\r\n item.status = 2; // deleted\r\n }\r\n }); \r\n // tslint:disable-next-line: max-line-length\r\n const filteredFiles = existingFiles.filter((item: DocumentFile) => {\r\n return item.status !== 2 || item.guidID !== null;\r\n });\r\n input.onChange(filteredFiles);\r\n }} \r\n // tslint:disable-next-line:no-any\r\n onDrop={(files: File[], event: any) => {\r\n // let existingFiles: DocumentFile[] = [...input.value];\r\n // tslint:disable-next-line: max-line-length\r\n // const existingFile = existingFiles.find((item: DocumentFile) => item.name === file)\r\n // tslint:disable-next-line:no-console\r\n console.log(event);\r\n }} \r\n initialFiles={input.value.map((file: { url: string; }) => file.url)}\r\n dropzoneText=\"Alternate Mobile App Logo\"\r\n />\r\n )}\r\n \r\n */}\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n )}\r\n
\r\n );\r\n}\r\n\r\nexport function retrieveFirmDetailsConfigData(\r\n refreshData: boolean,\r\n onSuccess: (data: FirmDetailsConfigData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void)\r\n : void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n\r\n client.query({\r\n query: FirmDetailsConfigQuery,\r\n variables: {},\r\n fetchPolicy: fetchPolicy\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any; }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any ) => { onError(reason); });\r\n}\r\n\r\nexport interface FirmDetailsConfigData {\r\n settings: Settings;\r\n}\r\n\r\nexport interface Settings {\r\n systems: Systems;\r\n}\r\n\r\nexport interface Systems {\r\n id: number;\r\n firmDetails: FirmDetails;\r\n}\r\n\r\nexport interface FirmDetails {\r\n id: number;\r\n config: Config;\r\n}\r\n\r\nexport interface Config {\r\n id: number;\r\n firmName: string;\r\n firmAddress: string;\r\n firmPhone: string;\r\n firmWebsite: string;\r\n firmEmailContact: string;\r\n firmHelpDeskContact: string;\r\n}\r\n\r\nexport const FirmDetailsConfigQuery = gql`\r\n query FirmDetailsConfig{\r\n settings {\r\n id,\r\n systems {\r\n id,\r\n firmDetails {\r\n id,\r\n config {\r\n id,\r\n firmName,\r\n firmAddress,\r\n firmPhone,\r\n firmWebsite,\r\n firmEmailContact,\r\n firmHelpDeskContact,\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nconst UpdateFirmDetailsMutation = gql`\r\n mutation updateFirmDetails(\r\n $firmName: String, \r\n $firmAddress: String, \r\n $firmPhone: String,\r\n $firmWebsite: String, \r\n $firmEmailContact: String, \r\n $firmHelpDeskContact: String\r\n ) {\r\n settings{\r\n firmDetails {\r\n update (\r\n firmName: $firmName, \r\n firmAddress: $firmAddress, \r\n firmPhone: $firmPhone,\r\n firmWebsite: $firmWebsite, \r\n firmEmailContact: $firmEmailContact, \r\n firmHelpDeskContact: $firmHelpDeskContact\r\n ) {\r\n status,\r\n error\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\n// tslint:disable-next-line: no-any\r\nexport function printJson(values: any) {\r\n if (values) {\r\n return (\r\n <>\r\n
\r\n                    {JSON.stringify(values, undefined, 2)}\r\n                
\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n
\r\n                            {JSON.stringify(values, undefined, 2)}\r\n                            {/*  */}\r\n                        
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}","export interface CountryDataInterface {\r\n countryCode: string;\r\n country: string;\r\n}\r\n\r\nexport const CountryData: CountryDataInterface[] = [\r\n { countryCode: 'BD', country: 'Bangladesh', },\r\n { countryCode: 'BE', country: 'Belgium', },\r\n { countryCode: 'BF', country: 'Burkina Faso', },\r\n { countryCode: 'BG', country: 'Bulgaria', },\r\n { countryCode: 'BA', country: 'Bosnia and Herzegovina', },\r\n { countryCode: 'BB', country: 'Barbados', },\r\n { countryCode: 'WF', country: 'Wallis and Futuna', },\r\n { countryCode: 'BL', country: 'Saint Barthelemy', },\r\n { countryCode: 'BM', country: 'Bermuda', },\r\n { countryCode: 'BN', country: 'Brunei', },\r\n { countryCode: 'BO', country: 'Bolivia', },\r\n { countryCode: 'BH', country: 'Bahrain', },\r\n { countryCode: 'BI', country: 'Burundi', },\r\n { countryCode: 'BJ', country: 'Benin', },\r\n { countryCode: 'BT', country: 'Bhutan', },\r\n { countryCode: 'JM', country: 'Jamaica', },\r\n { countryCode: 'BV', country: 'Bouvet Island', },\r\n { countryCode: 'BW', country: 'Botswana', },\r\n { countryCode: 'WS', country: 'Samoa', },\r\n { countryCode: 'BQ', country: 'Bonaire, Saint Eustatius and Saba ', },\r\n { countryCode: 'BR', country: 'Brazil', },\r\n { countryCode: 'BS', country: 'Bahamas', },\r\n { countryCode: 'JE', country: 'Jersey', },\r\n { countryCode: 'BY', country: 'Belarus', },\r\n { countryCode: 'BZ', country: 'Belize', },\r\n { countryCode: 'RU', country: 'Russia', },\r\n { countryCode: 'RW', country: 'Rwanda', },\r\n { countryCode: 'RS', country: 'Serbia', },\r\n { countryCode: 'TL', country: 'East Timor', },\r\n { countryCode: 'RE', country: 'Reunion', },\r\n { countryCode: 'TM', country: 'Turkmenistan', },\r\n { countryCode: 'TJ', country: 'Tajikistan', },\r\n { countryCode: 'RO', country: 'Romania', },\r\n { countryCode: 'TK', country: 'Tokelau', },\r\n { countryCode: 'GW', country: 'Guinea-Bissau', },\r\n { countryCode: 'GU', country: 'Guam', },\r\n { countryCode: 'GT', country: 'Guatemala', },\r\n { countryCode: 'GS', country: 'South Georgia and the South Sandwich Islands', },\r\n { countryCode: 'GR', country: 'Greece', },\r\n { countryCode: 'GQ', country: 'Equatorial Guinea', },\r\n { countryCode: 'GP', country: 'Guadeloupe', },\r\n { countryCode: 'JP', country: 'Japan', },\r\n { countryCode: 'GY', country: 'Guyana', },\r\n { countryCode: 'GG', country: 'Guernsey', },\r\n { countryCode: 'GF', country: 'French Guiana', },\r\n { countryCode: 'GE', country: 'Georgia', },\r\n { countryCode: 'GD', country: 'Grenada', },\r\n { countryCode: 'GB', country: 'United Kingdom', },\r\n { countryCode: 'GA', country: 'Gabon', },\r\n { countryCode: 'SV', country: 'El Salvador', },\r\n { countryCode: 'GN', country: 'Guinea', },\r\n { countryCode: 'GM', country: 'Gambia', },\r\n { countryCode: 'GL', country: 'Greenland', },\r\n { countryCode: 'GI', country: 'Gibraltar', },\r\n { countryCode: 'GH', country: 'Ghana', },\r\n { countryCode: 'OM', country: 'Oman', },\r\n { countryCode: 'TN', country: 'Tunisia', },\r\n { countryCode: 'JO', country: 'Jordan', },\r\n { countryCode: 'HR', country: 'Croatia', },\r\n { countryCode: 'HT', country: 'Haiti', },\r\n { countryCode: 'HU', country: 'Hungary', },\r\n { countryCode: 'HK', country: 'Hong Kong', },\r\n { countryCode: 'HN', country: 'Honduras', },\r\n { countryCode: 'HM', country: 'Heard Island and McDonald Islands', },\r\n { countryCode: 'VE', country: 'Venezuela', },\r\n { countryCode: 'PR', country: 'Puerto Rico', },\r\n { countryCode: 'PS', country: 'Palestinian Territory', },\r\n { countryCode: 'PW', country: 'Palau', },\r\n { countryCode: 'PT', country: 'Portugal', },\r\n { countryCode: 'SJ', country: 'Svalbard and Jan Mayen', },\r\n { countryCode: 'PY', country: 'Paraguay', },\r\n { countryCode: 'IQ', country: 'Iraq', },\r\n { countryCode: 'PA', country: 'Panama', },\r\n { countryCode: 'PF', country: 'French Polynesia', },\r\n { countryCode: 'PG', country: 'Papua New Guinea', },\r\n { countryCode: 'PE', country: 'Peru', },\r\n { countryCode: 'PK', country: 'Pakistan', },\r\n { countryCode: 'PH', country: 'Philippines', },\r\n { countryCode: 'PN', country: 'Pitcairn', },\r\n { countryCode: 'PL', country: 'Poland', },\r\n { countryCode: 'PM', country: 'Saint Pierre and Miquelon', },\r\n { countryCode: 'ZM', country: 'Zambia', },\r\n { countryCode: 'EH', country: 'Western Sahara', },\r\n { countryCode: 'EE', country: 'Estonia', },\r\n { countryCode: 'EG', country: 'Egypt', },\r\n { countryCode: 'ZA', country: 'South Africa', },\r\n { countryCode: 'EC', country: 'Ecuador', },\r\n { countryCode: 'IT', country: 'Italy', },\r\n { countryCode: 'VN', country: 'Vietnam', },\r\n { countryCode: 'SB', country: 'Solomon Islands', },\r\n { countryCode: 'ET', country: 'Ethiopia', },\r\n { countryCode: 'SO', country: 'Somalia', },\r\n { countryCode: 'ZW', country: 'Zimbabwe', },\r\n { countryCode: 'SA', country: 'Saudi Arabia', },\r\n { countryCode: 'ES', country: 'Spain', },\r\n { countryCode: 'ER', country: 'Eritrea', },\r\n { countryCode: 'ME', country: 'Montenegro', },\r\n { countryCode: 'MD', country: 'Moldova', },\r\n { countryCode: 'MG', country: 'Madagascar', },\r\n { countryCode: 'MF', country: 'Saint Martin', },\r\n { countryCode: 'MA', country: 'Morocco', },\r\n { countryCode: 'MC', country: 'Monaco', },\r\n { countryCode: 'UZ', country: 'Uzbekistan', },\r\n { countryCode: 'MM', country: 'Myanmar', },\r\n { countryCode: 'ML', country: 'Mali', },\r\n { countryCode: 'MO', country: 'Macao', },\r\n { countryCode: 'MN', country: 'Mongolia', },\r\n { countryCode: 'MH', country: 'Marshall Islands', },\r\n { countryCode: 'MK', country: 'Macedonia', },\r\n { countryCode: 'MU', country: 'Mauritius', },\r\n { countryCode: 'MT', country: 'Malta', },\r\n { countryCode: 'MW', country: 'Malawi', },\r\n { countryCode: 'MV', country: 'Maldives', },\r\n { countryCode: 'MQ', country: 'Martinique', },\r\n { countryCode: 'MP', country: 'Northern Mariana Islands', },\r\n { countryCode: 'MS', country: 'Montserrat', },\r\n { countryCode: 'MR', country: 'Mauritania', },\r\n { countryCode: 'IM', country: 'Isle of Man', },\r\n { countryCode: 'UG', country: 'Uganda', },\r\n { countryCode: 'TZ', country: 'Tanzania', },\r\n { countryCode: 'MY', country: 'Malaysia', },\r\n { countryCode: 'MX', country: 'Mexico', },\r\n { countryCode: 'IL', country: 'Israel', },\r\n { countryCode: 'FR', country: 'France', },\r\n { countryCode: 'IO', country: 'British Indian Ocean Territory', },\r\n { countryCode: 'SH', country: 'Saint Helena', },\r\n { countryCode: 'FI', country: 'Finland', },\r\n { countryCode: 'FJ', country: 'Fiji', },\r\n { countryCode: 'FK', country: 'Falkland Islands', },\r\n { countryCode: 'FM', country: 'Micronesia', },\r\n { countryCode: 'FO', country: 'Faroe Islands', },\r\n { countryCode: 'NI', country: 'Nicaragua', },\r\n { countryCode: 'NL', country: 'Netherlands', },\r\n { countryCode: 'NO', country: 'Norway', },\r\n { countryCode: 'NA', country: 'Namibia', },\r\n { countryCode: 'VU', country: 'Vanuatu', },\r\n { countryCode: 'NC', country: 'New Caledonia', },\r\n { countryCode: 'NE', country: 'Niger', },\r\n { countryCode: 'NF', country: 'Norfolk Island', },\r\n { countryCode: 'NG', country: 'Nigeria', },\r\n { countryCode: 'NZ', country: 'New Zealand', },\r\n { countryCode: 'NP', country: 'Nepal', },\r\n { countryCode: 'NR', country: 'Nauru', },\r\n { countryCode: 'NU', country: 'Niue', },\r\n { countryCode: 'CK', country: 'Cook Islands', },\r\n { countryCode: 'XK', country: 'Kosovo', },\r\n { countryCode: 'CI', country: 'Ivory Coast', },\r\n { countryCode: 'CH', country: 'Switzerland', },\r\n { countryCode: 'CO', country: 'Colombia', },\r\n { countryCode: 'CN', country: 'China', },\r\n { countryCode: 'CM', country: 'Cameroon', },\r\n { countryCode: 'CL', country: 'Chile', },\r\n { countryCode: 'CC', country: 'Cocos Islands', },\r\n { countryCode: 'CA', country: 'Canada', },\r\n { countryCode: 'CG', country: 'Republic of the Congo', },\r\n { countryCode: 'CF', country: 'Central African Republic', },\r\n { countryCode: 'CD', country: 'Democratic Republic of the Congo', },\r\n { countryCode: 'CZ', country: 'Czech Republic', },\r\n { countryCode: 'CY', country: 'Cyprus', },\r\n { countryCode: 'CX', country: 'Christmas Island', },\r\n { countryCode: 'CR', country: 'Costa Rica', },\r\n { countryCode: 'CW', country: 'Curacao', },\r\n { countryCode: 'CV', country: 'Cape Verde', },\r\n { countryCode: 'CU', country: 'Cuba', },\r\n { countryCode: 'SZ', country: 'Swaziland', },\r\n { countryCode: 'SY', country: 'Syria', },\r\n { countryCode: 'SX', country: 'Sint Maarten', },\r\n { countryCode: 'KG', country: 'Kyrgyzstan', },\r\n { countryCode: 'KE', country: 'Kenya', },\r\n { countryCode: 'SS', country: 'South Sudan', },\r\n { countryCode: 'SR', country: 'Suriname', },\r\n { countryCode: 'KI', country: 'Kiribati', },\r\n { countryCode: 'KH', country: 'Cambodia', },\r\n { countryCode: 'KN', country: 'Saint Kitts and Nevis', },\r\n { countryCode: 'KM', country: 'Comoros', },\r\n { countryCode: 'ST', country: 'Sao Tome and Principe', },\r\n { countryCode: 'SK', country: 'Slovakia', },\r\n { countryCode: 'KR', country: 'South Korea', },\r\n { countryCode: 'SI', country: 'Slovenia', },\r\n { countryCode: 'KP', country: 'North Korea', },\r\n { countryCode: 'KW', country: 'Kuwait', },\r\n { countryCode: 'SN', country: 'Senegal', },\r\n { countryCode: 'SM', country: 'San Marino', },\r\n { countryCode: 'SL', country: 'Sierra Leone', },\r\n { countryCode: 'SC', country: 'Seychelles', },\r\n { countryCode: 'KZ', country: 'Kazakhstan', },\r\n { countryCode: 'KY', country: 'Cayman Islands', },\r\n { countryCode: 'SG', country: 'Singapore', },\r\n { countryCode: 'SE', country: 'Sweden', },\r\n { countryCode: 'SD', country: 'Sudan', },\r\n { countryCode: 'DO', country: 'Dominican Republic', },\r\n { countryCode: 'DM', country: 'Dominica', },\r\n { countryCode: 'DJ', country: 'Djibouti', },\r\n { countryCode: 'DK', country: 'Denmark', },\r\n { countryCode: 'VG', country: 'British Virgin Islands', },\r\n { countryCode: 'DE', country: 'Germany', },\r\n { countryCode: 'YE', country: 'Yemen', },\r\n { countryCode: 'DZ', country: 'Algeria', },\r\n { countryCode: 'US', country: 'United States', },\r\n { countryCode: 'UY', country: 'Uruguay', },\r\n { countryCode: 'YT', country: 'Mayotte', },\r\n { countryCode: 'UM', country: 'United States Minor Outlying Islands', },\r\n { countryCode: 'LB', country: 'Lebanon', },\r\n { countryCode: 'LC', country: 'Saint Lucia', },\r\n { countryCode: 'LA', country: 'Laos', },\r\n { countryCode: 'TV', country: 'Tuvalu', },\r\n { countryCode: 'TW', country: 'Taiwan', },\r\n { countryCode: 'TT', country: 'Trinidad and Tobago', },\r\n { countryCode: 'TR', country: 'Turkey', },\r\n { countryCode: 'LK', country: 'Sri Lanka', },\r\n { countryCode: 'LI', country: 'Liechtenstein', },\r\n { countryCode: 'LV', country: 'Latvia', },\r\n { countryCode: 'TO', country: 'Tonga', },\r\n { countryCode: 'LT', country: 'Lithuania', },\r\n { countryCode: 'LU', country: 'Luxembourg', },\r\n { countryCode: 'LR', country: 'Liberia', },\r\n { countryCode: 'LS', country: 'Lesotho', },\r\n { countryCode: 'TH', country: 'Thailand', },\r\n { countryCode: 'TF', country: 'French Southern Territories', },\r\n { countryCode: 'TG', country: 'Togo', },\r\n { countryCode: 'TD', country: 'Chad', },\r\n { countryCode: 'TC', country: 'Turks and Caicos Islands', },\r\n { countryCode: 'LY', country: 'Libya', },\r\n { countryCode: 'VA', country: 'Vatican', },\r\n { countryCode: 'VC', country: 'Saint Vincent and the Grenadines', },\r\n { countryCode: 'AE', country: 'United Arab Emirates', },\r\n { countryCode: 'AD', country: 'Andorra', },\r\n { countryCode: 'AG', country: 'Antigua and Barbuda', },\r\n { countryCode: 'AF', country: 'Afghanistan', },\r\n { countryCode: 'AI', country: 'Anguilla', },\r\n { countryCode: 'VI', country: 'U.S. Virgin Islands', },\r\n { countryCode: 'IS', country: 'Iceland', },\r\n { countryCode: 'IR', country: 'Iran', },\r\n { countryCode: 'AM', country: 'Armenia', },\r\n { countryCode: 'AL', country: 'Albania', },\r\n { countryCode: 'AO', country: 'Angola', },\r\n { countryCode: 'AQ', country: 'Antarctica', },\r\n { countryCode: 'AS', country: 'American Samoa', },\r\n { countryCode: 'AR', country: 'Argentina', },\r\n { countryCode: 'AU', country: 'Australia', },\r\n { countryCode: 'AT', country: 'Austria', },\r\n { countryCode: 'AW', country: 'Aruba', },\r\n { countryCode: 'IN', country: 'India', },\r\n { countryCode: 'AX', country: 'Aland Islands', },\r\n { countryCode: 'AZ', country: 'Azerbaijan', },\r\n { countryCode: 'IE', country: 'Ireland', },\r\n { countryCode: 'ID', country: 'Indonesia', },\r\n { countryCode: 'UA', country: 'Ukraine', },\r\n { countryCode: 'QA', country: 'Qatar', },\r\n { countryCode: 'MZ', country: 'Mozambique' },\r\n];","import React, { useState } from 'react';\r\n// import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { Autocomplete, RenderInputParams } from '@material-ui/lab';\r\nimport { TextField, CircularProgress } from '@material-ui/core';\r\nimport match from 'autosuggest-highlight/match';\r\nimport parse from 'autosuggest-highlight/parse';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport _ from 'lodash';\r\nimport { CountryData, CountryDataInterface } from '../common/CountryData';\r\n\r\n// const useStyles = makeStyles((theme: Theme) =>\r\n// createStyles({\r\n// root: {\r\n// minWidth: '150px',\r\n// },\r\n// })\r\n// );\r\n\r\ninterface CountrySelectorProps {\r\n disabled?: boolean;\r\n required?: boolean;\r\n // tslint:disable-next-line: no-any\r\n value?: IAutoCompleteItem | any; // value only available in single select\r\n error?: boolean;\r\n onSelection?: (value?: IAutoCompleteItem | IAutoCompleteItem[], name?: string) => void;\r\n className?: string;\r\n helperText?: string;\r\n name?: string;\r\n label?: string;\r\n style?: React.CSSProperties; \r\n disablePortal?: boolean;\r\n size?: 'small' | 'medium';\r\n}\r\n\r\ninterface CountrySelectorState {\r\n isLoading: boolean;\r\n data: IAutoCompleteItem[];\r\n}\r\n\r\nexport const CountrySelector: React.FC = props => {\r\n\r\n // const classes = useStyles();\r\n\r\n const [state] = useState({\r\n isLoading: false,\r\n data: _.uniqBy(CountryData, 'country').map((item: CountryDataInterface) => {\r\n return {\r\n label: item.country,\r\n value: item.country\r\n };\r\n }).sort((a, b) => a.label < b.label ? -1 : a.label > b.label ? 1 : 0)\r\n });\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleChange = (event: React.ChangeEvent<{}>, value: any) => {\r\n if (props.onSelection) {\r\n props.onSelection(value, props.name);\r\n }\r\n };\r\n\r\n const handleOnClose = (event: React.ChangeEvent<{}>) => {\r\n\r\n // tslint:disable-next-line: no-string-literal\r\n if (event.currentTarget && event.currentTarget['value']) {\r\n // tslint:disable-next-line: no-string-literal\r\n let newValue = event.currentTarget['value'];\r\n\r\n if (props.onSelection) {\r\n // tslint:disable-next-line: no-string-literal\r\n let tempValue = { value: newValue, label: newValue };\r\n props.onSelection(tempValue, props.name);\r\n }\r\n }\r\n };\r\n\r\n const getInputProps = (params: RenderInputParams, isLoading?: boolean) => {\r\n return ({ \r\n ...params.InputProps,\r\n endAdornment: (\r\n \r\n {isLoading ? : null}\r\n {params.InputProps.endAdornment}\r\n \r\n ), \r\n });\r\n };\r\n\r\n return (\r\n option.label} \r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderInput={params => (\r\n \r\n )}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderOption={(option, { inputValue }) => {\r\n const matches = match(option.label, inputValue);\r\n const parts = parse(option.label, matches);\r\n \r\n return (\r\n
\r\n {parts.map((part, index) => (\r\n \r\n {part.text}\r\n \r\n ))}\r\n
\r\n );\r\n }}\r\n />\r\n );\r\n};","import React, { useState } from 'react';\r\n// import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { Autocomplete, RenderInputParams } from '@material-ui/lab';\r\nimport { TextField, CircularProgress } from '@material-ui/core';\r\nimport match from 'autosuggest-highlight/match';\r\nimport parse from 'autosuggest-highlight/parse';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { CurrenciesData, CurrencyDataProps } from '../common/Currencies';\r\nimport _ from 'lodash';\r\n\r\n// const useStyles = makeStyles((theme: Theme) =>\r\n// createStyles({\r\n// root: {\r\n// minWidth: '150px',\r\n// },\r\n// })\r\n// );\r\n\r\ninterface CurrencyCodeSelectorProps {\r\n disabled?: boolean;\r\n required?: boolean;\r\n // tslint:disable-next-line: no-any\r\n value?: IAutoCompleteItem | any; // value only available in single select\r\n error?: boolean;\r\n onSelection?: (value?: IAutoCompleteItem | IAutoCompleteItem[], name?: string) => void;\r\n className?: string;\r\n helperText?: string;\r\n name?: string;\r\n label?: string;\r\n style?: React.CSSProperties; \r\n disablePortal?: boolean;\r\n size?: 'small' | 'medium';\r\n}\r\n\r\ninterface CurrencyCodeSelectorState {\r\n isLoading: boolean;\r\n data: IAutoCompleteItem[];\r\n}\r\n\r\nexport const CurrencyCodeSelector: React.FC = props => {\r\n\r\n // const classes = useStyles();\r\n\r\n const [state] = useState({\r\n isLoading: false,\r\n data: _.uniqBy(CurrenciesData, 'currency').map((item: CurrencyDataProps) => {\r\n return {\r\n label: item.currency,\r\n value: item.currency\r\n };\r\n })\r\n });\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleChange = (event: React.ChangeEvent<{}>, value: any) => {\r\n if (props.onSelection) {\r\n props.onSelection(value, props.name);\r\n }\r\n };\r\n\r\n const handleOnClose = (event: React.ChangeEvent<{}>) => {\r\n\r\n // tslint:disable-next-line: no-string-literal\r\n if (event.currentTarget && event.currentTarget['value']) {\r\n // tslint:disable-next-line: no-string-literal\r\n let newValue = event.currentTarget['value'];\r\n\r\n if (props.onSelection) {\r\n // tslint:disable-next-line: no-string-literal\r\n let tempValue = { value: newValue, label: newValue };\r\n props.onSelection(tempValue, props.name);\r\n }\r\n }\r\n };\r\n\r\n const getInputProps = (params: RenderInputParams, isLoading?: boolean) => {\r\n return ({ \r\n ...params.InputProps,\r\n endAdornment: (\r\n \r\n {isLoading ? : null}\r\n {params.InputProps.endAdornment}\r\n \r\n ), \r\n });\r\n };\r\n\r\n return (\r\n option.label} \r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderInput={params => (\r\n \r\n )}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderOption={(option, { inputValue }) => {\r\n const matches = match(option.label, inputValue);\r\n const parts = parse(option.label, matches);\r\n \r\n return (\r\n
\r\n {parts.map((part, index) => (\r\n \r\n {part.text}\r\n \r\n ))}\r\n
\r\n );\r\n }}\r\n />\r\n );\r\n};","import React, { useState } from 'react';\r\n// import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { Autocomplete, RenderInputParams } from '@material-ui/lab';\r\nimport { TextField, CircularProgress } from '@material-ui/core';\r\nimport match from 'autosuggest-highlight/match';\r\nimport parse from 'autosuggest-highlight/parse';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { CurrenciesData, CurrencyDataProps } from '../common/Currencies';\r\nimport _ from 'lodash';\r\n\r\n// const useStyles = makeStyles((theme: Theme) =>\r\n// createStyles({\r\n// root: {\r\n// minWidth: '150px',\r\n// },\r\n// })\r\n// );\r\n\r\ninterface CurrencySymbolSelectorProps {\r\n disabled?: boolean;\r\n required?: boolean;\r\n multiple?: boolean;\r\n // tslint:disable-next-line: no-any\r\n value?: IAutoCompleteItem | any; // value only available in single select\r\n error?: boolean;\r\n onSelection?: (value?: IAutoCompleteItem | IAutoCompleteItem[], name?: string) => void;\r\n className?: string;\r\n helperText?: string;\r\n name?: string;\r\n label?: string;\r\n style?: React.CSSProperties; \r\n disablePortal?: boolean;\r\n size?: 'small' | 'medium';\r\n}\r\n\r\ninterface CurrencySymbolSelectorState {\r\n isLoading: boolean;\r\n data: IAutoCompleteItem[];\r\n}\r\n\r\nexport const CurrencySymbolSelector: React.FC = props => {\r\n\r\n // const classes = useStyles();\r\n\r\n const [state] = useState({\r\n isLoading: false,\r\n data: _.uniqBy(CurrenciesData, 'symbol').map((item: CurrencyDataProps) => {\r\n return {\r\n label: item.symbol,\r\n value: item.symbol\r\n };\r\n }).filter((item: IAutoCompleteItem) => item.value.length > 0)\r\n });\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleChange = (event: React.ChangeEvent<{}>, value: any) => {\r\n if (props.onSelection) {\r\n props.onSelection(value, props.name);\r\n }\r\n };\r\n\r\n const handleOnClose = (event: React.ChangeEvent<{}>) => {\r\n\r\n // tslint:disable-next-line: no-string-literal\r\n if (event.currentTarget && event.currentTarget['value']) {\r\n // tslint:disable-next-line: no-string-literal\r\n let newValue = event.currentTarget['value'];\r\n\r\n if (props.onSelection) {\r\n // tslint:disable-next-line: no-string-literal\r\n let tempValue = { value: newValue, label: newValue };\r\n props.onSelection(tempValue, props.name);\r\n }\r\n }\r\n };\r\n\r\n const getInputProps = (params: RenderInputParams, isLoading?: boolean) => {\r\n return ({ \r\n ...params.InputProps,\r\n endAdornment: (\r\n \r\n {isLoading ? : null}\r\n {params.InputProps.endAdornment}\r\n \r\n ), \r\n });\r\n };\r\n\r\n return (\r\n option.label} \r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderInput={params => (\r\n \r\n )}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderOption={(option, { inputValue }) => {\r\n const matches = match(option.label, inputValue);\r\n const parts = parse(option.label, matches);\r\n \r\n return (\r\n
\r\n {parts.map((part, index) => (\r\n \r\n {part.text}\r\n \r\n ))}\r\n
\r\n );\r\n }}\r\n />\r\n );\r\n};","export interface TimeZoneDataProps {\r\n name: string;\r\n timeZoneId: string;\r\n}\r\n\r\nexport const TimeZoneData: TimeZoneDataProps[] = [\r\n {timeZoneId: 'Dateline Standard Time', \t\t\t\tname: '(UTC -12:00) Dateline Standard Time'}\r\n , {timeZoneId: 'UTC-11', \t\t\t\t\t\t\t\tname: '(UTC -11:00) UTC-11'}\r\n , {timeZoneId: 'Aleutian Standard Time', \t\t\t\tname: '(UTC -09:00) Aleutian Standard Time'}\r\n , {timeZoneId: 'Hawaiian Standard Time',\t\t\t\tname: '(UTC -10:00) Hawaiian Standard Time'}\r\n , {timeZoneId: 'Marquesas Standard Time', \t\t\t name: '(UTC -09:30) Marquesas Standard Time'}\r\n , {timeZoneId: 'Alaskan Standard Time', \t\t\t\tname: '(UTC -08:00) Alaskan Standard Time'}\r\n , {timeZoneId: 'UTC-09', \t\t\t\t\t\t\t\tname: '(UTC -09:00) UTC-09'}\r\n , {timeZoneId: 'Pacific Standard Time (Mexico)', \t\tname: '(UTC -07:00) Pacific Standard Time (Mexico)'}\r\n , {timeZoneId: 'UTC-08', \t\t\t\t\t\t\t\tname: '(UTC -08:00) UTC-08'}\r\n , {timeZoneId: 'Pacific Standard Time', \t\t\t\tname: '(UTC -07:00) Pacific Standard Time'}\r\n , {timeZoneId: 'US Mountain Standard Time', \t\t\tname: '(UTC -07:00) US Mountain Standard Time'}\r\n , {timeZoneId: 'Mountain Standard Time (Mexico)', \t name: '(UTC -07:00) Mountain Standard Time (Mexico)'}\r\n , {timeZoneId: 'Mountain Standard Time', \t\t\t\tname: '(UTC -06:00) Mountain Standard Time'}\r\n , {timeZoneId: 'Yukon Standard Time', \t\t\t\t name: '(UTC -07:00) Yukon Standard Time'}\r\n , {timeZoneId: 'Central America Standard Time', \t\tname: '(UTC -06:00) Central America Standard Time'}\r\n , {timeZoneId: 'Central Standard Time', \t\t\t\tname: '(UTC -05:00) Central Standard Time'}\r\n , {timeZoneId: 'Easter Island Standard Time', \t\t name: '(UTC -05:00) Easter Island Standard Time'}\r\n , {timeZoneId: 'Central Standard Time (Mexico)', \t\tname: '(UTC -06:00) Central Standard Time (Mexico)'}\r\n , {timeZoneId: 'Canada Central Standard Time', \t\t name: '(UTC -06:00) Canada Central Standard Time'}\r\n , {timeZoneId: 'SA Pacific Standard Time', \t\t\t name: '(UTC -05:00) SA Pacific Standard Time'}\r\n , {timeZoneId: 'Eastern Standard Time (Mexico)', \t\tname: '(UTC -05:00) Eastern Standard Time (Mexico)'}\r\n , {timeZoneId: 'Eastern Standard Time', \t\t\t\tname: '(UTC -04:00) Eastern Standard Time'}\r\n , {timeZoneId: 'Haiti Standard Time', \t\t\t\t name: '(UTC -04:00) Haiti Standard Time'}\r\n , {timeZoneId: 'Cuba Standard Time', \t\t\t\t\tname: '(UTC -04:00) Cuba Standard Time'}\r\n , {timeZoneId: 'US Eastern Standard Time', \t\t\t name: '(UTC -04:00) US Eastern Standard Time'}\r\n , {timeZoneId: 'Turks And Caicos Standard Time', \t\tname: '(UTC -04:00) Turks And Caicos Standard Time'}\r\n , {timeZoneId: 'Paraguay Standard Time', \t\t\t\tname: '(UTC -03:00) Paraguay Standard Time'}\r\n , {timeZoneId: 'Atlantic Standard Time', \t\t\t\tname: '(UTC -03:00) Atlantic Standard Time'}\r\n , {timeZoneId: 'Venezuela Standard Time', \t\t\t name: '(UTC -04:00) Venezuela Standard Time'}\r\n , {timeZoneId: 'Central Brazilian Standard Time', \t name: '(UTC -04:00) Central Brazilian Standard Time'}\r\n , {timeZoneId: 'SA Western Standard Time', \t\t\t name: '(UTC -04:00) SA Western Standard Time'}\r\n , {timeZoneId: 'Pacific SA Standard Time', \t\t\t name: '(UTC -03:00) Pacific SA Standard Time'}\r\n , {timeZoneId: 'Newfoundland Standard Time', \t\t\tname: '(UTC -02:30) Newfoundland Standard Time'}\r\n , {timeZoneId: 'Tocantins Standard Time', \t\t\t name: '(UTC -03:00) Tocantins Standard Time'}\r\n , {timeZoneId: 'E. South America Standard Time', \t\tname: '(UTC -03:00) E. South America Standard Time'}\r\n , {timeZoneId: 'SA Eastern Standard Time', \t\t\t name: '(UTC -03:00) SA Eastern Standard Time'}\r\n , {timeZoneId: 'Argentina Standard Time', \t\t\t name: '(UTC -03:00) Argentina Standard Time'}\r\n , {timeZoneId: 'Greenland Standard Time', \t\t\t name: '(UTC -03:00) Greenland Standard Time'}\r\n , {timeZoneId: 'Montevideo Standard Time', \t\t\t name: '(UTC -03:00) Montevideo Standard Time'}\r\n , {timeZoneId: 'Magallanes Standard Time', \t\t\t name: '(UTC -03:00) Magallanes Standard Time'}\r\n , {timeZoneId: 'Saint Pierre Standard Time', \t\t\tname: '(UTC -02:00) Saint Pierre Standard Time'}\r\n , {timeZoneId: 'Bahia Standard Time', \t\t\t\t name: '(UTC -03:00) Bahia Standard Time'}\r\n , {timeZoneId: 'UTC-02', \t\t\t\t\t\t\t\tname: '(UTC -02:00) UTC-02'}\r\n , {timeZoneId: 'Mid-Atlantic Standard Time', \t\t\tname: '(UTC -02:00) Mid-Atlantic Standard Time'}\r\n , {timeZoneId: 'Azores Standard Time', \t\t\t\t name: '(UTC -01:00) Azores Standard Time'}\r\n , {timeZoneId: 'Cape Verde Standard Time', \t\t\t name: '(UTC -01:00) Cape Verde Standard Time'}\r\n , {timeZoneId: 'UTC', \t\t\t\t\t\t\t\t name: '(UTC +00:00) UTC'}\r\n , {timeZoneId: 'GMT Standard Time', \t\t\t\t\tname: '(UTC +00:00) GMT Standard Time'}\r\n , {timeZoneId: 'Greenwich Standard Time', \t\t\t name: '(UTC +00:00) Greenwich Standard Time'}\r\n , {timeZoneId: 'Sao Tome Standard Time', \t\t\t\tname: '(UTC +00:00) Sao Tome Standard Time'}\r\n , {timeZoneId: 'Morocco Standard Time',\t\t\t\t name: '(UTC +01:00) Morocco Standard Time'}\r\n , {timeZoneId: 'W. Europe Standard Time', \t\t\t name: '(UTC +01:00) W. Europe Standard Time'}\r\n , {timeZoneId: 'Central Europe Standard Time', \t\t name: '(UTC +01:00) Central Europe Standard Time'}\r\n , {timeZoneId: 'Romance Standard Time', \t\t\t\tname: '(UTC +01:00) Romance Standard Time'}\r\n , {timeZoneId: 'Central European Standard Time', \t\tname: '(UTC +01:00) Central European Standard Time'}\r\n , {timeZoneId: 'W. Central Africa Standard Time', \t name: '(UTC +01:00) W. Central Africa Standard Time'}\r\n , {timeZoneId: 'Jordan Standard Time', \t\t\t\t name: '(UTC +02:00) Jordan Standard Time'}\r\n , {timeZoneId: 'GTB Standard Time', \t\t\t\t\tname: '(UTC +02:00) GTB Standard Time'}\r\n , {timeZoneId: 'Middle East Standard Time', \t\t\tname: '(UTC +02:00) Middle East Standard Time'}\r\n , {timeZoneId: 'Egypt Standard Time', \t\t\t\t name: '(UTC +02:00) Egypt Standard Time'}\r\n , {timeZoneId: 'E. Europe Standard Time', \t\t\t name: '(UTC +02:00) E. Europe Standard Time'}\r\n , {timeZoneId: 'Syria Standard Time', \t\t\t\t name: '(UTC +02:00) Syria Standard Time'}\r\n , {timeZoneId: 'West Bank Standard Time', \t\t\t name: '(UTC +02:00) West Bank Standard Time'}\r\n , {timeZoneId: 'South Africa Standard Time', \t\t\tname: '(UTC +02:00) South Africa Standard Time'}\r\n , {timeZoneId: 'FLE Standard Time', \t\t\t\t\tname: '(UTC +02:00) FLE Standard Time'}\r\n , {timeZoneId: 'Israel Standard Time', \t\t\t\t name: '(UTC +02:00) Israel Standard Time'}\r\n , {timeZoneId: 'South Sudan Standard Time', \t\t\tname: '(UTC +02:00) South Sudan Standard Time'}\r\n , {timeZoneId: 'Kaliningrad Standard Time', \t\t\tname: '(UTC +02:00) Kaliningrad Standard Time'}\r\n , {timeZoneId: 'Sudan Standard Time', \t\t\t\t name: '(UTC +02:00) Sudan Standard Time'}\r\n , {timeZoneId: 'Libya Standard Time', \t\t\t\t name: '(UTC +02:00) Libya Standard Time'}\r\n , {timeZoneId: 'Namibia Standard Time', \t\t\t\tname: '(UTC +02:00) Namibia Standard Time'}\r\n , {timeZoneId: 'Arabic Standard Time', \t\t\t\t name: '(UTC +03:00) Arabic Standard Time'}\r\n , {timeZoneId: 'Turkey Standard Time', \t\t\t\t name: '(UTC +03:00) Turkey Standard Time'}\r\n , {timeZoneId: 'Arab Standard Time', \t\t\t\t\tname: '(UTC +03:00) Arab Standard Time'}\r\n , {timeZoneId: 'Belarus Standard Time', \t\t\t\tname: '(UTC +03:00) Belarus Standard Time'}\r\n , {timeZoneId: 'Russian Standard Time', \t\t\t\tname: '(UTC +03:00) Russian Standard Time'}\r\n , {timeZoneId: 'E. Africa Standard Time', \t\t\t name: '(UTC +03:00) E. Africa Standard Time'}\r\n , {timeZoneId: 'Volgograd Standard Time', \t\t\t name: '(UTC +03:00) Volgograd Standard Time'}\r\n , {timeZoneId: 'Iran Standard Time', \t\t\t\t\tname: '(UTC +03:30) Iran Standard Time'}\r\n , {timeZoneId: 'Arabian Standard Time', \t\t\t\tname: '(UTC +04:00) Arabian Standard Time'}\r\n , {timeZoneId: 'Astrakhan Standard Time', \t\t\t name: '(UTC +04:00) Astrakhan Standard Time'}\r\n , {timeZoneId: 'Azerbaijan Standard Time', \t\t\t name: '(UTC +04:00) Azerbaijan Standard Time'}\r\n , {timeZoneId: 'Russia Time Zone 3', \t\t\t\t\tname: '(UTC +04:00) Russia Time Zone 3'}\r\n , {timeZoneId: 'Mauritius Standard Time', \t\t\t name: '(UTC +04:00) Mauritius Standard Time'}\r\n , {timeZoneId: 'Saratov Standard Time', \t\t\t\tname: '(UTC +04:00) Saratov Standard Time'}\r\n , {timeZoneId: 'Georgian Standard Time', \t\t\t\tname: '(UTC +04:00) Georgian Standard Time'}\r\n , {timeZoneId: 'Caucasus Standard Time', \t\t\t\tname: '(UTC +04:00) Caucasus Standard Time'}\r\n , {timeZoneId: 'Afghanistan Standard Time', \t\t\tname: '(UTC +04:30) Afghanistan Standard Time'}\r\n , {timeZoneId: 'West Asia Standard Time', \t\t\t name: '(UTC +05:00) West Asia Standard Time'}\r\n , {timeZoneId: 'Ekaterinburg Standard Time', \t\t\tname: '(UTC +05:00) Ekaterinburg Standard Time'}\r\n , {timeZoneId: 'Pakistan Standard Time', \t\t\t\tname: '(UTC +05:00) Pakistan Standard Time'}\r\n , {timeZoneId: 'Qyzylorda Standard Time', \t\t\t name: '(UTC +05:00) Qyzylorda Standard Time'}\r\n , {timeZoneId: 'India Standard Time', \t\t\t\t name: '(UTC +05:30) India Standard Time'}\r\n , {timeZoneId: 'Sri Lanka Standard Time', \t\t\t name: '(UTC +05:30) Sri Lanka Standard Time'}\r\n , {timeZoneId: 'Nepal Standard Time', \t\t\t\t name: '(UTC +05:45) Nepal Standard Time'}\r\n , {timeZoneId: 'Central Asia Standard Time', \t\t\tname: '(UTC +06:00) Central Asia Standard Time'}\r\n , {timeZoneId: 'Bangladesh Standard Time', \t\t\t name: '(UTC +06:00) Bangladesh Standard Time'}\r\n , {timeZoneId: 'Omsk Standard Time', \t\t\t\t\tname: '(UTC +06:00) Omsk Standard Time'}\r\n , {timeZoneId: 'Myanmar Standard Time', \t\t\t\tname: '(UTC +06:30) Myanmar Standard Time'}\r\n , {timeZoneId: 'SE Asia Standard Time', \t\t\t\tname: '(UTC +07:00) SE Asia Standard Time'}\r\n , {timeZoneId: 'Altai Standard Time', \t\t\t\t name: '(UTC +07:00) Altai Standard Time'}\r\n , {timeZoneId: 'W. Mongolia Standard Time', \t\t\tname: '(UTC +07:00) W. Mongolia Standard Time'}\r\n , {timeZoneId: 'North Asia Standard Time', \t\t\t name: '(UTC +07:00) North Asia Standard Time'}\r\n , {timeZoneId: 'N. Central Asia Standard Time', \t\tname: '(UTC +07:00) N. Central Asia Standard Time'}\r\n , {timeZoneId: 'Tomsk Standard Time', \t\t\t\t name: '(UTC +07:00) Tomsk Standard Time'}\r\n , {timeZoneId: 'China Standard Time', \t\t\t\t name: '(UTC +08:00) China Standard Time'}\r\n , {timeZoneId: 'North Asia East Standard Time', \t\tname: '(UTC +08:00) North Asia East Standard Time'}\r\n , {timeZoneId: 'Singapore Standard Time', \t\t\t name: '(UTC +08:00) Singapore Standard Time'}\r\n , {timeZoneId: 'W. Australia Standard Time', \t\t\tname: '(UTC +08:00) W. Australia Standard Time'}\r\n , {timeZoneId: 'Taipei Standard Time', \t\t\t\t name: '(UTC +08:00) Taipei Standard Time'}\r\n , {timeZoneId: 'Ulaanbaatar Standard Time', \t\t\tname: '(UTC +08:00) Ulaanbaatar Standard Time'}\r\n , {timeZoneId: 'Aus Central W. Standard Time', \t\t name: '(UTC +08:45) Aus Central W. Standard Time'}\r\n , {timeZoneId: 'Transbaikal Standard Time', \t\t\tname: '(UTC +09:00) Transbaikal Standard Time'}\r\n , {timeZoneId: 'Tokyo Standard Time', \t\t\t\t name: '(UTC +09:00) Tokyo Standard Time'}\r\n , {timeZoneId: 'North Korea Standard Time', \t\t\tname: '(UTC +09:00) North Korea Standard Time'}\r\n , {timeZoneId: 'Korea Standard Time', \t\t\t\t name: '(UTC +09:00) Korea Standard Time'}\r\n , {timeZoneId: 'Yakutsk Standard Time', \t\t\t\tname: '(UTC +09:00) Yakutsk Standard Time'}\r\n , {timeZoneId: 'Cen. Australia Standard Time', \t\t name: '(UTC +10:30) Cen. Australia Standard Time'}\r\n , {timeZoneId: 'AUS Central Standard Time', \t\t\tname: '(UTC +09:30) AUS Central Standard Time'}\r\n , {timeZoneId: 'E. Australia Standard Time', \t\t\tname: '(UTC +10:00) E. Australia Standard Time'}\r\n , {timeZoneId: 'AUS Eastern Standard Time', \t\t\tname: '(UTC +11:00) AUS Eastern Standard Time'}\r\n , {timeZoneId: 'West Pacific Standard Time', \t\t\tname: '(UTC +10:00) West Pacific Standard Time'}\r\n , {timeZoneId: 'Tasmania Standard Time', \t\t\t\tname: '(UTC +11:00) Tasmania Standard Time'}\r\n , {timeZoneId: 'Vladivostok Standard Time', \t\t\tname: '(UTC +10:00) Vladivostok Standard Time'}\r\n , {timeZoneId: 'Lord Howe Standard Time', \t\t\t name: '(UTC +11:00) Lord Howe Standard Time'}\r\n , {timeZoneId: 'Bougainville Standard Time', \t\t\tname: '(UTC +11:00) Bougainville Standard Time'}\r\n , {timeZoneId: 'Russia Time Zone 10', \t\t\t\t name: '(UTC +11:00) Russia Time Zone 10'}\r\n , {timeZoneId: 'Magadan Standard Time', \t\t\t\tname: '(UTC +11:00) Magadan Standard Time'}\r\n , {timeZoneId: 'Norfolk Standard Time', \t\t\t\tname: '(UTC +12:00) Norfolk Standard Time'}\r\n , {timeZoneId: 'Sakhalin Standard Time', \t\t\t\tname: '(UTC +11:00) Sakhalin Standard Time'}\r\n , {timeZoneId: 'Central Pacific Standard Time', \t\tname: '(UTC +11:00) Central Pacific Standard Time'}\r\n , {timeZoneId: 'Russia Time Zone 11', \t\t\t\t name: '(UTC +12:00) Russia Time Zone 11'}\r\n , {timeZoneId: 'New Zealand Standard Time', \t\t\tname: '(UTC +13:00) New Zealand Standard Time'}\r\n , {timeZoneId: 'UTC+12', \t\t\t\t\t\t\t\tname: '(UTC +12:00) UTC+12'}\r\n , {timeZoneId: 'Fiji Standard Time', \t\t\t\t\tname: '(UTC +12:00) Fiji Standard Time'}\r\n , {timeZoneId: 'Kamchatka Standard Time', \t\t\t name: '(UTC +12:00) Kamchatka Standard Time'}\r\n , {timeZoneId: 'Chatham Islands Standard Time', \t\tname: '(UTC +13:45) Chatham Islands Standard Time'}\r\n , {timeZoneId: 'UTC+13', \t\t\t\t\t\t\t\tname: '(UTC +13:00) UTC+13'}\r\n , {timeZoneId: 'Tonga Standard Time', \t\t\t\t name: '(UTC +13:00) Tonga Standard Time'}\r\n , {timeZoneId: 'Samoa Standard Time', \t\t\t\t name: '(UTC +14:00) Samoa Standard Time'}\r\n , {timeZoneId: 'Line Islands Standard Time', \t\t\tname: '(UTC +14:00) Line Islands Standard Time'}\r\n];","import React, { useState } from 'react';\r\n// import { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { Autocomplete, RenderInputParams } from '@material-ui/lab';\r\nimport { TextField, CircularProgress } from '@material-ui/core';\r\nimport match from 'autosuggest-highlight/match';\r\nimport parse from 'autosuggest-highlight/parse';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport _ from 'lodash';\r\nimport { TimeZoneData, TimeZoneDataProps } from '../common/Timezone';\r\n\r\n// const useStyles = makeStyles((theme: Theme) =>\r\n// createStyles({\r\n// root: {\r\n// minWidth: '150px',\r\n// },\r\n// })\r\n// );\r\n\r\ninterface TimeZoneSelectorProps {\r\n disabled?: boolean;\r\n required?: boolean;\r\n multiple?: boolean;\r\n // tslint:disable-next-line: no-any\r\n value?: IAutoCompleteItem | any; // value only available in single select\r\n error?: boolean;\r\n onSelection?: (value?: IAutoCompleteItem | IAutoCompleteItem[], name?: string) => void;\r\n className?: string;\r\n helperText?: string;\r\n name?: string;\r\n label?: string;\r\n style?: React.CSSProperties; \r\n disablePortal?: boolean;\r\n size?: 'small' | 'medium';\r\n}\r\n\r\ninterface TimeZoneSelectorState {\r\n isLoading: boolean;\r\n data: IAutoCompleteItem[];\r\n}\r\n\r\nexport const TimeZoneSelector: React.FC = props => {\r\n\r\n // const classes = useStyles();\r\n\r\n const [state] = useState({\r\n isLoading: false,\r\n data: _.uniqBy(TimeZoneData, 'name').map((item: TimeZoneDataProps) => {\r\n return {\r\n label: item.name,\r\n value: item.timeZoneId\r\n };\r\n }).filter((item: IAutoCompleteItem) => item.value.length > 0)\r\n });\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleChange = (event: React.ChangeEvent<{}>, value: any) => {\r\n if (props.onSelection) {\r\n props.onSelection(value, props.name);\r\n }\r\n };\r\n\r\n const handleOnClose = (event: React.ChangeEvent<{}>) => {\r\n\r\n // tslint:disable-next-line: no-string-literal\r\n if (event.currentTarget && event.currentTarget['value']) {\r\n // tslint:disable-next-line: no-string-literal\r\n let newValue = event.currentTarget['value'];\r\n\r\n if (props.onSelection) {\r\n // tslint:disable-next-line: no-string-literal\r\n let tempValue = { value: newValue, label: newValue };\r\n props.onSelection(tempValue, props.name);\r\n }\r\n }\r\n };\r\n\r\n const getInputProps = (params: RenderInputParams, isLoading?: boolean) => {\r\n return ({ \r\n ...params.InputProps,\r\n endAdornment: (\r\n \r\n {isLoading ? : null}\r\n {params.InputProps.endAdornment}\r\n \r\n ), \r\n });\r\n };\r\n\r\n return (\r\n option.label} \r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderInput={params => (\r\n \r\n )}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderOption={(option, { inputValue }) => {\r\n const matches = match(option.label, inputValue);\r\n const parts = parse(option.label, matches);\r\n \r\n return (\r\n
\r\n {parts.map((part, index) => (\r\n \r\n {part.text}\r\n \r\n ))}\r\n
\r\n );\r\n }}\r\n />\r\n );\r\n};","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport MomentUtils from '@date-io/moment';\r\nimport { Button, createStyles, Grid, makeStyles, TextField, Theme } from '@material-ui/core';\r\nimport { KeyboardDatePicker, MuiPickersUtilsProvider } from '@material-ui/pickers';\r\nimport { FormApi } from 'final-form';\r\nimport gql from 'graphql-tag';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { useMutation, useQuery } from 'react-apollo';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport { showNotification } from '../../App';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { CountryData, CountryDataInterface } from '../common/CountryData';\r\nimport { CountrySelector } from '../selectors/CountrySelector';\r\nimport { CurrencyCodeSelector } from '../selectors/CurrencyCodeSelector';\r\nimport { CurrencySymbolSelector } from '../selectors/CurrencySymbolSelector';\r\nimport { TimeZoneSelector } from '../selectors/TimeZoneSelector';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n textField: {\r\n width: '100%'\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n formGroup: {\r\n alignItems: 'flex-start',\r\n '& .MuiFormControlLabel-root': {\r\n marginLeft: 0,\r\n }\r\n }\r\n })\r\n);\r\n\r\ninterface FormState {\r\n homeCountry: IAutoCompleteItem | null;\r\n timeZone: IAutoCompleteItem | null;\r\n currencyCode: IAutoCompleteItem | null;\r\n currencySymbol: IAutoCompleteItem | null;\r\n financialYearStart: Date | null;\r\n taxLabel: string | null;\r\n taxPercentage: number | null;\r\n}\r\ninterface RegionalTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function RegionalTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: true,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n homeCountry: null,\r\n timeZone: null,\r\n currencyCode: null,\r\n currencySymbol: null,\r\n financialYearStart: null,\r\n taxLabel: null,\r\n taxPercentage: null,\r\n });\r\n\r\n const regionSettingsQuery = useQuery(REGION_SETTINGS_QUERY);\r\n\r\n // tslint:disable-next-line: no-any\r\n const [upRegionSettingsQuery] = useMutation(REGION_SETTINGS_MUTATION);\r\n \r\n const getCountryDetails = (value: string, type: 'countryCode' | 'country') => {\r\n\r\n let renderType: 'countryCode' | 'country' = 'country';\r\n if (type === 'country') {\r\n renderType = 'countryCode';\r\n }\r\n\r\n const countryData: CountryDataInterface | undefined = CountryData.find((item: CountryDataInterface) => item[renderType] === value);\r\n\r\n // tslint:disable-next-line: no-console\r\n console.log('getCountryDetails', value, type, countryData);\r\n\r\n return countryData ? countryData[type] : '';\r\n };\r\n\r\n useEffect(() => {\r\n \r\n // tslint:disable-next-line: max-line-length\r\n if (!regionSettingsQuery.loading && regionSettingsQuery.data) {\r\n\r\n const { \r\n currencyCode,\r\n currencySymbol,\r\n financialYearStart,\r\n homeCountry,\r\n timeZone,\r\n timeZoneDescription,\r\n taxLabel,\r\n taxPercentage\r\n } = regionSettingsQuery.data.settings.systems.regionSettings.config;\r\n\r\n setFormState((prevFormState) => {\r\n return {\r\n ...prevFormState,\r\n financialYearStart,\r\n currencyCode: currencyCode ? { label: currencyCode, value: currencyCode } : null,\r\n currencySymbol: currencySymbol ? { label: currencySymbol, value: currencySymbol } : null,\r\n // tslint:disable-next-line: max-line-length\r\n homeCountry: homeCountry && homeCountry.length > 0 ? { label: getCountryDetails(homeCountry, 'country'), value: getCountryDetails(homeCountry, 'country') } : null,\r\n timeZone: timeZone && timeZoneDescription ? { label: timeZoneDescription, value: timeZone } : null,\r\n taxLabel: taxLabel,\r\n taxPercentage: taxPercentage\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n }\r\n }, [regionSettingsQuery.data, regionSettingsQuery.loading]);\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: AnyObject) => {\r\n\r\n upRegionSettingsQuery({\r\n variables: {\r\n homeCountry: values.homeCountry ? getCountryDetails(values.homeCountry.label, 'countryCode') : null,\r\n currencySymbol: values.currencySymbol ? values.currencySymbol.value : null,\r\n currencyCode: values.currencyCode ? values.currencyCode.value : null,\r\n financialYearStart: values.financialYearStart ? values.financialYearStart : null,\r\n timeZone: values.timeZone ? values.timeZone.value : null,\r\n taxLabel: values.taxLabel ? values.taxLabel : null,\r\n taxPercentage: values.taxPercentage ? values.taxPercentage : null\r\n }\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update region settings.', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n });\r\n };\r\n\r\n return (\r\n \r\n
\r\n {state.isLoading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n ) => onSubmit(form, values)} \r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{\r\n submitting: true,\r\n pristine: true\r\n }}\r\n render={({\r\n handleSubmit,\r\n form,\r\n submitting,\r\n pristine,\r\n values\r\n }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n input.onChange(selection)\r\n }\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n input.onChange(selection)\r\n }\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n input.onChange(selection)\r\n }\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n input.onChange(selection)\r\n }\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n parseFloat(value)}\r\n >\r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n )}\r\n
\r\n
\r\n );\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport function printJson(values: any) {\r\n if (values) {\r\n return (\r\n <>\r\n
\r\n                    {JSON.stringify(values, undefined, 2)}\r\n                
\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n
\r\n                            {JSON.stringify(values, undefined, 2)}\r\n                            {/*  */}\r\n                        
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nexport interface RegionSettingsData {\r\n settings: Settings;\r\n}\r\n\r\nexport interface Settings {\r\n id: number;\r\n systems: Systems;\r\n}\r\n\r\nexport interface Systems {\r\n regionSettings: RegionSettings;\r\n}\r\n\r\nexport interface RegionSettings {\r\n id: number;\r\n config: Config;\r\n}\r\n\r\nexport interface Config {\r\n id: number;\r\n currencyCode: string;\r\n currencySymbol: string;\r\n financialYearStart: Date;\r\n homeCountry: string;\r\n timeZone: string;\r\n timeZoneDescription: string;\r\n baseUtcOffset: number;\r\n taxLabel: string;\r\n taxPercentage: number;\r\n}\r\n\r\nconst REGION_SETTINGS_QUERY = gql`\r\n query regionSettings {\r\n settings {\r\n id\r\n systems {\r\n regionSettings {\r\n id\r\n config {\r\n id\r\n currencyCode\r\n currencySymbol\r\n financialYearStart\r\n homeCountry\r\n timeZone\r\n timeZoneDescription\r\n taxLabel\r\n taxPercentage\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\ninterface RegionSettingsMutationParams {\r\n homeCountry: string | null;\r\n timeZone: string | null;\r\n currencyCode: string | null;\r\n currencySymbol: string | null;\r\n financialYearStart: Date | null;\r\n taxLabel: string | null;\r\n taxPercentage: number | null;\r\n}\r\n\r\nconst REGION_SETTINGS_MUTATION = gql`\r\n mutation RegionSettingsMutation(\r\n $homeCountry: String,\r\n $timeZone: String,\r\n $currencyCode: String,\r\n $currencySymbol: String,\r\n $financialYearStart: DateTime,\r\n $taxLabel: String,\r\n $taxPercentage: Decimal\r\n ){\r\n settings {\r\n regionSettings {\r\n update (\r\n homeCountry: $homeCountry,\r\n timeZone: $timeZone,\r\n currencyCode: $currencyCode,\r\n currencySymbol: $currencySymbol,\r\n financialYearStart: $financialYearStart,\r\n taxLabel: $taxLabel,\r\n taxPercentage: $taxPercentage\r\n ) {\r\n status\r\n error\r\n }\r\n }\r\n }\r\n }\r\n`;","import React, { useState, useEffect } from 'react';\r\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { Autocomplete, RenderInputParams } from '@material-ui/lab';\r\nimport { TextField, CircularProgress } from '@material-ui/core';\r\nimport match from 'autosuggest-highlight/match';\r\nimport parse from 'autosuggest-highlight/parse';\r\nimport { showNotification } from '../../App';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport gql from 'graphql-tag';\r\nimport { client } from '../..';\r\nimport { FetchPolicy } from 'apollo-client';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n minWidth: '200px',\r\n },\r\n })\r\n);\r\n\r\ninterface TimesheetActivitiesSelectorProps {\r\n disabled?: boolean;\r\n required?: boolean;\r\n multiple?: boolean;\r\n // tslint:disable-next-line: no-any\r\n value?: IAutoCompleteItem | any; // value only available in single select\r\n error?: boolean;\r\n onSelection?: (value: IAutoCompleteItem | IAutoCompleteItem[], name: string) => void;\r\n className?: string;\r\n helperText?: string;\r\n name?: string;\r\n label?: string;\r\n disablePortal?: boolean;\r\n}\r\n\r\ninterface TimesheetActivitiesSelectorState {\r\n isLoading: boolean;\r\n options: IAutoCompleteItem[];\r\n}\r\n\r\nexport const TimesheetActivitiesSelector: React.FC = props => {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: false,\r\n options: [],\r\n });\r\n\r\n useEffect(() => { \r\n fetchData();\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const fetchData = () => {\r\n\r\n setState({\r\n ...state,\r\n isLoading: true\r\n });\r\n\r\n const timesheetActivitiesParams: TimesheetActivitiesParams = {\r\n clientOnly: false\r\n };\r\n\r\n retrieveTimesheetActivitiesData(\r\n timesheetActivitiesParams,\r\n false, // this.state.isRefresh, -- Since we are updating and creating, we do not fetch cached data\r\n // tslint:disable-next-line: no-console\r\n (data) => onRetrieveEnquiryStatus(data),\r\n // tslint:disable-next-line:no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onRetrieveEnquiryStatus = (data: TimesheetActivitiesData) => {\r\n setState({\r\n ...state,\r\n options: data.timesheetActivities.activities.map( (source: Activity) => ({value: source.stringValue, label: source.stringValue })),\r\n isLoading: false\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleChange = (event: React.ChangeEvent<{}>, value: any) => {\r\n // tslint:disable-next-line: no-console\r\n console.log('onChange', value);\r\n if (props.onSelection) {\r\n props.onSelection(value, props.name ? props.name : 'office');\r\n }\r\n };\r\n\r\n const getInputProps = (params: RenderInputParams, isLoading?: boolean) => {\r\n return ({ \r\n ...params.InputProps,\r\n endAdornment: (\r\n \r\n {isLoading ? : null}\r\n {params.InputProps.endAdornment}\r\n \r\n ), \r\n });\r\n };\r\n\r\n return (\r\n
\r\n { props.multiple ? \r\n (\r\n option.label} \r\n getOptionSelected={(option, value) => value.value === option.value} \r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderInput={params => (\r\n \r\n )}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderOption={(option, { inputValue }) => {\r\n const matches = match(option.label, inputValue);\r\n const parts = parse(option.label, matches);\r\n \r\n return (\r\n
\r\n {parts.map((part, index) => (\r\n \r\n {part.text}\r\n \r\n ))}\r\n
\r\n );\r\n }}\r\n />\r\n )\r\n :\r\n (\r\n option.label} \r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderInput={params => (\r\n \r\n )}\r\n // tslint:disable-next-line: jsx-no-lambda\r\n renderOption={(option, { inputValue }) => {\r\n const matches = match(option.label, inputValue);\r\n const parts = parse(option.label, matches);\r\n \r\n return (\r\n
\r\n {parts.map((part, index) => (\r\n \r\n {part.text}\r\n \r\n ))}\r\n
\r\n );\r\n }}\r\n />\r\n )\r\n }\r\n
\r\n );\r\n};\r\n\r\nexport function retrieveTimesheetActivitiesData(\r\n params: TimesheetActivitiesParams,\r\n refreshData: boolean,\r\n onSuccess: (data: TimesheetActivitiesData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void\r\n): void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n client\r\n .query({\r\n query: TimesheetActivitiesQuery,\r\n variables: {\r\n clientOnly: params.clientOnly\r\n },\r\n fetchPolicy: fetchPolicy,\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n onError(reason);\r\n });\r\n}\r\n\r\nexport interface TimesheetActivitiesParams {\r\n clientOnly: boolean;\r\n}\r\n\r\nexport interface TimesheetActivitiesData {\r\n timesheetActivities: TimesheetActivities;\r\n}\r\n\r\nexport interface TimesheetActivities {\r\n activities: Activity[];\r\n}\r\n\r\nexport interface Activity {\r\n id: number;\r\n stringValue: string;\r\n isVIP: boolean;\r\n isFirmActivity: boolean;\r\n}\r\n\r\nexport const TimesheetActivitiesQuery = gql`\r\n query timesheetActivities {\r\n timesheetActivities(clientOnly: false) {\r\n activities {\r\n id\r\n stringValue\r\n isVIP\r\n isFirmActivity\r\n }\r\n }\r\n }\r\n`;","import {\r\n Accordion,\r\n AccordionDetails,\r\n AccordionSummary,\r\n Button,\r\n Checkbox,\r\n createStyles,\r\n FormControl,\r\n FormControlLabel,\r\n FormGroup,\r\n FormLabel,\r\n Grid,\r\n makeStyles,\r\n Radio,\r\n RadioGroup,\r\n TextField,\r\n Theme,\r\n Typography,\r\n} from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\nimport { mainTheme } from '../../Theme';\r\nimport gql from 'graphql-tag';\r\nimport { useMutation, useQuery } from 'react-apollo';\r\nimport { showNotification } from '../../App';\r\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\r\nimport RadioButtonCheckedIcon from '@material-ui/icons/RadioButtonChecked';\r\nimport { TimesheetActivitiesSelector } from '../selectors/TimesheetActivitiesSelector';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n textField: {\r\n width: '100%'\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n formGroup: {\r\n alignItems: 'flex-start',\r\n '& .MuiFormControlLabel-root': {\r\n marginLeft: 0,\r\n }\r\n },\r\n radioGroup: {\r\n flexDirection: 'row'\r\n },\r\n radioIcon: {\r\n color: mainTheme.BrandColors.TemplatePrimary\r\n },\r\n heading: {\r\n fontSize: theme.typography.pxToRem(15),\r\n fontWeight: 600,\r\n color: theme.palette.primary.main\r\n },\r\n accordionDetails: {\r\n flexFlow: 'column',\r\n },\r\n })\r\n);\r\n\r\ninterface FormState {\r\n unitsPerHour: number | null;\r\n standardHoursPerDay: number | null;\r\n expectedHoursPerDay: number | null;\r\n warningOnExceedingHours: boolean;\r\n timeCaptureOptions: string | null;\r\n useStartEndTime: boolean;\r\n copyActivityAsNote: boolean;\r\n thresholdLevel: number | null;\r\n\r\n // defaults fields\r\n defaultDurationMinutes: number | null;\r\n defaultDurationUnits: number | null;\r\n phoneCallActivity: IAutoCompleteItem | null;\r\n emailActivity: IAutoCompleteItem | null;\r\n submissionType: string | null;\r\n // mobileOpeningPage: string | null;\r\n timeSelectionMinuteInterval: number | null;\r\n // isShowFavouriteActivitiesFirst: boolean;\r\n // isShowFavouriteMattersFirst: boolean;\r\n useSmartSettings: boolean;\r\n suggestCustomButtons: boolean;\r\n timeCaptureMode: string | null;\r\n\r\n // warning fields\r\n warnOnDefaultTime: boolean;\r\n warnOnExceedingHours: boolean;\r\n warnIfNotToday: boolean;\r\n}\r\ninterface TimeRecordingTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function TimeRecordingTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: true,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n unitsPerHour: null,\r\n standardHoursPerDay: null,\r\n expectedHoursPerDay: null,\r\n useStartEndTime: false,\r\n warningOnExceedingHours: false,\r\n timeCaptureOptions: 'both',\r\n copyActivityAsNote: false,\r\n thresholdLevel: null,\r\n\r\n defaultDurationMinutes: null,\r\n defaultDurationUnits: null,\r\n phoneCallActivity: null,\r\n emailActivity: null,\r\n submissionType: null,\r\n // mobileOpeningPage: null,\r\n timeSelectionMinuteInterval: null,\r\n // isShowFavouriteActivitiesFirst: false,\r\n // isShowFavouriteMattersFirst: false,\r\n useSmartSettings: false,\r\n suggestCustomButtons: false,\r\n timeCaptureMode: null,\r\n\r\n warnOnDefaultTime: false,\r\n warnOnExceedingHours: false,\r\n warnIfNotToday: false,\r\n });\r\n\r\n const timeRecordingSettings = useQuery(TIME_RECORDING_SETTINGS_QUERY);\r\n\r\n // tslint:disable-next-line: no-any\r\n const [updateTimeRecordingSettings] = useMutation(TIME_RECORDING_SETTINGS_MUTATION);\r\n\r\n useEffect(() => {\r\n \r\n // tslint:disable-next-line: max-line-length\r\n if (!timeRecordingSettings.loading && timeRecordingSettings.data) {\r\n\r\n const { \r\n copyActivityAsNote,\r\n expectedHoursPerDay,\r\n standardHoursPerDay,\r\n unitsPerHour,\r\n useStartEndTime,\r\n thresholdLevel,\r\n\r\n // defaults fields\r\n defaultDurationMinutes,\r\n defaultDurationUnits,\r\n emailActivity,\r\n phoneCallActivity,\r\n submissionType,\r\n suggestCustomButtons,\r\n tenantTimeCaptureMode,\r\n timeCaptureMode,\r\n timeSelectionMinuteInterval,\r\n useSmartSettings,\r\n\r\n // warning fields\r\n warnIfNotToday,\r\n warnOnExceedingHours,\r\n\r\n } = timeRecordingSettings.data.settings.systems.timeRecordingSettings.config;\r\n\r\n setFormState((prevFormState) => {\r\n return {\r\n ...prevFormState,\r\n copyActivityAsNote,\r\n expectedHoursPerDay,\r\n standardHoursPerDay,\r\n unitsPerHour,\r\n useStartEndTime,\r\n thresholdLevel,\r\n // passwordStrength: passwordStrength,\r\n\r\n // defaults fields\r\n defaultDurationMinutes,\r\n defaultDurationUnits,\r\n emailActivity : emailActivity ? { label: emailActivity, value: emailActivity} : null,\r\n phoneCallActivity: phoneCallActivity ? { label: phoneCallActivity, value: phoneCallActivity} : null,\r\n submissionType,\r\n suggestCustomButtons,\r\n tenantTimeCaptureMode,\r\n timeCaptureMode,\r\n timeSelectionMinuteInterval,\r\n useSmartSettings,\r\n\r\n // warning fields\r\n warnIfNotToday: warnIfNotToday,\r\n warnOnExceedingHours: warnOnExceedingHours,\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n }\r\n }, [timeRecordingSettings.data, timeRecordingSettings.loading]);\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: AnyObject) => {\r\n // console.log('submit');\r\n updateTimeRecordingSettings({\r\n variables: {\r\n copyActivityAsNote: values.copyActivityAsNote,\r\n expectedHoursPerDay: values.expectedHoursPerDay,\r\n standardHoursPerDay: values.standardHoursPerDay,\r\n unitsPerHour: values.unitsPerHour,\r\n useStartEndTime: values.useStartEndTime,\r\n thresholdLevel: values.thresholdLevel,\r\n\r\n // defaults fields\r\n defaultDurationMinutes: values.defaultDurationMinutes,\r\n defaultDurationUnits: values.defaultDurationUnits,\r\n emailActivity: values.emailActivity ? values.emailActivity.value : null,\r\n phoneCallActivity: values.phoneCallActivity ? values.phoneCallActivity.value : null,\r\n submissionType: values.submissionType,\r\n suggestCustomButtons: values.suggestCustomButtons,\r\n tenantTimeCaptureMode: values.tenantTimeCaptureMode,\r\n timeCaptureMode: values.timeCaptureMode,\r\n timeSelectionMinuteInterval: values.timeSelectionMinuteInterval,\r\n useSmartSettings: values.useSmartSettings,\r\n\r\n // warning fields\r\n warnIfNotToday: values.warnIfNotToday,\r\n warnOnExceedingHours: values.warnOnExceedingHours,\r\n }\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update time recording.', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const RadioComp = (compProps: any) => {\r\n\r\n const { input } = compProps; \r\n return (\r\n }\r\n />\r\n );\r\n };\r\n \r\n return (\r\n
\r\n {state.isLoading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n ) => onSubmit(form, values)}\r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{\r\n submitting: true,\r\n pristine: true,\r\n }}\r\n validate={(values) => {\r\n let errors = {\r\n unitsPerHour: '',\r\n standardHoursPerDay: '',\r\n expectedHoursPerDay: '',\r\n };\r\n if (values.unitsPerHour !== null) {\r\n if (!(values.unitsPerHour >= 0 && values.unitsPerHour <= 60)) {\r\n errors.unitsPerHour = 'Unit per hour should be between 0 and 60';\r\n }\r\n }\r\n if (values.standardHoursPerDay !== null) {\r\n if (!(values.standardHoursPerDay >= 0 && values.standardHoursPerDay <= 24)) {\r\n errors.standardHoursPerDay = 'Standard hours per day should be between 0 and 24';\r\n }\r\n }\r\n if (values.expectedHoursPerDay !== null) {\r\n if (!(values.expectedHoursPerDay >= 0 && values.expectedHoursPerDay <= 24)) {\r\n errors.expectedHoursPerDay = 'Expected hours per day should be between 0 and 24';\r\n }\r\n }\r\n if (errors.unitsPerHour === '' && errors.standardHoursPerDay === '' && errors.expectedHoursPerDay === '') {\r\n return undefined;\r\n }\r\n return errors;\r\n }}\r\n render={({ handleSubmit, form, submitting, pristine, values }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n\r\n \r\n \r\n \r\n }>\r\n Time Recording\r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Use Start & End Time\"\r\n />\r\n )}\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Copy Activity As Note\"\r\n />\r\n )}\r\n \r\n {/* \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Warning on Exceeding Hours\" \r\n />\r\n )}\r\n */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }>\r\n Default\r\n \r\n \r\n \r\n \r\n \r\n Submission Type\r\n \r\n \r\n }\r\n value=\"Automatic\"\r\n label=\"Submit Only\" \r\n />\r\n \r\n }\r\n value=\"Draft\"\r\n label=\"Allow Draft\" \r\n />\r\n \r\n \r\n \r\n \r\n {/* \r\n Mobile Opening Page\r\n \r\n \r\n }\r\n value=\"Home\"\r\n label=\"Home\" \r\n />\r\n \r\n }\r\n value=\"Timesheet\"\r\n label=\"Timesheet\" \r\n />\r\n \r\n */}\r\n \r\n \r\n parseInt(value)}\r\n // validate={form.getFieldState('durationUnits')?.value !== null ? required : undefined}\r\n >\r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n parseInt(value)}\r\n // validate={form.getFieldState('durationUnits')?.value !== null ? required : undefined}\r\n >\r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n parseInt(value)}\r\n // validate={form.getFieldState('durationUnits')?.value !== null ? required : undefined}\r\n >\r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n input.onChange(selection)\r\n }\r\n className={classes.textField}\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n input.onChange(selection)\r\n }\r\n className={classes.textField}\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {/* \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n disabled={true}\r\n label=\"Show Favourite Activities First\" \r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n disabled={true}\r\n label=\"Show Favourite Matters First\"\r\n />\r\n )}\r\n \r\n */}\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Use Smart Settings\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Suggest Custom Buttons\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Time Capture Mode\r\n \r\n \r\n }\r\n value=\"Duration\"\r\n label=\"Duration\" \r\n />\r\n \r\n }\r\n value=\"Units\"\r\n label=\"Units\" \r\n />\r\n \r\n \r\n \r\n \r\n \r\n Tenant Time Capture Mode\r\n \r\n \r\n }\r\n value=\"Both\"\r\n label=\"Both\" \r\n />\r\n \r\n }\r\n value=\"Duration\"\r\n label=\"Duration\" \r\n />\r\n \r\n }\r\n value=\"Units\"\r\n label=\"Units\" \r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n }>\r\n Warnings\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Warning on Exceeding Hours\" \r\n />\r\n )}\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Warn if not today\" \r\n />\r\n )}\r\n \r\n {/* \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Warn on Default Time\" \r\n />\r\n )}\r\n */}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n )}\r\n
\r\n );\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport function printJson(values: any) {\r\n if (values) {\r\n return (\r\n <>\r\n
\r\n                    {JSON.stringify(values, undefined, 2)}\r\n                
\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n
\r\n                            {JSON.stringify(values, undefined, 2)}\r\n                            {/*  */}\r\n                        
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nexport interface TimeRecordingSettingsData {\r\n settings: Settings;\r\n}\r\n\r\nexport interface Settings {\r\n id: number;\r\n systems: Systems;\r\n}\r\n\r\nexport interface Systems {\r\n timeRecordingSettings: TimeRecordingSettings;\r\n}\r\n\r\nexport interface TimeRecordingSettings {\r\n id: number;\r\n config: Config;\r\n}\r\n\r\nexport interface Config {\r\n id: number;\r\n copyActivityAsNote: boolean;\r\n expectedHoursPerDay: number;\r\n standardHoursPerDay: number;\r\n unitsPerHour: number;\r\n useStartEndTime: boolean;\r\n thresholdLevel: number;\r\n\r\n defaultDurationMinutes: number;\r\n defaultDurationUnits: number;\r\n emailActivity: string;\r\n phoneCallActivity: string;\r\n submissionType: string;\r\n suggestCustomButtons: boolean;\r\n tenantTimeCaptureMode: string;\r\n timeCaptureMode: string;\r\n timeSelectionMinuteInterval: number;\r\n useSmartSettings: boolean;\r\n warnIfNotToday: boolean;\r\n warnOnExceedingHours: boolean;\r\n\r\n}\r\n\r\nconst TIME_RECORDING_SETTINGS_QUERY = gql`\r\n query timeRecordingSettings {\r\n settings {\r\n id\r\n systems {\r\n timeRecordingSettings {\r\n id\r\n config {\r\n id\r\n copyActivityAsNote\r\n expectedHoursPerDay\r\n standardHoursPerDay\r\n unitsPerHour\r\n useStartEndTime\r\n thresholdLevel\r\n \r\n defaultDurationMinutes\r\n defaultDurationUnits\r\n emailActivity\r\n phoneCallActivity\r\n submissionType\r\n suggestCustomButtons\r\n tenantTimeCaptureMode\r\n timeCaptureMode\r\n timeSelectionMinuteInterval\r\n useSmartSettings\r\n \r\n warnIfNotToday\r\n warnOnExceedingHours\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\ninterface TimeRecordingSettingsMutationParams {\r\n unitsPerHour: number | null;\r\n standardHoursPerDay: number | null;\r\n expectedHoursPerDay: number | null;\r\n useStartEndTime: Boolean;\r\n copyActivityAsNote: Boolean;\r\n thresholdLevel: number | null;\r\n\r\n // defaults fields\r\n tenantTimeCaptureMode: string | null;\r\n submissionType: string | null;\r\n defaultDurationUnits: number | null;\r\n defaultDurationMinutes: number | null;\r\n phoneCallActivity: string | null;\r\n emailActivity: string | null;\r\n suggestCustomButtons: Boolean;\r\n useSmartSettings: Boolean;\r\n timeCaptureMode: string | null;\r\n timeSelectionMinuteInterval: number | null;\r\n\r\n // warning fields\r\n warnOnExceedingHours: Boolean;\r\n warnIfNotToday: Boolean;\r\n}\r\n\r\nconst TIME_RECORDING_SETTINGS_MUTATION = gql`\r\n mutation TimeRecordingSettingsMutation(\r\n $unitsPerHour: Int,\r\n $standardHoursPerDay: Decimal,\r\n $expectedHoursPerDay: Int,\r\n $useStartEndTime: Boolean,\r\n $copyActivityAsNote: Boolean,\r\n $thresholdLevel: Decimal,\r\n \r\n \t$tenantTimeCaptureMode: String,\r\n $submissionType: String,\r\n $defaultDurationUnits: Int,\r\n $defaultDurationMinutes: Int,\r\n $phoneCallActivity: String,\r\n $emailActivity: String,\r\n $suggestCustomButtons: Boolean,\r\n $useSmartSettings: Boolean,\r\n $timeCaptureMode: String,\r\n $timeSelectionMinuteInterval: Int\r\n \r\n \t\t\t$warnIfNotToday: Boolean,\r\n $warnOnExceedingHours: Boolean,\r\n ){\r\n settings {\r\n timeRecordingSettings {\r\n update (\r\n unitsPerHour: $unitsPerHour,\r\n standardHoursPerDay: $standardHoursPerDay,\r\n expectedHoursPerDay: $expectedHoursPerDay,\r\n useStartEndTime: $useStartEndTime,\r\n copyActivityAsNote: $copyActivityAsNote,\r\n thresholdLevel: $thresholdLevel,\r\n \r\n \ttenantTimeCaptureMode: $tenantTimeCaptureMode,\r\n submissionType: $submissionType,\r\n defaultDurationUnits: $defaultDurationUnits,\r\n defaultDurationMinutes: $defaultDurationMinutes,\r\n phoneCallActivity: $phoneCallActivity,\r\n emailActivity: $emailActivity,\r\n suggestCustomButtons: $suggestCustomButtons,\r\n useSmartSettings: $useSmartSettings,\r\n timeCaptureMode: $timeCaptureMode,\r\n timeSelectionMinuteInterval: $timeSelectionMinuteInterval,\r\n \r\n \twarnIfNotToday: $warnIfNotToday,\r\n warnOnExceedingHours: $warnOnExceedingHours,\r\n ) {\r\n status\r\n error\r\n }\r\n }\r\n }\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { Button, Checkbox, createStyles, FormControl, FormControlLabel, FormLabel, Grid, makeStyles, Radio, RadioGroup, TextField, Theme } from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport RadioButtonCheckedIcon from '@material-ui/icons/RadioButtonChecked';\r\nimport { mainTheme } from '../../Theme';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\nimport gql from 'graphql-tag';\r\nimport { useMutation, useQuery } from 'react-apollo';\r\nimport { showNotification } from '../../App';\r\nimport { TimesheetActivitiesSelector } from '../selectors/TimesheetActivitiesSelector';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n textField: {\r\n width: '100%'\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n formGroup: {\r\n alignItems: 'flex-start',\r\n '& .MuiFormControlLabel-root': {\r\n marginLeft: 0,\r\n }\r\n },\r\n radioGroup: {\r\n flexDirection: 'row'\r\n },\r\n radioIcon: {\r\n color: mainTheme.BrandColors.TemplatePrimary\r\n },\r\n })\r\n);\r\n\r\ninterface FormState {\r\n defaultDurationMinutes: number | null;\r\n defaultDurationUnits: number | null;\r\n phoneCallActivity: IAutoCompleteItem | null;\r\n emailActivity: IAutoCompleteItem | null;\r\n submissionType: string | null;\r\n // mobileOpeningPage: string | null;\r\n timeSelectionMinuteInterval: number | null;\r\n // isShowFavouriteActivitiesFirst: boolean;\r\n // isShowFavouriteMattersFirst: boolean;\r\n useSmartSettings: boolean;\r\n suggestCustomButtons: boolean;\r\n timeCaptureMode: string | null;\r\n}\r\ninterface TimeRecordingDefaultsTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function TimeRecordingDefaultsTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: true,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n defaultDurationMinutes: null,\r\n defaultDurationUnits: null,\r\n phoneCallActivity: null,\r\n emailActivity: null,\r\n submissionType: null,\r\n // mobileOpeningPage: null,\r\n timeSelectionMinuteInterval: null,\r\n // isShowFavouriteActivitiesFirst: false,\r\n // isShowFavouriteMattersFirst: false,\r\n useSmartSettings: false,\r\n suggestCustomButtons: false,\r\n timeCaptureMode: null\r\n });\r\n\r\n const timeRecordingDefaults = useQuery(TIME_RECORDING_DEFAULTS);\r\n\r\n // tslint:disable-next-line: no-any\r\n const [updateTimeRecordingDefaults] = useMutation(TIME_RECORD_DEFAULTS_MUTATION);\r\n\r\n useEffect(() => {\r\n \r\n // tslint:disable-next-line: max-line-length\r\n if (!timeRecordingDefaults.loading && timeRecordingDefaults.data && timeRecordingDefaults.data.settings && timeRecordingDefaults.data.settings.systems.timeRecordingDefaults && timeRecordingDefaults.data.settings.systems.timeRecordingDefaults.config) {\r\n\r\n var { \r\n defaultDurationMinutes,\r\n defaultDurationUnits,\r\n emailActivity,\r\n phoneCallActivity,\r\n submissionType,\r\n suggestCustomButtons,\r\n tenantTimeCaptureMode,\r\n timeCaptureMode,\r\n timeSelectionMinuteInterval,\r\n useSmartSettings\r\n } = timeRecordingDefaults.data.settings.systems.timeRecordingDefaults.config;\r\n \r\n setFormState((prevFormState) => {\r\n return {\r\n ...prevFormState,\r\n defaultDurationMinutes,\r\n defaultDurationUnits,\r\n emailActivity : emailActivity ? { label: emailActivity, value: emailActivity} : null,\r\n phoneCallActivity: phoneCallActivity ? { label: phoneCallActivity, value: phoneCallActivity} : null,\r\n submissionType,\r\n suggestCustomButtons,\r\n tenantTimeCaptureMode,\r\n timeCaptureMode,\r\n timeSelectionMinuteInterval,\r\n useSmartSettings\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n }\r\n }, [timeRecordingDefaults.data, timeRecordingDefaults.loading]);\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: AnyObject) => {\r\n \r\n updateTimeRecordingDefaults({\r\n variables: {\r\n defaultDurationMinutes: values.defaultDurationMinutes,\r\n defaultDurationUnits: values.defaultDurationUnits,\r\n emailActivity: values.emailActivity ? values.emailActivity.value : null,\r\n phoneCallActivity: values.phoneCallActivity ? values.phoneCallActivity.value : null,\r\n submissionType: values.submissionType,\r\n suggestCustomButtons: values.suggestCustomButtons,\r\n tenantTimeCaptureMode: values.tenantTimeCaptureMode,\r\n timeCaptureMode: values.timeCaptureMode,\r\n timeSelectionMinuteInterval: values.timeSelectionMinuteInterval,\r\n useSmartSettings: values.useSmartSettings\r\n }\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update time recording defaults.', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const RadioComp = (compProps: any) => {\r\n\r\n const { input } = compProps; \r\n return (\r\n }\r\n />\r\n );\r\n };\r\n\r\n return (\r\n
\r\n {state.isLoading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n ) => onSubmit(form, values)} \r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{\r\n submitting: true,\r\n pristine: true\r\n }}\r\n render={({\r\n handleSubmit,\r\n form,\r\n submitting,\r\n pristine,\r\n values,\r\n }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n Submission Type\r\n \r\n \r\n }\r\n value=\"Automatic\"\r\n label=\"Submit Only\" \r\n />\r\n \r\n }\r\n value=\"Draft\"\r\n label=\"Allow Draft\" \r\n />\r\n \r\n \r\n \r\n \r\n {/* \r\n Mobile Opening Page\r\n \r\n \r\n }\r\n value=\"Home\"\r\n label=\"Home\" \r\n />\r\n \r\n }\r\n value=\"Timesheet\"\r\n label=\"Timesheet\" \r\n />\r\n \r\n */}\r\n \r\n \r\n parseInt(value)}\r\n // validate={form.getFieldState('durationUnits')?.value !== null ? required : undefined}\r\n >\r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n parseInt(value)}\r\n // validate={form.getFieldState('durationUnits')?.value !== null ? required : undefined}\r\n >\r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n parseInt(value)}\r\n // validate={form.getFieldState('durationUnits')?.value !== null ? required : undefined}\r\n >\r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n input.onChange(selection)\r\n }\r\n className={classes.textField}\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n input.onChange(selection)\r\n }\r\n className={classes.textField}\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {/* \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n disabled={true}\r\n label=\"Show Favourite Activities First\" \r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n disabled={true}\r\n label=\"Show Favourite Matters First\"\r\n />\r\n )}\r\n \r\n */}\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Use Smart Settings\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Suggest Custom Buttons\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Time Capture Mode\r\n \r\n \r\n }\r\n value=\"Duration\"\r\n label=\"Duration\" \r\n />\r\n \r\n }\r\n value=\"Units\"\r\n label=\"Units\" \r\n />\r\n \r\n \r\n \r\n \r\n \r\n Tenant Time Capture Mode\r\n \r\n \r\n }\r\n value=\"Both\"\r\n label=\"Both\" \r\n />\r\n \r\n }\r\n value=\"Duration\"\r\n label=\"Duration\" \r\n />\r\n \r\n }\r\n value=\"Units\"\r\n label=\"Units\" \r\n />\r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n )}\r\n
\r\n );\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport function printJson(values: any) {\r\n if (values) {\r\n return (\r\n <>\r\n
\r\n                    {JSON.stringify(values, undefined, 2)}\r\n                
\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n
\r\n                            {JSON.stringify(values, undefined, 2)}\r\n                            {/*  */}\r\n                        
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nexport interface TimeRecordingDefaultsData {\r\n settings: Settings;\r\n}\r\n\r\nexport interface Settings {\r\n id: number;\r\n systems: Systems;\r\n}\r\n\r\nexport interface Systems {\r\n timeRecordingDefaults: TimeRecordingDefaults;\r\n}\r\n\r\nexport interface TimeRecordingDefaults {\r\n id: number;\r\n config: Config;\r\n}\r\n\r\nexport interface Config {\r\n id: number;\r\n defaultDurationMinutes: number;\r\n defaultDurationUnits: number;\r\n emailActivity: null;\r\n phoneCallActivity: null;\r\n submissionType: string;\r\n suggestCustomButtons: boolean;\r\n tenantTimeCaptureMode: string;\r\n timeCaptureMode: string;\r\n timeSelectionMinuteInterval: number;\r\n useSmartSettings: boolean;\r\n}\r\n\r\nconst TIME_RECORDING_DEFAULTS = gql`\r\n query timeRecordingDefaults {\r\n settings {\r\n id\r\n systems {\r\n timeRecordingDefaults {\r\n id\r\n config {\r\n id\r\n defaultDurationMinutes\r\n defaultDurationUnits\r\n emailActivity\r\n phoneCallActivity\r\n submissionType\r\n suggestCustomButtons\r\n tenantTimeCaptureMode\r\n timeCaptureMode\r\n timeSelectionMinuteInterval\r\n useSmartSettings\r\n\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\ninterface TimeRecordingDefaultsMutationParams {\r\n tenantTimeCaptureMode: string | null;\r\n submissionType: string | null;\r\n defaultDurationUnits: number | null;\r\n defaultDurationMinutes: number | null;\r\n phoneCallActivity: string | null;\r\n emailActivity: string | null;\r\n suggestCustomButtons: Boolean;\r\n useSmartSettings: Boolean;\r\n timeCaptureMode: string | null;\r\n timeSelectionMinuteInterval: number | null;\r\n}\r\n\r\nconst TIME_RECORD_DEFAULTS_MUTATION = gql`\r\n mutation TimeRecordingDefaultsMutation(\r\n $tenantTimeCaptureMode: String,\r\n $submissionType: String,\r\n $defaultDurationUnits: Int,\r\n $defaultDurationMinutes: Int,\r\n $phoneCallActivity: String,\r\n $emailActivity: String,\r\n $suggestCustomButtons: Boolean,\r\n $useSmartSettings: Boolean,\r\n $timeCaptureMode: String,\r\n $timeSelectionMinuteInterval: Int\r\n ){\r\n settings {\r\n timeRecordingDefaults {\r\n update (\r\n tenantTimeCaptureMode: $tenantTimeCaptureMode,\r\n submissionType: $submissionType,\r\n defaultDurationUnits: $defaultDurationUnits,\r\n defaultDurationMinutes: $defaultDurationMinutes,\r\n phoneCallActivity: $phoneCallActivity,\r\n emailActivity: $emailActivity,\r\n suggestCustomButtons: $suggestCustomButtons,\r\n useSmartSettings: $useSmartSettings,\r\n timeCaptureMode: $timeCaptureMode,\r\n timeSelectionMinuteInterval: $timeSelectionMinuteInterval\r\n ) {\r\n status\r\n error\r\n }\r\n }\r\n }\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport {\r\n Accordion,\r\n AccordionDetails,\r\n AccordionSummary,\r\n Button,\r\n Checkbox,\r\n createStyles,\r\n FormControl,\r\n FormControlLabel,\r\n FormGroup,\r\n FormHelperText,\r\n FormLabel,\r\n Grid,\r\n makeStyles,\r\n TextField,\r\n Theme,\r\n Typography,\r\n} from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport { DropzoneArea } from 'material-ui-dropzone';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\nimport { DocumentFile } from '../../types/DocumentFile';\r\nimport gql from 'graphql-tag';\r\nimport { useMutation, useQuery } from 'react-apollo';\r\nimport { showNotification } from '../../App';\r\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n textField: {\r\n width: '100%'\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n formGroup: {\r\n alignItems: 'flex-start',\r\n '& .MuiFormControlLabel-root': {\r\n marginLeft: 0,\r\n }\r\n },\r\n radioGroup: {\r\n flexDirection: 'row'\r\n },\r\n heading: {\r\n fontSize: theme.typography.pxToRem(15),\r\n fontWeight: 600,\r\n color: theme.palette.primary.main\r\n },\r\n })\r\n);\r\n\r\ninterface FormState {\r\n staffContactFilter: string | null;\r\n welcomeMessage: string | null;\r\n isEmailNotificationDocuments: boolean;\r\n isEmailNotificationMessages: boolean;\r\n isPushNotificationDocuments: boolean;\r\n isPushNotificationMessages: boolean;\r\n isExternalMessagesToActing: boolean;\r\n isExternalMessagesToResponsible: boolean;\r\n isExternalMessagesToAssisting: boolean;\r\n alternativeLogo: DocumentFile[];\r\n isExternalMessageToActing: boolean;\r\n isExternalMessageToResponsible: boolean;\r\n isExternalMessageToAssisting: boolean;\r\n isFirmToClientPushNewDocumentNotifications: boolean;\r\n isFirmToClientPushNewMessageNotifications: boolean;\r\n}\r\ninterface ConnectTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function ConnectTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: true,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n staffContactFilter: null,\r\n welcomeMessage: null,\r\n isEmailNotificationDocuments: false,\r\n isEmailNotificationMessages: false,\r\n isPushNotificationDocuments: false,\r\n isPushNotificationMessages: false,\r\n isExternalMessagesToActing: false,\r\n isExternalMessagesToResponsible: false,\r\n isExternalMessagesToAssisting: false,\r\n isExternalMessageToActing: true,\r\n isExternalMessageToAssisting: false,\r\n isExternalMessageToResponsible: false,\r\n isFirmToClientPushNewDocumentNotifications: false,\r\n isFirmToClientPushNewMessageNotifications: false,\r\n alternativeLogo: []\r\n });\r\n\r\n const connectSettingQuery = useQuery(ConnectSettingQuery);\r\n // tslint:disable-next-line: no-any\r\n const [updateConnectSetting, updateConnectSettingObj] = useMutation(CONNECT_SETTINGS_MUTATION);\r\n\r\n useEffect(() => {\r\n \r\n // tslint:disable-next-line: max-line-length\r\n if (!connectSettingQuery.loading && connectSettingQuery.data) {\r\n\r\n const { \r\n emailDocumentNotifications,\r\n emailMessageNotifications,\r\n pushDocumentNotifications,\r\n pushMessageNotifications,\r\n staffContactFilter,\r\n welcomeMessage,\r\n externalMessagesToActing,\r\n externalMessagesToResponsible,\r\n externalMessagesToAssisting,\r\n firmToClientPushNewDocumentNotifications,\r\n firmToClientPushNewMessageNotifications\r\n } = connectSettingQuery.data.settings.systems.connectSettings.config;\r\n\r\n setFormState((prevFormState) => {\r\n return {\r\n ...prevFormState,\r\n staffContactFilter: staffContactFilter,\r\n welcomeMessage: welcomeMessage,\r\n isEmailNotificationDocuments: emailDocumentNotifications,\r\n isEmailNotificationMessages: emailMessageNotifications,\r\n isPushNotificationDocuments: pushDocumentNotifications,\r\n isPushNotificationMessages: pushMessageNotifications,\r\n isExternalMessagesToActing: externalMessagesToActing,\r\n isExternalMessagesToResponsible: externalMessagesToResponsible,\r\n isExternalMessagesToAssisting: externalMessagesToAssisting,\r\n isFirmToClientPushNewDocumentNotifications: firmToClientPushNewDocumentNotifications,\r\n isFirmToClientPushNewMessageNotifications: firmToClientPushNewMessageNotifications\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n }\r\n }, [connectSettingQuery.data, connectSettingQuery.loading]);\r\n\r\n useEffect(() => {\r\n if (updateConnectSettingObj.loading) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n }\r\n if (updateConnectSettingObj.error) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onSubmitLoading: false,\r\n };\r\n });\r\n \r\n showNotification('Failed to update connect settings', updateConnectSettingObj.error.message, 'error');\r\n }\r\n }, [updateConnectSettingObj.data, updateConnectSettingObj.loading, updateConnectSettingObj.error]);\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const required = (value: any) => {\r\n return value ? undefined : 'Required';\r\n };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: AnyObject) => {\r\n updateConnectSetting({\r\n variables: {\r\n emailDocumentNotifications: values.isEmailNotificationDocuments,\r\n emailMessageNotifications: values.isEmailNotificationMessages,\r\n pushDocumentNotifications: values.isPushNotificationDocuments,\r\n pushMessageNotifications: values.isPushNotificationMessages,\r\n staffContactFilter: values.staffContactFilter,\r\n welcomeMessage: values.welcomeMessage,\r\n externalMessagesToActing: values.isExternalMessagesToActing,\r\n externalMessagesToAssisting: values.isExternalMessagesToAssisting,\r\n externalMessagesToResponsible: values.isExternalMessagesToResponsible,\r\n firmToClientPushNewDocumentNotifications: values.isFirmToClientPushNewDocumentNotifications,\r\n firmToClientPushNewMessageNotifications: values.isFirmToClientPushNewMessageNotifications\r\n }\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onSubmitLoading: true,\r\n };\r\n });\r\n\r\n };\r\n\r\n return (\r\n
\r\n {state.isLoading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n ) => onSubmit(form, values)} \r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n validate={(values: FormState) => {\r\n // tslint:disable-next-line: no-any\r\n const errors: any = {\r\n externalMessageToError: '',\r\n };\r\n\r\n if (!values.isExternalMessageToActing && !values.isExternalMessageToResponsible && !values.isExternalMessageToAssisting) {\r\n errors.externalMessageToError = 'At least one checkbox must be checked';\r\n }\r\n\r\n if (errors.externalMessageToError === '') {\r\n return undefined;\r\n }\r\n\r\n return errors;\r\n }}\r\n subscription={{\r\n submitting: true,\r\n pristine: true,\r\n errors: true\r\n }}\r\n render={({\r\n handleSubmit,\r\n form,\r\n submitting,\r\n pristine,\r\n errors\r\n }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n } aria-controls=\"panel1a-content\" id=\"panel1a-header\">\r\n For notifications from the Client to the Firm\r\n \r\n \r\n \r\n \r\n \r\n Send email notification for\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"New Documents\"\r\n />\r\n )}\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"New Messages\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Notify\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Acting\"\r\n />\r\n )}\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Responsible\"\r\n />\r\n )}\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Assisting\"\r\n />\r\n )}\r\n \r\n \r\n {errors && errors.externalMessageToError && (\r\n {errors.externalMessageToError}\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n } aria-controls=\"panel1a-content\" id=\"panel1a-header\">\r\n For Notifications from the Firm to the Client\r\n \r\n \r\n \r\n \r\n Send email notification for\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"New Documents\"\r\n />\r\n )}\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"New Messages\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n {\r\n let existingFiles: DocumentFile[] = [...input.value];\r\n const newFiles = files.filter((file: File) => {\r\n return !existingFiles.some((item: DocumentFile) => {\r\n return item.name === file.name && item.status !== 2;\r\n });\r\n });\r\n if (newFiles && newFiles.length > 0) {\r\n newFiles.forEach((file: File) => {\r\n const documentFile: DocumentFile = {\r\n guidID: null,\r\n file: file,\r\n status: 1,\r\n name: file.name,\r\n url: ''\r\n };\r\n existingFiles.push(documentFile);\r\n }); \r\n input.onChange(existingFiles);\r\n }\r\n }}\r\n onDelete={(file: File) => {\r\n let existingFiles: DocumentFile[] = [...input.value];\r\n // eslint-disable-next-line array-callback-return\r\n existingFiles.map((item: DocumentFile) => {\r\n if (file.name === item.name) {\r\n item.file = file;\r\n item.status = 2; // deleted\r\n }\r\n }); \r\n // tslint:disable-next-line: max-line-length\r\n const filteredFiles = existingFiles.filter((item: DocumentFile) => {\r\n return item.status !== 2 || item.guidID !== null;\r\n });\r\n input.onChange(filteredFiles);\r\n }} \r\n // tslint:disable-next-line:no-any\r\n onDrop={(files: File[], event: any) => {\r\n // let existingFiles: DocumentFile[] = [...input.value];\r\n // tslint:disable-next-line: max-line-length\r\n // const existingFile = existingFiles.find((item: DocumentFile) => item.name === file)\r\n // tslint:disable-next-line:no-console\r\n console.log(event);\r\n }} \r\n initialFiles={input.value.map((file: { url: string; }) => file.url)}\r\n dropzoneText=\"Alternate Mobile App Logo\"\r\n />\r\n )}\r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n )}\r\n
\r\n );\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport function printJson(values: any) {\r\n if (values) {\r\n return (\r\n <>\r\n
\r\n                    {JSON.stringify(values, undefined, 2)}\r\n                
\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n
\r\n                            {JSON.stringify(values, undefined, 2)}\r\n                            {/*  */}\r\n                        
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nexport interface ConnectSettingQueryData {\r\n settings: Settings;\r\n}\r\n\r\nexport interface Settings {\r\n systems: Systems;\r\n}\r\n\r\nexport interface Systems {\r\n connectSettings: ConnectSettings;\r\n}\r\n\r\nexport interface ConnectSettings {\r\n id: number;\r\n config: Config;\r\n}\r\n\r\nexport interface Config {\r\n id: number;\r\n emailDocumentNotifications: boolean;\r\n emailMessageNotifications: boolean;\r\n pushDocumentNotifications: boolean;\r\n pushMessageNotifications: boolean;\r\n externalMessagesToActing: boolean;\r\n externalMessagesToResponsible: boolean;\r\n externalMessagesToAssisting: boolean;\r\n staffContactFilter: string;\r\n welcomeMessage: string;\r\n firmToClientPushNewDocumentNotifications: boolean;\r\n firmToClientPushNewMessageNotifications: boolean;\r\n}\r\n\r\nconst ConnectSettingQuery = gql`\r\n query ConnectSetting {\r\n settings {\r\n id\r\n systems {\r\n connectSettings {\r\n id\r\n config {\r\n id\r\n emailDocumentNotifications\r\n emailMessageNotifications\r\n pushDocumentNotifications\r\n pushMessageNotifications\r\n staffContactFilter\r\n welcomeMessage\r\n externalMessagesToResponsible\r\n externalMessagesToActing\r\n externalMessagesToAssisting\r\n firmToClientPushNewDocumentNotifications\r\n firmToClientPushNewMessageNotifications\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\ninterface ConnectSettingMutationParams {\r\n staffContactFilter: String | null;\r\n welcomeMessage: String | null;\r\n emailDocumentNotifications: Boolean;\r\n emailMessageNotifications: Boolean;\r\n pushDocumentNotifications: Boolean;\r\n pushMessageNotifications: Boolean;\r\n externalMessagesToActing: boolean;\r\n externalMessagesToResponsible: boolean;\r\n externalMessagesToAssisting: boolean;\r\n firmToClientPushNewDocumentNotifications: boolean;\r\n firmToClientPushNewMessageNotifications: boolean;\r\n}\r\n\r\nconst CONNECT_SETTINGS_MUTATION = gql`\r\n mutation ConnectSettingsMutation(\r\n $staffContactFilter: String,\r\n $welcomeMessage: String,\r\n $emailDocumentNotifications: Boolean,\r\n $emailMessageNotifications: Boolean,\r\n $pushDocumentNotifications: Boolean,\r\n $pushMessageNotifications: Boolean,\r\n $externalMessagesToResponsible: Boolean,\r\n $externalMessagesToActing: Boolean,\r\n $externalMessagesToAssisting: Boolean,\r\n $firmToClientPushNewDocumentNotifications: Boolean,\r\n $firmToClientPushNewMessageNotifications: Boolean\r\n ){\r\n settings {\r\n connectSettings {\r\n update (\r\n staffContactFilter: $staffContactFilter,\r\n welcomeMessage: $welcomeMessage,\r\n emailDocumentNotifications: $emailDocumentNotifications,\r\n emailMessageNotifications: $emailMessageNotifications,\r\n pushDocumentNotifications: $pushDocumentNotifications,\r\n pushMessageNotifications: $pushMessageNotifications,\r\n externalMessagesToResponsible: $externalMessagesToResponsible,\r\n externalMessagesToActing: $externalMessagesToActing,\r\n externalMessagesToAssisting: $externalMessagesToAssisting,\r\n firmToClientPushNewDocumentNotifications: $firmToClientPushNewDocumentNotifications,\r\n firmToClientPushNewMessageNotifications: $firmToClientPushNewMessageNotifications\r\n ) {\r\n status\r\n error\r\n }\r\n }\r\n }\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { Button, Checkbox, createStyles, FormControlLabel, FormGroup, Grid, makeStyles, Theme } from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\nimport gql from 'graphql-tag';\r\nimport { useMutation, useQuery } from 'react-apollo';\r\nimport { showNotification } from '../../App';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n textField: {\r\n width: '100%'\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n formGroup: {\r\n alignItems: 'flex-start',\r\n '& .MuiFormControlLabel-root': {\r\n marginLeft: 0,\r\n }\r\n },\r\n radioGroup: {\r\n flexDirection: 'row'\r\n }\r\n })\r\n);\r\n\r\ninterface FormState {\r\n warnOnDefaultTime: boolean;\r\n warnOnExceedingHours: boolean;\r\n warnIfNotToday: boolean;\r\n}\r\ninterface TimeRecordingWarningDefaultsTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function TimeRecordingWarningDefaultsTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: true,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n warnOnDefaultTime: false,\r\n warnOnExceedingHours: false,\r\n warnIfNotToday: false,\r\n });\r\n\r\n const timeRecordingWarnings = useQuery(TIME_RECORDING_WARNING_QUERY);\r\n\r\n // tslint:disable-next-line: no-any\r\n const [updateTimeRecordingWarnings] = useMutation(TIME_RECORDING_WARNING_MUTATION);\r\n\r\n useEffect(() => {\r\n \r\n // tslint:disable-next-line: max-line-length\r\n if (!timeRecordingWarnings.loading && timeRecordingWarnings.data) {\r\n\r\n const { \r\n warnIfNotToday,\r\n warnOnExceedingHours,\r\n } = timeRecordingWarnings.data.settings.systems.timeRecordingWarnings.config;\r\n\r\n setFormState((prevFormState) => {\r\n return {\r\n ...prevFormState,\r\n warnIfNotToday: warnIfNotToday,\r\n warnOnExceedingHours: warnOnExceedingHours,\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n }\r\n }, [timeRecordingWarnings.data, timeRecordingWarnings.loading]);\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: AnyObject) => {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onSubmitLoading: true,\r\n };\r\n });\r\n\r\n updateTimeRecordingWarnings({\r\n variables: {\r\n warnIfNotToday: values.warnIfNotToday,\r\n warnOnExceedingHours: values.warnOnExceedingHours,\r\n }\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update time recording warnings', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n });\r\n };\r\n\r\n return (\r\n
\r\n {state.isLoading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n ) => onSubmit(form, values)} \r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{\r\n submitting: true,\r\n pristine: true\r\n }}\r\n render={({\r\n handleSubmit,\r\n form,\r\n submitting,\r\n pristine,\r\n values\r\n }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Warning on Exceeding Hours\" \r\n />\r\n )}\r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Warn if not today\" \r\n />\r\n )}\r\n \r\n {/* \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Warn on Default Time\" \r\n />\r\n )}\r\n */}\r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n )}\r\n
\r\n );\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport function printJson(values: any) {\r\n if (values) {\r\n return (\r\n <>\r\n
\r\n                    {JSON.stringify(values, undefined, 2)}\r\n                
\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n
\r\n                            {JSON.stringify(values, undefined, 2)}\r\n                            {/*  */}\r\n                        
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nexport interface TimeRecordingWarningsData {\r\n settings: Settings;\r\n}\r\n\r\nexport interface Settings {\r\n id: number;\r\n systems: Systems;\r\n}\r\n\r\nexport interface Systems {\r\n timeRecordingWarnings: TimeRecordingWarnings;\r\n}\r\n\r\nexport interface TimeRecordingWarnings {\r\n id: number;\r\n config: Config;\r\n}\r\n\r\nexport interface Config {\r\n id: number;\r\n warnIfNotToday: boolean;\r\n warnOnExceedingHours: boolean;\r\n}\r\n\r\nconst TIME_RECORDING_WARNING_QUERY = gql`\r\n query timeRecordingWarnings {\r\n settings {\r\n id\r\n systems {\r\n timeRecordingWarnings {\r\n id\r\n config {\r\n id\r\n warnIfNotToday\r\n warnOnExceedingHours\r\n }\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\ninterface TimeRecordingWarningsMutationParams {\r\n warnOnExceedingHours: Boolean;\r\n warnIfNotToday: Boolean;\r\n}\r\n\r\nconst TIME_RECORDING_WARNING_MUTATION = gql`\r\n mutation timeRecordingWarnings(\r\n $warnIfNotToday: Boolean,\r\n $warnOnExceedingHours: Boolean,\r\n ){\r\n settings {\r\n timeRecordingWarnings {\r\n update (\r\n warnIfNotToday: $warnIfNotToday,\r\n warnOnExceedingHours: $warnOnExceedingHours,\r\n ) {\r\n status\r\n error\r\n }\r\n }\r\n }\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { Button, createStyles, Grid, makeStyles, TextField, Theme } from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport gql from 'graphql-tag';\r\nimport { showNotification } from '../../App';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport NumberFormat from 'react-number-format';\r\nimport { client } from '../..';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport { FetchPolicy } from 'apollo-client';\r\nimport { firmSubscription } from '../../lookupConfiguration/tabs/LookupNameTagTypeMaintenance';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n textField: {\r\n width: '100%'\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n formGroup: {\r\n alignItems: 'flex-start',\r\n '& .MuiFormControlLabel-root': {\r\n marginLeft: 0,\r\n }\r\n },\r\n radioGroup: {\r\n flexDirection: 'row'\r\n }\r\n })\r\n);\r\n\r\ninterface FormState {\r\n completionDate: string | null;\r\n instructionDate: string | null;\r\n internalImportanceLevel?: number | null;\r\n externalImportanceLevel?: number | null;\r\n clientNoteActivityCategory?: number | null;\r\n clientNoteActivityType?: number | null;\r\n fileNoteActivityCategory?: number | null;\r\n fileNoteActivityType?: number | null;\r\n applicationNumber?: string | null;\r\n grantNumber?: string | null;\r\n publicationNumber?: string | null;\r\n}\r\n\r\ninterface InprotechTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function InprotechTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: false,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState();\r\n\r\n useEffect(() => {\r\n fetchData();\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const fetchData = () => {\r\n fetchInProtectionSettings(\r\n true,\r\n (data: SettingsData) => onInProtechRetrievedData(data),\r\n // tslint:disable-next-line: no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n useEffect(() => {\r\n const subscribeFirmObj = inProtechSettingsNotification();\r\n\r\n return () => {\r\n subscribeFirmObj.unsubscribe();\r\n };\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const inProtechSettingsNotification = () => {\r\n return (\r\n // let subscription =\r\n client\r\n .subscribe({\r\n fetchPolicy: 'no-cache',\r\n query: firmSubscription,\r\n variables: {},\r\n })\r\n .subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n if (results.data.lookupNotification.status) {\r\n const { lookupNotification } = results.data;\r\n showNotification('Success', lookupNotification.message, 'info');\r\n } else {\r\n showNotification('Failed', results.data.lookupNotification.message, 'error');\r\n }\r\n },\r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n },\r\n })\r\n );\r\n };\r\n\r\n const onInProtechRetrievedData = (data: SettingsData) => {\r\n if (data && data.settings && data.settings.systems && data.settings.systems.inprotechSettings && data.settings.systems.inprotechSettings.config) {\r\n const config = data.settings.systems.inprotechSettings.config;\r\n setFormState((prevFormState) => {\r\n return {\r\n ...prevFormState,\r\n completionDate: config.completionDate,\r\n instructionDate: config.instructionDate,\r\n internalImportanceLevel: config.externalImportanceLevel ?? 5,\r\n externalImportanceLevel: config.internalImportanceLevel ?? 10,\r\n clientNoteActivityCategory: config.clientNoteActivityCategory,\r\n clientNoteActivityType: config.clientNoteActivityType,\r\n fileNoteActivityCategory: config.fileNoteActivityCategory,\r\n fileNoteActivityType: config.fileNoteActivityType,\r\n applicationNumber: config.applicationNumber,\r\n grantNumber: config.grantNumber,\r\n publicationNumber: config.publicationNumber\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: AnyObject) => {\r\n // console.log('values', values);\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onSubmitLoading: true,\r\n };\r\n });\r\n\r\n showNotification('Success', 'Successfully submitted.', 'info');\r\n\r\n client.mutate({\r\n mutation: INPROTECH_MUTATION,\r\n variables: {\r\n registrationDate: values.completionDate,\r\n filingDate: values.instructionDate,\r\n internalImportanceLevel: values.internalImportanceLevel,\r\n externalImportanceLevel: values.externalImportanceLevel,\r\n clientNoteActivityCategory: values.clientNoteActivityCategory,\r\n clientNoteActivityType: values.clientNoteActivityType,\r\n fileNoteActivityCategory: values.fileNoteActivityCategory,\r\n fileNoteActivityType: values.fileNoteActivityType,\r\n grantNumber: values.grantNumber,\r\n applicationNumber: values.applicationNumber,\r\n publicationNumber: values.publicationNumber\r\n }\r\n // tslint:disable-next-line: no-any\r\n }).then((result: {data: any}) => {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onSubmitLoading: false,\r\n };\r\n });\r\n // tslint:disable-next-line: no-any\r\n }).catch((reason: any) => {\r\n showNotification('Failed to upadte InProtech Settings.', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n });\r\n };\r\n\r\n return (\r\n
\r\n {state.isLoading ? (\r\n
\r\n \r\n
\r\n ) : formState && (\r\n ) => onSubmit(form, values)} \r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{\r\n submitting: true,\r\n pristine: true\r\n }}\r\n render={({\r\n handleSubmit,\r\n form,\r\n submitting,\r\n pristine,\r\n values\r\n }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n
\r\n \r\n\r\n \r\n
\r\n
\r\n
\r\n \r\n )}\r\n />\r\n )}\r\n
\r\n );\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport function printJson(values: any) {\r\n if (values) {\r\n return (\r\n <>\r\n
\r\n                    {JSON.stringify(values, undefined, 2)}\r\n                
\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n
\r\n                            {JSON.stringify(values, undefined, 2)}\r\n                            {/*  */}\r\n                        
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\nconst fetchInProtectionSettings = (\r\n refreshData: boolean,\r\n onSuccess: (data: SettingsData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void\r\n ) => {\r\n \r\n var fetchPolicy: FetchPolicy = refreshData ? 'network-only' : 'cache-first';\r\n\r\n client.query({\r\n query: INPROTECH_QUERY,\r\n variables: {},\r\n fetchPolicy: fetchPolicy\r\n })\r\n .then((results: {data: SettingsData}) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => { onError(reason); });\r\n};\r\n\r\ninterface CustomNumberFormatProps {\r\n inputRef: (instance: NumberFormat | null) => void;\r\n onChange: (event: { target: { name: string; value: string } }) => void;\r\n name: string;\r\n minValue?: number;\r\n maxValue?: number;\r\n}\r\n\r\nfunction CustomNumberFormat(props: CustomNumberFormatProps) {\r\n const { inputRef, onChange, minValue, maxValue, ...other } = props;\r\n\r\n return (\r\n {\r\n onChange({\r\n target: {\r\n name: props.name,\r\n value: values.value,\r\n },\r\n });\r\n }}\r\n isNumericString={true}\r\n isAllowed={(values) => {\r\n const { formattedValue, floatValue } = values;\r\n if (floatValue == null) {\r\n return formattedValue === '';\r\n } else {\r\n return (floatValue >= (minValue ?? Math.max()) && floatValue <= (maxValue ?? Math.min()));\r\n }\r\n }}\r\n />\r\n );\r\n }\r\n\r\ninterface InProtechSettings {\r\n id: number;\r\n config: {\r\n completionDate: string;\r\n instructionDate: string;\r\n externalImportanceLevel?: number;\r\n internalImportanceLevel?: number;\r\n clientNoteActivityCategory?: number;\r\n clientNoteActivityType?: number;\r\n fileNoteActivityCategory?: number;\r\n fileNoteActivityType?: number;\r\n grantNumber?: string;\r\n applicationNumber?: string;\r\n publicationNumber?: string;\r\n };\r\n}\r\n\r\ninterface InProtech {\r\n id: number;\r\n inprotechSettings: InProtechSettings;\r\n}\r\n\r\ninterface SystemSettings {\r\n id: number;\r\n systems: InProtech;\r\n}\r\n\r\ninterface SettingsData {\r\n settings: SystemSettings;\r\n}\r\n\r\nconst INPROTECH_MUTATION = gql`\r\n mutation InProtechSettings (\r\n $filingDate: String,\r\n $registrationDate: String,\r\n $internalImportanceLevel: Int,\r\n $externalImportanceLevel: Int,\r\n $clientNoteActivityCategory: Int,\r\n $clientNoteActivityType: Int,\r\n $fileNoteActivityCategory: Int,\r\n $fileNoteActivityType: Int,\r\n $grantNumber: String,\r\n $applicationNumber: String,\r\n $publicationNumber: String\r\n ) {\r\n settings {\r\n inprotechSettings {\r\n update (\r\n filingDate: $filingDate,\r\n registrationDate: $registrationDate,\r\n internalImportanceLevel: $internalImportanceLevel,\r\n externalImportanceLevel: $externalImportanceLevel,\r\n clientNoteActivityCategory: $clientNoteActivityCategory,\r\n clientNoteActivityType: $clientNoteActivityType,\r\n fileNoteActivityCategory: $fileNoteActivityCategory,\r\n fileNoteActivityType: $fileNoteActivityType,\r\n grantNumber: $grantNumber,\r\n applicationNumber: $applicationNumber,\r\n publicationNumber: $publicationNumber\r\n ) {\r\n error\r\n status\r\n }\r\n }\r\n }\r\n }\r\n`;\r\n\r\nconst INPROTECH_QUERY = gql`\r\nquery InproTechSettings {\r\n settings {\r\n id\r\n systems {\r\n id\r\n inprotechSettings {\r\n id\r\n config {\r\n id\r\n completionDate\r\n instructionDate\r\n externalImportanceLevel\r\n internalImportanceLevel\r\n clientNoteActivityCategory\r\n clientNoteActivityType\r\n fileNoteActivityCategory\r\n fileNoteActivityType\r\n grantNumber\r\n applicationNumber\r\n \tpublicationNumber\r\n }\r\n }\r\n }\r\n }\r\n}\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport {\r\n Accordion,\r\n AccordionDetails,\r\n AccordionSummary,\r\n Button,\r\n Checkbox,\r\n createStyles,\r\n FormControlLabel,\r\n FormGroup,\r\n Grid,\r\n makeStyles,\r\n Theme,\r\n Typography,\r\n} from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { Field, Form, FormSpy } from 'react-final-form';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers';\r\nimport { ReminderSelector } from '../../components/ReminderSelector';\r\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\r\nimport { mainTheme } from '../../Theme';\r\nimport MomentUtils from '@date-io/moment';\r\nimport {\r\n retrievePhoneMessageDefaultConfigData,\r\n TaskAndPhoneMessageDefaultConfigMutationParams,\r\n PhoneMessageDefaultsData,\r\n UPDATE_PHONE_MESSAGE_DEFAULT_CONFIG_MUTATION,\r\n} from '../FirmSettingConfigurationRepository';\r\nimport { showNotification } from '../../App';\r\nimport { client } from '../..';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n heading: {\r\n fontSize: theme.typography.pxToRem(15),\r\n fontWeight: 600,\r\n color: theme.palette.primary.main,\r\n },\r\n accordionDetails: {\r\n flexFlow: 'column',\r\n },\r\n radioGroup: {\r\n flexFlow: 'row wrap',\r\n },\r\n formControl: {\r\n margin: '10px 0',\r\n },\r\n optionContainer: {},\r\n optionList: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n padding: '10px 0',\r\n margin: '0 -5px',\r\n '& > span': {\r\n margin: '0 5px',\r\n },\r\n '& > div': {\r\n margin: '0 5px',\r\n },\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n },\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n reminderTextField: {\r\n width: '30%',\r\n },\r\n radioIcon: {\r\n color: mainTheme.BrandColors.TemplatePrimary,\r\n },\r\n }),\r\n);\r\n\r\ninterface FormState {\r\n reminder?: IAutoCompleteItem;\r\n overdueReminder?: IAutoCompleteItem;\r\n isSendReminderOnWeekend: boolean;\r\n isSendReminderOnWeekendForOverDueReminders: boolean;\r\n}\r\ninterface PhoneMessageDefaultConfigurationTabState {\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n isLoading: boolean;\r\n}\r\n\r\nexport const PhoneMessageDefaultConfigurationTab: React.FC = () => {\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n isLoading: true,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n reminder: { value: 'None', label: 'None' },\r\n overdueReminder: { value: 'None', label: 'None' },\r\n isSendReminderOnWeekend: false,\r\n isSendReminderOnWeekendForOverDueReminders: false,\r\n });\r\n\r\n useEffect(() => {\r\n fetchData();\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const fetchData = () => {\r\n retrievePhoneMessageDefaultConfigData(\r\n true,\r\n // tslint:disable-next-line: no-console\r\n (data: PhoneMessageDefaultsData) => onPhoneMessageDefaultConfigRetrieved(data),\r\n // tslint:disable-next-line: no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onPhoneMessageDefaultConfigRetrieved = (data: PhoneMessageDefaultsData) => {\r\n const config = data.settings.systems.phoneMessageDefaults.config;\r\n\r\n setFormState((prevFormState) => {\r\n\r\n return {\r\n ...prevFormState,\r\n reminder: config.reminder ? { value: config.reminder, label: config.reminder } : formState.reminder,\r\n overdueReminder: config.overdueReminder ? { value: config.overdueReminder, label: config.overdueReminder } : formState.overdueReminder,\r\n isSendReminderOnWeekend: config.isSendReminderOnWeekend,\r\n isSendReminderOnWeekendForOverDueReminders: config.isSendReminderOnWeekendForOverDueReminders\r\n };\r\n });\r\n setState((prevState) => {\r\n\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true,\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: FormState) => {\r\n // tslint:disable-next-line: no-console\r\n // console.log('submit', values);\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onSubmitLoading: true,\r\n };\r\n });\r\n\r\n client\r\n // tslint:disable-next-line: no-any\r\n .mutate({\r\n mutation: UPDATE_PHONE_MESSAGE_DEFAULT_CONFIG_MUTATION,\r\n variables: {\r\n reminder: values.reminder ? values.reminder.value : 'None',\r\n overdueReminder: values.overdueReminder ? values.overdueReminder.value : 'None',\r\n isSendReminderOnWeekend: values.isSendReminderOnWeekend,\r\n isSendReminderOnWeekendForOverDueReminders: values.isSendReminderOnWeekendForOverDueReminders,\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false,\r\n };\r\n });\r\n\r\n // reset the field and set to the current changes after saved.\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset(values);\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update enquiry default', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false,\r\n };\r\n });\r\n });\r\n };\r\n\r\n if (state.isLoading) {\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n return (\r\n \r\n
\r\n ) => onSubmit(form, values)}\r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{ submitting: true, pristine: true }}\r\n // validate={(values: FormState) => {\r\n // let errors = {\r\n // addDays: '',\r\n // addHours: ''\r\n // };\r\n\r\n // if (errors.addDays === '' && errors.addHours === '') {\r\n // return undefined;\r\n // }\r\n\r\n // return errors;\r\n // }}\r\n render={({ handleSubmit, form, submitting, pristine, values }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n\r\n \r\n \r\n \r\n } aria-controls=\"panel1a-content\">\r\n Phone Message Reminder Default\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send reminder on weekend\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n Send reminder\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={meta.error && meta.touched ? meta.error : ''}\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n before phone message due\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n } aria-controls=\"panel1a-content\">\r\n Phone Message Overdue Reminder Default\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send reminder on weekend\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n Send overdue reminder\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={meta.error && meta.touched ? meta.error : ''}\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n after phone message due\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n Save\r\n \r\n \r\n Reset\r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default PhoneMessageDefaultConfigurationTab;\r\n\r\n// tslint:disable-next-line: no-any\r\n// export function printJson(values: any) {\r\n// if (values) {\r\n// return (\r\n// <>\r\n//
\r\n//                     {JSON.stringify(values, undefined, 2)}\r\n//                 
\r\n// \r\n// );\r\n// } else {\r\n// return (\r\n// <>\r\n// \r\n// {/* tslint:disable-next-line: no-shadowed-variable */}\r\n// {({ values }) => (\r\n//
\r\n//                             {JSON.stringify(values, undefined, 2)}\r\n//                             {/*  */}\r\n//                         
\r\n// )}\r\n//
\r\n// \r\n// );\r\n// }\r\n// }\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport {\r\n Accordion,\r\n AccordionDetails,\r\n AccordionSummary,\r\n Button,\r\n Checkbox,\r\n createStyles,\r\n FormControlLabel,\r\n FormGroup,\r\n Grid,\r\n makeStyles,\r\n Theme,\r\n Typography,\r\n} from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { Field, Form, FormSpy } from 'react-final-form';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { MuiPickersUtilsProvider } from '@material-ui/pickers';\r\nimport { ReminderSelector } from '../../components/ReminderSelector';\r\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\r\nimport { mainTheme } from '../../Theme';\r\nimport MomentUtils from '@date-io/moment';\r\nimport {\r\n retrieveTaskDefaultConfigData,\r\n TaskAndPhoneMessageDefaultConfigMutationParams,\r\n TaskDefaultsData,\r\n UPDATE_TASK_DEFAULT_CONFIG_MUTATION,\r\n} from '../FirmSettingConfigurationRepository';\r\nimport { showNotification } from '../../App';\r\nimport { client } from '../..';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n heading: {\r\n fontSize: theme.typography.pxToRem(15),\r\n fontWeight: 600,\r\n color: theme.palette.primary.main,\r\n },\r\n accordionDetails: {\r\n flexFlow: 'column',\r\n },\r\n radioGroup: {\r\n flexFlow: 'row wrap',\r\n },\r\n formControl: {\r\n margin: '10px 0',\r\n },\r\n optionContainer: {},\r\n optionList: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n padding: '10px 0',\r\n margin: '0 -5px',\r\n '& > span': {\r\n margin: '0 5px',\r\n },\r\n '& > div': {\r\n margin: '0 5px',\r\n },\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n },\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n reminderTextField: {\r\n width: '30%',\r\n },\r\n radioIcon: {\r\n color: mainTheme.BrandColors.TemplatePrimary,\r\n },\r\n }),\r\n);\r\n\r\ninterface FormState {\r\n reminder?: IAutoCompleteItem;\r\n overdueReminder?: IAutoCompleteItem;\r\n isSendReminderOnWeekend: boolean;\r\n isSendReminderOnWeekendForOverDueReminders: boolean;\r\n}\r\ninterface TaskDefaultConfigurationTabState {\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n isLoading: boolean;\r\n}\r\n\r\nexport const TaskDefaultConfigurationTab: React.FC = () => {\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n isLoading: true,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n reminder: { value: 'None', label: 'None' },\r\n overdueReminder: { value: 'None', label: 'None' },\r\n isSendReminderOnWeekend: false,\r\n isSendReminderOnWeekendForOverDueReminders: false,\r\n });\r\n\r\n useEffect(() => {\r\n fetchData();\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const fetchData = () => {\r\n retrieveTaskDefaultConfigData(\r\n true,\r\n // tslint:disable-next-line: no-console\r\n (data: TaskDefaultsData) => onTaskDefaultConfigRetrieved(data),\r\n // tslint:disable-next-line: no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onTaskDefaultConfigRetrieved = (data: TaskDefaultsData) => {\r\n const config = data.settings.systems.taskDefaults.config;\r\n\r\n setFormState((prevFormState) => {\r\n\r\n return {\r\n ...prevFormState,\r\n reminder: config.reminder ? { value: config.reminder, label: config.reminder } : formState.reminder,\r\n overdueReminder: config.overdueReminder ? { value: config.overdueReminder, label: config.overdueReminder } : formState.overdueReminder,\r\n isSendReminderOnWeekend: config.isSendReminderOnWeekend,\r\n isSendReminderOnWeekendForOverDueReminders: config.isSendReminderOnWeekendForOverDueReminders\r\n };\r\n });\r\n setState((prevState) => {\r\n\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true,\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: FormState) => {\r\n // tslint:disable-next-line: no-console\r\n // console.log('submit', values);\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onSubmitLoading: true,\r\n };\r\n });\r\n\r\n client\r\n // tslint:disable-next-line: no-any\r\n .mutate({\r\n mutation: UPDATE_TASK_DEFAULT_CONFIG_MUTATION,\r\n variables: {\r\n reminder: values.reminder ? values.reminder.value : 'None',\r\n overdueReminder: values.overdueReminder ? values.overdueReminder.value : 'None',\r\n isSendReminderOnWeekend: values.isSendReminderOnWeekend,\r\n isSendReminderOnWeekendForOverDueReminders: values.isSendReminderOnWeekendForOverDueReminders,\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false,\r\n };\r\n });\r\n\r\n // reset the field and set to the current changes after saved.\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset(values);\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update enquiry default', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false,\r\n };\r\n });\r\n });\r\n };\r\n\r\n if (state.isLoading) {\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n return (\r\n \r\n
\r\n ) => onSubmit(form, values)}\r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{ submitting: true, pristine: true }}\r\n // validate={(values: FormState) => {\r\n // let errors = {\r\n // addDays: '',\r\n // addHours: ''\r\n // };\r\n\r\n // if (errors.addDays === '' && errors.addHours === '') {\r\n // return undefined;\r\n // }\r\n\r\n // return errors;\r\n // }}\r\n render={({ handleSubmit, form, submitting, pristine, values }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n\r\n \r\n \r\n \r\n } aria-controls=\"panel1a-content\">\r\n Task Reminder Default\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send reminder on weekend\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n Send reminder\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={meta.error && meta.touched ? meta.error : ''}\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n before task due\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n \r\n } aria-controls=\"panel1a-content\">\r\n Task Overdue Reminder Default\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Send reminder on weekend\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n
\r\n
\r\n Send overdue reminder\r\n \r\n {({ input, meta }) => (\r\n {\r\n input.onChange(selection);\r\n }}\r\n error={meta.error && meta.touched}\r\n helperText={meta.error && meta.touched ? meta.error : ''}\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n after task due\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n Save\r\n \r\n \r\n Reset\r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n )}\r\n />\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default TaskDefaultConfigurationTab;\r\n\r\n// tslint:disable-next-line: no-any\r\n// export function printJson(values: any) {\r\n// if (values) {\r\n// return (\r\n// <>\r\n//
\r\n//                     {JSON.stringify(values, undefined, 2)}\r\n//                 
\r\n// \r\n// );\r\n// } else {\r\n// return (\r\n// <>\r\n// \r\n// {/* tslint:disable-next-line: no-shadowed-variable */}\r\n// {({ values }) => (\r\n//
\r\n//                             {JSON.stringify(values, undefined, 2)}\r\n//                             {/*  */}\r\n//                         
\r\n// )}\r\n//
\r\n// \r\n// );\r\n// }\r\n// }\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { Accordion, AccordionDetails, AccordionSummary, Button, Checkbox, createStyles, FormControlLabel, FormGroup, Grid, makeStyles, Theme, Typography } from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport React, { useMemo, useState } from 'react';\r\nimport { Field, Form, FormSpy } from 'react-final-form';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\r\nimport { showNotification } from '../../App';\r\nimport { client } from '../..';\r\nimport CheckBoxIcon from '@material-ui/icons/CheckBox';\r\nimport {\r\n ClientAndContacsDefaultConfigurationQuery,\r\n ClientAndContactDefaultConfigParams,\r\n ClientAndContactsDefaultConfigurationMutation,\r\n ClientAndContactsDefaultsData,\r\n} from '../FirmSettingConfigurationRepository';\r\nimport { CorrespondenceActivityData } from '../../hooks/useCorrespondenceActivity';\r\n// import { useClietAndMatterNoteSubjectQuery } from '../../hooks/useClientAndMatterNoteSubject';\r\n// import { GenericSelectorIAutoCompateItem } from '../../components/selectors/GenericSelector';\r\nimport { CorrespondenceActivitySelector } from '../../lookupConfiguration/selectors/CorrespondenceActivitySelector';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { ClientAndMatterNoteSubjectData, SubjectSelector } from '../selectors/SubjectSelector';\r\nimport { useQuery } from 'react-apollo';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n heading: {\r\n fontSize: theme.typography.pxToRem(15),\r\n fontWeight: 600,\r\n color: theme.palette.primary.main,\r\n },\r\n radioGroup: {\r\n flexFlow: 'row wrap',\r\n },\r\n accordionDetails: {\r\n flexFlow: 'column',\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n },\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n }),\r\n);\r\n\r\ninterface FormState {\r\n isNoteTypeMandatory: boolean;\r\n isNoteSubjectMandatory: boolean;\r\n\r\n outlookAddinType: IAutoCompleteItem | null;\r\n outlookAddinSubject: IAutoCompleteItem | null;\r\n eventCreationType: IAutoCompleteItem | null;\r\n eventCreationSubject: IAutoCompleteItem | null;\r\n campaignCreationType: IAutoCompleteItem | null;\r\n campaignCreationSubject: IAutoCompleteItem | null;\r\n}\r\n\r\ninterface ClientAndContactsDefaultConfigurationTabState {\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n noteTypeData: CorrespondenceActivityData | null | undefined;\r\n noteSubjectData: ClientAndMatterNoteSubjectData | null | undefined;\r\n}\r\n\r\nexport const ClientAndContactsDefaultConfigurationTab: React.FC = () => {\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n noteTypeData: null,\r\n noteSubjectData: null,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n isNoteTypeMandatory: false,\r\n isNoteSubjectMandatory: false,\r\n campaignCreationSubject: null,\r\n campaignCreationType: null,\r\n eventCreationSubject: null,\r\n eventCreationType: null,\r\n outlookAddinSubject: null,\r\n outlookAddinType: null,\r\n });\r\n\r\n // tslint:disable-next-line: no-any\r\n const clientAndContactDefaultConfigQuery = useQuery(ClientAndContacsDefaultConfigurationQuery);\r\n\r\n useMemo(() => {\r\n\r\n if (!clientAndContactDefaultConfigQuery.loading && !clientAndContactDefaultConfigQuery.error && clientAndContactDefaultConfigQuery.data) {\r\n \r\n const { config } = clientAndContactDefaultConfigQuery.data.settings.systems.clientAndContactDefaults;\r\n\r\n setFormState((prevFormState) => {\r\n return {\r\n ...prevFormState,\r\n isNoteTypeMandatory: config.isNoteTypeMandatory,\r\n isNoteSubjectMandatory: config.isNoteSubjectMandatory,\r\n outlookAddinType:\r\n config.outlookAddinNoteTypeGuid && config.outlookAddinNoteTypeDescription\r\n ? { value: config.outlookAddinNoteTypeGuid, label: config.outlookAddinNoteTypeDescription }\r\n : null,\r\n outlookAddinSubject:\r\n config.outlookAddinNoteSubjectId && config.outlookAddinNoteSubjectDescription\r\n ? { value: config.outlookAddinNoteSubjectId.toString(), label: config.outlookAddinNoteSubjectDescription }\r\n : null,\r\n eventCreationType:\r\n config.eventCreationNoteTypeGuid && config.eventCreationNoteTypeDescription\r\n ? { value: config.eventCreationNoteTypeGuid, label: config.eventCreationNoteTypeDescription }\r\n : null,\r\n eventCreationSubject:\r\n config.eventCreationNoteSubjectId && config.eventCreationNoteSubjectDescription\r\n ? { value: config.eventCreationNoteSubjectId.toString(), label: config.eventCreationNoteSubjectDescription }\r\n : null,\r\n campaignCreationType:\r\n config.campaignCreationNoteTypeGuid && config.campaignCreationNoteTypeDescription\r\n ? { value: config.campaignCreationNoteTypeGuid, label: config.campaignCreationNoteTypeDescription }\r\n : null,\r\n campaignCreationSubject:\r\n config.campaignCreationNoteSubjectId && config.campaignCreationNoteSubjectDescription\r\n ? { value: config.campaignCreationNoteSubjectId.toString(), label: config.campaignCreationNoteSubjectDescription }\r\n : null,\r\n };\r\n });\r\n }\r\n // tslint:disable-next-line: align\r\n }, [clientAndContactDefaultConfigQuery.data, clientAndContactDefaultConfigQuery.loading, clientAndContactDefaultConfigQuery.error]);\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true,\r\n };\r\n });\r\n }\r\n };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: FormState) => {\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onSubmitLoading: true,\r\n };\r\n });\r\n\r\n client\r\n // tslint:disable-next-line: no-any\r\n .mutate({\r\n mutation: ClientAndContactsDefaultConfigurationMutation,\r\n variables: {\r\n isNoteSubjectMandatory: values.isNoteSubjectMandatory,\r\n isNoteTypeMandatory: values.isNoteTypeMandatory,\r\n outlookAddinNoteTypeGuid: values.outlookAddinType ? values.outlookAddinType?.value : null,\r\n outlookAddinNoteSubjectId: values.outlookAddinSubject ? values.outlookAddinSubject.value : null,\r\n\r\n eventCreationNoteTypeGuid: values.eventCreationType ? values.eventCreationType?.value : null,\r\n eventCreationNoteSubjectId: values.eventCreationSubject ? values.eventCreationSubject?.value : null,\r\n\r\n campaignCreationNoteTypeGuid: values.campaignCreationType ? values.campaignCreationType?.value : null,\r\n campaignCreationNoteSubjectId: values.campaignCreationSubject ? values.campaignCreationSubject?.value : null,\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n showNotification(null, 'Successfully submitted', 'info');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false,\r\n };\r\n });\r\n\r\n // reset the field and set to the current changes after saved.\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset(values);\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update enquiry default', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false,\r\n };\r\n });\r\n });\r\n };\r\n\r\n if (clientAndContactDefaultConfigQuery.loading || !clientAndContactDefaultConfigQuery.data) {\r\n return (\r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n }\r\n\r\n return (\r\n
\r\n ) => onSubmit(form, values)}\r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{ submitting: true, pristine: true, values: true, initialValues: true }}\r\n render={({ handleSubmit, form, submitting, pristine, values }) => (\r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n\r\n \r\n \r\n \r\n } aria-controls=\"panel1a-content\">\r\n Client and Contact Defaults\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Provide a new section to define default settings for Note Subject and \r\n Type in various circumstances.\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Subject Mandatory\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n }\r\n />\r\n }\r\n label=\"Type Mandatory\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Outlook Addin\r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n Event Creation\r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n {/* \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n */}\r\n \r\n \r\n \r\n \r\n \r\n Campaign Creation\r\n \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n {/* \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n )}\r\n />\r\n
\r\n );\r\n};\r\n\r\nexport default ClientAndContactsDefaultConfigurationTab;\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport { Accordion, AccordionDetails, AccordionSummary, Box, Button, createStyles, Grid, InputAdornment, makeStyles, TextField, Theme, Typography } from '@material-ui/core';\r\nimport { FormApi } from 'final-form';\r\nimport React, { useEffect, useState } from 'react';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport { client } from '../..';\r\nimport { showNotification } from '../../App';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\r\nimport gql from 'graphql-tag';\r\nimport { useQuery } from 'react-apollo';\r\nimport { useCurrencySymbol } from '../../hooks/useCurrencySymbol';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n display: 'flex',\r\n flex: 1,\r\n flexFlow: 'column',\r\n padding: '0 30px',\r\n },\r\n textField: {\r\n width: '100%',\r\n maxWidth: '75px',\r\n },\r\n buttonWrapper: {\r\n margin: '0 -10px',\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n '& > button': {\r\n margin: '0 10px',\r\n }\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n },\r\n heading: {\r\n fontSize: theme.typography.pxToRem(15),\r\n fontWeight: 600,\r\n color: theme.palette.primary.main\r\n },\r\n })\r\n);\r\n\r\ninterface FormState {\r\n redIndicatorWhenActualVsBudgetIsLessThanPercentage: number | null;\r\n amberIndicatorWhenActualVsBudgetIsLessThanPercentage: number | null;\r\n redIndicatorWhenNinetyDayDebtExceedsPercentage: number | null;\r\n redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage: number | null;\r\n redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage: number | null;\r\n firmOverallStandardChargeOutRate: number | null;\r\n currentBankOverdraftInterestRate: number | null;\r\n firmStandardTradingTermsInDays: number | null;\r\n firmTargetWipLockupDays: number | null;\r\n firmOverallBlendedCostRate: number | null;\r\n}\r\ninterface FinancialThresholdsTabState {\r\n isLoading: boolean;\r\n isFormChanged: boolean;\r\n onSubmitLoading: boolean;\r\n}\r\n\r\nexport default function FinancialThresholdsTab() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: true,\r\n isFormChanged: false,\r\n onSubmitLoading: false,\r\n });\r\n\r\n const [formState, setFormState] = useState({\r\n redIndicatorWhenActualVsBudgetIsLessThanPercentage: null,\r\n amberIndicatorWhenActualVsBudgetIsLessThanPercentage: null,\r\n redIndicatorWhenNinetyDayDebtExceedsPercentage: null,\r\n redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage: null,\r\n redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage: null,\r\n firmOverallStandardChargeOutRate: null,\r\n currentBankOverdraftInterestRate: null,\r\n firmStandardTradingTermsInDays: null,\r\n firmTargetWipLockupDays: null,\r\n firmOverallBlendedCostRate: null\r\n });\r\n\r\n const currencyQuery = useCurrencySymbol();\r\n\r\n const financialThresholdsQuery = useQuery(FinancialThresholdsQuery);\r\n\r\n useEffect(() => {\r\n\r\n if (financialThresholdsQuery.data && !financialThresholdsQuery.error && !financialThresholdsQuery.loading) {\r\n\r\n const { \r\n\r\n amberIndicatorWhenActualVsBudgetIsLessThanPercentage,\r\n currentBankOverdraftInterestRate,\r\n firmOverallStandardChargeOutRate,\r\n firmStandardTradingTermsInDays,\r\n firmTargetWipLockupDays,\r\n redIndicatorWhenActualVsBudgetIsLessThanPercentage,\r\n redIndicatorWhenNinetyDayDebtExceedsPercentage,\r\n redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage,\r\n redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage,\r\n showGreenIndicator,\r\n firmOverallBlendedCostRate\r\n\r\n } = financialThresholdsQuery.data.settings.systems.financialThresholdsSettings.config;\r\n\r\n setFormState((prevState) => {\r\n return {\r\n ...prevState,\r\n amberIndicatorWhenActualVsBudgetIsLessThanPercentage,\r\n currentBankOverdraftInterestRate,\r\n firmOverallStandardChargeOutRate,\r\n firmStandardTradingTermsInDays,\r\n firmTargetWipLockupDays: firmTargetWipLockupDays,\r\n redIndicatorWhenActualVsBudgetIsLessThanPercentage,\r\n redIndicatorWhenNinetyDayDebtExceedsPercentage,\r\n redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage,\r\n redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage,\r\n showGreenIndicator,\r\n firmOverallBlendedCostRate\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isLoading: false\r\n };\r\n });\r\n }\r\n\r\n }, [financialThresholdsQuery.data, financialThresholdsQuery.error, financialThresholdsQuery.loading]);\r\n\r\n // const onTextFieldChange = (event: React.ChangeEvent) => {\r\n // const value = event.target.value;\r\n // const name = event.target.name;\r\n\r\n // setState((prevState) => {\r\n // return {\r\n // ...prevState,\r\n // [name]: value\r\n // };\r\n // });\r\n \r\n // };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isFormChanged: true\r\n };\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n const onReset = (form: FormApi) => () => {\r\n form.setConfig('keepDirtyOnReinitialize', false);\r\n form.batch(() => {\r\n form.reset();\r\n });\r\n form.setConfig('keepDirtyOnReinitialize', true);\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: AnyObject) => {\r\n\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: true\r\n };\r\n });\r\n\r\n client\r\n .mutate({\r\n mutation: FinancialThresholdsMutation,\r\n variables: {\r\n amberIndicatorWhenActualVsBudgetIsLessThanPercentage: values.amberIndicatorWhenActualVsBudgetIsLessThanPercentage,\r\n currentBankOverdraftInterestRate: values.currentBankOverdraftInterestRate,\r\n firmOverallStandardChargeOutRate: values.firmOverallStandardChargeOutRate,\r\n firmStandardTradingTermsInDays: values.firmStandardTradingTermsInDays,\r\n firmTargetWipLockupDays: values.firmTargetWipLockupDays,\r\n redIndicatorWhenActualVsBudgetIsLessThanPercentage: values.redIndicatorWhenActualVsBudgetIsLessThanPercentage,\r\n redIndicatorWhenNinetyDayDebtExceedsPercentage: values.redIndicatorWhenNinetyDayDebtExceedsPercentage,\r\n redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage: values.redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage,\r\n redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage: values.redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage,\r\n showGreenIndicator: values.showGreenIndicator,\r\n firmOverallBlendedCostRate: values.firmOverallBlendedCostRate\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results) => {\r\n if (results.data?.settings.financialThresholdsSettings.update.status) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n \r\n onReset(form);\r\n\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n }); \r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to update firm details', reason, 'error');\r\n setState((_prevState) => {\r\n return {\r\n ..._prevState,\r\n onSubmitLoading: false\r\n };\r\n });\r\n });\r\n };\r\n\r\n const redAmberAndGreenComponent = () => {\r\n return (\r\n \r\n }\r\n aria-controls=\"panel1a-content\"\r\n id=\"panel1a-header\"\r\n >\r\n Red/Amber/Green\r\n \r\n \r\n \r\n \r\n \r\n \r\n Display a red indicator when actual vs budget is less than\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n %\r\n \r\n ),\r\n }}\r\n inputProps={{\r\n style: { textAlign: 'right' }\r\n }}\r\n type=\"number\"\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Display an amber indicator when actual vs budget is less than\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n %\r\n \r\n ),\r\n }}\r\n inputProps={{\r\n style: { textAlign: 'right' }\r\n }}\r\n type=\"number\"\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n Otherwise display green\r\n \r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const exceptionsComponent = () => {\r\n return (\r\n \r\n }\r\n aria-controls=\"panel1a-content\"\r\n id=\"panel1a-header\"\r\n >\r\n Exceptions\r\n \r\n \r\n \r\n \r\n \r\n \r\n Display red when 90 day debt exceeds\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n %\r\n \r\n ),\r\n }}\r\n inputProps={{\r\n style: { textAlign: 'right' }\r\n }}\r\n type=\"number\"\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n \r\n of total debt\r\n \r\n \r\n \r\n \r\n \r\n \r\n Display red when 90 day unbilled fees exceeds\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n %\r\n \r\n ),\r\n }}\r\n inputProps={{\r\n style: { textAlign: 'right' }\r\n }}\r\n type=\"number\"\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n \r\n of total unbilled fees\r\n \r\n \r\n \r\n \r\n \r\n \r\n Display red when 90 day unbilled disbursements exceeds\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n %\r\n \r\n ),\r\n }}\r\n inputProps={{\r\n style: { textAlign: 'right' }\r\n }}\r\n type=\"number\"\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n \r\n of total unbilled disbursements\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const standardsComponent = () => {\r\n return (\r\n \r\n }\r\n aria-controls=\"panel1a-content\"\r\n id=\"panel1a-header\"\r\n >\r\n Standards\r\n \r\n \r\n \r\n \r\n \r\n \r\n Firm Overall Standard Blended Charge Out Rice\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n {currencyQuery.data?.options.currencySymbol.symbol || '$'}\r\n \r\n ),\r\n }}\r\n inputProps={{\r\n style: { textAlign: 'right' }\r\n }}\r\n type=\"number\"\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Current Bank Overdraft Interest Rate \r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n %\r\n \r\n ),\r\n }}\r\n inputProps={{\r\n style: { textAlign: 'right' }\r\n }}\r\n type=\"number\"\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Firm's Standard Trading Terms in Days to Firm's target debtor days\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Firm's target WIP Lockup days\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n Firm's Overall Blended Cost Rate\r\n \r\n \r\n {({ input, meta }) => (\r\n \r\n {currencyQuery.data?.options.currencySymbol.symbol || '$'}\r\n \r\n ),\r\n }}\r\n inputProps={{\r\n style: { textAlign: 'right' }\r\n }}\r\n type=\"number\"\r\n size=\"small\"\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n };\r\n \r\n return (\r\n
\r\n {state.isLoading || currencyQuery.loading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n ) => onSubmit(form, values)} \r\n initialValues={formState}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{\r\n submitting: true,\r\n pristine: true,\r\n }}\r\n render={({\r\n handleSubmit,\r\n form,\r\n submitting,\r\n pristine,\r\n }) => {\r\n return (\r\n \r\n
\r\n {\r\n onFormValueChanged(props);\r\n }}\r\n />\r\n \r\n \r\n\r\n \r\n {redAmberAndGreenComponent()}\r\n \r\n \r\n {exceptionsComponent()}\r\n \r\n \r\n {standardsComponent()}\r\n \r\n\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n {/* {printJson(values)} */}\r\n
\r\n \r\n );\r\n }}\r\n />\r\n )}\r\n
\r\n );\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport function printJson(values: any) {\r\n if (values) {\r\n return (\r\n <>\r\n
\r\n                    {JSON.stringify(values, undefined, 2)}\r\n                
\r\n \r\n );\r\n } else {\r\n return (\r\n <>\r\n \r\n {/* tslint:disable-next-line: no-shadowed-variable */}\r\n {({ values }) => (\r\n
\r\n                            {JSON.stringify(values, undefined, 2)}\r\n                            {/*  */}\r\n                        
\r\n )}\r\n
\r\n \r\n );\r\n }\r\n}\r\n\r\ntype FinancialThresholdsData = {\r\n settings: Settings;\r\n}\r\n\r\ntype Settings = {\r\n id: number;\r\n systems: Systems;\r\n __typename: string;\r\n}\r\n\r\ntype Systems = {\r\n financialThresholdsSettings: FinancialThresholdsSettings;\r\n __typename: string;\r\n}\r\n\r\ntype FinancialThresholdsSettings = {\r\n id: number;\r\n config: Config;\r\n __typename: string;\r\n}\r\n\r\ntype Config = {\r\n id: number | null;\r\n redIndicatorWhenActualVsBudgetIsLessThanPercentage: number | null;\r\n amberIndicatorWhenActualVsBudgetIsLessThanPercentage: number | null;\r\n redIndicatorWhenNinetyDayDebtExceedsPercentage: number | null;\r\n redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage: number | null;\r\n redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage: number | null;\r\n firmOverallStandardChargeOutRate: number | null;\r\n currentBankOverdraftInterestRate: number | null;\r\n firmStandardTradingTermsInDays: number | null;\r\n firmTargetWipLockupDays: number | null;\r\n showGreenIndicator: boolean;\r\n firmOverallBlendedCostRate: number | null;\r\n __typename: string;\r\n}\r\n\r\nconst FinancialThresholdsQuery = gql`\r\n query financialThresholdsSettings {\r\n settings {\r\n id\r\n systems {\r\n financialThresholdsSettings {\r\n id\r\n config {\r\n id\r\n redIndicatorWhenActualVsBudgetIsLessThanPercentage\r\n amberIndicatorWhenActualVsBudgetIsLessThanPercentage\r\n redIndicatorWhenNinetyDayDebtExceedsPercentage\r\n redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage\r\n redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage\r\n firmOverallStandardChargeOutRate\r\n currentBankOverdraftInterestRate\r\n firmStandardTradingTermsInDays\r\n firmTargetWipLockupDays\r\n showGreenIndicator\r\n firmOverallBlendedCostRate\r\n __typename\r\n }\r\n __typename\r\n }\r\n __typename\r\n }\r\n __typename\r\n }\r\n }\r\n\r\n`;\r\n\r\ntype FinancialThresholdsMutationParams = {\r\n redIndicatorWhenActualVsBudgetIsLessThanPercentage: number;\r\n amberIndicatorWhenActualVsBudgetIsLessThanPercentage: number;\r\n redIndicatorWhenNinetyDayDebtExceedsPercentage: number;\r\n redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage: number;\r\n redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage: number;\r\n firmOverallStandardChargeOutRate: number;\r\n currentBankOverdraftInterestRate: number;\r\n firmStandardTradingTermsInDays: number;\r\n firmTargetWipLockupDays: number;\r\n showGreenIndicator: boolean;\r\n firmOverallBlendedCostRate: number;\r\n}\r\n\r\ntype FinancialThresholdsMutationData = {\r\n settings: FinancialThresholdsMutationSettings;\r\n}\r\n\r\ntype FinancialThresholdsMutationSettings = {\r\n financialThresholdsSettings: FinancialThresholdsMutationFinancialSettings;\r\n __typename: string;\r\n}\r\n\r\ntype FinancialThresholdsMutationFinancialSettings = {\r\n update: Update;\r\n __typename: string;\r\n}\r\n\r\ntype Update = {\r\n status: boolean;\r\n error: null;\r\n __typename: string;\r\n}\r\n\r\n\r\nconst FinancialThresholdsMutation = gql`\r\n mutation FinancialThresholdsMutation(\r\n $redIndicatorWhenActualVsBudgetIsLessThanPercentage: Decimal\r\n $amberIndicatorWhenActualVsBudgetIsLessThanPercentage: Decimal\r\n $redIndicatorWhenNinetyDayDebtExceedsPercentage: Decimal\r\n $redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage: Decimal\r\n $redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage: Decimal\r\n $firmOverallStandardChargeOutRate: Decimal\r\n $currentBankOverdraftInterestRate: Decimal\r\n $firmStandardTradingTermsInDays: Int\r\n $firmTargetWipLockupDays: Int\r\n $showGreenIndicator: Boolean\r\n $firmOverallBlendedCostRate: Decimal\r\n ) {\r\n settings {\r\n financialThresholdsSettings{\r\n update(\r\n redIndicatorWhenActualVsBudgetIsLessThanPercentage :$redIndicatorWhenActualVsBudgetIsLessThanPercentage\r\n amberIndicatorWhenActualVsBudgetIsLessThanPercentage : $amberIndicatorWhenActualVsBudgetIsLessThanPercentage\r\n redIndicatorWhenNinetyDayDebtExceedsPercentage: $redIndicatorWhenNinetyDayDebtExceedsPercentage\r\n redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage: $redIndicatorWhenNinetyDayUnbilledFeesExceedsPercentage\r\n redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage: $redIndicatorWhenNinetyDayUnbilledDisbursementsExceedsPercentage\r\n firmOverallStandardChargeOutRate: $firmOverallStandardChargeOutRate\r\n currentBankOverdraftInterestRate: $currentBankOverdraftInterestRate\r\n firmStandardTradingTermsInDays: $firmStandardTradingTermsInDays\r\n firmTargetWipLockupDays: $firmTargetWipLockupDays\r\n showGreenIndicator: $showGreenIndicator\r\n firmOverallBlendedCostRate: $firmOverallBlendedCostRate\r\n ) {\r\n status\r\n error\r\n __typename\r\n }\r\n __typename\r\n }\r\n __typename\r\n }\r\n }\r\n`;\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useState, useEffect } from 'react';\r\nimport List from '@material-ui/core/List';\r\nimport ListItem from '@material-ui/core/ListItem';\r\nimport ListItemText from '@material-ui/core/ListItemText';\r\nimport { FirmSettingConfigurationBanner } from './FirmSettingConfigurationBanner';\r\nimport { RouterProps, showNotification } from '../App';\r\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\r\nimport SettingsIcon from '@material-ui/icons/Settings';\r\nimport Avatar from '@material-ui/core/Avatar';\r\nimport { makeStyles } from '@material-ui/core';\r\nimport EmailOutlinedIcon from '@material-ui/icons/EmailOutlined';\r\nimport EmailingTab from './tabs/EmailingTab';\r\nimport { retrieveSystemSettingsNamesQueryData, SettingName, SettingNotificationSubscription, SystemSettingsNamesData } from './FirmSettingConfigurationRepository';\r\nimport NaturePeopleIcon from '@material-ui/icons/NaturePeople';\r\nimport EnquiryDefaultTab from './tabs/EnquiryDefaultTab';\r\nimport { RvLoader } from '../components/Loader';\r\nimport { client } from '..';\r\nimport VpnKeyOutlinedIcon from '@material-ui/icons/VpnKeyOutlined';\r\nimport ListAltOutlinedIcon from '@material-ui/icons/ListAltOutlined';\r\nimport RoomOutlinedIcon from '@material-ui/icons/RoomOutlined';\r\nimport TimerOutlinedIcon from '@material-ui/icons/TimerOutlined';\r\nimport AccessTimeIcon from '@material-ui/icons/AccessTime';\r\nimport SecurityTab from './tabs/SecurityTab';\r\nimport FirmDetailsTab from './tabs/FirmDetailsTab';\r\nimport RegionalTab from './tabs/RegionalTab';\r\nimport TimeRecordingTab from './tabs/TimeRecordingTab';\r\nimport TimeRecordingDefaultsTab from './tabs/TimeRecordingDefaultsTab';\r\nimport ConnectTab from './tabs/ConnectTab';\r\nimport TimeRecordingWarningDefaultsTab from './tabs/TimeRecordingWarningDefaultsTab';\r\nimport InprotechTab from './tabs/InprotechTab';\r\n// import AgeingTab from './tabs/AgeingTab';\r\n// import PollIcon from '@material-ui/icons/Poll';\r\n// import ChartDefaultsTab from './tabs/ChartDefaultsTab';\r\nimport PhoneMessageDefaultConfigurationTab from './tabs/PhoneMessageDefaultConfigurationTab';\r\nimport TaskDefaultConfigurationTab from './tabs/TaskDefaultConfigurationTab';\r\n// import { LearnMoreEnum } from '../learnMore/LearnMorePage';\r\nimport PermPhoneMsgIcon from '@material-ui/icons/PermPhoneMsg';\r\nimport AssignmentLateIcon from '@material-ui/icons/AssignmentLate';\r\nimport ClientAndContactsDefaultConfigurationTab from './tabs/ClientAndContactsDefaultConfigurationTab';\r\nimport FinancialThresholdsTab from './tabs/FinancialThresholdsTab';\r\n\r\nconst useStyles = makeStyles({\r\n root: {\r\n flex: 1,\r\n display: 'flex',\r\n flexFlow: 'column',\r\n },\r\n wrapper: {\r\n flex: 1,\r\n display: 'flex',\r\n backgroundColor: '#fff',\r\n margin: '0 -15px',\r\n padding: '15px',\r\n },\r\n sidebar: {\r\n padding: '0 15px',\r\n maxWidth: '400px',\r\n width: '100%',\r\n position: 'relative',\r\n flex: 1,\r\n display: 'flex',\r\n },\r\n sidebarInner: {\r\n position: 'relative',\r\n flex: 1,\r\n // left: 0,\r\n // right: 0,\r\n // top: 0,\r\n // bottom: 0,\r\n // overflow: 'auto',\r\n },\r\n sidebarList: {\r\n position: 'absolute',\r\n top: 0,\r\n right: 0,\r\n left: 0,\r\n bottom: 0,\r\n overflow: 'auto',\r\n paddingRight: '10px',\r\n '& .Mui-selected': {\r\n backgroundColor: 'rgba(0, 0, 0, 0.2)'\r\n },\r\n '& .Mui-selected:hover': {\r\n backgroundColor: 'rgba(0, 0, 0, 0.2)'\r\n }\r\n },\r\n content: {\r\n padding: '0 15px',\r\n flexGrow: 1,\r\n display: 'flex',\r\n flexFlow: 'column',\r\n '& > div': {\r\n flexGrow: 1,\r\n maxWidth: '800px',\r\n }\r\n },\r\n tabLoaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flex: 1,\r\n }\r\n});\r\n\r\nexport enum FirmSettingConfigurationList {\r\n // Ageing = 0,\r\n Security,\r\n EmailConfiguration,\r\n EnquiryDefaultConfiguration,\r\n FirmDetails,\r\n Regional,\r\n TimeRecording,\r\n TimeRecordingDefaults,\r\n Connect,\r\n TimeRecordingWarningDefaults,\r\n Inprotech,\r\n ChartDefaults,\r\n PhoneMessageDefaultConfiguration,\r\n TaskDefaultConfiguration,\r\n ClientAndContactsDefaultConfiguration,\r\n FinancialThresholds\r\n}\r\n\r\ninterface FirmSettingConfigurationPageState {\r\n selectedTable: FirmSettingConfigurationList;\r\n tabs: SettingName[];\r\n isTabLoading: boolean;\r\n}\r\n\r\ninterface FirmSettingConfigurationPageProps extends RouterProps {\r\n\r\n}\r\n\r\nexport default function FirmSettingConfigurationPage(props: FirmSettingConfigurationPageProps) {\r\n\r\n const classes = useStyles();\r\n\r\n const [pageState, setPageState] = useState({\r\n selectedTable: 0,\r\n tabs: [],\r\n isTabLoading: true,\r\n });\r\n\r\n // tslint:disable-next-line: no-any\r\n let routeCommand = props.match.params.command;\r\n\r\n useEffect(() => {\r\n\r\n fetchTabData();\r\n\r\n var routeTab: FirmSettingConfigurationList = FirmSettingConfigurationList[props.match.params.tab as keyof typeof FirmSettingConfigurationList];\r\n // tslint:disable-next-line: no-console\r\n console.log('routeCommand', routeCommand);\r\n\r\n setPageState({\r\n ...pageState,\r\n selectedTable: routeTab ? routeTab : pageState.selectedTable\r\n });\r\n\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n useEffect(() => { \r\n const subscribeSettingNotificationObj = subscribeSettingNotification();\r\n // Cleanup\r\n return () => {\r\n subscribeSettingNotificationObj.unsubscribe();\r\n };\r\n\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const subscribeSettingNotification = () => {\r\n return (\r\n client\r\n .subscribe({\r\n fetchPolicy: 'no-cache',\r\n query: SettingNotificationSubscription,\r\n variables: {},\r\n })\r\n .subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n if (results.data.settingNotification.status) {\r\n showNotification('Success', results.data.settingNotification.message, 'info');\r\n\r\n } else {\r\n showNotification('Failed', results.data.settingNotification.message, 'error');\r\n }\r\n },\r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n },\r\n })\r\n );\r\n };\r\n\r\n const fetchTabData = () => {\r\n retrieveSystemSettingsNamesQueryData(\r\n true,\r\n // tslint:disable-next-line: no-console\r\n (data: SystemSettingsNamesData) => onFirmSettingTabRetrieved(data),\r\n // tslint:disable-next-line: no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onFirmSettingTabRetrieved = (data: SystemSettingsNamesData) => {\r\n setPageState((prevState) => {\r\n return {\r\n ...prevState,\r\n tabs: data.settings.systems.settingNames.settingName,\r\n isTabLoading: false\r\n };\r\n });\r\n };\r\n\r\n const getIcon = (internalName: string) => {\r\n\r\n if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.Security]) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.FirmDetails]) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.Regional]) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.TimeRecording]) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.TimeRecordingDefaults]) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n \r\n if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.EmailConfiguration]) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.EnquiryDefaultConfiguration]) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n // if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.ChartDefaults]) {\r\n // return (\r\n // \r\n // \r\n // \r\n // );\r\n // }\r\n\r\n if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.PhoneMessageDefaultConfiguration]) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.ClientAndContactsDefaultConfiguration]) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.TaskDefaultConfiguration]) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const isHasAccess = (internalName: string): boolean => {\r\n \r\n // if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.EmailConfiguration]) {\r\n // return UserFeature.HasAccess(UserFeatureEnum.hasInnographyLink);\r\n // }\r\n\r\n // if (internalName === FirmSettingConfigurationList[FirmSettingConfigurationList.EnquiryDefaultConfiguration]) {\r\n // return UserFeature.HasAccess(UserFeatureEnum.hasVisionSix);\r\n // }\r\n\r\n return true;\r\n };\r\n\r\n const onClickBack = () => {\r\n props.history.push('/configurationDashboard');\r\n };\r\n\r\n const onClickTab = (value: FirmSettingConfigurationList) => () => {\r\n setPageState({\r\n ...pageState,\r\n selectedTable: value\r\n });\r\n\r\n props.history.push(`/firmSettingConfiguration/${FirmSettingConfigurationList[value]}`);\r\n };\r\n\r\n // const onLearnMore = () => {\r\n // props.history.push({\r\n // pathname: `/learnMore/${LearnMoreEnum[LearnMoreEnum.FIRM_STRUCTURE]}`, \r\n // });\r\n // };\r\n \r\n return (\r\n
\r\n \r\n
\r\n {pageState.isTabLoading ? (\r\n
\r\n \r\n
\r\n ) : (\r\n <>\r\n
\r\n
\r\n \r\n {pageState.tabs.map((tab: SettingName) => isHasAccess(tab.internalName) && (\r\n \r\n \r\n {getIcon(tab.internalName)}\r\n \r\n \r\n \r\n )\r\n )}\r\n \r\n
\r\n
\r\n
\r\n {(pageState.selectedTable === FirmSettingConfigurationList.EmailConfiguration) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.EnquiryDefaultConfiguration) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.Security) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.FirmDetails) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.Regional) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.TimeRecording) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.TimeRecordingDefaults) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.Connect) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.TimeRecordingWarningDefaults) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.Inprotech) && ()}\r\n {/* {(pageState.selectedTable === FirmSettingConfigurationList.Ageing) && ()} */}\r\n {/* {(pageState.selectedTable === FirmSettingConfigurationList.ChartDefaults) && ()} */}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.PhoneMessageDefaultConfiguration) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.ClientAndContactsDefaultConfiguration) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.TaskDefaultConfiguration) && ()}\r\n {(pageState.selectedTable === FirmSettingConfigurationList.FinancialThresholds) && ()}\r\n
\r\n \r\n )}\r\n
\r\n
\r\n );\r\n}","import React from 'react';\r\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { RvButtonFabric, RvButtonType } from '../components/Button';\r\nimport { RvLabel, LabelStyle } from '../components/Label/Label';\r\nimport { mainTheme } from '../Theme';\r\nimport VideoLibraryOutlinedIcon from '@material-ui/icons/VideoLibraryOutlined';\r\nimport { Button } from '@material-ui/core';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n width: '100%',\r\n padding: '0 15px'\r\n },\r\n container: {},\r\n buttonContainer: {\r\n position: 'relative',\r\n padding: '15px 80px',\r\n display: 'flex',\r\n alignItems: 'center',\r\n color: mainTheme.BrandColors.TextPrimary,\r\n '@media (max-width: 1024px)': {\r\n padding: '15px 30px'\r\n },\r\n '& .rvlabel': {\r\n // paddingLeft: '82px',\r\n flex: 1,\r\n fontFamily: mainTheme.Font.Main,\r\n fontSize: mainTheme.FontSize.PX.size8,\r\n letterSpacing: '0.86px',\r\n lineHeight: mainTheme.LineHeight.ExtraLarge\r\n },\r\n '& .back-button': {\r\n paddingRight: '32px',\r\n display: 'flex',\r\n alignItems: 'center',\r\n // position: 'absolute',\r\n // top: '50%',\r\n // transform: 'translateY(-50%)',\r\n '& .ms-Button': {\r\n width: '50px',\r\n height: '50px'\r\n },\r\n '& .ms-Button-icon': {\r\n fontSize: mainTheme.FontSize.PX.size10,\r\n color: mainTheme.BrandColors.TemplatePrimary\r\n }\r\n }\r\n },\r\n button: {\r\n margin: '0 10px',\r\n textTransform: 'none',\r\n fontSize: '14px',\r\n }\r\n })\r\n);\r\n\r\ninterface BannerProps {\r\n title: string;\r\n onClickBack?: () => void;\r\n onLearnMore?: () => void;\r\n}\r\n\r\nexport const FurmStructureConfigurationBanner: React.FC = ({\r\n title,\r\n onClickBack,\r\n onLearnMore\r\n}) => {\r\n const classes = useStyles();\r\n\r\n return (\r\n
\r\n
\r\n
\r\n \r\n \r\n {onLearnMore && (\r\n \r\n )}\r\n
\r\n
\r\n
\r\n );\r\n};\r\n","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useState, useEffect } from 'react';\r\nimport MaterialTable, { EditComponentProps, MTableToolbar } from 'material-table';\r\nimport { \r\n Avatar, \r\n ListItem, \r\n ListItemAvatar, \r\n ListItemText, \r\n Badge,\r\n Typography, \r\n Chip,\r\n Checkbox\r\n} from '@material-ui/core';\r\nimport { Colors, hashString } from '../../tasksSummary/board/BoardCardDraggable';\r\nimport { SemanticCOLORS } from 'semantic-ui-react';\r\nimport PeopleOutlineIcon from '@material-ui/icons/PeopleOutline';\r\nimport { browserHistory } from '../../components/AppContent';\r\nimport { showNotification } from '../../App';\r\nimport { Icons } from 'material-table';\r\nimport { forwardRef } from 'react';\r\n \r\nimport AddBox from '@material-ui/icons/AddBox';\r\nimport ArrowDownward from '@material-ui/icons/ArrowDownward';\r\nimport Check from '@material-ui/icons/Check';\r\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\r\nimport ChevronRight from '@material-ui/icons/ChevronRight';\r\nimport Clear from '@material-ui/icons/Clear';\r\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\r\nimport Edit from '@material-ui/icons/Edit';\r\nimport FilterList from '@material-ui/icons/FilterList';\r\nimport FirstPage from '@material-ui/icons/FirstPage';\r\nimport LastPage from '@material-ui/icons/LastPage';\r\nimport Remove from '@material-ui/icons/Remove';\r\nimport SaveAlt from '@material-ui/icons/SaveAlt';\r\nimport Search from '@material-ui/icons/Search';\r\nimport ViewColumn from '@material-ui/icons/ViewColumn';\r\nimport { client } from '../..';\r\nimport gql from 'graphql-tag';\r\nimport DialogBox from '../../Dashboard/Component/DialogBox';\r\nimport { useStyles } from '../../lookupConfiguration/common/tabsStyle';\r\nimport { FirmData, Team } from '../../lookupConfiguration/models/Firm';\r\nimport { retrieveTeamData } from '../../lookupConfiguration/selectors/FirmTeamSelector';\r\nimport CheckIcon from '@material-ui/icons/Check';\r\n\r\ninterface LookupTeamsMaintenanceState {\r\n // tslint:disable-next-line: no-any\r\n selectedRow: any | null;\r\n data: Team[];\r\n isLoading: boolean;\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nlet onDeleteItems: any = [];\r\n\r\nexport default function LookupTeamsMaintenance() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n selectedRow: null,\r\n data: [],\r\n isLoading: false,\r\n });\r\n\r\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\r\n\r\n useEffect(() => { \r\n fetchData();\r\n\r\n const subscribeFirmObj = subscribeFirm();\r\n\r\n return () => {\r\n subscribeFirmObj.unsubscribe();\r\n };\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const tableIcons: Icons = {\r\n Add: forwardRef((props, ref) => ),\r\n Check: forwardRef((props, ref) => ),\r\n Clear: forwardRef((props, ref) => ),\r\n Delete: forwardRef((props, ref) => ),\r\n DetailPanel: forwardRef((props, ref) => ),\r\n Edit: forwardRef((props, ref) => ),\r\n Export: forwardRef((props, ref) => ),\r\n Filter: forwardRef((props, ref) => ),\r\n FirstPage: forwardRef((props, ref) => ),\r\n LastPage: forwardRef((props, ref) => ),\r\n NextPage: forwardRef((props, ref) => ),\r\n PreviousPage: forwardRef((props, ref) => ),\r\n ResetSearch: forwardRef((props, ref) => ),\r\n Search: forwardRef((props, ref) => ),\r\n SortArrow: forwardRef((props, ref) => ),\r\n ThirdStateCheck: forwardRef((props, ref) => ),\r\n ViewColumn: forwardRef((props, ref) => )\r\n };\r\n\r\n const subscribeFirm = () => {\r\n return (\r\n // let subscription =\r\n client\r\n .subscribe({\r\n fetchPolicy: 'no-cache',\r\n query: firmSubscription,\r\n variables: {},\r\n })\r\n .subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n if (results.data.lookupNotification.status) {\r\n\r\n const { lookupNotification } = results.data;\r\n showNotification('Success', lookupNotification.message, 'info');\r\n\r\n if (lookupNotification.message.includes('created successfully')) {\r\n setState((prevState) => {\r\n\r\n const tdata = [...prevState.data];\r\n\r\n const temp = tdata[tdata.length - 1];\r\n\r\n tdata[tdata.length - 1] = {\r\n ...temp,\r\n guidID: lookupNotification.guidId\r\n };\r\n\r\n return {\r\n ...prevState,\r\n data: tdata\r\n };\r\n });\r\n }\r\n\r\n } else {\r\n showNotification('Failed', results.data.lookupNotification.message, 'error');\r\n }\r\n },\r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n },\r\n })\r\n );\r\n };\r\n\r\n const fetchData = () => {\r\n\r\n setState({\r\n ...state,\r\n isLoading: true,\r\n });\r\n retrieveTeamData(\r\n undefined,\r\n true, // this.state.isRefresh, -- Since we are updating and creating, we do not fetch cached data\r\n // tslint:disable-next-line: no-console\r\n (data) => onRetrieveData(data),\r\n // tslint:disable-next-line:no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onRetrieveData = (data: FirmData) => {\r\n \r\n setState({\r\n ...state,\r\n data: data.firm.teams.team,\r\n isLoading: false\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getSection = (data: any) => {\r\n\r\n const { description } = data;\r\n\r\n let bColor: SemanticCOLORS = Colors[(description === '' || description === null) ? \r\n Colors[Colors.length] : (hashString(description) % Colors.length) - 1];\r\n let stringSplit = description\r\n .replace(/[^\\w\\s]/gi, '') // remove special character\r\n .split(' ')\r\n // tslint:disable-next-line: no-any\r\n .map((n: any) => n[0])\r\n .join('');\r\n\r\n let stringInitials = stringSplit.slice(0, 2);\r\n \r\n return (\r\n
\r\n \r\n \r\n \r\n {stringInitials}\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getMember = (data: any) => {\r\n\r\n let staffCount = 0;\r\n\r\n if (data) {\r\n staffCount = data.staffCount;\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getCheckboxRender = (data: any, field: string) => {\r\n\r\n if (data && data[field]) {\r\n return (\r\n \r\n );\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const checkBoxComponent = (componentProps: EditComponentProps | any) => {\r\n return (\r\n <>\r\n componentProps.onChange(event.target.checked)}\r\n />\r\n \r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleRowClick = (event?: React.MouseEvent, rowData?: any, toggleDetailPanel?: (panelIndex?: number) => void) => {\r\n\r\n setState({\r\n ...state,\r\n selectedRow: rowData.tableData.id\r\n });\r\n\r\n browserHistory.push(`/firmStructureConfiguration/teams/${encodeURIComponent(rowData.description)};key=${rowData.guidID}`);\r\n };\r\n\r\n const updateRowData = (newData: Team, oldData: Team) => {\r\n\r\n setState((prevState) => {\r\n\r\n const tdata = [...prevState.data];\r\n \r\n // const isExists = tdata.filter((item: Team) => item.description.toLowerCase().includes(newData.description.toLowerCase())).length;\r\n \r\n tdata[tdata.indexOf(oldData)] = newData;\r\n\r\n return { \r\n ...prevState, \r\n data: tdata\r\n };\r\n \r\n });\r\n };\r\n\r\n const updateData = (rowData: Team) => {\r\n\r\n if (rowData) {\r\n client\r\n .mutate({\r\n mutation: updateFirmTeam,\r\n variables: {\r\n guidId: rowData.guidID,\r\n description: rowData.description,\r\n usedByTasks: rowData.usedByTasks,\r\n usedByFinancials: rowData.usedByFinancials,\r\n usedByEnquiries: rowData.usedByEnquiries\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Update Team', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Update Team', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n const deleteRowData = (oldData: Team) => {\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(oldData), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n \r\n };\r\n\r\n const deleteData = (oldData: Team) => {\r\n client\r\n .mutate({\r\n mutation: deleteFirmTeam,\r\n variables: {\r\n guidId: oldData.guidID,\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Delete Team', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Delete Team', reason, 'error');\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const insertRowData = (newData: Team) => {\r\n\r\n setState((prevState) => {\r\n\r\n const tdata = prevState.data;\r\n\r\n const isExists = tdata.filter((item: Team) => item.description.toLowerCase().includes(newData.description.toLowerCase())).length;\r\n\r\n if (!isExists) {\r\n tdata.push(newData);\r\n }\r\n\r\n return { \r\n ...prevState,\r\n data: tdata\r\n };\r\n\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const createData = (newData: Team) => {\r\n if (newData) {\r\n client\r\n .mutate({\r\n mutation: createFirmTeam,\r\n variables: {\r\n description: newData.description,\r\n usedByTasks: newData.usedByTasks,\r\n usedByFinancials: newData.usedByFinancials,\r\n usedByEnquiries: newData.usedByEnquiries\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Create Team', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Create Team', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onDeleteData = (data: any) => {\r\n\r\n setShowDeleteConfirm(true);\r\n\r\n onDeleteItems = data;\r\n\r\n };\r\n\r\n const onDeleteConfirm = (agree: boolean) => {\r\n if (agree) {\r\n // tslint:disable-next-line: no-any\r\n onDeleteItems.forEach((selected: any) => {\r\n\r\n // delete check data\r\n deleteData(selected);\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(selected), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n\r\n });\r\n }\r\n\r\n setShowDeleteConfirm(false);\r\n };\r\n\r\n const getTitle = (title: string, count: number) => {\r\n return (\r\n
\r\n {title}\r\n \r\n
\r\n );\r\n };\r\n\r\n return (\r\n
\r\n \r\n getSection(rowData), \r\n cellStyle: { flex: 3 }, \r\n headerStyle: { flex: 3 },\r\n validate: (rowData) => rowData.hasOwnProperty('description') && rowData.description \r\n ? true \r\n : { isValid: false, helperText: 'Team is required'}, \r\n },\r\n {\r\n title: 'Used By Enquiries',\r\n field: 'usedByEnquiries',\r\n render: (rowData) => getCheckboxRender(rowData, 'usedByEnquiries'),\r\n editComponent: (componentData) => checkBoxComponent(componentData)\r\n },\r\n {\r\n title: 'Used By Tasks',\r\n field: 'usedByTasks',\r\n render: (rowData) => getCheckboxRender(rowData, 'usedByTasks'),\r\n editComponent: (componentData) => checkBoxComponent(componentData)\r\n },\r\n {\r\n title: 'Used By Financials',\r\n field: 'usedByFinancials',\r\n render: (rowData) => getCheckboxRender(rowData, 'usedByFinancials'),\r\n editComponent: (componentData) => checkBoxComponent(componentData)\r\n },\r\n // tslint:disable-next-line: max-line-length\r\n { title: 'Members Count', field: 'staffCount', render: (rowData) => getMember(rowData), editable: 'never', cellStyle: { justifyContent: 'center' }, headerStyle: { justifyContent: 'center' } },\r\n ]}\r\n components={\r\n {\r\n Toolbar: props => (\r\n
\r\n \r\n
\r\n )\r\n }\r\n }\r\n data={state.data} \r\n options={{\r\n addRowPosition: 'first',\r\n search: true,\r\n selection: true,\r\n paging: true,\r\n pageSize: 10,\r\n pageSizeOptions: [10, 20, 30, 40, 50],\r\n showTitle: true,\r\n toolbar: true,\r\n actionsColumnIndex: -1,\r\n rowStyle: rowData => ({\r\n backgroundColor: (state.selectedRow === rowData.tableData.id) ? '#EEE' : '#FFF'\r\n })\r\n }}\r\n editable={{\r\n onRowAdd: (newData: Team) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (newData.description) {\r\n createData(newData);\r\n insertRowData(newData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowUpdate: (newData, oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n updateData(newData);\r\n updateRowData(newData, oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowDelete: (oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n deleteData(oldData);\r\n deleteRowData(oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n }}\r\n actions={[\r\n {\r\n tooltip: 'Remove All Selected Team',\r\n icon: DeleteOutline,\r\n // tslint:disable-next-line: no-any\r\n onClick: (evt: any, data: any) => onDeleteData(data)\r\n },\r\n ]}\r\n />\r\n
\r\n );\r\n}\r\n\r\nconst createFirmTeam = gql`\r\n mutation createFirmTeam($description: String, $usedByTasks: Boolean, $usedByFinancials: Boolean, $usedByEnquiries: Boolean) {\r\n createFirmTeam(description: $description, usedByTasks: $usedByTasks, usedByFinancials: $usedByFinancials, usedByEnquiries: $usedByEnquiries)\r\n }\r\n`;\r\n\r\nconst updateFirmTeam = gql`\r\n mutation updateFirmTeam($description: String, $guidId: String, $usedByTasks: Boolean, $usedByFinancials: Boolean, $usedByEnquiries: Boolean) {\r\n updateFirmTeam(description:$description, guidId: $guidId, usedByTasks: $usedByTasks, usedByFinancials: $usedByFinancials, usedByEnquiries: $usedByEnquiries)\r\n }\r\n`;\r\n\r\nconst deleteFirmTeam = gql`\r\n mutation deleteFirmTeam($guidId: String) {\r\n deleteFirmTeam(guidId: $guidId)\r\n } \r\n`;\r\n\r\nexport const firmSubscription = gql`\r\n subscription firm{\r\n lookupNotification{\r\n id,\r\n guidId,\r\n lookupDescription,\r\n message,\r\n status\r\n }\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useState, useEffect } from 'react';\r\nimport MaterialTable, { MTableToolbar, EditComponentProps } from 'material-table';\r\nimport { \r\n Avatar,\r\n ListItem,\r\n ListItemAvatar,\r\n ListItemText,\r\n Breadcrumbs,\r\n Link,\r\n Typography,\r\n Chip\r\n} from '@material-ui/core';\r\nimport { Colors, hashString } from '../../tasksSummary/board/BoardCardDraggable';\r\nimport { SemanticCOLORS } from 'semantic-ui-react';\r\nimport { RouterProps, showNotification } from '../../App';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport gql from 'graphql-tag';\r\nimport { client } from '../..';\r\nimport { firmSubscription } from './LookupTeamsMaintenance';\r\nimport { Icons } from 'material-table';\r\nimport { forwardRef } from 'react';\r\nimport AddBox from '@material-ui/icons/AddBox';\r\nimport ArrowDownward from '@material-ui/icons/ArrowDownward';\r\nimport Check from '@material-ui/icons/Check';\r\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\r\nimport ChevronRight from '@material-ui/icons/ChevronRight';\r\nimport Clear from '@material-ui/icons/Clear';\r\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\r\nimport Edit from '@material-ui/icons/Edit';\r\nimport FilterList from '@material-ui/icons/FilterList';\r\nimport FirstPage from '@material-ui/icons/FirstPage';\r\nimport LastPage from '@material-ui/icons/LastPage';\r\nimport Remove from '@material-ui/icons/Remove';\r\nimport SaveAlt from '@material-ui/icons/SaveAlt';\r\nimport Search from '@material-ui/icons/Search';\r\nimport ViewColumn from '@material-ui/icons/ViewColumn';\r\nimport DialogBox from '../../Dashboard/Component/DialogBox';\r\nimport { FirmData, Member } from '../../lookupConfiguration/models/Firm';\r\nimport { useStyles } from '../../lookupConfiguration/common/tabsStyle';\r\nimport { AvailableTeamMemberSelector } from '../../lookupConfiguration/selectors/AvailableTeamMemberSelector';\r\nimport { FetchPolicy } from 'apollo-client';\r\nimport PersonOutlineOutlinedIcon from '@material-ui/icons/PersonOutlineOutlined';\r\nimport PersonIcon from '@material-ui/icons/Person';\r\n\r\ninterface LookupTeamMemberMaintenanceProps extends RouterProps {}\r\n\r\ninterface TableData extends Member {\r\n tableData: { \r\n checked: boolean;\r\n id: number;\r\n };\r\n}\r\n\r\ninterface LookupTeamMemberMaintenanceState {\r\n // tslint:disable-next-line: no-any\r\n data: Member[];\r\n isLoading: boolean;\r\n onDeleteItems: TableData[];\r\n}\r\n\r\nexport default function LookupTeamMemberMaintenance(props: LookupTeamMemberMaintenanceProps) {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: false,\r\n data: [],\r\n onDeleteItems: [],\r\n });\r\n\r\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\r\n const [isRefreshData, setIsRefreshData] = useState(false);\r\n\r\n useEffect(() => {\r\n \r\n // groupId\r\n const { command } = props.match.params;\r\n\r\n const guID = command.split(';key=', 2)[1];\r\n\r\n if (command) {\r\n fetchData(guID);\r\n }\r\n\r\n const subscribeFirmObj = subscribeFirm();\r\n\r\n return () => {\r\n subscribeFirmObj.unsubscribe();\r\n };\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (isRefreshData) {\r\n const { command } = props.match.params;\r\n\r\n const guID = command.split(';key=', 2)[1];\r\n \r\n if (command) {\r\n fetchData(guID);\r\n }\r\n\r\n setIsRefreshData(false);\r\n } \r\n // tslint:disable-next-line: align\r\n }, [isRefreshData]);\r\n\r\n const tableIcons: Icons = {\r\n Add: forwardRef((iconProps, ref) => ),\r\n Check: forwardRef((iconProps, ref) => ),\r\n Clear: forwardRef((iconProps, ref) => ),\r\n Delete: forwardRef((iconProps, ref) => ),\r\n DetailPanel: forwardRef((iconProps, ref) => ),\r\n Edit: forwardRef((iconProps, ref) => ),\r\n Export: forwardRef((iconProps, ref) => ),\r\n Filter: forwardRef((iconProps, ref) => ),\r\n FirstPage: forwardRef((iconProps, ref) => ),\r\n LastPage: forwardRef((iconProps, ref) => ),\r\n NextPage: forwardRef((iconProps, ref) => ),\r\n PreviousPage: forwardRef((iconProps, ref) => ),\r\n ResetSearch: forwardRef((iconProps, ref) => ),\r\n Search: forwardRef((iconProps, ref) => ),\r\n SortArrow: forwardRef((iconProps, ref) => ),\r\n ThirdStateCheck: forwardRef((iconProps, ref) => ),\r\n ViewColumn: forwardRef((iconProps, ref) => )\r\n };\r\n\r\n const subscribeFirm = () => {\r\n return (\r\n // let subscription =\r\n client\r\n .subscribe({\r\n fetchPolicy: 'no-cache',\r\n query: firmSubscription,\r\n variables: {},\r\n })\r\n .subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n if (results.data.lookupNotification.status) {\r\n\r\n const { lookupNotification } = results.data;\r\n showNotification('Success', lookupNotification.message, 'info');\r\n\r\n if (lookupNotification.message.includes('member added successfully')) {\r\n setIsRefreshData(true);\r\n // setState((prevState) => {\r\n\r\n // const tdata = [...prevState.data];\r\n\r\n // const temp = tdata[tdata.length - 1];\r\n\r\n // tdata[tdata.length - 1] = {\r\n // ...temp,\r\n // guidID: lookupNotification.guidId\r\n // };\r\n\r\n // return {\r\n // ...prevState,\r\n // data: tdata\r\n // };\r\n // });\r\n }\r\n\r\n } else {\r\n showNotification('Failed', results.data.lookupNotification.message, 'error');\r\n }\r\n },\r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n },\r\n })\r\n );\r\n };\r\n\r\n const fetchData = (groupId: string) => {\r\n\r\n setState({\r\n ...state,\r\n isLoading: true,\r\n });\r\n\r\n const teamMemberQueryParams: TeamMemberQueryParams = {\r\n teamGuidId: groupId\r\n };\r\n\r\n retrieveTeamMemberData(\r\n teamMemberQueryParams,\r\n true, // refresh\r\n (data) => onRetrieveData(data),\r\n // tslint:disable-next-line:no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n setIsRefreshData(false);\r\n }\r\n );\r\n };\r\n\r\n const onRetrieveData = (data: FirmData) => {\r\n setState({\r\n ...state,\r\n data: data.firm.teams.team.length > 0\r\n ? data.firm.teams.team[0].members.member\r\n : [],\r\n isLoading: false\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const insertRowData = (newData: any) => {\r\n \r\n const tdata = [...state.data];\r\n\r\n // if (tdata.some((e: Member) => e.staffId && e.staffId.toLowerCase() === newData.friendlyName.value.toLowerCase())) {\r\n // return { \r\n // ...prevState, \r\n // };\r\n // } \r\n\r\n tdata.push({\r\n friendlyName: newData.friendlyName,\r\n staffId: newData.friendlyName,\r\n email: newData.friendlyName,\r\n });\r\n\r\n setState((prevState) => {\r\n return { \r\n ...prevState, \r\n data: tdata\r\n };\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const deleteRowData = (oldData: any) => {\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(oldData), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n \r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getStaffList = (newData: any) => {\r\n\r\n let staffArray = [];\r\n if (!Array.isArray(newData.friendlyName) && newData && newData.friendlyName) {\r\n // tslint:disable-next-line: no-any\r\n JSON.parse(newData.friendlyName).forEach( (item: any) => {\r\n staffArray.push(item);\r\n });\r\n } else {\r\n staffArray = newData && newData.friendlyName ? newData.friendlyName : [];\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n return staffArray.map((item: any) => item.value).toString();\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const createData = (newData: any) => {\r\n if (newData) {\r\n\r\n const groupId = props.match.params.command.split(';key=', 2)[1];\r\n\r\n client\r\n .mutate({\r\n mutation: AddFirmTeamMember,\r\n variables: {\r\n groupId: groupId,\r\n staffIdList: getStaffList(newData),\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Create Team Member', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Create Team Member', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n const deleteData = (oldData: Member) => {\r\n client\r\n .mutate({\r\n mutation: RemoveFirmTeamMember,\r\n variables: {\r\n guidId: oldData.guidID?.toString(),\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Delete Team Member', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Delete Team Member', reason, 'error');\r\n });\r\n };\r\n\r\n const handleBreadCrumbClick = (event: React.MouseEvent) => {\r\n event.preventDefault();\r\n props.history.goBack();\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onDeleteData = (data: any) => {\r\n\r\n setShowDeleteConfirm(true);\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onDeleteItems: data,\r\n };\r\n });\r\n // onDeleteItems = data;\r\n\r\n };\r\n\r\n const onDeleteConfirm = (agree: boolean) => {\r\n if (agree) {\r\n // tslint:disable-next-line: no-any\r\n state.onDeleteItems.forEach((selected: any) => {\r\n\r\n // delete check data\r\n deleteData(selected);\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(selected), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onDeleteItems: []\r\n };\r\n });\r\n\r\n }\r\n\r\n setShowDeleteConfirm(false);\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getUser = (data: any) => {\r\n\r\n const { friendlyName, email } = data;\r\n\r\n if (!Array.isArray(friendlyName) ) {\r\n let bColor: SemanticCOLORS = Colors[(friendlyName === '' || friendlyName === null) ? \r\n Colors[Colors.length] : (hashString(friendlyName) % Colors.length) - 1];\r\n let stringSplit = friendlyName\r\n .replace(/[^\\w\\s]/gi, '') // remove special character\r\n .split(' ')\r\n // tslint:disable-next-line: no-any\r\n .map((n: any) => n[0])\r\n .join('');\r\n \r\n let stringInitials = stringSplit.slice(0, 2);\r\n \r\n return (\r\n \r\n \r\n \r\n \r\n {stringInitials}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n \r\n \r\n );\r\n } \r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getUserIcon = (data: any) => {\r\n const { isActive } = data;\r\n\r\n if (isActive) {\r\n return (\r\n \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const removeItems = (itemId: string, name: string, componentProps: EditComponentProps | any) => {\r\n let memberList = componentProps.value;\r\n\r\n // tslint:disable-next-line: no-any\r\n const itemToRemove = memberList.findIndex((item: any) => item.value.toString().toLowerCase() === itemId.toString().toLowerCase());\r\n memberList.splice(itemToRemove, 1); \r\n\r\n componentProps.onChange(memberList);\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getUserComponent = (componentProps: EditComponentProps | any) => {\r\n const groupId = props.match.params.command.split(';key=', 2)[1];\r\n \r\n return (\r\n \r\n {\r\n componentProps.onChange(selectionList);\r\n }}\r\n onRemoveItem={(itemId: string, name: string) => {\r\n removeItems(itemId, name, componentProps);\r\n }}\r\n // value={componentProps.value \r\n // ? componentProps.value.value \r\n // : undefined}\r\n required={true}\r\n helperText={componentProps.helperText}\r\n error={componentProps.error}\r\n groupId={groupId}\r\n />\r\n \r\n );\r\n };\r\n\r\n const tableHeading = () => {\r\n\r\n const title = decodeURIComponent(props.match.params.command.split(';key=', 2)[0]);\r\n\r\n return (\r\n
\r\n \r\n \r\n Teams\r\n \r\n {title}\r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n return (\r\n
\r\n \r\n getUser(rowData), \r\n editComponent: (componentData) => getUserComponent(componentData),\r\n // tslint:disable-next-line: max-line-length\r\n validate: (rowData) => rowData.hasOwnProperty('friendlyName') && rowData.friendlyName.length > 0 \r\n ? true \r\n : { isValid: false, helperText: 'Member is required'},\r\n },\r\n // { title: 'friendlyName', field: 'friendlyName', searchable: true },\r\n { \r\n title: '', \r\n field: 'isActive', \r\n hidden: false, \r\n searchable: false,\r\n editable: 'never',\r\n render: (rowData) => getUserIcon(rowData)\r\n },\r\n { title: 'groupGuidId', field: 'groupGuidId', hidden: true, searchable: true },\r\n { title: 'guidID', field: 'guidID', hidden: true, searchable: true },\r\n { title: 'userID', field: 'userID', hidden: true, searchable: true },\r\n { title: 'email', field: 'email', hidden: true, searchable: true }\r\n ]}\r\n data={state.data} \r\n components={\r\n {\r\n // tslint:disable-next-line: max-line-length\r\n Toolbar: toolbarProps => (\r\n
\r\n \r\n
\r\n )\r\n }\r\n } \r\n options={{\r\n // search: true,\r\n addRowPosition: 'first',\r\n selection: true,\r\n paging: true,\r\n pageSize: 10,\r\n pageSizeOptions: [10, 20, 30, 40, 50],\r\n // showTitle: true,\r\n // toolbar: true,\r\n actionsColumnIndex: -1,\r\n }}\r\n editable={{ \r\n onRowAdd: (newData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (newData) {\r\n createData(newData);\r\n insertRowData(newData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowDelete: (oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n deleteData(oldData);\r\n deleteRowData(oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n isDeletable: (rowData) => {\r\n if (Array.isArray(rowData.friendlyName)) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n }}\r\n actions={[\r\n {\r\n tooltip: 'Remove All Selected Users',\r\n icon: DeleteOutline,\r\n // tslint:disable-next-line: no-any\r\n onClick: (evt: any, data: any) => onDeleteData(data)\r\n }\r\n ]}\r\n />\r\n
\r\n );\r\n}\r\n\r\nexport interface TeamMemberQueryParams {\r\n teamGuidId: string | null;\r\n}\r\n\r\nexport function retrieveTeamMemberData(\r\n query: TeamMemberQueryParams,\r\n refreshData: boolean,\r\n onSuccess: (data: FirmData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void\r\n): void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n client\r\n .query({\r\n query: FirmTeamMember,\r\n variables: {\r\n teamGuidId: query.teamGuidId\r\n },\r\n fetchPolicy: fetchPolicy,\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n onError(reason);\r\n });\r\n}\r\n\r\nconst FirmTeamMember = gql`\r\nquery FirmTeamMember($teamGuidId: String){\r\n firm{\r\n teams(teamGuidId: $teamGuidId) {\r\n team{\r\n guidID,\r\n description\r\n members{\r\n recordCount,\r\n member{\r\n guidID,\r\n staffId,\r\n groupGuidId,\r\n friendlyName,\r\n userId,\r\n email,\r\n isActive\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}`;\r\n\r\nconst AddFirmTeamMember = gql`\r\n mutation AddFirmTeamMember($groupId: String, $staffIdList: String) {\r\n addFirmTeamMember(groupId: $groupId, staffIdList: $staffIdList)\r\n }\r\n`;\r\n \r\nconst RemoveFirmTeamMember = gql`\r\n mutation RemoveFirmTeamMember($guidId: String){\r\n removeFirmTeamMember(guidId: $guidId)\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useState, useEffect } from 'react';\r\nimport MaterialTable, { EditComponentProps, MTableToolbar } from 'material-table';\r\nimport { \r\n Avatar, \r\n ListItem, \r\n ListItemAvatar, \r\n ListItemText, \r\n Badge,\r\n Typography, \r\n Chip\r\n} from '@material-ui/core';\r\nimport { Colors, hashString } from '../../tasksSummary/board/BoardCardDraggable';\r\nimport { SemanticCOLORS } from 'semantic-ui-react';\r\nimport PeopleOutlineIcon from '@material-ui/icons/PeopleOutline';\r\nimport { browserHistory } from '../../components/AppContent';\r\nimport { showNotification } from '../../App';\r\nimport { Icons } from 'material-table';\r\nimport { forwardRef } from 'react';\r\n \r\nimport AddBox from '@material-ui/icons/AddBox';\r\nimport ArrowDownward from '@material-ui/icons/ArrowDownward';\r\nimport Check from '@material-ui/icons/Check';\r\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\r\nimport ChevronRight from '@material-ui/icons/ChevronRight';\r\nimport Clear from '@material-ui/icons/Clear';\r\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\r\nimport Edit from '@material-ui/icons/Edit';\r\nimport FilterList from '@material-ui/icons/FilterList';\r\nimport FirstPage from '@material-ui/icons/FirstPage';\r\nimport LastPage from '@material-ui/icons/LastPage';\r\nimport Remove from '@material-ui/icons/Remove';\r\nimport SaveAlt from '@material-ui/icons/SaveAlt';\r\nimport Search from '@material-ui/icons/Search';\r\nimport ViewColumn from '@material-ui/icons/ViewColumn';\r\nimport { client } from '../..';\r\nimport gql from 'graphql-tag';\r\nimport DialogBox from '../../Dashboard/Component/DialogBox';\r\nimport { useStyles } from '../../lookupConfiguration/common/tabsStyle';\r\nimport { FirmData, Office } from '../../lookupConfiguration/models/Firm';\r\nimport { retrieveOfficeData } from '../../lookupConfiguration/selectors/FirmOfficeSelector';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { TimezoneSelector } from '../../lookupConfiguration/selectors/TimezoneSelector';\r\n\r\ninterface OfficeItem extends Office {\r\n timezoneSelector: IAutoCompleteItem | null;\r\n}\r\ninterface LookupOfficesMaintenanceState {\r\n // tslint:disable-next-line: no-any\r\n selectedRow: any | null;\r\n data: OfficeItem[];\r\n isLoading: boolean;\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nlet onDeleteItems: any = [];\r\n\r\nexport default function LookupOfficesMaintenance() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n selectedRow: null,\r\n data: [],\r\n isLoading: false,\r\n });\r\n\r\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\r\n\r\n useEffect(() => { \r\n fetchData();\r\n\r\n const subscribeFirmObj = subscribeFirm();\r\n\r\n return () => {\r\n subscribeFirmObj.unsubscribe();\r\n };\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const tableIcons: Icons = {\r\n Add: forwardRef((props, ref) => ),\r\n Check: forwardRef((props, ref) => ),\r\n Clear: forwardRef((props, ref) => ),\r\n Delete: forwardRef((props, ref) => ),\r\n DetailPanel: forwardRef((props, ref) => ),\r\n Edit: forwardRef((props, ref) => ),\r\n Export: forwardRef((props, ref) => ),\r\n Filter: forwardRef((props, ref) => ),\r\n FirstPage: forwardRef((props, ref) => ),\r\n LastPage: forwardRef((props, ref) => ),\r\n NextPage: forwardRef((props, ref) => ),\r\n PreviousPage: forwardRef((props, ref) => ),\r\n ResetSearch: forwardRef((props, ref) => ),\r\n Search: forwardRef((props, ref) => ),\r\n SortArrow: forwardRef((props, ref) => ),\r\n ThirdStateCheck: forwardRef((props, ref) => ),\r\n ViewColumn: forwardRef((props, ref) => )\r\n };\r\n\r\n const subscribeFirm = () => {\r\n return (\r\n // let subscription =\r\n client\r\n .subscribe({\r\n fetchPolicy: 'no-cache',\r\n query: firmSubscription,\r\n variables: {},\r\n })\r\n .subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n if (results.data.lookupNotification.status) {\r\n\r\n const { lookupNotification } = results.data;\r\n showNotification('Success', lookupNotification.message, 'info');\r\n\r\n if (lookupNotification.message.includes('created successfully')) {\r\n setState((prevState) => {\r\n\r\n const tdata = [...prevState.data];\r\n\r\n const temp = tdata[tdata.length - 1];\r\n\r\n tdata[tdata.length - 1] = {\r\n ...temp,\r\n guidID: lookupNotification.guidId\r\n };\r\n\r\n return {\r\n ...prevState,\r\n data: tdata\r\n };\r\n });\r\n }\r\n\r\n } else {\r\n showNotification('Failed', results.data.lookupNotification.message, 'error');\r\n }\r\n },\r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n },\r\n })\r\n );\r\n };\r\n\r\n const fetchData = () => {\r\n\r\n setState({\r\n ...state,\r\n isLoading: true,\r\n });\r\n retrieveOfficeData(\r\n undefined,\r\n true, // this.state.isRefresh, -- Since we are updating and creating, we do not fetch cached data\r\n // tslint:disable-next-line: no-console\r\n (data) => onRetrieveData(data),\r\n // tslint:disable-next-line:no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onRetrieveData = (data: FirmData) => {\r\n setState({\r\n ...state,\r\n data: data.firm.firmOffices.firmOffice.map((office: Office) => {\r\n return {\r\n ...office,\r\n timezoneSelector: office.timezone && office.timezoneDescription ? { label: office.timezoneDescription, value: office.timezone } : null\r\n };\r\n }),\r\n isLoading: false\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getSection = (data: any) => {\r\n\r\n const { description } = data;\r\n\r\n let bColor: SemanticCOLORS = Colors[(description === '' || description === null) ? \r\n Colors[Colors.length] : (hashString(description) % Colors.length) - 1];\r\n let stringSplit = description\r\n .replace(/[^\\w\\s]/gi, '') // remove special character\r\n .split(' ')\r\n // tslint:disable-next-line: no-any\r\n .map((n: any) => n[0])\r\n .join('');\r\n\r\n let stringInitials = stringSplit.slice(0, 2);\r\n \r\n return (\r\n
\r\n \r\n \r\n \r\n {stringInitials}\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getMember = (data: any) => {\r\n\r\n let staffCount = 0;\r\n\r\n if (data) {\r\n staffCount = data.staffCount;\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleRowClick = (event?: React.MouseEvent, rowData?: any, toggleDetailPanel?: (panelIndex?: number) => void) => {\r\n\r\n // tslint:disable-next-line: no-console\r\n console.log('rowData', rowData);\r\n\r\n setState({\r\n ...state,\r\n selectedRow: rowData.tableData.id\r\n });\r\n\r\n browserHistory.push(`/firmStructureConfiguration/offices/${encodeURIComponent(rowData.description)};key=${rowData.guidID}`);\r\n };\r\n\r\n const updateRowData = (newData: OfficeItem, oldData: OfficeItem) => {\r\n\r\n setState((prevState) => {\r\n\r\n const tdata = [...prevState.data];\r\n \r\n // if (tdata.some((e: OfficeItem) => e.description.toLowerCase() === newData.description.toLowerCase())) {\r\n // return { \r\n // ...prevState, \r\n // };\r\n // } \r\n\r\n tdata[tdata.indexOf(oldData)] = newData;\r\n \r\n return { \r\n ...prevState, \r\n data: tdata\r\n };\r\n \r\n });\r\n };\r\n\r\n const updateData = (rowData: OfficeItem) => {\r\n if (rowData) {\r\n client\r\n .mutate({\r\n mutation: updateFirmOffice,\r\n variables: {\r\n guidId: rowData.guidID,\r\n description: rowData.description,\r\n timezone: rowData.timezoneSelector ? rowData.timezoneSelector.value : null\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Update Office', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Update Office', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n const deleteRowData = (oldData: OfficeItem) => {\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(oldData), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n \r\n };\r\n\r\n const deleteData = (oldData: Office) => {\r\n client\r\n .mutate({\r\n mutation: deleteFirmOffice,\r\n variables: {\r\n guidId: oldData.guidID,\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Delete Office', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Delete Office', reason, 'error');\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const insertRowData = (newData: OfficeItem) => {\r\n\r\n setState((prevState) => {\r\n\r\n const tdata = prevState.data;\r\n\r\n if (tdata.some((e: OfficeItem) => e.description.toLowerCase() === newData.description.toLowerCase())) {\r\n return { \r\n ...prevState, \r\n };\r\n } \r\n tdata.push(newData);\r\n\r\n return { \r\n ...prevState,\r\n data: tdata\r\n };\r\n\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const createData = (newData: OfficeItem) => {\r\n if (newData) {\r\n client\r\n .mutate({\r\n mutation: createFirmOffice,\r\n variables: {\r\n description: newData.description,\r\n timezone: newData.timezoneSelector ? newData.timezoneSelector.value : null\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Create Office', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Create Office', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onDeleteData = (data: any) => {\r\n\r\n setShowDeleteConfirm(true);\r\n\r\n onDeleteItems = data;\r\n\r\n };\r\n\r\n const onDeleteConfirm = (agree: boolean) => {\r\n if (agree) {\r\n // tslint:disable-next-line: no-any\r\n onDeleteItems.forEach((selected: any) => {\r\n\r\n // delete check data\r\n deleteData(selected);\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(selected), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n\r\n });\r\n }\r\n\r\n setShowDeleteConfirm(false);\r\n };\r\n\r\n const getTitle = (title: string, count: number) => {\r\n return (\r\n
\r\n {title}\r\n \r\n
\r\n );\r\n };\r\n\r\n const timezoneRender = (data: OfficeItem) => {\r\n // console.log('timezoneRender', data);\r\n if (data.timezoneSelector) {\r\n return
{data.timezoneSelector.label}
;\r\n }\r\n return undefined;\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const timezoneSelectorComponent = (componentProps: EditComponentProps) => {\r\n\r\n return (\r\n {\r\n componentProps.onChange(selection);\r\n }}\r\n className={classes.textField}\r\n error={componentProps.error}\r\n value={componentProps.value}\r\n />\r\n );\r\n };\r\n\r\n return (\r\n
\r\n \r\n getSection(rowData), \r\n cellStyle: { flex: 3 }, \r\n headerStyle: { flex: 3 },\r\n validate: (rowData) => rowData.hasOwnProperty('description') && rowData.description \r\n ? true \r\n : { isValid: false, helperText: 'Office is required'},\r\n },\r\n { \r\n title: 'Timezone', \r\n field: 'timezoneSelector', \r\n cellStyle: { flex: 3 }, \r\n headerStyle: { flex: 3 },\r\n // tslint:disable-next-line: max-line-length\r\n // validate: (rowData) => rowData.hasOwnProperty('areaOfLaw') && rowData.areaOfLaw ? true : { isValid: false, helperText: 'Area of Law is required'},\r\n render: (rowData) => timezoneRender(rowData), \r\n editComponent: (componentData) => timezoneSelectorComponent(componentData),\r\n },\r\n // tslint:disable-next-line: max-line-length\r\n { title: 'Members Count', field: 'staffCount', render: (rowData) => getMember(rowData), editable: 'never', cellStyle: { justifyContent: 'center' }, headerStyle: { justifyContent: 'center' } },\r\n ]}\r\n components={\r\n {\r\n Toolbar: props => (\r\n
\r\n \r\n
\r\n )\r\n }\r\n }\r\n data={state.data} \r\n options={{\r\n addRowPosition: 'first',\r\n search: true,\r\n selection: true,\r\n paging: true,\r\n pageSize: 10,\r\n pageSizeOptions: [10, 20, 30, 40, 50],\r\n showTitle: true,\r\n toolbar: true,\r\n actionsColumnIndex: -1,\r\n rowStyle: rowData => ({\r\n backgroundColor: (state.selectedRow === rowData.tableData.id) ? '#EEE' : '#FFF'\r\n })\r\n }}\r\n editable={{\r\n onRowAdd: (newData: OfficeItem) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (newData.description) {\r\n createData(newData);\r\n insertRowData(newData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowUpdate: (newData, oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n updateData(newData);\r\n updateRowData(newData, oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowDelete: (oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n deleteData(oldData);\r\n deleteRowData(oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n }}\r\n actions={[\r\n {\r\n tooltip: 'Remove All Selected Office',\r\n icon: DeleteOutline,\r\n // tslint:disable-next-line: no-any\r\n onClick: (evt: any, data: any) => onDeleteData(data)\r\n },\r\n ]}\r\n />\r\n
\r\n );\r\n}\r\n\r\nconst createFirmOffice = gql`\r\n mutation createFirmOffice($description: String, $timezone: String) {\r\n createFirmOffice(description: $description, timezone: $timezone)\r\n }\r\n`;\r\n\r\nconst updateFirmOffice = gql`\r\n mutation updateFirmOffice($description: String, $guidId: String, $timezone: String) {\r\n updateFirmOffice(description:$description, guidId: $guidId, timezone: $timezone)\r\n }\r\n`;\r\n\r\nconst deleteFirmOffice = gql`\r\n mutation deleteFirmOffice($guidId: String) {\r\n deleteFirmOffice(guidId: $guidId)\r\n } \r\n`;\r\n\r\nconst firmSubscription = gql`\r\n subscription firm{\r\n lookupNotification{\r\n id,\r\n guidId,\r\n lookupDescription,\r\n message,\r\n status\r\n }\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useState, useEffect } from 'react';\r\nimport MaterialTable, { MTableToolbar, EditComponentProps } from 'material-table';\r\nimport { \r\n Avatar,\r\n ListItem,\r\n ListItemAvatar,\r\n ListItemText,\r\n Breadcrumbs,\r\n Link,\r\n Typography,\r\n Chip\r\n} from '@material-ui/core';\r\nimport { Colors, hashString } from '../../tasksSummary/board/BoardCardDraggable';\r\nimport { SemanticCOLORS } from 'semantic-ui-react';\r\nimport { RouterProps, showNotification } from '../../App';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport gql from 'graphql-tag';\r\nimport { client } from '../..';\r\nimport { firmSubscription } from './LookupTeamsMaintenance';\r\nimport { Icons } from 'material-table';\r\nimport { forwardRef } from 'react';\r\nimport AddBox from '@material-ui/icons/AddBox';\r\nimport ArrowDownward from '@material-ui/icons/ArrowDownward';\r\nimport Check from '@material-ui/icons/Check';\r\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\r\nimport ChevronRight from '@material-ui/icons/ChevronRight';\r\nimport Clear from '@material-ui/icons/Clear';\r\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\r\nimport Edit from '@material-ui/icons/Edit';\r\nimport FilterList from '@material-ui/icons/FilterList';\r\nimport FirstPage from '@material-ui/icons/FirstPage';\r\nimport LastPage from '@material-ui/icons/LastPage';\r\nimport Remove from '@material-ui/icons/Remove';\r\nimport SaveAlt from '@material-ui/icons/SaveAlt';\r\nimport Search from '@material-ui/icons/Search';\r\nimport ViewColumn from '@material-ui/icons/ViewColumn';\r\nimport DialogBox from '../../Dashboard/Component/DialogBox';\r\nimport { useStyles } from '../../lookupConfiguration/common/tabsStyle';\r\nimport { FirmData, Member } from '../../lookupConfiguration/models/Firm';\r\nimport { AvailableOfficeMemberSelector } from '../../lookupConfiguration/selectors/AvailableOfficeMemberSelector';\r\nimport { FetchPolicy } from 'apollo-client';\r\nimport PersonOutlineOutlinedIcon from '@material-ui/icons/PersonOutlineOutlined';\r\nimport PersonIcon from '@material-ui/icons/Person';\r\n\r\ninterface LookupOfficeMemberMaintenanceProps extends RouterProps {}\r\n\r\ninterface TableData extends Member {\r\n tableData: { \r\n checked: boolean;\r\n id: number;\r\n };\r\n}\r\n\r\ninterface LookupOfficeMemberMaintenanceState {\r\n // tslint:disable-next-line: no-any\r\n data: Member[];\r\n isLoading: boolean;\r\n onDeleteItems: TableData[];\r\n}\r\n\r\nexport default function LookupOfficeMemberMaintenance(props: LookupOfficeMemberMaintenanceProps) {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: false,\r\n data: [],\r\n onDeleteItems: [],\r\n });\r\n\r\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\r\n const [isRefreshData, setIsRefreshData] = useState(false);\r\n\r\n useEffect(() => {\r\n \r\n // groupId\r\n const { command } = props.match.params;\r\n\r\n const guID = command.split(';key=', 2)[1];\r\n\r\n if (command) {\r\n fetchData(guID);\r\n }\r\n\r\n const subscribeFirmObj = subscribeFirm();\r\n\r\n return () => {\r\n subscribeFirmObj.unsubscribe();\r\n };\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (isRefreshData) {\r\n const { command } = props.match.params;\r\n\r\n const guID = command.split(';key=', 2)[1];\r\n \r\n if (command) {\r\n fetchData(guID);\r\n }\r\n\r\n setIsRefreshData(false);\r\n } \r\n // tslint:disable-next-line: align\r\n }, [isRefreshData]);\r\n\r\n const tableIcons: Icons = {\r\n Add: forwardRef((iconProps, ref) => ),\r\n Check: forwardRef((iconProps, ref) => ),\r\n Clear: forwardRef((iconProps, ref) => ),\r\n Delete: forwardRef((iconProps, ref) => ),\r\n DetailPanel: forwardRef((iconProps, ref) => ),\r\n Edit: forwardRef((iconProps, ref) => ),\r\n Export: forwardRef((iconProps, ref) => ),\r\n Filter: forwardRef((iconProps, ref) => ),\r\n FirstPage: forwardRef((iconProps, ref) => ),\r\n LastPage: forwardRef((iconProps, ref) => ),\r\n NextPage: forwardRef((iconProps, ref) => ),\r\n PreviousPage: forwardRef((iconProps, ref) => ),\r\n ResetSearch: forwardRef((iconProps, ref) => ),\r\n Search: forwardRef((iconProps, ref) => ),\r\n SortArrow: forwardRef((iconProps, ref) => ),\r\n ThirdStateCheck: forwardRef((iconProps, ref) => ),\r\n ViewColumn: forwardRef((iconProps, ref) => )\r\n };\r\n\r\n const subscribeFirm = () => {\r\n return (\r\n // let subscription =\r\n client\r\n .subscribe({\r\n fetchPolicy: 'no-cache',\r\n query: firmSubscription,\r\n variables: {},\r\n })\r\n .subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n if (results.data.lookupNotification.status) {\r\n\r\n const { lookupNotification } = results.data;\r\n showNotification('Success', lookupNotification.message, 'info');\r\n\r\n if (lookupNotification.message.includes('member added successfully')) {\r\n setIsRefreshData(true);\r\n // setState((prevState) => {\r\n\r\n // const tdata = [...prevState.data];\r\n\r\n // const temp = tdata[tdata.length - 1];\r\n\r\n // tdata[tdata.length - 1] = {\r\n // ...temp,\r\n // guidID: lookupNotification.guidId\r\n // };\r\n\r\n // return {\r\n // ...prevState,\r\n // data: tdata\r\n // };\r\n // });\r\n }\r\n\r\n } else {\r\n showNotification('Failed', results.data.lookupNotification.message, 'error');\r\n }\r\n },\r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n },\r\n })\r\n );\r\n };\r\n\r\n const fetchData = (groupId: string) => {\r\n\r\n setState({\r\n ...state,\r\n isLoading: true,\r\n });\r\n\r\n const officeMemberQueryParams: OfficeMemberQueryParams = {\r\n officeGuidId: groupId\r\n };\r\n\r\n retrieveOfficeMemberData(\r\n officeMemberQueryParams,\r\n true, // refresh\r\n (data) => onRetrieveData(data),\r\n // tslint:disable-next-line:no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n setIsRefreshData(false);\r\n }\r\n );\r\n };\r\n\r\n const onRetrieveData = (data: FirmData) => {\r\n\r\n setState({\r\n ...state,\r\n data: data.firm.firmOffices.firmOffice.length > 0\r\n ? data.firm.firmOffices.firmOffice[0].members.member\r\n : [],\r\n isLoading: false\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const insertRowData = (newData: any) => {\r\n\r\n // let chipsArray = [];\r\n\r\n // if (newData && newData.friendlyName) { \r\n\r\n // if (!Array.isArray(newData.friendlyName)) {\r\n // // tslint:disable-next-line: no-any\r\n // JSON.parse(newData.friendlyName).forEach( (item: any) => {\r\n // chipsArray.push(item.label);\r\n // });\r\n // } else {\r\n // chipsArray = newData.friendlyName;\r\n // }\r\n // } \r\n \r\n const tdata = [...state.data];\r\n\r\n // if (tdata.some((e: Member) => e.staffId && e.staffId.toLowerCase() === newData.friendlyName.value.toLowerCase())) {\r\n // return { \r\n // ...state, \r\n // };\r\n // } \r\n\r\n tdata.push({\r\n friendlyName: newData.friendlyName,\r\n staffId: newData.friendlyName,\r\n email: newData.friendlyName\r\n });\r\n \r\n setState((prevState) => {\r\n return { \r\n ...prevState, \r\n data: tdata\r\n };\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const deleteRowData = (oldData: any) => {\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(oldData), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n \r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getStaffList = (newData: any) => {\r\n\r\n let staffArray = [];\r\n if (!Array.isArray(newData.friendlyName) && newData && newData.friendlyName) {\r\n // tslint:disable-next-line: no-any\r\n JSON.parse(newData.friendlyName).forEach( (item: any) => {\r\n staffArray.push(item);\r\n });\r\n } else {\r\n staffArray = newData && newData.friendlyName ? newData.friendlyName : [];\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n return staffArray.map((item: any) => item.value).toString();\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const createData = (newData: any) => {\r\n if (newData) {\r\n\r\n const groupId = props.match.params.command.split(';key=', 2)[1];\r\n\r\n client\r\n .mutate({\r\n mutation: AddFirmOfficeMember,\r\n variables: {\r\n groupId: groupId,\r\n staffIdList: getStaffList(newData),\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Create Team Member', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Create Team Member', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n const deleteData = (oldData: Member) => {\r\n client\r\n .mutate({\r\n mutation: RemoveFirmOfficeMember,\r\n variables: {\r\n guidId: oldData.guidID?.toString(),\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Delete Team Member', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Delete Team Member', reason, 'error');\r\n });\r\n };\r\n\r\n const handleBreadCrumbClick = (event: React.MouseEvent) => {\r\n event.preventDefault();\r\n props.history.goBack();\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onDeleteData = (data: any) => {\r\n\r\n setShowDeleteConfirm(true);\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onDeleteItems: data,\r\n };\r\n });\r\n // onDeleteItems = data;\r\n\r\n };\r\n\r\n const onDeleteConfirm = (agree: boolean) => {\r\n if (agree) {\r\n // tslint:disable-next-line: no-any\r\n state.onDeleteItems.forEach((selected: any) => {\r\n\r\n // delete check data\r\n deleteData(selected);\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(selected), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onDeleteItems: []\r\n };\r\n });\r\n\r\n }\r\n\r\n setShowDeleteConfirm(false);\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getUser = (data: any) => {\r\n\r\n const { friendlyName, email } = data;\r\n\r\n if (!Array.isArray(friendlyName) ) {\r\n let bColor: SemanticCOLORS = Colors[(friendlyName === '' || friendlyName === null) ? \r\n Colors[Colors.length] : (hashString(friendlyName) % Colors.length) - 1];\r\n let stringSplit = friendlyName\r\n .replace(/[^\\w\\s]/gi, '') // remove special character\r\n .split(' ')\r\n // tslint:disable-next-line: no-any\r\n .map((n: any) => n[0])\r\n .join('');\r\n\r\n let stringInitials = stringSplit.slice(0, 2);\r\n \r\n return (\r\n \r\n \r\n \r\n \r\n {stringInitials}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n } else {\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n /*\r\n let chipsArray = [];\r\n if (!Array.isArray(friendlyName)) {\r\n // tslint:disable-next-line: no-any\r\n JSON.parse(friendlyName).forEach( (item: any) => {\r\n chipsArray.push(item);\r\n });\r\n } else {\r\n chipsArray = friendlyName;\r\n }\r\n\r\n const chips: React.ReactNode = (\r\n
\r\n {\r\n // tslint:disable-next-line: no-any\r\n chipsArray.map((chipData: any) => { \r\n return (\r\n // tslint:disable-next-line: no-unused-expression\r\n \r\n );\r\n })\r\n }\r\n
\r\n );\r\n return chips;\r\n */\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getUserIcon = (data: any) => {\r\n const { isActive } = data;\r\n\r\n if (isActive) {\r\n return (\r\n \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const removeItems = (itemId: string, name: string, componentProps: EditComponentProps | any) => {\r\n let officeMemberList = componentProps.value;\r\n\r\n // tslint:disable-next-line: no-any\r\n const itemToRemove = officeMemberList.findIndex((item: any) => item.value.toString().toLowerCase() === itemId.toString().toLowerCase());\r\n officeMemberList.splice(itemToRemove, 1); \r\n\r\n componentProps.onChange(officeMemberList);\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getUserComponent = (componentProps: EditComponentProps | any) => {\r\n\r\n const groupId = props.match.params.command.split(';key=', 2)[1];\r\n\r\n return (\r\n \r\n {\r\n componentProps.onChange(selectionList);\r\n }}\r\n onRemoveItem={(itemId: string, name: string) => {\r\n removeItems(itemId, name, componentProps);\r\n }}\r\n // value={componentProps.value \r\n // ? componentProps.value.value \r\n // : undefined}\r\n required={true}\r\n helperText={componentProps.helperText}\r\n error={componentProps.error}\r\n groupId={groupId}\r\n />\r\n \r\n );\r\n };\r\n\r\n const tableHeading = () => {\r\n\r\n const title = decodeURIComponent(props.match.params.command.split(';key=', 2)[0]);\r\n\r\n return (\r\n
\r\n \r\n \r\n Offices\r\n \r\n {title}\r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n return (\r\n
\r\n \r\n getUser(rowData), \r\n editComponent: (componentData) => getUserComponent(componentData),\r\n validate: (rowData) => rowData.hasOwnProperty('friendlyName') && rowData.friendlyName.length > 0 \r\n ? true \r\n : { isValid: false, helperText: 'Member is required'},\r\n },\r\n // { title: 'friendlyName', field: 'friendlyName', searchable: true },\r\n { \r\n title: '', \r\n field: 'isActive', \r\n hidden: false, \r\n searchable: false,\r\n editable: 'never',\r\n render: (rowData) => getUserIcon(rowData)\r\n },\r\n { title: 'groupGuidId', field: 'groupGuidId', hidden: true, searchable: true },\r\n { title: 'guidID', field: 'guidID', hidden: true, searchable: true },\r\n { title: 'userID', field: 'userID', hidden: true, searchable: true },\r\n { title: 'email', field: 'email', hidden: true, searchable: true }\r\n ]}\r\n data={state.data} \r\n components={\r\n {\r\n // tslint:disable-next-line: max-line-length\r\n Toolbar: toolbarProps => (\r\n
\r\n \r\n
\r\n )\r\n }\r\n } \r\n options={{\r\n addRowPosition: 'first',\r\n // search: true,\r\n selection: true,\r\n paging: true,\r\n pageSize: 10,\r\n pageSizeOptions: [10, 20, 30, 40, 50],\r\n // showTitle: true,\r\n // toolbar: true,\r\n actionsColumnIndex: -1,\r\n }}\r\n editable={{\r\n onRowAdd: (newData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (newData) {\r\n createData(newData);\r\n insertRowData(newData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowDelete: (oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n deleteData(oldData);\r\n deleteRowData(oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n isDeletable: (rowData) => {\r\n if (Array.isArray(rowData.friendlyName)) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n }} \r\n actions={[\r\n {\r\n tooltip: 'Remove All Selected Users',\r\n icon: DeleteOutline,\r\n // tslint:disable-next-line: no-any\r\n onClick: (evt: any, data: any) => onDeleteData(data)\r\n }\r\n ]}\r\n />\r\n
\r\n );\r\n}\r\n\r\nexport interface OfficeMemberQueryParams {\r\n officeGuidId: string | null;\r\n}\r\n\r\nexport function retrieveOfficeMemberData(\r\n query: OfficeMemberQueryParams,\r\n refreshData: boolean,\r\n onSuccess: (data: FirmData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void): void {\r\n \r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n client\r\n .query({\r\n query: FirmOfficeMember,\r\n variables: {\r\n officeGuidId: query.officeGuidId\r\n },\r\n fetchPolicy: fetchPolicy,\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n onError(reason);\r\n });\r\n}\r\n\r\nconst FirmOfficeMember = gql`\r\nquery FirmOfficeMember($officeGuidId: String){\r\n firm{\r\n firmOffices(officeGuidId: $officeGuidId) {\r\n firmOffice{\r\n guidID,\r\n description\r\n members{\r\n recordCount,\r\n member{\r\n guidID,\r\n staffId,\r\n groupGuidId,\r\n friendlyName,\r\n userId,\r\n email,\r\n isActive\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}`;\r\n\r\nconst AddFirmOfficeMember = gql`\r\n mutation AddFirmOfficeMember($groupId: String, $staffIdList: String) {\r\n addFirmOfficeMember(groupId: $groupId, staffIdList: $staffIdList)\r\n }\r\n`;\r\n \r\nconst RemoveFirmOfficeMember = gql`\r\n mutation RemoveFirmOfficeMember($guidId: String){\r\n removeFirmOfficeMember(guidId: $guidId)\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useState, useEffect } from 'react';\r\nimport MaterialTable, { MTableToolbar } from 'material-table';\r\nimport { \r\n Avatar, \r\n ListItem, \r\n ListItemAvatar, \r\n ListItemText, \r\n Badge,\r\n Typography,\r\n Chip\r\n} from '@material-ui/core';\r\nimport { Colors, hashString } from '../../tasksSummary/board/BoardCardDraggable';\r\nimport { SemanticCOLORS } from 'semantic-ui-react';\r\nimport PeopleOutlineIcon from '@material-ui/icons/PeopleOutline';\r\nimport { browserHistory } from '../../components/AppContent';\r\nimport { showNotification } from '../../App';\r\nimport { Icons } from 'material-table';\r\nimport { forwardRef } from 'react';\r\n \r\nimport AddBox from '@material-ui/icons/AddBox';\r\nimport ArrowDownward from '@material-ui/icons/ArrowDownward';\r\nimport Check from '@material-ui/icons/Check';\r\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\r\nimport ChevronRight from '@material-ui/icons/ChevronRight';\r\nimport Clear from '@material-ui/icons/Clear';\r\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\r\nimport Edit from '@material-ui/icons/Edit';\r\nimport FilterList from '@material-ui/icons/FilterList';\r\nimport FirstPage from '@material-ui/icons/FirstPage';\r\nimport LastPage from '@material-ui/icons/LastPage';\r\nimport Remove from '@material-ui/icons/Remove';\r\nimport SaveAlt from '@material-ui/icons/SaveAlt';\r\nimport Search from '@material-ui/icons/Search';\r\nimport ViewColumn from '@material-ui/icons/ViewColumn';\r\nimport { client } from '../..';\r\nimport gql from 'graphql-tag';\r\nimport DialogBox from '../../Dashboard/Component/DialogBox';\r\nimport { Department, FirmData } from '../../lookupConfiguration/models/Firm';\r\nimport { useStyles } from '../../lookupConfiguration/common/tabsStyle';\r\nimport { retrieveDepartmentData } from '../../lookupConfiguration/selectors/FirmDepartmentSelector';\r\n\r\ninterface LookupDepartmentMaintenanceState {\r\n // tslint:disable-next-line: no-any\r\n selectedRow: any | null;\r\n data: Department[];\r\n isLoading: boolean;\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nlet onDeleteItems: any = [];\r\n\r\nexport default function LookupDepartmentMaintenance() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n selectedRow: null,\r\n data: [],\r\n isLoading: false,\r\n });\r\n\r\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\r\n\r\n useEffect(() => { \r\n fetchData();\r\n\r\n const subscribeFirmObj = subscribeFirm();\r\n\r\n return () => {\r\n subscribeFirmObj.unsubscribe();\r\n };\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const tableIcons: Icons = {\r\n Add: forwardRef((props, ref) => ),\r\n Check: forwardRef((props, ref) => ),\r\n Clear: forwardRef((props, ref) => ),\r\n Delete: forwardRef((props, ref) => ),\r\n DetailPanel: forwardRef((props, ref) => ),\r\n Edit: forwardRef((props, ref) => ),\r\n Export: forwardRef((props, ref) => ),\r\n Filter: forwardRef((props, ref) => ),\r\n FirstPage: forwardRef((props, ref) => ),\r\n LastPage: forwardRef((props, ref) => ),\r\n NextPage: forwardRef((props, ref) => ),\r\n PreviousPage: forwardRef((props, ref) => ),\r\n ResetSearch: forwardRef((props, ref) => ),\r\n Search: forwardRef((props, ref) => ),\r\n SortArrow: forwardRef((props, ref) => ),\r\n ThirdStateCheck: forwardRef((props, ref) => ),\r\n ViewColumn: forwardRef((props, ref) => )\r\n };\r\n\r\n const subscribeFirm = () => {\r\n return (\r\n // let subscription =\r\n client\r\n .subscribe({\r\n fetchPolicy: 'no-cache',\r\n query: firmSubscription,\r\n variables: {},\r\n })\r\n .subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n if (results.data.lookupNotification.status) {\r\n\r\n const { lookupNotification } = results.data;\r\n showNotification('Success', lookupNotification.message, 'info');\r\n\r\n if (lookupNotification.message.includes('created successfully')) {\r\n setState((prevState) => {\r\n\r\n const tdata = [...prevState.data];\r\n\r\n const temp = tdata[tdata.length - 1];\r\n\r\n tdata[tdata.length - 1] = {\r\n ...temp,\r\n guidID: lookupNotification.guidId\r\n };\r\n\r\n return {\r\n ...prevState,\r\n data: tdata\r\n };\r\n });\r\n }\r\n\r\n } else {\r\n showNotification('Failed', results.data.lookupNotification.message, 'error');\r\n }\r\n },\r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n },\r\n })\r\n );\r\n };\r\n\r\n const fetchData = () => {\r\n\r\n setState({\r\n ...state,\r\n isLoading: true,\r\n });\r\n retrieveDepartmentData(\r\n undefined,\r\n true, // this.state.isRefresh, -- Since we are updating and creating, we do not fetch cached data\r\n // tslint:disable-next-line: no-console\r\n (data) => onRetrieveData(data),\r\n // tslint:disable-next-line:no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onRetrieveData = (data: FirmData) => {\r\n setState({\r\n ...state,\r\n data: data.firm.departments.department,\r\n isLoading: false\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getSection = (data: any) => {\r\n\r\n const { description } = data;\r\n\r\n let bColor: SemanticCOLORS = Colors[(description === '' || description === null) ? \r\n Colors[Colors.length] : (hashString(description) % Colors.length) - 1];\r\n // tslint:disable-next-line: no-any\r\n let stringSplit = description\r\n .replace(/[^\\w\\s]/gi, '') // remove special character\r\n .split(' ')\r\n // tslint:disable-next-line: no-any\r\n .map((n: any) => n[0])\r\n .join('');\r\n\r\n let stringInitials = stringSplit.slice(0, 2);\r\n \r\n return (\r\n
\r\n \r\n \r\n \r\n {stringInitials}\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getMember = (data: any) => {\r\n\r\n let staffCount = 0;\r\n\r\n if (data) {\r\n staffCount = data.staffCount;\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleRowClick = (event?: React.MouseEvent, rowData?: any, toggleDetailPanel?: (panelIndex?: number) => void) => {\r\n\r\n // tslint:disable-next-line: no-console\r\n console.log('rowData', rowData);\r\n\r\n setState({\r\n ...state,\r\n selectedRow: rowData.tableData.id\r\n });\r\n\r\n browserHistory.push(`/firmStructureConfiguration/department/${encodeURIComponent(rowData.description)};key=${rowData.guidID}`);\r\n };\r\n\r\n const updateRowData = (newData: Department, oldData: Department) => {\r\n\r\n setState((prevState) => {\r\n\r\n const tdata = [...prevState.data];\r\n \r\n if (tdata.some((e: Department) => e.description.toLowerCase() === newData.description.toLowerCase())) {\r\n return { \r\n ...prevState, \r\n };\r\n } \r\n\r\n tdata[tdata.indexOf(oldData)] = newData;\r\n \r\n return { \r\n ...prevState, \r\n data: tdata\r\n };\r\n \r\n });\r\n };\r\n\r\n const updateData = (rowData: Department) => {\r\n if (rowData) {\r\n client\r\n .mutate({\r\n mutation: updateFirmDepartment,\r\n variables: {\r\n guidId: rowData.guidID,\r\n description: rowData.description,\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Update Department', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Update Department', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n const deleteRowData = (oldData: Department) => {\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(oldData), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n \r\n };\r\n\r\n const deleteData = (oldData: Department) => {\r\n client\r\n .mutate({\r\n mutation: deleteFirmDepartment,\r\n variables: {\r\n guidId: oldData.guidID,\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Delete Department', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Delete Department', reason, 'error');\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const insertRowData = (newData: Department) => {\r\n\r\n setState((prevState) => {\r\n\r\n const tdata = prevState.data;\r\n\r\n if (tdata.some((e: Department) => e.description.toLowerCase() === newData.description.toLowerCase())) {\r\n return { \r\n ...prevState, \r\n };\r\n } \r\n tdata.push(newData);\r\n\r\n return { \r\n ...prevState,\r\n data: tdata\r\n };\r\n\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const createData = (newData: Department) => {\r\n if (newData) {\r\n client\r\n .mutate({\r\n mutation: createFirmDepartment,\r\n variables: {\r\n description: newData.description\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Create Department', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Create Department', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onDeleteData = (data: any) => {\r\n\r\n setShowDeleteConfirm(true);\r\n\r\n onDeleteItems = data;\r\n\r\n };\r\n\r\n const onDeleteConfirm = (agree: boolean) => {\r\n if (agree) {\r\n // tslint:disable-next-line: no-any\r\n onDeleteItems.forEach((selected: any) => {\r\n\r\n // delete check data\r\n deleteData(selected);\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(selected), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n\r\n });\r\n }\r\n\r\n setShowDeleteConfirm(false);\r\n };\r\n\r\n const getTitle = (title: string, count: number) => {\r\n return (\r\n
\r\n {title}\r\n \r\n
\r\n );\r\n };\r\n\r\n return (\r\n
\r\n \r\n getSection(rowData), \r\n cellStyle: { flex: 3 }, \r\n headerStyle: { flex: 3 },\r\n validate: (rowData) => rowData.hasOwnProperty('description') && rowData.description ? true : { isValid: false, helperText: 'Department is required'},\r\n },\r\n // tslint:disable-next-line: max-line-length\r\n { title: 'Members Count', field: 'staffCount', render: (rowData) => getMember(rowData), editable: 'never', cellStyle: { justifyContent: 'center' }, headerStyle: { justifyContent: 'center' } },\r\n ]}\r\n components={\r\n {\r\n Toolbar: props => (\r\n
\r\n \r\n
\r\n )\r\n }\r\n }\r\n data={state.data} \r\n options={{\r\n addRowPosition: 'first',\r\n search: true,\r\n selection: true,\r\n paging: true,\r\n pageSize: 10,\r\n pageSizeOptions: [10, 20, 30, 40, 50],\r\n showTitle: true,\r\n toolbar: true,\r\n actionsColumnIndex: -1,\r\n rowStyle: rowData => ({\r\n backgroundColor: (state.selectedRow === rowData.tableData.id) ? '#EEE' : '#FFF'\r\n })\r\n }}\r\n editable={{\r\n onRowAdd: (newData: Department) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (newData.description) {\r\n createData(newData);\r\n insertRowData(newData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowUpdate: (newData, oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n updateData(newData);\r\n updateRowData(newData, oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowDelete: (oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n deleteData(oldData);\r\n deleteRowData(oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n }}\r\n actions={[\r\n {\r\n tooltip: 'Remove All Selected Department',\r\n icon: DeleteOutline,\r\n // tslint:disable-next-line: no-any\r\n onClick: (evt: any, data: any) => onDeleteData(data)\r\n },\r\n ]}\r\n />\r\n
\r\n );\r\n}\r\n\r\nconst createFirmDepartment = gql`\r\n mutation createFirmDepartment($description: String) {\r\n createFirmDepartment(description: $description)\r\n }\r\n`;\r\n\r\nconst updateFirmDepartment = gql`\r\n mutation updateFirmDepartment($description: String, $guidId: String) {\r\n updateFirmDepartment(description:$description, guidId: $guidId)\r\n }\r\n`;\r\n\r\nconst deleteFirmDepartment = gql`\r\n mutation deleteFirmDepartment($guidId: String) {\r\n deleteFirmDepartment(guidId: $guidId)\r\n } \r\n`;\r\n\r\nconst firmSubscription = gql`\r\n subscription firm{\r\n lookupNotification{\r\n id,\r\n guidId,\r\n lookupDescription,\r\n message,\r\n status\r\n }\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useState, useEffect } from 'react';\r\nimport MaterialTable, { MTableToolbar, EditComponentProps } from 'material-table';\r\nimport { \r\n Avatar,\r\n ListItem,\r\n ListItemAvatar,\r\n ListItemText,\r\n Breadcrumbs,\r\n Link,\r\n Typography, \r\n Chip\r\n} from '@material-ui/core';\r\nimport { Colors, hashString } from '../../tasksSummary/board/BoardCardDraggable';\r\nimport { SemanticCOLORS } from 'semantic-ui-react';\r\nimport { RouterProps, showNotification } from '../../App';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport gql from 'graphql-tag';\r\nimport { FetchPolicy } from 'apollo-client';\r\nimport { client } from '../..';\r\nimport { firmSubscription } from './LookupTeamsMaintenance';\r\nimport { Icons } from 'material-table';\r\nimport { forwardRef } from 'react';\r\nimport AddBox from '@material-ui/icons/AddBox';\r\nimport ArrowDownward from '@material-ui/icons/ArrowDownward';\r\nimport Check from '@material-ui/icons/Check';\r\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\r\nimport ChevronRight from '@material-ui/icons/ChevronRight';\r\nimport Clear from '@material-ui/icons/Clear';\r\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\r\nimport Edit from '@material-ui/icons/Edit';\r\nimport FilterList from '@material-ui/icons/FilterList';\r\nimport FirstPage from '@material-ui/icons/FirstPage';\r\nimport LastPage from '@material-ui/icons/LastPage';\r\nimport Remove from '@material-ui/icons/Remove';\r\nimport SaveAlt from '@material-ui/icons/SaveAlt';\r\nimport Search from '@material-ui/icons/Search';\r\nimport ViewColumn from '@material-ui/icons/ViewColumn';\r\nimport DialogBox from '../../Dashboard/Component/DialogBox';\r\nimport { FirmData, Member } from '../../lookupConfiguration/models/Firm';\r\nimport { useStyles } from '../../lookupConfiguration/common/tabsStyle';\r\nimport { AvailableDepartmentMemberSelector } from '../../lookupConfiguration/selectors/AvailableDepartmentMemberSelector';\r\nimport PersonOutlineOutlinedIcon from '@material-ui/icons/PersonOutlineOutlined';\r\nimport PersonIcon from '@material-ui/icons/Person';\r\n\r\ninterface LookupDepartmentMemberMaintenanceProps extends RouterProps {}\r\n\r\ninterface TableData extends Member {\r\n tableData: { \r\n checked: boolean;\r\n id: number;\r\n };\r\n}\r\ninterface LookupDepartmentMemberMaintenanceState {\r\n // tslint:disable-next-line: no-any\r\n data: Member[];\r\n isLoading: boolean;\r\n onDeleteItems: TableData[];\r\n}\r\n\r\nexport default function LookupDepartmentMemberMaintenance(props: LookupDepartmentMemberMaintenanceProps) {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: false,\r\n data: [],\r\n onDeleteItems: [],\r\n });\r\n\r\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\r\n const [isRefreshData, setIsRefreshData] = useState(false);\r\n\r\n useEffect(() => {\r\n \r\n // groupId\r\n const { command } = props.match.params;\r\n\r\n const guID = command.split(';key=', 2)[1];\r\n\r\n if (command) {\r\n fetchData(guID);\r\n }\r\n\r\n subscribeFirm();\r\n\r\n // return () => {\r\n // subscribeFirmObj.unsubscribe();\r\n // };\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n useEffect(() => {\r\n if (isRefreshData) {\r\n const { command } = props.match.params;\r\n\r\n const guID = command.split(';key=', 2)[1];\r\n \r\n if (command) {\r\n fetchData(guID);\r\n }\r\n\r\n setIsRefreshData(false);\r\n } \r\n // tslint:disable-next-line: align\r\n }, [isRefreshData]);\r\n\r\n const tableIcons: Icons = {\r\n Add: forwardRef((iconProps, ref) => ),\r\n Check: forwardRef((iconProps, ref) => ),\r\n Clear: forwardRef((iconProps, ref) => ),\r\n Delete: forwardRef((iconProps, ref) => ),\r\n DetailPanel: forwardRef((iconProps, ref) => ),\r\n Edit: forwardRef((iconProps, ref) => ),\r\n Export: forwardRef((iconProps, ref) => ),\r\n Filter: forwardRef((iconProps, ref) => ),\r\n FirstPage: forwardRef((iconProps, ref) => ),\r\n LastPage: forwardRef((iconProps, ref) => ),\r\n NextPage: forwardRef((iconProps, ref) => ),\r\n PreviousPage: forwardRef((iconProps, ref) => ),\r\n ResetSearch: forwardRef((iconProps, ref) => ),\r\n Search: forwardRef((iconProps, ref) => ),\r\n SortArrow: forwardRef((iconProps, ref) => ),\r\n ThirdStateCheck: forwardRef((iconProps, ref) => ),\r\n ViewColumn: forwardRef((iconProps, ref) => )\r\n };\r\n\r\n const subscribeFirm = () => {\r\n return (\r\n // let subscription =\r\n client\r\n .subscribe({\r\n fetchPolicy: 'no-cache',\r\n query: firmSubscription,\r\n variables: {},\r\n })\r\n .subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n if (results.data.lookupNotification.status) {\r\n\r\n const { lookupNotification } = results.data;\r\n showNotification('Success', lookupNotification.message, 'info');\r\n \r\n if (lookupNotification.message.includes('member added successfully')) {\r\n setIsRefreshData(true);\r\n\r\n // setState((prevState) => {\r\n\r\n // const tdata = [...prevState.data];\r\n\r\n // const temp = tdata[tdata.length - 1];\r\n\r\n // tdata[tdata.length - 1] = {\r\n // ...temp,\r\n // guidID: lookupNotification.guidId\r\n // };\r\n\r\n // return {\r\n // ...prevState,\r\n // data: tdata\r\n // };\r\n // });\r\n }\r\n\r\n } else {\r\n showNotification('Failed', results.data.lookupNotification.message, 'error');\r\n }\r\n },\r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n setIsRefreshData(true);\r\n },\r\n })\r\n );\r\n };\r\n\r\n const fetchData = (groupId: string) => {\r\n\r\n setState({\r\n ...state,\r\n isLoading: true,\r\n });\r\n\r\n const departmentMemberQueryParams: DepartmentMemberQueryParams = {\r\n departmentGuidId: groupId\r\n };\r\n\r\n retrieveDepartmentMemberData(\r\n departmentMemberQueryParams,\r\n true, // refresh\r\n (data) => onRetrieveData(data),\r\n // tslint:disable-next-line:no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n setIsRefreshData(false);\r\n }\r\n );\r\n };\r\n\r\n const onRetrieveData = (data: FirmData) => {\r\n setState({\r\n ...state,\r\n data: data.firm.departments.department.length > 0 \r\n ? data.firm.departments.department[0].members.member\r\n : [],\r\n isLoading: false\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const insertRowData = (newData: any) => {\r\n \r\n const tdata = [...state.data];\r\n\r\n // if (tdata.some((e: Member) => e.staffId && e.staffId.toLowerCase() === newData.friendlyName.value.toLowerCase())) {\r\n // return { \r\n // ...prevState, \r\n // };\r\n // } \r\n\r\n tdata.push({\r\n friendlyName: newData.friendlyName,\r\n staffId: newData.friendlyName,\r\n email: newData.friendlyName,\r\n // userID: '',\r\n // firmTeamGuidId: ''\r\n });\r\n\r\n setState((prevState) => {\r\n return { \r\n ...prevState, \r\n data: tdata\r\n };\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const deleteRowData = (oldData: any) => {\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(oldData), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n }); \r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getStaffList = (newData: any) => {\r\n\r\n let staffArray = [];\r\n if (!Array.isArray(newData.friendlyName) && newData && newData.friendlyName) {\r\n // tslint:disable-next-line: no-any\r\n JSON.parse(newData.friendlyName).forEach( (item: any) => {\r\n staffArray.push(item);\r\n });\r\n } else {\r\n staffArray = newData && newData.friendlyName ? newData.friendlyName : [];\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n return staffArray.map((item: any) => item.value).toString();\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const createData = (newData: any) => {\r\n if (newData) {\r\n\r\n const groupId = props.match.params.command.split(';key=', 2)[1];\r\n\r\n client\r\n .mutate({\r\n mutation: AddFirmDepartmentMember,\r\n variables: {\r\n groupId: groupId,\r\n staffIdList: getStaffList(newData),\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Create Team Member', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Create Team Member', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n const deleteData = (oldData: Member) => {\r\n client\r\n .mutate({\r\n mutation: RemoveFirmDepartmentMember,\r\n variables: {\r\n guidId: oldData.guidID?.toString(),\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Delete Team Member', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Delete Team Member', reason, 'error');\r\n });\r\n };\r\n\r\n const handleBreadCrumbClick = (event: React.MouseEvent) => {\r\n event.preventDefault();\r\n props.history.goBack();\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onDeleteData = (data: any) => {\r\n\r\n setShowDeleteConfirm(true);\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onDeleteItems: data,\r\n };\r\n });\r\n // onDeleteItems = data;\r\n\r\n };\r\n\r\n const onDeleteConfirm = (agree: boolean) => {\r\n if (agree) {\r\n // tslint:disable-next-line: no-any\r\n state.onDeleteItems.forEach((selected: any) => {\r\n\r\n // delete check data\r\n deleteData(selected);\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(selected), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onDeleteItems: []\r\n };\r\n });\r\n\r\n }\r\n\r\n setShowDeleteConfirm(false);\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getUser = (data: any) => {\r\n\r\n const { friendlyName, email } = data;\r\n\r\n if (!Array.isArray(friendlyName) ) {\r\n let bColor: SemanticCOLORS = Colors[(friendlyName === '' || friendlyName === null) ? \r\n Colors[Colors.length] : (hashString(friendlyName) % Colors.length) - 1];\r\n // tslint:disable-next-line: no-any\r\n let stringSplit = friendlyName\r\n .replace(/[^\\w\\s]/gi, '') // remove special character\r\n .split(' ')\r\n // tslint:disable-next-line: no-any\r\n .map((n: any) => n[0])\r\n .join('');\r\n \r\n let stringInitials = stringSplit.slice(0, 2);\r\n \r\n return (\r\n \r\n \r\n \r\n \r\n {stringInitials}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n \r\n \r\n );\r\n } \r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getUserIcon = (data: any) => {\r\n const { isActive } = data;\r\n\r\n if (isActive) {\r\n return (\r\n \r\n \r\n \r\n );\r\n } else {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const removeItems = (itemId: string, name: string, componentProps: EditComponentProps | any) => {\r\n let memberList = componentProps.value;\r\n\r\n // tslint:disable-next-line: no-any\r\n const itemToRemove = memberList.findIndex((item: any) => item.value.toString().toLowerCase() === itemId.toString().toLowerCase());\r\n memberList.splice(itemToRemove, 1); \r\n\r\n componentProps.onChange(memberList);\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const getUserComponent = (componentProps: EditComponentProps | any) => {\r\n\r\n // tslint:disable-next-line: no-console\r\n console.log('componentProps', componentProps);\r\n\r\n const groupId = props.match.params.command.split(';key=', 2)[1];\r\n\r\n return (\r\n \r\n {\r\n componentProps.onChange(selectionList);\r\n }}\r\n onRemoveItem={(itemId: string, name: string) => {\r\n removeItems(itemId, name, componentProps);\r\n }}\r\n // value={componentProps.value \r\n // ? componentProps.value.value \r\n // : undefined}\r\n required={true}\r\n helperText={componentProps.helperText}\r\n error={componentProps.error}\r\n groupId={groupId}\r\n />\r\n \r\n );\r\n };\r\n\r\n const tableHeading = () => {\r\n\r\n const title = decodeURIComponent(props.match.params.command.split(';key=', 2)[0]);\r\n\r\n return (\r\n
\r\n \r\n \r\n Departments\r\n \r\n {title}\r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n return (\r\n
\r\n \r\n \r\n getUser(rowData), \r\n editComponent: (componentData) => getUserComponent(componentData),\r\n // Cell delete item is managed here\r\n validate: (rowData) => rowData.hasOwnProperty('friendlyName') && rowData.friendlyName.length > 0 \r\n ? true \r\n : { isValid: false, helperText: 'Member is required'},\r\n },\r\n // { title: 'friendlyName', field: 'friendlyName', searchable: true },\r\n { \r\n title: '', \r\n field: 'isActive', \r\n hidden: false, \r\n searchable: false,\r\n editable: 'never',\r\n render: (rowData) => getUserIcon(rowData)\r\n },\r\n { title: 'groupGuidId', field: 'groupGuidId', hidden: true, searchable: true },\r\n { title: 'guidID', field: 'guidID', hidden: true, searchable: true },\r\n { title: 'userID', field: 'userID', hidden: true, searchable: true },\r\n { title: 'email', field: 'email', hidden: true, searchable: true }\r\n ]}\r\n data={state.data} \r\n components={\r\n {\r\n // tslint:disable-next-line: max-line-length\r\n Toolbar: toolbarProps => (\r\n
\r\n \r\n
\r\n )\r\n }\r\n } \r\n options={{\r\n addRowPosition: 'first',\r\n // search: true,\r\n selection: true,\r\n paging: true,\r\n pageSize: 10,\r\n pageSizeOptions: [10, 20, 30, 40, 50],\r\n // showTitle: true,\r\n // toolbar: true,\r\n actionsColumnIndex: -1,\r\n }}\r\n editable={{\r\n onRowAdd: (newData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (newData) {\r\n createData(newData);\r\n insertRowData(newData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowDelete: (oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n deleteData(oldData);\r\n deleteRowData(oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n isDeletable: (rowData) => {\r\n if (Array.isArray(rowData.friendlyName)) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }\r\n }}\r\n actions={[\r\n {\r\n tooltip: 'Remove All Selected Users',\r\n icon: DeleteOutline,\r\n // tslint:disable-next-line: no-any\r\n onClick: (evt: any, data: any) => onDeleteData(data)\r\n }\r\n ]}\r\n />\r\n
\r\n );\r\n}\r\n\r\nexport interface DepartmentMemberQueryParams {\r\n departmentGuidId: string | null;\r\n}\r\n\r\nexport function retrieveDepartmentMemberData(\r\n query: DepartmentMemberQueryParams,\r\n refreshData: boolean,\r\n onSuccess: (data: FirmData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void): void {\r\n\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n client\r\n .query({\r\n query: FirmDepartmentMember,\r\n variables: {\r\n departmentGuidId: query.departmentGuidId\r\n },\r\n fetchPolicy: fetchPolicy,\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n onError(reason);\r\n });\r\n}\r\n\r\nconst FirmDepartmentMember = gql`\r\nquery FirmDepartmentMember($departmentGuidId: String){\r\n firm{\r\n departments(departmentGuidId: $departmentGuidId) {\r\n department{\r\n guidID,\r\n description\r\n members{\r\n recordCount,\r\n member{\r\n guidID,\r\n staffId,\r\n groupGuidId,\r\n friendlyName,\r\n userId,\r\n email,\r\n isActive\r\n }\r\n }\r\n }\r\n }\r\n }\r\n}`;\r\n\r\nconst AddFirmDepartmentMember = gql`\r\n mutation AddFirmDepartmentMember($groupId: String, $staffIdList: String) {\r\n addFirmDepartmentMember(groupId: $groupId, staffIdList: $staffIdList)\r\n }\r\n`;\r\n \r\nconst RemoveFirmDepartmentMember = gql`\r\n mutation RemoveFirmDepartmentMember($guidId: String){\r\n removeFirmDepartmentMember(guidId: $guidId)\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useEffect, useState } from 'react';\r\nimport MaterialTable, { Column, EditComponentProps, MTableToolbar } from 'material-table';\r\nimport { \r\n Avatar, \r\n ListItem, \r\n ListItemAvatar, \r\n ListItemText, \r\n Badge,\r\n Typography, \r\n Chip\r\n} from '@material-ui/core';\r\nimport { Colors, hashString } from '../../tasksSummary/board/BoardCardDraggable';\r\nimport { SemanticCOLORS } from 'semantic-ui-react';\r\nimport PeopleOutlineIcon from '@material-ui/icons/PeopleOutline';\r\nimport { browserHistory } from '../../components/AppContent';\r\nimport { Icons } from 'material-table';\r\nimport { forwardRef } from 'react';\r\n \r\nimport AddBox from '@material-ui/icons/AddBox';\r\nimport ArrowDownward from '@material-ui/icons/ArrowDownward';\r\nimport Check from '@material-ui/icons/Check';\r\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\r\nimport ChevronRight from '@material-ui/icons/ChevronRight';\r\nimport Clear from '@material-ui/icons/Clear';\r\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\r\nimport Edit from '@material-ui/icons/Edit';\r\nimport FilterList from '@material-ui/icons/FilterList';\r\nimport FirstPage from '@material-ui/icons/FirstPage';\r\nimport LastPage from '@material-ui/icons/LastPage';\r\nimport Remove from '@material-ui/icons/Remove';\r\nimport SaveAlt from '@material-ui/icons/SaveAlt';\r\nimport Search from '@material-ui/icons/Search';\r\nimport ViewColumn from '@material-ui/icons/ViewColumn';\r\nimport DialogBox from '../../Dashboard/Component/DialogBox';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport { retrieveUserListData, UserAutocompleteSelector, UserListData, UserQueryParams } from '../../components/UserAutocompleteSelector';\r\nimport { showNotification } from '../../App';\r\nimport { useStyles } from '../../lookupConfiguration/common/tabsStyle';\r\n// import { FirmData, Team } from '../models/Firm';\r\n\r\ninterface TemporaryDataFormat {\r\n // tslint:disable-next-line: no-any\r\n user: IAutoCompleteItem | any;\r\n count: number;\r\n}\r\n\r\ninterface LookupUserAssistantMaintenanceState {\r\n // tslint:disable-next-line: no-any\r\n selectedRow: any | null;\r\n data: TemporaryDataFormat[];\r\n isLoading: boolean;\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nlet onDeleteItems: any = [];\r\n\r\nexport default function LookupUserAssistantMaintenance() {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n selectedRow: null,\r\n data: [],\r\n isLoading: false,\r\n });\r\n\r\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\r\n\r\n useEffect(() => { \r\n\r\n fetchData();\r\n\r\n // const subscribeFirmObj = subscribeFirm();\r\n\r\n // return () => {\r\n // subscribeFirmObj.unsubscribe();\r\n // };\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const tableIcons: Icons = {\r\n Add: forwardRef((props, ref) => ),\r\n Check: forwardRef((props, ref) => ),\r\n Clear: forwardRef((props, ref) => ),\r\n Delete: forwardRef((props, ref) => ),\r\n DetailPanel: forwardRef((props, ref) => ),\r\n Edit: forwardRef((props, ref) => ),\r\n Export: forwardRef((props, ref) => ),\r\n Filter: forwardRef((props, ref) => ),\r\n FirstPage: forwardRef((props, ref) => ),\r\n LastPage: forwardRef((props, ref) => ),\r\n NextPage: forwardRef((props, ref) => ),\r\n PreviousPage: forwardRef((props, ref) => ),\r\n ResetSearch: forwardRef((props, ref) => ),\r\n Search: forwardRef((props, ref) => ),\r\n SortArrow: forwardRef((props, ref) => ),\r\n ThirdStateCheck: forwardRef((props, ref) => ),\r\n ViewColumn: forwardRef((props, ref) => )\r\n };\r\n\r\n // const subscribeFirm = () => {\r\n // return (\r\n // // let subscription =\r\n // client\r\n // .subscribe({\r\n // fetchPolicy: 'no-cache',\r\n // query: firmSubscription,\r\n // variables: {},\r\n // })\r\n // .subscribe({\r\n // // tslint:disable-next-line:no-any\r\n // next(results: any) {\r\n // if (results.data.lookupNotification.status) {\r\n\r\n // const { lookupNotification } = results.data;\r\n // showNotification('Success', lookupNotification.message, 'info');\r\n\r\n // if (lookupNotification.message.includes('created successfully')) {\r\n // setState((prevState) => {\r\n\r\n // const tdata = [...prevState.data];\r\n\r\n // const temp = tdata[tdata.length - 1];\r\n\r\n // tdata[tdata.length - 1] = {\r\n // ...temp,\r\n // guidID: lookupNotification.guidId\r\n // };\r\n\r\n // return {\r\n // ...prevState,\r\n // data: tdata\r\n // };\r\n // });\r\n // }\r\n\r\n // } else {\r\n // showNotification('Failed', results.data.lookupNotification.message, 'error');\r\n // }\r\n // },\r\n // // tslint:disable-next-line:no-any\r\n // error(err: any) {\r\n // // tslint:disable-next-line:no-console\r\n // console.error(err);\r\n // showNotification(null, err, 'error');\r\n // },\r\n // })\r\n // );\r\n // };\r\n\r\n const fetchData = () => {\r\n\r\n setState({\r\n ...state,\r\n isLoading: true,\r\n });\r\n const userQueryParams: UserQueryParams = {\r\n // filter: filter,\r\n // first: loadBlockLimit,\r\n // offset: state.offset,\r\n isStaff: null,\r\n isExternal: false\r\n };\r\n\r\n retrieveUserListData(\r\n userQueryParams,\r\n true, // this.state.isRefresh, -- Since we are updating and creating, we do not fetch cached data\r\n // tslint:disable-next-line: no-console\r\n (data) => onRetrieveData(data),\r\n // tslint:disable-next-line:no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n isNextPageLoading: false,\r\n };\r\n });\r\n }\r\n );\r\n };\r\n\r\n const onRetrieveData = (data: UserListData) => {\r\n\r\n const userData = data.administrator.users.user;\r\n\r\n const tempData = userData.map((user) => {\r\n return {\r\n user: {\r\n value: user.userID, \r\n label: user.isStaff ? user.staffName : user.friendlyName,\r\n },\r\n count: user.assistantCount\r\n };\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n data: tempData,\r\n isLoading: false\r\n };\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const userRender = (data: any) => {\r\n\r\n if (data.user) {\r\n\r\n const user = data.user;\r\n\r\n let bColor: SemanticCOLORS = Colors[(user.label === '' || user.label === null) ? \r\n Colors[Colors.length] : (hashString(user.label) % Colors.length) - 1];\r\n // tslint:disable-next-line: no-any\r\n let stringSplit = user.label\r\n .replace(/[^\\w\\s]/gi, '') // remove special character\r\n .split(' ')\r\n // tslint:disable-next-line: no-any\r\n .map((n: any) => n[0])\r\n .join('');\r\n\r\n let stringInitials = stringSplit.slice(0, 2);\r\n \r\n return (\r\n \r\n \r\n \r\n \r\n {stringInitials}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const memberCountRender = (data: any) => {\r\n\r\n let count = 0;\r\n\r\n if (data && data.count) {\r\n count = data.count;\r\n }\r\n\r\n return (\r\n
\r\n \r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const handleRowClick = (event?: React.MouseEvent, rowData?: any, toggleDetailPanel?: (panelIndex?: number) => void) => {\r\n\r\n // tslint:disable-next-line: no-console\r\n console.log('rowData', rowData);\r\n\r\n setState({\r\n ...state,\r\n selectedRow: rowData.tableData.id\r\n });\r\n\r\n browserHistory.push(`/firmStructureConfiguration/userAssistant/${encodeURIComponent(rowData.user.label)};key=${rowData.user.value}`);\r\n };\r\n\r\n // const updateRowData = (newData: TemporaryDataFormat, oldData: TemporaryDataFormat) => {\r\n\r\n // setState((prevState) => {\r\n\r\n // const tdata = [...prevState.data];\r\n \r\n // if (tdata.some((e: TemporaryDataFormat) => e.user.value.toLowerCase() === newData.user.value.toLowerCase())) {\r\n // return { \r\n // ...prevState, \r\n // };\r\n // } \r\n\r\n // tdata[tdata.indexOf(oldData)] = newData;\r\n \r\n // return { \r\n // ...prevState, \r\n // data: tdata\r\n // };\r\n \r\n // });\r\n // };\r\n\r\n // const updateData = (rowData: TemporaryDataFormat) => {\r\n // // if (rowData) {\r\n // // client\r\n // // .mutate({\r\n // // mutation: updateFirmTeam,\r\n // // variables: {\r\n // // guidId: rowData.guidID,\r\n // // description: rowData.description,\r\n // // },\r\n // // })\r\n // // // tslint:disable-next-line: no-any\r\n // // .then((results: { data: any }) => {\r\n // // if (results.data) {\r\n // // if (results.data.error !== undefined) {\r\n // // showNotification( 'Failed to Update Team', results.data.error, 'error');\r\n // // }\r\n // // }\r\n // // })\r\n // // // tslint:disable-next-line:no-any\r\n // // .catch((reason: any) => {\r\n // // showNotification('Failed to Update Team', reason, 'error');\r\n // // });\r\n // // }\r\n // };\r\n\r\n // const deleteRowData = (oldData: TemporaryDataFormat) => {\r\n\r\n // setState((prevState) => {\r\n // const tdata = [...prevState.data];\r\n // tdata.splice(tdata.indexOf(oldData), 1);\r\n // return { \r\n // ...prevState, \r\n // data: tdata \r\n // };\r\n // });\r\n \r\n // };\r\n\r\n const deleteData = (oldData: TemporaryDataFormat) => {\r\n // client\r\n // .mutate({\r\n // mutation: deleteFirmTeam,\r\n // variables: {\r\n // guidId: oldData.guidID,\r\n // },\r\n // })\r\n // // tslint:disable-next-line: no-any\r\n // .then((results: { data: any }) => {\r\n // if (results.data) {\r\n // if (results.data.error !== undefined) {\r\n // showNotification( 'Failed to Delete Team', results.data.error, 'error');\r\n // }\r\n // }\r\n // })\r\n // // tslint:disable-next-line:no-any\r\n // .catch((reason: any) => {\r\n // showNotification('Failed to Delete Team', reason, 'error');\r\n // });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const insertRowData = (newData: TemporaryDataFormat) => {\r\n\r\n // setState((prevState) => {\r\n\r\n // const tdata = prevState.data;\r\n\r\n // if (tdata.some((e: TemporaryDataFormat) => e.user.value.toLowerCase() === newData.user.value.toLowerCase())) {\r\n // return { \r\n // ...prevState, \r\n // };\r\n // } \r\n\r\n // tdata.push(newData);\r\n\r\n // return { \r\n // ...prevState,\r\n // data: tdata\r\n // };\r\n\r\n // });\r\n // };\r\n\r\n // // tslint:disable-next-line: no-any\r\n // const createData = (newData: TemporaryDataFormat) => {\r\n // if (newData) {\r\n // client\r\n // .mutate({\r\n // mutation: CreateUserAssistantMutation,\r\n // variables: {\r\n // input: {\r\n // userToAssistId: newData.user.value,\r\n // }\r\n // },\r\n // })\r\n // // tslint:disable-next-line: no-any\r\n // .then((results: { data: any }) => {\r\n\r\n // if (results.data) {\r\n\r\n // if (results.data.error !== undefined || results.data.error !== null) {\r\n // showNotification( 'Failed to Create User Assistant', results.data.error, 'error');\r\n // }\r\n // }\r\n // })\r\n // // tslint:disable-next-line:no-any\r\n // .catch((reason: any) => {\r\n // showNotification('Failed to Create User Assistant', reason, 'error');\r\n // });\r\n // }\r\n // };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const onDeleteData = (data: any) => {\r\n\r\n // setShowDeleteConfirm(true);\r\n\r\n // onDeleteItems = data;\r\n\r\n // };\r\n\r\n const onDeleteConfirm = (agree: boolean) => {\r\n if (agree) {\r\n // tslint:disable-next-line: no-any\r\n onDeleteItems.forEach((selected: any) => {\r\n\r\n // delete check data\r\n deleteData(selected);\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(selected), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n\r\n });\r\n }\r\n\r\n setShowDeleteConfirm(false);\r\n };\r\n\r\n const getTitle = (title: string, count: number) => {\r\n return (\r\n
\r\n {title}\r\n \r\n
\r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const userSelectorComponent = (componentProps: EditComponentProps) => {\r\n \r\n return (\r\n {\r\n componentProps.onChange(selection);\r\n }}\r\n error={componentProps.error}\r\n disablePortal={false}\r\n className={classes.textField}\r\n />\r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const customFilterAndSearch = (filter: any, rowData: TemporaryDataFormat, columnDef: Column) => {\r\n return rowData && rowData.user && rowData.user.label.toLowerCase().includes(filter.toLowerCase());\r\n };\r\n\r\n return (\r\n
\r\n \r\n rowData.hasOwnProperty('user') && rowData.user \r\n ? true \r\n : { isValid: false, helperText: 'User is required'},\r\n render: (rowData) => userRender(rowData), cellStyle: { flex: 3 }, headerStyle: { flex: 3 },\r\n editComponent: (componentData) => userSelectorComponent(componentData),\r\n customFilterAndSearch: customFilterAndSearch\r\n },\r\n { \r\n title: 'Assistant Count', \r\n field: 'count', render: (rowData) => \r\n memberCountRender(rowData), editable: 'never', \r\n cellStyle: { justifyContent: 'center' }, \r\n headerStyle: { justifyContent: 'center' },\r\n },\r\n ]}\r\n components={\r\n {\r\n Toolbar: props => (\r\n
\r\n \r\n
\r\n )\r\n }\r\n }\r\n data={state.data} \r\n options={{\r\n addRowPosition: 'first',\r\n search: true,\r\n selection: true,\r\n paging: true,\r\n pageSize: 10,\r\n pageSizeOptions: [10, 20, 30, 40, 50],\r\n showTitle: true,\r\n toolbar: true,\r\n actionsColumnIndex: -1,\r\n rowStyle: rowData => ({\r\n backgroundColor: (state.selectedRow === rowData.tableData.id) ? '#EEE' : '#FFF'\r\n })\r\n }}\r\n // editable={{\r\n // onRowAdd: (newData: TemporaryDataFormat) =>\r\n // // tslint:disable-next-line: no-any\r\n // new Promise((resolve: any) => {\r\n // setTimeout(() => {\r\n // resolve();\r\n // if (newData.user) {\r\n // createData(newData);\r\n // insertRowData(newData);\r\n // }\r\n // // tslint:disable-next-line: align\r\n // }, 600);\r\n // }),\r\n // onRowUpdate: (newData, oldData) =>\r\n // // tslint:disable-next-line: no-any\r\n // new Promise((resolve: any) => {\r\n // setTimeout(() => {\r\n // resolve();\r\n // if (oldData) {\r\n // updateData(newData);\r\n // updateRowData(newData, oldData);\r\n // }\r\n // // tslint:disable-next-line: align\r\n // }, 600);\r\n // }),\r\n // onRowDelete: (oldData) =>\r\n // // tslint:disable-next-line: no-any\r\n // new Promise((resolve: any) => {\r\n // setTimeout(() => {\r\n // resolve();\r\n // if (oldData) {\r\n // deleteData(oldData);\r\n // deleteRowData(oldData);\r\n // }\r\n // // tslint:disable-next-line: align\r\n // }, 600);\r\n // }),\r\n // }}\r\n // actions={[\r\n // {\r\n // tooltip: 'Remove All Selected Team',\r\n // icon: DeleteOutline,\r\n // // tslint:disable-next-line: no-any\r\n // onClick: (evt: any, data: any) => onDeleteData(data)\r\n // },\r\n // ]}\r\n />\r\n
\r\n );\r\n}\r\n\r\n// const createFirmTeam = gql`\r\n// mutation createFirmTeam($description: String) {\r\n// createFirmTeam(description: $description)\r\n// }\r\n// `;\r\n\r\n// const updateFirmTeam = gql`\r\n// mutation updateFirmTeam($description: String, $guidId: String) {\r\n// updateFirmTeam(description:$description, guidId: $guidId)\r\n// }\r\n// `;\r\n\r\n// const deleteFirmTeam = gql`\r\n// mutation deleteFirmTeam($guidId: String) {\r\n// deleteFirmTeam(guidId: $guidId)\r\n// } \r\n// `;\r\n\r\n// export const firmSubscription = gql`\r\n// subscription firm{\r\n// lookupNotification{\r\n// id,\r\n// guidId,\r\n// lookupDescription,\r\n// message,\r\n// status\r\n// }\r\n// }\r\n// `;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useEffect, useState } from 'react';\r\nimport MaterialTable, { MTableToolbar, EditComponentProps, Column } from 'material-table';\r\nimport { \r\n Avatar,\r\n ListItem,\r\n ListItemAvatar,\r\n ListItemText,\r\n Breadcrumbs,\r\n Link,\r\n Typography,\r\n Chip\r\n} from '@material-ui/core';\r\nimport { Colors, hashString } from '../../tasksSummary/board/BoardCardDraggable';\r\nimport { SemanticCOLORS } from 'semantic-ui-react';\r\nimport { RouterProps, showNotification } from '../../App';\r\nimport { IAutoCompleteItem } from '../../typings/autoComplete';\r\nimport gql from 'graphql-tag';\r\nimport { FetchPolicy } from 'apollo-client';\r\nimport { client } from '../..';\r\nimport { Icons } from 'material-table';\r\nimport { forwardRef } from 'react';\r\nimport AddBox from '@material-ui/icons/AddBox';\r\nimport ArrowDownward from '@material-ui/icons/ArrowDownward';\r\nimport Check from '@material-ui/icons/Check';\r\nimport ChevronLeft from '@material-ui/icons/ChevronLeft';\r\nimport ChevronRight from '@material-ui/icons/ChevronRight';\r\nimport Clear from '@material-ui/icons/Clear';\r\nimport DeleteOutline from '@material-ui/icons/DeleteOutline';\r\nimport Edit from '@material-ui/icons/Edit';\r\nimport FilterList from '@material-ui/icons/FilterList';\r\nimport FirstPage from '@material-ui/icons/FirstPage';\r\nimport LastPage from '@material-ui/icons/LastPage';\r\nimport Remove from '@material-ui/icons/Remove';\r\nimport SaveAlt from '@material-ui/icons/SaveAlt';\r\nimport Search from '@material-ui/icons/Search';\r\nimport ViewColumn from '@material-ui/icons/ViewColumn';\r\nimport DialogBox from '../../Dashboard/Component/DialogBox';\r\nimport { UserAutocompleteSelector } from '../../components/UserAutocompleteSelector';\r\nimport { useStyles } from '../../lookupConfiguration/common/tabsStyle';\r\n\r\ninterface TemporaryDataFormat {\r\n // tslint:disable-next-line: no-any\r\n user: IAutoCompleteItem | any;\r\n guidId: string;\r\n}\r\n\r\ninterface LookupUserAssistantMemberMaintenanceProps extends RouterProps {}\r\n\r\ninterface TableData extends TemporaryDataFormat {\r\n tableData: { \r\n checked: boolean;\r\n id: number;\r\n };\r\n}\r\n\r\ninterface LookupUserAssistantMemberMaintenanceState {\r\n // tslint:disable-next-line: no-any\r\n data: TemporaryDataFormat[];\r\n isLoading: boolean;\r\n onDeleteItems: TableData[];\r\n}\r\n\r\nexport default function LookupUserAssistantMemberMaintenance(props: LookupUserAssistantMemberMaintenanceProps) {\r\n\r\n const classes = useStyles();\r\n\r\n const [state, setState] = useState({\r\n isLoading: false,\r\n data: [],\r\n onDeleteItems: [],\r\n });\r\n\r\n const [showDeleteConfirm, setShowDeleteConfirm] = useState(false);\r\n\r\n useEffect(() => {\r\n \r\n // groupId\r\n const { command } = props.match.params;\r\n\r\n const guID = command.split(';key=', 2)[1];\r\n\r\n if (command) {\r\n fetchData(guID);\r\n }\r\n\r\n const subscribeFirmObj = subscribeFirm();\r\n\r\n return () => {\r\n subscribeFirmObj.unsubscribe();\r\n };\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const tableIcons: Icons = {\r\n Add: forwardRef((iconProps, ref) => ),\r\n Check: forwardRef((iconProps, ref) => ),\r\n Clear: forwardRef((iconProps, ref) => ),\r\n Delete: forwardRef((iconProps, ref) => ),\r\n DetailPanel: forwardRef((iconProps, ref) => ),\r\n Edit: forwardRef((iconProps, ref) => ),\r\n Export: forwardRef((iconProps, ref) => ),\r\n Filter: forwardRef((iconProps, ref) => ),\r\n FirstPage: forwardRef((iconProps, ref) => ),\r\n LastPage: forwardRef((iconProps, ref) => ),\r\n NextPage: forwardRef((iconProps, ref) => ),\r\n PreviousPage: forwardRef((iconProps, ref) => ),\r\n ResetSearch: forwardRef((iconProps, ref) => ),\r\n Search: forwardRef((iconProps, ref) => ),\r\n SortArrow: forwardRef((iconProps, ref) => ),\r\n ThirdStateCheck: forwardRef((iconProps, ref) => ),\r\n ViewColumn: forwardRef((iconProps, ref) => )\r\n };\r\n\r\n const subscribeFirm = () => {\r\n return (\r\n // let subscription =\r\n client\r\n .subscribe({\r\n fetchPolicy: 'no-cache',\r\n query: userAssistantSubscription,\r\n variables: {},\r\n })\r\n .subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n if (results.data.userAssistantNotification.status) {\r\n\r\n const { userAssistantNotification } = results.data;\r\n\r\n showNotification('Success', userAssistantNotification.message, 'info');\r\n\r\n if (userAssistantNotification.message.includes('UserAssistant updated successfully')) {\r\n setState((prevState) => {\r\n\r\n const tdata = [...prevState.data];\r\n\r\n const temp = tdata[tdata.length - 1];\r\n\r\n tdata[tdata.length - 1] = {\r\n ...temp,\r\n guidId: userAssistantNotification.guid\r\n };\r\n\r\n return {\r\n ...prevState,\r\n data: tdata\r\n };\r\n });\r\n }\r\n\r\n } else {\r\n showNotification('Failed', results.data.userAssistantNotification.message, 'error');\r\n }\r\n },\r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n },\r\n })\r\n );\r\n };\r\n\r\n const fetchData = (userGuid: string) => {\r\n\r\n setState({\r\n ...state,\r\n isLoading: true,\r\n });\r\n\r\n const userAssistantsQueryParams: UserAssistantsQueryParams = {\r\n userGuid: userGuid\r\n };\r\n\r\n retrieveUserAssistantsData(\r\n userAssistantsQueryParams,\r\n true, // refresh\r\n (data) => onRetrieveData(data),\r\n // tslint:disable-next-line:no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n };\r\n\r\n const onRetrieveData = (data: UserAssistantsData) => {\r\n\r\n const userAssistants = data.userAssistants.userAssistants;\r\n\r\n const tempData = userAssistants.map((user) => {\r\n return {\r\n user: {\r\n value: user.userGuid, \r\n label: user.friendlyName\r\n },\r\n guidId: user.guid\r\n };\r\n });\r\n\r\n setState({\r\n ...state,\r\n data: userAssistants.length > 0 ? tempData : [],\r\n isLoading: false\r\n });\r\n };\r\n\r\n const updateRowData = (newData: TemporaryDataFormat, oldData: TemporaryDataFormat) => {\r\n\r\n setState((prevState) => {\r\n\r\n const tdata = [...prevState.data];\r\n \r\n if (tdata.some((e: TemporaryDataFormat) => e.user.value.toLowerCase() === newData.user.value.toLowerCase())) {\r\n return { \r\n ...prevState, \r\n };\r\n } \r\n\r\n tdata[tdata.indexOf(oldData)] = newData;\r\n \r\n return { \r\n ...prevState, \r\n data: tdata\r\n };\r\n \r\n });\r\n };\r\n\r\n const updateData = (rowData: TemporaryDataFormat) => {\r\n const userToAssistId = props.match.params.command.split(';key=', 2)[1];\r\n\r\n if (rowData) {\r\n client\r\n .mutate({\r\n mutation: UpdateUserAssistantMutation,\r\n variables: {\r\n input: {\r\n guid: rowData.guidId,\r\n userToAssistId: userToAssistId,\r\n assistantId: rowData.user.value,\r\n }\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Update User Assistant', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Update User Assistant', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const insertRowData = (newData: TemporaryDataFormat) => {\r\n \r\n setState((prevState) => {\r\n\r\n const tdata = [...prevState.data];\r\n\r\n if (tdata.some((e: TemporaryDataFormat) => e.user && e.user.value.toLowerCase() === newData.user.value.toLowerCase())) {\r\n return { \r\n ...prevState, \r\n };\r\n } \r\n\r\n tdata.push(newData);\r\n\r\n return { \r\n ...prevState, \r\n data: tdata\r\n };\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const deleteRowData = (oldData: any) => {\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(oldData), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n \r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const createData = (newData: any) => {\r\n if (newData) {\r\n\r\n const userToAssistId = props.match.params.command.split(';key=', 2)[1];\r\n\r\n client\r\n .mutate({\r\n mutation: CreateUserAssistantMutation,\r\n variables: {\r\n input: {\r\n guid: null,\r\n userToAssistId: userToAssistId,\r\n assistantId: newData.user.value,\r\n }\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Create User Assitant', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Create User Assitant', reason, 'error');\r\n });\r\n }\r\n };\r\n\r\n const deleteData = (oldData: TemporaryDataFormat) => {\r\n client\r\n .mutate({\r\n mutation: DeleteUserAssistant,\r\n variables: {\r\n guid: oldData.guidId,\r\n },\r\n })\r\n // tslint:disable-next-line: no-any\r\n .then((results: { data: any }) => {\r\n if (results.data) {\r\n if (results.data.error !== undefined) {\r\n showNotification( 'Failed to Delete User Assitant', results.data.error, 'error');\r\n }\r\n }\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n showNotification('Failed to Delete User Assitant', reason, 'error');\r\n });\r\n };\r\n\r\n const handleBreadCrumbClick = (event: React.MouseEvent) => {\r\n event.preventDefault();\r\n props.history.goBack();\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onDeleteData = (data: any) => {\r\n\r\n setShowDeleteConfirm(true);\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onDeleteItems: data,\r\n };\r\n });\r\n // onDeleteItems = data;\r\n\r\n };\r\n\r\n const onDeleteConfirm = (agree: boolean) => {\r\n if (agree) {\r\n // tslint:disable-next-line: no-any\r\n state.onDeleteItems.forEach((selected: any) => {\r\n\r\n // delete check data\r\n deleteData(selected);\r\n\r\n setState((prevState) => {\r\n const tdata = [...prevState.data];\r\n tdata.splice(tdata.indexOf(selected), 1);\r\n return { \r\n ...prevState, \r\n data: tdata \r\n };\r\n });\r\n\r\n });\r\n\r\n setState((prevState) => {\r\n return {\r\n ...prevState,\r\n onDeleteItems: []\r\n };\r\n });\r\n\r\n }\r\n\r\n setShowDeleteConfirm(false);\r\n };\r\n\r\n const tableHeading = () => {\r\n\r\n const title = decodeURIComponent(props.match.params.command.split(';key=', 2)[0]);\r\n\r\n return (\r\n
\r\n \r\n \r\n User Assistant\r\n \r\n {title}\r\n \r\n \r\n
\r\n );\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const userSelectorComponent = (componentProps: EditComponentProps | any) => {\r\n \r\n return (\r\n {\r\n componentProps.onChange(selection);\r\n }}\r\n error={componentProps.error}\r\n disablePortal={false}\r\n className={classes.textField}\r\n helperText={componentProps.helperText}\r\n />\r\n );\r\n };\r\n \r\n // tslint:disable-next-line: no-any\r\n const userRender = (data: any) => {\r\n\r\n if (data.user) {\r\n\r\n const user = data.user;\r\n\r\n let bColor: SemanticCOLORS = Colors[(user.label === '' || user.label === null) ? \r\n Colors[Colors.length] : (hashString(user.label) % Colors.length) - 1];\r\n // tslint:disable-next-line: no-any\r\n let stringSplit = user.label\r\n .replace(/[^\\w\\s]/gi, '') // remove special character\r\n .split(' ')\r\n // tslint:disable-next-line: no-any\r\n .map((n: any) => n[0])\r\n .join('');\r\n\r\n let stringInitials = stringSplit.slice(0, 2);\r\n \r\n return (\r\n \r\n \r\n \r\n \r\n {stringInitials}\r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n return undefined;\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const customFilterAndSearch = (filter: any, rowData: TemporaryDataFormat, columnDef: Column) => {\r\n return rowData && rowData.user && rowData.user.label.toLowerCase().includes(filter.toLowerCase());\r\n };\r\n\r\n return (\r\n
\r\n \r\n rowData.hasOwnProperty('user') && rowData.user \r\n ? true \r\n : { isValid: false, helperText: 'User is required'},\r\n render: (rowData) => userRender(rowData), cellStyle: { flex: 3 }, headerStyle: { flex: 3 },\r\n editComponent: (componentData) => userSelectorComponent(componentData),\r\n customFilterAndSearch: customFilterAndSearch\r\n }\r\n ]}\r\n data={state.data} \r\n components={\r\n {\r\n // tslint:disable-next-line: max-line-length\r\n Toolbar: toolbarProps => (\r\n
\r\n \r\n
\r\n )\r\n }\r\n } \r\n options={{\r\n // search: true,\r\n addRowPosition: 'first',\r\n selection: true,\r\n paging: true,\r\n pageSize: 10,\r\n pageSizeOptions: [10, 20, 30, 40, 50],\r\n // showTitle: true,\r\n // toolbar: true,\r\n actionsColumnIndex: -1,\r\n }}\r\n editable={{\r\n onRowAdd: (newData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (newData) {\r\n createData(newData);\r\n insertRowData(newData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowUpdate: (newData, oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n updateData(newData);\r\n updateRowData(newData, oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n onRowDelete: (oldData) =>\r\n // tslint:disable-next-line: no-any\r\n new Promise((resolve: any) => {\r\n setTimeout(() => {\r\n resolve();\r\n if (oldData) {\r\n deleteData(oldData);\r\n deleteRowData(oldData);\r\n }\r\n // tslint:disable-next-line: align\r\n }, 600);\r\n }),\r\n }}\r\n actions={[\r\n {\r\n tooltip: 'Remove All Selected Users',\r\n icon: DeleteOutline,\r\n // tslint:disable-next-line: no-any\r\n onClick: (evt: any, data: any) => onDeleteData(data)\r\n }\r\n ]}\r\n />\r\n
\r\n );\r\n}\r\n\r\nexport interface UserAssistantsData {\r\n loading?: boolean;\r\n networkStatus?: number;\r\n userAssistants: UserAssistants;\r\n}\r\n\r\nexport interface UserAssistants {\r\n userAssistants: UserAssistant[];\r\n}\r\n\r\nexport interface UserAssistant {\r\n userGuid: string;\r\n email: string;\r\n friendlyName: string;\r\n guid: string;\r\n}\r\nexport interface UserAssistantsQueryParams {\r\n userGuid: string | null;\r\n}\r\n\r\nexport function retrieveUserAssistantsData(\r\n query: UserAssistantsQueryParams,\r\n refreshData: boolean,\r\n onSuccess: (data: UserAssistantsData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void\r\n): void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n client\r\n .query({\r\n query: UserAssistantsQuery,\r\n variables: {\r\n userGuid: query.userGuid\r\n },\r\n fetchPolicy: fetchPolicy,\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n onError(reason);\r\n });\r\n}\r\n\r\nconst UserAssistantsQuery = gql`\r\n query UserAssistants($userGuid: String) {\r\n userAssistants(userGuid: $userGuid) {\r\n userAssistants {\r\n userGuid\r\n email\r\n friendlyName\r\n guid\r\n }\r\n }\r\n }\r\n`;\r\n\r\nconst CreateUserAssistantMutation = gql`\r\n mutation createUserAssistant(\r\n $input: CreateUserAssistantInputType, \r\n ) {\r\n createUserAssistant(\r\n input: $input, \r\n ) {\r\n status,\r\n error\r\n }\r\n }\r\n`;\r\n\r\nconst UpdateUserAssistantMutation = gql`\r\n mutation updateUserAssistant(\r\n $input: UpdateUserAssistantInputType, \r\n ) {\r\n updateUserAssistant(\r\n input: $input, \r\n ) {\r\n status,\r\n error\r\n }\r\n }\r\n`;\r\n \r\nconst DeleteUserAssistant = gql`\r\n mutation DeleteUserAssistant($guid: String) {\r\n deleteUserAssistant(guid: $guid) {\r\n error\r\n status\r\n }\r\n }\r\n`;\r\n\r\nexport const userAssistantSubscription = gql`\r\n subscription {\r\n userAssistantNotification {\r\n id\r\n status\r\n message\r\n description\r\n guid\r\n }\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useState, useEffect } from 'react';\r\nimport List from '@material-ui/core/List';\r\nimport ListItem from '@material-ui/core/ListItem';\r\nimport ListItemText from '@material-ui/core/ListItemText';\r\nimport { RouterProps, showNotification } from '../App';\r\nimport { UserFeature, UserFeatureEnum } from '../types/UserFeature';\r\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\r\nimport Avatar from '@material-ui/core/Avatar';\r\nimport { CircularProgress, makeStyles } from '@material-ui/core';\r\nimport GroupIcon from '@material-ui/icons/Group';\r\nimport BusinessIcon from '@material-ui/icons/Business';\r\nimport HomeWorkIcon from '@material-ui/icons/HomeWork';\r\nimport AccessibleOutlinedIcon from '@material-ui/icons/AccessibleOutlined';\r\nimport { FurmStructureConfigurationBanner } from './FurmStructureConfigurationBanner';\r\nimport LookupTeamsMaintenance from './tabs/LookupTeamsMaintenance';\r\nimport LookupTeamMemberMaintenance from './tabs/LookupTeamMemberMaintenance';\r\nimport LookupOfficesMaintenance from './tabs/LookupOfficesMaintenance';\r\nimport LookupOfficeMemberMaintenance from './tabs/LookupOfficeMemberMaintenance';\r\nimport LookupDepartmentMaintenance from './tabs/LookupDepartmentMaintenance';\r\nimport LookupDepartmentMemberMaintenance from './tabs/LookupDepartmentMemberMaintenance';\r\nimport LookupUserAssistantMaintenance from './tabs/LookupUserAssistantMaintenance';\r\nimport LookupUserAssistantMemberMaintenance from './tabs/LookupUserAssistantMemberMaintenance';\r\nimport { client } from '..';\r\nimport { UserData } from '../configurationDashboard/ConfigurationDashboardPage';\r\nimport { LearnMoreEnum } from '../learnMore/LearnMorePage';\r\n\r\nconst useStyles = makeStyles({\r\n root: {\r\n flex: 1,\r\n display: 'flex',\r\n flexFlow: 'column',\r\n },\r\n wrapper: {\r\n flex: 1,\r\n display: 'flex',\r\n backgroundColor: '#fff',\r\n margin: '0 -15px',\r\n padding: '15px',\r\n },\r\n sidebar: {\r\n padding: '0 15px',\r\n maxWidth: '400px',\r\n width: '100%',\r\n position: 'relative',\r\n flex: 1,\r\n display: 'flex',\r\n },\r\n sidebarInner: {\r\n position: 'relative',\r\n flex: 1,\r\n // left: 0,\r\n // right: 0,\r\n // top: 0,\r\n // bottom: 0,\r\n // overflow: 'auto',\r\n },\r\n sidebarList: {\r\n position: 'absolute',\r\n top: 0,\r\n right: 0,\r\n left: 0,\r\n bottom: 0,\r\n overflow: 'auto',\r\n paddingRight: '10px',\r\n '& .Mui-selected': {\r\n backgroundColor: 'rgba(0, 0, 0, 0.2)'\r\n },\r\n '& .Mui-selected:hover': {\r\n backgroundColor: 'rgba(0, 0, 0, 0.2)'\r\n }\r\n },\r\n content: {\r\n padding: '0 15px',\r\n flexGrow: 1,\r\n display: 'flex',\r\n flexFlow: 'column',\r\n '& > div': {\r\n flexGrow: 1,\r\n maxWidth: '800px',\r\n }\r\n }\r\n});\r\n\r\nexport enum TableList {\r\n offices = 0,\r\n department,\r\n teams,\r\n userAssistant,\r\n}\r\n\r\ninterface FirmStructureConfigurationPageState {\r\n selectedTable: TableList;\r\n}\r\n\r\ninterface FirmStructureConfigurationPageProps extends RouterProps {\r\n\r\n}\r\n\r\nexport default function FirmStructureConfigurationPage(props: FirmStructureConfigurationPageProps) {\r\n\r\n const classes = useStyles();\r\n\r\n var routeTab: TableList = TableList[props.match.params.tab];\r\n \r\n const [pageState, setPageState] = useState({\r\n selectedTable: routeTab ? routeTab : TableList.department\r\n });\r\n\r\n const [isLoading, setIsLoading] = useState(true);\r\n const [isInternalAdmin, setIsInternalAdmin] = useState(false);\r\n\r\n // tslint:disable-next-line: no-any\r\n let routeCommand = props.match.params.command;\r\n\r\n useEffect(() => {\r\n fetchAppUserData();\r\n // tslint:disable-next-line: align\r\n }, []);\r\n\r\n const fetchAppUserData = () => {\r\n client.query({\r\n query: UserData,\r\n fetchPolicy: 'network-only'\r\n // tslint:disable-next-line:no-any\r\n }).then((results: {\r\n // tslint:disable-next-line:no-any\r\n data: any;\r\n }) => {\r\n if (results.data.appUser) {\r\n setIsInternalAdmin(results.data.appUser.isInternalAdmin);\r\n }\r\n setIsLoading(false);\r\n // tslint:disable-next-line: no-any\r\n }).catch((reason: any) => {\r\n showNotification(null, reason, 'error');\r\n });\r\n };\r\n\r\n const onClickBack = () => {\r\n props.history.push('/configurationDashboard');\r\n };\r\n\r\n const onClickTab = (value: TableList) => () => {\r\n setPageState({\r\n ...pageState,\r\n selectedTable: value\r\n });\r\n\r\n props.history.push(`/firmStructureConfiguration/${TableList[value]}`);\r\n };\r\n\r\n const onLearnMore = () => {\r\n props.history.push({\r\n pathname: `/learnMore/${LearnMoreEnum[LearnMoreEnum.FIRM_STRUCTURE]}`, \r\n });\r\n };\r\n \r\n return (\r\n \r\n {isLoading \r\n ? (\r\n
\r\n \r\n
\r\n )\r\n : (\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n {(UserFeature.HasAccess(UserFeatureEnum.hasFirmDepartmentLookupMaintenance) || isInternalAdmin ) && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {(UserFeature.HasAccess(UserFeatureEnum.hasFirmOfficeLookupMaintenance) || isInternalAdmin ) && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {(UserFeature.HasAccess(UserFeatureEnum.hasFirmTeamLookupMaintenance) || isInternalAdmin ) && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n {(UserFeature.HasAccess(UserFeatureEnum.hasUserAssistantLookupMaintenance) || isInternalAdmin ) && (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n
\r\n
\r\n {(pageState.selectedTable === TableList.teams && routeCommand === undefined) && ()}\r\n {/* tslint:disable-next-line: max-line-length */}\r\n {(pageState.selectedTable === TableList.teams && routeCommand !== undefined) && ()}\r\n {/* tslint:disable-next-line: max-line-length */}\r\n {(pageState.selectedTable === TableList.offices && routeCommand === undefined) && ()}\r\n {/* tslint:disable-next-line: max-line-length */}\r\n {(pageState.selectedTable === TableList.offices && routeCommand !== undefined) && ()}\r\n {/* tslint:disable-next-line: max-line-length */}\r\n {(pageState.selectedTable === TableList.department && routeCommand === undefined) && ()}\r\n {(pageState.selectedTable === TableList.department \r\n && routeCommand !== undefined) && ()}\r\n {/* tslint:disable-next-line: max-line-length */}\r\n {(pageState.selectedTable === TableList.userAssistant && routeCommand === undefined) && ()}\r\n {(pageState.selectedTable === TableList.userAssistant \r\n && routeCommand !== undefined) && ()}\r\n
\r\n
\r\n
\r\n )\r\n }\r\n
\r\n );\r\n}","import gql from 'graphql-tag';\r\nimport { client } from '..';\r\nimport { FetchPolicy } from 'apollo-client';\r\nimport { UserFeature, UserFeatureEnum } from '../types/UserFeature';\r\n\r\n// New Matter Summary Query params\r\nexport interface FeatureLayoutConfigurationQueryParams {\r\n layoutId: number;\r\n includeHidden: boolean;\r\n isInternalRole: boolean | null;\r\n isAdministrator: boolean | null;\r\n roleId?: string | null;\r\n userEmail?: string | null;\r\n isPersonal?: boolean | null;\r\n dashboardPanelId?: string | null;\r\n}\r\n\r\nexport interface FeatureLayoutConfigurationListData {\r\n loading?: boolean;\r\n networkStatus?: number;\r\n featureLayoutConfigurationList: FeatureLayoutConfigurationList;\r\n}\r\n\r\nexport interface FeatureLayoutConfigurationList {\r\n recordCount: number;\r\n featureLayoutConfiguration: FeatureLayoutConfiguration[];\r\n}\r\n\r\nexport interface FeatureLayoutConfiguration {\r\n id: number;\r\n feature: string;\r\n featureGuid: string;\r\n description: string;\r\n title: string;\r\n isHidden: boolean;\r\n sequence: number;\r\n infoUrl: string;\r\n}\r\n\r\nexport interface FeatureSearchChanges {\r\n feature: string;\r\n featureGuid: string;\r\n isHidden: boolean;\r\n sequence: number;\r\n}\r\n\r\nexport interface RoleListData {\r\n loading?: boolean;\r\n networkStatus?: number;\r\n roleList: RoleList;\r\n}\r\n\r\nexport interface RoleList {\r\n role: Role[];\r\n}\r\n\r\nexport interface Role {\r\n roleIdString: string;\r\n rolename: string;\r\n isExternal: boolean;\r\n}\r\n\r\nexport enum RoleCategoryType {\r\n External = 0,\r\n Internal = 1,\r\n Administrator = 2,\r\n}\r\n\r\nexport interface DropDownData {\r\n value: string;\r\n text: string;\r\n isInternal?: boolean;\r\n}\r\n\r\nexport interface DropDownRoleCategoryData {\r\n value: RoleCategoryType;\r\n text: string;\r\n}\r\n\r\nexport interface DropDownSearchData {\r\n title: string;\r\n description: string;\r\n}\r\n\r\nexport function fetchScopeFeatureData(value?: string, isPersonalise?: boolean): DropDownData[] {\r\n var scope = [];\r\n\r\n // This is selected through features. Which are passed on through the accessToken while logging in.\r\n if (UserFeature.HasAccess(UserFeatureEnum.hasDashboardSecurityScope)) {\r\n scope.push({ value: 'DashboardSecurityScope', text: 'Firm' });\r\n }\r\n if (UserFeature.HasAccess(UserFeatureEnum.hasDashboardSecurityRoleCategory)) {\r\n scope.push({ value: 'DashboardSecurityRoleCategory', text: 'Role Category' });\r\n }\r\n if (UserFeature.HasAccess(UserFeatureEnum.hasDashboardSecurityRole)) {\r\n scope.push({ value: 'DashboardSecurityRole', text: 'Role' });\r\n }\r\n if (UserFeature.HasAccess(UserFeatureEnum.hasDashboardSecurityUser)) {\r\n scope.push({ value: 'DashboardSecurityUser', text: 'User' });\r\n }\r\n if (UserFeature.HasAccess(UserFeatureEnum.hasDashboardSecurityPersonal) || isPersonalise === true) {\r\n scope.push({ value: 'DashboardSecurityPersonal', text: 'Personal' });\r\n }\r\n\r\n if (value) {\r\n scope = scope.filter((x) => x.value === value);\r\n }\r\n\r\n if (scope && scope.length === 0 && (value === 'DashboardSecurityPersonal' || isPersonalise === true)) {\r\n // For Personalise\r\n scope.push({ value: 'DashboardSecurityPersonal', text: 'Personal' });\r\n }\r\n\r\n return scope;\r\n}\r\n\r\nexport function fetchRoleCategoryData(isIncludeAdmin?: boolean): DropDownRoleCategoryData[] {\r\n var roleCategoryData = [];\r\n\r\n roleCategoryData.push({ value: RoleCategoryType.Internal, text: 'Internal' });\r\n roleCategoryData.push({ value: RoleCategoryType.External, text: 'External' });\r\n\r\n if (isIncludeAdmin) {\r\n roleCategoryData.push({ value: RoleCategoryType.Administrator, text: 'Administrator' });\r\n }\r\n\r\n return roleCategoryData;\r\n}\r\n\r\nexport function fetchFeatureLayoutConfigurationData(\r\n query: FeatureLayoutConfigurationQueryParams,\r\n refreshData: boolean,\r\n onSuccess: (data: FeatureLayoutConfigurationListData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void,\r\n): void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n client\r\n .query({\r\n query: FeatureLayoutConfigurationData,\r\n variables: {\r\n layoutId: query.layoutId,\r\n includeHidden: query.includeHidden,\r\n isInternalRole: query.isInternalRole,\r\n isAdministrator: query.isAdministrator,\r\n roleId: query.roleId,\r\n userEmail: query.userEmail,\r\n isPersonal: query.isPersonal,\r\n dashboardPanelId: query.dashboardPanelId,\r\n },\r\n fetchPolicy: fetchPolicy,\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n onError(reason);\r\n });\r\n}\r\n\r\nexport function fetchRoleData(\r\n refreshData: boolean,\r\n onSuccess: (data: RoleListData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void,\r\n): void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n client\r\n .query({\r\n query: RoleSelectorData,\r\n variables: {},\r\n fetchPolicy: fetchPolicy,\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n onError(reason);\r\n });\r\n}\r\n\r\nconst FeatureLayoutConfigurationData = gql`\r\n query featureLayoutConfiguration(\r\n $layoutId: Int\r\n $includeHidden: Boolean\r\n $isInternalRole: Boolean\r\n $isAdministrator: Boolean\r\n $roleId: String\r\n $userEmail: String\r\n $isPersonal: Boolean\r\n $dashboardPanelId: String\r\n ) {\r\n featureLayoutConfigurationList(\r\n layoutId: $layoutId\r\n includeHidden: $includeHidden\r\n isInternalRole: $isInternalRole\r\n isAdministrator: $isAdministrator\r\n roleId: $roleId\r\n userEmail: $userEmail\r\n isPersonal: $isPersonal\r\n dashboardPanelId: $dashboardPanelId\r\n ) {\r\n recordCount\r\n featureLayoutConfiguration {\r\n id\r\n feature\r\n featureGuid\r\n description\r\n title\r\n isHidden\r\n sequence\r\n infoUrl\r\n }\r\n }\r\n }\r\n`;\r\n\r\nconst RoleSelectorData = gql`\r\n query roleSelectorQuery {\r\n roleList {\r\n role {\r\n roleIdString\r\n rolename\r\n isExternal\r\n }\r\n }\r\n }\r\n`;\r\n\r\nexport const UpdateFeatureLayoutConfigData = gql`\r\n mutation UpdateFeatureLayoutConfiguration(\r\n $featureLayoutConfigurationList: [FeatureLayoutConfigurationInput]!\r\n $layoutId: Int!\r\n $isInternalRole: Boolean\r\n $isAdministrator: Boolean\r\n $roleId: String\r\n $userEmail: String\r\n $isPersonal: Boolean\r\n $dashboardPanelId: String\r\n ) {\r\n updateFeatureLayoutConfiguration(\r\n featureLayoutConfigurationList: $featureLayoutConfigurationList\r\n layoutId: $layoutId\r\n isInternalRole: $isInternalRole\r\n isAdministrator: $isAdministrator\r\n roleId: $roleId\r\n userEmail: $userEmail\r\n isPersonal: $isPersonal\r\n dashboardPanelId: $dashboardPanelId\r\n )\r\n }\r\n`;\r\n\r\nexport const DeleteFeatureLayoutConfigData = gql`\r\n mutation deleteFeatureLayoutConfiguration(\r\n $layoutId: Int!\r\n $isInternalRole: Boolean\r\n $isAdministrator: Boolean\r\n $roleId: String\r\n $userEmail: String\r\n $isPersonal: Boolean\r\n $dashboardPanelId: String\r\n ) {\r\n deleteFeatureLayoutConfiguration(\r\n layoutId: $layoutId\r\n isInternalRole: $isInternalRole\r\n isAdministrator: $isAdministrator\r\n roleId: $roleId\r\n userEmail: $userEmail\r\n isPersonal: $isPersonal\r\n dashboardPanelId: $dashboardPanelId\r\n )\r\n }\r\n`;\r\n\r\nexport const featureLayoutConfigSubscription = gql`\r\n subscription featureLayoutConfigurationSubscription {\r\n featureLayoutConfigurationNotification {\r\n id\r\n status\r\n message\r\n description\r\n }\r\n }\r\n`;\r\n\r\nexport interface CurrentUserData {\r\n appUser: AppUser;\r\n}\r\n\r\nexport interface AppUser {\r\n userId: string;\r\n staffGuid: string;\r\n name: string;\r\n userName: string;\r\n isAdministrator: boolean;\r\n role: string;\r\n isInternal: boolean;\r\n isInternalAdmin: boolean;\r\n}\r\n\r\nexport function fetchCurrentUserData(\r\n refreshData: boolean,\r\n onSuccess: (data: CurrentUserData) => void,\r\n // tslint:disable-next-line:no-any\r\n onError: (reason: any) => void,\r\n): void {\r\n var fetchPolicy: FetchPolicy = refreshData === true ? 'network-only' : 'cache-first';\r\n client\r\n .query({\r\n query: CURRENT_USER_QUERY,\r\n variables: {},\r\n fetchPolicy: fetchPolicy,\r\n })\r\n // tslint:disable-next-line:no-any\r\n .then((results: { data: any }) => {\r\n onSuccess(results.data);\r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => {\r\n onError(reason);\r\n });\r\n}\r\n\r\nexport const CURRENT_USER_QUERY = gql`\r\n query CurrentUser {\r\n appUser {\r\n userId\r\n staffGuid\r\n name\r\n userName\r\n isAdministrator\r\n role\r\n isInternal\r\n isInternalAdmin\r\n }\r\n }\r\n`;\r\n\r\nexport const UpdateFeatureSubscription = gql`\r\n subscription updateFeatureNotification {\r\n featureUpdateNotification{\r\n id,\r\n description,\r\n message,\r\n status\r\n }\r\n }\r\n`;","export const globalVariableDefaults = {\r\n isAdministrator: false,\r\n canViewDashboard: true\r\n };","import React from 'react';\r\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { RvButtonFabric, RvButtonType } from '../components/Button';\r\nimport { RvLabel, LabelStyle } from '../components/Label/Label';\r\nimport { mainTheme } from '../Theme';\r\nimport { Button } from '@material-ui/core';\r\nimport ErrorOutlineIcon from '@material-ui/icons/ErrorOutline';\r\nimport { LearnMoreEnum } from '../learnMore/LearnMorePage';\r\nimport { useHistory } from 'react-router-dom';\r\n// import SystemUpdateAltOutlinedIcon from '@material-ui/icons/SystemUpdateAltOutlined';\r\nimport VideoLibraryOutlinedIcon from '@material-ui/icons/VideoLibraryOutlined';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n root: {\r\n width: '100%',\r\n padding: '0 15px',\r\n },\r\n container: {},\r\n buttonContainer: {\r\n position: 'relative',\r\n padding: '15px 34px',\r\n color: mainTheme.BrandColors.TextPrimary,\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n '@media (max-width: 1024px)': {\r\n padding: '15px 30px',\r\n },\r\n '& .rvlabel': {\r\n paddingLeft: '82px',\r\n fontFamily: mainTheme.Font.Main,\r\n fontSize: mainTheme.FontSize.PX.size8,\r\n letterSpacing: '0.86px',\r\n lineHeight: mainTheme.LineHeight.ExtraLarge,\r\n },\r\n '& .back-button': {\r\n paddingRight: '32px',\r\n position: 'absolute',\r\n top: '50%',\r\n transform: 'translateY(-50%)',\r\n '& .ms-Button': {\r\n width: '50px',\r\n height: '50px',\r\n },\r\n '& .ms-Button-icon': {\r\n fontSize: mainTheme.FontSize.PX.size10,\r\n color: mainTheme.BrandColors.TemplatePrimary,\r\n },\r\n },\r\n },\r\n button: {\r\n margin: '0 10px',\r\n textTransform: 'none',\r\n fontSize: '14px',\r\n },\r\n }),\r\n);\r\n\r\ninterface HeaderProps {\r\n onClickBack?: () => void;\r\n key: string;\r\n title: string;\r\n hasBack: boolean;\r\n}\r\n\r\nexport const FeatureLayoutConfigurationHeader: React.FC = (props) => {\r\n const classes = useStyles();\r\n\r\n const history = useHistory();\r\n\r\n const onLearnMore = () => {\r\n history.push({\r\n pathname: `learnMore/${LearnMoreEnum[LearnMoreEnum.Configuring_Dashboards]}`,\r\n });\r\n };\r\n\r\n const onResources = () => {\r\n history.push({\r\n pathname: `/acuityResourceCenter`,\r\n });\r\n };\r\n\r\n return (\r\n
\r\n
\r\n
\r\n
\r\n {!!props.hasBack && (\r\n \r\n )}\r\n \r\n
\r\n
\r\n \r\n \r\n {/* }\r\n download={true}\r\n target=\"_blank\"\r\n >\r\n Further Information\r\n */}\r\n
\r\n
\r\n
\r\n
\r\n );\r\n};\r\n","import * as React from 'react';\r\nimport glamorous from 'glamorous';\r\nimport { MatterTerminology } from '../MatterTerminology';\r\nimport { debounce } from 'lodash';\r\nimport { fetchScopeFeatureData, DropDownData, \r\n DropDownSearchData, \r\n fetchFeatureLayoutConfigurationData, FeatureLayoutConfigurationQueryParams, \r\n FeatureLayoutConfigurationListData, \r\n FeatureLayoutConfiguration, \r\n RoleCategoryType,\r\n UpdateFeatureSubscription\r\n} from './FeatureLayoutConfigurationRepository';\r\nimport { showNotification } from '../App';\r\nimport { RvLoader } from '../components/Loader';\r\nimport { DashboardLayoutScopeSelector } from '../components/DashboardLayoutScopeSelector';\r\nimport { IAutoCompleteItem } from '../typings/autoComplete';\r\nimport { WithStyles, withStyles, Theme, createStyles, Grid, Button, TextField, IconButton } from '@material-ui/core';\r\nimport { RoleSelector } from '../components/RoleSelector';\r\nimport { IDownShiftItem } from 'mui-downshift';\r\nimport { RoleCategorySelector } from '../components/RoleCategorySelector';\r\nimport UserSelector from '../components/UserSelector';\r\nimport DialogBox from '../Dashboard/Component/DialogBox';\r\nimport { PanelSelector } from '../lookupConfiguration/selectors/PanelSelector';\r\nimport CloseOutlinedIcon from '@material-ui/icons/CloseOutlined';\r\nimport SearchOutlinedIcon from '@material-ui/icons/SearchOutlined';\r\nimport { TypeOfDashboard } from './FeatureLayoutConfigurationPage';\r\nimport { UserAutocompleteSelector } from '../components/UserAutocompleteSelector';\r\nimport { client } from '..';\r\nimport { Subscription } from 'apollo-client/util/Observable';\r\n\r\nconst StyledContainer = glamorous.div<{ theme?: object }>((props) => ({\r\n padding: '30px',\r\n position: 'relative',\r\n [`& .${`rvloader-col`}`]: {\r\n position: 'absolute',\r\n left: '50%',\r\n top: '50%',\r\n transform: 'translate(-50%, -50%)',\r\n } \r\n}));\r\n\r\nconst ControlWrapper = glamorous(Grid)<{ theme?: object }>((props) => ({\r\n '& .downshift-wrapper': {\r\n maxWidth: '350px',\r\n },\r\n '& .scope-selector': {\r\n '& .MuiInputBase-formControl::before, .MuiInputBase-formControl::after, .MuiInputBase-formControl:after': {\r\n borderBottom: '1px solid #5173FF !important',\r\n }\r\n },\r\n '& .MuiAutocomplete-popupIndicator': {\r\n color: '#5173FF',\r\n }\r\n}));\r\n\r\n// tslint:disable-next-line:no-any\r\nconst SearchWrapper = glamorous.div<{ theme?: any }>((props) => ({\r\n alignItems: 'center',\r\n display: 'flex',\r\n justifyContent: 'flex-start',\r\n flexFlow: 'row wrap',\r\n width: '100%',\r\n [`& .${`checkbox`}`]: {\r\n color: props.theme.BrandColors.TemplatePrimary,\r\n padding: '0 16px'\r\n },\r\n [`& .${`input`}`]: {\r\n height: '48px',\r\n width: '100%', // '336px',\r\n border: '1px solid ' + props.theme.NeutralColors.BackgroundGrey1,\r\n borderRadius: '4px',\r\n boxShadow: '0 0 4px 0 ' + props.theme.NeutralColors.BackgroundGrey2,\r\n margin: 0\r\n },\r\n '& .downshift-wrapper': {\r\n width: '100%'\r\n } \r\n}));\r\n\r\nconst styles = (theme: Theme) => createStyles({\r\n backgroundColor: {\r\n // backgroundColor: fade(theme.palette.primary.main, 0.03),\r\n paddingTop: '15px',\r\n position: 'relative',\r\n },\r\n button: {\r\n margin: theme.spacing(),\r\n },\r\n buttonContainer: {\r\n margin: '0 -10px 0 5px',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n alignItems: 'center',\r\n '& .button-primary': {\r\n // backgroundColor: '#5173FF',\r\n color: '#5173FF',\r\n border: '1px solid rgba(81,115,255, 0.5)'\r\n },\r\n '& .button': {\r\n margin: '0 5px',\r\n }\r\n },\r\n buttonWrapper: {\r\n alignItems: 'center',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n padding: '15px',\r\n },\r\n card: {\r\n marginBottom: '15px',\r\n padding: '0 15px',\r\n },\r\n container: {\r\n bottom: 0,\r\n left: 0,\r\n overflowY: 'auto',\r\n // padding: '12px', // Commented to keep it consistant with RecordView\r\n position: 'absolute',\r\n right: 0,\r\n top: 0,\r\n },\r\n devider: {\r\n borderLeft: '1px solid' + theme.palette.grey[400],\r\n height: '100%',\r\n margin: '0 auto',\r\n width: '1px',\r\n },\r\n extendedIcon: {\r\n marginRight: theme.spacing(),\r\n },\r\n formContainer: {\r\n flex: 1,\r\n padding: '12px',\r\n },\r\n formControl: {\r\n margin: '0 10px',\r\n minWidth: '250px',\r\n },\r\n generateWrapper: {\r\n alignItems: 'center',\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n textAlign: 'center',\r\n },\r\n mainContainer: {\r\n marginBottom: '10px',\r\n marginTop: '10px',\r\n },\r\n subContainer: {\r\n borderTop: '1px solid' + theme.palette.grey[400],\r\n marginTop: '25px',\r\n paddingTop: '10px',\r\n },\r\n table: {\r\n \r\n },\r\n tableWrapper: {\r\n '& .ag-header': {\r\n color: theme.palette.secondary.main,\r\n fontSize: '14px'\r\n },\r\n display: 'inline-block',\r\n height: '100%',\r\n maxHeight: '200px',\r\n minHeight: '200px',\r\n width: '100%',\r\n },\r\n tableWrapperDetails: {\r\n '& .ag-header': {\r\n color: theme.palette.secondary.main,\r\n fontSize: '14px'\r\n },\r\n display: 'inline-block',\r\n height: '100%',\r\n maxHeight: '400px',\r\n minHeight: '400px',\r\n width: '100%',\r\n },\r\n textField: {\r\n\r\n },\r\n upperButton: {\r\n position: 'fixed',\r\n right: 0,\r\n top: '180px',\r\n },\r\n panelSelector: {\r\n width: '100%'\r\n },\r\n rightContainer: {\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n alignItems: 'center',\r\n },\r\n searchField: {\r\n '& .MuiInputBase-input': {\r\n paddingTop: '8px',\r\n paddingBottom: '8px',\r\n }\r\n }\r\n});\r\n\r\n// tslint:disable-next-line: no-any\r\n// const FieldContainer = glamorous.div<{theme?: any}> ((props) => ({\r\n// width: '250px',\r\n// marginRight: '10px' \r\n// }));\r\n\r\ninterface FeatureLayoutConfigurationControlPanelProps extends WithStyles {\r\n layoutId: number;\r\n isSearchAgain: boolean;\r\n isShowFilterControls?: boolean;\r\n\r\n onFeatureLayoutConfigurationFetch?: (\r\n featureLayoutConfigurationList: FeatureLayoutConfiguration[],\r\n filteredFeatureLayoutConfigurationList: FeatureLayoutConfiguration[],\r\n isHideAllOperation: boolean\r\n ) => void;\r\n onSearchCriteriaChanged?: (\r\n layoutId: number, \r\n isInternalRole: boolean | null, \r\n isAdministrator: boolean | null,\r\n userEmail: string | null, \r\n roleId: string | null, \r\n isPersonal: boolean | null,\r\n dashboardPanel: IAutoCompleteItem | null,\r\n ) => void;\r\n handleSave?: () => void;\r\n handleReset?: () => void; \r\n dashboardPanel: IAutoCompleteItem | null;\r\n dashboardScope: string | null;\r\n personalise: boolean;\r\n isInternalUser: boolean;\r\n}\r\n\r\nexport interface FeatureLayoutConfigurationControlPanelState {\r\n featureLayoutConfigurationList: FeatureLayoutConfiguration[];\r\n roleCategoryList: DropDownData[];\r\n userList: DropDownSearchData[];\r\n\r\n isLoading: boolean;\r\n isUserLoading: boolean;\r\n isSearchAgain: boolean;\r\n isDisableReset: boolean;\r\n layoutId: number;\r\n scope: string;\r\n\r\n isInternalRole: string; // RoleCategory\r\n roleId: string;\r\n user: string;\r\n userLabel: string;\r\n userEmail: string;\r\n\r\n isHideAll: boolean;\r\n showConfirm: boolean;\r\n dashboardPanel: IAutoCompleteItem | null;\r\n search: string;\r\n personalise: boolean;\r\n externalUser?: IAutoCompleteItem;\r\n}\r\n\r\nclass FeatureLayoutConfigurationControlPanel \r\n extends React.Component {\r\n \r\n private featureSubscription: Subscription;\r\n\r\n constructor(props: FeatureLayoutConfigurationControlPanelProps, state: FeatureLayoutConfigurationControlPanelState) {\r\n super(props, state);\r\n\r\n this.handleChangeFilters = this.handleChangeFilters.bind(this);\r\n this.onDownShiftSelect = this.onDownShiftSelect.bind(this);\r\n this.constructSecondDropDown = this.constructSecondDropDown.bind(this);\r\n // this.handleUserResultSelect = this.handleUserResultSelect.bind(this);\r\n this.handleSave = this.handleSave.bind(this);\r\n this.handleReset = this.handleReset.bind(this);\r\n this.onSelection = this.onSelection.bind(this);\r\n this.onHideAllChange = this.onHideAllChange.bind(this);\r\n this.handleDeleteConfirm = this.handleDeleteConfirm.bind(this);\r\n this.onPanelSelection = this.onPanelSelection.bind(this);\r\n\r\n this.onSearchChange = this.onSearchChange.bind(this);\r\n\r\n this.handleFeatureLayoutConfigurationSearch = debounce(this.handleFeatureLayoutConfigurationSearch.bind(this), 500);\r\n this.onClearSearch = this.onClearSearch.bind(this);\r\n this.onUserSelection = this.onUserSelection.bind(this);\r\n this.subscribeToUpdateFeature = this.subscribeToUpdateFeature.bind(this);\r\n\r\n let scope = this.props.dashboardScope ? this.props.dashboardScope : '';\r\n\r\n this.state = {\r\n featureLayoutConfigurationList: [],\r\n roleCategoryList: [],\r\n userList: [],\r\n\r\n isLoading: false,\r\n isUserLoading: false,\r\n isSearchAgain: false,\r\n isDisableReset: scope === 'DashboardSecurityScope' ? true : false,\r\n layoutId: this.props.layoutId,\r\n scope: scope,\r\n isInternalRole: '',\r\n roleId: '',\r\n user: '',\r\n userLabel: '',\r\n userEmail: '',\r\n isHideAll: false,\r\n showConfirm: false,\r\n dashboardPanel: this.props.dashboardPanel,\r\n search: '',\r\n personalise: this.props.personalise,\r\n };\r\n }\r\n\r\n componentDidMount() {\r\n this.fetchScopeData();\r\n\r\n this.subscribeToUpdateFeature();\r\n \r\n }\r\n\r\n public componentWillUnmount() {\r\n if (this.featureSubscription) {\r\n this.featureSubscription.unsubscribe();\r\n }\r\n }\r\n\r\n public UNSAFE_componentWillReceiveProps(nextProps: FeatureLayoutConfigurationControlPanelProps) {\r\n\r\n if (this.props.layoutId !== nextProps.layoutId ||\r\n this.state.isSearchAgain !== nextProps.isSearchAgain ||\r\n this.props.dashboardScope !== nextProps.dashboardScope) {\r\n // let scope = this.props.dashboardScope ? this.props.dashboardScope : this.state.scope;\r\n\r\n this.setState({\r\n layoutId: nextProps.layoutId,\r\n isSearchAgain : nextProps.isSearchAgain,\r\n dashboardPanel: nextProps.dashboardPanel\r\n // scope: this.props.dashboardScope ? this.props.dashboardScope : this.state.scope,\r\n // isDisableReset: scope === 'DashboardSecurityScope' ? true : false\r\n });\r\n\r\n if (this.state.isSearchAgain !== nextProps.isSearchAgain) {\r\n this.handleFeatureLayoutConfigurationSearch(this.state.scope);\r\n }\r\n }\r\n if (this.props.dashboardPanel && nextProps.dashboardPanel && this.props.dashboardPanel.value !== nextProps.dashboardPanel.value) {\r\n // let scope = this.props.dashboardScope ? this.props.dashboardScope : this.state.scope;\r\n\r\n this.setState({\r\n layoutId: nextProps.layoutId,\r\n isSearchAgain : nextProps.isSearchAgain,\r\n dashboardPanel: nextProps.dashboardPanel,\r\n // scope: this.props.dashboardScope ? this.props.dashboardScope : this.state.scope,\r\n // isDisableReset: scope === 'DashboardSecurityScope' ? true : false\r\n });\r\n\r\n this.onPanelSelection(nextProps.dashboardPanel, '');\r\n }\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n const terminology = { ...MatterTerminology };\r\n\r\n var loader = this.state.isLoading ? : undefined;\r\n var secondDropDown = this.constructSecondDropDown(terminology);\r\n\r\n let isHideAll = !(this.state.featureLayoutConfigurationList.filter( x => x.isHidden === false).length > 0);\r\n\r\n let isShowFilterControls = this.props.isShowFilterControls === undefined ? true : this.props.isShowFilterControls;\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n { isShowFilterControls === true && this.props.layoutId !== TypeOfDashboard.lead && this.props.layoutId !== TypeOfDashboard.client\r\n ? ( \r\n \r\n \r\n \r\n \r\n {secondDropDown}\r\n \r\n ) \r\n : null\r\n } \r\n {!!(isShowFilterControls === true && this.props.layoutId === TypeOfDashboard.client) && this.props.isInternalUser && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n {/* */}\r\n {/* */}\r\n \r\n {/* */}\r\n {/* */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {loader}\r\n \r\n\r\n \r\n \r\n \r\n
\r\n \r\n )\r\n :\r\n (\r\n \r\n \r\n \r\n )\r\n }}\r\n />\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n );\r\n }\r\n\r\n private fetchScopeData() {\r\n let scopeList = fetchScopeFeatureData(undefined, this.state.personalise);\r\n\r\n const scopeData = scopeList.map( (scope: DropDownData) => ({value: scope.value, label: scope.text }));\r\n\r\n if (scopeList != null && scopeList.length > 0) {\r\n // If there is no value is set, then set the default value to first in scopeData\r\n const defaultValue = this.state.scope !== '' \r\n ? this.state.scope \r\n : scopeData[0].value;\r\n // let isDisableReset = false;\r\n // if (defaultValue === 'DashboardSecurityScope' && this.props.layoutId !== TypeOfDashboard.client) {\r\n // isDisableReset = true;\r\n // }\r\n\r\n // this.setState({\r\n // scope: defaultValue,\r\n // isDisableReset: isDisableReset\r\n // });\r\n\r\n this.handleChangeFilters(defaultValue, '', 'scopeId');\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n private constructSecondDropDown(terminology: any): JSX.Element {\r\n if (this.state.scope === 'DashboardSecurityRoleCategory') {\r\n return (\r\n \r\n \r\n {/* */}\r\n {/* */}\r\n \r\n {/* */}\r\n {/* */}\r\n \r\n \r\n );\r\n } else if (this.state.scope === 'DashboardSecurityRole') { \r\n return (\r\n \r\n \r\n {/* */}\r\n {/* */}\r\n \r\n {/* */}\r\n {/* */}\r\n \r\n \r\n );\r\n } else if (this.state.scope === 'DashboardSecurityUser') {\r\n return (\r\n \r\n \r\n {/* */}\r\n {/* */}\r\n \r\n {/* */}\r\n {/* */}\r\n \r\n \r\n );\r\n } else {\r\n return
;\r\n }\r\n }\r\n\r\n private onHideAllChange() {\r\n const featureLayoutConfigurationList = this.state.featureLayoutConfigurationList;\r\n featureLayoutConfigurationList.forEach(featureLayoutConfig => {\r\n featureLayoutConfig.isHidden = !this.state.isHideAll;\r\n });\r\n \r\n this.setState({\r\n featureLayoutConfigurationList: featureLayoutConfigurationList,\r\n isHideAll: !this.state.isHideAll\r\n });\r\n\r\n // Pass this to the parent component.\r\n if (this.props.onFeatureLayoutConfigurationFetch) {\r\n this.props.onFeatureLayoutConfigurationFetch(featureLayoutConfigurationList, featureLayoutConfigurationList, true);\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n private onUserSelection(selection: IAutoCompleteItem | any) {\r\n if (selection) {\r\n // Pass this to the parent component.\r\n if (this.props.onFeatureLayoutConfigurationFetch) {\r\n this.props.onFeatureLayoutConfigurationFetch([], [], false);\r\n }\r\n\r\n let isInternalRoleParam = null;\r\n let isAdministratorParam = null;\r\n let userEmailParam = selection.email;\r\n let roleIdParam = null;\r\n let isPersonal = false;\r\n let dashboardPanel = { label: 'Home', value: 'all' };\r\n\r\n if (this.props.layoutId === TypeOfDashboard.client) {\r\n\r\n this.setState({\r\n isDisableReset: (userEmailParam as string).length > 0 ? false : true,\r\n userEmail: userEmailParam,\r\n dashboardPanel: dashboardPanel,\r\n });\r\n } else {\r\n this.setState({\r\n userEmail: userEmailParam,\r\n dashboardPanel: dashboardPanel,\r\n });\r\n }\r\n\r\n if (this.props.onSearchCriteriaChanged) {\r\n this.props.onSearchCriteriaChanged(\r\n this.state.layoutId, \r\n isInternalRoleParam, \r\n isAdministratorParam, \r\n userEmailParam, \r\n roleIdParam, \r\n isPersonal,\r\n dashboardPanel,\r\n );\r\n }\r\n\r\n this.handleFeatureLayoutConfigurationSearch(this.state.scope);\r\n\r\n } else {\r\n this.setState({\r\n userEmail: '',\r\n isDisableReset: true\r\n });\r\n }\r\n }\r\n\r\n private onPanelSelection(selection: IAutoCompleteItem, name: string) {\r\n \r\n if (this.props.onFeatureLayoutConfigurationFetch) {\r\n this.props.onFeatureLayoutConfigurationFetch([], [], false);\r\n }\r\n\r\n if (selection) {\r\n\r\n this.setState({\r\n dashboardPanel: selection\r\n });\r\n \r\n if (this.props.onSearchCriteriaChanged) {\r\n \r\n let isInternalRoleParam = null;\r\n let isAdministratorParam = null;\r\n if (this.state.scope === 'DashboardSecurityRoleCategory') {\r\n // tslint:disable-next-line: max-line-length\r\n isInternalRoleParam = this.state.isInternalRole !== RoleCategoryType.Administrator.toString() ? this.state.isInternalRole === '1' : null;\r\n isAdministratorParam = this.state.isInternalRole === RoleCategoryType.Administrator.toString() ? true : null;\r\n }\r\n let roleIdParam = (this.state.roleId !== undefined && this.state.roleId.length > 0) ? this.state.roleId : null;\r\n let userEmailParam = (this.state.userEmail !== undefined && this.state.userEmail.length > 0) ? this.state.userEmail : null;\r\n let isPersonal = (this.state.scope === 'DashboardSecurityPersonal') \r\n ? true \r\n : (this.state.scope === 'DashboardSecurityUser' ? false : (userEmailParam !== null ? false : null ));\r\n\r\n this.props.onSearchCriteriaChanged(\r\n this.state.layoutId, \r\n isInternalRoleParam, \r\n isAdministratorParam, \r\n userEmailParam, \r\n roleIdParam, \r\n isPersonal,\r\n selection,\r\n );\r\n }\r\n this.handleFeatureLayoutConfigurationSearch(this.state.scope);\r\n }\r\n }\r\n\r\n private onSelection(selection: IAutoCompleteItem, name: string) {\r\n this.handleChangeFilters(selection.value, '', name);\r\n }\r\n\r\n private onDownShiftSelect(selection: IDownShiftItem, name: string) {\r\n this.handleChangeFilters(selection.value === undefined ? '' : selection.value, selection.label, name);\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n private handleChangeFilters(value: any, label: string, name: string) {\r\n if (value !== undefined) {\r\n let isScopeChanged = false;\r\n let scope = '';\r\n let isInternalRole = '';\r\n let userEmail = '';\r\n let userLabel = '';\r\n let roleId = '';\r\n let isDisableReset = true;\r\n \r\n let dashboardPanel: IAutoCompleteItem | null = null;\r\n\r\n if (this.props.layoutId === TypeOfDashboard.client) {\r\n dashboardPanel = this.state.dashboardPanel;\r\n } else {\r\n dashboardPanel = this.state.dashboardPanel ? this.state.dashboardPanel : { label: 'Home', value: 'all' };\r\n }\r\n\r\n if (name === 'scopeId') {\r\n\r\n isScopeChanged = true;\r\n scope = value; \r\n \r\n if (value === 'DashboardSecurityPersonal') {\r\n isDisableReset = false;\r\n } else {\r\n isDisableReset = true;\r\n }\r\n\r\n } else if (this.state.scope === 'DashboardSecurityRoleCategory' && name === 'roleCategoryId') {\r\n \r\n isInternalRole = value; \r\n\r\n if (value.toString().length > 0) {\r\n isDisableReset = false;\r\n } \r\n \r\n } else if (this.state.scope === 'DashboardSecurityRole' && name === 'roleId') {\r\n \r\n roleId = value;\r\n\r\n if (typeof value === 'string' && value.length > 0) {\r\n isDisableReset = false;\r\n }\r\n\r\n } else if (this.state.scope === 'DashboardSecurityUser' && name === 'userId') {\r\n userEmail = value;\r\n userLabel = label;\r\n\r\n if (typeof value === 'string' && value.length > 0) {\r\n isDisableReset = false;\r\n }\r\n }\r\n \r\n // if (name === 'scopeId') {\r\n // isScopeChanged = true;\r\n // scope = value; \r\n \r\n // if (value === 'DashboardSecurityScope' || value === '') {\r\n // isDisableReset = true;\r\n // }\r\n\r\n // } else if (name === 'roleCategoryId') {\r\n // isInternalRole = value; \r\n // } else if (name === 'roleId') {\r\n // roleId = value;\r\n // } else if (name === 'userId') {\r\n // userEmail = value;\r\n // userLabel = label;\r\n // }\r\n\r\n scope = isScopeChanged ? scope : this.state.scope;\r\n \r\n this.setState({\r\n isDisableReset: isDisableReset,\r\n scope: scope,\r\n isInternalRole: isInternalRole, \r\n userEmail: userEmail,\r\n user: userEmail === '' ? '' : this.state.user,\r\n userLabel: userLabel,\r\n roleId: roleId, \r\n dashboardPanel: dashboardPanel ? dashboardPanel : this.state.dashboardPanel \r\n }); \r\n\r\n // Pass this to the parent component.\r\n if (this.props.onFeatureLayoutConfigurationFetch) {\r\n this.props.onFeatureLayoutConfigurationFetch([], [], false);\r\n }\r\n\r\n if (value === 'DashboardSecurityScope' || value === 'DashboardSecurityPersonal' ||\r\n (name === 'roleCategoryId' && value !== '') || \r\n ( name === 'roleId' && value !== '') || \r\n ( name === 'userId' && value !== '' ) ||\r\n ( name === 'dashboardPanel' && value !== '')) {\r\n this.handleFeatureLayoutConfigurationSearch(scope);\r\n }\r\n\r\n if (this.props.onSearchCriteriaChanged) { \r\n let isInternalRoleParam = null;\r\n let isAdministratorParam = null;\r\n\r\n if (name === 'roleCategoryId') {\r\n if (isInternalRole === RoleCategoryType.Administrator.toString()) {\r\n isAdministratorParam = true;\r\n } else {\r\n isInternalRoleParam = isInternalRole === '1';\r\n }\r\n }\r\n\r\n let roleIdParam = (name === 'roleId' && value !== undefined && value.length > 0) ? value : null;\r\n let userEmailParam = (name === 'userId' && value !== undefined && value.length > 0) ? value : null;\r\n let isPersonal = (value === 'DashboardSecurityPersonal') \r\n ? true \r\n : (value === 'DashboardSecurityUser' ? false : (userEmailParam !== null ? false : null ));\r\n\r\n this.props.onSearchCriteriaChanged(\r\n this.state.layoutId, \r\n isInternalRoleParam, \r\n isAdministratorParam, \r\n userEmailParam, \r\n roleIdParam, \r\n isPersonal,\r\n dashboardPanel ? dashboardPanel : this.state.dashboardPanel,\r\n );\r\n }\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n // private handleUserResultSelect(event: any, data: SearchResultData) {\r\n // if (data.result === undefined) {\r\n // return; \r\n // }\r\n \r\n // this.setState({\r\n // isUserLoading: false, \r\n // isInternalRole: '',\r\n // roleId: '',\r\n // userEmail: data.result.description.substring(0, data.result.description.indexOf('|')).trim(),\r\n // user: data.result.title,\r\n // });\r\n\r\n // this.handleFeatureLayoutConfigurationSearch();\r\n\r\n // if (this.props.onSearchCriteriaChanged) {\r\n // let userEmail = data.result.description.substring(0, data.result.description.indexOf('|')).trim(); \r\n\r\n // this.props.onSearchCriteriaChanged(this.state.layoutId, null, null, userEmail, null, null);\r\n // }\r\n // }\r\n \r\n private handleFeatureLayoutConfigurationSearch(scope: string) {\r\n \r\n this.setState({\r\n isLoading: true,\r\n featureLayoutConfigurationList: [], // clear before setting the data again\r\n isHideAll: false\r\n });\r\n\r\n // Pass this to the parent component to clear the records\r\n if (this.props.onFeatureLayoutConfigurationFetch) {\r\n this.props.onFeatureLayoutConfigurationFetch([], [], false);\r\n }\r\n\r\n let isAdministrator = null;\r\n let isInternalRole = null;\r\n\r\n if (this.state.isInternalRole.length > 0) {\r\n if (this.state.isInternalRole === RoleCategoryType.Administrator.toString()) {\r\n isAdministrator = true;\r\n } else {\r\n isInternalRole = this.state.isInternalRole === '1';\r\n }\r\n }\r\n\r\n let isShowFilterControls = this.props.isShowFilterControls === undefined ? true : this.props.isShowFilterControls;\r\n\r\n var queryParams: FeatureLayoutConfigurationQueryParams = {\r\n includeHidden: true,\r\n layoutId: this.state.layoutId, // This is hardcoded now. \r\n isInternalRole: isShowFilterControls === false ? null : isInternalRole,\r\n isAdministrator: isShowFilterControls === false ? null : isAdministrator,\r\n userEmail: isShowFilterControls === false ? null : (this.state.userEmail.length > 0 ? this.state.userEmail : null),\r\n roleId: isShowFilterControls === false ? null : ( this.state.roleId.length > 0 ? this.state.roleId : null ),\r\n isPersonal: isShowFilterControls === false \r\n ? true \r\n : (scope === 'DashboardSecurityPersonal' ? true : (this.state.userEmail.length > 0 ? false : null) ),\r\n dashboardPanelId: this.state.dashboardPanel ? this.state.dashboardPanel.value === 'all' ? null : this.state.dashboardPanel.value : null\r\n };\r\n\r\n fetchFeatureLayoutConfigurationData(queryParams, \r\n true, \r\n (data: FeatureLayoutConfigurationListData) => { \r\n this.handleFeatureLayoutConfigurationFetch(data); \r\n }, \r\n (reason) => { \r\n this.setState({\r\n isLoading: false\r\n });\r\n\r\n showNotification('Failed to Fetch Layout Configuration', reason, 'error'); \r\n });\r\n }\r\n\r\n private handleFeatureLayoutConfigurationFetch(data: FeatureLayoutConfigurationListData) {\r\n if (data.loading) {\r\n this.setState({\r\n isLoading: true\r\n });\r\n }\r\n\r\n if (data && data.featureLayoutConfigurationList !== undefined && \r\n data.featureLayoutConfigurationList.featureLayoutConfiguration !== undefined) {\r\n\r\n // This is due to what is being returned from Graphql is a readonly list. \r\n // This is a intentional in Graphql Apollo. But we need this to be editable.\r\n // So we make a deep copy.\r\n const featureLayoutConfigurationList = JSON.parse(JSON.stringify(\r\n data.featureLayoutConfigurationList.featureLayoutConfiguration));\r\n\r\n let isHideAll = !(data.featureLayoutConfigurationList.featureLayoutConfiguration.filter( x => x.isHidden === false).length > 0);\r\n\r\n let filteredItems: FeatureLayoutConfiguration[] = featureLayoutConfigurationList;\r\n\r\n if (this.state.search.length > 0) {\r\n filteredItems = featureLayoutConfigurationList.filter((item: FeatureLayoutConfiguration) => {\r\n return item.title.toLowerCase().includes(this.state.search.toLowerCase().trim());\r\n });\r\n }\r\n\r\n this.setState({\r\n featureLayoutConfigurationList: filteredItems,\r\n isLoading: false,\r\n isSearchAgain: false,\r\n isHideAll: isHideAll\r\n });\r\n\r\n // Pass this to the parent component.\r\n if (this.props.onFeatureLayoutConfigurationFetch) {\r\n this.props.onFeatureLayoutConfigurationFetch(featureLayoutConfigurationList, filteredItems, false);\r\n }\r\n }\r\n }\r\n\r\n private handleSave() {\r\n if (this.props.handleSave) {\r\n this.props.handleSave();\r\n }\r\n }\r\n\r\n private handleReset() {\r\n this.setState({\r\n showConfirm: true\r\n });\r\n }\r\n\r\n private handleDeleteConfirm(agree: boolean) { \r\n if (agree) {\r\n if (this.props.handleReset) {\r\n this.props.handleReset();\r\n }\r\n }\r\n\r\n this.setState({showConfirm: false});\r\n }\r\n\r\n private onSearchChange(event: React.ChangeEvent) {\r\n\r\n const search = event.target.value;\r\n this.setState({\r\n search: search\r\n });\r\n \r\n this.handleFeatureLayoutConfigurationSearch(this.state.scope);\r\n \r\n // const filteredFeatureLayoutConfigurationList = this.state.featureLayoutConfigurationList;\r\n\r\n // if (this.props.onFeatureLayoutConfigurationFetch) {\r\n // this.props.onFeatureLayoutConfigurationFetch(filteredFeatureLayoutConfigurationList, filteredItems);\r\n // }\r\n }\r\n\r\n private onClearSearch() {\r\n this.setState({\r\n search: ''\r\n });\r\n\r\n this.handleFeatureLayoutConfigurationSearch(this.state.scope);\r\n }\r\n\r\n private subscribeToUpdateFeature() {\r\n\r\n const vm = this; \r\n \r\n this.featureSubscription = client.subscribe({\r\n query: UpdateFeatureSubscription\r\n }).subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n // tslint:disable-next-line:no-console\r\n console.log(results);\r\n if (results.data.featureUpdateNotification.status) {\r\n \r\n showNotification('Success', results.data.featureUpdateNotification.message, 'info');\r\n \r\n vm.fetchScopeData();\r\n\r\n } else {\r\n showNotification('Failed', results.data.featureUpdateNotification.message, 'error');\r\n }\r\n }, \r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n }\r\n });\r\n \r\n }\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport default withStyles(styles as any, { withTheme: true })(FeatureLayoutConfigurationControlPanel as any) as any;","import { createStyles, Theme } from '@material-ui/core';\r\n\r\nexport const styles = (theme: Theme) => createStyles({\r\n addButtonWrapper: {\r\n display: 'flex',\r\n flexGrow: 1,\r\n justifyContent: 'flex-end',\r\n // paddingTop: '20px',\r\n },\r\n button: {\r\n margin: theme.spacing(),\r\n },\r\n buttonWrapper: {\r\n alignItems: 'center',\r\n display: 'flex',\r\n justifyContent: 'flex-end',\r\n padding: '10px 15px',\r\n },\r\n checkbox: {\r\n\r\n },\r\n checkboxContainer: {\r\n margin: '0 8px',\r\n },\r\n checkboxWrapper: {\r\n margin: '0 8px',\r\n paddingTop: '20px',\r\n },\r\n clientGrid: {\r\n margin: '0 -12px',\r\n },\r\n col: {\r\n alignItems: 'center',\r\n display: 'flex',\r\n flexWrap: 'wrap',\r\n },\r\n container: {\r\n // display: 'flex',\r\n // flexWrap: 'wrap',\r\n },\r\n customExpandablePanel: {\r\n marginBottom: 0,\r\n },\r\n customGrid: {\r\n '@media (min-width: 1280px)': {\r\n flexBasis: '25%',\r\n flexGrow: 0,\r\n maxWidth: '25%',\r\n },\r\n '@media (min-width: 960px)': {\r\n flexBasis: '25%',\r\n flexGrow: 0,\r\n maxWidth: '25%',\r\n },\r\n flexBasis: '50%',\r\n flexGrow: 0,\r\n margin: 0,\r\n maxWidth: '50%',\r\n },\r\n dateField: {\r\n alignItems: 'flex-end',\r\n display: 'flex',\r\n },\r\n expansionPanel: {\r\n marginTop: '20px',\r\n },\r\n extendedIcon: {\r\n marginRight: theme.spacing(),\r\n },\r\n flexEnd: {\r\n justifyContent: 'flex-end',\r\n },\r\n formContainer: {\r\n padding: '12px',\r\n },\r\n formControl: {\r\n margin: theme.spacing(),\r\n }, \r\n grid: {\r\n display: 'flex',\r\n padding: '2px 12px 2px 12px !important',\r\n },\r\n gridContainer: {\r\n display: 'flex',\r\n flexFlow: 'row wrap',\r\n padding: '0 !important',\r\n },\r\n gridWrapper: {\r\n flexGrow: 1,\r\n },\r\n group: {\r\n flexFlow: 'row wrap',\r\n margin: `${theme.spacing()}px 0`,\r\n },\r\n heading: {\r\n fontSize: theme.typography.pxToRem(15),\r\n // fontWeight: theme.typography.fontWeightRegular,\r\n },\r\n label: {\r\n marginLeft: '8px',\r\n paddingRight: '10px',\r\n },\r\n menu: {\r\n width: 200,\r\n },\r\n panelAction: {\r\n padding: '8px',\r\n },\r\n textField: {\r\n '& .form-control': {\r\n width: '100%',\r\n },\r\n flexGrow: 1,\r\n marginBottom: theme.spacing(),\r\n marginLeft: theme.spacing(),\r\n marginRight: theme.spacing(),\r\n },\r\n typeTitle: {\r\n marginBottom: 0,\r\n },\r\n upperButton: {\r\n position: 'fixed',\r\n right: '15px',\r\n top: '300px',\r\n zIndex: 2,\r\n [theme.breakpoints.up('md')]: {\r\n top: '240px',\r\n },\r\n },\r\n voiPadding: {\r\n paddingTop: '20px'\r\n },\r\n cardRoot: {\r\n display: 'flex',\r\n },\r\n cardDetails: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n },\r\n cardContent: {\r\n flex: '1 0 auto',\r\n padding: '0 15px !important',\r\n width: '100%',\r\n },\r\n cardCover: {\r\n display: 'flex',\r\n },\r\n cardControls: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n paddingLeft: theme.spacing(1),\r\n paddingBottom: theme.spacing(1),\r\n },\r\n popover: {\r\n pointerEvents: 'none',\r\n },\r\n paper: {\r\n padding: theme.spacing(1),\r\n maxWidth: '960px',\r\n },\r\n controlContainer: {\r\n display: 'flex',\r\n padding: '0 15px 10px 15px',\r\n justifyContent: 'space-between',\r\n alignItems: 'center',\r\n '& .Mui-checked': {\r\n '& .MuiSwitch-thumb': {\r\n color: '#5173FF'\r\n }\r\n }\r\n },\r\n cardMedia: {\r\n display: 'flex',\r\n flex: 1,\r\n padding: '10px 0',\r\n '& .image': {\r\n padding: '0 15px',\r\n // flex: 1,\r\n display: 'flex',\r\n alignItems: 'center'\r\n },\r\n '& .text': {\r\n flex: 2,\r\n display: 'flex',\r\n alignItems: 'center',\r\n }\r\n },\r\n cardWrapper: {\r\n display: 'flex',\r\n flex: 1,\r\n },\r\n cardContainer: {\r\n display: 'flex',\r\n flexFlow: 'column',\r\n flex: 1,\r\n },\r\n rightControl: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'flex-end',\r\n gap: '5px'\r\n },\r\n videoButton: {\r\n // marginRight: '5px',\r\n color: '#5173FF'\r\n }\r\n});","import { WatchQueryFetchPolicy } from 'apollo-client';\r\nimport gql from 'graphql-tag';\r\nimport { useMutation } from 'react-apollo';\r\n\r\nexport const useUpdateFeatureMutation = (fetchPolicy?: WatchQueryFetchPolicy) => {\r\n\r\n const [updateData, updateResult] = useMutation(UpdateFeature);\r\n\r\n return {...updateResult, updateData};\r\n};\r\n\r\nexport interface UpdateFeatureInput {\r\n guid: string | null;\r\n feature?: string | null;\r\n description: string | null;\r\n title?: string | null;\r\n infoUrl?: string | null;\r\n}\r\n\r\nexport interface UpdateFeatureParams {\r\n input: UpdateFeatureInput;\r\n}\r\n\r\nexport interface UpdateFeatureData {\r\n updateFeature: boolean;\r\n}\r\n\r\nconst UpdateFeature = gql`\r\n mutation updateFeature($input: UpdateFeatureInput) {\r\n updateFeature(input: $input)\r\n }\r\n`;","/* eslint-disable react-hooks/exhaustive-deps */\r\nimport React, { useEffect, useState } from 'react';\r\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles';\r\nimport { Button, Dialog, DialogTitle, DialogActions, DialogContent, Grid } from '@material-ui/core';\r\nimport { AnyObject, Field, Form, FormSpy } from 'react-final-form';\r\nimport { FormApi } from 'final-form';\r\nimport { RvLoader } from '../../components/Loader';\r\nimport DialogBox from '../../Dashboard/Component/DialogBox';\r\n// import { Editor } from 'react-draft-wysiwyg';\r\nimport { convertFromRaw, convertToRaw, EditorState } from 'draft-js';\r\n// import htmlToDraft from 'html-to-draftjs';\r\nimport draftToHtml from 'draftjs-to-html';\r\nimport { convertToDraftWysiwygContent } from '../../helpers/commonHelper';\r\nimport { useUpdateFeatureMutation } from '../hooks/useUpdateFeatureMutation';\r\nimport { showNotification } from '../../App';\r\nimport { Editor as TinyEditor } from '@tinymce/tinymce-react';\r\n\r\nconst useStyles = makeStyles((theme: Theme) =>\r\n createStyles({\r\n dialogRoot: {\r\n '& .downshift-wrapper': {\r\n flex: 1,\r\n padding: 0,\r\n },\r\n },\r\n header: {\r\n textTransform: 'capitalize',\r\n },\r\n content: {\r\n flex: 1,\r\n },\r\n buttonContainer: {\r\n display: 'flex',\r\n justifyContent: 'space-between',\r\n // paddingBottom: '20px'\r\n },\r\n button: {\r\n margin: theme.spacing(1),\r\n minWidth: '83px',\r\n },\r\n hidden: {\r\n display: 'none',\r\n },\r\n loaderWrapper: {\r\n display: 'flex',\r\n justifyContent: 'center',\r\n padding: '20px 0',\r\n },\r\n formLabel: {\r\n paddingBottom: '10px',\r\n },\r\n editorClassName: {\r\n padding: '0 10px',\r\n minHeight: '300px',\r\n maxHeight: '500px',\r\n },\r\n wrapperClassName: {\r\n border: '1px solid #949494',\r\n display: 'flex',\r\n flexFlow: 'column-reverse',\r\n },\r\n toolbarClassName: {\r\n border: 0,\r\n // borderBottom: '1px solid #F1F1F1',\r\n margin: 0,\r\n padding: 0,\r\n '& .rdw-dropdown-wrapper': {\r\n position: 'relative',\r\n },\r\n '& .rdw-dropdown-optionwrapper': {\r\n position: 'absolute',\r\n },\r\n },\r\n paperRoot: {\r\n overflow: 'visible',\r\n minHeight: 'calc(100vh - 50px)',\r\n display: 'flex',\r\n flexFlow: 'column',\r\n },\r\n dialogContent: {\r\n overflow: 'inherit',\r\n display: 'flex',\r\n flexFlow: 'column',\r\n },\r\n taskForm: {\r\n flex: 1,\r\n display: 'flex',\r\n flexFlow: 'column',\r\n }\r\n }),\r\n);\r\n\r\ninterface FeatureNotesDialogProps {\r\n open: boolean;\r\n onClose?: () => void;\r\n title: string;\r\n description: string;\r\n featureGuid: string;\r\n feature?: string;\r\n infoUrl?: string | null;\r\n}\r\n\r\nexport interface FeatureNotesDialogForm {\r\n notes: string; // EditorState;\r\n}\r\n \r\nexport const FeatureNotesDialog: React.FC = (props) => {\r\n const classes = useStyles();\r\n\r\n const updateFeature = useUpdateFeatureMutation();\r\n \r\n const [isLoading] = useState(false);\r\n const [isChanged, setIsChanged] = useState(false);\r\n const [showDiscard, setShowDiscard] = useState(false);\r\n\r\n useEffect(() => {\r\n \r\n if (updateFeature.data && updateFeature.data.updateFeature && !updateFeature.loading && !updateFeature.error) {\r\n showNotification(null, 'Successfully submitted', 'info');\r\n if (props.onClose) {\r\n props.onClose();\r\n }\r\n }\r\n\r\n if (updateFeature.error) {\r\n showNotification('Failed to Save Enquiry', updateFeature.error.message, 'error');\r\n }\r\n\r\n }, [updateFeature.data, updateFeature.error, updateFeature.loading]);\r\n\r\n let tempDesription = props.description;\r\n\r\n if (props.description) {\r\n if (props.description.indexOf('blocks\":') !== -1) {\r\n const draftContent = convertToDraftWysiwygContent(JSON.parse(props.description));\r\n const contentState = convertFromRaw(draftContent);\r\n tempDesription = draftToHtml(convertToRaw(EditorState.createWithContent(contentState).getCurrentContent()));\r\n } \r\n \r\n // else {\r\n // const contentBlock = htmlToDraft(props.description);\r\n\r\n // if (contentBlock) {\r\n // const contentState = ContentState.createFromBlockArray(contentBlock.contentBlocks);\r\n // editorState = EditorState.createWithContent(contentState);\r\n // }\r\n // }\r\n }\r\n\r\n const initialValues: FeatureNotesDialogForm = {\r\n notes: tempDesription // draftToHtml(convertToRaw(editorState.getCurrentContent()))\r\n };\r\n\r\n const onSubmit = (form: FormApi, values: FeatureNotesDialogForm) => {\r\n\r\n // const notes = draftToHtml(convertToRaw(values.notes.getCurrentContent()));\r\n\r\n updateFeature.updateData({\r\n variables: {\r\n input: {\r\n guid: props.featureGuid,\r\n description: values.notes,\r\n }\r\n }\r\n });\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n const onFormValueChanged = (form: FormApi, changeProps: any) => {\r\n if (!changeProps.pristine) {\r\n setIsChanged(true);\r\n }\r\n };\r\n\r\n const onClose = () => {\r\n if (isChanged) {\r\n setShowDiscard(true);\r\n } else {\r\n if (props.onClose) {\r\n props.onClose();\r\n }\r\n }\r\n };\r\n\r\n const onDiscardChanges = (agree: boolean) => {\r\n if (agree) {\r\n if (props.onClose) {\r\n props.onClose();\r\n }\r\n }\r\n setShowDiscard(false);\r\n };\r\n\r\n // tslint:disable-next-line: no-any\r\n // const required = (value: any) => {\r\n // return value ? undefined : 'Required';\r\n // };\r\n\r\n // const onFocusEditor = (event: SyntheticEvent) => {\r\n // setHideToolbar(false);\r\n // };\r\n\r\n // const onBlurEditor = (event: SyntheticEvent) => {\r\n // setHideToolbar(true);\r\n // };\r\n\r\n const actionButton = (\r\n // tslint:disable-next-line: no-any\r\n form: FormApi,\r\n submitting: boolean,\r\n pristine: boolean,\r\n // tslint:disable-next-line: no-any\r\n values: AnyObject,\r\n ) => {\r\n return (\r\n
\r\n {/* */}\r\n
\r\n {\r\n // code here..\r\n }}\r\n disabled={submitting || pristine}\r\n >\r\n Update\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n );\r\n };\r\n\r\n return (\r\n <>\r\n \r\n\r\n \r\n {props.title}\r\n {isLoading ? (\r\n \r\n
\r\n \r\n
\r\n
\r\n ) : (\r\n ) => onSubmit(form, values)}\r\n initialValues={initialValues}\r\n initialValuesEqual={() => true}\r\n keepDirtyOnReinitialize={true}\r\n subscription={{ submitting: true, pristine: true }}\r\n render={({ handleSubmit, form, submitting, pristine, values }) => (\r\n
\r\n {\r\n onFormValueChanged(form, props);\r\n }}\r\n />\r\n \r\n \r\n {/* \r\n \r\n {({ input, meta }) => (\r\n <>\r\n \r\n Notes\r\n \r\n \r\n \r\n )}\r\n \r\n */}\r\n \r\n \r\n {({ input, meta }) => (\r\n
',\r\n },\r\n { title: 'Starting my story', description: 'A cure for writers block', content: 'Once upon a time...' },\r\n {\r\n title: 'New list with dates',\r\n description: 'New List with dates',\r\n content:\r\n '
cdate
mdate

My List

',\r\n },\r\n ],\r\n template_cdate_format: '[Date Created (CDATE): %m/%d/%Y : %H:%M:%S]',\r\n template_mdate_format: '[Date Modified (MDATE): %m/%d/%Y : %H:%M:%S]',\r\n image_caption: true,\r\n quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',\r\n noneditable_noneditable_class: 'mceNonEditable',\r\n toolbar_mode: 'sliding',\r\n contextmenu: 'link image imagetools table',\r\n // menu: {\r\n // custom: { title: 'Merge Fields', items: getMergeFieldItems() }\r\n // },\r\n // tslint:disable-next-line: no-any\r\n // setup: function (editor: any) {\r\n // // var toggleState = false;\r\n // getMergeFieldMenuItems(editor);\r\n\r\n // // editor.ui.registry.addMenuItem('firstName', {\r\n // // text: 'First Name',\r\n // // onAction: function () {\r\n // // editor.insertContent('{firstName}');\r\n // // },\r\n // // });\r\n\r\n // // comment\r\n // // tslint:disable-next-line: no-any\r\n // var onAction = function (autocompleteApi: any, rng: any, value: any) {\r\n // editor.selection.setRng(rng);\r\n // editor.insertContent(value);\r\n // autocompleteApi.hide();\r\n // };\r\n\r\n // // tslint:disable-next-line: no-any\r\n // var getMatchedChars = function (pattern: any) {\r\n // const mergedFields = getMergeFields();\r\n // if (mergedFields) {\r\n // // tslint:disable-next-line: no-any\r\n // return mergedFields.filter(function (char: any) {\r\n // if (pattern && char.text) {\r\n // return char.text.toLowerCase().indexOf(pattern.toLowerCase()) !== -1;\r\n // } else {\r\n // return char.text.toLowerCase().indexOf(pattern) !== -1;\r\n // }\r\n // });\r\n // } else {\r\n // return [];\r\n // }\r\n // };\r\n\r\n // /* An autocompleter that allows you to insert special characters */\r\n // editor.ui.registry.addAutocompleter('specialchars', {\r\n // ch: '{',\r\n // minChars: 0,\r\n // columns: 1,\r\n // highlightOn: ['char_name'],\r\n // onAction: onAction,\r\n // // tslint:disable-next-line: no-any\r\n // fetch: function (pattern: any) {\r\n // // tslint:disable-next-line: no-any\r\n // return new Promise(function (resolve: any) {\r\n // // tslint:disable-next-line: no-any\r\n // var results = getMatchedChars(pattern).map(function (char: any) {\r\n // return {\r\n // type: 'cardmenuitem',\r\n // value: char.value,\r\n // label: char.text,\r\n // items: [\r\n // {\r\n // type: 'cardcontainer',\r\n // direction: 'vertical',\r\n // items: [\r\n // {\r\n // type: 'cardtext',\r\n // text: char.text,\r\n // name: 'char_name'\r\n // },\r\n // // Don't display value of the merged field\r\n // // {\r\n // // type: 'cardtext',\r\n // // text: char.value\r\n // // }\r\n // ]\r\n // }\r\n // ]\r\n // };\r\n // });\r\n // resolve(results);\r\n // });\r\n // }\r\n // });\r\n // },\r\n }}\r\n onEditorChange={(content: string) => {\r\n input.onChange(content);\r\n }}\r\n />\r\n )}\r\n \r\n \r\n \r\n \r\n {actionButton(form, submitting, pristine, values)}\r\n \r\n )}\r\n />\r\n )}\r\n \r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { Draggable } from 'react-beautiful-dnd';\r\nimport glamorous from 'glamorous';\r\nimport { styles } from './styles';\r\nimport { WithStyles, CardContent, Card, Typography, CardMedia, FormControlLabel, Switch, withStyles, IconButton } from '@material-ui/core';\r\nimport InfoIcon from '@material-ui/icons/InfoOutlined';\r\nimport TrendingUpIcon from '@material-ui/icons/TrendingUp';\r\n// import MUIRichTextEditor from 'mui-rte';\r\nimport VideoLibraryOutlinedIcon from '@material-ui/icons/VideoLibraryOutlined';\r\nimport { VideoModal } from '../components/VideoModal';\r\nimport EditOutlinedIcon from '@material-ui/icons/EditOutlined';\r\nimport { FeatureNotesDialog } from './dialogs/FeatureNotesDialog';\r\n\r\n// import htmlToDraft from 'html-to-draftjs';\r\nimport draftToHtml from 'draftjs-to-html';\r\nimport { EditorState, convertFromRaw, convertToRaw } from 'draft-js';\r\n// import { Editor } from 'react-draft-wysiwyg';\r\nimport { convertToDraftWysiwygContent } from '../helpers/commonHelper';\r\nimport { Editor } from '@tinymce/tinymce-react';\r\nimport { FeatureNotesPreviewDialog } from './dialogs/FeatureNotesPreviewDialog';\r\n\r\n// tslint:disable-next-line: no-any\r\nconst CardDraggable = glamorous.div<{theme?: any}> ((props) => ({\r\n // paddingRight: '25px', \r\n}));\r\n\r\n// tslint:disable-next-line: no-any\r\nconst TrendingUpIconWrapper = glamorous(TrendingUpIcon)<{ theme?: any }>((props) => ({\r\n color: props.theme.TemplateColor.Primary\r\n}));\r\n\r\n// tslint:disable-next-line: no-any\r\nconst SwitchWrapper = glamorous(Switch)<{ theme?: any }>((props) => ({\r\n color: props.theme.TemplateColor.Primary\r\n}));\r\n\r\n// tslint:disable-next-line: no-any\r\n// const InfoIconWrapper = glamorous(InfoIcon)<{ theme?: any }>((props) => ({\r\n// color: props.theme.TemplateColor.Primary,\r\n// cursor: 'pointer'\r\n// }));\r\n\r\nexport interface FeatureLayoutCardDraggableProps extends WithStyles {\r\n featureGuid: string;\r\n feature: string;\r\n title: string;\r\n description: string;\r\n isHidden: boolean;\r\n sequence: number;\r\n index: number;\r\n onIsHiddenUpdated: (featureGuid: string, isHidden: boolean) => void;\r\n itemPerRow: number;\r\n windowInnterWidth: number;\r\n isDragDisabled?: boolean;\r\n infoUrl: string | null;\r\n isInternalAdmin: boolean;\r\n}\r\n\r\nexport interface FeatureLayoutCardDraggableState {\r\n isVisible: boolean;\r\n hiddenText: string;\r\n open: boolean;\r\n anchorEl: Element | ((element: Element) => Element) | null | undefined;\r\n isVideoModalOpen: boolean;\r\n isEditNotesOpen: boolean;\r\n isNotesPreviewOpen: boolean;\r\n}\r\n\r\nclass FeatureLayoutCardDraggable \r\n extends React.Component {\r\n \r\n // tslint:disable-next-line: no-any\r\n // private refValue: any;\r\n \r\n constructor(props: FeatureLayoutCardDraggableProps, state: FeatureLayoutCardDraggableState) {\r\n super(props, state);\r\n\r\n this.onHiddenChange = this.onHiddenChange.bind(this);\r\n this.handlePopoverOpen = this.handlePopoverOpen.bind(this);\r\n this.handlePopoverClose = this.handlePopoverClose.bind(this);\r\n this.getWidthPerRow = this.getWidthPerRow.bind(this);\r\n // this.handleClick = this.handleClick.bind(this);\r\n this.onClickVideoToggle = this.onClickVideoToggle.bind(this);\r\n this.onToggleNotesDialog = this.onToggleNotesDialog.bind(this);\r\n this.getTooltip = this.getTooltip.bind(this);\r\n this.onPreviewNotes = this.onPreviewNotes.bind(this);\r\n \r\n this.state = {\r\n isVisible: false,\r\n hiddenText: 'Hidden',\r\n open: false,\r\n anchorEl: undefined,\r\n isVideoModalOpen: false,\r\n isEditNotesOpen: false,\r\n isNotesPreviewOpen: false\r\n };\r\n\r\n // this.refValue = React.createRef();\r\n }\r\n\r\n // tslint:disable-next-line: no-empty\r\n public componentDidMount() {\r\n this.setState({\r\n isVisible: !this.props.isHidden,\r\n hiddenText: this.props.isHidden ? 'Hidden' : 'Visible'\r\n });\r\n }\r\n\r\n public UNSAFE_componentWillReceiveProps(nextProps: FeatureLayoutCardDraggableProps) {\r\n if (this.props.isHidden !== nextProps.isHidden) {\r\n this.setState({\r\n isVisible: !nextProps.isHidden,\r\n });\r\n }\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n\r\n const hiddenText = this.state.isVisible ? 'Visible' : 'Hidden';\r\n\r\n return (\r\n \r\n {this.state.isEditNotesOpen ? (\r\n \r\n ) : undefined}\r\n\r\n {this.state.isNotesPreviewOpen ? (\r\n \r\n ) : undefined}\r\n\r\n {this.state.isVideoModalOpen && this.props.infoUrl && (\r\n \r\n )}\r\n \r\n {(provided, snapshot) => (\r\n \r\n {/* tslint:disable-next-line: jsx-alignment */}\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n {this.props.title}\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n }\r\n label={hiddenText}\r\n />\r\n
\r\n {this.props.infoUrl && (\r\n \r\n \r\n \r\n )}\r\n\r\n {this.props.isInternalAdmin ? (\r\n \r\n \r\n \r\n ) : null}\r\n\r\n \r\n \r\n \r\n \r\n {/* \r\n 0 ? this.state.open : false}\r\n anchorEl={this.state.anchorEl}\r\n anchorOrigin={{\r\n vertical: 'bottom',\r\n horizontal: 'left',\r\n }}\r\n transformOrigin={{\r\n vertical: 'top',\r\n horizontal: 'left',\r\n }}\r\n onClose={this.handlePopoverClose}\r\n disableRestoreFocus={true}\r\n >\r\n {this.getTooltip(this.props.description ?? '')}\r\n */}\r\n
\r\n
\r\n
\r\n
\r\n \r\n )}\r\n \r\n
\r\n );\r\n }\r\n\r\n private getTooltip(description: string) {\r\n\r\n let tempDesription = description;\r\n\r\n if (description.indexOf('blocks\":') !== -1) {\r\n const draftContent = convertToDraftWysiwygContent(JSON.parse(description));\r\n const contentState = convertFromRaw(draftContent);\r\n tempDesription = draftToHtml(convertToRaw(EditorState.createWithContent(contentState).getCurrentContent()));\r\n } \r\n\r\n // const contentBlock = htmlToDraft(description);\r\n\r\n // const contentState = ContentState.createFromBlockArray(contentBlock.contentBlocks);\r\n \r\n // const editorState = EditorState.createWithContent(contentState);\r\n\r\n return (\r\n <>\r\n \r\n \r\n );\r\n\r\n // return (\r\n // <>\r\n // \r\n // \r\n // );\r\n }\r\n\r\n private getWidthPerRow(itemPerRow: number, windowInnterWidth: number) {\r\n if (itemPerRow === 4) {\r\n return `${(windowInnterWidth - 173) / 4}px`;\r\n } else if (itemPerRow === 3) {\r\n if (windowInnterWidth >= 1025) {\r\n return `${(windowInnterWidth - 173) / 3}px`;\r\n } else {\r\n return `${(windowInnterWidth - 105) / 3}px`;\r\n }\r\n } else if (itemPerRow === 2) {\r\n return `${(windowInnterWidth - 105) / 2}px`;\r\n } else {\r\n return `${(windowInnterWidth - 105)}px`;\r\n }\r\n }\r\n\r\n private onHiddenChange(event: React.FormEvent) {\r\n this.setState({\r\n isVisible: !this.state.isVisible,\r\n hiddenText: !this.state.isVisible ? 'Visible' : 'Hidden'\r\n });\r\n\r\n if (this.props.onIsHiddenUpdated) {\r\n this.props.onIsHiddenUpdated(this.props.featureGuid, !this.state.isVisible);\r\n }\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n private handlePopoverOpen(event: any) {\r\n this.setAnchorEl(event.currentTarget);\r\n }\r\n \r\n private handlePopoverClose = () => {\r\n this.setAnchorEl(null);\r\n }\r\n\r\n // tslint:disable-next-line: no-any\r\n private setAnchorEl(anchorElValue: any) {\r\n this.setState({\r\n anchorEl: anchorElValue,\r\n open: Boolean(anchorElValue)\r\n });\r\n } \r\n\r\n private onClickVideoToggle = (toggle: boolean) => () => {\r\n this.setState({\r\n isVideoModalOpen: toggle\r\n });\r\n }\r\n\r\n private onToggleNotesDialog = (toggle: boolean) => () => {\r\n this.setState({\r\n isEditNotesOpen: toggle\r\n });\r\n }\r\n\r\n private onPreviewNotes = () => {\r\n this.setState({\r\n isNotesPreviewOpen: !this.state.isNotesPreviewOpen\r\n });\r\n }\r\n\r\n // private handleClick(event: React.MouseEvent) {\r\n // // click was used as a part of the drag\r\n // if (event.defaultPrevented) {\r\n // return;\r\n // }\r\n \r\n // this.refValue.current.focus();\r\n // } \r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport default withStyles(styles as any, { withTheme: true })(FeatureLayoutCardDraggable as any) as any;","import * as React from 'react';\r\nimport { CardMedia, CardContent, withStyles, WithStyles, Typography, FormControlLabel, Card, Switch, IconButton } from '@material-ui/core';\r\nimport glamorous from 'glamorous';\r\nimport { styles } from './styles';\r\nimport InfoIcon from '@material-ui/icons/InfoOutlined';\r\nimport TrendingUpIcon from '@material-ui/icons/TrendingUp';\r\nimport VideoLibraryOutlinedIcon from '@material-ui/icons/VideoLibraryOutlined';\r\n\r\n// tslint:disable-next-line: no-any\r\nconst CardDraggable = glamorous.div<{theme?: any}> ((props) => ({\r\n // paddingRight: '25px', \r\n}));\r\n\r\nexport interface FeatureLayoutCardCloneProps extends WithStyles {\r\n featureGuid: string;\r\n feature: string;\r\n title: string;\r\n description: string;\r\n isHidden: boolean;\r\n sequence: number;\r\n onIsHiddenUpdated?: (featureGuid: string, isHidden: boolean) => void;\r\n itemPerRow: number;\r\n windowInnterWidth: number;\r\n infoUrl: string | null;\r\n}\r\n\r\nexport interface FeatureLayoutCardCloneState {\r\n isVisible: boolean;\r\n hiddenText: string;\r\n}\r\n\r\nclass FeatureLayoutCardClone \r\n extends React.Component {\r\n constructor(props: FeatureLayoutCardCloneProps, state: FeatureLayoutCardCloneState) {\r\n super(props, state);\r\n\r\n this.onHiddenChange = this.onHiddenChange.bind(this);\r\n this.getWidthPerRow = this.getWidthPerRow.bind(this);\r\n \r\n this.state = {\r\n isVisible: false,\r\n hiddenText: 'Visible'\r\n };\r\n }\r\n\r\n // tslint:disable-next-line: no-empty\r\n componentDidMount() {\r\n this.setState({\r\n isVisible: !this.props.isHidden,\r\n hiddenText: this.props.isHidden ? 'Hidden' : 'Visible'\r\n });\r\n }\r\n\r\n render() {\r\n const { classes } = this.props;\r\n \r\n return (\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n \r\n
\r\n
\r\n \r\n \r\n {this.props.title}\r\n \r\n \r\n
\r\n
\r\n
\r\n \r\n }\r\n label={this.state.hiddenText}\r\n />\r\n
\r\n {this.props.infoUrl && (\r\n \r\n \r\n \r\n )}\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n );\r\n }\r\n\r\n private getWidthPerRow(itemPerRow: number, windowInnterWidth: number) {\r\n if (itemPerRow === 4) {\r\n return `${(windowInnterWidth - 173) / 4}px`;\r\n } else if (itemPerRow === 3) {\r\n if (windowInnterWidth >= 1025) {\r\n return `${(windowInnterWidth - 173) / 3}px`;\r\n } else {\r\n return `${(windowInnterWidth - 105) / 3}px`;\r\n }\r\n } else if (itemPerRow === 2) {\r\n return `${(windowInnterWidth - 105) / 2}px`;\r\n } else {\r\n return '100%';\r\n }\r\n }\r\n\r\n private onHiddenChange(event: React.FormEvent) {\r\n this.setState({\r\n isVisible: !this.state.isVisible,\r\n hiddenText: !this.state.isVisible ? 'Visible' : 'Hidden'\r\n });\r\n\r\n if (this.props.onIsHiddenUpdated) {\r\n this.props.onIsHiddenUpdated(this.props.featureGuid, !this.state.isVisible);\r\n }\r\n }\r\n}\r\n\r\n// tslint:disable-next-line: no-any\r\nexport default withStyles(styles as any, { withTheme: true })(FeatureLayoutCardClone as any) as any;","import * as React from 'react';\r\nimport { FeatureLayoutConfiguration } from './FeatureLayoutConfigurationRepository';\r\nimport FeatureLayoutCardDraggable from './FeatureLayoutCardDraggable';\r\nimport { Droppable, DroppableProvided, DroppableStateSnapshot, \r\n DraggableRubric, DraggableStateSnapshot, DraggableProvided } from 'react-beautiful-dnd';\r\nimport glamorous from 'glamorous';\r\nimport FeatureLayoutCardClone from './FeatureLayoutCardClone';\r\n\r\n// tslint:disable-next-line: no-any\r\nconst FeatureListContainer = glamorous.div<{theme?: any}> ((props) => ({\r\n}));\r\n\r\n// tslint:disable-next-line: no-any\r\nconst FeatureList = glamorous.div<{theme?: any}> ((props) => ({\r\n flexGrow: 1,\r\n display: 'flex',\r\n // justifyContent: 'space-evenly',\r\n // flexFlow: 'row wrap',\r\n}));\r\n\r\n// tslint:disable-next-line: no-any\r\nconst CloneItem = glamorous.div<{theme?: any}> ((props) => ({\r\n display: 'flex',\r\n // flex: 1,\r\n}));\r\n\r\n// tslint:disable-next-line: no-any\r\nconst FeatureLayoutCardDraggableWrapper = glamorous.div<{theme?: any}> ((props) => ({\r\n // flex: 1,\r\n}));\r\n\r\ninterface FeatureLayoutConfigurationDroppableProps {\r\n featureLayoutConfigurationList: FeatureLayoutConfiguration[];\r\n droppableId: string;\r\n onIsHiddenUpdated?: (featureGuid: string, isHidden: boolean) => void;\r\n itemsPerRow: number;\r\n windowInnterWidth: number;\r\n isDragDisabled?: boolean;\r\n isInternalAdmin: boolean;\r\n}\r\n\r\ninterface FeatureLayoutConfigurationDroppableState {\r\n featureLayoutConfigurationList: FeatureLayoutConfiguration[];\r\n}\r\n\r\nexport class FeatureLayoutConfigurationDroppable \r\n extends React.Component {\r\n constructor(props: FeatureLayoutConfigurationDroppableProps, state: FeatureLayoutConfigurationDroppableState) {\r\n super(props, state);\r\n\r\n this.getFeatureLayoutCardDraggable = this.getFeatureLayoutCardDraggable.bind(this);\r\n this.onIsHiddenUpdated = this.onIsHiddenUpdated.bind(this);\r\n\r\n this.state = {\r\n featureLayoutConfigurationList: this.props.featureLayoutConfigurationList\r\n };\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: FeatureLayoutConfigurationDroppableProps) {\r\n // If we don't have this, the draggable will always try to render\r\n if (nextProps.featureLayoutConfigurationList === this.props.featureLayoutConfigurationList) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public UNSAFE_componentWillReceiveProps(nextProps: FeatureLayoutConfigurationDroppableProps) {\r\n if (this.props.featureLayoutConfigurationList !== nextProps.featureLayoutConfigurationList) {\r\n this.setState({\r\n featureLayoutConfigurationList: nextProps.featureLayoutConfigurationList\r\n });\r\n }\r\n }\r\n\r\n public render() { \r\n const featureLayouts = this.getFeatureLayoutCardDraggable();\r\n\r\n return (\r\n \r\n \r\n (\r\n snapshot.isDragging ? this.getCloneItem(rubric.draggableId, provided, snapshot, rubric) \r\n : this.getCloneItem(rubric.draggableId, provided, snapshot, rubric)\r\n )}\r\n > \r\n {(provided: DroppableProvided, snapshot: DroppableStateSnapshot) => ( \r\n \r\n {featureLayouts} \r\n {provided.placeholder} \r\n {/* To Increase the space in droppable while drag */} \r\n \r\n \r\n )}\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n private getCloneItem(featureGuid: string, provided: DraggableProvided, snapshot: DraggableStateSnapshot, rubric: DraggableRubric) {\r\n const featureLayout = this.state.featureLayoutConfigurationList.filter( x => x.featureGuid === featureGuid)[0];\r\n // const index = this.state.featureLayoutConfigurationList.indexOf(featureLayout);\r\n return (\r\n \r\n {\r\n \r\n \r\n \r\n })\r\n \r\n );\r\n }\r\n\r\n private getFeatureLayoutCardDraggable() {\r\n return (\r\n \r\n { \r\n this.state.featureLayoutConfigurationList.map((featureLayout, index) => {\r\n return ( \r\n // \r\n \r\n \r\n \r\n );\r\n })}\r\n \r\n );\r\n }\r\n\r\n private onIsHiddenUpdated(featureGuid: string, isHidden: boolean) {\r\n if (this.props.onIsHiddenUpdated) {\r\n this.props.onIsHiddenUpdated(featureGuid, !isHidden);\r\n }\r\n }\r\n}","import * as React from 'react';\r\nimport { FeatureLayoutConfiguration, FeatureSearchChanges } from './FeatureLayoutConfigurationRepository';\r\nimport { DragDropContext } from 'react-beautiful-dnd';\r\nimport { FeatureLayoutConfigurationDroppable } from './FeatureLayoutConfigurationDroppable';\r\n\r\nexport interface DroppableRows {\r\n droppableRow: DroppableRow[];\r\n}\r\n\r\nexport interface DroppableRow {\r\n id: string;\r\n featureList: FeatureLayoutConfiguration[];\r\n}\r\n\r\ninterface FeatureLayoutConfigurationListProps {\r\n featureLayoutConfigurationList: FeatureLayoutConfiguration[];\r\n isSearch: boolean; // When the List is filtered using search\r\n onDragEnd?: (featureLayoutConfigurationList: FeatureLayoutConfiguration[] ) => void;\r\n isDragDisabled?: boolean;\r\n isHideAllOperation: boolean;\r\n isSearchChanged: boolean;\r\n onVisibilityChanged?: () => void;\r\n isInternalAdmin: boolean;\r\n}\r\n\r\ninterface FeatureLayoutConfigurationListState {\r\n windowInnterWidth: number;\r\n itemsPerRow: number;\r\n isLoading: boolean;\r\n featureLayoutConfigurationList: FeatureLayoutConfiguration[];\r\n droppableRows: DroppableRows; \r\n featureSearchChanges: FeatureSearchChanges[];\r\n isSearch: boolean;\r\n}\r\n\r\nexport class FeatureLayoutConfigurationList extends React.Component {\r\n constructor(props: FeatureLayoutConfigurationListProps, state: FeatureLayoutConfigurationListState) {\r\n super(props, state);\r\n\r\n this.onDragEnd = this.onDragEnd.bind(this);\r\n this.constructRows = this.constructRows.bind(this);\r\n this.getDroppable = this.getDroppable.bind(this);\r\n this.onIsHiddenUpdated = this.onIsHiddenUpdated.bind(this);\r\n this.gridBreakPoints = this.gridBreakPoints.bind(this);\r\n\r\n this.state = {\r\n itemsPerRow: this.gridBreakPoints(window.innerWidth), // Math.floor(window.innerWidth / 450),\r\n windowInnterWidth: window.innerWidth,\r\n isLoading: false,\r\n featureLayoutConfigurationList: [],\r\n droppableRows: { droppableRow: [] },\r\n featureSearchChanges: [],\r\n isSearch: false\r\n };\r\n }\r\n\r\n public UNSAFE_componentWillReceiveProps(nextProps: FeatureLayoutConfigurationListProps) {\r\n if (this.state.featureLayoutConfigurationList !== nextProps.featureLayoutConfigurationList ||\r\n this.props.isSearch !== nextProps.isSearch) {\r\n this.constructRows(nextProps.featureLayoutConfigurationList.slice(), false, nextProps.isSearch, false, nextProps.isHideAllOperation);\r\n }\r\n\r\n if (nextProps.isSearchChanged === true) {\r\n this.setState({\r\n featureSearchChanges: []\r\n });\r\n }\r\n }\r\n\r\n public shouldComponentUpdate(nextProps: FeatureLayoutConfigurationListProps) {\r\n // Prevent render if the list is same\r\n if (nextProps.featureLayoutConfigurationList === this.state.featureLayoutConfigurationList) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\r\n public componentDidMount() {\r\n this.setState({\r\n windowInnterWidth: window.innerWidth\r\n });\r\n window.addEventListener('resize', this.updateDimensions.bind(this));\r\n }\r\n\r\n public componentWillUnmount() {\r\n window.removeEventListener('resize', this.updateDimensions.bind(this));\r\n } \r\n\r\n public render() { \r\n\r\n // const droppables = this.getDroppable();\r\n\r\n return ( \r\n \r\n {/* {droppables} */}\r\n \r\n {this.state.droppableRows.droppableRow.map((droppableRow, index) =>\r\n \r\n )} \r\n \r\n \r\n );\r\n }\r\n \r\n private gridBreakPoints(width: number) {\r\n if (width >= 1280) {\r\n return 4;\r\n } else if (width >= 960) {\r\n return 3;\r\n } else if (width >= 600) {\r\n return 2;\r\n } else {\r\n return 1;\r\n }\r\n }\r\n\r\n private updateDimensions() {\r\n this.setState({\r\n windowInnterWidth: window.innerWidth,\r\n itemsPerRow: this.gridBreakPoints(window.innerWidth) // Math.floor(window.innerWidth / 450)\r\n });\r\n \r\n this.constructRows(this.state.featureLayoutConfigurationList, true, false, false, false);\r\n }\r\n\r\n private getDroppable() {\r\n return( \r\n \r\n {this.state.droppableRows.droppableRow.map((droppableRow, index) =>\r\n \r\n )} \r\n \r\n );\r\n }\r\n\r\n private constructRows(featureLayoutConfigurationList: FeatureLayoutConfiguration[], isReOrder: boolean, \r\n isSearch?: boolean, isHiddenUpdated?: boolean, isHideAllOperation?: boolean) {\r\n let featureLayoutConfigurationListCopy: FeatureLayoutConfiguration[] = featureLayoutConfigurationList;\r\n\r\n const featureSearchChanges = this.state.featureSearchChanges;\r\n\r\n // If we already had previous record in search, then apply these changes back to featureLayoutChanges\r\n if (this.state.featureSearchChanges.length > 0 && featureLayoutConfigurationList.length > 0 &&\r\n isHiddenUpdated === false && isHideAllOperation === false) {\r\n this.state.featureSearchChanges.forEach((featureChange: FeatureSearchChanges) => {\r\n featureLayoutConfigurationListCopy.forEach((feature: FeatureLayoutConfiguration) => {\r\n if (feature.featureGuid.toLowerCase() === featureChange.featureGuid.toLowerCase()) {\r\n feature.isHidden = featureChange.isHidden;\r\n }\r\n }); \r\n });\r\n }\r\n\r\n // Construct Rows. 5 Items per Row.\r\n let rowNumber = 1;\r\n let droppableRows: DroppableRows = { droppableRow: [] };\r\n\r\n for (let index = 0; index < featureLayoutConfigurationListCopy.length; index++) {\r\n // Check the count of featureList. if it is 5, create new row\r\n let lastDroppableRow = droppableRows.droppableRow[droppableRows.droppableRow.length - 1];\r\n\r\n if (lastDroppableRow !== undefined \r\n && lastDroppableRow.featureList.length === this.state.itemsPerRow) {\r\n rowNumber = rowNumber + 1; // Increase to next row.\r\n\r\n // Create a new Row\r\n droppableRows.droppableRow.push({\r\n id: 'row-' + rowNumber.toString(),\r\n featureList: []\r\n });\r\n }\r\n\r\n if (lastDroppableRow === undefined) {\r\n droppableRows.droppableRow.push({\r\n id: 'row-' + rowNumber.toString(),\r\n featureList: []\r\n });\r\n }\r\n\r\n lastDroppableRow = droppableRows.droppableRow[droppableRows.droppableRow.length - 1];\r\n lastDroppableRow.featureList.push(featureLayoutConfigurationListCopy[index]);\r\n\r\n // if (featureLayoutConfigurationListCopy[index].feature.toLowerCase() === ('FeesBilledByPeriodVsBudgetChart').toLowerCase()) {\r\n // // tslint:disable-next-line: no-console\r\n // console.log('Feature', featureLayoutConfigurationListCopy[index]);\r\n // }\r\n }\r\n\r\n // re-order featureLayoutConfigurationList\r\n let featureLayoutConfigList: FeatureLayoutConfiguration[] = [];\r\n if (isReOrder) { \r\n let newdroppableRowList = Array.from(droppableRows.droppableRow); \r\n\r\n let sequence: number = 1;\r\n newdroppableRowList.forEach(droppableRow => {\r\n droppableRow.featureList.forEach(featureLayout => { \r\n featureLayout.sequence = sequence; \r\n featureLayoutConfigList.push(featureLayout);\r\n sequence = sequence + 1;\r\n }); \r\n });\r\n }\r\n\r\n // Set hidden list, and maintain the feature hidden flags. This can be used again when we are using search\r\n if (isSearch !== undefined && isSearch === false && featureLayoutConfigurationListCopy.length > 0) {\r\n \r\n featureLayoutConfigurationListCopy.forEach((item: FeatureLayoutConfiguration) => {\r\n let featureSearchChange = featureSearchChanges.find((featureItem) => {\r\n return featureItem.featureGuid.toLowerCase() === item.featureGuid.toLowerCase();\r\n });\r\n\r\n if (featureSearchChange === undefined) {\r\n featureSearchChanges.push({\r\n feature: item.feature,\r\n featureGuid: item.featureGuid,\r\n isHidden: item.isHidden,\r\n sequence: item.sequence\r\n });\r\n } else {\r\n featureSearchChange.isHidden = item.isHidden;\r\n }\r\n });\r\n\r\n // const feesBilledByPeriodVsBudgetChartGuid = \r\n // featureSearchChanges.find(feature => feature.featureGuid.toLowerCase() === ('C4A8B6C2-3D48-4BC5-8BF7-DB4B8AF8E118').toLowerCase());\r\n // // tslint:disable-next-line: no-console\r\n // console.log('Feature Inside Push Guid', feesBilledByPeriodVsBudgetChartGuid); \r\n\r\n // const feesBilledByPeriodVsBudgetChart = \r\n // featureSearchChanges.find(feature => feature.feature.toLowerCase() === ('FeesBilledByPeriodVsBudgetChart').toLowerCase());\r\n \r\n // // tslint:disable-next-line: no-console\r\n // console.log('Feature Inside Push', feesBilledByPeriodVsBudgetChart); \r\n\r\n this.setState({\r\n droppableRows: droppableRows,\r\n featureLayoutConfigurationList: isReOrder ? featureLayoutConfigList : featureLayoutConfigurationListCopy,\r\n featureSearchChanges: featureSearchChanges,\r\n isSearch: isSearch\r\n });\r\n } else {\r\n featureLayoutConfigurationListCopy.forEach((item: FeatureLayoutConfiguration) => {\r\n featureSearchChanges.forEach(featureSearch => {\r\n if (featureSearch.featureGuid.toLowerCase() === item.featureGuid.toLowerCase()) {\r\n featureSearch.isHidden = item.isHidden;\r\n }\r\n });\r\n });\r\n\r\n const feesBilledByPeriodVsBudgetChart = featureSearchChanges.find(feature => feature.feature.toLowerCase() === ('FeesBilledByPeriodVsBudgetChart').toLowerCase());\r\n \r\n // tslint:disable-next-line: no-console\r\n console.log('Feature Inside Update', feesBilledByPeriodVsBudgetChart);\r\n\r\n this.setState({\r\n droppableRows: droppableRows,\r\n featureLayoutConfigurationList: isReOrder ? featureLayoutConfigList : featureLayoutConfigurationListCopy,\r\n featureSearchChanges: featureSearchChanges,\r\n isSearch: isSearch === undefined ? false : isSearch\r\n });\r\n } \r\n\r\n if (isReOrder) {\r\n if (this.props.onDragEnd) {\r\n this.props.onDragEnd(featureLayoutConfigurationListCopy);\r\n }\r\n }\r\n }\r\n \r\n // tslint:disable-next-line: no-any\r\n private onDragEnd(result: any) {\r\n const {destination, source, draggableId} = result;\r\n\r\n if (!destination) {\r\n return;\r\n }\r\n\r\n if (destination.droppableId === source.droppableId &&\r\n destination.index === source.index) {\r\n return;\r\n }\r\n\r\n // Get current source object & with draggable feature\r\n const sourceDroppable = this.state.droppableRows.droppableRow.filter(x => x.id === source.droppableId);\r\n const draggableFeatures = sourceDroppable[0].featureList.filter( x => x.featureGuid === draggableId);\r\n const draggableFeature = draggableFeatures[0];\r\n\r\n // Get destination object\r\n const destinationDroppable = this.state.droppableRows.droppableRow.filter(x => x.id === destination.droppableId);\r\n\r\n // Remove from current source\r\n sourceDroppable[0].featureList.splice(source.index, 1); // Remove the draggable from it's previous location\r\n\r\n // Insert the draggable in the new destination\r\n destinationDroppable[0].featureList.splice(destination.index, 0, draggableFeature);\r\n\r\n // Select all features from rows into a object\r\n let featureLayoutConfigurationList: FeatureLayoutConfiguration[] = [];\r\n\r\n this.state.droppableRows.droppableRow.forEach(droppableRow => {\r\n droppableRow.featureList.forEach(featureLayout => {\r\n featureLayoutConfigurationList.push(featureLayout);\r\n }); \r\n });\r\n\r\n // call constuctRows again to order\r\n this.constructRows(featureLayoutConfigurationList, true, false, false, false);\r\n }\r\n\r\n private onIsHiddenUpdated(featureGuid: string, isHidden: boolean) {\r\n if (this.state.featureLayoutConfigurationList !== undefined) {\r\n let newfeatureLayoutConfigurationList = this.state.featureLayoutConfigurationList;\r\n let featureLayout = this.state.featureLayoutConfigurationList.filter(x => x.featureGuid === featureGuid);\r\n\r\n if (featureLayout.length > 0) {\r\n featureLayout[0].isHidden = isHidden;\r\n\r\n this.setState({\r\n featureLayoutConfigurationList: newfeatureLayoutConfigurationList\r\n });\r\n }\r\n\r\n this.constructRows(this.state.featureLayoutConfigurationList, false, false, true, false);\r\n\r\n if (this.props.onVisibilityChanged) {\r\n this.props.onVisibilityChanged();\r\n }\r\n }\r\n }\r\n}","import * as React from 'react';\r\nimport glamorous from 'glamorous';\r\nimport { RvContainer } from '../components/Container';\r\nimport { FeatureLayoutConfigurationHeader } from './FeatureLayoutConfigurationHeader';\r\nimport FeatureLayoutConfigurationControlPanel from './FeatureLayoutConfigurationControlPanel';\r\nimport { FeatureLayoutConfigurationList } from './FeatureLayoutConfigurationList';\r\nimport { FeatureLayoutConfiguration, UpdateFeatureLayoutConfigData, featureLayoutConfigSubscription, \r\n DeleteFeatureLayoutConfigData, \r\n fetchCurrentUserData,\r\n CurrentUserData } from './FeatureLayoutConfigurationRepository';\r\nimport { client } from '..';\r\nimport { showNotification, RouterProps } from '../App';\r\nimport { Subscription } from 'apollo-client/util/Observable';\r\nimport { MatterTerminology } from '../MatterTerminology';\r\nimport { IAutoCompleteItem } from '../typings/autoComplete';\r\n\r\nconst GridWrapper = glamorous.div<{theme?: object}>((props) => ({\r\n [`& .${`pushable`}`]: {\r\n overflow: 'visible',\r\n [`& .${`sidebar`}`]: {\r\n top: '0px !important',\r\n width: '500px !important'\r\n },\r\n },\r\n [`& .${`segment`}`]: {\r\n // overflow: 'visible',\r\n // top: '10px !important',\r\n padding: 0,\r\n // background: props.theme.NeutralColors.BackgroundGrey5\r\n } \r\n}));\r\n\r\nconst ContentWrapper = glamorous.div <{ theme?: object }>((props) => ({\r\n padding: '0 34px',\r\n '@media (max-width: 1024px)': {\r\n padding: 0\r\n }\r\n}));\r\n\r\n// tslint:disable-next-line:no-any\r\nconst StyledSummaryContent = glamorous.div <{ theme?: any }>((props) => ({\r\n borderRadius: '8px',\t\r\n backgroundColor: props.theme.NeutralColors.BackgroundWhite,\t\r\n boxShadow: '0 0 14px 0 ' + props.theme.NeutralColors.BackgroundGrey4,\r\n // height: window.innerHeight - 300,\r\n height: '100%'\r\n}));\r\n\r\nconst SummaryViewWrapper = glamorous.div<{ theme?: object }>((props) => ({\r\n paddingLeft: '30px',\r\n paddingRight: '30px',\r\n paddingBottom: '20px',\r\n}));\r\n\r\nexport enum TypeOfDashboard {\r\n firm = 0,\r\n lead = 1,\r\n feeEarner = 2,\r\n task = 3,\r\n client = 4\r\n}\r\n\r\nexport interface FeatureLayoutConfigurationProps extends RouterProps {\r\n // tslint:disable-next-line: no-any\r\n location: any;\r\n}\r\n\r\ninterface FeatureLayoutConfigurationState { \r\n layoutId: number; \r\n isInternalRole: boolean | null; // RoleCategory\r\n isAdministrator: boolean | null; // RoleCategory\r\n roleId: string | null;\r\n userEmail: string | null;\r\n isPersonal: boolean | null;\r\n featureLayoutConfigurationList: FeatureLayoutConfiguration[];\r\n filteredFeatureLayoutConfigurationList: FeatureLayoutConfiguration[];\r\n isSearchAgain: boolean;\r\n isSearchChanged: boolean;\r\n isHideAllOperation: boolean;\r\n dashboardPanel: IAutoCompleteItem | null;\r\n dashboardScope: string | null;\r\n personalise: boolean;\r\n isCurrentUserLoading: boolean;\r\n isInternalUser: boolean;\r\n userId: string | null;\r\n isInternalAdmin: boolean;\r\n}\r\n\r\nexport class FeatureLayoutConfigurationPage extends React.Component {\r\n private featureLayoutConfigurationSubscription: Subscription;\r\n private isSubscribed: boolean;\r\n private isShowFilterControls: boolean = true;\r\n private hasBack: boolean = true;\r\n\r\n constructor(props: FeatureLayoutConfigurationProps, state: FeatureLayoutConfigurationState) {\r\n super(props, state);\r\n \r\n this.onFeatureLayoutConfigurationFetch = this.onFeatureLayoutConfigurationFetch.bind(this);\r\n this.onSearchCriteriaChanged = this.onSearchCriteriaChanged.bind(this);\r\n this.onDragEnd = this.onDragEnd.bind(this);\r\n this.handleSave = this.handleSave.bind(this);\r\n this.handleReset = this.handleReset.bind(this);\r\n this.saveFeatureLayoutConfiguration = this.saveFeatureLayoutConfiguration.bind(this);\r\n this.deleteFeatureLayoutConfiguration = this.deleteFeatureLayoutConfiguration.bind(this);\r\n this.subscribeToFeatureLayoutConfig = this.subscribeToFeatureLayoutConfig.bind(this);\r\n this.onClickBack = this.onClickBack.bind(this);\r\n this.fetchCurrentUser = this.fetchCurrentUser.bind(this);\r\n this.onRetreivedCurrentUser = this.onRetreivedCurrentUser.bind(this);\r\n this.onVisibilityChanged = this.onVisibilityChanged.bind(this);\r\n\r\n this.isSubscribed = false;\r\n\r\n let personaliseStorage = sessionStorage.getItem('personalise');\r\n // let layoutId = sessionStorage.getItem('layoutId');\r\n let dashboardScope = sessionStorage.getItem('dashboardScope');\r\n let dashboardPanelValue = sessionStorage.getItem('dashboardPanelValue');\r\n let dashboardPanelLabel = sessionStorage.getItem('dashboardPanelLabel');\r\n\r\n let layoutId = props.location.state && props.location.state.layoutId ? props.location.state.layoutId : Number(sessionStorage.getItem('layoutId'));\r\n\r\n if (personaliseStorage === 'noback') {\r\n this.hasBack = false;\r\n }\r\n\r\n let dashboardPanel: IAutoCompleteItem | null = { label: 'Home', value: 'all' };\r\n\r\n if (dashboardPanelValue && dashboardPanelLabel ) {\r\n dashboardPanel = { label: dashboardPanelLabel, value: dashboardPanelValue };\r\n } \r\n \r\n this.state = {\r\n layoutId: props.location.state && props.location.state.layoutId ? props.location.state.layoutId : Number(layoutId),\r\n isInternalRole: null,\r\n isAdministrator: null,\r\n roleId: null,\r\n userEmail: null,\r\n isPersonal: dashboardScope === 'DashboardSecurityPersonal' ? true : null,\r\n featureLayoutConfigurationList: [],\r\n filteredFeatureLayoutConfigurationList: [],\r\n isSearchAgain: false,\r\n isSearchChanged: false,\r\n isHideAllOperation: false,\r\n dashboardPanel: dashboardPanel,\r\n dashboardScope: dashboardScope,\r\n personalise: personaliseStorage === 'noback',\r\n isCurrentUserLoading: true,\r\n isInternalUser: true,\r\n userId: null,\r\n isInternalAdmin: false\r\n };\r\n\r\n // After assigning the values, clear them from session storage\r\n sessionStorage.removeItem('layoutId');\r\n sessionStorage.removeItem('dashboardScope');\r\n sessionStorage.removeItem('dashboardPanelValue');\r\n sessionStorage.removeItem('dashboardPanelLabel');\r\n }\r\n\r\n // tslint:disable-next-line: no-empty\r\n public componentDidMount() {\r\n this.fetchCurrentUser();\r\n if (!this.isSubscribed) {\r\n this.isSubscribed = true;\r\n this.subscribeToFeatureLayoutConfig(); \r\n }\r\n }\r\n\r\n // tslint:disable-next-line: no-empty\r\n public componentWillUnmount() {\r\n if (this.featureLayoutConfigurationSubscription) {\r\n this.featureLayoutConfigurationSubscription.unsubscribe();\r\n } \r\n }\r\n\r\n // tslint:disable-next-line: no-empty\r\n public UNSAFE_componentWillReceiveProps(nextProps: FeatureLayoutConfigurationProps) {\r\n // let layoutId = sessionStorage.getItem('layoutId');\r\n // let dashboardScope = sessionStorage.getItem('dashboardScope');\r\n\r\n // this.setState({\r\n // layoutId: layoutId ? Number(layoutId) : 0,\r\n // dashboardScope: dashboardScope\r\n // }); \r\n }\r\n\r\n public render() { \r\n let title = MatterTerminology.FirmDashboardLayout;\r\n this.isShowFilterControls = true;\r\n\r\n if (this.state.layoutId === TypeOfDashboard.lead) {\r\n title = MatterTerminology.EnquiryDashboardLayout;\r\n } else if (this.state.layoutId === TypeOfDashboard.feeEarner) {\r\n title = MatterTerminology.FeeEarnerDashboardLayout;\r\n // this.isShowFilterControls = false;\r\n } else if (this.state.layoutId === TypeOfDashboard.task) {\r\n title = MatterTerminology.TaskDashboardLayout;\r\n } else if (this.state.layoutId === TypeOfDashboard.client) {\r\n title = MatterTerminology.ClientDashboardLayout;\r\n }\r\n\r\n // If the list is filtered using the search, then show filtered list\r\n const isSearch = this.state.featureLayoutConfigurationList.length !== this.state.filteredFeatureLayoutConfigurationList.length;\r\n\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {/* Control Panel or Controls */}\r\n \r\n \r\n \r\n {/* Draggable control */}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }\r\n\r\n private onClickBack() {\r\n this.props.history.goBack();\r\n }\r\n\r\n private onFeatureLayoutConfigurationFetch(\r\n featureLayoutConfigurationList: FeatureLayoutConfiguration[],\r\n filteredFeatureLayoutConfigurationList: FeatureLayoutConfiguration[],\r\n isHideAllOperation: boolean\r\n ) {\r\n \r\n this.setState({\r\n featureLayoutConfigurationList: featureLayoutConfigurationList,\r\n filteredFeatureLayoutConfigurationList: filteredFeatureLayoutConfigurationList,\r\n isSearchAgain: false,\r\n isSearchChanged: false,\r\n isHideAllOperation: isHideAllOperation\r\n });\r\n }\r\n\r\n private onSearchCriteriaChanged(\r\n layoutId: number, \r\n isInternalRole: boolean | null, \r\n isAdministrator: boolean | null,\r\n userEmail: string | null, \r\n roleId: string | null, \r\n isPersonal: boolean | null,\r\n dashboardPanel: IAutoCompleteItem | null,\r\n userId: string | null\r\n ) {\r\n\r\n // console.log(\r\n // 'dashboardPanel', dashboardPanel,\r\n // 'isInternalRole', isInternalRole,\r\n // 'isAdministrator', isAdministrator,\r\n // 'userEmail', userEmail,\r\n // 'roleId', roleId,\r\n // 'isPersonal', isPersonal,\r\n // );\r\n\r\n this.setState({\r\n isInternalRole: isInternalRole,\r\n isAdministrator: isAdministrator,\r\n userEmail: userEmail,\r\n roleId: roleId,\r\n isPersonal: isPersonal,\r\n dashboardPanel: dashboardPanel,\r\n isSearchChanged: true,\r\n userId: userId && userId.length > 0 ? userId : null,\r\n });\r\n }\r\n\r\n private onDragEnd(featureLayoutConfigurationList: FeatureLayoutConfiguration[]) {\r\n \r\n this.setState({\r\n featureLayoutConfigurationList: featureLayoutConfigurationList,\r\n // isConfigChanged: true\r\n });\r\n\r\n // sessionStorage.setItem(ChangedPageEnum.DashboardLayoutConfiguration, 'true');\r\n }\r\n\r\n private onVisibilityChanged() {\r\n this.setState({\r\n // isConfigChanged: true\r\n });\r\n // sessionStorage.setItem(ChangedPageEnum.DashboardLayoutConfiguration, 'true');\r\n }\r\n\r\n private handleSave() {\r\n this.saveFeatureLayoutConfiguration();\r\n }\r\n\r\n private handleReset() {\r\n this.deleteFeatureLayoutConfiguration();\r\n }\r\n \r\n private saveFeatureLayoutConfiguration() { \r\n if (this.state.featureLayoutConfigurationList !== undefined) {\r\n\r\n const featureLayoutConfigurationList = this.state.featureLayoutConfigurationList;\r\n const filteredFeatureLayoutConfigurationList = this.state.filteredFeatureLayoutConfigurationList;\r\n\r\n if (featureLayoutConfigurationList.length !== filteredFeatureLayoutConfigurationList.length) {\r\n filteredFeatureLayoutConfigurationList.forEach((filtered: FeatureLayoutConfiguration) => {\r\n \r\n const objIndex = featureLayoutConfigurationList.findIndex((obj => obj.featureGuid === filtered.featureGuid));\r\n\r\n featureLayoutConfigurationList[objIndex].isHidden = filtered.isHidden;\r\n \r\n });\r\n }\r\n\r\n // eslint-disable-next-line\r\n let featureLayoutConfigList = new Array();\r\n\r\n // To save the hidden features at the end of the list. \r\n const featureList = featureLayoutConfigurationList.filter((item: FeatureLayoutConfiguration) => {\r\n return !item.isHidden;\r\n });\r\n\r\n const hiddenFeatureList = featureLayoutConfigurationList.filter((item: FeatureLayoutConfiguration) => {\r\n return item.isHidden;\r\n });\r\n\r\n // eslint-disable-next-line array-callback-return\r\n featureList.map((featureLayout, index) => {\r\n featureLayoutConfigList.push(\r\n {\r\n featureGuid: featureLayout.featureGuid,\r\n sequence: index,\r\n isHidden: featureLayout.isHidden\r\n }\r\n );\r\n });\r\n\r\n // eslint-disable-next-line array-callback-return\r\n hiddenFeatureList.map((featureLayout, index) => {\r\n featureLayoutConfigList.push(\r\n {\r\n featureGuid: featureLayout.featureGuid,\r\n sequence: featureList.length + index,\r\n isHidden: featureLayout.isHidden\r\n }\r\n );\r\n });\r\n\r\n client.mutate({\r\n mutation: UpdateFeatureLayoutConfigData,\r\n variables: {\r\n featureLayoutConfigurationList: featureLayoutConfigList,\r\n layoutId: this.state.layoutId,\r\n isInternalRole: this.isShowFilterControls === false ? null : this.state.isInternalRole,\r\n isAdministrator: this.isShowFilterControls === false ? null : this.state.isAdministrator,\r\n roleId: this.isShowFilterControls === false ? null : this.state.roleId,\r\n userEmail: this.isShowFilterControls === false ? null : this.state.userEmail,\r\n isPersonal: this.isShowFilterControls === false ? true : this.state.isPersonal,\r\n dashboardPanelId: this.state.dashboardPanel ? this.state.dashboardPanel.value === 'all' ? null : this.state.dashboardPanel.value : null,\r\n userId: this.state.userId ? this.state.userId : null\r\n }\r\n }) // tslint:disable-next-line:no-any\r\n .then((results: { data: any; }) => { \r\n if (results.data) {\r\n if (results.data.error === null || results.data.error === undefined) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n } else {\r\n showNotification('Failed to Save Feature Layout Configuration', results.data.error, 'error'); \r\n }\r\n } \r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => { showNotification('Failed to Save Feature Layout Configuration', reason, 'error'); });\r\n }\r\n }\r\n\r\n private deleteFeatureLayoutConfiguration() { \r\n if (this.state.featureLayoutConfigurationList !== undefined) {\r\n client.mutate({\r\n mutation: DeleteFeatureLayoutConfigData,\r\n variables: {\r\n layoutId: this.state.layoutId,\r\n isInternalRole: this.isShowFilterControls === false ? null : this.state.isInternalRole,\r\n isAdministrator: this.isShowFilterControls === false ? null : this.state.isAdministrator,\r\n roleId: this.isShowFilterControls === false ? null : this.state.roleId,\r\n userEmail: this.isShowFilterControls === false ? null : this.state.userEmail,\r\n isPersonal: this.isShowFilterControls === false ? true : this.state.isPersonal,\r\n dashboardPanelId: this.state.dashboardPanel ? this.state.dashboardPanel.value === 'all' ? null : this.state.dashboardPanel.value : null\r\n }\r\n }) // tslint:disable-next-line:no-any\r\n .then((results: { data: any; }) => { \r\n if (results.data) {\r\n if (results.data.error === null || results.data.error === undefined) {\r\n showNotification(null, 'Successfully submitted', 'info'); \r\n } else {\r\n showNotification('Failed to Reset Feature Layout Configuration', results.data.error, 'error'); \r\n }\r\n } \r\n })\r\n // tslint:disable-next-line:no-any\r\n .catch((reason: any) => { showNotification('Failed to Reset Feature Layout Configuration', reason, 'error'); });\r\n }\r\n }\r\n\r\n private subscribeToFeatureLayoutConfig() {\r\n const vm = this; \r\n this.featureLayoutConfigurationSubscription = \r\n client.subscribe({\r\n query: featureLayoutConfigSubscription\r\n }).subscribe({\r\n // tslint:disable-next-line:no-any\r\n next(results: any) {\r\n if (results.data.featureLayoutConfigurationNotification.status) {\r\n showNotification('Success', results.data.featureLayoutConfigurationNotification.message, 'info');\r\n // Fetch again\r\n vm.setState({\r\n isSearchAgain: true,\r\n isHideAllOperation: false\r\n });\r\n } else {\r\n showNotification('Failed', results.data.featureLayoutConfigurationNotification.message, 'error');\r\n }\r\n }, \r\n // tslint:disable-next-line:no-any\r\n error(err: any) {\r\n // tslint:disable-next-line:no-console\r\n console.error(err);\r\n showNotification(null, err, 'error');\r\n }\r\n });\r\n }\r\n\r\n private fetchCurrentUser() {\r\n fetchCurrentUserData(\r\n false,\r\n (data: CurrentUserData) => this.onRetreivedCurrentUser(data),\r\n // tslint:disable-next-line: no-any\r\n function (reason: any): void {\r\n showNotification(null, reason, 'error');\r\n }\r\n );\r\n }\r\n\r\n private onRetreivedCurrentUser(data: CurrentUserData) {\r\n this.setState({\r\n\r\n isCurrentUserLoading: false,\r\n isInternalUser: data.appUser.isInternal,\r\n isInternalAdmin: data.appUser.isInternalAdmin\r\n });\r\n }\r\n}"],"sourceRoot":""}